/* nudg website. Same palette and type as the app (app/src/theme.ts). */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/space-grotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #FAF6F0;
  --surface: #FFFFFF;
  --text: #2A211B;
  --muted: #6B5D52;
  --border: #ECE3D8;
  --accent: #9AA4BF;
  --accent-deep: #475569;
  --sleep: #3B4A8C;
  --hrv: #2F7D6B;
  --spend: #E6A348;
  --spend-text: #8A5A12;
  --attention: #C4A6E8;
  --radius: 12px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: var(--accent-deep); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(44px, 8vw, 88px); letter-spacing: -0.045em; }
h2 { font-size: clamp(30px, 4.6vw, 48px); }
h3 { font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(19px, 2.2vw, 22px); color: var(--muted); max-width: 34em; }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.dot { color: var(--accent); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(250, 246, 240, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.site-header.scrolled { border-bottom-color: var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 22px; letter-spacing: -0.04em; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav a:hover { color: var(--accent-deep); }
@media (max-width: 720px) { .nav a.hide-sm { display: none; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent-deep); color: #fff; text-decoration: none; font-weight: 600;
  border-radius: 999px; padding: 14px 24px; font-size: 16px; border: 0; cursor: pointer;
}
.btn:hover { background: var(--text); color: #fff; }
.btn.small { padding: 9px 16px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--border); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--text); color: var(--text); }
.nav .btn { color: #fff; }

/* Hero */
.hero { padding: 72px 0 96px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero h1 .dot { display: inline-block; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; align-items: center; }
.hero .note { font-size: 14px; color: var(--muted); margin-top: 16px; }
@media (max-width: 880px) {
  .hero { padding: 40px 0 64px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
}

/* Phone frame */
.phone {
  width: 100%; max-width: 320px; margin: 0 auto; aspect-ratio: 9 / 19.2;
  background: var(--text); border-radius: 46px; padding: 10px;
  box-shadow: 0 30px 60px -20px rgba(42, 33, 27, 0.35);
}
.phone .screen { width: 100%; height: 100%; border-radius: 37px; overflow: hidden; background: var(--bg); position: relative; }
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; }

/* App screen mock */
.mock { padding: 44px 18px 18px; height: 100%; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.mock .top { display: flex; justify-content: space-between; align-items: baseline; }
.mock .hello { font-weight: 700; font-size: 20px; letter-spacing: -0.03em; }
.mock .date { color: var(--muted); font-size: 12px; }
.mock .ringbox { background: var(--surface); border-radius: 18px; padding: 16px; display: flex; align-items: center; gap: 14px; }
.mock .ringbox svg { width: 96px; height: 96px; flex: none; }
.mock .legend { display: grid; gap: 6px; font-size: 12px; }
.mock .legend span { display: flex; align-items: center; gap: 6px; }
.mock .legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.mock .card { background: var(--surface); border-radius: 18px; padding: 14px; }
.mock .tag { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted); }
.mock .card b { display: block; font-size: 15px; letter-spacing: -0.02em; line-height: 1.25; margin: 4px 0 6px; }
.mock .bars { display: flex; gap: 8px; align-items: flex-end; height: 54px; margin-top: 6px; }
.mock .bars div { flex: 1; border-radius: 6px 6px 3px 3px; background: var(--spend); }
.mock .bars div.lo { background: var(--border); }
.mock .barlabels { display: flex; gap: 8px; font-size: 10px; color: var(--muted); }
.mock .barlabels span { flex: 1; text-align: center; }
.mock .limit { display: flex; align-items: center; justify-content: space-between; }
.mock .pill { background: var(--bg); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 600; }

/* Sections */
section { padding: 88px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (max-width: 600px) { section { padding: 64px 0; } }
.section-head { max-width: 40em; margin-bottom: 48px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--bg); border-radius: 20px; padding: 28px; }
section:not(.alt) .step { background: var(--surface); }
.step .num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; margin-bottom: 18px; color: #fff; }
.step p { color: var(--muted); margin: 0; }
@media (max-width: 880px) { .steps { grid-template-columns: 1fr; } }

/* Signals strip */
.signals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.signal { border-top: 3px solid var(--c); padding-top: 18px; }
.signal p { color: var(--muted); margin: 0; font-size: 16px; }
@media (max-width: 880px) { .signals { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .signals { grid-template-columns: 1fr; } }

/* Insight cards */
.insights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.insight { background: var(--bg); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.insight .tag { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted); }
.insight h3 { margin: 0; }
.insight p { color: var(--muted); margin: 0; font-size: 16px; }
.insights-note { font-size: 14px; color: var(--muted); margin-top: 20px; }
@media (max-width: 880px) { .insights { grid-template-columns: 1fr; } }

/* Split feature */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.split li { display: flex; gap: 12px; align-items: flex-start; }
.split li::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex: none; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; gap: 40px; } }

/* FAQ */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--border); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 19px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--muted); margin: 12px 0 0; }

/* Closing band */
.closing { text-align: center; }
.closing h2 { font-size: clamp(36px, 6vw, 64px); }
.closing .cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 48px; font-size: 15px; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer small { display: block; margin-top: 8px; max-width: 34em; }

/* Long-form pages (science, privacy, terms) */
.doc { padding: 56px 0 96px; }
.doc .wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; }
.doc .toc { position: sticky; top: 88px; align-self: start; font-size: 15px; }
.doc .toc a { display: block; color: var(--muted); text-decoration: none; padding: 5px 0; }
.doc .toc a:hover { color: var(--text); }
.doc article { max-width: 720px; }
.doc article h1 { font-size: clamp(40px, 6vw, 64px); }
.doc article h2 { font-size: 30px; margin-top: 56px; scroll-margin-top: 88px; }
.doc article h3 { margin-top: 28px; }
.doc article ul, .doc article ol { padding-left: 22px; }
.doc article li { margin-bottom: 6px; }
.doc .meta { color: var(--muted); font-size: 15px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0 24px; }
.doc th, .doc td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc th { font-weight: 600; }
.table-scroll { overflow-x: auto; }
.callout { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 16px 20px; margin: 24px 0; }
.callout p:last-child { margin: 0; }
.draft { border-left-color: var(--spend); }
.sources { font-size: 15px; color: var(--muted); }
.sources li { margin-bottom: 8px; }
.metric { scroll-margin-top: 88px; }
.metric .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; vertical-align: 2px; }
@media (max-width: 880px) {
  .doc .wrap { grid-template-columns: 1fr; gap: 24px; }
  .doc .toc { position: static; display: none; }
}

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 20; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (max-width: 600px) { .hero .phone { max-width: 250px; } }
