/* ==========================================================================
   Per-demo styles
   ========================================================================== */
:root { --sun: #f5c94a; }
.dot-sound { background: var(--sun); }
#sound-btn.on { background: var(--accent); color: #140b05; border-color: var(--accent); }
#sound-btn .wave { opacity: .35; }
#sound-btn.on .wave { opacity: 1; }

/* ---------- Kinetic type ---------- */
.kinetic {
  height: 100%; display: flex; align-items: center; justify-content: center; gap: .01em;
  font-size: clamp(56px, 11vw, 150px); line-height: 1; user-select: none; cursor: crosshair;
}
.kinetic span { font-variation-settings: "wght" var(--w, 200); color: color-mix(in oklab, var(--accent) var(--a, 0%), var(--ink)); transition: font-variation-settings .08s linear; display: inline-block; transform: translateY(var(--y, 0)); }

/* ---------- Scramble ---------- */
.scramble { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 28px; }
.scramble .mono { color: var(--mint); }
.scramble p { margin: 0; font-family: var(--mono); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; min-height: 2.5em; }
.scramble p .g { color: var(--accent); opacity: .7; }
.scramble .btn { align-self: flex-start; position: static; color: var(--ink); background: transparent; border-color: var(--line-2); }

/* ---------- Tilt card ---------- */
.tilt-wrap { height: 100%; display: grid; place-items: center; perspective: 900px; }
.tilt-card {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative; width: 230px; height: 150px; border-radius: 16px; padding: 18px;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  color: #fff; background: linear-gradient(135deg, #2b1a10, #ff6a1a 55%, #a78bfa);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .15s ease-out;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); transform-style: preserve-3d;
}
.tilt-card strong { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1; transform: translateZ(40px); }
.tilt-card .mono { font-size: 10px; opacity: .85; }
.tilt-card .glare { position: absolute; inset: 0; background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .5), transparent 45%); mix-blend-mode: overlay; pointer-events: none; }

