/* ===========================================================================
   Shared dark design system.

   Colour tokens arrive as custom properties from brands/<slug>/brand.toml,
   injected into the <head>. This file is identical for all four storefronts
   and never needs a per-brand build.

   Token contract:
     --bg-deep --bg --bg-elevated --border
     --text --text-muted
     --primary --primary-hover --primary-contrast
     --accent --accent-contrast
     --success --warning --danger
     --hero-from --hero-to
     --font-heading --font-body

   Layout-specific rules live in layouts.css. Anything added here is shared by
   all four brands, so think twice before putting something here that only one
   of them uses.
   =========================================================================== */

:root {
  color-scheme: dark;          /* native controls, scrollbars, form widgets */

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Fluid type: no breakpoints to maintain, and nothing overflows at 360px. */
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
  --text-4xl: clamp(2.25rem, 1.5rem + 3.4vw, 4rem);
  --text-5xl: clamp(2.75rem, 1.6rem + 4.8vw, 5rem);

  --measure: 66ch;
  --wrap: 1180px;
  --wrap-narrow: 760px;

  /* On dark surfaces a shadow only reads as depth if it is near-black. */
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 8px 24px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / 0.55);

  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 45%, transparent);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchored sections must not land under the sticky header. */
  scroll-padding-top: 88px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.1;
  margin: 0 0 var(--space-4);
  letter-spacing: -0.025em;
  font-weight: 800;
  text-wrap: balance;
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin: 0 0 var(--space-4); max-width: var(--measure); }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

img, svg, video { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-12) 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--space-4); }
.wrap.narrow { max-width: var(--wrap-narrow); }

.skip-link {
  position: absolute; left: -9999px; top: var(--space-2);
  background: var(--primary); color: var(--primary-contrast);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-sm); z-index: 200;
}
.skip-link:focus { left: var(--space-4); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-deep) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background-color 200ms ease;
}
.site-header[data-scrolled="true"] {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg-deep) 97%, transparent);
}
.header-inner { display: flex; align-items: center; gap: var(--space-6); min-height: 72px; }
.brand-mark {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-heading); font-weight: 800; font-size: var(--text-lg);
  color: var(--text); text-decoration: none; letter-spacing: -0.02em;
  margin-right: auto; flex: none;
}
/* 40px: the three supplied emblems are illustrations, not geometric marks,
   and their subject is unreadable much below this. No radius - two of them
   are shield silhouettes and a rounded crop clips their points. */
.brand-mark img { width: 40px; height: 40px; }

.site-nav { display: flex; align-items: center; gap: var(--space-1); }
.site-nav a {
  color: var(--text-muted); text-decoration: none;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  min-height: 44px; display: inline-flex; align-items: center;
  font-size: var(--text-sm); font-weight: 600; white-space: nowrap;
}
.site-nav a:hover {
  color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent);
}
.site-nav .btn { margin-left: var(--space-2); }

/* Under 900px the anchor links drop and the buy button (and My VPN) remain.
   A hamburger for five same-page anchors is more machinery than the content
   justifies. */
@media (max-width: 900px) {
  .site-nav .nav-anchor { display: none; }
  .header-inner { gap: var(--space-3); }
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: var(--space-3) var(--space-6);
  border: 1px solid transparent; border-radius: var(--radius-md);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 120ms ease, background-color 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-contrast); }
