/* Spillt landing — layout & components. Tokens live in tokens.css. */
:root { --site-css: 1; } /* sentinel: story.js only starts the pinned story when this stylesheet has applied */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-md)/var(--lh-body) var(--font-body); }
img { max-width: 100%; display: block; }
a { color: var(--text); text-decoration-color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--text); }
:focus-visible { outline: 3px solid var(--promo-yellow); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 400; line-height: var(--lh-tight); margin: 0 0 var(--space-2); letter-spacing: -0.01em; }
p { margin: 0 0 var(--space-2); }
.wrap { width: min(100% - 2 * var(--space-3), var(--maxw)); margin-inline: auto; }
.eyebrow { font: 600 var(--fs-xs)/1.3 var(--font-body); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--text-2); margin: 0 0 var(--space-2); display: flex; align-items: center; gap: .6em; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--gold); flex: none; }
.lede { font-size: var(--fs-lg); color: var(--text-2); max-width: 34ch; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: 0 1.6em; border-radius: var(--radius-pill); font: 600 var(--fs-md)/1 var(--font-body); text-decoration: none; cursor: pointer; border: 2px solid transparent; transition: background .2s, box-shadow .2s, transform .2s; }
.btn-primary { background: var(--gold); color: var(--espresso); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--gold-rich); box-shadow: 0 0 0 6px rgba(231,175,42,.30), 0 6px 18px rgba(0,0,0,.4); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--text); }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { min-height: 40px; padding: 0 1.1em; font-size: var(--fs-sm); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* Skip links */
.skip { position: absolute; left: var(--space-2); top: -100px; z-index: 100; background: var(--gold); color: var(--espresso); padding: .7em 1em; border-radius: var(--radius-sm); }
.skip:focus { top: var(--space-1); }

/* Nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h); display: flex; align-items: center; background: rgba(36,22,13,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(94,68,51,.8); }
.nav .wrap { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.nav-logo { display: flex; align-items: center; flex: none; text-decoration: none; }
.nav-logo img { height: 42px; width: auto; }
.nav nav { margin-left: auto; min-width: 0; }
.nav .btn { flex: none; }
.nav-links { display: flex; gap: var(--space-3); list-style: none; padding: 0; margin: 0; }
.nav-links a { text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.nav-links a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
@media (max-width: 760px) { .nav nav { display: none; } .nav .btn { margin-left: auto; } }

/* ---------- Story ---------- */
.story { position: relative; }
.story-skip { position: absolute; z-index: 30; right: var(--space-3); top: calc(var(--nav-h) + var(--space-2)); font-size: var(--fs-sm); font-weight: 600; background: var(--surface); padding: .55em 1em; border-radius: var(--radius-pill); border: 1px solid var(--line); text-decoration: none; }
.story-skip:hover { border-color: var(--gold); }
.stage { display: none; }

/* Static (default, no-JS, reduced motion, low-power): scenes in normal flow */
.scene { padding: calc(var(--nav-h) + var(--space-4)) 0 var(--space-4); }
.scene .wrap { display: grid; gap: var(--space-4); align-items: center; }
@media (min-width: 900px) { .scene .wrap { grid-template-columns: 1.1fr 1fr; } }
.scene + .scene { padding-top: var(--space-4); }
.scene:first-child { padding-top: calc(var(--nav-h) + var(--space-5)); } /* clears the Skip the story pill */
.scene-media { margin: 0; }
.scene-media img { border-radius: 999px 999px var(--radius-md) var(--radius-md); aspect-ratio: 4 / 5; object-fit: cover; width: min(100%, 460px); margin-inline: auto; background: var(--surface); }
.scene-mark { width: min(70%, 320px); margin-inline: auto; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(201,162,39,.16), rgba(231,175,42,.06) 62%, transparent 63%); display: grid; place-items: center; }
.scene-mark img { width: 62%; }
.scene-mark-photo { margin-block: 0; background: radial-gradient(circle, rgba(201,162,39,.12) 0 69%, transparent 70%); }
/* Opening coffee photo = ghosted backdrop (owner, 9 Oct): faded, softened and feathered into the dark page. */
.scene-mark-photo img { width: 300px; max-width: 76%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; margin-inline: auto; opacity: .3; filter: saturate(.55) blur(.4px); -webkit-mask-image: radial-gradient(circle, #000 38%, transparent 71%); mask-image: radial-gradient(circle, #000 38%, transparent 71%); }
.copy-block h1 { font-size: var(--fs-hero); max-width: 14ch; }
.copy-block h2 { font-size: var(--fs-xl); max-width: 18ch; }
.copy-block .actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.copy-block .logo-lockup { height: 76px; width: auto; margin-bottom: var(--space-3); }
.chat-example { margin-top: var(--space-3); max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2); box-shadow: var(--shadow-soft); }
.chat-example figcaption { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin-bottom: .6em; }
.bubble { padding: .6em .9em; border-radius: 16px; font-size: var(--fs-sm); margin: 0 0 .5em; max-width: 85%; line-height: 1.4; }
.bubble.you { margin-left: auto; background: var(--gold); color: var(--espresso); border-bottom-right-radius: 4px; }
.bubble.spillt { background: var(--surface-3); color: var(--text); border-bottom-left-radius: 4px; }

/* Cinematic mode (enabled by JS) */
/* Exactly one of .stage / .scenes is ever shown: the stage ships `hidden`, the head gate adds .cinematic,
   and the gate drops back to .story-static if story.js has not started by DOMContentLoaded. */
html.cinematic .scenes { display: none; }
html.cinematic .stage { display: block; position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
html.story-static .stage { display: none; }
/* Large screens: cap the stage so the opening isn't surrounded by empty space and the menu arrives sooner. */
@media (min-width: 900px) { html.cinematic .stage { height: min(100svh, 820px); } }
.stage-poster { position: absolute; inset: 0; background: transparent; } /* page bg + beans show through */
.frame-box { position: absolute; right: max(7vw, calc((100vw - var(--maxw)) / 2)); top: calc(50% + var(--nav-h) / 2); width: min(38vw, 62svh, 520px); aspect-ratio: 4 / 5; transform: translateY(-50%); }
.frame { position: absolute; inset: 0; border-radius: 999px 999px var(--radius-md) var(--radius-md); overflow: hidden; clip-path: circle(calc(var(--reveal, 0) * 80%) at 50% 62%); background: var(--surface); }
.frame .shot { position: absolute; inset: -4%; opacity: 0; will-change: transform, opacity; }
.frame .shot img, .frame .shot canvas { width: 100%; height: 100%; object-fit: cover; }
.pour-svg { position: absolute; left: 0; width: 100%; top: -60svh; height: calc(62% + 60svh); overflow: visible; pointer-events: none; z-index: 2; }
.pour-svg line { stroke: var(--oak); stroke-width: 6px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pool { position: absolute; left: 50%; top: 62%; aspect-ratio: 1; border-radius: 50%; translate: -50% -50%; pointer-events: none; will-change: transform; }
.pool-1 { width: 100%; background: rgba(201,162,39,.13); }
.pool-2 { width: 80%; background: rgba(231,175,42,.08); }
/* Logo on the gold pool (finale). The artwork's visual centre sits right of and above its box centre (circular
   badge + arc text), so anchor that point, not the box centre, on the pool. Width keeps it inside the pool. */
.pour-logo { position: absolute; left: 50%; top: 62%; width: 48%; translate: -52.4% -44.9%; pointer-events: none; z-index: 3; opacity: 0; }
/* Opening: real coffee photo on the gold pool. Never wider than 300 CSS px (source is 600 px, so <=2x DPR is not upscaled). */
.pour-photo { position: absolute; left: 50%; top: 62%; width: min(52%, 300px); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; overflow: hidden; z-index: 1; pointer-events: none; }
/* Ghosted backdrop (owner, 9 Oct): story.js sets the wrapper's opacity for the hand-over; the fade lives on the img. */
.pour-photo img { width: 100%; height: 100%; object-fit: cover; opacity: .3; filter: saturate(.55) blur(.4px); -webkit-mask-image: radial-gradient(circle, #000 38%, transparent 71%); mask-image: radial-gradient(circle, #000 38%, transparent 71%); }
.frame-ring { position: absolute; inset: -14px; border-radius: 999px 999px 26px 26px; border: 1.5px solid var(--oak); opacity: 0; pointer-events: none; }
.story-copy { position: absolute; inset: 0; pointer-events: none; }
.story-copy .copy-block { position: absolute; left: max(var(--space-3), calc((100vw - var(--maxw)) / 2)); top: calc(50% + var(--nav-h) / 2); width: min(46vw, 560px); transform: translateY(-50%); opacity: 0; visibility: hidden; pointer-events: none; }
.story-copy .copy-block.is-on { visibility: visible; pointer-events: auto; }
.story-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--gold); transform-origin: 0 50%; transform: scaleX(0); opacity: .9; }
.scroll-hint { position: absolute; left: 50%; bottom: var(--space-3); transform: translateX(-50%); font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
@media (max-width: 899px) {
  .pour-svg { top: -30svh; height: calc(62% + 30svh); }
  .frame-box { right: auto; left: 50%; top: calc(var(--nav-h) + 3svh); width: min(64vw, 38svh); transform: translateX(-50%); }
  .story-copy .copy-block { left: var(--space-3); right: var(--space-3); width: auto; top: auto; bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); transform: none; }
  .story-copy .copy-block::before { content: ""; position: absolute; inset: -40px -24px -24px; background: linear-gradient(to bottom, rgba(36,22,13,0), var(--bg) 34%); z-index: -1; }
  .copy-block h1 { font-size: clamp(2rem, 8.4vw, 2.6rem); }
  .copy-block h2 { font-size: clamp(1.6rem, 6.6vw, 2rem); }
  .copy-block .logo-lockup { display: none; }
  .copy-block .lede { font-size: var(--fs-md); }
  .chat-example { display: none; }
  .story-skip { top: calc(var(--nav-h) + 8px); right: var(--space-1); font-size: var(--fs-xs); padding: .45em .8em; }
  .scroll-hint { display: none; }
}
@media (max-width: 899px) and (max-height: 700px) { .frame-box { width: min(52vw, 30svh); } }

/* ---------- Normal-flow sections ---------- */
.section { padding: var(--space-6) 0; }
.section h2 { font-size: var(--fs-xl); max-width: 20ch; }
.section-head { margin-bottom: var(--space-4); }
.section-alt { background: var(--surface-2); }
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-3); }
.menu-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3); }
.section-alt .menu-card { background: var(--surface); }
.menu-card h3 { font-size: var(--fs-lg); display: flex; align-items: center; gap: .5em; }
.menu-card h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; }
.menu-card ul { list-style: none; padding: 0; margin: 0; }
.menu-card li { padding: .45em 0; border-top: 1px dashed var(--line); font-size: var(--fs-sm); }
.menu-card li:first-child { border-top: 0; }
.note { font-size: var(--fs-xs); color: var(--text-2); margin-top: var(--space-3); }
.steps { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; background: var(--surface); border-radius: var(--radius-md); padding: var(--space-3); border: 1px solid var(--line); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--espresso); font: 600 1.1rem/1 var(--font-head); margin-bottom: var(--space-2); }
.steps h3 { font-size: var(--fs-lg); }
.split { display: grid; gap: var(--space-4); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.bakes-img { border-radius: var(--radius-md); width: 100%; max-width: 560px; aspect-ratio: 3/2; object-fit: cover; }
.pill-list { display: flex; flex-wrap: wrap; gap: .6em; list-style: none; padding: 0; margin: var(--space-3) 0 0; }
.pill-list li { border: 1.5px solid var(--gold); border-radius: var(--radius-pill); padding: .4em 1em; font-weight: 600; font-size: var(--fs-sm); }
.visit-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); display: grid; gap: var(--space-3); }
@media (min-width: 760px) { .visit-card { grid-template-columns: repeat(3, 1fr); } }
.visit-card h3 { font: 600 var(--fs-xs)/1.3 var(--font-body); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: var(--text-2); }
.visit-card address { font-style: normal; font-size: var(--fs-lg); font-family: var(--font-head); }
.placeholder-tag { display: inline-block; font: 600 var(--fs-xs)/1 var(--font-body); background: var(--surface-3); color: var(--text); border: 1px dashed var(--oak); padding: .35em .6em; border-radius: 6px; margin-top: .5em; }
.order-band { background: var(--surface); color: var(--cream); border-block: 1px solid var(--line); text-align: center; padding: var(--space-6) 0; }
.order-band h2 { color: var(--cream); font-size: var(--fs-xl); margin-inline: auto; max-width: 18ch; }
.order-band p { color: var(--text-2); }
.order-band .logo-cream { height: 90px; width: auto; margin: 0 auto var(--space-3); }
.order-band a:not(.btn) { color: var(--cream); }
.order-band .btn-primary:focus-visible { outline-color: var(--promo-yellow); }
.footer { background: var(--footer-bg); color: var(--text-2); padding: var(--space-4) 0 calc(var(--space-4) + var(--progress-h) + env(safe-area-inset-bottom)); font-size: var(--fs-sm); }
.footer a { color: #F5F0E8; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; }

/* ---------- Dark theme extras (9 Oct) ---------- */
:root { --progress-h: 30px; }
main, .footer { position: relative; z-index: 1; }
/* Decorative coffee beans: one fixed inline SVG behind everything, edges only (kept clear of the text column),
   no animation, no pointer events, hidden from assistive tech. */
.beans { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .2; contain: strict; }
.beans svg { width: 100%; height: 100%; display: block; overflow: hidden; }
.beans .bean { fill: var(--bean); }
.beans .crease { fill: none; stroke: var(--bg); stroke-width: 1.6; stroke-linecap: round; }
@media (max-width: 899px) { .beans .b-wide { display: none; } .beans { opacity: .16; } }

/* Scroll progress cup: fixed thin track at the bottom of the viewport (above the safe area). */
.scroll-cup { display: block; position: fixed; z-index: 40; left: var(--space-2); right: var(--space-2); bottom: calc(env(safe-area-inset-bottom) + 4px); height: var(--progress-h); pointer-events: none; }
.scroll-cup .track { position: absolute; left: 0; right: 0; bottom: 5px; height: 2px; border-radius: 2px; background: rgba(245,240,232,.12); }
.scroll-cup .trail { position: absolute; left: 0; bottom: 5px; height: 2px; width: 0; border-radius: 2px; background: linear-gradient(to right, rgba(201,162,39,0), rgba(201,162,39,.75)); }
.scroll-cup .cup { position: absolute; left: 0; bottom: 4px; width: 20px; height: 24px; transform-origin: 50% 100%; will-change: transform; filter: drop-shadow(0 0 4px rgba(201,162,39,.35)); }
.scroll-cup .cup svg { width: 100%; height: 100%; display: block; }
/* Stage progress bar is replaced by the cup track (same information); keep the element for story.js. */
html.cinematic .story-progress { display: none; }
@media (max-width: 899px) { .story-copy .copy-block { bottom: calc(var(--space-4) + var(--progress-h) - 14px + env(safe-area-inset-bottom)); } }
@media print { .scroll-cup, .beans { display: none; } }
/* Traveller variants (content/site.json -> scrollTraveller, or ?traveller=person|cup). */
.scroll-cup .cup .t-person { display: none; }
.scroll-cup[data-traveller="person"] .cup .t-cup { display: none; }
.scroll-cup[data-traveller="person"] .cup .t-person { display: block; }
.scroll-cup[data-traveller="person"] .cup { width: 20px; height: 30px; bottom: 3px; }
.t-person .leg { display: none; }
.t-person[data-frame="0"] .f0, .t-person[data-frame="1"] .f1, .t-person[data-frame="2"] .f2 { display: inline; }
.t-person:not([data-frame]) .f1 { display: inline; }
