/* Colours taken from the owner's AMI 200 photo: aqua lacquer, chrome, ivory title strips, red key accents. */
:root {
  --bg: #0b0808;
  --ink: #f3ece0;
  --mute: #b7aa9c;
  --aqua: #8fd3c9;
  --aqua-deep: #2f7c76;
  --ivory: #f4ead0;
  --red: #c4262e;
  --chrome: #d9dde1;
  --card: #15100e;
  --line: rgba(243, 236, 224, 0.12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Hanken Grotesk", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }

/* ---------- the jukebox hero ---------- */
.hero { position: relative; min-height: 100svh; overflow: hidden; display: flex; flex-direction: column; align-items: center; padding: clamp(18px, 3vh, 34px) 0 20px; }
.bar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.shade { position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.35) 100%), linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0) 18%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.55)); }

/* her name, centred, with breathing room above the jukebox */
.name { position: relative; z-index: 3; text-align: center; margin-bottom: clamp(4px, 1.5vh, 16px); }
.name h1 { margin: 0; font: 400 clamp(34px, 5vw, 64px)/1 "Italiana", serif; letter-spacing: 0.02em; text-transform: lowercase; text-shadow: 0 2px 18px rgba(0,0,0,0.7); }
.name .j { font-family: "Pinyon Script", cursive; text-transform: none; font-size: 1.25em; margin-right: -0.04em; }

/* the stage: render is 1600x1240 with the machine in the middle 60% */
.stage { position: relative; z-index: 2; width: min(100vw, calc((100svh - 250px) * 1600 / 1240)); min-width: min(100vw, 640px); aspect-ratio: 1600 / 1240; margin-top: -3%; margin-bottom: -2%; }
.machine { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.mech { position: absolute; pointer-events: none; }
/* bloom: the marquee, jewels and lamps glow past their edges, like a lens sees them */
.bloom { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.8; }
.lights { position: absolute; inset: 0; pointer-events: none; }
.lamp { position: absolute; border-radius: 50%; mix-blend-mode: screen; opacity: 0; transition: opacity .25s ease; }
.key-lamp { border-radius: 3px; background: radial-gradient(closest-side, rgba(255, 236, 190, 0.9), rgba(255, 210, 140, 0.35) 60%, rgba(255, 200, 120, 0)); }
.key-lamp.on { opacity: 1; }
.jewel-lamp { background: radial-gradient(closest-side, rgba(255, 150, 80, 0.75), rgba(255, 110, 40, 0.25) 55%, rgba(255, 90, 30, 0)); }
.jewel-lamp.on { animation: jewel 1.6s ease-in-out infinite; }
@keyframes jewel { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.9; } }
/* fine film grain over the whole scene */
.grain { position: absolute; inset: -50%; z-index: 4; pointer-events: none; opacity: 0.07; background: url("assets/grain.png"); animation: grain 0.9s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }
.strip-glow { position: absolute; pointer-events: none; opacity: 0; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 214, 120, 0.9), 0 0 14px 4px rgba(255, 200, 90, 0.55);
  background: rgba(255, 220, 140, 0.18); mix-blend-mode: screen; transition: opacity .35s ease; }
.strip-glow.on { opacity: 1; animation: glow 1.8s ease-in-out infinite; }
.strip-glow.on.soft { opacity: 0.55; animation: none; }
@keyframes glow { 50% { box-shadow: 0 0 0 1px rgba(255, 214, 120, 0.7), 0 0 22px 6px rgba(255, 200, 90, 0.4); } }

