:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-soft: rgba(99, 102, 241, .12);
  --proto: #4c68e0;
  --heading: #0b0f19;
  --body: #565973;
  --muted: #9397ad;
  --bg: #ffffff;
  --bg-secondary: #f3f6ff;
  --bg-tertiary: #eef1ff;
  --card: #ffffff;
  --border: #e2e5f1;
  --line: #e2e5f1;
  --ring: #eef0fb;
  --btn-secondary: #eff2fc;
  --btn-secondary-hover: #e4e8fb;
  --code-bg: #f6f7fb;
  --code-text: #33354d;
  --pre-bg: #0f1422;
  --pre-text: #e6e8f2;
  --shadow: 0 .275rem .75rem -.0625rem rgba(11, 15, 25, .06), 0 .125rem .4rem -.0625rem rgba(11, 15, 25, .03);
  --shadow-lg: 0 .3rem 1.525rem -.375rem rgba(11, 15, 25, .1), 0 .25rem .8125rem -.125rem rgba(11, 15, 25, .06);
  --hero-grad: radial-gradient(110% 115% at 50% 100%, rgba(99, 102, 241, .10) 0%, rgba(218, 70, 239, .05) 40%, rgba(241, 244, 253, .08) 80%);
  --f3-ink: #192c32;
  --f3-accent: #146c75;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-proto: "Fira Sans", "Manrope", system-ui, sans-serif;
  --font-brand: "Unbounded", "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --container: 1040px;
  --radius: .75rem;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --primary: #7c7ff5;
  --primary-hover: #9a9cf8;
  --primary-soft: rgba(124, 127, 245, .16);
  --proto: #7d93ff;
  --heading: #ffffff;
  --body: rgba(255, 255, 255, .72);
  --muted: rgba(255, 255, 255, .5);
  --bg: #0b0f19;
  --bg-secondary: #121723;
  --bg-tertiary: #171d2b;
  --card: #151a27;
  --border: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .14);
  --ring: rgba(255, 255, 255, .06);
  --btn-secondary: rgba(255, 255, 255, .06);
  --btn-secondary-hover: rgba(255, 255, 255, .12);
  --code-bg: rgba(255, 255, 255, .08);
  --code-text: #e6e8f2;
  --pre-bg: #070a12;
  --shadow: 0 .275rem .75rem -.0625rem rgba(0, 0, 0, .35);
  --shadow-lg: 0 .3rem 1.525rem -.375rem rgba(0, 0, 0, .5);
  --hero-grad: radial-gradient(110% 115% at 50% 100%, rgba(99, 102, 241, .18) 0%, rgba(218, 70, 239, .07) 40%, rgba(11, 15, 25, 0) 80%);
  --f3-ink: #e9f1f3;
  --f3-accent: #3fb2bd;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
h1, h2, h3, h4, h5, h6 { color: var(--heading); font-weight: 800; line-height: 1.3; margin: 0 0 1rem; }
p { margin: 0 0 1rem; }
a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
img, svg { vertical-align: middle; }
strong, b { font-weight: 700; color: var(--heading); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.container { width: 100%; max-width: calc(var(--container) + 2rem); margin: 0 auto; padding: 0 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-brand); font-weight: 800; font-size: 1.28rem; letter-spacing: .06em;
  color: var(--primary); text-decoration: none !important; line-height: 1;
}
.brand:hover { color: var(--primary-hover); }
.brand small { font-family: var(--font); font-weight: 700; font-size: .85rem; letter-spacing: 0; color: var(--heading); }

.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 20; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 46px; }
.header-actions { display: flex; align-items: center; gap: 1rem; }

