/*
 * Sheerlane: Apple-style design language, Thurven's system.
 * - Layout: frosted sticky nav, full-bleed alternating bands, centred
 *   display headlines, large-radius tiles, Apple content widths
 *   (87.5% phones, 692px from 735px, 980px from 1069px).
 * - Identity: Thurven stand-in brand colour Deep Sea #0B5C73 (see the
 *   thurven-site visual identity brief). System fonts until the brand
 *   typeface is licensed; never load fonts from a third-party CDN.
 */
:root {
  --paper: #ffffff;
  --band: #f3f6f7;
  --tile: #ffffff;
  --ink: #0f1d22;
  --muted: #55666c;
  --rule: #dbe3e5;
  --accent: #0b5c73;
  --on-accent: #ffffff;
  --mark: color-mix(in srgb, var(--accent) 14%, transparent);
  --nav: color-mix(in srgb, var(--paper) 78%, transparent);
  --alert: #a3341f;
  --seg-on: #ffffff;
  --on-alert: #ffffff;
  --alert-mark: color-mix(in srgb, var(--alert) 12%, transparent);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --nav-h: 48px;
  /* Spacing system: every page uses these, nothing else.
     section-y  space above and below each section, the hero and page heads
     head-gap   section heading → its content; page head → body
     block-gap  hero copy → the block under it (tester, 404 address)
     grid-gap   between cards in a grid
     card-pad   inside cards (tiles, FAQ, At a glance)
     footer-y   footer top padding (footer content → base row is head-gap) */
  --section-y: clamp(4rem, 2.5rem + 5vw, 6.5rem);
  --head-gap: clamp(2rem, 1.5rem + 2vw, 3rem);
  --block-gap: clamp(2.5rem, 1.75rem + 3vw, 3.5rem);
  --grid-gap: clamp(0.75rem, 0.5rem + 0.8vw, 1.25rem);
  --card-pad: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  --footer-y: clamp(3rem, 2.25rem + 2.5vw, 4rem);
  --radius: 24px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1214;
    --band: #111a1d;
    --tile: #172327;
    --ink: #e6eef0;
    --muted: #94a7ac;
    --rule: #24343a;
    --accent: #6cc1d4;
    --on-accent: #0b1214;
    --mark: color-mix(in srgb, var(--accent) 18%, transparent);
    --nav: color-mix(in srgb, var(--paper) 72%, transparent);
    --alert: #f29a84;
    --seg-on: #2b3f45;
    --on-alert: #0b1214;
    --alert-mark: color-mix(in srgb, var(--alert) 16%, transparent);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--mark); }
