/* ============================================================
   VPNFP base.css
   Design tokens / reset / typography / buttons / header / footer
   shared primitives / reveal / toc / breakpoints
   ============================================================ */

:root{
  /* -- palette ------------------------------------------------ */
  --bg:#131110;
  --bg-panel:#1B1815;
  --bg-panel2:#242019;
  --border:#2E2922;
  --accent:#3FC1E4;
  --accent-dark:#1E8FB2;
  --text:#F2EEE6;
  --text-muted:#A69E90;
  --success:#5BD6A2;
  --warn:#E8B45A;
  --error:#E86A5A;
  --ink-on-accent:#0F1B1E;
  --accent-glow:rgba(63,193,228,.38);
  --accent-glow-soft:rgba(63,193,228,.12);
  --line-faint:rgba(242,238,230,.035);
  --flag-red:#C0524A;
  --flag-blue:#3D5A9E;
  --flag-white:#F2EEE6;
  /* -- fonts -------------------------------------------------- */
  --font-display:'Inter','Noto Sans SC','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  --font-body:'Inter','Noto Sans SC','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  --font-mono:'JetBrains Mono','SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace;
  /* -- geometry ----------------------------------------------- */
  --r-s:6px;
  --r-m:10px;
  --r-pill:999px;
  --gutter:32px;
  --head-h:64px;
  --maxw:1240px;
}

/* ============================================================
   Reset & base
   ============================================================ */
*{margin:0;padding:0;box-sizing:border-box}
html{
  scroll-behavior:smooth;
  scroll-padding-top:calc(var(--head-h) + 16px);
}
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.6;
  overflow-x:hidden;
}
/* paper-grain overlay, 0.05 opacity, fixed full-screen */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:40;
  pointer-events:none;
  opacity:.05;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  background-size:160px 160px;
}
a{text-decoration:none;color:inherit}
img{max-width:100%;height:auto}
button{font:inherit;color:inherit;background:none;border:none;cursor:pointer}
ul,ol{list-style-position:outside}
summary{cursor:pointer}
.no-break{white-space:nowrap}
code{overflow-wrap:anywhere;word-break:break-word}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
::selection{background:var(--accent);color:var(--ink-on-accent)}

html.nav-open{overflow:hidden}

/* ============================================================
   Layout primitives
   ============================================================ */
.wrap{
  max-width:var(--maxw);
  margin-inline:auto;
  padding-inline:var(--gutter);
}
/* section rhythm: vertical padding only, never zero the gutters */
.sec{padding-top:72px;padding-bottom:72px}
.sec-tight{padding-top:48px;padding-bottom:48px}
.sec-panel{
  background:var(--bg-panel);
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
}
.sec-head{
  max-width:760px;
  margin:0 auto 44px;
  text-align:center;
}
.kicker{
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:.2em;
  color:var(--text-muted);
  margin-bottom:12px;
}
.panel{
  background:var(--bg-panel);
  border:1px solid var(--border);
  border-radius:var(--r-m);
}
.panel-2{
  background:var(--bg-panel2);
  border:1px solid var(--border);
  border-radius:var(--r-m);
}
/* decorative tilt: neutralised on narrow screens (overflow guard) */
.tilt{transform:rotate(-.45deg)}

/* ============================================================
   Typography
   ============================================================ */
h1,h2,h3,h4{
  font-family:var(--font-display);
  font-weight:700;
  line-height:1.25;
  color:var(--text);
  text-wrap:balance;
}
h1{
  font-size:clamp(34px,4.4vw,46px);
  font-weight:800;
  line-height:1.2;
  margin:0 0 .5em;
}
h2{
  font-size:clamp(24px,3vw,30px);
  margin:0 0 .6em;
}
h3{
  font-size:20px;
  margin:0 0 .5em;
}
h4{font-size:16.5px;margin:0 0 .4em}
p{margin:0 0 1em}
strong{color:var(--text);font-weight:600}
em{color:var(--text-muted);font-style:normal}

/* long-form prose (guides, blog articles, help pages) */
.prose{font-size:15.5px;line-height:1.85;color:var(--text-muted)}
.prose p{margin:0 0 1.1em}
.prose h2{font-size:25px;margin:2.2em 0 .7em}
.prose h3{font-size:19px;margin:1.8em 0 .6em}
.prose h2,.prose h3{color:var(--text)}
.prose ul,.prose ol{padding-left:1.5em;margin:0 0 1.1em}
.prose li{margin:.4em 0}
.prose strong{color:var(--text)}
.prose a{color:var(--accent)}
/* buttons inside prose keep their own colors — the prose link rule
   (equal-or-higher specificity) must not dye them accent-on-accent */
