/* Daily Path — palette v2 "Sunrise Arcade" (the app's src/constants/colors.ts and spec §4.1).
   Violet = act or climb; coral = earned; yellow = right now; green = cleared. Light: a cream-to-peach sunrise; dark: an indigo night. */
:root {
  color-scheme: light dark;
  --bg: #FFF3E6;
  --bg-top: #FFE2C7;
  --surface: #FFFFFF;
  --sunken: #FFE9D6;
  --line: #F1DCC8;
  --text: #1A1238;
  --muted: #5A4C7D;
  --primary: #6A3BFF;
  --primary-edge: #4A1FD6;
  --on-primary: #FFFFFF;
  --link: #5A2EE6;
  --spark: #FFC531;
  --on-spark: #1A1238;
  --sun: #FF5A36;
  --sun-text: #B8321A;
  --success: #0A7A50;
  --tile: #FFFFFF;
  --tile-edge: #F1DCC8;
  --tile-lit: #E4DAFF;
  --clue: #1A1238;
  --on-clue: #FFFFFF;
  --wall: #1A1238;
  --shadow: 0 18px 40px -24px rgba(26, 18, 56, 0.35);
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #140E30;
    --bg-top: #2A1A66;
    --surface: #231A4D;
    --sunken: #1B1440;
    --line: #33296A;
    --text: #FBF8FF;
    --muted: #BCB0E0;
    --primary: #9A78FF;
    --primary-edge: #6C4BE0;
    --on-primary: #140E30;
    --link: #B9A4FF;
    --spark: #FFD54A;
    --on-spark: #140E30;
    --sun: #FF7656;
    --sun-text: #FF9D82;
    --success: #38E0A2;
    --tile: #2B2160;
    --tile-edge: #1A1340;
    --tile-lit: #3B2B86;
    --clue: #FBF8FF;
    --on-clue: #140E30;
    --wall: #FBF8FF;
    --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--spark); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 999px; z-index: 10; font-weight: 700; }
.skip:focus { left: 16px; }
.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; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* Header */
.site-header { background: var(--bg-top); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; font-size: 15px; font-weight: 600; }
.site-nav a { color: var(--text); text-decoration: none; padding: 10px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--primary); text-decoration-thickness: 3px; }

/* Hero: the sunrise gradient continues from the header */
.eyebrow { display: inline-block; background: var(--spark); color: var(--on-spark); font-weight: 800; font-size: 14px; padding: 3px 12px; border-radius: 999px; margin: 0 0 16px; }
.hero h1 { font-size: clamp(40px, 10vw, 68px); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 16px; font-weight: 900; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 24px; max-width: 30em; }
.note { font-size: 15px; color: var(--muted); margin: 12px 0 0; }

