:root {
  --canvas: #0b0b12;
  --surface-1: #12121b;
  --surface-2: #191924;
  --surface-3: #21212e;
  --hairline: rgba(243, 233, 220, 0.08);
  --hairline-strong: rgba(243, 233, 220, 0.16);
  --ink: #f3e9dc;
  --ink-soft: #c4b8aa;
  --ink-mute: #857d8c;
  --crema: #e0a96d;
  --crema-2: #f1c58f;
  --roast: #6b4430;
  --roast-deep: #3a2419;
  --success: #7ee2a8;
  --sky-top: #191426;
  --sky-mid: #0e0d18;
  --sky-low: #07070c;
  --glass: rgba(18, 18, 27, 0.82);
  --nav-fade: rgba(11, 11, 18, 0.85);
  --nav-fade-0: rgba(11, 11, 18, 0);
  --on-crema: #0b0b12;
  --radius: 16px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--crema); color: var(--canvas); }

/* ---------- Atmosphere ---------- */
.sky {
  position: fixed; inset: 0; z-index: -3;
  background: radial-gradient(120% 80% at 70% 0%, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-low) 100%);
  transition: background 0.2s linear;
}
.stars { position: absolute; inset: 0; }
.star {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #fff8ec; opacity: 0.6;
  animation: twinkle var(--d, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.9; } }
