/*
 * The site's stylesheet: every page generated by scripts/build-pages.mjs
 * links tokens.css and then this (as content-hashed copies in public/css).
 *
 * Rules shared by every page come first. Each page type's own rules are
 * scoped by the class on its <html> — page-home, page-doc, page-404,
 * page-redirect — through :where(), which adds no specificity, so every
 * rule competes exactly as it did when it was inline in its page.
 */
/* ── shared by every page ── */
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); margin: 0; -webkit-font-smoothing: antialiased; }
.mark svg { width: 100%; height: 100%; }
.lang-switch a { color: var(--ink-faint); text-decoration: none; }
.lang-switch a:hover, .lang-switch a[aria-current] { color: var(--accent); }
/* Skip link: off-screen until it takes keyboard focus. */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; background: var(--surface); color: var(--accent); border: 2px solid var(--accent); border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* ── landing page (html.page-home) ── */
html:where(.page-home) { scroll-behavior: smooth; }
:where(.page-home) a { color: inherit; }
:where(.page-home) img { max-width: 100%; }
:where(.page-home) .wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
/* ---------- header ---------- */
:where(.page-home) header.site { padding: 28px 0; }
:where(.page-home) header.site .wrap { display: flex; align-items: center; justify-content: space-between; }
:where(.page-home) .brand-link { text-decoration: none; display: flex; align-items: center; gap: 12px; }
:where(.page-home) .mark { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; background: linear-gradient(160deg, var(--accent), var(--accent-deep)); }
:where(.page-home) .brand-name { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
:where(.page-home) nav.site-links { display: flex; gap: 28px; font-size: 14.5px; }
:where(.page-home) nav.site-links a { color: var(--ink-soft); text-decoration: none; }
:where(.page-home) nav.site-links a:hover { color: var(--accent); }
/* ---------- hero ---------- */
:where(.page-home) .hero { padding: 64px 0 88px; position: relative; overflow: hidden; }
:where(.page-home) .hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
:where(.page-home) .eyebrow { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
:where(.page-home) h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(38px, 5vw, 58px); line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 22px; text-wrap: balance; }
:where(.page-home) h1 em { font-style: italic; color: var(--accent); }
:where(.page-home) .hero-dek { font-size: 18px; line-height: 1.6; color: var(--ink-soft); max-width: 46ch; margin: 0 0 34px; }
:where(.page-home) .cta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
/* Official Apple-provided "Download on the App Store" artwork, served
   live from Apple's own badge CDN — per Apple's marketing guidelines,
   the badge may never be recreated, recolored, or rebuilt from custom
   type/icons, so this is an <img> of Apple's real artwork, not a
   lookalike. Only one <img> per badge (src picked by the inline script
   next to each one) rather than a black+white pair toggled with CSS —
   two near-identical cross-origin SVGs loaded at once (one hidden) hit
   a real Chromium decode/paint race where the hidden one's bitmap could
   flash onto the visible element; a single element with one src has
   nothing to race against. */
:where(.page-home) .appstore-badge { display: inline-flex; text-decoration: none; }
:where(.page-home) .appstore-badge img { display: block; height: 54px; width: auto; }
:where(.page-home) .cta-fine { font-size: 13px; color: var(--ink-faint); }
:where(.page-home) .hero-visual { position: relative; display: flex; justify-content: center; }
:where(.page-home) .hero-visual img { width: 100%; max-width: 340px; border-radius: 34px; box-shadow: 0 40px 80px -20px rgba(10, 40, 45, 0.35); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):where(.page-home) .hero-visual img { box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6); }
}
:root[data-theme="dark"]:where(.page-home) .hero-visual img { box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6); }
/* ---------- features ---------- */
:where(.page-home) .features { padding: 20px 0 90px; }
:where(.page-home) .features h2 { font-family: var(--font-display); font-weight: 600; font-size: 30px; letter-spacing: -0.01em; margin: 0 0 44px; text-align: center; }
:where(.page-home) .feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
:where(.page-home) .feature { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 26px; }
:where(.page-home) .feature .icon { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
:where(.page-home) .feature .icon svg { width: 22px; height: 22px; }
:where(.page-home) .feature h3 { font-size: 17px; margin: 0 0 8px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
:where(.page-home) .feature p { font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); margin: 0; }
/* ---------- showcase ---------- */
:where(.page-home) .showcase { padding: 0 0 96px; }
:where(.page-home) .showcase .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
:where(.page-home) .showcase img { border-radius: 24px; box-shadow: 0 40px 80px -24px rgba(10, 40, 45, 0.3); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):where(.page-home) .showcase img { box-shadow: 0 40px 80px -24px rgba(0, 0, 0, 0.55); }
}
:root[data-theme="dark"]:where(.page-home) .showcase img { box-shadow: 0 40px 80px -24px rgba(0, 0, 0, 0.55); }
:where(.page-home) .showcase-copy .eyebrow { margin-bottom: 14px; }
:where(.page-home) .showcase-copy h2 { font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 18px; text-wrap: balance; }
:where(.page-home) .showcase-copy p { font-size: 16px; line-height: 1.65; color: var(--ink-soft); margin: 0 0 24px; max-width: 42ch; }
:where(.page-home) .showcase-copy ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
:where(.page-home) .showcase-copy li { display: flex; gap: 10px; font-size: 15px; color: var(--ink); }
:where(.page-home) .showcase-copy li::before { content: "—"; color: var(--accent); flex-shrink: 0; }
/* ---------- footer cta ---------- */
:where(.page-home) .footer-cta { background: linear-gradient(160deg, var(--accent-deep), var(--accent)); border-radius: 28px; margin: 0 24px 80px; padding: 64px 40px; text-align: center; }
:where(.page-home) .footer-cta h2 { font-family: var(--font-display); font-weight: 600; color: white; font-size: 34px; margin: 0 0 14px; }
:where(.page-home) .footer-cta p { color: rgba(255,255,255,0.85); font-size: 16px; margin: 0 0 30px; }
:where(.page-home) footer.site { border-top: 1px solid var(--line); padding: 32px 0 48px; }
:where(.page-home) footer.site .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
:where(.page-home) footer.site p { font-size: 13px; color: var(--ink-faint); margin: 0; }
:where(.page-home) footer.site nav { display: flex; gap: 20px; }
:where(.page-home) footer.site nav a { font-size: 13px; color: var(--ink-faint); text-decoration: none; }
:where(.page-home) footer.site nav a:hover { color: var(--accent); }
:where(.page-home) footer.site .attribution { flex-basis: 100%; display: grid; gap: 8px; max-width: 92ch; margin: 4px 0 0; }
:where(.page-home) footer.site .attribution p { font-size: 12px; line-height: 1.5; color: var(--ink-faint); margin: 0; }
:where(.page-home) footer.site .attribution a { color: inherit; text-decoration: underline; }
:where(.page-home) footer.site .attribution .admiralty { font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
:where(.page-home) .lang-switch { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; }
@media (max-width: 860px) {
  :where(.page-home) .hero .wrap { grid-template-columns: 1fr; }
  :where(.page-home) .hero-visual { order: -1; }
  :where(.page-home) .showcase .wrap { grid-template-columns: 1fr; }
  :where(.page-home) .showcase .hero-visual, :where(.page-home) .showcase img { order: -1; margin: 0 auto; }
}
/* Both navs gained a Coverage link, and neither could wrap: each was a
   three-item flex row that happened to fit. At 390px the fourth item
   pushed the header 192px past the viewport in French — measured, not
   guessed, after the whole page reported horizontal overflow in seven
   of eight languages and not in Japanese, which is the tell that it is
   text width rather than a box. */
:where(.page-home) nav.site-links { flex-wrap: wrap; justify-content: flex-end; gap: 10px 20px; }
:where(.page-home) footer.site nav { flex-wrap: wrap; }
@media (max-width: 560px) {
  :where(.page-home) header.site .wrap { flex-wrap: wrap; gap: 10px; }
  :where(.page-home) nav.site-links { gap: 8px 14px; font-size: 13.5px; }
}
/* Free / Pro marker on every feature card. Replaces the old .soon badge,
   which advertised two shipped features as forthcoming — one of them
   free. Stating the gate per card does the pricing work without a
   pricing table, and is harder to let drift than a prose claim. */
:where(.page-home) .feature .pill { font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); white-space: nowrap; }
:where(.page-home) .feature .pill.free { border-color: var(--ink-faint); color: var(--ink-faint); }
/* Six cards want three columns, not the four that a 230px minimum gives
   at this width — four leaves a widowed pair on the second row. */
