/* ============================================================
   Lumi — landing page
   Aesthetic: "sun-faded 70s" — warm sand paper, espresso ink,
   muted rust / olive / mustard. Editorial serif, sharp corners.
   Tokens mirror the app's Color+Bound.swift palette.
   ============================================================ */

:root {
  /* surfaces */
  --bg:        #EDE4D3;  /* sand */
  --paper:     #F4EAD6;  /* lighter paper */
  --surface:   #E4D8C1;  /* tan card */
  --hairline:  rgba(58, 48, 39, 0.16);

  /* ink */
  --ink:       #3A3027;  /* espresso */
  --ink-soft:  #7A6E5F;  /* faded */

  /* brand */
  --rust:      #A8553B;
  --rust-deep: #8A3B1E;
  --mustard:   #B98A3C;
  --olive:     #6E7A4F;
  --cream:     #F7F1E6;  /* onAccent */

  /* flame */
  --flame-top: #F6C16A;
  --flame-bot: #DD7A3C;

  --corner: 4px;        /* sharp, near-square */
  --maxw: 1120px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* subtle paper grain via layered gradients */
  background-image:
    radial-gradient(ellipse at 20% -10%, rgba(244, 234, 214, 0.7), transparent 55%),
    radial-gradient(ellipse at 100% 0%, rgba(185, 138, 60, 0.10), transparent 45%);
  background-attachment: fixed;
}

h1, h2, h3, .brand-name { font-family: var(--serif); font-weight: 600; line-height: 1.06; letter-spacing: -0.01em; }

a { color: inherit; text-decoration: none; }

.ink-rust  { color: var(--rust); }
.ink-faded { color: var(--ink-soft); }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  padding: 0.85em 1.4em; border-radius: var(--corner);
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--rust); color: var(--cream);
  box-shadow: 0 2px 0 var(--rust-deep);
}
.btn-primary:hover { background: #97492f; }

.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--hairline);
}
.btn-ghost:hover { background: rgba(58,48,39,0.05); }

.btn-appstore {
  background: var(--ink); color: var(--cream);
  border-radius: var(--corner);
}
.btn-appstore:hover { background: #2a221b; }

/* ── header ────────────────────────────────────────────── */
.site-header {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.55rem; }
.brand-mark { border-radius: 8px; }
.brand-name { font-size: 1.5rem; font-weight: 700; }
.nav { display: flex; align-items: center; gap: 1.6rem; font-weight: 500; }
.nav a { color: var(--ink-soft); }
.nav a:hover { color: var(--ink); }
.nav-cta {
  color: var(--ink) !important; border: 1px solid var(--hairline);
  padding: 0.5em 1em; border-radius: var(--corner);
}
.nav-cta:hover { background: rgba(58,48,39,0.05); }

/* ── hero ──────────────────────────────────────────────── */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3rem;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.78rem;
  font-weight: 600; color: var(--rust); margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(3rem, 7vw, 5.2rem); }
.lede {
  margin: 1.4rem 0 2rem; font-size: 1.18rem; color: var(--ink-soft);
  max-width: 30ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero-foot { margin-top: 1.4rem; font-size: 0.92rem; color: var(--ink-soft); font-style: italic; }

/* ── phone mockups ─────────────────────────────────────── */
.hero-art { position: relative; display: flex; justify-content: center; }

.phone {
  background: #1f242a; border-radius: 34px; padding: 10px;
  box-shadow: 0 30px 60px -20px rgba(58,36,16,0.45), 0 0 0 1px rgba(0,0,0,0.2);
  position: relative;
}
.phone-tilt { transform: rotate(-3deg); }
.phone-notch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 84px; height: 20px; background: #1f242a; border-radius: 0 0 14px 14px; z-index: 3;
}
.phone-screen {
  width: 268px; aspect-ratio: 9 / 19.3; border-radius: 26px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 2.6rem 1.4rem 1.6rem; text-align: center;
}