.btn-accent { background: var(--accent); color: var(--accent-contrast); }
.btn-accent:hover { filter: brightness(1.08); color: var(--accent-contrast); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.btn-danger { background: var(--danger); color: #1a0808; }
.btn-lg { min-height: 56px; padding: var(--space-4) var(--space-8); font-size: var(--text-lg); }
.btn-sm { min-height: 40px; padding: var(--space-2) var(--space-4); font-size: var(--text-sm); }

@media (max-width: 560px) {
  .btn { width: 100%; }
  .btn-inline { width: auto; }
}

/* ---------------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------------- */
.section { padding-block: var(--space-24); }
.section-tight { padding-block: var(--space-16); }
.section-deep { background: var(--bg-deep); }
.section-elevated { background: var(--bg-elevated); }

.section-head { margin-bottom: var(--space-12); }
.section-head p { color: var(--text-muted); font-size: var(--text-lg); }
.section-head.centred { text-align: center; }
.section-head.centred p { margin-inline: auto; }

.eyebrow {
  display: inline-block; font-size: var(--text-sm); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--space-3);
}

.lede { font-size: var(--text-lg); color: var(--text-muted); max-width: 58ch; }

@media (max-width: 640px) {
  .section { padding-block: var(--space-16); }
  .section-head { margin-bottom: var(--space-8); }
}

/* ---------------------------------------------------------------------------
   Cards and grids
   --------------------------------------------------------------------------- */
.grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.card h3 { margin-bottom: var(--space-2); }
.card p { color: var(--text-muted); margin-bottom: 0; }
.card + .card { margin-top: var(--space-5); }
.card-link { text-decoration: none; color: inherit; display: block; transition: border-color 140ms ease, transform 140ms ease; }
.card-link:hover { border-color: var(--primary); transform: translateY(-2px); color: inherit; }
.card-accent { border-left: 3px solid var(--accent); }
.card-quiet { background: transparent; }

.feature-icon {
  width: 44px; height: 44px; margin-bottom: var(--space-4);
  display: grid; place-items: center; border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
}
.feature-icon svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------------------
   Plans
   No prices are shown anywhere on the site, so this section sells the terms
   instead of the numbers: what every plan includes, and one way through to
   the operator's checkout.
   --------------------------------------------------------------------------- */
.checkout-panel {
  display: grid; gap: var(--space-8);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-8);
}
.checkout-panel > div > h3 { margin-top: 0; }
.plan-facts { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.plan-facts li { display: flex; gap: var(--space-3); align-items: flex-start; color: var(--text-muted); }
.plan-facts svg { color: var(--success); flex: none; margin-top: 0.2em; }
.checkout-action { text-align: center; }
.checkout-action .fineprint { margin-top: var(--space-4); margin-bottom: 0; }

@media (max-width: 860px) {
  .checkout-panel { grid-template-columns: 1fr; padding: var(--space-6); }
}

/* ---------------------------------------------------------------------------
   Trust strip
   --------------------------------------------------------------------------- */
.trust-strip { border-block: 1px solid var(--border); background: var(--bg-deep); padding-block: var(--space-5); }
.trust-items {
  display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-8);
  justify-content: center; align-items: center;
  color: var(--text-muted); font-size: var(--text-sm); font-weight: 600;
}
.trust-items span { display: inline-flex; align-items: center; gap: var(--space-2); }
.trust-items svg { width: 18px; height: 18px; color: var(--success); flex: none; }

/* ---------------------------------------------------------------------------
   Steps
   --------------------------------------------------------------------------- */