:where(.page-home) .feature-grid { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
/* Screenshots are 1284x2778, so width alone is the wrong constraint: a
   phone sized to half a column comes out 600px tall and each band ends
   up the height of a screen. Everything below is capped by HEIGHT, with
   width following, which is what actually governs how far the page
   scrolls. */
:where(.page-home) .showcase + .showcase { padding-top: 8px; }
:where(.page-home) .showcase.reverse .wrap > .visual { order: 2; }
:where(.page-home) .visual { position: relative; display: flex; justify-content: center; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
:where(.page-home) .visual img { width: auto; max-width: 100%; max-height: 460px; border-radius: 22px; box-shadow: 0 30px 60px -22px rgba(10, 40, 45, 0.3); }
:where(.page-home) .hero .visual img { max-height: 620px; border-radius: 26px; }
:where(.page-home) .visual.pair img { max-height: 420px; }
/* One row of four rather than a 2x2: the Pro band names four surfaces,
   and four across says that in a quarter of the vertical space. */
:where(.page-home) .visual.quad { gap: 10px; flex-wrap: nowrap; }
:where(.page-home) .visual.quad img { max-height: 300px; min-width: 0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):where(.page-home) .visual img { box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.55); }
}
:root[data-theme="dark"]:where(.page-home) .visual img { box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.55); }
@media (max-width: 860px) {
  :where(.page-home) .visual.quad { flex-wrap: wrap; }
  :where(.page-home) .visual.quad img { max-height: 260px; max-width: calc(50% - 5px); }
}