.prose .btn-primary{color:var(--ink-on-accent);text-decoration:none}
.prose .btn-ghost{color:var(--text);text-decoration:none}
.prose code{
  font-family:var(--font-mono);
  font-size:.86em;
  background:var(--bg-panel2);
  border:1px solid var(--border);
  border-radius:4px;
  padding:.1em .4em;
  overflow-wrap:anywhere;
}
.prose pre{
  background:var(--bg-panel);
  border:1px solid var(--border);
  border-radius:var(--r-m);
  padding:16px 18px;
  overflow-x:auto;
  margin:0 0 1.3em;
}
.prose pre code{background:none;border:none;padding:0;white-space:pre;overflow-wrap:normal}
/* bare-table defence: a loose <table class="data-table"> inside prose
   must scroll, never stretch the page */
.prose > .data-table{
  display:block;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  max-width:100%;
  min-width:0;
}
/* numbered step lists */
.prose ol.steps{list-style:none;counter-reset:step;padding-left:0}
.prose ol.steps > li{
  counter-increment:step;
  position:relative;
  padding-left:44px;
  margin:1.1em 0;
}
.prose ol.steps > li::before{
  content:counter(step);
  position:absolute;
  left:0;
  top:3px;
  width:28px;
  height:28px;
  border-radius:50%;
  border:1px solid var(--accent-dark);
  color:var(--accent);
  font-family:var(--font-mono);
  font-size:13px;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-family:var(--font-display);
  font-size:15px;
  font-weight:700;
  border-radius:var(--r-s);
  padding:13px 34px;
  min-height:48px;
  transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;
}
.btn-primary{
  background:var(--accent);
  color:var(--ink-on-accent);
  box-shadow:0 0 26px var(--accent-glow);
}
.btn-primary:hover{
  transform:translateY(-1px);
  box-shadow:0 0 38px var(--accent-glow);
}
.btn-ghost{
  color:var(--text);
  background:var(--bg-panel);
  border:1px solid var(--border);
}
.btn-ghost:hover{
  transform:translateY(-1px);
  border-color:var(--accent-dark);
}
.btn-sm{
  padding:9px 20px;
  font-size:13.5px;
  min-height:38px;
}
.btn-login{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  font-weight:600;
  color:var(--accent);
  border:1px solid var(--accent-dark);
  border-radius:var(--r-s);
  padding:7px 18px;
  min-height:34px;
  transition:background .15s ease,color .15s ease,box-shadow .15s ease;
}
.btn-login:hover{
  background:var(--accent);
  color:var(--ink-on-accent);
  box-shadow:0 0 18px var(--accent-glow);
}

/* ============================================================
   Header (injected by header.js)
   ============================================================ */
.site-head{
  border-bottom:1px solid var(--border);
  background:var(--bg);
  position:relative;
  z-index:60;
}
.head-inner{
  max-width:1280px;
  margin:0 auto;
  height:var(--head-h);
  padding:0 32px;
  display:flex;
  align-items:center;
  gap:32px;
}
.brand{display:flex;align-items:center;gap:10px;flex:none}
.brand img{width:30px;height:30px;flex:none}
.brand-name{
  font-family:var(--font-display);
  font-weight:800;
  font-size:18px;
  letter-spacing:.02em;
  color:var(--text);
}
/* semantic wrapper around the desktop nav list; keeps the
   right-aligned slot inside .head-inner */
.head-nav{margin-left:auto}
/* dot-separated one-line nav */
.nav-list{
  list-style:none;
  display:flex;
  align-items:center;
  font-size:14px;
}
.nav-list li{display:flex;align-items:center}
.nav-list li + li::before{
  content:"·";
  color:var(--border);
  margin:0 13px;
  font-weight:700;
}
.nav-list a{color:var(--text-muted);transition:color .15s ease;padding:6px 0}
.nav-list a:hover{color:var(--text)}
.nav-list a.is-active{color:var(--text);font-weight:600}
.head-ctrl{display:flex;align-items:center;gap:16px;flex:none}

/* language dropdown */
.lang-drop{position:relative}
.lang-switch{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:13px;
  color:var(--text-muted);
  padding:8px 4px;
  min-height:34px;
}
.lang-switch:hover{color:var(--text)}
.lang-switch svg{flex:none}
.lang-menu{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  list-style:none;
  background:var(--bg-panel2);
  border:1px solid var(--border);
  border-radius:var(--r-m);
  min-width:132px;
  padding:6px;
  display:none;
  box-shadow:0 12px 32px rgba(0,0,0,.45);
  z-index:70;
}
.lang-drop.open .lang-menu{display:block}
.lang-menu a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 12px;
  font-size:13px;
  color:var(--text-muted);
  border-radius:var(--r-s);
  min-height:36px;
}
.lang-menu a:hover{color:var(--text);background:var(--bg-panel)}
.lang-menu a.is-cur{color:var(--accent)}

/* hamburger: hidden on desktop */
.nav-toggle{
  display:none;
  width:44px;
  height:44px;
  align-items:center;
  justify-content:center;
  margin-right:-10px;
  color:var(--text-muted);
}
.nav-toggle:hover{color:var(--text)}
.nav-toggle svg{flex:none}

