/* FaraLink website. One stylesheet for every page: the Content-Security-Policy allows no inline
   styles, so page-specific rules live here too. Brand values live in :root. */
:root {
  /* FaraLink tokens, from the watch theme (CombadgeColors) built in the FaraLink Design chat. */
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #e7e8ea;
  --text: #1b1d20;
  --muted: #5d6066;
  --line: #d4d6da;
  --accent: #0e7490; /* 5.4:1 on white, 4.9:1 on --bg: AA for body text */
  --accent-ink: #ffffff;
  --accent-soft: #cff3fa;
  --action: #e09400;
  --action-ink: #1b1d20;
  --gold: #a8822e;
  --ok: #1f7a46;
  --watch: #b87400;
  --risk: #b3261e;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1d20; --surface: #24272b; --surface-2: #2c2f34; --text: #f4f4f5; --muted: #9a9ca1;
    --line: #3a3e44; --accent: #06b6d4; --accent-ink: #1e1e1e; --accent-soft: #0b3a44;
    --action: #ffb020; --action-ink: #1b1d20; --gold: #c9a24a;
    --ok: #4cc27f; --watch: #ffb020; --risk: #ff6b5e; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1d20; --surface: #24272b; --surface-2: #2c2f34; --text: #f4f4f5; --muted: #9a9ca1;
    --line: #3a3e44; --accent: #06b6d4; --accent-ink: #1e1e1e; --accent-soft: #0b3a44;
    --action: #ffb020; --action-ink: #1b1d20; --gold: #c9a24a;
    --ok: #4cc27f; --watch: #ffb020; --risk: #ff6b5e; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
img, svg { max-width: 100%; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Header and footer */
.top { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: #1b1d20; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; white-space: nowrap; padding: 8px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.foot { border-top: 1px solid var(--line); margin-top: 64px; padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
.foot .wrap { display: grid; gap: 10px; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: 8px; border: 2px solid var(--accent); }
.skip:focus { top: 8px; }
main:focus { outline: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Type and blocks */
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; margin: 0 0 6px; }
p { margin: 0 0 14px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
section { padding: 48px 0 8px; }
.hero { padding: 56px 0 24px; display: grid; gap: 32px; grid-template-columns: 1.1fr .9fr; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 600; }
.btn-primary { background: var(--action); color: var(--action-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; align-items: flex-start; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }

/* Route ladder */
.ladder { display: grid; gap: 12px; counter-reset: tier; }
.ladder li { list-style: none; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.ladder li::before { counter-increment: tier; content: counter(tier); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.ladder { padding: 0; margin: 0; }

/* Pricing */
.price { font-size: 2.2rem; font-weight: 700; margin: 4px 0; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.checks { padding: 0; margin: 12px 0 0; list-style: none; display: grid; gap: 8px; }
.checks li { padding-left: 24px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }

/* Watch face illustration */
.watch-hero { display: grid; place-items: center; }
.watch-hero svg { width: min(340px, 80vw); height: auto; }

/* Status tokens: color + text + shape */
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; font-family: var(--mono); }
.status::before { content: ""; width: 9px; height: 9px; }
.status.ok { color: var(--ok); } .status.ok::before { background: var(--ok); border-radius: 50%; }
.status.watch { color: var(--watch); } .status.watch::before { background: var(--watch); transform: rotate(45deg); }
.status.risk { color: var(--risk); } .status.risk::before { background: var(--risk); clip-path: polygon(50% 0, 100% 100%, 0 100%); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Shared page pieces */
.page-title { margin-top: 32px; }
.buy { display: inline-grid; gap: 4px; justify-items: start; margin: 8px 0 16px; }
.buy-note { margin: 0; font-size: .85rem; color: var(--muted); }
.card-accent { border-color: var(--accent); }
.plan { margin: 8px 0 4px; }

/* Legal pages */
.legal { max-width: 78ch; padding-top: 32px; }
.legal h2 { margin-top: 32px; }
.legal li { margin-bottom: 6px; }
.notice { background: var(--accent-soft); color: var(--text); border-radius: 10px; padding: 12px 16px; }
mark.tbd { background: #fff3c4; color: #1b1d20; padding: 0 3px; border-radius: 3px; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: 8px 10px; }
code { font-family: var(--mono); font-size: .9em; }

/* Security page */
.spec { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
  .spec dt { font-weight: 600; } .spec dd { margin: 0; color: var(--muted); }
  code { font-family: var(--mono); font-size: .9em; }
  @media (max-width: 620px) { .spec { grid-template-columns: 1fr; } .spec dd { margin-bottom: 8px; } }

/* Support page */
.support { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.support-col { padding-top: 8px; }
form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
.field-error { margin: 0; color: var(--risk); font-size: .88rem; font-weight: 600; }
.field-error:empty, #formError:empty { display: none; }
#formError { margin: 0; color: var(--risk); font-weight: 600; }
[aria-invalid="true"] { border-color: var(--risk) !important; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
textarea { min-height: 150px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; color: var(--muted); }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.hint { margin: 0; font-weight: 400; color: var(--muted); font-size: .85rem; }
.faqs { display: grid; gap: 10px; }
.faq { padding: 0; }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; position: relative; padding-right: 44px; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 14px; color: var(--accent); font-size: 1.3rem; }
.faq[open] summary::after { content: "-"; }
.faq p { padding: 0 20px 16px; margin: 0; }
@media (max-width: 820px) { .support { grid-template-columns: 1fr; } }

/* Pairing guide */
.pair { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: start; padding-top: 24px; }
  .stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
  .stage svg { display: block; width: 100%; height: auto; border-radius: 10px; }
  .steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
  .steps button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 34px 1fr; gap: 12px; width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
  .steps button:focus-visible, .toggle input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  .steps .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--muted); }
  .steps [aria-current="step"] { border-color: var(--accent); background: var(--accent-soft); }
  .steps [aria-current="step"] .n { background: var(--accent); color: var(--accent-ink); }
  .steps .done .n { background: var(--ok); color: #fff; }
  .steps h3 { margin: 4px 0 2px; font-size: 1rem; }
  .steps p { margin: 0; color: var(--muted); font-size: .92rem; }
  .controls { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
  .controls .btn { padding: 8px 14px; font-size: .9rem; }
  .controls .btn-primary { background: var(--accent); color: var(--accent-ink); }
  .toggle { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; font-size: .9rem; color: var(--muted); cursor: pointer; }
  .toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

  .scene [data-show] { opacity: 0; transition: opacity .45s ease; }
  .scene.s1 [data-show~="1"], .scene.s2 [data-show~="2"], .scene.s3 [data-show~="3"],
  .scene.s4 [data-show~="4"], .scene.s5 [data-show~="5"] { opacity: 1; }
  .cabin { transition: opacity .8s ease; }
  .scene.s1 .cabin, .scene.s2 .cabin { opacity: .35; }

  .wave { fill: none; stroke: #06B6D4; stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; }
  .scene.s3 .wave, .scene.s4 .wave { animation: wave 1.8s ease-out infinite; }
  .scene .wave.w2 { animation-delay: .6s; } .scene .wave.w3 { animation-delay: 1.2s; }
  @keyframes wave { 0% { opacity: .9; transform: scale(.45); } 100% { opacity: 0; transform: scale(1.7); } }

  .card-key { transition: transform 1.3s cubic-bezier(.3,.7,.2,1); }
  .scene.s4 .card-key, .scene.s5 .card-key { transform: translate(-216px, 32px); }
  .scene.pre2024.s4 .card-key, .scene.pre2024.s5 .card-key { transform: translate(-175px, 169px); }
  .reader { fill: transparent; stroke: transparent; stroke-width: 3; }
  .scene.s4 .reader { animation: pulse 1s ease-in-out infinite; }
  @keyframes pulse { 50% { stroke: #06B6D4; fill: rgba(6,182,212,.2); } }
  .scene .cup-reader { display: none; }
  .scene.pre2024 .pad-reader { display: none; } .scene.pre2024 .cup-reader { display: inline; }
  .tick { stroke-dasharray: 60; stroke-dashoffset: 60; }
  .scene.s5 .tick { animation: draw .7s .2s ease forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }

  @media (max-width: 820px) { .pair { grid-template-columns: 1fr; } .toggle { margin-left: 0; } }
