/* Optic website. Colours and type follow branding/README.md and branding/tokens.json. */

@font-face {
  font-family: "Optic Display";
  src: url("/assets/fonts/archivo-expanded-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --optic: #D6EE3A;
  --court: #1F4E89;
  --night: #0C1A2E;
  --chalk: #F2F4EF;
  --clay: #B5502A;
  --clay-ink: #E58A60;
  --net: #7B8794;
  --surface: #142742;
  --surface-high: #1B3354;
  --muted-dark: #AEB8C6;   /* secondary text on night/surface, 7:1 */
  --muted-light: #46546A;  /* secondary text on chalk, 7:1 */
  --line-light: rgba(12, 26, 46, 0.14);
  --line-dark: rgba(242, 244, 239, 0.16);

  --display: "Optic Display", "Archivo", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --text: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--night);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 720px) { body { font-size: 1.125rem; } }

img, svg { display: block; max-width: 100%; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--optic); color: var(--night); padding: 10px 14px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

a { color: var(--court); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--court); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible, .hero :focus-visible, .site-head :focus-visible, .site-foot :focus-visible {
  outline-color: var(--optic);
}

/* ---------- Display type ---------- */

.display {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
h2.display { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); }

/* ---------- Top navigation ---------- */

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; }
.nav ul { display: flex; gap: 22px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav a { color: var(--chalk); text-decoration: none; font-weight: 500; font-size: 1rem; }
.nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--optic); text-decoration-thickness: 2px; }
.nav .home img { height: 26px; width: auto; }

/* ---------- Hero ---------- */

.hero { background: var(--court); color: var(--chalk); overflow: hidden; }
.hero .wrap { position: relative; }
.hero-mark { padding-top: clamp(40px, 6vw, 72px); }
/* Pull the wordmark left by the o's side bearing so it lines up with the text below. */
.hero-mark svg { width: 100%; max-width: 1040px; height: auto; overflow: visible; margin-left: -1.9%; }

.hero-copy {
  display: grid;
  gap: 20px 48px;
  padding: clamp(28px, 5vw, 56px) 0 clamp(48px, 7vw, 88px);
}
@media (min-width: 900px) {
  .hero-copy { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
}
.tagline { font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.25rem); margin: 0; color: var(--chalk); }
.lede { max-width: 34em; margin: 0 0 22px; font-size: 1.125em; }
.soon { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0; color: var(--chalk); }
.tag {
  display: inline-block; background: var(--optic); color: var(--night);
  font-weight: 600; font-size: 0.95rem; padding: 7px 14px; border-radius: 999px;
}
.soon small { font-size: 0.95rem; opacity: 0.85; }

/* The baseline with its centre mark closes the hero. */
.baseline { position: relative; height: 16px; }
.baseline::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--chalk);
}
.baseline::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 3px; height: 12px;
  margin-left: -1.5px; background: var(--chalk);
}

/* The one moment of motion: the ball is tossed up to become the dot of the i. */
@media (prefers-reduced-motion: no-preference) {
  .toss { animation: toss 1.05s cubic-bezier(.333, .667, .667, 1) 0.25s both; }
  .trail-1 { animation: trail 0.45s ease-out 0.72s both; }
  .trail-2 { animation: trail 0.45s ease-out 0.62s both; }
}
@keyframes toss {
  0% { transform: translateY(980px); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes trail { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Sections ---------- */

.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-head { max-width: 38em; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { margin: 14px 0 0; color: var(--muted-light); }

/* How it works */
.how-grid { display: grid; gap: 40px 64px; }
@media (min-width: 900px) { .how-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }

.setup-figure { margin: 0; }
.setup-figure svg { width: 100%; height: auto; border-radius: 14px; }
.setup-figure figcaption { margin-top: 12px; font-size: 0.95rem; color: var(--muted-light); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 0 0 28px 64px; counter-increment: step; }
.steps li + li { padding-top: 28px; border-top: 1px solid var(--line-light); }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--court); color: var(--chalk);
  font-family: var(--display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em;
}
.steps h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin: 7px 0 8px; }
.steps p { margin: 0; color: var(--muted-light); }

/* What it checks (dark) */
.on-dark { background: var(--night); color: var(--chalk); }
.on-dark a { color: var(--chalk); }
.on-dark .section-head p { color: var(--muted-dark); }

.checks-grid { display: grid; gap: 48px 64px; }
@media (min-width: 900px) { .checks-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: start; } }

.phases { margin: 0; display: grid; gap: 0; }
.phases div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 4px 20px; padding: 16px 0; border-top: 1px solid var(--line-dark); }
.phases div:last-child { border-bottom: 1px solid var(--line-dark); }
.phases dt { font-weight: 600; }
.phases dd { margin: 0; color: var(--muted-dark); }
@media (max-width: 480px) { .phases div { grid-template-columns: 1fr; } }

