/* Shared visual system. Every page loads tokens.css + site.css.
   Home adds home.css for the hero, state card, facts and doors. */

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, p, ul, dl { margin: 0; padding: 0; }
html { scroll-behavior: auto; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--deep); text-underline-offset: 2px; }
a:hover { color: var(--ink); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--deep);
  outline-offset: 2px;
}
.nav :focus-visible,
.pro :focus-visible {
  outline-color: var(--signal);
}

.skip {
  position: absolute;
  left: var(--space-4);
  top: -40px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
}
.skip:focus { top: var(--space-2); }

.wrap {
  width: min(var(--max-w), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--space-5);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--deep); border-color: var(--deep); color: var(--paper); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-on-ink {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.btn-on-ink:hover { background: var(--slab); color: var(--ink); }
.btn-ghost-on-ink {
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
}
.btn-ghost-on-ink:hover { background: var(--paper); color: var(--ink); }
.btn-lg { min-height: 52px; padding: 0 var(--space-6); }

/* ---- Nav: ink bar, always solid ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  height: var(--nav-h);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--paper);
  text-decoration: none;
  flex-shrink: 0;
}
/* a:hover { color: var(--ink) } is (0,1,1) and would paint the
   mark the same colour as the bar — contrast 1:1, the wordmark
   vanishes. Nav links are shielded by .nav-links a:hover; the
   logo sits outside that list. */
.nav .nav-logo:hover { color: var(--paper); }
.nav-badge {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.logo-mark {
  display: block;
  width: 116px;
  height: 32px;
  background-color: currentColor;
  -webkit-mask: url("/img/logo.svg?v=2") left center / contain no-repeat;
  mask: url("/img/logo.svg?v=2") left center / contain no-repeat;
}
.nav-logo .logo-mark {
  width: 102px;
  height: 28px;
}
.brand-tagline {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--whisper);
  white-space: nowrap;
}
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { display: block; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.nav-links a {
  color: var(--paper);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 400;
}
.nav-links a:hover { color: var(--paper); text-decoration: underline; }
.nav-actions { display: flex; align-items: center; gap: var(--space-2); }
.nav-actions .btn { min-height: 40px; padding: 0 var(--space-4); font-size: 0.9375rem; }
.nav-links .btn-on-ink,
.nav-links .btn-on-ink:hover { color: var(--ink); text-decoration: none; }
.nav-links .btn-ghost-on-ink:hover { color: var(--ink); text-decoration: none; }

@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--ink);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4) var(--gutter) var(--space-6);
    gap: var(--space-2);
    max-height: calc(100vh - var(--nav-h));
    overflow: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links > a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .nav-actions {
    order: -1;
    flex-direction: column;
    align-items: stretch;
    margin: 0 0 var(--space-3);
  }
  .nav-actions .btn { width: 100%; }
}

/* ---- PRO ink slab ---- */
.pro {
  background: var(--ink);
  color: var(--paper);
  padding: var(--section-y) 0;
}
.pro h2 {
  font-family: var(--font-display);
  font-size: var(--fs-display-l);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.pro p {
  font-size: var(--fs-lead);
  line-height: 1.55;
  max-width: 36rem;
  margin: var(--space-4) 0 var(--space-6);
  color: var(--paper);
}
@media (min-width: 1024px) {
  .pro > .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: var(--space-8);
    align-items: center;
  }
  .pro p { margin-bottom: 0; }
  /* On the container's right rail, same edge as the state card and the doors.
     Started at the cell's left, which stopped the band short of every other
     section and read as a tag-along rather than the second cell. */
  .pro .btn-on-ink { justify-self: end; }
}
.pro a { color: var(--paper); }
.pro a:hover { color: var(--paper); }
.pro .btn-on-ink,
.pro .btn-on-ink:hover { color: var(--ink); text-decoration: none; }
.pro .btn-on-ink:focus-visible { outline-color: var(--signal); }

/* ---- Footer ---- */
.footer {
  padding: var(--space-8) 0;
  background: var(--paper);
  border-top: 1px solid var(--slab);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-6);
  align-items: flex-start;
}
.footer-brand {
  display: grid;
  gap: var(--space-3);
}
.footer-logo {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
.footer-logo .nav-badge {
  width: 24px;
  height: 24px;
}
.footer-logo .logo-mark {
  width: 87px;
  height: 24px;
}
.footer-copy {
  font-size: var(--fs-body);
  color: var(--ink);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
}
.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }

/* ---- Inner-page patterns ---- */
/* ---- Page head ----
   Left-aligned on paper, not a centred royal-blue band. Centred H1 + centred
   lead over a colour block is the single most templated shape on the old site,
   and it also breaks the left rail that the nav, the hero and every section
   below share. */
.page-head {
  padding: var(--space-8) 0 var(--space-7);
  border-bottom: 1px solid var(--slab);
}
.page-kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--restricted);
  margin-bottom: var(--space-4);
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: var(--fs-display-l);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  text-wrap: balance;
}
.page-head .lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  max-width: 40rem;
  margin-top: var(--space-4);
}

