/* knute's landing page. Colors, radii and motion are the app's:
   ios-native/Knute/Theme/Tokens.swift holds the values, DESIGN.md the rules. */

@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url(/fonts/space-grotesk-700.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 500; font-display: swap; src: url(/fonts/nunito-500.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 800; font-display: swap; src: url(/fonts/nunito-800.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 900; font-display: swap; src: url(/fonts/nunito-900.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url(/fonts/jetbrains-mono-500.woff2) format("woff2"); }

:root {
  /* SchemePalette.light */
  --bg0: #F4F6FA; --bg1: #FFFFFF; --bg2: #EDF1F7; --bg3: #DBE1EC; --bg4: #BFC7D5;
  --ink1: #161A24; --ink2: #4B5468; --ink3: #5A6373; --ink4: #9AA1B2;
  --line: rgba(15, 20, 35, 0.10);
  --card-shadow: 0 6px 18px rgba(15, 20, 35, 0.10), 0 2px 6px rgba(15, 20, 35, 0.06);
  /* Brand.Theme and the pre-app canvas */
  --sheet: #D9E9FF; --sheet-ink: #161A24; --sheet-ink2: #4B5468; --sheet-wash: rgba(22, 26, 36, 0.16);
  --deep: #1F63C9; --deep-rim: #174A9E; --on-deep: #FFFFFF;
  --accent-ink: #1B5FB5;
  /* Brand.Neon, with each fill's InkOn */
  --blue: #5BB0FF; --green: #6EE7A7; --yellow: #FFD24A; --amber: #F2A33A; --red: #FF6B85; --purple: #B891FF; --cyan: #6EE7E7;
  --on-blue: #0A2745; --on-green: #07331C; --on-yellow: #3A2B0A; --on-red: #3D0A16; --on-purple: #2A1A4A; --on-cyan: #0B6363;
  /* A hue as text: the deep companion in light, the neon in dark */
  --blue-text: #1B5FB5; --purple-text: #5538B5; --green-text: #14794D; --red-text: #B0263B;
  /* Tinted cards: the neon's wash and border */
  --wash: 18%; --wash-edge: 30%;

  --display: "Space Grotesk", Nunito, -apple-system, sans-serif;
  --sans: Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring: cubic-bezier(0.5, 1.4, 0.5, 1);
  --gutter: clamp(20px, 5vw, 48px);
  --section: clamp(64px, 9vw, 120px);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* SchemePalette.dark */
    --bg0: #0B0E14; --bg1: #11151E; --bg2: #1A2030; --bg3: #242C40; --bg4: #2F3A52;
    --ink1: #FFFFFF; --ink2: #C9D1E0; --ink3: #9EA8BE; --ink4: #5A6478;
    --line: rgba(255, 255, 255, 0.14);
    --card-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
    /* BrandCanvas.night */
    --sheet: #1C2A3F; --sheet-ink: #F3F5F9; --sheet-ink2: #B9C0CE; --sheet-wash: rgba(255, 255, 255, 0.14);
    --accent-ink: #5BB0FF;
    --blue-text: #5BB0FF; --purple-text: #B891FF; --green-text: #6EE7A7; --red-text: #FF6B85;
    --wash: 13%; --wash-edge: 34%;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg0); color: var(--ink1); font: 500 1.0625rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol, dl, dd { margin: 0; }
ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
strong { font-weight: 800; }

h1, h2 { font-family: var(--display); font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 1.5rem + 4.6vw, 4.75rem); line-height: 1.02; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.875rem, 1.3rem + 2.4vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; line-height: 1.2; font-weight: 800; }
p { text-wrap: pretty; }
a { color: inherit; }
.quiet { color: var(--ink3); }

.wrap { width: min(100%, 1120px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 12px; top: -64px; z-index: 2; padding: 12px 16px; border-radius: 14px; background: var(--deep); color: var(--on-deep); font-weight: 800; }
.skip:focus { top: 12px; }

/* Focus is a 2px accent stroke; nothing glows (DESIGN.md). */
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }

/* ---- Buttons: a face on a darker rim that collapses on press ---- */
.btn {
  --top: var(--deep); --rim: var(--deep-rim); --label: var(--on-deep);
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 24px; margin-bottom: 4px;
  border: 0; border-radius: 20px; background: var(--top); color: var(--label);
  box-shadow: 0 4px 0 var(--rim);
  font: 800 1.0625rem/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 140ms var(--bounce), box-shadow 140ms var(--bounce);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--rim); }
.btn-xl { min-height: 64px; padding: 0 32px; font-size: 1.1875rem; }
.btn-full { width: 100%; }
.btn-danger { --top: var(--red); --rim: #C92A4D; --label: var(--on-red); }
.btn-ghost { --top: transparent; --rim: transparent; --label: var(--ink1); box-shadow: inset 0 0 0 2px var(--line); margin-bottom: 0; }
/* The runner's idle Check: neutral until every pointer is placed. */
.btn:disabled { --top: var(--bg3); --rim: var(--bg4); --label: var(--ink3); cursor: default; }
.btn:disabled:active { transform: none; box-shadow: 0 4px 0 var(--rim); }

.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---- The pre-app canvas: the pastel sheet, or night on a dark screen ---- */
.sheet { background: var(--sheet); color: var(--sheet-ink); }
@media (prefers-color-scheme: dark) {
  /* Btn.pastel: the primary button on the night canvas. */
  .sheet .btn-primary { --top: #D9E9FF; --rim: #A3C1EA; --label: #0A2745; }
  .sheet { --accent-ink: #D9E9FF; }
}

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font: 700 1.5rem/1 var(--display); letter-spacing: -0.02em; text-decoration: none; }
.wordmark img { border-radius: 8px; box-shadow: 0 0 0 1px var(--sheet-wash); }

.hero { display: grid; align-items: center; gap: 8px 48px; padding-block: clamp(24px, 4vw, 56px) calc(clamp(56px, 8vw, 104px) + 36px); }
.hero-copy { display: grid; justify-items: start; gap: 24px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; white-space: nowrap; border-radius: 999px; background: var(--sheet-wash); font-size: 0.875rem; font-weight: 800; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #2BC36B; }
.lede { max-width: 34em; font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem); color: var(--sheet-ink2); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 8px; }
.hero-knute { width: min(60vw, 240px); justify-self: center; order: -1; animation: bob 3.2s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(-5px); } to { transform: translateY(5px); } }

@media (min-width: 880px) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
  .hero-knute { width: min(100%, 460px); order: 0; justify-self: end; }
}

/* ---- Try one: the app's canvas rising over the sheet, with one white card ---- */
.try { position: relative; margin-top: -36px; padding-block: var(--section); border-radius: 36px 36px 0 0; background: var(--bg0); }
.try-grid { display: grid; align-items: center; gap: 40px 64px; }
.try-copy { display: grid; gap: 16px; max-width: 30em; }
.try-copy p { color: var(--ink2); }
.try-copy .quiet { color: var(--ink3); }
@media (min-width: 880px) { .try-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }

.question { display: grid; gap: 20px; width: 100%; max-width: 500px; justify-self: center; padding: clamp(20px, 3vw, 32px); border-radius: 28px; background: var(--bg1); box-shadow: var(--card-shadow); }
.q-prompt { font-size: 1.1875rem; line-height: 1.4; font-weight: 800; }
.q-chips { display: flex; gap: 8px; }
.chip { position: relative; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--bg2); color: var(--ink3); font: 800 0.8125rem/1.4 var(--sans); cursor: pointer; }
.chip::after { content: ""; position: absolute; inset: -8px -2px; }
.chip[aria-pressed="true"] { color: #0A0A14; }
.chip[aria-pressed="true"][data-pointer="0"] { background: var(--blue); }
.chip[aria-pressed="true"][data-pointer="1"] { background: var(--purple); }

.q-cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(6px, 1.6vw, 8px); padding-block: 8px; }
.cell { display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.cell-holders { display: flex; justify-content: center; gap: 4px; height: 14px; font: 800 0.6875rem/14px var(--sans); white-space: nowrap; }
.cell-holders .p0 { color: var(--blue-text); }
.cell-holders .p1 { color: var(--purple-text); }
.cell-value { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border: 2px solid transparent; border-radius: 8px; background: var(--bg2); font: 500 clamp(1.0625rem, 0.9rem + 0.8vw, 1.375rem)/1 var(--mono); font-variant-ligatures: none; transition: transform 140ms var(--spring); }
.cell:active:not(:disabled) .cell-value { transform: scale(0.94); }
.cell[data-holder] .cell-value { background: var(--bg3); }
.cell[data-holder="0"] .cell-value { border-color: var(--blue); }
.cell[data-holder="1"] .cell-value { border-color: var(--purple); }
.cell-index { font: 800 0.6875rem/1.2 var(--sans); color: var(--ink3); }
.cell:focus-visible { outline: none; }
.cell:focus-visible .cell-value { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.chip:disabled, .cell:disabled { cursor: default; }

.q-result { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 16px; padding: 16px; border: 1px solid; border-radius: 20px; animation: pop 420ms var(--bounce) both; }
.q-result[data-state="right"] { background: rgba(110, 231, 167, 0.12); border-color: rgba(110, 231, 167, 0.30); }
.q-result[data-state="wrong"] { background: rgba(255, 107, 133, 0.10); border-color: rgba(255, 107, 133, 0.35); }
.q-result-title { font-weight: 800; }
.q-result[data-state="right"] .q-result-title { color: var(--green-text); }
.q-result[data-state="wrong"] .q-result-title { color: var(--red-text); }
.q-result p + p { color: var(--ink2); font-size: 1rem; }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } }
.q-actions { display: grid; gap: 12px; }