p, li { text-wrap: pretty; }
p { margin: 0 0 1rem; }
h1, h2, h3 { text-wrap: balance; margin: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
code {
  font: 0.88em var(--mono);
  background: var(--band);
  padding: 0.12em 0.38em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.nowrap { white-space: nowrap; }

.skip {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
}
.skip:focus { top: calc(env(safe-area-inset-top) + 0.5rem); }

/* Apple content widths */
.wrap { width: 87.5%; max-width: 980px; margin-inline: auto; }
@media (min-width: 735px) { .wrap { width: 692px; } }
@media (min-width: 1069px) { .wrap { width: 980px; } }
.wrap.narrow { width: min(87.5%, 692px); }

/* ---------- Global nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav {
    background: var(--nav);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
  }
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}
.brand { display: flex; align-items: center; gap: 0.5rem; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.mark { display: block; width: 22px; height: 22px; border-radius: 6px; }
.nav ul { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav ul a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.8rem;
  color: var(--muted);
}
.nav ul a[aria-current="page"] { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .nav ul a:hover { color: var(--ink); text-decoration: none; }
}
/* Phones: in-page anchors go; the page is short enough to scroll. */
@media (max-width: 734px) {
  .nav ul .anchor { display: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); }
.section.band { background: var(--band); }
.section-head { text-align: center; margin-bottom: var(--head-gap); }
.section-head h2 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 650;
}
.section-head p {
  max-width: 34rem;
  margin: 1rem auto 0;
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Hero ---------- */
.hero { padding-block: var(--section-y); text-align: center; }
.hero h1 {
  font-size: clamp(2.6rem, 1.5rem + 4.6vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.hero .sub {
  max-width: 36rem;
  margin: 1.25rem auto 0;
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.6rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--muted);
}
.hero .meta { margin: 1rem auto 0; font-size: 0.9rem; color: var(--muted); }
.ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem 1.75rem;
  margin-top: 2rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1rem;
  font-weight: 500;
  transition: transform 160ms var(--ease-out), background-color 150ms ease;
}
.pill:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .pill:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
}
.more { display: inline-flex; align-items: center; min-height: 44px; font-size: 1rem; }
.more::after { content: "\203A"; margin-left: 0.3em; font-size: 1.2em; line-height: 1; }

/* Signature: the link, read part by part. The destination is the point.
   Used live in the homepage tester and on the 404 page. */
.anatomy {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0 1rem;
  margin: 0;
  padding: clamp(1.2rem, 0.9rem + 1.4vw, 2rem);
  text-align: left;
  background: var(--band);
  border-radius: var(--radius);
}
.anatomy > * { grid-column: 1 / -1; }
.anatomy p { margin: 0; }
.anatomy .url {
  font: clamp(0.9rem, 0.8rem + 0.45vw, 1.15rem)/1.7 var(--mono);
  overflow-wrap: anywhere;
  max-height: 11.5em;
  overflow-y: auto;
  -webkit-user-select: all;
  user-select: all;
}
.anatomy .host { display: block; color: var(--muted); }
.anatomy .param { white-space: nowrap; }
.anatomy mark {
  color: var(--accent);
  background: var(--mark);
  border-radius: 5px;
  padding: 0.05em 0.2em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: color 150ms ease, background-color 150ms ease;
}
.anatomy .hop {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font: clamp(0.9rem, 0.8rem + 0.45vw, 1.15rem)/1.6 var(--mono);
  overflow-wrap: anywhere;
  min-width: 0;
}
.anatomy .status {
  flex: none;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 0.72em/1.5 var(--mono);
  transition: background-color 150ms ease, color 150ms ease;
}
.anatomy .status.alert, .is-bad .anatomy .status { background: var(--alert); color: var(--on-alert); }
.anatomy mark.alert, .is-bad .anatomy mark { color: var(--alert); background: var(--alert-mark); }
.anatomy figcaption { grid-column: 1; margin-top: 1.1rem; font-size: 0.9rem; color: var(--muted); }
.anatomy .copy { grid-column: 2; grid-row: 3; margin-top: 1.1rem; display: flex; gap: 1.1rem; }

/* ---------- Tester: type a final URL, get the real link ---------- */
.tester {
  max-width: 46rem;
  margin: var(--block-gap) auto 0;
  padding: clamp(0.75rem, 0.5rem + 1vw, 1.25rem);
  text-align: left;
  background: var(--band);
  border-radius: calc(var(--radius) + 6px);
}
.tester-top { padding: 0.5rem 0.5rem 0; }
.tester-title { font-size: 1.2rem; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }
.tester-lede { margin: 0.35rem 0 0; font-size: 0.95rem; color: var(--muted); }

.field {
  display: flex;
  gap: 6px;
  margin-top: 1rem;
  padding: 6px;
  background: var(--tile);
  border: 1px solid var(--rule);
  border-radius: 18px;
}
.field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.field input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 0.8rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: max(16px, 1rem)/1.3 var(--mono);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder { color: var(--muted); opacity: 0.75; }
.field .pill { flex: none; border: 0; cursor: pointer; font-family: inherit; border-radius: 13px; }
.pill .arrow { margin-left: 0.4em; }
@media (max-width: 479px) {
  .field { flex-direction: column; }
  .field .pill { justify-content: center; }
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.25rem;
  padding: 0.75rem 0.5rem;
}
.controls[hidden] { display: none; }
.hosts { display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.hosts .label, .samples .label { font-size: 0.85rem; color: var(--muted); }
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.85rem;
  border-radius: 999px;
  font: 500 0.85rem/1 var(--mono);
  color: var(--muted);
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.seg label:has(:checked) span {
  background: var(--seg-on);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 0 0 0.5px rgb(0 0 0 / 0.06);
}
.seg label:has(:focus-visible) span { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) {
  .seg label:hover span { color: var(--ink); }
}

.samples { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.9rem; }
.quiet {
  display: inline-grid;
  align-items: center;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), color 150ms ease;
}
.quiet:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .quiet:hover { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
}
/* Copy label swap: both labels share one grid cell, so the width never jumps. */
.quiet > span { grid-area: 1 / 1; transition: opacity 150ms ease, filter 150ms ease; }
.quiet .done { opacity: 0; filter: blur(2px); }
.quiet[data-state="done"] .idle { opacity: 0; filter: blur(2px); }
.quiet[data-state="done"] .done { opacity: 1; filter: none; }

.tester .anatomy { background: var(--tile); border-radius: calc(var(--radius) - 4px); }
.tester .anatomy .copy[hidden] { display: none; }
@media (max-width: 559px) {
  .anatomy .copy { grid-column: 1 / -1; grid-row: auto; margin-top: 0.75rem; }
}
.is-empty .anatomy mark, .is-empty .anatomy [data-loc] { color: var(--muted); }
.is-empty .anatomy mark { background: color-mix(in srgb, var(--muted) 12%, transparent); }
.is-empty .anatomy .status { background: color-mix(in srgb, var(--muted) 70%, transparent); }
.tester .msg { min-height: 1.5em; margin: 0; padding: 0.6rem 0.5rem 0.15rem; font-size: 0.85rem; color: var(--muted); }

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

/* Hero entrance: one sequence on load, no JS. The headline leads; the
   highlight on the destination lands last, because it is the point. */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .sub, .hero .meta, .hero .ctas, .hero .tester, .hero .anatomy {
    animation: rise 700ms var(--ease-out) both;
  }
  .hero .sub { animation-delay: 70ms; }
  .hero .meta { animation-delay: 120ms; }
  .hero .ctas { animation-delay: 160ms; }
  .hero .tester, .hero .anatomy { animation-delay: 220ms; }
  .hero .tester .anatomy { animation: none; }
  .hero .anatomy mark { animation: light 600ms ease 850ms both; }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero .sub, .hero .meta, .hero .ctas, .hero .tester, .hero .anatomy { animation: fade 300ms ease both; }
  .hero .tester .anatomy { animation: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes light { from { background-color: transparent; color: inherit; } }

/* ---------- 404 ---------- */
.lost .anatomy { max-width: 46rem; margin: var(--block-gap) auto 0; }
.lost .url .host { display: inline; }
.lost .hint {
  max-width: 46rem;
  margin: 1.25rem auto 0;
  font-size: 0.95rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.lost .hint a { font-family: var(--mono); font-size: 0.9em; }

/* ---------- Tiles ---------- */
.tiles { display: grid; gap: var(--grid-gap); list-style: none; margin: 0; padding: 0; }
@media (min-width: 735px) {
  .tiles.three { grid-template-columns: repeat(3, 1fr); }
  .tiles.two { grid-template-columns: repeat(2, 1fr); }
}
.tile {
  padding: var(--card-pad);
  background: var(--band);
  border-radius: var(--radius);
}
.band .tile { background: var(--tile); }
.tile h3 {
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 650;
  margin-bottom: 0.6rem;
}
.tile p { margin: 0; color: var(--muted); }
.tile p code { color: var(--ink); }
.band .tile code { background: var(--band); }
.host-tile { display: flex; flex-direction: column; gap: 0.35rem; }
.host-tile .name {
  font: 500 clamp(1.1rem, 0.95rem + 0.8vw, 1.5rem)/1.3 var(--mono);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.host-tile .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1rem; }
.host-tile .what { font-size: 0.9rem; color: var(--muted); }
.host-tile .quiet[hidden] { display: none; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: var(--grid-gap); list-style: none; margin: 0; padding: 0; }
@media (min-width: 735px) { .faq { grid-template-columns: repeat(2, 1fr); } }
.faq-item { padding: var(--card-pad); background: var(--tile); border-radius: var(--radius); }
.faq-item h3 { font-size: 1.15rem; line-height: 1.25; letter-spacing: -0.015em; font-weight: 650; margin-bottom: 0.6rem; }
.faq-item p { margin: 0; color: var(--muted); }
.faq-item code { color: var(--ink); background: var(--band); }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact .section-head { margin-bottom: 1.25rem; }
.contact .email {
  display: inline-block;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

/* ---------- Long-form (privacy) ---------- */
.doc-layout { width: min(87.5%, 692px); margin-inline: auto; padding-bottom: var(--section-y); }
@media (min-width: 1069px) {
  .doc-layout {
    width: 980px;
    display: grid;
    grid-template-columns: 196px minmax(0, 692px);
    column-gap: 92px;
  }
  .doc-layout > .doc-head, .doc-layout > .doc-body { grid-column: 2; }
  .toc { grid-column: 1; grid-row: 2; }
}
.doc-head { padding-block: var(--section-y) var(--head-gap); }
.doc-head h1 {
  font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.doc-head p { margin: 1rem 0 0; color: var(--muted); }

/* At a glance: the policy's commitments, read in five seconds. */
.glance { padding: var(--card-pad); background: var(--band); border-radius: var(--radius); }
.glance h2 { font-size: 0.85rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.glance dl { display: grid; gap: 1.25rem 2rem; margin: 1.1rem 0 0; }
@media (min-width: 560px) { .glance dl { grid-template-columns: 1fr 1fr; } }
.glance dl > div { padding-top: 0.9rem; border-top: 1px solid var(--rule); }
.glance dt { font-size: 0.9rem; color: var(--muted); }
.glance dd {
  margin: 0.15rem 0 0;
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.65rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.glance dd a { color: var(--accent); }
.glance p { margin: 1.5rem 0 0; font-size: 0.9rem; color: var(--muted); }

.toc { display: none; }
@media (min-width: 1069px) {
  .toc { display: block; position: sticky; top: calc(var(--nav-h) + 2rem); align-self: start; }
  .toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
  }
  .toc li + li { margin-top: 0.15rem; }
  .toc a { display: block; padding: 0.35rem 0; color: var(--muted); line-height: 1.35; }
  .toc .toc-title { margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--ink); font-weight: 600; }
}
@media (hover: hover) and (pointer: fine) {
  .toc a:hover { color: var(--ink); text-decoration: none; }
}
.doc h2 {
  font-size: 1.45rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 650;
  margin: 2.5rem 0 0.75rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}
.doc p { line-height: 1.6; }
.doc > :last-child { margin-bottom: 0; }
.doc ul { margin: 0 0 1rem; padding-left: 1.25rem; line-height: 1.6; }
.doc li + li { margin-top: 0.4rem; }
@media (prefers-reduced-motion: no-preference) {
  .doc-head, .glance { animation: rise 600ms var(--ease-out) both; }
  .glance { animation-delay: 80ms; }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--band);
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
  /* The base row mirrors the header bar: same height, text centered. */
  padding: var(--footer-y) 0 env(safe-area-inset-bottom);
}
.footer-top { display: grid; gap: var(--head-gap) 2rem; }
.footer-brand p { margin: 0.5rem 0 0; color: var(--muted); }
.footer-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
.footer h2 { margin: 0 0 0.25rem; font-size: 0.8125rem; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.footer a[aria-current="page"] { color: var(--ink); }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 1.5rem;
  min-height: var(--nav-h);
  margin-top: var(--head-gap);
  border-top: 1px solid var(--rule);
}
.footer-base p { margin: 0; }
.footer-base a { color: inherit; }
@media (min-width: 735px) {
  .footer li a { min-height: 32px; }
  .footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1069px) {
  .footer-top { grid-template-columns: 1fr 3fr; }
}
@media (hover: hover) and (pointer: fine) {
  .footer li a:hover, .footer-base a:hover { color: var(--ink); }
}

