/* shidnf.art — design tokens ------------------------------------------------ */
:root {
  --bg: #120a05;
  --espresso: #2b1a0f;
  --choc: #4a2c17;
  --caramel: #8b5a2b;
  --mustard: #c8923a;
  --gold: #e2ac4c;
  --cream: #f6e7c8;
  --slime: #a8b04a;
  --ink: #f6e7c8;
  --muted: rgba(246, 231, 200, 0.58);
  --line: rgba(246, 231, 200, 0.1);
  --glass: linear-gradient(160deg, rgba(255, 228, 186, 0.075), rgba(255, 228, 186, 0.018) 60%);
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Instrument Serif', ui-serif, Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --spring: cubic-bezier(0.34, 1.9, 0.5, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(1.25rem, 5vw, 6rem);
  --radius: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg);
  font-family: var(--display); font-size: 16px; line-height: 1.5; overflow-x: hidden; overflow-x: clip;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body::before { /* ambient page glows */
  content: ''; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 15% 30%, rgba(139, 90, 43, 0.22), transparent 70%),
    radial-gradient(35% 30% at 85% 70%, rgba(200, 146, 58, 0.13), transparent 70%),
    radial-gradient(30% 30% at 60% 10%, rgba(168, 176, 74, 0.06), transparent 70%);
  animation: drift 28s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(4%, -3%, 0) rotate(4deg); } }
::selection { background: var(--mustard); color: var(--espresso); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 12px; }
.defs { position: absolute; width: 0; height: 0; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
kbd { font-family: var(--mono); font-size: 0.78em; padding: 0.1em 0.45em; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,0.04); }

/* ---------- overlays ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 95; pointer-events: none; opacity: 0.1; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .75 0 0 0 1.2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(5) 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); }
}
.gas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 80; pointer-events: none; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; pointer-events: none; }
.progress span { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--caramel), var(--gold), var(--slime)); }
.cursor { display: none; }
.has-cursor .cursor {
  display: block; position: fixed; left: 0; top: 0; z-index: 130; pointer-events: none; opacity: 0; transition: opacity 0.3s;
}
.has-cursor .cursor.on { opacity: 1; }
.cursor span {
  display: block; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: var(--cream); mix-blend-mode: difference;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; z-index: 100; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(1320px, calc(100% - 24px)); display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 10px 10px 10px 18px; border-radius: 999px; border: 1px solid transparent;
  transition: background 0.5s var(--out), border-color 0.5s, backdrop-filter 0.5s;
}
.nav.is-scrolled { background: rgba(26, 15, 8, 0.55); border-color: var(--line); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.04em; }
.brand-word em { font-family: var(--serif); font-weight: 400; color: var(--gold); font-size: 1.15em; }
.brand-blob { position: relative; width: 34px; height: 34px; filter: url(#goo-sm); }
.brand-blob i { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; border-radius: 50%; background: var(--gold); animation: orbit 3.2s ease-in-out infinite; }
.brand-blob i:nth-child(2) { background: var(--caramel); width: 20px; height: 20px; margin: -10px; animation-delay: -1s; animation-duration: 4s; }
.brand-blob i:nth-child(3) { background: var(--slime); width: 11px; height: 11px; margin: -5.5px; animation-delay: -2s; animation-duration: 2.6s; }
@keyframes orbit {
  0%, 100% { transform: translate(-7px, 3px); } 33% { transform: translate(6px, -6px); } 66% { transform: translate(4px, 7px); }
}
.nav-links { display: flex; gap: 0.25rem; font-weight: 500; }
.nav-links a { padding: 0.55rem 1rem; border-radius: 999px; color: var(--muted); transition: color 0.3s, background 0.3s; }
.nav-links a:hover { color: var(--cream); background: rgba(246, 231, 200, 0.06); }

/* ---------- gooey button ---------- */
.gbtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; isolation: isolate;
  padding: 1.05rem 1.9rem; border: 0; background: none; color: var(--espresso); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em;
}
.gbtn--sm { padding: 0.75rem 1.3rem; font-size: 0.95rem; }
.gbtn-bg { position: absolute; inset: 0; z-index: -1; filter: url(#goo); }
.gbtn-bg::before { content: ''; position: absolute; inset: 0; border-radius: 999px; background: var(--gold); }
.gbtn-bg i { position: absolute; top: 50%; width: 2.2em; height: 2.2em; margin-top: -1.1em; border-radius: 50%; background: var(--gold); transition: transform 0.7s var(--spring); }
.gbtn-bg i:nth-child(1) { left: 18%; }
.gbtn-bg i:nth-child(2) { right: 16%; }
.gbtn:hover .gbtn-bg i:nth-child(1) { transform: translate(-0.6em, -1.25em) scale(0.9); }
.gbtn:hover .gbtn-bg i:nth-child(2) { transform: translate(0.5em, 1.2em) scale(0.85); }
.gbtn:active .gbtn-bg { transform: scale(0.94, 0.88); transition: transform 0.1s; }
.gbtn-bg { transition: transform 0.6s var(--spring); }
.gbtn::after { content: ''; position: absolute; inset: 0; border-radius: 999px; pointer-events: none; background: linear-gradient(180deg, rgba(255,244,214,.35), transparent 55%, rgba(120,70,20,.25)); }
.gbtn-label { position: relative; z-index: 1; display: inline-flex; gap: 0.45em; align-items: center; white-space: nowrap; }
.gbtn .arrow { display: inline-block; transition: transform 0.5s var(--spring); }
.gbtn:hover .arrow { transform: translateY(3px); }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 0.7rem; padding: 0.6rem 1.3rem 0.6rem 0.6rem; border-radius: 999px;
  border: 1px solid rgba(246, 231, 200, 0.22); background: rgba(26, 15, 8, 0.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-weight: 600; transition: border-color 0.3s, background 0.3s;
}
.ghost-btn:hover { border-color: var(--gold); background: rgba(200, 146, 58, 0.12); }
.ghost-icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--cream); color: var(--espresso); font-size: 0.8rem; padding-left: 2px; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 7rem var(--pad) clamp(2.5rem, 7vh, 5rem); }
.hero-fluid { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: radial-gradient(circle at 70% 40%, var(--caramel), var(--espresso) 60%, var(--bg)); }
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, rgba(18, 10, 5, 0.72) 0%, rgba(18, 10, 5, 0.25) 50%, transparent 75%), linear-gradient(0deg, var(--bg) 0%, transparent 25%); }
.hero-inner { position: relative; z-index: 2; will-change: transform, opacity; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem; margin: 0 0 1.4rem; padding: 0.45rem 0.9rem; border-radius: 999px;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--cream);
  background: rgba(26, 15, 8, 0.45); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--slime); box-shadow: 0 0 0 0 rgba(168, 176, 74, 0.7); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(168, 176, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(168, 176, 74, 0); } }