/* ---- What a lesson is made of ---- */
.kinds { padding-block: var(--section); background: var(--bg1); }
.kinds h2 { max-width: 16em; }
.kind-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 40px 56px; margin-top: clamp(40px, 5vw, 64px); }
.kind-list dt { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; line-height: 1.2; font-weight: 800; }
/* One of Knute's plates beside each kind, in the units' color cycle. */
.kind-list dt::before { content: ""; flex: none; width: 28px; height: 14px; border-radius: 999px; background: var(--plate); }
.kind-list dd { margin-top: 8px; padding-left: 40px; color: var(--ink2); }
.kind-list div:nth-child(6n + 1) { --plate: var(--blue); }
.kind-list div:nth-child(6n + 2) { --plate: var(--green); }
.kind-list div:nth-child(6n + 3) { --plate: var(--purple); }
.kind-list div:nth-child(6n + 4) { --plate: var(--yellow); }
.kind-list div:nth-child(6n + 5) { --plate: var(--cyan); }
.kind-list div:nth-child(6n + 6) { --plate: var(--amber); }

/* ---- The course: each track a stack, every plate wider than the one above ---- */
.path { padding-block: var(--section); }
.path-head { display: grid; gap: 16px; max-width: 38em; }
.path-head p { color: var(--ink2); font-size: 1.125rem; }
.tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 56px 40px; margin-top: clamp(40px, 5vw, 64px); }
.track { display: grid; align-content: start; justify-items: center; gap: 8px; text-align: center; }
.track p { max-width: 22em; color: var(--ink3); font-size: 1rem; }
.stack { display: grid; justify-items: center; gap: 6px; width: 100%; margin-top: 16px; }
.stack li { display: grid; place-items: center; min-height: 48px; padding: 8px 20px; border-radius: 999px; background: var(--fill); color: var(--on); font-size: 1rem; line-height: 1.2; font-weight: 800; }
.stack li:nth-child(1) { width: 58%; }
.stack li:nth-child(2) { width: 65%; }
.stack li:nth-child(3) { width: 72%; }
.stack li:nth-child(4) { width: 79%; }
.stack li:nth-child(5) { width: 86%; }
.stack li:nth-child(6) { width: 93%; }
.stack li:nth-child(7) { width: 100%; }
.stack li:nth-child(6n + 1) { --fill: var(--blue); --on: var(--on-blue); }
.stack li:nth-child(6n + 2) { --fill: var(--green); --on: var(--on-green); }
.stack li:nth-child(6n + 3) { --fill: var(--purple); --on: var(--on-purple); }
.stack li:nth-child(6n + 4) { --fill: var(--yellow); --on: var(--on-yellow); }
.stack li:nth-child(6n + 5) { --fill: var(--cyan); --on: var(--on-cyan); }
.stack li:nth-child(6n + 6) { --fill: var(--amber); --on: var(--on-yellow); }