/* ---------- Aurora ---------- */
.aurora { position: absolute; inset: 0; overflow: hidden; background: #0a0814; display: grid; place-items: center; }
.aurora i { position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%; filter: blur(50px); mix-blend-mode: screen; opacity: .85; }
.aurora i:nth-child(1) { background: #ff6a1a; left: -10%; top: -10%; animation: drift1 11s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: #7c5cff; right: -15%; top: 10%; animation: drift2 13s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: #19c2a0; left: 20%; bottom: -25%; animation: drift3 9s ease-in-out infinite alternate; }
.aurora i:nth-child(4) { background: #ff3d7f; right: 10%; bottom: -10%; width: 40%; animation: drift1 15s ease-in-out infinite alternate-reverse; }
.aurora span { position: relative; font-family: var(--serif); font-size: 52px; color: #fff; mix-blend-mode: overlay; }
@keyframes drift1 { to { transform: translate(40%, 30%) scale(1.2); } }
@keyframes drift2 { to { transform: translate(-50%, 40%) scale(.8); } }
@keyframes drift3 { to { transform: translate(30%, -60%) scale(1.3); } }

/* ---------- Gen art ---------- */
.gen-art { width: 100%; height: 100%; }
.seed { pointer-events: none !important; }

/* ---------- Goo ---------- */
.goo { position: absolute; inset: 0; filter: url(#goo); }
.goo b { position: absolute; left: 0; top: 0; border-radius: 50%; background: var(--accent); will-change: transform; }
.goo-defs { position: absolute; }

/* ---------- Chart ---------- */
.chart { position: absolute; inset: 0; padding: 22px 22px 16px; display: flex; flex-direction: column; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; }
.chart-head strong { display: block; font-size: 34px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.chart-head .mono { color: var(--mute); }
.chart svg { flex: 1; width: 100%; margin-top: 12px; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); opacity: 0; transform: translate(-50%, -130%); transition: opacity .15s; white-space: nowrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); position: relative; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 12.5px; color: var(--mute); position: relative; z-index: 1; }
.seg button.on { color: var(--bg); background: var(--ink); }

/* ---------- Spotlight ---------- */
.spot-grid { position: absolute; inset: 18px 18px 80px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spot {
  --x: -999px; --y: -999px; position: relative; border-radius: 14px; padding: 14px; font-size: 13px; color: var(--mute);
  background: var(--card); display: flex; flex-direction: column; gap: 2px; isolation: isolate;
}
.spot b { color: var(--ink); font-size: 16px; }
.spot .mono { color: var(--accent); font-size: 10px; }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1;
  background: radial-gradient(240px circle at var(--x) var(--y), var(--accent), var(--line) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.spot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; background: radial-gradient(200px circle at var(--x) var(--y), rgba(255, 106, 26, .12), transparent 70%); }
.magnets { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 16px; }
.magnet { border: 0; border-radius: 999px; padding: 12px 22px; background: var(--ink); color: var(--bg); font-weight: 600; cursor: pointer; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.magnet.alt { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }

/* ---------- Scroll-driven ---------- */
.scroller { position: absolute; inset: 0; overflow-y: auto; padding: 40% 24px; text-align: center; scrollbar-width: thin; }
.scroller .mono { color: var(--mute); margin: 0 0 30%; }
.scroller .mono:last-child { margin: 30% 0 0; }
.reveal { font-family: var(--serif); font-size: 56px; line-height: 1.15; }
@supports (animation-timeline: view()) {
  .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
}
@keyframes reveal {
  0% { opacity: 0; transform: scale(.6) translateY(30px); filter: blur(6px); color: var(--mute); }
  45%, 55% { opacity: 1; transform: none; filter: none; color: var(--accent); }
  100% { opacity: 0; transform: scale(.6) translateY(-30px); filter: blur(6px); color: var(--mute); }
}

/* ---------- UI kit ---------- */
.uikit { position: absolute; inset: 0; padding: 24px; display: flex; flex-direction: column; gap: 18px; font-size: 14px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 44px; height: 26px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg-wide { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg-wide button.on { background: none; color: var(--bg); }
.seg-pill { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 999px; background: var(--ink); transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); }
.range { display: flex; flex-direction: column; gap: 6px; }
.range span { display: flex; justify-content: space-between; color: var(--mute); }
.range output { color: var(--ink); font-variant-numeric: tabular-nums; }
.range input { accent-color: var(--accent); width: 100%; }
details { border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; }
details summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details summary::after { content: "+"; transition: transform .25s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 8px 0 0; color: var(--mute); }
.stars { display: flex; gap: 4px; }
.stars button { border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--line-2); padding: 0; transition: transform .2s, color .2s; }
.stars button.on { color: var(--sun); }
.stars button:hover { transform: scale(1.2) rotate(-8deg); }

/* ---------- CSS cube ---------- */
.cube-scene { position: absolute; inset: 0; display: grid; place-items: center; perspective: 800px; cursor: grab; touch-action: none; }
.cube-scene:active { cursor: grabbing; }
.cube { --s: 140px; width: var(--s); height: var(--s); position: relative; transform-style: preserve-3d; }
.cube div {
  position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-weight: 600; letter-spacing: .1em;
  border: 1px solid rgba(255, 255, 255, .25); color: #fff; backface-visibility: visible;
}
.cube div:nth-child(1) { transform: translateZ(calc(var(--s) / 2)); background: rgba(255, 106, 26, .75); }
.cube div:nth-child(2) { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); background: rgba(167, 139, 250, .75); }
.cube div:nth-child(3) { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); background: rgba(126, 224, 195, .7); }
.cube div:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); background: rgba(245, 201, 74, .75); }
.cube div:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); background: rgba(255, 61, 127, .7); }
.cube div:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); background: rgba(60, 130, 255, .7); }

