/* ==========================================================================
   NZVPN Design System · base.css
   Design tokens, reset, typography, layout, buttons, header, footer, reveal
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Palette */
  --bg: #FFFFFF;
  --bg-panel: #F6FAF9;
  --bg-panel2: #EBF3F0;
  --border: #DFE8E5;
  --border-strong: #C8D6D1;
  --accent: #17BE9C;
  --accent-dark: #0D8F73;
  --accent-deep: #0A6B57;
  --text: #14211D;
  --muted: #5C6B66;
  --faint: #8A9792;
  --success: #1E9E6A;
  --warn: #D9820F;
  --error: #D64545;
  --mist: #EBF7F4;
  --tint: #DCF4EC;
  --tint2: #EFFAF6;

  /* Flag colors */
  --f-red: #D8342C;
  --f-canton: #3C3F77;
  --f-navy: #20315F;
  --f-white: #FFFFFF;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-soft: 0 10px 30px rgba(20, 33, 29, 0.06);
  --shadow-lift: 0 16px 40px rgba(20, 33, 29, 0.10);
  --shadow-btn: 0 6px 18px rgba(23, 190, 156, 0.28);

  /* Layout */
  --wrap: 1240px;
  --wrap-narrow: 1080px;
  --gutter: 32px;
  --head-h: 64px;

  /* 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', monospace;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--head-h) + 16px);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

a {
  text-decoration: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(52px, 5.5vw, 72px);
  font-weight: 900;
  letter-spacing: -0.022em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h3 {
  font-size: 22px;
  font-weight: 700;
}

h4 {
  font-size: 18px;
  font-weight: 700;
}

p {
  line-height: 1.7;
}

.lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
}

.no-break {
  white-space: nowrap;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.wrap-narrow {
  max-width: var(--wrap-narrow);
  padding-inline: var(--gutter);
}

.sec {
  padding-top: 72px;
  padding-bottom: 72px;
}

.sec-tight {
  padding-top: 48px;
  padding-bottom: 48px;
}

.sec-flush {
  padding-top: 0;
}

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

/* ---------- Buttons ---------- */
.btn-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 34px;
  border-radius: 10px;
  background: var(--accent-dark);
  color: var(--bg);
  font-size: 16px;
  font-weight: 700;
  box-shadow: var(--shadow-btn);
  transition: background 0.15s ease, transform 0.15s ease;
  min-height: 48px;
}

.btn-main:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.btn-main svg {
  display: block;
  flex-shrink: 0;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 30px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  transition: border-color 0.15s ease;
  min-height: 48px;
}

.btn-ghost:hover {
  border-color: var(--accent);
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  min-height: 36px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-sm.btn-main {
  padding: 8px 18px;
}

.btn-sm.btn-ghost {
  padding: 7px 17px;
}

/* ---------- Header ---------- */
.site-head {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: relative;
  z-index: 50;
}

.head-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
  height: var(--head-h);
  display: flex;
  align-items: center;
  gap: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand-mark {
  display: block;
  flex: none;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: var(--head-h);
  flex: 1;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 13px;
  font-size: 14.5px;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav a.is-active {
  color: var(--text);
  font-weight: 600;
}

.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.head-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  margin-left: auto;
}

.lang-wrap {
  position: relative;
}

.lang-pick {
  font-size: 13.5px;
  color: var(--muted);
  border: 0;
  background: none;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 6px 4px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lang-pick:hover {
  color: var(--text);
}

.lang-pick .caret {
  display: inline-block;
  transition: transform 0.15s ease;
  font-size: 10px;
}

.lang-wrap.is-open .caret {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lift);
  padding: 6px;
  min-width: 168px;
  z-index: 100;
  display: none;
}

.lang-menu.is-open {
  display: block;
}

.lang-menu a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--r-xs);
  font-size: 14px;
  color: var(--muted);
  min-height: 44px;
}

.lang-menu a:hover {
  background: var(--tint2);
  color: var(--text);
}

.lang-menu a.is-current {
  color: var(--accent-dark);
  font-weight: 600;
}

.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s ease;
  min-height: 40px;
}

.btn-login:hover {
  background: var(--accent-dark);
}

/* Mobile toggle button */
.nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-xs);
  transition: background 0.15s ease;
}

.nav-toggle:hover {
  background: var(--tint2);
}

.nav-toggle svg {
  display: block;
  flex-shrink: 0;
}

/* Mobile drawer */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--head-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 40;
  padding: 24px var(--gutter) 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-drawer.is-open {
  display: block;
}

.drawer-nav a {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  font-size: 16px;
  color: var(--text);
  border-radius: var(--r-sm);
  min-height: 48px;
  transition: background 0.15s ease;
}

.drawer-nav a:hover {
  background: var(--tint2);
}

.drawer-nav a.is-active {
  color: var(--accent-dark);
  font-weight: 600;
}

.drawer-langs {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.drawer-langs a {
  display: flex;
  align-items: center;
  padding: 12px;
  font-size: 14px;
  color: var(--muted);
  border-radius: var(--r-xs);
  min-height: 44px;
  transition: background 0.15s ease;
}

.drawer-langs a:hover {
  background: var(--tint2);
}

.drawer-langs a.is-current {
  color: var(--accent-dark);
  font-weight: 600;
}

html.nav-open {
  overflow: hidden;
}

/* ---------- Footer ---------- */
.site-foot {
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  padding-top: 64px;
  padding-bottom: 32px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
}

.foot-brand p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  max-width: 300px;
  line-height: 1.7;
}