/* keys flank the machine, each level with its own title strip (positions come from layout.json) */
.keys { position: absolute; inset: 0; pointer-events: none; }
.key-side { position: absolute; top: 20%; bottom: 24%; width: 15.5%; display: flex; flex-direction: column; justify-content: space-evenly; gap: 6px; }
.key-side.left { left: 1.6%; } .key-side.right { right: 1.6%; }
@media (min-width: 1100px) { .key-side { width: 21%; } .key-side.left { left: -4.5%; } .key-side.right { right: -4.5%; } }
.key { position: relative; pointer-events: auto; width: 100%; padding: 7px 10px 7px 40px; border-radius: 2px; cursor: pointer; text-align: center;
  font: 400 clamp(10px, 0.95vw, 13px)/1.25 "Special Elite", "Courier New", monospace; color: #1e1a18; text-transform: uppercase; letter-spacing: 0.02em;
  background: linear-gradient(#f6ecc8, #ebdcac); border-top: 3px solid #b0242a; border-bottom: 3px solid #b0242a;
  box-shadow: 0 2px 0 rgba(90, 70, 40, 0.6), 0 4px 10px rgba(0,0,0,0.5); transition: transform .08s ease, box-shadow .08s ease, filter .15s ease; }
.key b { position: absolute; left: 0; top: 0; bottom: 0; width: 30px; display: grid; place-items: center; font: 600 12px "Hanken Grotesk", system-ui, sans-serif; color: #ece6d6; background: #201e1e; }
.key span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key small { display: block; font-size: 0.82em; color: #a8262c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key:hover { filter: brightness(1.06); }
.key:active, .key[aria-pressed="true"] { transform: translateY(2px); box-shadow: 0 0 0 rgba(90, 70, 40, 0.6), 0 1px 4px rgba(0,0,0,0.5); }
.key[aria-pressed="true"] { background: linear-gradient(#fff4cf, #f3dc98); filter: drop-shadow(0 0 8px rgba(255, 210, 120, 0.55)); }
.key:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }

/* now playing + the Spotify player, under the jukebox */
.deck { position: relative; z-index: 3; width: min(460px, calc(100vw - 32px)); text-align: center; margin-top: 6px; }
.now { margin: 0 0 8px; font-size: 15px; letter-spacing: 0.02em; color: var(--ivory); text-shadow: 0 1px 10px rgba(0,0,0,0.8); }
.player { position: relative; border-radius: 14px; padding: 4px; background: linear-gradient(#e9ecef, #9aa1a6 45%, #dfe3e6); box-shadow: 0 6px 18px rgba(0,0,0,0.55); }
.player iframe { display: block; border-radius: 12px; }
.player.cue { animation: cue 1.4s ease-in-out infinite; }
@keyframes cue { 50% { box-shadow: 0 0 0 3px rgba(143, 211, 201, 0.85), 0 0 22px rgba(143, 211, 201, 0.5); } }
.tap-cue { margin: 8px 0 0; font-size: 13px; color: var(--aqua); }
.deck-links { display: flex; justify-content: center; gap: 22px; align-items: baseline; margin-top: 14px; }
.bar-sound { background: none; border: 0; padding: 0; cursor: pointer; color: var(--mute); font: 14px "Hanken Grotesk", system-ui, sans-serif; letter-spacing: 0.04em; }
.bar-sound:hover, .bar-sound:focus-visible, .bar-sound[aria-pressed="true"] { color: var(--ink); }
.story-link { display: inline-block; color: var(--mute); font-size: 14px; text-decoration: none; letter-spacing: 0.04em; }
.story-link:hover, .story-link:focus-visible { color: var(--ink); }

/* ---------- her story ---------- */
.story { max-width: 760px; margin: 0 auto; padding: 72px 20px 48px; }
.chapter { padding: 40px 0; border-top: 1px solid var(--line); }
.chapter:first-child { border-top: 0; }
.eyebrow { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--aqua); }
.chapter h2 { margin: 0 0 18px; font: 400 clamp(28px, 4vw, 40px)/1.15 "Italiana", serif; }
.chapter h3 { margin: 4px 0 6px; font-size: 17px; font-weight: 600; }
.chapter p { line-height: 1.7; color: #e6ddcf; }
.lead { font-size: 19px; }
.aside { font-style: italic; color: var(--mute); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0 0 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 0; }
.stat dt { font-size: 13px; color: var(--mute); }
.stat dd { margin: 6px 0 0; font: 400 34px/1 "Italiana", serif; color: var(--ivory); }
.hero-stat dd { color: var(--aqua); }
.ledger, .timeline, .reach { list-style: none; margin: 0; padding: 0; }
.ledger li { padding: 14px 0; border-top: 1px solid var(--line); }
.tag, .when { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--aqua); }
.ledger p { margin: 6px 0 0; }
.timeline li { position: relative; padding: 0 0 22px 22px; border-left: 1px solid var(--aqua-deep); }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--aqua-deep); }
.timeline .now-item::before { background: var(--aqua); box-shadow: 0 0 10px var(--aqua); }
.timeline p { margin: 0; }
.reach li { display: flex; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.reach span { width: 90px; color: var(--mute); }
.reach a, .foot a { color: var(--ink); }
.foot { text-align: center; padding: 32px 0 8px; font-size: 14px; }
.foot a { color: var(--mute); }

/* ---------- phone: the flanking keys hide; a two-column grid sits under the machine ---------- */
.keys-grid { display: none; }
@media (max-width: 760px) {
  .stage { width: 100vw; min-width: 0; margin-top: 0; }
  .keys { display: none; }
  .keys-grid { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: column; grid-template-rows: repeat(5, auto); gap: 8px; width: 100%; padding: 4px 16px 0; }
  .keys-grid .key { position: relative; transform: none; width: 100%; padding: 9px 8px 9px 38px; font-size: 13px; }
  .keys-grid .key:active, .keys-grid .key[aria-pressed="true"] { transform: translateY(2px); }
  
  .deck { margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .strip-glow.on { animation: none; }
}