.theme-switch { display: inline-flex; align-items: center; gap: .55rem; font-size: .875rem; font-weight: 600; color: var(--heading); cursor: pointer; user-select: none; background: none; border: 0; padding: 0; }
.theme-switch .lbl { opacity: 1; transition: opacity .2s; }
.theme-switch .lbl-dark { color: var(--body); font-weight: 500; }
:root[data-theme="dark"] .theme-switch .lbl-light { color: var(--body); font-weight: 500; }
:root[data-theme="dark"] .theme-switch .lbl-dark { color: var(--heading); font-weight: 600; }
.theme-switch .track { position: relative; width: 36px; height: 20px; border-radius: 20px; background: var(--primary); transition: background .2s; }
.theme-switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
:root[data-theme="dark"] .theme-switch .track::after { transform: translateX(16px); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 0; border-radius: .375rem; font-weight: 600; cursor: pointer; text-decoration: none !important; transition: background .15s, color .15s, box-shadow .15s; }
.btn-lang { background: var(--primary); color: #fff !important; font-size: .7rem; padding: .3rem .5rem; line-height: 1; }
.btn-lang:hover { background: var(--primary-hover); }
.btn-soft { background: var(--btn-secondary); color: var(--heading) !important; font-size: .8rem; padding: .45rem 1rem; }
.btn-soft:hover { background: var(--btn-secondary-hover); }
.btn-help { display: none; background: transparent; color: var(--heading) !important; padding: 0; }

.hero { background: var(--hero-grad); padding: 7.5rem 0 5.5rem; }
.hero .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: 2.25rem; line-height: 1.33; margin-bottom: 1.75rem; max-width: 30rem; }
.hero p { font-size: 1rem; font-weight: 400; max-width: 30rem; margin-bottom: 1rem; }
.protocols { display: flex; flex-direction: column; align-items: center; font-family: var(--font-proto); font-weight: 700; color: var(--proto); line-height: .98; user-select: none; }
.protocols span { display: block; letter-spacing: -.01em; }
.protocols .p-wg { font-size: 4.4rem; }
.protocols .p-ovpn { font-size: 4.4rem; margin-left: -.9rem; }
.protocols .row { display: flex; align-items: flex-start; gap: .6rem; }
.protocols .p-ike { font-size: 4.4rem; }
.protocols .p-ss { font-size: 2.05rem; padding-top: .45rem; }
.protocols .p-xray { font-size: 4.4rem; margin-left: -2.2rem; }
.protocols .p-awg { font-size: 4.4rem; margin-left: 1rem; }

.section { padding: 3rem 0; }
.section-title { text-align: center; font-size: 2rem; margin-bottom: 1.1rem; }
.section-sub { text-align: center; font-size: .95rem; margin-bottom: 0; }

.steps { position: relative; margin-top: 3.5rem; }
.step { position: relative; display: grid; grid-template-columns: 96px 1fr; column-gap: 4.5rem; align-items: center; padding-bottom: 5.5rem; }
.step:last-child { padding-bottom: 1rem; }
.step::before { content: ""; position: absolute; left: 48px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.step:first-child::before { top: 50%; }
.step:last-child::before { bottom: 50%; }
.step-number { position: relative; z-index: 1; width: 96px; height: 96px; border-radius: 50%; background: var(--ring); display: flex; align-items: center; justify-content: center; }
.step-number span { width: 70px; height: 70px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; color: var(--heading); }
.step-body h3 { font-size: 1.2rem; margin-bottom: .9rem; }
.step-body .label { font-size: .85rem; font-weight: 700; color: var(--heading); margin-bottom: .6rem; }
.step-body p.note { font-size: .88rem; margin: -.2rem 0 1rem; max-width: 32rem; }
.step-body p.hosting-intro { max-width: none; }
.dotlist { margin: 0; padding-left: 1.5rem; font-size: .82rem; line-height: 1.85; }
.dotlist li::marker { color: var(--heading); }
.dotlist strong { font-weight: 700; }

.f3-logo { display: inline-flex; align-items: baseline; font-family: var(--font); font-weight: 800; font-size: 2.35rem; line-height: 1; letter-spacing: -.02em; margin-bottom: 1rem; text-decoration: none !important; }
.f3-logo .f3 { color: var(--f3-accent); }
.f3-logo .cloud { color: var(--f3-ink); }

.badges { display: grid; grid-template-columns: repeat(2, 135px); gap: .9rem 1.2rem; }
.badge { display: flex; align-items: center; gap: .55rem; height: 41px; padding: 0 .7rem; border-radius: .45rem; background: #0b0f19; color: #fff !important; text-decoration: none !important; border: 1px solid #0b0f19; transition: transform .15s, box-shadow .15s; }
:root[data-theme="dark"] .badge { background: #fff; color: #0b0f19 !important; border-color: #fff; }
.badge:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.badge svg { flex: 0 0 auto; width: 22px; height: 22px; }
.badge .t { display: flex; flex-direction: column; line-height: 1; white-space: nowrap; }
.badge .t small { font-size: .5rem; font-weight: 600; letter-spacing: .01em; margin-bottom: 2px; }
.badge .t b { color: inherit; font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; }
.badge.apk .t b { font-size: .88rem; font-weight: 500; }

.phones { display: flex; gap: .55rem; margin: 1rem 0 1.4rem; flex-wrap: wrap; }
.phone { width: 219px; height: 422px; border-radius: .35rem; background: #0e0e11; color: #fff; padding: 1rem .25rem .5rem; font-size: .5rem; line-height: 1.4; overflow: hidden; box-shadow: var(--shadow); font-family: "Manrope", system-ui, sans-serif; }
.phone .ph-title { font-size: 1.05rem; font-weight: 600; margin: 0 .2rem .9rem; display: flex; justify-content: space-between; align-items: center; }
.phone .ph-hint { font-size: .5rem; color: #e6e6e6; margin: 0 .2rem .9rem; }
.phone .ph-key { display: flex; margin-bottom: 1.4rem; }
.phone .ph-key .in { flex: 1; background: #1c1d21; border-radius: .25rem 0 0 .25rem; height: 40px; padding: .6rem .5rem; color: #7c7c80; font-size: .42rem; }
.phone .ph-key .go { width: 42px; background: #d7d8db; color: #0e0e11; border-radius: 0 .25rem .25rem 0; display: flex; align-items: center; justify-content: center; font-size: .5rem; font-weight: 600; }
.phone .ph-sub { color: #3d3d42; font-size: .45rem; margin: 0 .2rem .9rem; }
.phone .ph-opt { display: flex; align-items: center; gap: .6rem; background: #1c1d21; border-radius: .3rem; padding: .7rem .55rem; margin-bottom: .55rem; min-height: 52px; }
.phone .ph-opt .ic { width: 12px; height: 12px; flex: 0 0 auto; color: #d7d8db; }
.phone .ph-opt .tx { flex: 1; font-size: .54rem; color: #f2f2f2; }
.phone .ph-opt .tx em { display: block; font-style: normal; color: #85858a; font-size: .4rem; margin-top: .15rem; }
.phone .ph-opt .ch { color: #d7d8db; font-size: .7rem; }
.phone .back { font-size: .8rem; margin: -.3rem .2rem .45rem; }
.phone .field { background: #1c1d21; border-radius: .25rem; padding: .45rem .55rem; margin-bottom: .55rem; min-height: 40px; }
.phone .field small { display: block; font-size: .36rem; color: #85858a; margin-bottom: .2rem; }
.phone .field span { font-size: .5rem; color: #f2f2f2; }
.phone .pw { display: flex; gap: 0; }
.phone .pw .field { flex: 1; border-radius: .25rem 0 0 .25rem; }
.phone .pw .eye { width: 42px; background: #d7d8db; border-radius: 0 .25rem .25rem 0; margin-bottom: .55rem; display: flex; align-items: center; justify-content: center; color: #0e0e11; }
.phone .cta { background: #d7d8db; color: #0e0e11; text-align: center; border-radius: .3rem; padding: .6rem; font-size: .5rem; font-weight: 600; margin: .3rem 0 .7rem; border: 2px solid #fff; }
.phone .priv { font-size: .38rem; color: #85858a; margin: 0 .2rem .5rem; }
.step-body p.after { font-size: .9rem; margin: 0; }

.features { background: var(--bg-secondary); padding: 3.75rem 0 4rem; }
.features .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.feature { padding: 2.25rem 2.25rem 2.4rem; background: var(--card); border-radius: 1.25rem; box-shadow: 0 1px 2px rgba(11, 15, 25, .04), 0 12px 28px -22px rgba(11, 15, 25, .22); }
:root[data-theme="dark"] .feature { box-shadow: inset 0 0 0 1px var(--border); }
.feature .ic { display: block; margin-bottom: 1.4rem; color: var(--primary); }
.feature .ic svg { width: 28px; height: 28px; }
.feature h3 { font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: .5rem; }
.feature p { font-size: .9rem; line-height: 1.65; margin: 0; }
.feature a { color: var(--body); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.feature a:hover { color: var(--primary); text-decoration-color: currentColor; }

.cmp-wrap { overflow-x: auto; margin-top: 2.5rem; }
.cmp { width: 100%; min-width: 620px; border-collapse: separate; border-spacing: 0; font-size: .9rem; background: var(--card); border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; }
.cmp th, .cmp td { padding: .95rem 1.15rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.cmp thead th { background: var(--bg-secondary); color: var(--heading); font-size: .85rem; font-weight: 800; }
.cmp thead th:nth-child(2) { color: var(--primary); }
.cmp tbody th { width: 24%; font-weight: 600; color: var(--heading); }
.cmp tbody tr:last-child th, .cmp tbody tr:last-child td { border-bottom: 0; }

.guide-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem 1rem; margin: 2.5rem 0 0; padding: 0; }
.guide-list a { display: block; padding: .7rem .95rem; border-radius: .55rem; background: var(--bg-secondary); color: var(--heading); font-size: .88rem; font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.guide-list a:hover { background: var(--primary-soft); color: var(--primary); }
.guide-list a::after { content: " →"; color: var(--muted); }

.step-body p.dl-note { font-size: .82rem; color: var(--muted); max-width: 34rem; margin: .9rem 0 0; }

.faq { padding: 3.5rem 0 3rem; }
.faq .section-title { text-align: left; font-size: 2rem; letter-spacing: -.01em; margin-bottom: 1.6rem; }
.accordion { background: var(--card); border: 1px solid var(--border); border-radius: 1.1rem; box-shadow: 0 1px 3px rgba(11, 15, 25, .04); overflow: hidden; }
.acc-item { border-top: 1px solid var(--border); }
.acc-item:first-child { border-top: 0; }
.acc-item h3 { margin: 0; }
.acc-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; background: none; border: 0; padding: 1.4rem 2rem; text-align: left; font-size: 1rem; font-weight: 500; line-height: 1.45; color: var(--heading); cursor: pointer; transition: background .15s; }
.acc-btn:hover { background: var(--bg-secondary); }
.acc-btn .chev { flex: 0 0 auto; display: flex; color: var(--muted); transition: transform .25s ease, color .2s; }
.acc-btn .chev svg { width: 18px; height: 18px; stroke-width: 2; }
.acc-btn[aria-expanded="true"] .chev { transform: rotate(180deg); color: var(--primary); }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.acc-panel > div { overflow: hidden; }
.acc-item.open .acc-panel { grid-template-rows: 1fr; }
.acc-panel p { margin: 0; padding: 0 2rem 1.5rem; font-size: .95rem; line-height: 1.65; }

.site-footer { text-align: center; padding: 4.5rem 0 3rem; }
.site-footer .mascot { width: 150px; height: auto; display: block; margin: 0 auto -.3rem; }
.site-footer .brand { font-size: 1.35rem; }
.site-footer .legal { margin-top: 4.2rem; font-size: .78rem; }
.site-footer .legal a { text-decoration: underline; }
.site-footer .disclaimer { max-width: 40rem; margin: .6rem auto 0; font-size: .72rem; color: var(--muted); }

.to-top { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 30; display: flex; align-items: center; gap: .5rem; opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .25s ease; color: var(--muted); font-size: .8rem; text-decoration: none !important; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top .circ { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); }
.to-top:hover .circ { background: var(--primary-hover); }

@media (max-width: 991px) {
  .hero { padding: 6rem 0 3.5rem; }
  .hero .grid { grid-template-columns: 1fr; }
  .hero h1, .hero p { text-align: center; margin-left: auto; margin-right: auto; }
  .protocols .p-wg, .protocols .p-ovpn, .protocols .p-ike, .protocols .p-xray, .protocols .p-awg { font-size: 3.4rem; }
  .protocols .p-ss { font-size: 1.6rem; }
  .step { column-gap: 2rem; }
  .guide-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .theme-switch .lbl { display: none; }
  .btn-soft.docs-btn { display: none; }
  .btn-help { display: inline-flex; }
  .hero h1 { font-size: 1.7rem; }
  .protocols .p-wg, .protocols .p-ovpn, .protocols .p-ike, .protocols .p-xray, .protocols .p-awg { font-size: 2.55rem; }
  .protocols .p-ss { font-size: 1.2rem; padding-top: .3rem; }
  .protocols .p-xray { margin-left: -1.2rem; }
  .section-title { font-size: 1.6rem; }
  .step { grid-template-columns: 1fr; row-gap: 1.2rem; padding-bottom: 3.5rem; }
  .step::before { display: none; }
  .step-number { width: 72px; height: 72px; margin: 0 auto; }
  .step-number span { width: 52px; height: 52px; font-size: 1.2rem; }
  .step-body { text-align: center; }
  .step-body .label, .step-body p.note { text-align: center; margin-left: auto; margin-right: auto; }
  .dotlist { display: inline-block; text-align: left; }
  .badges { justify-content: center; }
  .phones { justify-content: center; }
  .features .grid { grid-template-columns: 1fr; }
  .feature { padding: 1.4rem; }
  .guide-list { grid-template-columns: 1fr; }
  .step-body p.dl-note { text-align: left; }
  .faq .section-title { font-size: 1.6rem; }
  .acc-btn { padding: 1.1rem 1.2rem; font-size: .95rem; gap: 1rem; }
  .acc-panel p { padding: 0 1.2rem 1.2rem; font-size: .9rem; }
}
@media (max-width: 380px) {
  .badges { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .badge { padding: 0 .5rem; }
  .badge .t b { font-size: .9rem; }
  .phone { width: 100%; max-width: 280px; }
}