/* ---- The habit loop: four tinted cards, each wearing the hue of its own art ---- */
.habit { padding-block: var(--section); background: var(--bg1); }
.tiles { display: grid; gap: 20px; margin-top: clamp(40px, 5vw, 64px); }
.tile { display: grid; align-content: start; gap: 8px; padding: clamp(20px, 3vw, 32px); border: 1px solid color-mix(in srgb, var(--hue) var(--wash-edge), transparent); border-radius: 28px; background: color-mix(in srgb, var(--hue) var(--wash), var(--bg1)); }
.tile p { max-width: 30em; color: var(--ink2); }
.tile-art { display: flex; align-items: flex-end; min-height: 72px; margin-bottom: 16px; }
.tile-streak { --hue: var(--yellow); }
.tile-daily { --hue: var(--purple); }
.tile-leagues { --hue: var(--blue); }
.tile-beat { --hue: var(--green); }
@media (min-width: 760px) {
  .tiles { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .tile-streak, .tile-beat { grid-column: span 7; }
  .tile-daily, .tile-leagues { grid-column: span 5; }
}

.week { gap: 6px; }
.day { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--ink1) 10%, transparent); color: var(--ink3); font-size: 0.8125rem; font-weight: 900; }
.day.on { background: var(--yellow); color: var(--on-yellow); }