/* ---- Groups ---- */
.group { padding: var(--space-8) 0 0; }
/* last-child covers pages with no band. Adjacent .pro gets the
   section gap as margin-top so browsers without :has (Firefox <121)
   still get the seam. Home is safe: its .pro follows .doors. */
.group:last-child { padding-bottom: var(--section-y); }
.group + .pro { margin-top: var(--section-y); }
.group h2,
.help-topic h2 {
  font-family: var(--font-display);
  font-size: var(--fs-head-m);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-2);
}
.group > .wrap > h3 {
  font-family: var(--font-display);
  font-size: var(--fs-head-m);
  font-weight: 600;
  line-height: 1.2;
  margin: var(--space-7) 0 var(--space-2);
}
.group > .wrap > p,
.group > .wrap > ol + p,
.group > .wrap > .pcards + p,
.help-topic > .topic-sub {
  color: var(--restricted);
  margin-bottom: var(--space-5);
  max-width: 44rem;
}
.group > .wrap > .pcards + p { margin-top: var(--space-5); }
.group ol:not(.steps) {
  margin: var(--space-4) 0 0;
  padding-left: 1.25em;
  max-width: 44rem;
}
.group ol:not(.steps) li + li { margin-top: var(--space-2); }
.group > .wrap > p:has(.btn) { margin-top: var(--space-4); }

/* ---- Cards ----
   Default is a 3-count: 1 column, then 3. A 2-col middle breakpoint
   orphans the third card. .cols-4 is the 4-count (1 / 2 / 4) if a
   page needs it; /download/ is 3-up. */
.pcards {
  display: grid;
  gap: var(--space-4);
  align-items: stretch;
}
@media (min-width: 1024px) { .pcards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) { .pcards.cols-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .pcards.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.pcard {
  border: 1.5px solid var(--slab);
  border-radius: var(--radius);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.pcard[data-you] { background: var(--slab); border-color: var(--slab); }
.prow[data-you] { background: var(--slab); margin-inline: calc(-1 * var(--space-4)); padding-inline: var(--space-4); }
.pcard[data-you]::before,
.prow[data-you] .platform b::after {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--restricted);
  font-weight: 400;
}
.pcard[data-you="exact"]::before { content: "Your browser"; }
.pcard[data-you="compat"]::before { content: "Install this one"; }
.prow[data-you] .platform b::after {
  content: "Your device";
  display: block;
  margin-top: 0.15em;
}
.pcard svg {
  width: 28px;
  height: 28px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pcard h3 {
  font-family: var(--font-display);
  font-size: var(--fs-head-m);
  font-weight: 600;
  line-height: 1.2;
}
.pcard p { color: var(--restricted); }
.pcard .btn { margin-top: auto; }
a.pcard { text-decoration: none; color: inherit; }
a.pcard:hover { border-color: var(--ink); color: inherit; }

/* ---- Rows: the five devices that take a VPN profile ----
   A five-item set has no honest card grid — 4+1 and 3+2 both orphan. It is a
   list, so it ships as one: same object as the VPN door on the home page.
   No glyphs here — at 24 px the five shapes collapse into two, and the
   rows already have a name, a subtitle and an action. Keep icons on .pcards. */
.prows {
  border-top: 1px solid var(--slab);
}
.prow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--slab);
  min-height: 64px;
}
.prow .platform {
  min-width: 0;
  color: var(--ink);
}
.prow .platform b { font-weight: 600; }
.prow .platform span {
  display: block;
  font-size: 0.875rem;
  color: var(--restricted);
  font-weight: 400;
}
.prow .text-link {
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--deep);
}
.prow .text-link:hover { text-decoration: underline; }

.page-note {
  padding: var(--space-6) 0 var(--section-y);
  color: var(--restricted);
}
.page-note p { margin-top: var(--space-5); }

/* ---- Prose (~66ch). Token law: --whisper is ink-only, so step
   numerals use --restricted on paper even though the plan named whisper. */
.prose { max-width: 66ch; color: var(--ink); }
.page-head .prose { margin-top: var(--space-5); }
.group .prose { margin-top: var(--space-4); }
.group .pcards,
.group .ctable,
.group .steps,
.group .prows { margin-top: var(--space-5); }
.prose p + p { margin-top: var(--space-4); }
.prose ul {
  margin: var(--space-4) 0 0;
  padding-left: 1.25em;
}
.prose li + li { margin-top: var(--space-2); }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ---- Steps ---- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--slab);
  counter-reset: step;
}
.steps > li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: var(--space-4);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--slab);
  counter-increment: step;
}
.steps > li::before {
  content: counter(step);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  color: var(--restricted);
  line-height: 1.6;
  padding-top: 0.15em;
}
.steps h3 {
  font-family: var(--font-display);
  font-size: var(--fs-head-m);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-2);
}
.steps p + p { margin-top: var(--space-3); }
.steps .btn { margin-top: var(--space-3); }