/* ---------- FLIP grid ---------- */
.flip-grid { position: absolute; inset: 18px 18px 60px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.flip-grid div { border-radius: 10px; display: grid; place-items: center; font-family: var(--mono); font-weight: 600; color: #160c06; }

/* ---------- Terminal ---------- */
.term { position: absolute; inset: 16px; border-radius: 12px; background: #0b0a09; border: 1px solid rgba(243, 237, 228, .12); display: flex; flex-direction: column; overflow: hidden; color: #e9e2d8; }
.term-bar { display: flex; gap: 6px; align-items: center; padding: 10px 12px; border-bottom: 1px solid rgba(243, 237, 228, .08); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3532; }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 8px; color: #8d847b; font-size: 10px; }
.term-body { margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow: hidden; flex: 1; }
.term-body .p { color: var(--accent); } .term-body .ok { color: var(--mint); } .term-body .dim { color: #8d847b; } .term-body .v { color: var(--violet); }
.caret { display: inline-block; width: 7px; height: 14px; background: var(--accent); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Canvas stages ---------- */
#c-life canvas, #c-breakout canvas, #c-flow canvas, #h-ascii canvas, #s-ambient canvas, #s-mic canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#c-breakout canvas { outline: none; }

/* ---------- Path text ---------- */
.path-text { width: 100%; height: 100%; }
.path-text text { font-family: var(--serif); font-size: 22px; fill: var(--ink); }

/* ---------- Marquee ---------- */
#c-marquee .stage { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.marquee { overflow: hidden; display: flex; -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee div { display: flex; align-items: center; gap: 28px; padding-right: 28px; flex-shrink: 0; animation: marquee 22s linear infinite; font-family: var(--serif); font-size: 64px; line-height: 1.1; white-space: nowrap; }
.marquee.rev div { animation-direction: reverse; animation-duration: 28s; }
.marquee.rev span { color: transparent; -webkit-text-stroke: 1px var(--ink); font-style: italic; }
.marquee i { color: var(--accent); font-style: normal; font-size: 32px; }
.marquee:hover div { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- three.js stages ---------- */
.text-in { pointer-events: auto; width: 150px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(243, 237, 228, .25); background: rgba(14, 12, 11, .6); color: #f3ede4; font-family: var(--mono); font-size: 13px; }

/* ---------- Robot configurator ---------- */
.robot-stage { background: radial-gradient(ellipse at 50% 40%, #2a2420, #121010 70%); }
.source-pip { position: absolute; left: 14px; top: 14px; z-index: 3; margin: 0; width: 120px; background: rgba(14, 12, 11, .6); border: 1px solid rgba(243, 237, 228, .15); border-radius: 12px; padding: 6px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.source-pip img { border-radius: 8px; aspect-ratio: 1; object-fit: cover; }
.source-pip figcaption { font-size: 9.5px; color: #cfc6bb; padding: 6px 2px 0; }
.config { position: absolute; right: 14px; top: 14px; z-index: 3; padding: 14px 16px; border-radius: 14px; background: rgba(14, 12, 11, .6); border: 1px solid rgba(243, 237, 228, .15); color: #f3ede4; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 6px; }
.config .mono { font-size: 10px; color: #cfc6bb; }
.config strong { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1; }
.swatches { display: flex; gap: 8px; margin-top: 4px; }
.swatches button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.swatches button.on { border-color: var(--accent); }
@media (max-width: 720px) { .source-pip { width: 84px; } }

.robot-cap { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 3; pointer-events: none; font-family: var(--serif); font-size: clamp(28px, 4vw, 48px); color: #fff; text-shadow: 0 2px 24px rgba(0, 0, 0, .6); white-space: nowrap; }
.robot-cap:empty { display: none; }

/* ---------- Gallery caption ---------- */
.gallery-cap { position: absolute; left: 18px; top: 16px; z-index: 3; color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); pointer-events: none; }
.gallery-cap strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 42px; line-height: 1.1; }

/* ---------- Before / after ---------- */
.ba { --p: 50%; user-select: none; touch-action: none; cursor: ew-resize; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--p); width: 2px; background: #fff; transform: translateX(-1px); outline: none; }
.ba-handle i { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.ba-handle i::before { content: "\2039\00a0\203A"; position: absolute; inset: 0; display: grid; place-items: center; color: #1d1916; font-size: 20px; font-weight: 700; }
.ba-handle:focus-visible i { outline: 3px solid var(--accent); }
.ba-lab { position: absolute; top: 14px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10.5px; }
.ba-lab.l { left: 14px; } .ba-lab.r { right: 14px; }

/* ---------- Holo card ---------- */
.hcard-wrap { position: absolute; inset: 0; display: grid; place-items: center; perspective: 1000px; background: radial-gradient(circle at 50% 30%, #2a2133, #110e14 70%); }
.hcard {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --o: 0;
  position: relative; width: 240px; aspect-ratio: 5 / 7; border-radius: 16px; overflow: hidden; padding: 10px;
  background: linear-gradient(160deg, #f6e8d6, #e8c9a6); transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .2s ease-out; box-shadow: 0 40px 70px -25px rgba(0, 0, 0, .7);
}
.hcard img { border-radius: 10px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.hcard-info { padding: 10px 4px; color: #2a1d12; }
.hcard-info .mono { font-size: 9.5px; opacity: .7; }
.hcard-info strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; }
.hcard .foil { position: absolute; inset: 0; background: url(../assets/hf/holo.jpg) center / 200%; background-position: var(--mx) var(--my); mix-blend-mode: color-dodge; opacity: calc(.25 + var(--o) * .55); pointer-events: none; }
.hcard .shine { position: absolute; inset: 0; background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .7), transparent 40%); mix-blend-mode: soft-light; pointer-events: none; }

/* ---------- Editorial ---------- */
.editorial { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); background: #efe7da !important; color: #1d1916; }
.ed-media { position: relative; min-height: 560px; }
.ed-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ed-media .mono { position: absolute; left: 14px; bottom: 14px; color: #fff; font-size: 10px; background: rgba(0, 0, 0, .4); padding: 4px 8px; border-radius: 99px; }
.ed-copy { padding: clamp(24px, 4vw, 56px); display: flex; flex-direction: column; gap: 16px; }
.ed-copy > .mono { color: #b8461a; }
.ed-copy h4 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 6vw, 92px); line-height: .92; letter-spacing: -0.02em; }
.ed-copy h4 em { color: #b8461a; }
.ed-copy p { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.5; max-width: 52ch; columns: 1; }
.dropcap::first-letter { float: left; font-size: 4.2em; line-height: .8; padding: 6px 10px 0 0; color: #b8461a; }
.ed-copy blockquote { margin: 6px 0; padding: 16px 0; border-block: 1px solid rgba(29, 25, 22, .2); font-family: var(--serif); font-style: italic; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; }
.ed-foot { margin-top: auto; display: flex; justify-content: space-between; color: #6f655c; font-size: 10.5px; }
@media (max-width: 860px) { .editorial { grid-template-columns: 1fr; } .ed-media { min-height: 420px; } }

/* ---------- Restaurant mockup ---------- */
.browser { position: absolute; inset: 18px; border-radius: 12px; overflow: hidden; background: #171310; display: flex; flex-direction: column; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); border: 1px solid rgba(243, 237, 228, .12); }
.browser-bar { display: flex; gap: 6px; align-items: center; padding: 9px 12px; background: #221d19; }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #4a423c; }
.browser-bar span { margin: 0 auto; padding: 3px 14px; border-radius: 6px; background: #171310; color: #8d847b; font-size: 10px; }
.site-r { flex: 1; overflow: auto; color: #f1e6d6; font-family: var(--sans); background: #1a1410; scrollbar-width: none; }
.site-r-nav { display: flex; gap: 18px; align-items: center; padding: 16px 22px; font-size: 13px; color: #c9bba8; }
.site-r-nav b { font-family: var(--serif); font-weight: 400; font-size: 22px; color: #f1e6d6; margin-right: auto; }
.pill { border: 1px solid #d3a873; color: #f1e6d6; padding: 7px 14px; border-radius: 999px; background: none; font-size: 12.5px; cursor: pointer; }
.pill.solid { background: #d3a873; color: #1a1410; border: 0; font-weight: 600; padding: 11px 20px; }
.site-r-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 10px 22px 22px; align-items: center; }
.site-r-hero .mono { color: #d3a873; font-size: 10px; }
.site-r-hero h4 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 3.6vw, 52px); line-height: .95; margin: 8px 0 12px; }
.site-r-hero h4 em { color: #d3a873; }
.site-r-hero p { color: #c9bba8; font-size: 13.5px; margin: 0 0 18px; }
.site-r-hero img { border-radius: 10px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; max-height: 330px; }
.site-r-menu { list-style: none; margin: 0; padding: 0 22px 22px; font-size: 14px; }
.site-r-menu li { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(241, 230, 214, .1); }
.site-r-menu i { flex: 1; border-bottom: 1px dotted rgba(241, 230, 214, .3); }
.site-r-menu b { font-family: var(--mono); font-weight: 400; color: #d3a873; }
@media (max-width: 560px) { .site-r-hero { grid-template-columns: 1fr; } }

/* ---------- Poster wall ---------- */
.poster-wall { position: absolute; inset: 0; display: grid; place-items: center; perspective: 1400px; background:
  radial-gradient(ellipse at 50% 0%, rgba(255, 220, 170, .35), transparent 55%), linear-gradient(#3b342e, #2a2420); }
.poster-3d { --rx: 0deg; --ry: 0deg; height: 82%; width: auto; aspect-ratio: 2 / 3; object-fit: cover; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .3s ease-out; box-shadow: 0 2px 0 rgba(255, 255, 255, .2) inset, 18px 30px 40px -12px rgba(0, 0, 0, .55), 0 0 0 10px #f2eee8, 0 0 0 11px rgba(0, 0, 0, .3); }

/* ---------- Treatments ---------- */
.treat-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: filter .4s; }
.treat-img.f-duotone { filter: url(#duotone); }
.treat-img.f-poster { filter: url(#poster) saturate(1.4); }
.treat-img.f-mono { filter: grayscale(1) contrast(1.6) brightness(.9); }
.treat-img.f-halftone { filter: grayscale(1) contrast(2.2); -webkit-mask: radial-gradient(circle, #000 1.6px, transparent 2.2px) 0 0 / 6px 6px; mask: radial-gradient(circle, #000 1.6px, transparent 2.2px) 0 0 / 6px 6px; }
#h-treat .stage { background: #efe7da; }

/* ---------- Synth ---------- */
.synth { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 16px; gap: 12px; }
.scope { flex: 1; min-height: 0; width: 100%; border-radius: 10px; background: #0b0a09; }
.synth-knobs { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--mute); }
.synth-knobs label { display: flex; align-items: center; gap: 8px; }
.synth-knobs input { width: 100px; accent-color: var(--accent); }
.synth-knobs select { background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 3px 6px; }
.keys { position: relative; height: 120px; display: flex; user-select: none; touch-action: none; }
.keys .white { flex: 1; border: 1px solid #2a2622; border-radius: 0 0 8px 8px; background: linear-gradient(#f3ede4, #ddd4c8); position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-family: var(--mono); font-size: 10px; color: #6f655c; cursor: pointer; }
.keys .black { position: absolute; top: 0; width: 6%; height: 62%; z-index: 2; border-radius: 0 0 6px 6px; background: linear-gradient(#2a2622, #0e0c0b); cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; font-family: var(--mono); font-size: 9px; color: #8d847b; }
.keys .down { background: var(--accent) !important; color: #140b05; }

/* ---------- Drum sequencer ---------- */
.seq { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.seq .btn { position: static; color: var(--ink); background: transparent; border-color: var(--line-2); }
.seq .btn.on { color: #140b05; background: var(--accent); }
.seq-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seq-top label { display: flex; align-items: center; gap: 8px; color: var(--mute); }
.seq-top input { accent-color: var(--accent); }
.seq-grid { display: grid; grid-template-columns: 70px repeat(16, minmax(24px, 1fr)); gap: 5px; align-items: center; overflow-x: auto; padding-bottom: 4px; }
.seq-grid .lab { font-family: var(--mono); font-size: 11px; color: var(--mute); text-transform: uppercase; }
.seq-grid button { height: clamp(24px, 2.6vw, 36px); min-width: 24px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--card-2); cursor: pointer; padding: 0; transition: background .1s, transform .1s; }
.seq-grid button:nth-of-type(4n+1) { border-color: color-mix(in oklab, var(--ink) 30%, transparent); }
.seq-grid button.on { background: var(--c, var(--accent)); border-color: transparent; }
.seq-grid button.now { transform: scale(.88); box-shadow: 0 0 0 2px var(--ink); }
@media (max-width: 720px) { .seq-grid { grid-template-columns: 44px repeat(16, minmax(24px, 1fr)); gap: 3px; } .seq-grid button { border-radius: 4px; } }

/* ---------- Narrator ---------- */
.narr { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 28px; gap: 22px; }
.narr-cap { margin: 0; font-family: var(--serif); font-size: clamp(26px, 3vw, 38px); line-height: 1.15; min-height: 2.4em; }
.narr-cap span { color: var(--mute); transition: color .15s; }
.narr-cap span.said { color: var(--ink); }
.narr-cap span.now { color: var(--accent); }
.narr-wave { width: 100%; height: 90px; cursor: pointer; }
.narr-row { display: flex; justify-content: space-between; align-items: center; }
.narr .btn, .pip .btn, .sfx button { position: static; color: var(--ink); background: transparent; border-color: var(--line-2); }
.narr-time { color: var(--mute); }

/* ---------- Pip ---------- */
.pip { position: absolute; inset: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 28px; padding: 28px; }
.pip-avatar { --lvl: 0; position: relative; width: clamp(140px, 18vw, 210px); aspect-ratio: 1; }
.pip-avatar img { border-radius: 50%; width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1 + var(--lvl) * .08)) rotate(calc(var(--lvl) * -4deg)); transition: transform .05s; position: relative; z-index: 1; }
.pip-ring { position: absolute; inset: -10px; border-radius: 50%; background: conic-gradient(var(--accent), var(--violet), var(--mint), var(--accent)); filter: blur(calc(6px + var(--lvl) * 18px)); opacity: calc(.2 + var(--lvl) * 1.2); animation: spin 4s linear infinite; }
.pip-chat { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.bubble { position: relative; padding: 14px 18px; border-radius: 18px 18px 18px 4px; background: var(--card-2); border: 1px solid var(--line); font-size: 17px; line-height: 1.35; min-height: 52px; }
@media (max-width: 560px) { .pip { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

/* ---------- Video with sound ---------- */
.snd-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }

/* ---------- SFX grid ---------- */
.sfx { position: absolute; inset: 0; padding: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sfx button { border-radius: 14px; border: 1px solid var(--line-2); font-size: 13.5px; cursor: pointer; transition: transform .15s, background .2s; }
.sfx button:hover { background: var(--card-2); }
.sfx button.hit { transform: scale(.94); background: var(--accent); color: #140b05; }