/* ── privacy and accessibility (html.page-doc) ── */
:where(.page-doc) .wrap { max-width: 760px; margin: 0 auto; padding: 64px 24px 96px; }
:where(.page-doc) header.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 48px; }
:where(.page-doc) .mark { width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(160deg, var(--accent), var(--accent-deep)); flex-shrink: 0; }
:where(.page-doc) .brand { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
:where(.page-doc) h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 5.5vw, 46px); line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 14px; text-wrap: balance; }
:where(.page-doc) .dek { font-size: 17px; color: var(--ink-soft); line-height: 1.6; max-width: 56ch; margin: 0 0 8px; }
:where(.page-doc) .updated { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-faint); margin-top: 18px; }
:where(.page-doc) nav.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; margin: 40px 0 56px; }
:where(.page-doc) nav.toc p { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 12px; }
:where(.page-doc) nav.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
:where(.page-doc) nav.toc a { color: var(--ink); text-decoration: none; font-size: 15px; display: flex; gap: 10px; }
:where(.page-doc) nav.toc a:hover { color: var(--accent); }
:where(.page-doc) nav.toc a::before { content: counter(item); counter-increment: item; font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); min-width: 1.4em; }
:where(.page-doc) nav.toc ol { counter-reset: item; }
:where(.page-doc) section { margin: 0 0 44px; scroll-margin-top: 24px; }
:where(.page-doc) section h2 { font-family: var(--font-display); font-weight: 600; font-size: 25px; letter-spacing: -0.005em; margin: 0 0 14px; display: flex; align-items: baseline; gap: 10px; }
:where(.page-doc) section h2 .num { font-family: var(--font-mono); font-size: 14px; color: var(--accent); font-weight: 500; }
:where(.page-doc) section p, :where(.page-doc) section li { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); max-width: 62ch; }
:where(.page-doc) section p { margin: 0 0 14px; }
:where(.page-doc) section ul { margin: 0 0 14px; padding-left: 1.2em; }
:where(.page-doc) section li { margin-bottom: 8px; }
:where(.page-doc) strong { color: var(--ink); font-weight: 600; }
:where(.page-doc) .fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 18px 0 20px; }
:where(.page-doc) .fact { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
:where(.page-doc) .fact .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
:where(.page-doc) .fact .value { font-size: 14.5px; color: var(--ink); line-height: 1.5; }
:where(.page-doc) table { width: 100%; border-collapse: collapse; margin: 18px 0 20px; font-size: 14.5px; }
:where(.page-doc) th, :where(.page-doc) td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
:where(.page-doc) th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; }
:where(.page-doc) td { color: var(--ink-soft); }
:where(.page-doc) td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
@media (max-width: 560px) {
  /* Below this width the provider table would push past the edge — the
     first column does not wrap — so each row becomes a small stacked card:
     name, what it is for, then what it receives, labelled. */
  :where(.page-doc) #thirdparty table, :where(.page-doc) #thirdparty tbody, :where(.page-doc) #thirdparty tr, :where(.page-doc) #thirdparty td { display: block; }
  :where(.page-doc) #thirdparty thead { display: none; }
  :where(.page-doc) #thirdparty tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  :where(.page-doc) #thirdparty td { border: 0; padding: 2px 0; }
  :where(.page-doc) #thirdparty td:first-child { white-space: normal; }
  :where(.page-doc) #thirdparty td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-faint); }
}
:where(.page-doc) .contact-card { background: var(--accent-soft); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; }
:where(.page-doc) .contact-card p { color: var(--ink); }
:where(.page-doc) .contact-card .fine { color: var(--ink-soft); font-size: 14px; margin-top: 8px; }
:where(.page-doc) footer { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-faint); }
:where(.page-doc) a { color: var(--accent); }
@media (max-width: 480px) {
  :where(.page-doc) .wrap { padding: 44px 18px 72px; }
}
:where(.page-doc) a.brand-link { text-decoration: none; display: flex; align-items: center; gap: 14px; }
:where(.page-doc) .lang-switch { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; margin-top: 14px; }
:where(.page-doc) footer .attribution { display: grid; gap: 8px; max-width: 92ch; margin-top: 18px; }
:where(.page-doc) footer .attribution p { font-size: 12px; line-height: 1.5; margin: 0; }
:where(.page-doc) footer .attribution a { color: inherit; text-decoration: underline; }
:where(.page-doc) footer .attribution .admiralty { font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
:where(.page-doc) .translation-note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-size: 13.5px; color: var(--ink-soft); margin: 0 0 32px; }

/* ── 404 (html.page-404) ── */
:where(.page-404) .wrap { max-width: 640px; margin: 0 auto; padding: 64px 24px 96px; }
:where(.page-404) .brand-link { text-decoration: none; display: inline-flex; align-items: center; gap: 12px; color: inherit; }
:where(.page-404) .mark { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; background: linear-gradient(160deg, var(--accent), var(--accent-deep)); }
:where(.page-404) .brand-name { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
:where(.page-404) .eyebrow { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 56px 0 14px; }
:where(.page-404) h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 5vw, 48px); line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 18px; }
:where(.page-404) .lost-dek { font-size: 17px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 22px; }
:where(.page-404) a { color: var(--accent); }
:where(.page-404) .lang-switch { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
:where(.page-404) .lang-switch a { color: var(--accent); }

/* ── root redirects (html.page-redirect) ── */
html:where(.page-redirect), :where(.page-redirect) body { height: 100%; }
:where(.page-redirect) .redirect-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }
:where(.page-redirect) a { color: var(--accent); }