.foot-col h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  font-family: var(--font-display);
}

.foot-col a {
  display: block;
  padding: 6px 0;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.foot-col a:hover {
  color: var(--accent-dark);
}

.foot-hot {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.foot-hot h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  font-family: var(--font-display);
}

.foot-hot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.foot-hot a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.foot-hot a:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.foot-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.foot-bottom p {
  font-size: 13px;
  color: var(--faint);
}

.foot-legal {
  display: flex;
  gap: 20px;
}

.foot-legal a {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.foot-legal a:hover {
  color: var(--accent-dark);
}

/* ---------- Reveal ---------- */
.reveal {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.pending {
  opacity: 0;
  transform: translateY(16px);
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.pending {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Hero (centered-minimal) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--mist) 0%, var(--bg) 100%) top/100% 640px no-repeat,
    var(--bg);
}

.confetti {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.cf {
  fill: var(--accent);
  opacity: 0.32;
}

.cf-soft {
  fill: var(--accent);
  opacity: 0.16;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px var(--gutter) 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  background: var(--tint2);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.hero-h1 {
  margin-top: 16px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(52px, 6vw, 66px);
  line-height: 1.08;
  letter-spacing: -0.022em;
}

.hero-sub {
  margin-top: 14px;
  font-size: 17px;
  color: var(--muted);
  max-width: 640px;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 700;
}

.cta-row {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.trust-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  font-size: 13.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.trust-row li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-row svg {
  color: var(--success);
  flex-shrink: 0;
  display: block;
}

/* ---------- Relay Device ---------- */
.relay-card {
  margin-top: 26px;
  width: 100%;
  max-width: 980px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: 16px 26px 8px;
}

.relay-cap {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
}

.cap-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.cap-note {
  margin-left: auto;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.relay-svg {
  width: 100%;
  height: auto;
  display: block;
}

.rl-ground {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.rl-body {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.3;
}

.rl-top {
  fill: var(--tint);
  stroke: var(--accent);
  stroke-width: 1.3;
}

.rl-rim {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.8;
  opacity: 0.45;
}

.rl-arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 2 7;
}

.rl-dot {
  fill: var(--accent);
}

.rl-name {
  font: 600 15px var(--font-body);
  fill: var(--text);
}

.rl-code {
  font: 11px var(--font-mono);
  letter-spacing: 0.14em;
  fill: var(--accent-dark);
}

@keyframes dotPulse {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.rl-dot {
  animation: dotPulse 2.2s ease-in-out infinite alternate;
}

.rl-dot:nth-of-type(2) {
  animation-delay: 0.5s;
}

.rl-dot:nth-of-type(3) {
  animation-delay: 1s;
}

.rl-dot:nth-of-type(4) {
  animation-delay: 1.5s;
}

@media (prefers-reduced-motion: reduce) {
  .rl-dot {
    animation: none;
  }
}

/* ---------- Platform & Flag Rows ---------- */
.platform-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  flex-wrap: wrap;
}

.platform-row li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.platform-row svg {
  display: block;
  color: var(--muted);
  flex-shrink: 0;
}

.platform-row li:hover {
  color: var(--text);
}

.platform-row li:hover svg {
  color: var(--accent-dark);
}

.flag-row {
  margin-top: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.flag-row li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.flag-row svg {
  display: block;
  flex-shrink: 0;
}

/* Flag SVG colors */
.c-red { fill: var(--f-red); }
.c-white { fill: var(--f-white); }
.c-canton { fill: var(--f-canton); }
.c-navy { fill: var(--f-navy); }

.f-brd {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}

/* ---------- Entrance Motion ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fx {
  animation: rise 0.6s ease both;
}

.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.12s; }
.d3 { animation-delay: 0.19s; }
.d4 { animation-delay: 0.26s; }
.d5 { animation-delay: 0.33s; }
.d6 { animation-delay: 0.42s; }
.d7 { animation-delay: 0.5s; }
.d8 { animation-delay: 0.56s; }

@media (prefers-reduced-motion: reduce) {
  .fx {
    animation: none;
  }
}

/* ---------- Section Peek ---------- */
.peek {
  max-width: 1080px;
  margin: 0 auto;
  padding: 58px var(--gutter) 80px;
}

.peek h2 {
  margin-top: 12px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 3.5vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.peek p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  max-width: 560px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root {
    --gutter: 18px;
  }

  .head-inner {
    gap: 16px;
  }

  .nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  h1 {
    font-size: clamp(32px, 8vw, 40px);
  }

  h2 {
    font-size: clamp(24px, 6vw, 30px);
  }

  .sec {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .sec-tight {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .foot-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-sub {
    font-size: 15.5px;
  }

  .trust-row {
    gap: 10px 18px;
  }

  .platform-row,
  .flag-row {
    gap: 14px 20px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .btn-main,
  .btn-ghost {
    padding-left: 24px;
    padding-right: 24px;
    font-size: 15px;
  }

  .relay-card {
    padding: 12px 14px 6px;
  }

  .cap-note {
    display: none;
  }

  .hero-h1 .no-break {
    white-space: normal;
  }
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }