/*
 * The landing page's styles (DAP-105). Colours are the app's own tokens (app/tokens.css),
 * copied rather than linked because this page is served from its own bucket and must not
 * depend on the app being up. tests/marketing-page.test.ts fails if a value here drifts from
 * the app's, so the two products keep one palette.
 *
 * Fonts are the device's own: a font file would be one more request, and a font from a
 * third party would break "no trackers on this page" and the content security policy.
 */
:root {
  --canvas: #f6f8f7;
  --surface: #ffffff;
  --surface-2: #f2f6f4;
  --border-subtle: #e0e8e5;
  --border-strong: #7c8f8b;
  --text-primary: #142a2b;
  --text-muted: #566a68;
  --action: #087f66;
  --action-fg: #ffffff;
  --action-soft: #e8f8f1;
  --mint: #66ddb1;
  --mint-fg: #142a2b;
  --warning: #8f5f00;
  --warning-soft: #fbefd0;
  --focus: #087f66;
  color-scheme: light;
  --radius: 12px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0e191a;
    --surface: #162426;
    --surface-2: #1b2d2f;
    --border-subtle: #2a3c3b;
    --border-strong: #7a9692;
    --text-primary: #f1f7f5;
    --text-muted: #c2d0cd;
    --action: #66ddb1;
    --action-fg: #142a2b;
    --action-soft: rgba(102, 221, 177, 0.12);
    --warning: #f0b429;
    --warning-soft: rgba(240, 180, 41, 0.12);
    --focus: #66ddb1;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font: 16px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); font-weight: 750; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0; }
a { color: inherit; }
strong { color: var(--text-primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.muted { color: var(--text-muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border-subtle); background: var(--canvas); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 68px; flex-wrap: wrap; padding-block: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.logo-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--mint); color: var(--mint-fg); font: 700 15px var(--mono); }
.logo-mark.small { width: 22px; height: 22px; font-size: 12px; border-radius: 6px; }
.logo-word { font-family: var(--mono); font-size: 1.05rem; }
.header-nav { display: flex; gap: 22px; margin-inline: auto; font-size: 0.92rem; }
.header-nav a { color: var(--text-muted); text-decoration: none; }
.header-nav a:hover { color: var(--text-primary); text-decoration: underline; }
.header-actions { display: flex; gap: 10px; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 10px; font-weight: 650; font-size: 0.95rem; text-decoration: none; border: 1px solid transparent; }
.button.large { min-height: 50px; padding: 0 22px; font-size: 1rem; }
.button.primary { background: var(--action); color: var(--action-fg); }
.button.primary:hover { filter: brightness(1.05); }
.button.secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text-primary); }
.button.secondary:hover { background: var(--surface-2); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.actions.center { justify-content: center; }

/* Hero */
.hero { padding-block: 56px 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center; }
.eyebrow-pill { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--action-soft); color: var(--text-primary); border: 1px solid var(--border-subtle); margin-bottom: 18px; }
.lead { font-size: 1.12rem; color: var(--text-muted); margin-block: 20px 26px; max-width: 60ch; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 6px; color: var(--text-muted); font-size: 0.92rem; }
.ticks li::before { content: "✓"; color: var(--action); font-weight: 700; margin-right: 10px; }

.hero-visual { position: relative; padding-bottom: 64px; }
.routine-card { position: relative; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 20px 22px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12); }
.kicker { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.routine-title { font-weight: 700; margin-top: 4px; padding-right: 64px; }
.score { position: absolute; top: 18px; right: 20px; width: 44px; height: 44px; display: grid; place-items: center; }
.score svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.score span { font-weight: 750; font-size: 0.85rem; }
.ring-track { fill: none; stroke: var(--border-subtle); stroke-width: 3.5; }
.ring-fill { fill: none; stroke: var(--action); stroke-width: 3.5; stroke-linecap: round; }
.score-caption { position: absolute; top: 64px; right: 14px; font-size: 0.68rem; color: var(--text-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 18px; }
.chip { font-size: 0.76rem; font-weight: 650; padding: 3px 9px; border-radius: 999px; }
.chip.good { background: var(--action-soft); color: var(--text-primary); }
.chip.warn { background: var(--warning-soft); color: var(--text-primary); }
.routine-foot { font-size: 0.82rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.run { margin-left: auto; background: var(--action); color: var(--action-fg); font-weight: 700; padding: 3px 10px; border-radius: 8px; font-size: 0.78rem; }
.ken-bubble { position: absolute; right: -8px; bottom: 0; width: min(88%, 300px); display: flex; gap: 10px; background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 12px 14px; font-size: 0.86rem; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14); }
.ken-avatar { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color: var(--mint-fg); font-weight: 700; font-size: 0.8rem; }

/* Sections */
.band { padding-block: 72px; border-top: 1px solid var(--border-subtle); }
.band.alt { background: var(--surface-2); }
.eyebrow { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--action); margin-bottom: 10px; }
.section-lead { color: var(--text-muted); margin-top: 14px; max-width: 62ch; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.cards { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 16px; }
.cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards.three { margin-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 20px; display: grid; gap: 8px; align-content: start; }
.card p { color: var(--text-muted); font-size: 0.92rem; }
.card .eyebrow { margin-bottom: 0; color: var(--action); font-size: 0.72rem; }
.icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--action-soft); color: var(--action); margin-bottom: 6px; }
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.round { border-radius: 50%; font-weight: 750; }
.icon.warm { background: var(--warning-soft); color: var(--warning); margin-bottom: 18px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.steps li { display: flex; gap: 14px; }
.step-number { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--mint); color: var(--mint-fg); font-weight: 750; }
.steps p { color: var(--text-muted); font-size: 0.94rem; margin-top: 4px; }

.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.promises li { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 14px 16px 14px 42px; position: relative; color: var(--text-muted); font-size: 0.92rem; }
.promises li::before { content: "✓"; position: absolute; left: 16px; top: 14px; color: var(--action); font-weight: 700; }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 44px 14px 16px; font-weight: 650; position: relative; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "⌄"; position: absolute; right: 16px; top: 10px; color: var(--text-muted); font-size: 1.2rem; }
.faq details[open] summary::after { content: "⌃"; top: 16px; }
.faq details p { padding: 0 16px 16px; color: var(--text-muted); }

.final { padding-block: 88px; border-top: 1px solid var(--border-subtle); text-align: center; }
.final .section-lead { margin-inline: auto; margin-bottom: 26px; }
.center { text-align: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--border-subtle); padding-block: 28px; font-size: 0.86rem; }
.footer-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: var(--text-muted); }

/* Narrower screens (board 53c): one column, the header's section links folded away. */
@media (max-width: 960px) {
  .cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-nav { display: none; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 760px) {
  .hero { padding-block: 32px 48px; }
  .hero-grid, .split, .cards.three { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .band { padding-block: 52px; }
}
@media (max-width: 520px) {
  .cards.four { grid-template-columns: minmax(0, 1fr); }
  /* Board 53c keeps the one primary action in the header; Sign in is repeated at the foot. */
  .header-actions .button.secondary { display: none; }
  .actions .button { flex: 1 1 100%; }
  .ken-bubble { right: 0; }
}
