/* Bet On Yourself, the English landing + science pages.
   Palette mirrors BetOnYourself/Theme.swift (washi). Light only, like the app. */
:root {
  color-scheme: light;
  --paper: #F7F4ED; --behind: #EFECE3; --surface: #ECE8DD;
  --ink: #2B2823; --mid: #5D5749; --dim: #6C675C; --faint: #958D78;
  --line: #DCD7C9; --rung: #E3DFD2;
  --ember: #AE4238; --sage: #7D9A8C; --sage-deep: #526C5E;
  --serif: ui-serif, "New York", "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--behind); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.6 var(--sans); overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
a { color: var(--sage-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 99px; z-index: 50; }
.skip:focus { left: 16px; }

.wrap { max-width: calc(1200px + 2 * clamp(16px, 5vw, 96px)); margin: 0 auto; padding: 0 clamp(16px, 5vw, 96px); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.75rem); }
h3 { font-size: 23px; }
p { margin: 0 0 1em; text-wrap: pretty; }
.eyebrow { font: 600 11px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--dim); margin: 0 0 18px; }
.lead { font-size: clamp(18px, 1.5vw, 19px); color: var(--mid); max-width: 36em; }
.micro { font-size: 14px; color: var(--dim); }
.mono { font-family: var(--mono); font-size: .86em; }
.ember { color: var(--ember); } .sage { color: var(--sage-deep); }
section { padding: clamp(64px, 10vh, 120px) 0; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 14px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 17px var(--serif); margin-right: auto; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.top nav { display: flex; gap: 18px; font-size: 15px; }
.top nav a { color: var(--mid); text-decoration: none; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 640px) { .top nav .opt { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: var(--paper); text-decoration: none; border-radius: 99px; padding: 14px 22px; font: 700 17px var(--serif); border: 0; cursor: pointer; }
.btn:hover { color: var(--paper); background: #000; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.ghost { background: var(--surface); color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 26px 0 0; }

/* hero */
.hero { padding: 56px 0 24px; }
.hero .wrap { display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) { .hero .wrap { grid-template-columns: 1.35fr 1fr; } }
.hero h1 em { font-style: normal; color: var(--ember); }
.hero-teller { position: relative; justify-self: center; width: min(300px, 72vw); }
.bubble { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; font: 500 15px/1.4 var(--sans); color: var(--mid); margin: 0 0 18px; box-shadow: 0 6px 20px rgba(43,40,35,.06); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 14px; height: 14px; background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }

/* the Teller (CharacterView.swift, idle/watching/playful/asleep/worried) */
.teller .t-all { transform-box: fill-box; transform-origin: 50% 100%; animation: hop 6s infinite; }
.teller .t-body { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 3.4s ease-in-out infinite; }
.teller .t-lids { opacity: 0; animation: lids 4.3s infinite; }
.teller .t-open { animation: open 4.3s infinite; }
.teller .t-brow, .teller .t-o, .teller .t-grin, .teller .t-zz { display: none; }
.teller.playful .t-all { animation: hop-play 4.4s infinite; }
.teller.playful .t-dash { display: none; } .teller.playful .t-grin, .teller.playful .t-brow.up { display: inline; }
.teller.worried .t-all { animation: tremble .11s infinite; }
.teller.worried .t-dash { display: none; } .teller.worried .t-o, .teller.worried .t-brow.down { display: inline; }
.teller.asleep .t-all { animation: none; } .teller.asleep .t-body { animation-duration: 5s; }
.teller.asleep .t-open, .teller.asleep .t-dash { display: none; } .teller.asleep .t-lids { opacity: 1; animation: none; } .teller.asleep .t-zz { display: inline; }
.teller.watching .t-pupils { transform: translateY(-2%); }
@keyframes breathe { 50% { transform: scaleY(1.018); } }
@keyframes lids { 0%, 95% { opacity: 0; } 95.1%, 100% { opacity: 1; } }
@keyframes open { 0%, 95% { opacity: 1; } 95.1%, 100% { opacity: 0; } }
@keyframes hop { 0% { transform: scale(1.12,.88); } 2% { transform: translateY(-6%) scale(.92,1.08); } 4.5% { transform: translateY(-15%) scale(.9,1.1); } 7% { transform: translateY(-4%) scale(.95,1.05); } 9% { transform: scale(1.12,.88); } 11%, 100% { transform: none; } }
@keyframes hop-play { 0% { transform: scale(1.14,.86); } 5% { transform: translateY(-20%) scale(.88,1.12); } 11% { transform: scale(1.14,.86); } 13% { transform: none; } 15% { transform: translateY(-10%) rotate(-2deg); } 24% { transform: none; } 30% { transform: rotate(9deg); } 36% { transform: rotate(-9deg); } 42% { transform: rotate(8deg); } 48% { transform: rotate(-7deg); } 55% { transform: rotate(4deg); } 62%, 77% { transform: none; } 82% { transform: translateY(-4%) scale(1.1,.9); } 88%, 100% { transform: none; } }
@keyframes tremble { 50% { transform: rotate(.7deg); } }

/* the stage: the app screen, rebuilt in SVG (assets/site.js) */
.stage { width: 100%; height: auto; aspect-ratio: 300 / 650; border-radius: 13% / 6%; box-shadow: 0 30px 60px -30px rgba(43,40,35,.35), 0 0 0 1px var(--line); background: var(--paper); }
.stage svg { width: 100%; height: 100%; overflow: visible; }
.stage text { font-family: var(--sans); }
.stage .serif { font-family: var(--serif); font-weight: 700; }
.stage .mono { font-family: var(--mono); font-size: 9px; }
.stage .fade { transition: opacity .35s ease; }
.stage .move { transition: transform .5s cubic-bezier(.3,1.4,.5,1); }
.stage .bar { transition: fill .35s, width .35s, x .35s; }
.stage img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* scrolly sections: tall track, pinned stage. Only with JS + motion allowed. */
.scrolly .pin { display: grid; gap: 24px; justify-items: center; }
.scrolly .stage-box { width: min(270px, 70vw); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; max-width: 30em; }
.steps .k { display: block; font: 600 11px/1 var(--sans); letter-spacing: .25em; text-transform: uppercase; color: var(--ember); margin-bottom: 8px; }
.steps b { font-family: var(--serif); font-size: 23px; line-height: 1.2; display: block; margin-bottom: 4px; }
.steps p { color: var(--mid); margin: 0; }
.motion .loop.scrolly { height: 640vh; padding: 0; }
.motion .loop .pin { position: sticky; top: 58px; height: calc(100svh - 58px); align-content: center; padding: 8px 16px 16px; grid-template-rows: auto 1fr auto; }
.motion .loop .pin h2 { font-size: clamp(22px, 3vw, 2.5rem); margin: 0; text-align: center; }
.motion .loop .stage-box { width: auto; height: min(58svh, 620px); aspect-ratio: 300/650; align-self: center; }
.motion .loop .steps { position: relative; min-height: 8.5em; width: 100%; }
.motion .loop .steps li { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; }
.motion .loop .steps li.on { opacity: 1; transform: none; }
.progress { display: flex; gap: 6px; justify-content: center; }
.progress i { width: 26px; height: 3px; border-radius: 2px; background: var(--rung); transition: background .3s; }
.progress i.on { background: var(--ember); }
.no-motion .progress, html:not(.js) .progress { display: none; }
@media (min-width: 860px) {
  .motion .loop .pin { grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; column-gap: 64px; max-width: calc(1200px + 2 * clamp(16px, 5vw, 96px)); margin: 0 auto; padding-inline: clamp(16px, 5vw, 96px); }
  .motion .loop .pin h2 { grid-column: 1 / -1; }
  .motion .loop .steps { grid-column: 1; grid-row: 2; align-self: center; min-height: 12em; }
  .motion .loop .stage-box { grid-column: 2; grid-row: 2; height: min(72svh, 640px); }
  .motion .loop .progress { grid-column: 1; grid-row: 2; align-self: end; justify-content: start; margin-bottom: 12%; }
}
.no-motion .loop .pin, html:not(.js) .loop .pin { grid-template-columns: 1fr; }
@media (min-width: 860px) { .no-motion .loop .pin, html:not(.js) .loop .pin { grid-template-columns: 1fr auto; align-items: center; } .no-motion .loop h2, html:not(.js) .loop h2 { grid-column: 1 / -1; } }


/* the money */
.money { background: var(--behind); }
.money .wrap { display: grid; gap: 40px; }
@media (min-width: 860px) { .money .wrap { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.facts li { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; color: var(--mid); }
.facts strong { color: var(--ink); font-family: var(--serif); font-size: 19px; display: block; margin-bottom: 2px; }
.split { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 22px; position: sticky; top: 80px; }
.split .bar { display: flex; gap: 3px; height: 10px; margin: 14px 0 10px; }
.split .bar span { border-radius: 99px; background: var(--sage); flex: 80; transform-origin: left; }
.split .bar span + span { background: var(--rung); flex: 20; }
.split .legend { display: flex; justify-content: space-between; font: 13px var(--mono); color: var(--mid); }
.held-demo { width: 100%; height: auto; margin-top: 18px; }
.in .split .bar span { animation: grow .9s cubic-bezier(.3,1.2,.5,1) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* Sam */
.story { padding-bottom: 24px; }
.story .head { max-width: 40em; }
.story-grid { display: grid; gap: 0 56px; }
.story .stage-col .stage-box { width: min(230px, 56vw); margin: 0 auto; }
.chapter { padding: 28px 0; max-width: 34em; }
.chapter .k { font: 600 11px/1 var(--sans); letter-spacing: .25em; text-transform: uppercase; color: var(--dim); display: block; margin-bottom: 10px; }
.chapter p { font-size: 18px; color: var(--mid); }
.chapter p b { color: var(--ink); }
.motion .story .stage-col { position: sticky; top: 58px; z-index: 5; background: linear-gradient(var(--paper) 88%, transparent); padding: 10px 0 18px; }
.motion .story .stage-col .stage-box { height: min(40svh, 380px); width: auto; aspect-ratio: 300/650; }
.motion .story .chapter { min-height: 52svh; opacity: .35; transition: opacity .3s; }
.motion .story .chapter.on { opacity: 1; }
@media (min-width: 860px) {
  .story-grid { grid-template-columns: 1fr auto; }
  .story .stage-col { grid-column: 2; grid-row: 1; }
  .story .chapters { grid-column: 1; grid-row: 1; }
  .motion .story .stage-col { top: 58px; height: calc(100svh - 58px); display: grid; align-content: center; background: none; }
  .motion .story .stage-col .stage-box { height: min(70svh, 600px); }
  .motion .story .chapter { min-height: 78svh; display: flex; flex-direction: column; justify-content: center; }
}
.disclaim { font-size: 14px; color: var(--dim); border-left: 3px solid var(--ember); padding-left: 12px; }

/* science teaser cards + science page figures */
.cards { display: grid; gap: 16px; margin-top: 26px; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: #FBF9F4; border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.card svg { width: 100%; height: auto; margin-bottom: 12px; }
.card h3 { font-size: 21px; }
.card p { color: var(--mid); font-size: 16px; margin: 0; }
.cite { display: block; font-size: 12.5px; color: var(--dim); margin-top: 10px; }
.chip { display: inline-block; font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 5px 9px; border-radius: 99px; background: var(--surface); color: var(--mid); vertical-align: middle; }
.chip.strong { background: #DDE6DF; color: #3E5649; } .chip.mod { background: #EFE6D4; color: #6A5534; } .chip.mixed { background: #F1DEDA; color: #8A3A31; }

/* drawn-on-scroll figures */
.js .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.in .draw { animation: draw 1.6s ease-out .2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.js .pop { opacity: 0; } .in .pop { animation: pop .5s ease-out 1.4s forwards; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.seesaw { transform-box: view-box; transform-origin: 150px 92px; transform: rotate(0deg); transition: transform 1.2s cubic-bezier(.3,1.6,.5,1) .3s; }
.in .seesaw { transform: rotate(-11deg); }
.needle { transform-box: fill-box; transform-origin: 50% 100%; transform: rotate(-40deg); transition: transform 1s cubic-bezier(.3,1.5,.5,1); }
.balance { transform-box: view-box; transform-origin: 150px 61px; transform: rotate(-8deg); transition: transform 1s cubic-bezier(.3,1.5,.5,1); }
.weight { opacity: 0; transition: opacity .4s; }
.fig.armed .needle.want { transform: rotate(62deg); }
.fig.armed .balance { transform: rotate(8deg); }
.fig.armed .weight { opacity: 1; }

/* origin + fine print + footer */
.origin .wrap { display: grid; gap: 28px; }
@media (min-width: 860px) { .origin .wrap { grid-template-columns: 1.4fr 1fr; align-items: center; } }
.beer { background: var(--surface); border-radius: 20px; padding: 22px; font: 14px/1.7 var(--mono); color: var(--mid); }
.beer b { color: var(--ink); }
.fine { padding: 40px 0; }
.fine p { font-size: 15px; color: var(--dim); max-width: 46em; }
footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 14px; color: var(--dim); }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
footer .langs a { color: var(--dim); }

/* science page */
.sci-hero { padding: 56px 0 8px; }
.sci { padding: 52px 0; border-top: 1px solid var(--line); }
.sci .wrap { display: grid; gap: 28px; }
@media (min-width: 860px) { .sci .wrap { grid-template-columns: 1fr 1fr; align-items: center; } .sci:nth-of-type(even) .fig { order: -1; } }
.sci h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.sci p { color: var(--mid); }
.fig { background: #FBF9F4; border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.fig svg { width: 100%; height: auto; }
.fig .toggle { margin-top: 12px; }
.fig text { font-family: var(--sans); }
.fig .serif { font-family: var(--serif); font-weight: 700; }
.ifthen { display: grid; gap: 10px; }
.ifthen label { font-size: 14px; color: var(--dim); display: grid; gap: 4px; }
.ifthen input { font: 17px var(--sans); padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); width: 100%; }
.ifthen output { display: block; font: 700 21px/1.35 var(--serif); padding: 14px 0 0; }
.rules { padding-left: 22px; } .rules li { margin-bottom: 10px; color: var(--mid); } .rules b { color: var(--ink); }
.refs { font-size: 14px; color: var(--mid); padding-left: 20px; } .refs li { margin-bottom: 8px; overflow-wrap: anywhere; }
.callout { background: #F1DEDA55; border: 1px solid #E6C9C3; border-radius: 16px; padding: 16px 18px; color: var(--mid); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .draw { stroke-dashoffset: 0 !important; opacity: 1 !important; } .js .pop { opacity: 1 !important; }
  .seesaw { transform: rotate(-11deg); }
  .teller .t-lids { opacity: 0; }
}
@media (max-width: 859px) { .motion .loop .steps b { font-size: 20px; } .motion .loop .steps p { font-size: 15px; line-height: 1.5; } }
.facts strong { line-height: 1.3; margin-bottom: 6px; }
[id] { scroll-margin-top: 70px; }
@media (min-width: 860px) {
  .motion .loop .steps, .motion .loop .progress { justify-self: start; }
  .motion .loop .steps { max-width: 32em; }
  .motion .loop .steps b { font-size: clamp(26px, 2.4vw, 34px); margin-bottom: 10px; }
  .motion .loop .steps p { font-size: 18px; }
}

/* fullscreen: every major section is at least a screen tall, content centered,
   backgrounds edge to edge, paragraphs kept to a readable measure */
html { scroll-padding-top: 58px; }
main p, main li { max-width: 65ch; }
.steps p, .facts li { max-width: none; }
.hero, .money, .sci-teaser, .origin, .sci, .sci-hero {
  display: flex; flex-direction: column; justify-content: center;
}
.hero { min-height: calc(100svh - 58px); }
.hero > .wrap, .money > .wrap, .sci-teaser > .wrap, .origin > .wrap, .sci > .wrap, .sci-hero > .wrap { width: 100%; }
.motion .story .chapter { min-height: 72svh; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 859px) {
  .motion .story .chapter { justify-content: flex-start; padding-top: 12svh; min-height: 64svh; }
}
@media (min-width: 860px) {
  .hero-teller { width: min(360px, 30vw); }
  .motion .story .stage-col .stage-box { height: min(72svh, 620px); }
  .motion .loop .stage-box { height: min(72svh, 640px); }
  .sci .wrap { gap: clamp(28px, 6vw, 120px); }
}

/* no frames: visuals sit on the section background, sections separate by tone */
.top { border-bottom: 0; }
.rule { display: none; }
.card, .fig, .split, .facts li, .beer, .callout { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
.split { position: static; }
.card svg { max-height: 180px; }
.fig svg { width: 100%; max-width: 560px; margin-inline: auto; max-height: 56svh; }
.facts { gap: 26px; }
.facts li { padding: 0 0 0 18px; border-left: 3px solid var(--sage); }
.facts li:nth-child(3) { border-left-color: var(--ember); }
.callout { border-left: 3px solid var(--ember); padding-left: 14px; }
.beer { font-size: clamp(14px, 1.3vw, 17px); }
.sci { border-top: 0; }
footer { border-top: 0; background: var(--surface); }
/* section tones, alternating, edge to edge */
.loop, .money, .sci-teaser, .fine { background: var(--behind); }
.hero, .story, .origin { background: var(--paper); }
.sci:nth-of-type(odd) { background: var(--behind); }
.sci:nth-of-type(even) { background: var(--paper); }
/* the stage is the iPhone: a dark bezel, not a box */
.stage { box-shadow: 0 0 0 clamp(5px, 1.1svh, 11px) #1F1C18, 0 40px 70px -30px rgba(43,40,35,.45); }
@media (min-width: 860px) {
  .motion .loop .pin { grid-template-columns: minmax(0, 34rem) auto; justify-content: center; column-gap: clamp(48px, 9vw, 240px); }
  .story-grid { grid-template-columns: minmax(0, 36rem) auto; justify-content: center; column-gap: clamp(48px, 9vw, 240px); }
}
.motion .loop .pin { padding-top: clamp(12px, 4vh, 44px); }
@media (min-width: 860px) { .motion .loop .progress { margin-bottom: 18%; } }
@media (max-width: 600px) { .wrap, .motion .loop .pin { padding-left: 16px; padding-right: 16px; } }
.chip { line-height: 1.35; margin-bottom: 12px; }
.js .draw { opacity: 0; } .js .in .draw { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .js .draw { opacity: 1; } }

/* Sam's spot drawings: flat, Teller palette, play once when scrolled in */
.spot { width: min(280px, 70vw); height: auto; margin-top: 8px; }
.spot .i { fill: var(--ink); } .spot .m { fill: var(--mid); } .spot .s { fill: var(--surface); } .spot .l { fill: var(--line); }
.spot .p { fill: var(--paper); } .spot .e { fill: var(--ember); } .spot .g { fill: var(--sage); } .spot .gd { fill: var(--sage-deep); }
.spot .sh { fill: var(--ink); opacity: .08; } .spot .zz { fill: var(--faint); }
.spot .sw { transform: rotate(var(--a)); }
.spot .rise, .spot .drop { transform-box: fill-box; transform-origin: 50% 50%; }
.spot .steam path { opacity: .55; }
.motion .spot:not(.in) .mv { visibility: hidden; }
.in .walk { animation: walk 2.6s cubic-bezier(.25,.6,.4,1) both; }
.in .walk .sw { animation: sw .33s ease-in-out 8 alternate; }
.in .bob { animation: bob .165s ease-in-out 16 alternate; }
.in .rise { animation: rise .9s cubic-bezier(.3,1.4,.5,1) .2s both; }
.in .drop { animation: drop 1.3s .3s both; }
.in .steam path { animation: steam 3.4s ease-in-out infinite; }
.in .steam path:nth-child(2) { animation-delay: -1.1s; } .in .steam path:nth-child(3) { animation-delay: -2.2s; }
.in .zz { animation: zz 3s ease-in-out infinite alternate; }
@keyframes walk { from { transform: translateX(-120px); } }
@keyframes sw { to { transform: rotate(calc(var(--a) * -1)); } }
@keyframes bob { to { transform: translateY(-1.6px); } }
@keyframes rise { from { transform: translateY(70px); } }
@keyframes drop { 0% { transform: translate(-36px, -80px) rotate(-50deg); animation-timing-function: cubic-bezier(.5,0,.8,.4); } 62% { transform: translateY(5px) rotate(5deg); animation-timing-function: ease-out; } 82% { transform: translateY(-6px) rotate(-3deg); animation-timing-function: ease-in-out; } 100% { transform: none; } }
@keyframes steam { 0% { transform: translateY(10px); opacity: 0; } 45% { opacity: .6; } 100% { transform: translateY(-10px); opacity: 0; } }
@keyframes zz { to { transform: translateY(-3px); opacity: .6; } }

/* round 2: more spots */
.spot .tx { fill: var(--dim); }
.spot.wide { width: min(420px, 100%); margin: 10px 0 22px; }
.hero-teller .note { position: absolute; right: -8%; top: 39%; width: 34%; }
.split .coins { width: 100%; margin: 4px 0 -4px; }
.money .bell { width: min(260px, 66vw); margin: 14px 0 4px; }
.sci-teaser .brain { width: 180px; margin: 0 0 10px -10px; }
.beer .beers { width: 220px; margin: 0 0 14px; }
.foot-teller { width: 104px; margin: 0 0 10px; }
.in .pen { animation: pen 1.4s ease-in-out .3s 2; }
.in .coin { animation: coin .55s cubic-bezier(.3,1.5,.5,1) both; }
.in .spark { animation: spark 2.4s ease-in-out infinite; }
.in .gl { animation: gl 1s cubic-bezier(.3,1.6,.5,1) .2s both; }
.spot .gl { transform: rotate(var(--r)); }
.js .spot .cf { opacity: 0; } .in .cf { animation: cf 1.6s cubic-bezier(.2,.6,.4,1) both; }
@keyframes pen { 25% { transform: rotate(-6deg) translateX(-3px); } 75% { transform: rotate(4deg) translateX(2px); } }
@keyframes coin { from { transform: translateY(-40px); opacity: 0; } }
@keyframes spark { 50% { transform: scale(1.25) rotate(20deg); } }
@keyframes gl { from { transform: rotate(0deg); } }
@keyframes cf { from { opacity: 0; transform: translateY(-34px) rotate(-90deg); } 25% { opacity: 1; } to { opacity: 1; } }

/* round 2: beauty pass, small and editorial */
::selection { background: #E9D2CD; color: var(--ink); }
h1, h2 { font-feature-settings: "kern", "liga", "onum"; }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--ember); opacity: .7; }
.legend, .beer, .mono, .split { font-variant-numeric: tabular-nums; }
.lead { hanging-punctuation: first; }
a { text-decoration-thickness: 1px; transition: color .2s, text-decoration-thickness .2s; }
a:hover { text-decoration-thickness: 2px; }
.top nav a { background: linear-gradient(var(--ember), var(--ember)) 0 100% / 0 1.5px no-repeat; padding-bottom: 2px; transition: background-size .25s, color .2s; }
.top nav a:hover, .top nav a[aria-current] { text-decoration: none; background-size: 100% 1.5px; color: var(--ink); }
.btn { transition: transform .18s, box-shadow .18s, background .18s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(43,40,35,.55); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.btn.ghost:hover { background: var(--rung); color: var(--ink); }
:focus-visible { transition: outline-offset .15s; }
input:focus-visible { outline-offset: 1px; }
/* sections ease into each other instead of hard tone cuts */
.loop, .money, .sci-teaser, .fine { background: linear-gradient(var(--paper), var(--behind) 90px, var(--behind) calc(100% - 90px), var(--paper)); }
.fine { background: linear-gradient(var(--paper), var(--behind) 60px); }
footer { background: linear-gradient(var(--behind), var(--surface) 80px); }
/* scroll reveal for headings and blocks */
.motion .fx { transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.motion .fx:not(.in) { opacity: 0; transform: translateY(14px); }
.motion .facts li.fx:nth-child(2) { transition-delay: .06s; } .motion .facts li.fx:nth-child(3) { transition-delay: .12s; }
.motion .facts li.fx:nth-child(4) { transition-delay: .18s; } .motion .facts li.fx:nth-child(5) { transition-delay: .24s; } .motion .facts li.fx:nth-child(6) { transition-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
  .js .spot .cf { opacity: 1; }
  .teller.asleep .t-lids { opacity: 1; }
}

/* charity list in the money split */
.split .ch-h { margin: 26px 0 8px; }
.charities { list-style: none; margin: 0; padding: 0; }
.charities li { padding: 10px 0; border-top: 1px solid var(--line); }
.charities li:first-child { border-top: 0; }
.charities a { display: block; font-weight: 600; color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
.charities a:hover { text-decoration-color: var(--sage); }
.charities span { display: block; font-size: 14px; color: var(--mid); }
.ch-note { font-size: 13px; color: var(--dim); margin: 8px 0 18px; }

/* waitlist (stands in for the App Store button until review clears):
   one pill holding the field and the button, like a single control */
.waitlist { margin: 28px 0 0; max-width: 520px; }
.wl-label { display: block; font: 600 17px var(--serif); color: var(--ink); margin-bottom: 12px; }
.wl-row { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 99px;
  background: #FCFBF7; border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(43,40,35,.04), 0 10px 28px -14px rgba(43,40,35,.28);
  transition: border-color .18s, box-shadow .18s; }
.wl-row:focus-within { border-color: var(--sage); box-shadow: 0 0 0 4px rgba(82,108,94,.14), 0 10px 28px -14px rgba(43,40,35,.28); }
.wl-row input[type=email] { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; border: 0; outline: 0;
  background: transparent; font: 17px var(--sans); color: var(--ink); padding: 10px 6px 10px 16px; }
.wl-row input[type=email]::placeholder { color: var(--faint); }
.wl-row .btn { padding: 12px 20px; white-space: nowrap; flex: none; }
.wl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wl-note { margin: 12px 0 0 18px; font-size: 13px; }
.waitlist.done .wl-row { display: none; }
.waitlist.done .wl-note { margin-left: 0; font: 600 17px var(--serif); color: var(--sage); }