/* App Store state: not a link until the listing exists */
.store-soon { margin: 0; display: inline-flex; align-items: center; gap: 12px; padding: 10px 18px 10px 14px; border: 2px dashed var(--muted); border-radius: 14px; line-height: 1.2; }
.store-soon svg { width: 26px; height: 26px; flex: none; fill: currentColor; }
.store-soon small { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.store-soon b { font-size: 18px; }

.board-card { background: var(--sunken); border-radius: 28px; padding: 14px; box-shadow: var(--shadow); }

/* Boards (inline SVG; invented examples) */
.board { display: block; width: 100%; height: auto; }
.bd-tile { fill: var(--tile); }
.bd-edge { fill: var(--tile-edge); }
.bd-lit { fill: var(--tile-lit); }
.bd-path { fill: none; stroke: var(--primary); stroke-width: 30; stroke-linecap: round; stroke-linejoin: round; }
.bd-head { fill: var(--primary); stroke: var(--spark); stroke-width: 8; }
.bd-wall { stroke: var(--wall); stroke-width: 9; stroke-linecap: round; }
.bd-clue { fill: var(--clue); }
.bd-num { fill: var(--on-clue); font: 800 38px/1 var(--font); text-anchor: middle; }
@media (prefers-reduced-motion: no-preference) {
  .bd-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s cubic-bezier(0.45, 0, 0.25, 1) 0.3s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* Sections */
section { padding: 48px 0; }
.section-title { font-size: clamp(28px, 6vw, 40px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 12px; font-weight: 900; }
.section-lede { color: var(--muted); margin: 0 0 28px; max-width: 36em; font-size: 18px; }
.band { background: var(--sunken); }

/* How a puzzle works */
.steps { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { background: var(--surface); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.steps .board { max-width: 220px; margin: 0 auto 14px; }
.steps h3 { font-size: 20px; margin: 0 0 4px; display: flex; gap: 10px; align-items: center; }
.steps h3::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 15px; }
.steps p { margin: 0; color: var(--muted); font-size: 16px; }

/* Split rows: text with art */
.split { display: grid; gap: 28px; align-items: center; }
.split .art { width: 160px; }
.ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 0.45em; width: 16px; height: 9px; border-left: 3px solid var(--success); border-bottom: 3px solid var(--success); transform: rotate(-45deg); }

/* The Daily's five camps */
.camps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; align-items: end; margin: 0 0 28px; padding: 0; list-style: none; max-width: 520px; }
.camps li { background: var(--primary); color: var(--on-primary); border-radius: 12px 12px 6px 6px; text-align: center; font-weight: 800; font-size: 14px; padding: 8px 2px; display: flex; align-items: flex-end; justify-content: center; }
.camps li:nth-child(1) { height: 48px; }
.camps li:nth-child(2) { height: 68px; }
.camps li:nth-child(3) { height: 88px; }
.camps li:nth-child(4) { height: 108px; }
.camps li:nth-child(5) { height: 128px; background: var(--sun); color: var(--on-spark); }

/* Example share card: always light, like the app's */
.share-card { background: #FFF3E6; color: #1A1238; border-radius: 22px; padding: 22px; max-width: 320px; width: 100%; justify-self: center; box-shadow: var(--shadow); text-align: center; border: 2px solid #F1DCC8; }
.share-card .tag { font-size: 12px; font-weight: 700; color: #5A4C7D; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; }
.share-card img { width: 120px; margin: 0 auto 8px; }
.share-card .big { font-size: 22px; font-weight: 900; line-height: 1.2; margin: 0 0 6px; }
.share-card .beat { color: #4A1FD6; font-weight: 800; margin: 0 0 6px; }
.share-card .stats { color: #5A4C7D; font-size: 15px; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.share-card .foot { font-size: 13px; color: #5A4C7D; border-top: 1px solid #F1DCC8; padding-top: 10px; margin: 0; }

/* The Journey */
.worlds { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.worlds li { background: var(--surface); border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 15px; }
.worlds li b { color: var(--muted); font-weight: 700; margin-right: 6px; }

/* Cards */
.cards { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.card { background: var(--surface); border-radius: 20px; padding: 22px 20px; box-shadow: var(--shadow); }
.card .art { width: 96px; margin: -4px 0 8px -4px; }
.card h3 { font-size: 21px; line-height: 1.25; margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.card p + p { margin-top: 8px; }


/* Plus */
.plus { background: var(--surface); border-radius: 28px; padding: 28px 22px; box-shadow: var(--shadow); display: grid; gap: 24px; }
.plus h2 { margin-top: 0; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.price { background: var(--sunken); border-radius: 16px; padding: 14px 16px; }
.price dt { font-weight: 700; color: var(--muted); font-size: 15px; }
.price dd { margin: 0; font-size: clamp(22px, 5vw, 28px); font-weight: 900; letter-spacing: -0.01em; }
.price dd small { display: block; font-size: 14px; font-weight: 700; color: var(--sun-text); letter-spacing: 0; }
.fine { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border-radius: 16px; padding: 0 18px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 800; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--primary); flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* Document pages (privacy, terms, support, your data) */
.doc { padding: 40px 0 56px; }
.doc h1 { font-size: clamp(32px, 8vw, 46px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 8px; font-weight: 900; }
.doc h2 { font-size: 22px; line-height: 1.3; margin: 36px 0 8px; }
.doc h3 { font-size: 18px; margin: 24px 0 6px; }
.doc .meta { color: var(--muted); font-size: 15px; margin: 0 0 28px; }
.doc .meta.tight { margin: 8px 0 0; }
.doc .summary { background: var(--surface); border-left: 5px solid var(--primary); border-radius: 0 16px 16px 0; padding: 16px 18px; margin: 0 0 8px; }
.doc .summary ul { margin: 8px 0 0; padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }
.doc .toc { font-size: 15px; }
.table-scroll { overflow-x: auto; margin: 8px 0; border-radius: 14px; background: var(--surface); }
.doc table { border-collapse: collapse; width: 100%; font-size: 16px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc tbody tr:last-child th, .doc tbody tr:last-child td { border-bottom: 0; }
.doc th { font-weight: 700; }
.status { display: inline-block; font-size: 13px; font-weight: 800; padding: 1px 10px; border-radius: 999px; white-space: nowrap; }
.status.on { background: var(--success); color: var(--on-primary); }
.status.when { background: var(--spark); color: var(--on-spark); }
.status.off { background: var(--sunken); color: var(--muted); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .status.on { color: #140E30; } }
.contact-card { background: var(--surface); border-radius: 16px; padding: 20px; margin: 16px 0 8px; box-shadow: var(--shadow); }
.contact-card p { margin: 0; }
.contact-card .email { font-size: 20px; font-weight: 800; }
.doc .art.small { width: 120px; margin: 0 0 12px; }
.lost { text-align: center; }
.lost .art { width: 200px; margin: 0 auto 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 15px; color: var(--muted); }
.site-footer .wrap { display: grid; gap: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-footer nav a { color: var(--text); display: inline-block; padding: 10px 0; }
.site-footer p { margin: 0; }

@media (min-width: 760px) {
  section { padding: 64px 0; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .split { grid-template-columns: 1.2fr 1fr; gap: 48px; }
  .split.flip > :first-child { order: 2; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .plus { grid-template-columns: 1.1fr 1fr; padding: 40px; align-items: center; }
  .site-footer .wrap { grid-template-columns: 1fr auto; align-items: center; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* Narrow phones: the brand and all three links on one line */
@media (max-width: 420px) {
  .site-nav { flex-wrap: nowrap; gap: 0 12px; font-size: 14px; }
  .brand { font-size: 17px; gap: 8px; }
}
@media (max-width: 359px) {
  .site-nav a[href$="#how"] { display: none; }
}
/* Narrow screens: tables become stacked cards, each cell labelled */
@media (max-width: 600px) {
  .doc table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .doc table.stack, .doc table.stack tbody, .doc table.stack tr, .doc table.stack td { display: block; }
  .doc table.stack tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .doc table.stack tbody tr:last-child { border-bottom: 0; }
  .doc table.stack td { border: 0; padding: 2px 0; }
  .doc table.stack td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
  .doc table.stack td + td { margin-top: 8px; }
  .doc table.stack ul { padding-left: 1.2em; margin: 4px 0 0; }
}

/* ---------------------------------------------------------------------------------------------------------------------
   Hero: the app's mountain scene as a full-bleed, layered backdrop (day in light, night in dark). Back to front: the sky
   art, twinkling stars (dark only), a scrim for the text, a misty far ridge, the near ridge that becomes the page, and the
   goat. With scroll-driven animations each layer moves at its own rate as the page scrolls; without them (or with reduced
   motion) it is the same composition, still. Only transforms move, so nothing shifts the layout. */
.hero { position: relative; overflow: clip; isolation: isolate; background: var(--bg-top); padding: 32px 0 0; }
.hero > .wrap { position: relative; z-index: 1; display: grid; gap: 32px; align-items: center; padding-bottom: 112px; }
.hero-scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.layer { position: absolute; display: block; }
/* Phones: the scene sits behind the lower half (the board); the text stays on the plain sky colour above it */
.layer-sky, .layer-stars { left: -35%; width: 170%; bottom: 0; aspect-ratio: 3 / 2; }
.layer-sky img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
.layer-sky::after { content: ""; position: absolute; inset: 0 0 auto; height: 42%; background: linear-gradient(var(--bg-top) 0 38%, rgba(0, 0, 0, 0)); background: linear-gradient(var(--bg-top) 0 38%, color-mix(in srgb, var(--bg-top) 0%, transparent)); }
.layer-stars { display: none; fill: #FFF6DC; }
.hero-scrim { display: none; inset: 0; }
.ridge-far, .ridge-near { left: 0; width: 100%; }
.ridge-far { bottom: 34px; height: 120px; fill: var(--bg); fill-opacity: 0.4; }
.ridge-near { bottom: -2px; height: 86px; fill: var(--bg); }
.hero-goat { width: 84px; left: 5%; bottom: 26px; }
.hero-art { position: relative; max-width: 420px; width: 100%; justify-self: center; }
@media (prefers-color-scheme: dark) {
  .layer-stars { display: block; }
}
@media (min-width: 760px) {
  .hero { padding: 56px 0 0; min-height: clamp(640px, 82vh, 780px); display: flex; align-items: center; }
  .hero > .wrap { grid-template-columns: 1.1fr 1fr; gap: 48px; padding-bottom: 140px; width: 100%; }
  .layer-sky, .layer-stars { inset: 0; left: 0; width: 100%; height: 100%; aspect-ratio: auto; }
  .layer-sky::after { height: 16%; }
  .hero-copy { max-width: 520px; }
  .hero-art { max-width: 400px; }
  /* Desktop: the text column sits on the sky's left; a scrim keeps it on a near-solid ground (AA over any art) */
  .hero-scrim { display: block; background: linear-gradient(90deg, var(--bg-top) 0 48%, rgba(0, 0, 0, 0) 70%); background: linear-gradient(90deg, var(--bg-top) 0 42%, color-mix(in srgb, var(--bg-top) 94%, transparent) 50%, color-mix(in srgb, var(--bg-top) 0%, transparent) 70%); }
  .ridge-far { bottom: 50px; height: 170px; }
  .ridge-near { height: 120px; }
  .hero-goat { width: 132px; left: 4%; bottom: 40px; }
}

/* Depth on scroll: CSS scroll-driven animations only (no JS), and never with reduced motion */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .layer-sky { animation: p-sky linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    .layer-stars { animation: p-stars linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    .ridge-far { animation: p-far linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    .hero-art { animation: p-board linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
  }
  .layer-stars circle { animation: twinkle 4.2s ease-in-out infinite; }
  .layer-stars .s2 { animation-duration: 5.6s; animation-delay: -1.7s; }
  .layer-stars .s3 { animation-duration: 3.3s; animation-delay: -2.4s; }
}
@keyframes p-sky { to { transform: translate3d(0, 24%, 0) scale(1.05); } }
@keyframes p-stars { to { transform: translate3d(0, 30%, 0); } }
@keyframes p-far { to { transform: translate3d(0, 38%, 0); } }
@keyframes p-board { to { transform: translate3d(0, -14%, 0); } }
@keyframes twinkle { 0%, 100% { opacity: 0.95; } 50% { opacity: 0.25; } }

/* Streak badges: the app's tier art, the number drawn in SVG inside each disc's clear white area
   (data/badge-fit.json, measured from the art). A centred row of four; two a row on phones. */
.streaks { margin-top: 56px; text-align: center; }
.streaks .section-lede { margin-left: auto; margin-right: auto; }
.badges { display: grid; grid-template-columns: repeat(4, minmax(0, 190px)); justify-content: center; gap: 20px 28px; margin: 0 auto; padding: 0; list-style: none; }
.badges li { text-align: center; }
.badge { position: relative; }
.badge img { width: 100%; }
.badge svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.badge text { fill: #1A1238; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-weight: 900; text-anchor: middle; font-variant-numeric: tabular-nums; }
.badges span { display: block; font-size: 15px; color: var(--muted); font-weight: 700; margin-top: 4px; }
@media (max-width: 600px) {
  .badges { grid-template-columns: repeat(2, minmax(0, 160px)); gap: 16px 20px; }
}