/* ---- Plans: 2-up pricing variant of .pcard ---- */
.plans {
  display: grid;
  gap: var(--space-4);
  align-items: start;
  margin-top: var(--space-6);
}
@media (min-width: 640px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan {
  border: 1.5px solid var(--slab);
  border-radius: var(--radius);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.plan-kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--restricted);
}
.plan-mark {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--deep);
}
.plan-price {
  font-family: var(--font-display);
  font-size: var(--fs-display-l);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.95;
}
.plan-price small { font-size: 0.45em; font-weight: 600; }
.plan-cycle { color: var(--restricted); }
.plan-old {
  color: var(--restricted);
  text-decoration: line-through;
}
.plan-save { font-weight: 600; }
.plan-actions {
  margin-top: auto;
  display: grid;
  gap: var(--space-2);
}
.plan-actions .btn { width: 100%; }
.paypal-form { margin: 0; }
.plan-foot {
  margin-top: var(--space-6);
  color: var(--restricted);
  max-width: 44rem;
}
.plan-foot p + p { margin-top: var(--space-3); }

/* ---- Compare table. Subgrid keeps feature rows aligned;
   under 640 each service is one block with labels on the values. */
.ctable {
  display: grid;
  grid-template-columns: minmax(8rem, 1.4fr) repeat(3, minmax(0, 1fr));
  grid-template-rows: auto repeat(7, auto);
  border: 1px solid var(--slab);
  border-radius: var(--radius);
  overflow: hidden;
}
.ctable-col {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: 1 / span 8;
}
.ctable-h {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: var(--space-4);
  background: var(--slab);
}
.ctable-c {
  padding: var(--space-4);
  border-top: 1px solid var(--slab);
}
/* Keep the label in the a11y tree on desktop. display:none drops it,
   so a screen reader hears twenty-one values with no row names. */
.ctable-k {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 639px) {
  .ctable {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
  .ctable-col {
    display: block;
    grid-row: auto;
    border: 1px solid var(--slab);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .ctable-col.ctable-feats { display: none; }
  .ctable-k {
    display: block;
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    color: var(--restricted);
    font-size: 0.875rem;
    margin-bottom: var(--space-1);
  }
}

/* ---- Tables (VPN location list). Not a new page object — a
   <table> inside a .group, scrollable under 640 so 3 columns do not
   overflow. */
.table-wrap { overflow-x: auto; margin-top: var(--space-5); }
.group table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--slab);
  border-radius: var(--radius);
}
.group th, .group td {
  text-align: left;
  padding: var(--space-4);
  border-top: 1px solid var(--slab);
  vertical-align: top;
}
.group thead th {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--slab);
  border-top: 0;
}
.group td a { font-weight: 600; text-decoration: none; }
.group td a:hover { text-decoration: underline; }
.note {
  border-left: 2px solid var(--slab);
  padding: var(--space-4);
  color: var(--restricted);
  max-width: 44rem;
  margin-top: var(--space-5);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[id] { scroll-margin-top: calc(var(--nav-h) + var(--space-4)); }

/* ---- Help: search, topic jump, Q&A. Bound to the ids help.js reads. */
.help-search { max-width: 40rem; margin-top: var(--space-5); }
.help-search input {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--space-5);
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--slab);
  border-radius: var(--radius);
}
#help-count {
  color: var(--restricted);
  margin-top: var(--space-3);
  min-height: 1.4em;
}
.help-jump {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-5);
}
.help-jump a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.help-topic { padding-top: var(--space-8); }
.help-topic:first-child { padding-top: var(--space-6); }
.qa {
  border: 1.5px solid var(--slab);
  border-radius: var(--radius);
  margin-top: var(--space-3);
}
.qa > summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: var(--space-4);
  padding-right: var(--space-8);
  font-weight: 600;
}
.qa > summary::-webkit-details-marker { display: none; }
.qa > summary::after {
  content: '+';
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--restricted);
}
.qa[open] > summary::after { content: '\2013'; }
.qa-body {
  padding: 0 var(--space-4) var(--space-4);
  max-width: 66ch;
}
.qa-body p + p,
.qa-body p + ol,
.qa-body p + ul { margin-top: var(--space-3); }
.qa-body ol, .qa-body ul {
  margin: var(--space-3) 0 0;
  padding-left: 1.25em;
}
.qa-body li + li { margin-top: var(--space-2); }
.qa-body .btn { margin-top: var(--space-3); }
.help-empty { display: none; padding: var(--space-6) 0; color: var(--restricted); }
.help-empty.show { display: block; }
.help-empty p + p { margin-top: var(--space-3); }

/* ---- 404 kicker size only ---- */
.page-kicker.err {
  font-size: var(--fs-display-l);
  letter-spacing: -0.02em;
  line-height: 1;
}