/* Example result card, drawn like the app's breakdown */
.result { margin: 0; }
.card {
  background: var(--surface); border: 1px solid var(--surface-high); border-radius: 22px;
  padding: clamp(20px, 3vw, 28px);
}
.card-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.card-top .who { font-weight: 600; }
.card-top .who span { display: block; font-weight: 400; color: var(--muted-dark); font-size: 0.95rem; }
.score { font-family: var(--display); font-weight: 800; letter-spacing: -0.035em; font-size: 3.4rem; line-height: 0.9; color: var(--optic); }
.score small { font-family: var(--text); font-weight: 500; font-size: 0.9rem; letter-spacing: 0; color: var(--muted-dark); margin-left: 4px; }

.strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 0 0 18px; padding: 0; }
.strip li { display: grid; gap: 8px; font-size: 0.82rem; color: var(--muted-dark); }
.strip .bar { height: 10px; border-radius: 5px; }
.strip .in .bar { background: var(--optic); }
.strip .fix .bar { background: var(--clay); }
.strip .unsure .bar { background: var(--net); }
.strip .name { color: var(--chalk); font-weight: 500; }
.strip .state { display: block; white-space: nowrap; }
.strip .fix .state { color: var(--clay-ink); }
/* On phones the strip shows only the glyph; the word stays for screen readers. */
@media (max-width: 560px) {
  .strip .word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .strip .state { font-size: 1rem; }
}

.fix-next { background: var(--surface-high); border-radius: 14px; padding: 16px 18px; }
.fix-next h3 { font-size: 1rem; font-weight: 600; margin: 0 0 6px; color: var(--clay-ink); }
.fix-next p { margin: 0; }
.result figcaption { margin-top: 14px; font-size: 0.95rem; color: var(--muted-dark); max-width: 34em; }

/* Privacy band */
.private { display: grid; gap: 20px 64px; }
@media (min-width: 900px) { .private { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; } }
.private p { margin: 0 0 14px; }
.private .links { margin: 0; }

/* ---------- Sub-pages (privacy, support) ---------- */

.site-head { background: var(--court); color: var(--chalk); }
.page { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }
.page .wrap { max-width: calc(44rem + 2 * var(--gutter)); }
.page h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.25rem); margin-bottom: 12px; }
.page .meta { color: var(--muted-light); margin-bottom: 36px; }
.page h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; font-size: 1.4rem; line-height: 1.2; margin: 44px 0 12px; }
.page h3 { font-size: 1.125rem; font-weight: 600; margin: 26px 0 6px; }
.page ul { padding-left: 1.2em; margin: 0 0 1em; }
.page li { margin-bottom: 0.45em; }
.page .summary {
  background: var(--court); color: var(--chalk); border-radius: 18px; padding: 22px 24px; margin: 0 0 8px;
}
.page .summary p:last-child { margin-bottom: 0; }
.page .summary a { color: var(--chalk); }
.contact-box {
  border: 2px solid var(--court); border-radius: 18px; padding: 22px 24px; margin: 8px 0 12px;
}
.contact-box .email { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; font-size: clamp(1.15rem, 0.9rem + 1.4vw, 1.6rem); word-break: break-word; }
.contact-box p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */

.site-foot { background: var(--night); color: var(--muted-dark); padding: 40px 0 48px; font-size: 0.95rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.site-foot img { height: 24px; width: auto; }
.site-foot ul { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; }
.site-foot a { color: var(--chalk); }
.site-foot p { margin: 0; }