.steps { list-style: none; padding: 0; margin: 0; }
.steps-inline { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.step { margin-bottom: var(--space-10); }
.steps-inline .step { margin-bottom: 0; }
.step h2, .step h3 { display: flex; align-items: center; gap: var(--space-3); }
.step-n {
  flex: none; width: 2.25rem; height: 2.25rem;
  display: inline-grid; place-items: center;
  background: var(--primary); color: var(--primary-contrast);
  border-radius: var(--radius-pill); font-size: var(--text-base); font-weight: 800;
}
code {
  background: color-mix(in srgb, var(--text) 10%, transparent);
  padding: 0.12em 0.4em; border-radius: 4px;
  font-size: 0.9em; overflow-wrap: anywhere;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
}

.shot-placeholder {
  border: 1px dashed var(--border); border-radius: var(--radius-md);
  padding: var(--space-10); text-align: center;
  color: var(--text-muted); font-size: var(--text-sm);
  background: color-mix(in srgb, var(--text) 3%, transparent);
}
.shot-placeholder.step-shot { margin-top: var(--space-5); }

/* Real screenshots, once they exist. Scoped to img so it does not fight the
   placeholder above. The max-height is what keeps a portrait phone capture
   from towering over the step it illustrates, while a landscape desktop
   capture still runs the full column width. */
img.step-shot {
  display: block; margin-top: var(--space-5);
  max-width: 100%; max-height: 560px;
  width: auto; height: auto;
  border: 1px solid var(--border); border-radius: var(--radius-md);
}

/* ---------------------------------------------------------------------------
   FAQ
   --------------------------------------------------------------------------- */
.faq-group { margin-top: var(--space-12); font-size: var(--text-xl); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  cursor: pointer; font-weight: 700; font-size: var(--text-lg);
  min-height: 44px; padding: var(--space-4) 0;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: var(--text-2xl); font-weight: 400;
  color: var(--text-muted); line-height: 1; flex: none;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item summary:hover { color: var(--primary); }
.faq-answer { padding-bottom: var(--space-5); color: var(--text-muted); }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer strong { color: var(--text); }

/* ---------------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------------- */
.field { margin-bottom: var(--space-5); }
.field label { display: block; font-weight: 700; margin-bottom: var(--space-2); font-size: var(--text-sm); }
.field input, .code-input {
  display: block; width: 100%; font: inherit;
  padding: var(--space-3) var(--space-4); min-height: 50px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg); color: var(--text);
}
.field input:focus-visible, .code-input:focus-visible { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.field-help { font-size: var(--text-sm); color: var(--text-muted); margin: var(--space-2) 0 0; }
.field-error { font-size: var(--text-sm); color: var(--danger); margin: var(--space-2) 0 0; font-weight: 600; }

.code-input {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--text-xl); letter-spacing: 0.16em; text-transform: uppercase; text-align: center;
}

/* ---------------------------------------------------------------------------
   Alerts and status
   --------------------------------------------------------------------------- */
.alert {
  padding: var(--space-4) var(--space-5); border-radius: var(--radius-md);
  border: 1px solid var(--border); margin-bottom: var(--space-6);
  background: var(--bg-elevated);
}
.alert-ok, .alert-success { border-color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--bg-elevated)); }
.alert-warning { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, var(--bg-elevated)); }
.alert-danger, .alert-error { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--bg-elevated)); }
.alert-info { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--bg-elevated)); }

.status-pending { color: var(--text-muted); display: flex; align-items: center; gap: var(--space-3); }
.status-ok { color: var(--success); font-weight: 600; }
.spinner {
  width: 1em; height: 1em; flex: none;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.recovery-code { text-align: center; margin: var(--space-6) 0; }
.recovery-code code {
  display: inline-block; font-size: var(--text-2xl); letter-spacing: 0.18em; font-weight: 700;
  padding: var(--space-4) var(--space-6);
  background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius-md);
}

.qr-details, .link-details { margin-top: var(--space-4); }
.qr-details summary,
.link-details summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.checkout-link code {
  display: block; word-break: break-all; font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.qr { max-width: 280px; background: #fff; padding: var(--space-3); border-radius: var(--radius-md); }

.fineprint { font-size: var(--text-sm); color: var(--text-muted); }

/* Card and grid classes set display, which beats the UA stylesheet rule for
   [hidden]. The buy page toggles both, so without this the "waiting" panel
   is visible before anyone presses anything. */
[hidden] { display: none !important; }
.plain-list { padding-left: var(--space-6); max-width: var(--measure); color: var(--text-muted); }
.plain-list li { margin-bottom: var(--space-3); }
.plain-list strong { color: var(--text); }
.crumb { font-size: var(--text-sm); margin-bottom: var(--space-2); }

.error-page { padding-block: var(--space-24); text-align: center; }
.error-code { font-size: var(--text-5xl); font-family: var(--font-heading); color: var(--text-muted); margin: 0; }
.error-page p { margin-inline: auto; }

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border); background: var(--bg-deep);
  margin-top: var(--space-24); padding-block: var(--space-16) var(--space-10);
  color: var(--text-muted); font-size: var(--text-sm);
}
.footer-nav {
  display: grid; gap: var(--space-8);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  margin-bottom: var(--space-10); padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--border);
}
.footer-col h2 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.09em; color: var(--text); margin-bottom: var(--space-3); }
.footer-col a { display: block; color: var(--text-muted); text-decoration: none; padding: var(--space-2) 0; min-height: 40px; }
.footer-col a:hover { color: var(--primary); }
.footer-legal { margin-bottom: var(--space-2); }
.footer-note { margin: 0; }

.cta-final { text-align: center; }
.cta-final .lede { margin-inline: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