/* main screen: shield + mascot, on warm paper */
.screen-shield { background: linear-gradient(180deg, #F4EAD6, #E4D8C1); color: var(--ink); }
.shield-blocked {
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--rust); background: rgba(168,85,59,0.10);
  border: 1px solid rgba(168,85,59,0.25); padding: 0.35em 0.8em; border-radius: 999px;
}
.mascot-wrap { margin: auto 0 0.5rem; }
.mascot { width: 130px; height: 130px; display: block; animation: bob 3.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.shield-line { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 0.4rem 0 auto; line-height: 1.25; }
.shield-cta {
  width: 100%; background: var(--rust); color: var(--cream);
  font-weight: 600; padding: 0.8em; border-radius: var(--corner); font-size: 0.95rem;
}

/* secondary small screen: reader */
.phone-small {
  position: absolute; right: -18px; bottom: -36px; transform: rotate(5deg);
  border-radius: 28px; padding: 8px;
}
.phone-small .phone-screen {
  width: 188px; aspect-ratio: 9 / 16; padding: 1.3rem 1.1rem;
  align-items: flex-start; text-align: left; border-radius: 22px;
}
.screen-read { background: #20262d; color: #E9E3D5; }
.read-label { font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: #97A1AC; }
.read-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; margin-top: 0.3rem; }
.read-author { font-size: 0.72rem; color: #97A1AC; margin-bottom: 0.7rem; }
.read-quote { font-family: var(--serif); font-style: italic; font-size: 0.82rem; line-height: 1.5; color: #E9E3D5; }
.read-progress { margin-top: auto; width: 100%; height: 4px; background: rgba(255,255,255,0.12); border-radius: 999px; }
.read-progress span { display: block; height: 100%; background: var(--mustard); border-radius: 999px; }

/* ── shared section bits ───────────────────────────────── */
.section-kicker {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.78rem;
  font-weight: 600; color: var(--rust); text-align: center; margin-bottom: 0.9rem;
}
.section-head {
  font-size: clamp(2rem, 4vw, 2.9rem); text-align: center; max-width: 18ch;
  margin: 0 auto 3rem;
}

/* ── problem / stats ───────────────────────────────────── */
.problem {
  background: var(--ink); color: var(--cream);
  padding: 5rem 1.5rem;
}
.problem .section-kicker { color: var(--mustard); }
.problem-head {
  font-family: var(--serif); font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 600;
  text-align: center; max-width: 20ch; margin: 0 auto 3.5rem; color: var(--cream);
}
.problem-head .ink-faded { color: #b3a48e; }
.stats {
  max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  text-align: center;
}
.stat { display: flex; flex-direction: column; gap: 0.6rem; }
.stat-num { font-family: var(--serif); font-size: clamp(2.8rem, 6vw, 4rem); font-weight: 600; color: var(--flame-top); line-height: 1; }
.stat-unit { font-size: 0.42em; color: #b3a48e; margin-left: 0.15em; }
.stat-cap { color: #c8bba4; font-size: 0.98rem; max-width: 22ch; margin: 0 auto; }

/* ── how it works ──────────────────────────────────────── */
.how { max-width: var(--maxw); margin: 0 auto; padding: 5.5rem 1.5rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.step {
  background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--corner);
  padding: 2rem 1.6rem;
}
.step-no { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; color: var(--rust); }
.step h3 { font-size: 1.4rem; margin: 0.7rem 0 0.6rem; }
.step p { color: var(--ink-soft); }

/* ── scroll scene: douse → revive ──────────────────────── */
.scroll-scene { position: relative; height: 600vh; background: var(--paper); }
.scene-stage {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border-block: 1px solid var(--hairline);
}

/* darkening as the flame drowns */
.scene-dim {
  position: absolute; inset: 0; background: #161a1f; pointer-events: none;
  opacity: var(--dark, 0);
}

/* — the mascot — */
.scene-mascot {
  position: relative; z-index: 2; width: min(46vh, 360px); will-change: transform;
}
.lumi-sprite { width: 100%; height: auto; display: block; overflow: visible; }

.sprite-glow       { opacity: calc(0.15 + 0.85 * var(--flame, 1)); }
.flame-alive       { opacity: var(--flame, 1); }
.flame-dead        { opacity: calc(1 - var(--flame, 1)); }
.sprite-face-alive { opacity: var(--flame, 1); }
.sprite-face-dead  { opacity: calc(1 - var(--flame, 1)); }
.sprite-smoke      { opacity: calc((1 - var(--flame, 1)) * 0.85); }
/* the doused flame slumps down a touch */
.sprite-flame { transform: translateY(calc((1 - var(--flame, 1)) * 14px)); }

/* alive = flicker; windy = the whole sprite sways in the gust */
.scroll-scene.lit .sprite-flame { animation: flicker 0.5s ease-in-out infinite alternate; }
.scroll-scene.windy .scene-mascot { animation: sway 1.5s ease-in-out infinite; }
@keyframes flicker { from { transform: translateY(0) scaleX(1); } to { transform: translateY(-5px) scaleX(1.035); } }
@keyframes sway    { 0%, 100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }

/* puddle pooling under Lumi, then drying */
.puddle {
  position: absolute; left: 50%; bottom: -4%; transform: translateX(-50%) scaleX(var(--wet, 0));
  width: 78%; height: 16px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(120,170,200,0.6), rgba(120,170,200,0));
  opacity: var(--wet, 0);
}

/* — unrolling water rig — */
.rig {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(58vh, 420px); display: flex; flex-direction: column; align-items: center;
  z-index: 3; pointer-events: none; opacity: var(--wet, 0);
}
.rig-roller {
  width: 86%; height: 16px; border-radius: 5px;
  background: linear-gradient(#8a7c68, #5e5446);
  box-shadow: 0 3px 6px rgba(58,36,16,0.35);
}
.rig-blind {
  width: 80%; height: calc(var(--douse, 0) * 30vh);
  background:
    repeating-linear-gradient(90deg, rgba(58,48,39,0.05) 0 14px, rgba(58,48,39,0) 14px 28px),
    linear-gradient(#ece0c8, #dccba9);
  border-radius: 0 0 5px 5px; position: relative;
  box-shadow: inset 0 -10px 14px -8px rgba(58,36,16,0.3);
}
.rig-blind::after {
  content: ''; position: absolute; left: 6%; right: 6%; bottom: -3px; height: 6px;
  border-radius: 4px; background: rgba(120,170,200,0.85); opacity: var(--water, 0);
}

/* — rain — */
.rain {
  position: absolute; top: 6%; left: 50%; transform: translateX(-50%);
  width: min(50vh, 360px); height: 78%; z-index: 2;
  opacity: var(--water, 0); pointer-events: none;
}
.rain i {
  position: absolute; top: -12%; width: 4px; height: 64px; border-radius: 2px;
  background: linear-gradient(rgba(150,195,220,0), rgba(96,150,190,0.95));
  animation: rainfall 0.7s linear infinite;
}
@keyframes rainfall { 0% { transform: translateY(-30%); } 100% { transform: translateY(230%); } }
.rain i:nth-child(1)  { left: 6%;  animation-delay: -0.05s; }
.rain i:nth-child(2)  { left: 14%; animation-delay: -0.32s; }
.rain i:nth-child(3)  { left: 22%; animation-delay: -0.51s; }
.rain i:nth-child(4)  { left: 30%; animation-delay: -0.18s; }
.rain i:nth-child(5)  { left: 38%; animation-delay: -0.62s; }
.rain i:nth-child(6)  { left: 46%; animation-delay: -0.28s; }
.rain i:nth-child(7)  { left: 54%; animation-delay: -0.44s; }
.rain i:nth-child(8)  { left: 62%; animation-delay: -0.11s; }
.rain i:nth-child(9)  { left: 70%; animation-delay: -0.58s; }
.rain i:nth-child(10) { left: 78%; animation-delay: -0.36s; }
.rain i:nth-child(11) { left: 86%; animation-delay: -0.22s; }
.rain i:nth-child(12) { left: 94%; animation-delay: -0.48s; }
.rain i:nth-child(13) { left: 10%; animation-delay: -0.66s; }
.rain i:nth-child(14) { left: 50%; animation-delay: -0.08s; }
.rain i:nth-child(15) { left: 66%; animation-delay: -0.55s; }
.rain i:nth-child(16) { left: 34%; animation-delay: -0.39s; }

/* — wind: gusts + flying pages — */
.wind { position: absolute; inset: 0; z-index: 4; opacity: var(--wind, 0); pointer-events: none; overflow: hidden; }
.gust {
  position: absolute; height: 2px; width: 22vw; border-radius: 2px;
  background: linear-gradient(90deg, rgba(122,110,95,0), rgba(122,110,95,0.55), rgba(122,110,95,0));
  animation: gust 1.5s linear infinite;
}
@keyframes gust { 0% { transform: translateX(-25vw); } 100% { transform: translateX(125vw); } }
.gust:nth-child(1) { top: 30%; animation-delay: -0.1s; }
.gust:nth-child(2) { top: 44%; width: 30vw; animation-delay: -0.7s; }
.gust:nth-child(3) { top: 58%; animation-delay: -1.1s; }
.gust:nth-child(4) { top: 38%; width: 16vw; animation-delay: -0.4s; }
.gust:nth-child(5) { top: 66%; width: 26vw; animation-delay: -0.9s; }

.page {
  position: absolute; width: 26px; height: 34px; border-radius: 2px;
  background: var(--paper); border: 1px solid var(--hairline);
  box-shadow: 0 2px 6px rgba(58,36,16,0.18);
  animation: pagefly 2.6s linear infinite;
}
@keyframes pagefly {
  0%   { transform: translate(-12vw, 38vh) rotate(0deg); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translate(112vw, -14vh) rotate(260deg); opacity: 0; }
}
.page:nth-child(6) { top: 0; animation-delay: -0.2s; }
.page:nth-child(7) { top: 0; animation-delay: -1.0s; animation-duration: 3.1s; }
.page:nth-child(8) { top: 0; animation-delay: -1.8s; animation-duration: 2.3s; }
.page:nth-child(9) { top: 0; animation-delay: -2.4s; }

/* — open book riffling in the gust — */
.bookflip {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%);
  width: min(34vh, 264px); height: min(22vh, 170px); z-index: 5;
  pointer-events: none; perspective: 1100px;
  opacity: max(var(--wind, 0), calc(var(--revive, 0) * 0.9));
}
.book { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(16deg); }
.book-half {
  position: absolute; top: 0; width: 50%; height: 100%;
  background:
    repeating-linear-gradient(transparent 0 11px, rgba(58,48,39,0.10) 11px 12px),
    linear-gradient(#F6ECD6, #e6d7ba);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 0 22px rgba(58,36,16,0.08);
}
.book-half.left  { left: 0;  border-radius: 7px 2px 2px 7px; }
.book-half.right { right: 0; border-radius: 2px 7px 7px 2px; }
.book::after { /* spine */
  content: ''; position: absolute; left: 50%; top: 0; width: 3px; height: 100%;
  transform: translateX(-1.5px); background: rgba(58,36,16,0.28);
}
/* pages flipping over the spine — seamless 0→-180 loop, staggered to riffle */
.page-turn {
  position: absolute; top: 3%; left: 50%; width: 48%; height: 94%;
  transform-origin: left center; transform-style: preserve-3d;
  background: linear-gradient(105deg, #fdf6e6, #e9dcc1);
  border: 1px solid var(--hairline); border-radius: 2px 7px 7px 2px;
  box-shadow: -2px 3px 8px rgba(58,36,16,0.16);
  animation: pageturn 1.7s linear infinite;
}
@keyframes pageturn { from { transform: rotateY(0deg); } to { transform: rotateY(-180deg); } }
.page-turn:nth-child(3) { animation-delay: 0s; }
.page-turn:nth-child(4) { animation-delay: -0.34s; }
.page-turn:nth-child(5) { animation-delay: -0.68s; }
.page-turn:nth-child(6) { animation-delay: -1.02s; }
.page-turn:nth-child(7) { animation-delay: -1.36s; }

/* — narration — */
.scene-caps {
  position: absolute; left: 50%; bottom: 11%; transform: translateX(-50%);
  width: min(90vw, 640px); z-index: 6; pointer-events: none; text-align: center;
}
.scene-cap {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; opacity: 0;
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 4vw, 2.4rem);
  line-height: 1.18;
  /* ink on paper, fading toward cream as the stage darkens */
  color: color-mix(in srgb, #3A3027, #F7F1E6 calc(var(--dark, 0) * 155%));
}
.scene-hint {
  position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); z-index: 6;
  font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft);
  opacity: calc(1 - var(--douse, 0)); pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-scene.lit .sprite-flame,
  .scroll-scene.windy .scene-mascot,
  .rain i, .gust, .page, .page-turn { animation: none !important; }
}

/* ── manifesto ─────────────────────────────────────────── */
.manifesto {
  max-width: 760px; margin: 0 auto; padding: 6rem 1.5rem; text-align: center;
}
.manifesto-mascot { animation: bob 3.4s ease-in-out infinite; margin-bottom: 1.5rem; }
.manifesto blockquote {
  font-family: var(--serif); font-size: clamp(1.5rem, 3.2vw, 2.2rem); font-weight: 500;
  line-height: 1.3; color: var(--ink);
}

/* ── final CTA ─────────────────────────────────────────── */
.cta {
  background: var(--rust); color: var(--cream); text-align: center;
  padding: 6rem 1.5rem;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(246,193,106,0.35), transparent 60%);
}
.cta h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); color: var(--cream); }
.cta-sub { margin: 1.2rem 0 2rem; font-size: 1.1rem; color: rgba(247,241,230,0.85); }
.waitlist { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.6rem; }
.waitlist input {
  font-family: var(--sans); font-size: 1rem; padding: 0.85em 1.1em; min-width: 260px;
  border: 1px solid rgba(247,241,230,0.4); border-radius: var(--corner);
  background: rgba(247,241,230,0.12); color: var(--cream);
}
.waitlist input::placeholder { color: rgba(247,241,230,0.6); }
.waitlist input:focus { outline: 2px solid var(--cream); outline-offset: 0; }
.cta .btn-primary { background: var(--ink); box-shadow: 0 2px 0 #1c160f; }
.cta .btn-primary:hover { background: #2a221b; }
.btn-appstore { margin: 0 auto; }

/* ── legal pages (privacy / terms) ─────────────────────── */
.legal {
  max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem;
}
.legal h1 { font-size: clamp(2.4rem, 6vw, 3.4rem); margin: 0.4rem 0 0.6rem; }
.legal-meta { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 2rem; }
.legal-callout {
  background: var(--paper); border: 1px solid var(--hairline); border-left: 3px solid var(--rust);
  border-radius: var(--corner); padding: 1.2rem 1.4rem; margin-bottom: 2.5rem;
}
.legal-callout p { margin: 0; color: var(--ink); }
.legal h2 {
  font-size: 1.55rem; margin: 2.4rem 0 0.7rem; padding-top: 0.4rem;
}
.legal h3 { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 1.4rem 0 0.4rem; color: var(--rust); }
.legal p { color: var(--ink); margin-bottom: 1rem; }
.legal ul { margin: 0 0 1.2rem 1.2rem; color: var(--ink); }
.legal li { margin-bottom: 0.5rem; }
.legal a { color: var(--rust); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: #97492f; }
.legal strong { font-weight: 600; }

/* ── footer ────────────────────────────────────────────── */
.site-footer {
  max-width: var(--maxw); margin: 0 auto; padding: 2.6rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; }
.footer-links { display: flex; gap: 1.4rem; color: var(--ink-soft); }
.footer-links a:hover { color: var(--ink); }
.footer-note { color: var(--ink-soft); font-size: 0.9rem; }

/* ── responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 4rem; padding-bottom: 3rem; }
  .lede { max-width: none; }
  .hero-art { margin-top: 1rem; }
  .stats { grid-template-columns: 1fr; gap: 2.5rem; }
  .steps { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .nav a:not(.nav-cta) { display: none; }
  .hero h1 { font-size: clamp(2.6rem, 13vw, 3.4rem); }
  .feature-grid { grid-template-columns: 1fr; }
  .phone-small { right: -8px; bottom: -28px; }
  .footer-note { width: 100%; }
}