/* mobile drawer: solid background, full-row tap targets */
.drawer{
  display:none;
  position:fixed;
  top:var(--head-h);
  left:0;
  right:0;
  max-height:calc(100dvh - var(--head-h));
  overflow-y:auto;
  overscroll-behavior:contain;
  background:var(--bg);
  border-bottom:1px solid var(--border);
  z-index:90;
  padding:8px 20px 26px;
}
html.nav-open .drawer{display:block}
.drawer ul{list-style:none}
.drawer .d-link{
  display:flex;
  align-items:center;
  min-height:48px;
  padding:12px 4px;
  font-size:15px;
  color:var(--text);
  border-bottom:1px solid var(--line-faint);
}
.drawer .d-link.is-active{color:var(--accent);font-weight:600}
.drawer .d-cap{
  font-family:var(--font-mono);
  font-size:11px;
  letter-spacing:.18em;
  color:var(--text-muted);
  opacity:.7;
  margin:18px 0 4px;
}
.drawer .d-lang{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:10px 4px;
  font-size:14px;
  color:var(--text-muted);
}
.drawer .d-lang.is-cur{color:var(--accent)}
.nav-veil{
  display:none;
  position:fixed;
  inset:var(--head-h) 0 0 0;
  background:rgba(0,0,0,.55);
  z-index:80;
}
html.nav-open .nav-veil{display:block}

/* ============================================================
   Footer (injected by footer.js)
   ============================================================ */
.site-foot{
  border-top:1px solid var(--border);
  background:var(--bg-panel);
}
.foot-grid{
  display:grid;
  grid-template-columns:1.5fr 1fr 1fr 1fr;
  gap:40px;
  padding-top:56px;
  padding-bottom:44px;
}
.foot-cap{
  font-family:var(--font-mono);
  font-size:11px;
  letter-spacing:.18em;
  color:var(--text-muted);
  opacity:.75;
  margin-bottom:14px;
}
.foot-brand .brand{margin-bottom:14px}
.foot-intro{
  font-size:13.5px;
  color:var(--text-muted);
  line-height:1.75;
  max-width:36ch;
}
.foot-nav ul,.foot-hot ul,.foot-lang ul{
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.foot-nav a,.foot-hot a,.foot-lang a{
  display:block;
  padding:6px 0;
  font-size:13.5px;
  color:var(--text-muted);
  transition:color .15s ease;
}
.foot-nav a:hover,.foot-hot a:hover,.foot-lang a:hover{color:var(--text)}
.foot-lang a.is-cur{color:var(--accent)}
.foot-bottom{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-top:1px solid var(--border);
  padding-top:20px;
  padding-bottom:24px;
}
.foot-copy{
  font-family:var(--font-mono);
  font-size:13px;
  color:var(--text-muted);
}
.foot-legal{list-style:none;display:flex;flex-wrap:wrap;gap:18px}
.foot-legal a{
  font-size:13px;
  color:var(--text-muted);
  transition:color .15s ease;
}
.foot-legal a:hover{color:var(--text)}

/* ============================================================
   Reveal on scroll (logic in reveal.js)
   Default state is VISIBLE; .pending is the hidden state.
   ============================================================ */
.reveal{transition:opacity .6s ease,transform .6s ease}
.reveal.pending{opacity:0;transform:translateY(16px)}

/* ============================================================
   Sticky table of contents (.toc-tabs)
   ============================================================ */
.toc-tabs{
  position:sticky;
  top:12px;
  z-index:30;
  display:flex;
  gap:8px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  padding:6px;
  background:var(--bg-panel);
  border:1px solid var(--border);
  border-radius:var(--r-pill);
}
.toc-tabs a{
  flex:none;
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:7px 16px;
  border-radius:var(--r-pill);
  font-size:13.5px;
  color:var(--text-muted);
  white-space:nowrap;
  transition:color .15s ease,background .15s ease;
}
.toc-tabs a:hover{color:var(--text)}
.toc-tabs a.is-current{
  background:var(--bg-panel2);
  color:var(--accent);
  box-shadow:inset 0 0 0 1px var(--accent-dark);
}
body:has(.toc-tabs) section[id],
body:has(.toc-tabs) h2[id],
body:has(.toc-tabs) h3[id]{
  scroll-margin-top:calc(var(--head-h) + 24px);
}

/* ============================================================
   Breakpoints
   ============================================================ */
@media (max-width:960px){
  :root{--gutter:24px}
  .head-nav,.nav-list{display:none}
  .nav-toggle{display:inline-flex}
  .head-ctrl{margin-left:auto}
  .head-inner{padding:0 20px;gap:14px}
  .sec{padding-top:56px;padding-bottom:56px}
  .foot-grid{grid-template-columns:1fr 1fr;gap:32px}
}
@media (max-width:640px){
  :root{--gutter:20px}
  .lang-drop{display:none}
  .foot-grid{grid-template-columns:1fr}
  .foot-bottom{flex-direction:column;align-items:flex-start}
  .tilt{transform:none}
}
@media (max-width:480px){
  .hero h1{font-size:32px}
}

/* ============================================================
   Reduced motion: loops stop, sparks hidden, reveal forced visible
   ============================================================ */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none !important;transition:none !important}
  .spark{display:none}
  .reveal,.reveal.pending{opacity:1;transform:none}
}