.moon {
  position: absolute; top: 9vh; right: 9vw;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6e3, #f3dcb3 60%, #d8b98a);
  box-shadow: 0 0 60px 10px rgba(255, 220, 160, 0.18);
}
.moon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 70% 60%, rgba(0,0,0,0.08) 0 10%, transparent 11%),
              radial-gradient(circle at 40% 70%, rgba(0,0,0,0.06) 0 7%, transparent 8%);
}
.weather { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
.weather.on { opacity: 1; }
.grain {
  position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- Scroll cup ---------- */
.scroll-cup {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 52px; height: 52px; padding: 6px;
  color: var(--crema); border-radius: 50%;
  background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid var(--hairline);
}
.scroll-cup svg { width: 100%; height: 100%; }
.scroll-cup-fill { fill: var(--roast); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  background: linear-gradient(to bottom, var(--nav-fade), var(--nav-fade-0));
  backdrop-filter: blur(6px);
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.logo svg { width: 28px; height: 28px; color: var(--crema); }
.nav-links { display: flex; gap: 28px; font-size: 0.92rem; color: var(--ink-soft); }
.nav-links a { position: relative; transition: color 0.2s; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px; background: var(--crema); transition: width 0.3s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- Shared ---------- */
section { position: relative; padding: clamp(80px, 14vh, 160px) clamp(16px, 6vw, 96px); }
.eyebrow { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--crema); margin-bottom: 18px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 450; letter-spacing: -0.03em; line-height: 1.05; }
h3 { letter-spacing: -0.02em; }
h2 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
.section-head { max-width: 760px; margin-bottom: 64px; }
.lede { margin-top: 18px; font-size: 1.12rem; color: var(--ink-soft); max-width: 560px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  transition: translate 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.btn-primary { background: var(--crema); color: var(--on-crema); box-shadow: 0 10px 40px -10px rgba(224, 169, 109, 0.6); }
.btn-primary:hover { translate: 0 -2px; background: var(--crema-2); box-shadow: 0 16px 50px -10px rgba(224, 169, 109, 0.8); }
.btn-ghost { color: var(--ink); border: 1px solid var(--hairline); }
.btn-ghost:hover { border-color: var(--crema); color: var(--crema-2); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 40px;
  padding-top: 120px;
}
.hero-title { font-size: clamp(3.2rem, 9vw, 7.6rem); font-weight: 400; letter-spacing: -0.035em; line-height: 1.02; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.hero-title .word { display: inline-block; }
.hero-title em { font-style: italic; color: var(--crema); font-weight: 300; }
.hero-sub { margin-top: 28px; max-width: 520px; font-size: 1.15rem; color: var(--ink-soft); }
.hero-cta { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-art { position: relative; display: grid; place-items: center; min-height: 420px; }
.glow { position: absolute; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(224, 169, 109, 0.35), transparent 65%); filter: blur(20px); animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: 0.75; } }
.mug { position: relative; width: min(340px, 80%); filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.5)); }
.mug-shadow { fill: rgba(0, 0, 0, 0.35); }
.mug-body { fill: #efe3d3; }
.mug-rim { fill: #f8efe3; }
.mug-coffee { fill: var(--roast-deep); }
.mug-handle { fill: none; stroke: #efe3d3; stroke-width: 18; stroke-linecap: round; }
.mug-text { font-family: var(--mono); font-size: 44px; font-weight: 600; fill: var(--roast); }
.steam { position: absolute; top: -40px; width: 220px; left: 50%; transform: translateX(-56%); overflow: visible; }
.steam path {
  fill: none; stroke: rgba(243, 233, 220, 0.5); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 60 200; animation: steam 4.5s ease-in-out infinite; filter: blur(1.5px);
}
.steam path:nth-child(2) { animation-delay: 1.4s; }
.steam path:nth-child(3) { animation-delay: 2.8s; }
@keyframes steam {
  0% { stroke-dashoffset: 260; opacity: 0; }
  20% { opacity: 0.9; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.72rem; color: var(--ink-mute); letter-spacing: 0.08em;
}
.scroll-line { width: 1px; height: 48px; background: linear-gradient(var(--crema), transparent); animation: drip 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Manifesto ---------- */
.manifesto { min-height: 80vh; display: grid; place-items: center; }
.manifesto-text { max-width: 1000px; font-family: var(--serif); font-size: clamp(1.7rem, 3.8vw, 3.1rem); line-height: 1.3; font-weight: 300; text-align: center; }
.manifesto-text .w { opacity: 0.15; transition: opacity 0.2s; }
.manifesto-text .hl { color: var(--crema); font-style: italic; }

/* ---------- Night shift ---------- */
.shift { padding-left: 0; padding-right: 0; overflow: hidden; }
.shift-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 0 clamp(16px, 6vw, 96px); margin-bottom: 56px; }
.shift-clock { position: relative; width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--hairline); background: var(--surface-1); flex-shrink: 0; }
.shift-clock .hand { position: absolute; left: 50%; bottom: 50%; transform-origin: bottom center; border-radius: 4px; background: var(--ink); }
.shift-clock .hour { width: 4px; height: 24px; margin-left: -2px; transform: rotate(270deg); }
.shift-clock .minute { width: 2px; height: 36px; margin-left: -1px; background: var(--crema); }
.shift-clock .pin { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--crema); }
.shift-track { display: flex; gap: 28px; padding: 0 clamp(16px, 6vw, 96px); width: max-content; }
.shift-card {
  position: relative; width: min(420px, 78vw); min-height: 380px; padding: 36px;
  display: flex; flex-direction: column; gap: 16px;
  border-radius: var(--radius); border: 1px solid var(--hairline);
  background: var(--surface-1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.shift-card .time { font-family: var(--mono); font-size: 2.4rem; font-weight: 600; color: var(--crema); letter-spacing: -0.03em; }
.shift-card h3 { font-size: 2.6rem; }
.shift-card p { color: var(--ink-soft); flex: 1; }
.tag { align-self: flex-start; font-family: var(--mono); font-size: 0.74rem; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(224, 169, 109, 0.35); color: var(--crema-2); }

/* ---------- Menu ---------- */
.menu-board {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px;
}
.menu-item {
  position: relative; padding: 32px; border-radius: var(--radius);
  background: var(--surface-1); border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.3s, background 0.3s;
}
.menu-item::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(224, 169, 109, 0.12), transparent 40%);
}
.menu-item:hover { border-color: var(--hairline-strong); background: var(--surface-2); }
.menu-item:hover::before { opacity: 1; }
.menu-row { display: flex; align-items: baseline; gap: 12px; }
.menu-row h3 { font-size: 1.7rem; white-space: nowrap; }
.leader { flex: 1; border-bottom: 2px dotted rgba(243, 233, 220, 0.2); transform: translateY(-6px); min-width: 20px; }
.kind { font-family: var(--mono); font-size: 0.8rem; color: var(--crema); white-space: nowrap; }
.menu-name { margin: 6px 0 14px; font-weight: 600; color: var(--ink); }
.menu-item > p:not(.menu-name) { color: var(--ink-soft); font-size: 0.97rem; }
.notes { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.notes li { font-size: 0.78rem; padding: 4px 10px; border-radius: 999px; background: rgba(243, 233, 220, 0.06); color: var(--ink-soft); }

/* ---------- Terminal ---------- */
.terminal {
  max-width: 860px; border-radius: var(--radius); overflow: hidden;
  background: rgba(11, 11, 18, 0.88); border: 1px solid var(--hairline);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.8);
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); background: var(--surface-3); }
.term-bar span { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.term-bar span:nth-child(2) { background: #febc2e; }
.term-bar span:nth-child(3) { background: #28c840; }
.term-bar p { margin-left: auto; margin-right: auto; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-mute); transform: translateX(-24px); }
.term-body { padding: 26px; min-height: 330px; font-family: var(--mono); font-size: clamp(0.78rem, 1.8vw, 0.95rem); line-height: 1.8; white-space: pre-wrap; word-break: break-word; color: var(--ink-soft); }
.term-body .p { color: var(--ink); }
.term-body .ok { color: var(--success); }
.term-body .c { color: var(--crema); }
.term-body .m { color: var(--ink-mute); }
.caret { color: var(--crema); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding-top: 70px; padding-bottom: 70px; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-num { font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 4.6rem); color: var(--crema); line-height: 1; }
.stat-label { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Lofi ---------- */
.lofi { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.player {
  display: flex; align-items: center; gap: 40px; width: min(760px, 100%);
  padding: 36px; border-radius: 28px;
  background: var(--surface-1); border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.vinyl {
  flex-shrink: 0; width: 170px; height: 170px; border-radius: 50%;
  background: repeating-radial-gradient(circle, #111 0 2px, #1b1b1f 2px 4px);
  display: grid; place-items: center; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: spin 3.2s linear infinite; animation-play-state: paused;
}
.vinyl-label { width: 62px; height: 62px; border-radius: 50%; background: var(--crema); color: var(--canvas); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-style: italic; }
.playing .vinyl { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.player-info h3 { font-size: 1.8rem; }
.artist { color: var(--ink-soft); margin-top: 4px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin: 20px 0; }
.bars i { width: 5px; height: 6px; border-radius: 3px; background: var(--ink-mute); }
.playing .bars i { animation: eq 1s ease-in-out infinite; }
.bars i:nth-child(odd) { animation-duration: 0.8s; }
.bars i:nth-child(3n) { animation-duration: 1.3s; background: var(--crema); }
.bars i:nth-child(4n) { animation-delay: 0.2s; }
.bars i:nth-child(5n) { animation-delay: 0.45s; }
@keyframes eq { 0%, 100% { height: 6px; } 50% { height: 32px; } }
.play {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 12px 22px; border-radius: 999px; border: 1px solid var(--hairline-strong);
  background: var(--surface-3); color: var(--ink); font: 600 0.92rem var(--sans);
  transition: background 0.25s;
}
.play:hover { background: var(--surface-2); }
.lofi-note { color: var(--ink-mute); font-size: 0.9rem; font-style: italic; font-family: var(--serif); }

/* ---------- Marquee ---------- */
.stack { padding-top: 40px; padding-bottom: 40px; padding-left: 0; padding-right: 0; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 36px; width: max-content; animation: marquee 32s linear infinite; font-family: var(--serif); font-size: clamp(1.6rem, 4vw, 2.8rem); color: var(--ink-mute); white-space: nowrap; }
.marquee-track span:nth-child(even) { font-size: 0.7em; align-self: center; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Contact ---------- */
.contact { display: grid; place-items: center; min-height: 80vh; }
.contact-card { text-align: center; max-width: 720px; display: flex; flex-direction: column; align-items: center; }
.contact-card h2 { font-size: clamp(3rem, 8vw, 6rem); }
.btn-big { margin-top: 38px; padding: 18px 34px; font-size: 1.1rem; font-family: var(--mono); }
.small { margin-top: 16px; font-size: 0.85rem; color: var(--ink-mute); }

/* ---------- Footer ---------- */
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 32px clamp(16px, 6vw, 96px) 90px; border-top: 1px solid var(--hairline); color: var(--ink-mute); font-size: 0.85rem; }
.footer-sign { font-family: var(--serif); font-style: italic; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; text-align: left; padding-top: 110px; gap: 10px; }
  .hero-art { min-height: 300px; order: -1; }
  .glow { width: 260px; height: 260px; }
  .mug { width: 210px; }
  .steam { width: 150px; top: -20px; }
  .scroll-hint { display: none; }
  .moon { width: 56px; height: 56px; top: 90px; right: 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .player { flex-direction: column; text-align: center; gap: 24px; padding: 28px 20px; }
  .bars { justify-content: center; }
  .shift-track { flex-direction: column; width: auto; }
  .shift-card { width: 100%; min-height: 0; }
}
@media (max-width: 480px) {
  .scroll-cup { width: 40px; height: 40px; right: 14px; bottom: 14px; padding: 5px; }
  .menu-row h3 { font-size: 1.4rem; }
  .menu-item { padding: 24px; }
  .shift-card { padding: 26px; }
  .shift-card h3 { font-size: 2rem; }
  .vinyl { width: 140px; height: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
  html { scroll-behavior: auto; }
}

/* ---------- 3D story ---------- */
.scene {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0;
  cursor: grab; touch-action: pan-y; transition: opacity 0.2s linear;
}
.scene.grabbing { cursor: grabbing; }
main, .footer { position: relative; z-index: 1; }
main > section:not(.story) { background: transparent; }
.story { height: 900vh; padding: 0; pointer-events: none; }
.story-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; }
.story .btn, .story-dots, .story a { pointer-events: auto; }

.chapter {
  position: absolute; left: clamp(16px, 5vw, 72px); bottom: clamp(24px, 9vh, 96px);
  width: min(440px, calc(100% - 32px)); padding: 28px 30px;
  background: var(--glass); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; transform: translateY(24px); visibility: hidden;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2,.7,.2,1), visibility 0s linear 0.6s;
}
.chapter.active { opacity: 1; transform: none; visibility: visible; transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2,.7,.2,1), visibility 0s; }
.chapter h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-bottom: 12px; }
.chapter p:not(.eyebrow) { color: var(--ink-soft); font-size: 1rem; }
.chapter .eyebrow { margin-bottom: 12px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips li { font-size: 0.78rem; padding: 5px 11px; border-radius: 999px; background: var(--surface-3); color: var(--ink-soft); }

.chapter-hero {
  top: clamp(96px, 16vh, 170px); bottom: auto; width: min(620px, calc(100% - 32px));
  background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0;
}
.chapter-hero .hero-title { font-size: clamp(3rem, 7.4vw, 6.6rem); }
.chapter-hero .hero-title em { display: block; }
.chapter-hero .hero-sub { text-shadow: 0 2px 20px var(--nav-fade); }
.hero-cta { align-items: center; }
.drag-hint { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-mute); }
.drag-icon { display: inline-block; font-size: 1.1rem; color: var(--crema); animation: sway 2.4s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(-35deg); } }

.story-dots {
  position: absolute; right: clamp(14px, 3vw, 40px); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 14px;
}
.story-dots button {
  width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--hairline-strong);
  background: transparent; cursor: pointer; padding: 0; transition: background 0.3s, transform 0.3s;
}
.story-dots button[aria-current="step"] { background: var(--crema); border-color: var(--crema); transform: scale(1.3); }
.story .scroll-hint { transition: opacity 0.4s; }
body:not([data-chapter="0"]) .story .scroll-hint { opacity: 0; }

@media (max-width: 900px) {
  .chapter { left: 16px; right: 16px; width: auto; bottom: 16px; padding: 20px 22px; }
  .chapter h2 { font-size: 1.7rem; }
  .chapter p:not(.eyebrow) { font-size: 0.93rem; }
  .chapter-hero { top: 92px; bottom: auto; }
  .chapter-hero .hero-title { font-size: clamp(2.6rem, 12vw, 3.6rem); }
  .chapter-hero .hero-sub { font-size: 1rem; margin-top: 16px; }
  .story-dots { right: 8px; gap: 10px; }
  .story-dots button { width: 8px; height: 8px; }
  .story .scroll-hint { display: none; }
  .chips { margin-top: 12px; }
}
@media (max-width: 480px) {
  .chapter:not(.chapter-hero) .chips { display: none; }
  .chapter:not(.chapter-hero) .eyebrow { font-size: 0.68rem; }
}
.no-webgl .scene { display: none; }
.no-webgl .story { height: 500vh; }
.no-webgl .drag-hint { display: none; }
/* let drags reach the 3D canvas through the story; everything else stays interactive */
main { pointer-events: none; }
main > section:not(.story) { pointer-events: auto; }

/* ---------- Nav actions: lofi + theme ---------- */
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; min-width: 40px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--hairline-strong); background: var(--glass); color: var(--ink-soft);
  font: 400 0.78rem var(--mono); backdrop-filter: blur(8px);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--crema); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle { padding: 0; width: 40px; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }
.mini-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.mini-eq i { width: 3px; height: 4px; border-radius: 2px; background: var(--crema); animation: mini-eq 0.9s ease-in-out infinite; }
@keyframes mini-eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.mini-eq i:nth-child(2) { animation-duration: 0.7s; animation-delay: 0.1s; }
.mini-eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: 0.25s; }
.mini-eq i:nth-child(4) { animation-duration: 0.8s; animation-delay: 0.05s; }
.sound-toggle[aria-pressed="true"] { color: var(--crema); border-color: var(--crema); }
.sound-toggle[aria-pressed="true"] .i-note { display: none; }
.sound-toggle[aria-pressed="true"] .mini-eq { display: inline-flex; }
.sound-toggle { padding: 0; width: 40px; }

/* ---------- Light theme: the morning shift ---------- */
:root[data-theme="light"] {
  --canvas: #f6efe4;
  --surface-1: #fffaf3;
  --surface-2: #f4eadc;
  --surface-3: #ece0cf;
  --hairline: rgba(58, 36, 25, 0.1);
  --hairline-strong: rgba(58, 36, 25, 0.2);
  --ink: #2a1d16;
  --ink-soft: #5b4a3e;
  --ink-mute: #8a786a;
  --crema: #b06a2c;
  --crema-2: #94551f;
  --sky-top: #ffd9b0;
  --sky-mid: #f9e9d6;
  --sky-low: #f6efe4;
  --glass: rgba(255, 250, 243, 0.86);
  --nav-fade: rgba(246, 239, 228, 0.9);
  --nav-fade-0: rgba(246, 239, 228, 0);
  --on-crema: #fffaf3;
  color-scheme: light;
}
:root[data-theme="light"] .stars { opacity: 0; }
:root[data-theme="light"] .moon {
  background: radial-gradient(circle at 40% 40%, #fff6dc, #ffc56b 60%, #f39a3d);
  box-shadow: 0 0 80px 20px rgba(255, 170, 80, 0.35);
}
:root[data-theme="light"] .moon::after { display: none; }
:root[data-theme="light"] .grain { opacity: 0.035; mix-blend-mode: multiply; }
:root[data-theme="light"] .term-body { color: #c4b8aa; }
:root[data-theme="light"] .terminal { background: #1a1a24; }
:root[data-theme="light"] .scroll-cup-fill { fill: #b06a2c; }
.stars { transition: opacity 0.6s; }
body, .sky { transition: background-color 0.5s; }

/* ---------- Day / night wording ---------- */
.t-day { display: none; }
:root[data-theme="light"] .t-night { display: none; }
:root[data-theme="light"] .t-day { display: inline; }

/* ---------- Chapter cards as café menus ---------- */
:root { --menu-bg: rgba(22, 19, 15, 0.9); --menu-ink: #f3e9dc; --menu-line: rgba(243, 233, 220, 0.22); }
:root[data-theme="light"] { --menu-bg: rgba(255, 250, 241, 0.94); --menu-ink: #2a1d16; --menu-line: rgba(58, 36, 25, 0.25); }
.chapter.menu-card {
  padding: 22px 28px 16px; border-radius: 6px; text-align: center;
  background: var(--menu-bg); color: var(--menu-ink);
  border: 1px solid var(--menu-line);
  box-shadow: inset 0 0 0 5px var(--menu-bg), inset 0 0 0 6px var(--menu-line), 0 24px 60px -20px rgba(0, 0, 0, 0.5);
}
.menu-head {
  display: flex; justify-content: space-between; padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 1px solid var(--menu-line);
  font: 400 0.68rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute);
}
.menu-cat { font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--crema); margin-bottom: 6px; }
.menu-cat span { font-style: normal; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.chapter.menu-card h2 { color: var(--menu-ink); margin-bottom: 10px; }
.chapter.menu-card > p:not(.menu-cat):not(.menu-foot) { font-size: 0.95rem; text-align: left; }
.menu-lines { list-style: none; margin: 16px 0 4px; padding-top: 12px; border-top: 1px dashed var(--menu-line); }
.menu-lines li { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-family: var(--serif); font-size: 1.02rem; text-align: left; }
.menu-lines i { flex: 1; border-bottom: 2px dotted var(--menu-line); transform: translateY(-4px); min-width: 16px; }
.menu-lines b { font: 400 0.76rem var(--mono); color: var(--crema); white-space: nowrap; }
.menu-foot { margin-top: 8px; font-family: var(--serif); color: var(--ink-mute); letter-spacing: 0.3em; font-size: 0.85rem; }
@media (max-width: 900px) {
  .chapter.menu-card { padding: 16px 20px 10px; }
  .menu-lines li { font-size: 0.92rem; padding: 2px 0; }
}
@media (max-width: 480px) {
  .menu-lines, .menu-foot { display: none; }
  .menu-head { margin-bottom: 10px; padding-bottom: 8px; font-size: 0.62rem; }
}

/* ---------- Ambience moods ---------- */
.moods { display: inline-flex; gap: 4px; margin-top: 16px; padding: 4px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface-2); }
.moods button {
  border: 0; cursor: pointer; padding: 7px 14px; border-radius: 999px; background: transparent;
  color: var(--ink-soft); font: 500 0.85rem var(--sans); transition: background 0.25s, color 0.25s;
}
.moods button[aria-checked="true"] { background: var(--surface-1); color: var(--ink); box-shadow: 0 1px 0 var(--hairline-strong); }
.player.snow .vinyl-label { background: #e8eef7; }
.player.snow .bars i:nth-child(3n) { background: #cfe0f5; }
@media (max-width: 900px) { .moods { margin-left: auto; margin-right: auto; } }

/* ---------- Mobile hero: text up top, café fills the lower half ---------- */
.hide-sm { display: inline; }
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .moon { display: none; }
  .scroll-cup { display: none; }
  .chapter-hero { top: 78px; padding-right: 8px; }
  .chapter-hero .eyebrow { margin-bottom: 10px; font-size: 0.7rem; }
  .chapter-hero .hero-title { font-size: clamp(2.3rem, 11vw, 3rem); line-height: 1.02; }
  .chapter-hero .hero-title em { display: inline; }
  .chapter-hero .hero-sub { font-size: 0.95rem; line-height: 1.5; margin-top: 12px; max-width: 34ch; }
  .chapter-hero .hero-cta { margin-top: 18px; gap: 12px; }
  .chapter-hero .btn { padding: 11px 20px; font-size: 0.9rem; }
  .story-sticky::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 52%;
    background: linear-gradient(to bottom, var(--canvas) 55%, transparent);
    opacity: 0.85; pointer-events: none; transition: opacity 0.6s;
  }
  body:not([data-chapter="0"]) .story-sticky::before { opacity: 0; }
  .story-dots { top: auto; bottom: 18px; right: 50%; transform: translateX(50%); flex-direction: row; }
  body:not([data-chapter="0"]) .story-dots { display: none; }
}