.hero-title {
  margin: 0; font-weight: 800; font-size: clamp(3.4rem, min(17vw, 19vh), 13rem); line-height: 0.84; letter-spacing: -0.055em;
  font-variation-settings: 'opsz' 96; text-wrap: balance;
}
.hero-title .line { display: block; overflow: hidden; padding: 0 0.12em 0.06em 0; margin-bottom: -0.06em; }
.hero-title .line:nth-child(2) { padding-left: 0.9em; }
.hero-title .line--fart { padding: 0.04em 0.2em 0.24em 0.02em; margin: -0.04em 0 -0.2em; }
/* 'fart.' uses Fraunces Black Italic: its f has a tall hooked ascender and a long descender,
   so it can't be misread as 'tart.' (Instrument Serif's italic f could). */
.hero-title .fart-word {
  font-family: 'Fraunces', var(--serif); font-style: italic; font-weight: 900;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
}
.hero-title em {
  font-size: 1.12em; letter-spacing: -0.03em; padding-right: 0.08em;
  background: linear-gradient(100deg, var(--cream) 0%, var(--gold) 35%, var(--mustard) 60%, var(--slime) 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-title em .char { background: inherit; -webkit-background-clip: text; background-clip: text; }
/* background-clip:text only paints inside each glyph's box, so pad the boxes (and cancel with
   negative margins) to keep italic overhangs — the f's hook and descender — from being cut off. */
.hero-title em .char { padding: 0.12em 0.2em 0.3em; margin: -0.12em -0.2em -0.3em; }
.char { display: inline-block; transform: translateY(105%) rotate(7deg); opacity: 0; transform-origin: 0 100%; }
.is-loaded .char { animation: charIn 1.1s var(--out) forwards; animation-delay: calc(var(--i) * 32ms + 120ms); }
@keyframes charIn { to { transform: none; opacity: 1; } }
.hero-title .char:hover { animation: rubber 0.8s var(--out) both; }
@keyframes rubber {
  0% { transform: none; opacity: 1; } 30% { transform: scale(1.25, 0.75); opacity: 1; } 45% { transform: scale(0.8, 1.2) translateY(-6%); opacity: 1; }
  65% { transform: scale(1.08, 0.94); opacity: 1; } 100% { transform: none; opacity: 1; }
}
.hero-title em .char:hover { animation: none; }
.hero-bottom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.5rem 3rem; margin-top: clamp(1.5rem, 4vh, 2.8rem); }
.hero-sub { max-width: 38ch; margin: 0; font-size: clamp(1rem, 1.3vw, 1.2rem); color: rgba(246, 231, 200, 0.78); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.reveal-up { opacity: 0; transform: translateY(24px); }
.is-loaded .reveal-up { animation: upIn 1s var(--out) forwards; animation-delay: calc(var(--d) * 1s); }
@keyframes upIn { to { opacity: 1; transform: none; } }
.hero-stats { position: absolute; z-index: 2; right: var(--pad); top: 50%; transform: translateY(-50%); list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; text-align: right; }
.hero-stats b { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(2.4rem, 4vw, 3.8rem); line-height: 0.9; color: var(--cream); }
.hero-stats span { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.scroll-hint { position: absolute; z-index: 2; right: var(--pad); bottom: 2.2rem; width: 24px; height: 38px; margin-left: -12px; border: 1.5px solid rgba(246, 231, 200, 0.4); border-radius: 14px; }
.scroll-hint span { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold); animation: wheel 1.6s var(--out) infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

/* ---------- marquee ---------- */
.marquee { position: relative; z-index: 3; overflow: hidden; margin: -1rem 0 0; padding: 1.1rem 0; background: linear-gradient(90deg, var(--mustard), var(--gold), var(--mustard)); color: var(--espresso); transform: rotate(-1.8deg) scale(1.03); box-shadow: 0 20px 60px -20px rgba(200, 146, 58, 0.5); }
.marquee-track { display: flex; width: max-content; gap: 2rem; align-items: center; animation: marquee 32s linear infinite; font-weight: 800; font-size: clamp(1.4rem, 3vw, 2.6rem); text-transform: uppercase; letter-spacing: -0.03em; white-space: nowrap; }
.marquee-track b { font-size: 0.8em; color: var(--choc); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
section { position: relative; }
.lab, .hall, .how { padding: clamp(5rem, 12vw, 10rem) var(--pad) 0; max-width: 1480px; margin: 0 auto; }
.section-head { margin-bottom: clamp(2rem, 4vw, 3.5rem); max-width: 900px; }
.kicker { display: inline-flex; align-items: center; gap: 0.8rem; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.kicker::before { content: ''; width: 36px; height: 1px; background: currentColor; }
.section-head h2 { margin: 0.6rem 0 0.8rem; font-size: clamp(2.8rem, 7.5vw, 7rem); font-weight: 800; line-height: 0.9; letter-spacing: -0.05em; }
.section-head h2 em { color: var(--gold); padding-right: 0.08em; }
.section-head p { margin: 0; max-width: 52ch; color: var(--muted); font-size: 1.1rem; }
.label-tiny { display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.glass {
  position: relative; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 240, 210, 0.07), 0 40px 100px -30px rgba(0, 0, 0, 0.7);
}
.glass::before { /* specular rim */
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(246, 231, 200, 0.35), transparent 30%, transparent 70%, rgba(200, 146, 58, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}

[data-reveal] { opacity: 0; transform: translateY(46px) scale(0.985); transition: opacity 1.1s var(--out), transform 1.1s var(--out); transition-delay: var(--rd, 0s); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- lab ---------- */
.lab-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 1.4rem; align-items: start; }
.stage { padding: clamp(1.1rem, 2vw, 1.8rem); }
.stage-top { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; justify-content: space-between; }
.name-field { flex: 1 1 280px; }
.name-field input {
  width: 100%; margin-top: 0.3rem; padding: 0.15rem 0 0.35rem; border: 0; border-bottom: 1.5px dashed rgba(246, 231, 200, 0.25); background: none; outline: none;
  font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -0.04em; transition: border-color 0.3s;
}
.name-field input:focus { border-bottom-color: var(--gold); }
.stink { flex: 0 1 260px; }
.stink-bar { position: relative; height: 10px; margin: 0.55rem 0 0.4rem; border-radius: 99px; background: rgba(246, 231, 200, 0.08); overflow: hidden; }
.stink-bar span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--slime), var(--gold), #d0662c); transition: width 0.7s var(--spring); }
.stink-val { font-family: var(--mono); font-size: 0.78rem; color: var(--gold); }
.presets { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.3rem 0 1.1rem; }
.preset {
  display: inline-flex; gap: 0.45rem; align-items: center; padding: 0.5rem 0.95rem; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(246, 231, 200, 0.04); font-size: 0.9rem; font-weight: 600; transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.5s var(--spring);
}
.preset:hover { border-color: rgba(226, 172, 76, 0.6); transform: translateY(-2px); }
.preset:active { transform: scale(0.94); }
.preset.is-active { background: var(--cream); color: var(--espresso); border-color: var(--cream); }

.viz-wrap { position: relative; height: clamp(190px, 24vw, 290px); border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(120% 90% at 50% 100%, rgba(139, 90, 43, 0.28), rgba(18, 10, 5, 0.75) 70%); }
.viz { display: block; width: 100%; height: 100%; }
.viz-meta { position: absolute; top: 12px; left: 12px; display: flex; gap: 0.4rem; }
.viz-meta span { font-family: var(--mono); font-size: 0.72rem; padding: 0.25rem 0.6rem; border-radius: 99px; background: rgba(18, 10, 5, 0.6); border: 1px solid var(--line); color: var(--gold); }

.stage-controls { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.2rem 2.2rem; align-items: center; margin: 1.6rem 0 0.4rem; }

/* RIP IT */
.rip { position: relative; width: 230px; height: 230px; display: grid; place-items: center; touch-action: manipulation; }
.rip-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 22s linear infinite; pointer-events: none; }
.rip-ring text { font-family: var(--mono); font-size: 10.6px; letter-spacing: 0.24em; fill: rgba(246, 231, 200, 0.55); }
.rip.is-playing .rip-ring { animation-duration: 3s; }
.rip.is-playing .rip-ring text { fill: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }
.rip-goo, .rip-btn { position: absolute; inset: 38px; border-radius: 50%; transition: transform 0.7s var(--spring); }
.rip-goo { filter: url(#goo); pointer-events: none; }
.rip-core { position: absolute; inset: 0; z-index: 1; border-radius: 50%; background: radial-gradient(circle at 36% 30%, #f0c46e, var(--mustard) 38%, var(--caramel) 72%, #5e3619); }
.drop { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: #6e4220; transform: rotate(var(--a)) translateX(0); }
.drop:nth-child(2) { --a: 20deg; } .drop:nth-child(3) { --a: 80deg; width: 34px; height: 34px; margin: -17px; }
.drop:nth-child(4) { --a: 145deg; } .drop:nth-child(5) { --a: 205deg; width: 30px; height: 30px; margin: -15px; }
.drop:nth-child(6) { --a: 265deg; } .drop:nth-child(7) { --a: 320deg; width: 38px; height: 38px; margin: -19px; }
.rip.is-playing .drop { animation: drip 1.1s var(--out) infinite; }
.rip.is-playing .drop:nth-child(odd) { animation-delay: -0.45s; animation-duration: 0.9s; }
.rip.is-playing .drop:nth-child(3n) { animation-delay: -0.2s; animation-duration: 1.3s; }
@keyframes drip { 0% { transform: rotate(var(--a)) translateX(0) scale(1); } 55% { transform: rotate(var(--a)) translateX(82px) scale(0.55); } 100% { transform: rotate(var(--a)) translateX(0) scale(1); } }
.rip:hover .rip-goo .drop:nth-child(2) { transform: rotate(var(--a)) translateX(64px) scale(0.6); transition: transform 0.8s var(--spring); }
.rip:hover .rip-goo .drop:nth-child(5) { transform: rotate(var(--a)) translateX(60px) scale(0.6); transition: transform 0.8s var(--spring) 0.05s; }
.rip-btn {
  border: 0; padding: 0; cursor: pointer; color: var(--espresso); background: radial-gradient(circle at 32% 24%, rgba(255, 246, 222, 0.7), rgba(255, 246, 222, 0) 30%);
  box-shadow: inset 0 -14px 30px rgba(60, 28, 8, 0.55), inset 0 6px 14px rgba(255, 230, 180, 0.35), 0 24px 60px -14px rgba(200, 146, 58, 0.65), 0 0 0 1px rgba(255, 230, 180, 0.15);
}
.rip-txt { display: block; font-weight: 800; font-size: 2.35rem; line-height: 0.9; letter-spacing: -0.05em; text-shadow: 0 1px 0 rgba(255, 240, 210, 0.45); }
.rip.is-pressed .rip-goo, .rip.is-pressed .rip-btn { transform: scale(1.12, 0.8); transition-duration: 0.12s; transition-timing-function: ease-out; }
.rip.squish .rip-goo, .rip.squish .rip-btn { animation: jelly 0.7s both; }
@keyframes jelly {
  0% { transform: scale(1.14, 0.8); } 30% { transform: scale(0.86, 1.16); } 50% { transform: scale(1.08, 0.94); }
  70% { transform: scale(0.97, 1.03); } 100% { transform: scale(1); }
}
.rip.is-playing .rip-core { animation: throb 0.32s ease-in-out infinite alternate; }
@keyframes throb { to { transform: scale(1.05, 0.96); } }

.actions { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.switch { display: inline-flex; align-items: center; gap: 0.75rem; width: max-content; font-weight: 600; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 52px; height: 30px; border-radius: 99px; background: rgba(246, 231, 200, 0.1); border: 1px solid var(--line); transition: background 0.35s; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--cream); transition: transform 0.6s var(--spring), width 0.3s; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4); }
.switch:active .switch-knob { width: 28px; }
.switch input:checked + .switch-track { background: linear-gradient(90deg, var(--caramel), var(--mustard)); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(22px); }
.switch:active input:checked + .switch-track .switch-knob { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--gold); outline-offset: 3px; }
.action-row { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; margin-top: 0.3rem; }
.chip-btn {
  padding: 0.72rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(246, 231, 200, 0.05); font-weight: 600; font-size: 0.92rem;
  transition: background 0.3s, border-color 0.3s;
}
.chip-btn:hover { background: rgba(246, 231, 200, 0.1); border-color: rgba(226, 172, 76, 0.6); }
.chip-btn:disabled { opacity: 0.6; cursor: progress; }

.curve-card { margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.curve-head { display: flex; flex-wrap: wrap; gap: 0.8rem 1.5rem; align-items: flex-end; justify-content: space-between; margin-bottom: 0.9rem; }
.curve-head h3 { margin: 0.2rem 0 0; font-size: 1.35rem; letter-spacing: -0.03em; }
.curve-head h3 .muted { font-weight: 400; font-size: 0.85em; }
.curve-tools { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.curve-tools button { padding: 0.4rem 0.75rem; border-radius: 10px; border: 1px solid var(--line); background: rgba(246, 231, 200, 0.04); font-family: var(--mono); font-size: 0.74rem; transition: background 0.25s, color 0.25s; }
.curve-tools button:hover { background: var(--mustard); color: var(--espresso); }
.curve { display: block; width: 100%; height: 170px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(43, 26, 15, 0.6), rgba(18, 10, 5, 0.8)); cursor: crosshair; touch-action: none; }
.curve-axis { display: flex; justify-content: space-between; margin-top: 0.4rem; font-family: var(--mono); font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* controls panel */
.panel { position: sticky; top: 92px; padding: clamp(1.1rem, 2vw, 1.7rem); }
.panel-head h3 { margin: 0.2rem 0 0.6rem; font-size: 1.6rem; letter-spacing: -0.04em; }
.group { margin: 0; padding: 1rem 0 0.4rem; border: 0; border-top: 1px solid var(--line); }
.group legend { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.5rem 0 0; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.group .gi { color: var(--gold); }
.ctrl { margin: 0.35rem 0 0.9rem; }
.ctrl-top { display: flex; justify-content: space-between; align-items: baseline; }
.ctrl label { font-weight: 600; font-size: 0.98rem; }
.ctrl output { font-family: var(--mono); font-size: 0.78rem; color: var(--gold); padding: 0.1rem 0.5rem; border-radius: 6px; background: rgba(200, 146, 58, 0.1); min-width: 4.5em; text-align: right; }
.hint { display: block; font-size: 0.76rem; color: rgba(246, 231, 200, 0.4); margin-top: -0.15rem; }
input[type='range'] { --pct: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 0.15rem 0 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type='range']::-webkit-slider-runnable-track {
  height: 8px; border-radius: 99px;
  background: linear-gradient(90deg, var(--caramel), var(--gold) var(--pct), rgba(246, 231, 200, 0.1) var(--pct));
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 35% 30%, #fff5dc, var(--gold) 55%, var(--caramel));
  box-shadow: 0 0 0 5px rgba(200, 146, 58, 0.16), 0 6px 14px rgba(0, 0, 0, 0.55); transition: transform 0.5s var(--spring), box-shadow 0.3s;
}
input[type='range']:hover::-webkit-slider-thumb { box-shadow: 0 0 0 8px rgba(200, 146, 58, 0.2), 0 6px 14px rgba(0, 0, 0, 0.55); }
input[type='range']:active::-webkit-slider-thumb { transform: scale(1.3, 0.8); }
input[type='range']::-moz-range-track { height: 8px; border-radius: 99px; background: rgba(246, 231, 200, 0.1); }
input[type='range']::-moz-range-progress { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--caramel), var(--gold)); }
input[type='range']::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff5dc, var(--gold) 55%, var(--caramel)); box-shadow: 0 0 0 5px rgba(200, 146, 58, 0.16), 0 6px 14px rgba(0, 0, 0, 0.55); transition: transform 0.5s var(--spring); }
input[type='range']:active::-moz-range-thumb { transform: scale(1.3, 0.8); }

/* ---------- hall of fame ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.card {
  position: relative; padding: 1.3rem; border-radius: 24px; cursor: pointer; overflow: hidden; outline: none;
  background: linear-gradient(165deg, rgba(139, 90, 43, 0.22), rgba(43, 26, 15, 0.5) 60%), rgba(18, 10, 5, 0.6);
  border: 1px solid var(--line); transition: transform 0.7s var(--spring), border-color 0.4s, box-shadow 0.5s, opacity 1.1s var(--out);
}
.card::after { content: ''; position: absolute; width: 260px; height: 260px; right: -110px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(226, 172, 76, 0.28), transparent 65%); transition: transform 0.8s var(--out); pointer-events: none; }
.card:hover, .card:focus-visible { transform: translateY(-6px) rotate(-0.6deg); border-color: rgba(226, 172, 76, 0.5); box-shadow: 0 30px 70px -25px rgba(200, 146, 58, 0.45); }
.card:hover::after { transform: scale(1.5) translate(-30px, 30px); }
.card.squish { animation: cardSquish 0.6s var(--out); }
@keyframes cardSquish { 30% { transform: scale(0.96, 0.93); } 60% { transform: scale(1.02, 1.03); } }
.card.is-playing { border-color: var(--slime); box-shadow: 0 0 0 1px var(--slime), 0 30px 80px -20px rgba(168, 176, 74, 0.5); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.rank { font-weight: 800; font-size: 3.2rem; line-height: 0.85; letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 1.2px rgba(246, 231, 200, 0.45); }
.card-emoji { font-size: 2rem; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4)); transition: transform 0.6s var(--spring); }
.card:hover .card-emoji { transform: rotate(-12deg) scale(1.2); }
.mini { display: block; width: 100%; height: 56px; margin: 1.1rem 0 0.9rem; }
.card h4 { margin: 0; font-size: 1.35rem; letter-spacing: -0.03em; line-height: 1.1; }
.card p { margin: 0.25rem 0 0.8rem; font-size: 0.9rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.card-meta span { font-family: var(--mono); font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 6px; background: rgba(246, 231, 200, 0.06); color: var(--muted); }
.card-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 1rem; }
.card-play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--cream); color: var(--espresso); font-size: 0.9rem; padding-left: 3px; transition: transform 0.5s var(--spring), background 0.3s; }
.card:hover .card-play { background: var(--gold); transform: scale(1.08); }
.card-load, .card-del { padding: 0.55rem 0.95rem; border-radius: 99px; border: 1px solid var(--line); background: none; font-size: 0.85rem; font-weight: 600; }
.card-load:hover { border-color: var(--gold); color: var(--gold); }
.card-del { margin-left: auto; padding: 0.55rem 0.8rem; }
.card-del:hover { border-color: #d0662c; color: #e88a55; }
.cards--stash .card { background: linear-gradient(165deg, rgba(168, 176, 74, 0.13), rgba(43, 26, 15, 0.5) 60%), rgba(18, 10, 5, 0.6); }
.stash-head { margin: 4rem 0 1.2rem; }
.stash-head h3 { display: flex; align-items: center; gap: 0.7rem; margin: 0 0 0.3rem; font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -0.04em; }
.stash-head p { margin: 0; }
.count { display: inline-grid; place-items: center; min-width: 2em; height: 2em; padding: 0 0.5em; border-radius: 99px; background: var(--slime); color: var(--espresso); font-family: var(--mono); font-size: 0.8rem; }
.empty { grid-column: 1 / -1; padding: 2rem; text-align: center; color: var(--muted); border-style: dashed; }

/* ---------- how ---------- */
.how-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; }
.how-grid li { padding: 1.6rem; min-height: 260px; display: flex; flex-direction: column; }
.how-n { font-family: var(--serif); font-style: italic; font-size: 4rem; line-height: 1; color: var(--gold); }
.how-grid h3 { margin: auto 0 0.4rem; font-size: 1.5rem; letter-spacing: -0.03em; }
.how-grid p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- footer ---------- */
.footer { margin-top: clamp(5rem, 12vw, 10rem); padding: 0 var(--pad) 2rem; overflow: hidden; }
.footer-big {
  font-weight: 800; font-size: clamp(4rem, 19vw, 22rem); line-height: 0.8; letter-spacing: -0.065em; text-align: center; white-space: nowrap;
  background: linear-gradient(180deg, var(--gold), var(--caramel) 55%, rgba(74, 44, 23, 0.2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer-big em { font-family: var(--serif); font-weight: 400; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem; padding-top: 1.6rem; margin-top: 1.2rem; border-top: 1px solid var(--line); font-size: 0.85rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 140; left: 50%; bottom: max(1.2rem, env(safe-area-inset-bottom)); transform: translate(-50%, 140%); max-width: calc(100% - 2rem);
  padding: 0.85rem 1.3rem; border-radius: 999px; background: rgba(43, 26, 15, 0.85); border: 1px solid rgba(226, 172, 76, 0.4);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-weight: 600; box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6);
  transition: transform 0.6s var(--spring); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-grid { grid-template-columns: 1fr; }
  .panel { position: relative; top: 0; }
  #controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
  #controls .panel-head { grid-column: 1 / -1; }
  .how-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
  .eyebrow .ver { display: none; }
  .nav-links { display: none; }
  .nav { padding: 8px 8px 8px 14px; }
  .hero { padding-top: 6rem; justify-content: center; }
  .hero-title .line:nth-child(2) { padding-left: 0.5em; }
  .hero-stats { position: relative; right: auto; top: auto; transform: none; display: flex; justify-content: space-between; text-align: left; margin-top: 2.4rem; }
  .hero-stats b { font-size: 2.2rem; }
  .scroll-hint { display: none; }
  .stage-controls { grid-template-columns: 1fr; justify-items: center; }
  .actions { align-items: center; width: 100%; }
  .action-row { justify-content: center; }
  #controls { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .how-grid li { min-height: 0; }
  .how-grid h3 { margin-top: 1rem; }
  .curve { height: 150px; }
  .footer-row { flex-direction: column; }
  .hint { display: none; }
}
@media (max-width: 420px) {
  .rip { width: 210px; height: 210px; }
  .rip-goo, .rip-btn { inset: 34px; }
  .chip-btn { padding: 0.65rem 0.9rem; font-size: 0.86rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .char, .reveal-up, [data-reveal] { opacity: 1 !important; transform: none !important; }
  .grain { animation: none; }
  .marquee-track { animation: none; }
}

/* used by the screenshot harness to stitch full-page captures */
.shot-mode .progress, .shot-mode .toast { visibility: hidden; }
.shot-mode .hero-inner { transform: none !important; opacity: 1 !important; }
.shot-mode .hero { min-height: var(--shot-h, 100svh); }
.shot-mode .gas { height: var(--shot-h, 100vh); }