.podium { gap: 6px; }
.plinth { display: grid; place-items: center; width: 52px; border-radius: 14px 14px 6px 6px; color: #1A1A26; font-weight: 900; }
.plinth.gold { height: 72px; background: #FFD24A; }
.plinth.silver { height: 54px; background: #C9CFDC; }
.plinth.bronze { height: 40px; background: #E0A572; }

.board { display: grid; grid-template-columns: repeat(3, 26px); gap: 4px; align-items: stretch; }
.board span { display: grid; place-items: center; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--ink1) 8%, transparent); font: 900 1.125rem/1 var(--sans); }
.board .o::before { content: ""; width: 12px; height: 12px; border: 3px solid var(--blue-text); border-radius: 50%; }

/* ---- The last word, back on the sheet ---- */
.final { display: grid; justify-items: center; gap: 16px; padding-block: var(--section) clamp(40px, 6vw, 72px); text-align: center; }
.final img { width: 168px; margin-bottom: 8px; }
.final p { max-width: 30em; color: var(--sheet-ink2); font-size: 1.125rem; }
.final .btn { margin-top: 16px; }
.foot { border-top: 1px solid var(--sheet-wash); color: var(--sheet-ink2); font-size: 0.9375rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 24px; padding-block: 16px 24px; }
.foot a { display: inline-block; padding-block: 10px; font-weight: 800; text-underline-offset: 3px; }

/* Reduce Motion: celebrations resolve without bouncing and idle motion holds still. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-knute, .q-result { animation: none; }
  .btn, .cell-value { transition: none; }
}
