/* ==========================================================================
   Emberpine — The Lab (experiment pages)
   ========================================================================== */
.lab-page { padding-top: 120px; }
.lab-head { padding-bottom: clamp(26px, 4vw, 44px); }
.lab-head__crumbs { font: 700 .74rem ui-monospace, Menlo, monospace; letter-spacing: .08em; color: var(--muted); margin: 0 0 18px; }
.lab-head__crumbs a { color: var(--ember-2); text-decoration: none; }
.lab-head h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); margin: 0 0 .2em; }
.lab-head__desc { max-width: 620px; font-size: 1.12rem; color: var(--cream-2); margin: 0; }

.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(243,236,226,.06); font-weight: 700; font-size: .88rem; transition: background .3s, border-color .3s, transform .3s var(--ease); }
.chip:hover { background: rgba(243,236,226,.12); }
.chip[aria-pressed="true"] { border-color: var(--ember); background: rgba(226,118,58,.16); color: #fff; }
.chip--ember { background: var(--ember); border-color: var(--ember); color: var(--ink); }
.chip--ember:hover { background: var(--ember-2); }
.chip--ember[aria-pressed="true"] { background: var(--ember-2); color: var(--ink); }

.lab-next { position: relative; display: grid; align-content: end; min-height: 300px; margin-top: clamp(60px, 8vw, 110px); padding: 40px var(--pad, clamp(20px, 4vw, 56px)); text-decoration: none; overflow: hidden; isolation: isolate; }
.lab-next img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: brightness(.45); transition: transform 1.4s var(--ease), filter .8s; }
.lab-next::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--ink), transparent 40%); }
.lab-next:hover img { transform: scale(1.05); filter: brightness(.6); }
.lab-next__label { font: 700 .74rem ui-monospace, Menlo, monospace; color: var(--ember-2); letter-spacing: .08em; }
.lab-next__title { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 4.6rem); font-weight: 300; line-height: 1; }

/* hub */
.lab-hub { padding: 150px 0 40px; }
.lab-hub__intro { margin-bottom: 50px; }
.lab-hub__intro h1 { font-size: clamp(3rem, 8vw, 6.4rem); margin: 0 0 .3em; }
.lab-hub__lede { max-width: 620px; color: var(--cream-2); font-size: 1.15rem; }

/* ---------- EXP-02 day dial ---------- */
.dial__stage { position: relative; aspect-ratio: 1408/768; border-radius: var(--r); overflow: hidden; background: #000; isolation: isolate; }
.dial__stage > img, .dial__tint, .dial__stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.dial__photo { object-fit: cover; transition: filter .15s linear; }
.dial__tint { mix-blend-mode: multiply; pointer-events: none; }
.dial__stars { mix-blend-mode: screen; -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 55%); mask-image: linear-gradient(180deg, #000 30%, transparent 55%); }
.dial__glow { object-fit: cover; mix-blend-mode: screen; filter: brightness(1.8) saturate(1.2) drop-shadow(0 0 12px rgba(255,170,80,.9)); pointer-events: none; }
.dial__fx { pointer-events: none; }
.dial__orb { position: absolute; width: clamp(28px, 4vw, 56px); aspect-ratio: 1; margin: calc(clamp(28px, 4vw, 56px) / -2) 0 0 calc(clamp(28px, 4vw, 56px) / -2); border-radius: 50%; pointer-events: none; mix-blend-mode: screen; }
.dial__orb--sun { background: radial-gradient(circle, #fff7dc 0 30%, rgba(255,200,120,.65) 45%, rgba(255,170,90,0) 72%); box-shadow: 0 0 120px 40px rgba(255,190,110,.35); }
.dial__orb--moon { background: radial-gradient(circle at 40% 40%, #fffdf3 0 38%, rgba(220,230,255,.4) 50%, rgba(200,215,255,0) 70%); box-shadow: 0 0 80px 20px rgba(190,205,255,.25); }
.dial__readout { position: absolute; left: clamp(16px, 3vw, 36px); bottom: clamp(16px, 3vw, 36px); display: grid; gap: 2px; padding: 16px 22px; border-radius: 18px; background: rgba(12,10,8,.45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.12); max-width: min(420px, calc(100% - 32px)); }
.dial__time { font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1; font-variant-numeric: tabular-nums; }
.dial__phase { font-weight: 700; color: var(--ember-2); }
.dial__tip { color: var(--cream-2); font-size: .95rem; }
.dial__controls { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 22px; }
.dial__track { flex: 1 1 380px; }
.dial__track input { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: 999px; outline-offset: 6px; cursor: pointer;
	background: linear-gradient(90deg, #0c1638 0%, #1a2350 18%, #e9a6a0 26%, #bcd8f2 38%, #dcecfb 55%, #ffd9a6 68%, #f08a4b 74%, #6a4f8c 82%, #1a2350 88%, #0c1638 100%); }
.dial__track input::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--cream); border: 4px solid var(--ink); box-shadow: 0 0 0 2px var(--cream), 0 6px 18px rgba(0,0,0,.4); }
.dial__track input::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--cream); border: 4px solid var(--ink); }
.dial__ticks { display: flex; justify-content: space-between; margin-top: 8px; font: 600 .72rem ui-monospace, Menlo, monospace; color: var(--muted); }
.dial__buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- EXP-03 blueprint ---------- */
.bp { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.bp__sheet { border-radius: var(--r); background: #123a5c; color: #cfe6ff; padding: clamp(10px, 2vw, 24px); box-shadow: inset 0 0 0 1px rgba(207,230,255,.18), inset 0 0 120px rgba(0,0,0,.35); }
.bp__svg { width: 100%; height: auto; display: block; font-family: ui-monospace, Menlo, monospace; }
.bp-line { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-dasharray: 1; stroke-dashoffset: 1; }
.bp-wall { stroke-width: 5; stroke-linejoin: miter; }
.bp-room--out .bp-wall { stroke-width: 2; stroke-dasharray: .012 .008; }
.bp__svg.is-drawn .bp-line { animation: draw 2.2s var(--ease) forwards; }
.bp__svg.is-drawn .bp-furn .bp-line { animation-delay: .9s; }
.bp__svg.is-drawn .bp-anno .bp-line { animation-delay: 1.4s; }
.bp__svg.is-drawn .bp-room--out .bp-wall { animation: none; stroke-dashoffset: 0; opacity: 0; animation: fadein-bp .8s 1.6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein-bp { to { opacity: 1; } }
.bp-hatch { fill: url(#bp-hatch); opacity: 0; transition: opacity 1s 1.6s; }
.bp__svg.is-drawn .bp-hatch { opacity: 1; }
.bp-room { cursor: pointer; outline: none; }
.bp-room__fill { fill: #cfe6ff; fill-opacity: 0; transition: fill-opacity .35s, fill .35s; }
.bp-room:hover .bp-room__fill, .bp-room:focus-visible .bp-room__fill { fill-opacity: .08; }
.bp-room.is-on .bp-room__fill { fill: #ff9d5c; fill-opacity: .34; }
.bp-room.is-on .bp-wall { stroke: #ffd2ac; }
.bp-room:focus-visible .bp-wall { stroke: #f29a5c; }
.bp-label, .bp-area, .bp-dim, .bp-tb { fill: currentColor; text-anchor: middle; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; opacity: 0; transition: opacity .8s 1.2s; }
.bp-label, .bp-area { text-anchor: start; pointer-events: none; }
.bp-area { font-size: 11px; opacity: 0; fill-opacity: .7; }
.bp-dim { font-size: 12px; }
.bp-tb { text-anchor: start; font-size: 13px; font-weight: 700; }
.bp-tb--s { font-size: 11px; font-weight: 400; }
.bp__svg.is-drawn .bp-label, .bp__svg.is-drawn .bp-area, .bp__svg.is-drawn .bp-dim, .bp__svg.is-drawn .bp-tb { opacity: 1; }
.bp-room.is-on .bp-label { fill: #ffd2ac; }
.bp-path { stroke: #f29a5c; stroke-width: 2.5; stroke-dasharray: 4000; stroke-dashoffset: 4000; stroke-linecap: round; opacity: 0; }
.bp-walker { fill: #f29a5c; opacity: 0; filter: drop-shadow(0 0 6px #f29a5c); }
.is-walking .bp-path, .is-walking .bp-walker { opacity: 1; }
.bp__panel { position: sticky; top: 100px; border-radius: var(--r); background: var(--bark); border: 1px solid var(--line); padding: 14px 14px 20px; }
.bp-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 14px; }
.bp-card.is-in { animation: rise-bp .5s var(--ease); }
@keyframes rise-bp { from { opacity: 0; transform: translateY(10px); } }
.bp-card__meta { margin: 14px 6px 4px; font: 700 .74rem ui-monospace, Menlo, monospace; color: var(--ember-2); letter-spacing: .06em; }
.bp-card h2 { font-size: 2rem; margin: 0 6px 10px; }
.bp-card ul { margin: 0 6px 16px; padding: 0; list-style: none; display: grid; gap: 6px; }
.bp-card li::before { content: "— "; color: var(--ember); }
.bp__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 6px; }

/* ---------- EXP-04 radio ---------- */
.radio__set { position: relative; border-radius: 28px; overflow: hidden; isolation: isolate; padding: clamp(18px, 3vw, 34px); background: #120d0a; border: 1px solid var(--line); --fire: 0; --rain: 0; }
.radio__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: brightness(calc(.22 + var(--fire) * .25)) saturate(calc(.6 + var(--fire) * .6)) blur(calc(var(--rain) * 3px)); transition: filter .6s; }
.radio__fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.radio__top { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.power { display: inline-flex; align-items: center; gap: 14px; border: 0; background: none; padding: 0; font-weight: 700; font-size: 1.05rem; }
.power__ring { width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(243,236,226,.35); display: grid; place-items: center; position: relative; transition: all .4s; }
.power__ring::before { content: ""; width: 18px; height: 18px; border: 2.5px solid currentColor; border-top-color: transparent; border-radius: 50%; }
.power__ring::after { content: ""; position: absolute; top: 18px; width: 2.5px; height: 14px; background: currentColor; border-radius: 2px; }
.power[aria-pressed="true"] .power__ring { background: var(--ember); border-color: var(--ember); color: var(--ink); box-shadow: 0 0 40px rgba(242,154,92,.6); }
.radio__dial { display: grid; justify-items: end; gap: 4px; }
.radio__freq { font: 600 1rem ui-monospace, Menlo, monospace; color: var(--cream-2); padding: 8px 14px; border-radius: 10px; background: rgba(0,0,0,.4); border: 1px solid var(--line); }
.radio__freq b { font-size: 1.5rem; color: #ffd2ac; text-shadow: 0 0 12px rgba(242,154,92,.7); }
.radio__onair { font: 700 .72rem var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.is-on .radio__onair { color: #ff6a55; text-shadow: 0 0 10px rgba(255,80,60,.8); }
.mixer { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 18px); }
.ch { display: grid; justify-items: center; gap: 4px; padding: 18px 8px 14px; border-radius: 18px; background: rgba(12,9,7,.55); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-align: center; cursor: pointer; }
.ch svg { color: var(--ember-2); }
.ch__name { font-family: var(--serif); font-size: 1.25rem; }
.ch__sub { font-size: .72rem; color: var(--muted); min-height: 2.4em; }
.ch__fader { display: grid; place-items: center; height: 170px; width: 100%; }
.ch__fader input { -webkit-appearance: none; appearance: none; width: 150px; height: 44px; transform: rotate(-90deg); background: transparent; cursor: pointer; --v: 0%; }
.ch__fader input::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--ember) var(--v), rgba(243,236,226,.15) var(--v)); }
.ch__fader input::-moz-range-track { height: 8px; border-radius: 99px; background: rgba(243,236,226,.15); }
.ch__fader input::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--ember); }
.ch__fader input::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 8px; background: var(--cream); box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.ch__fader input::-moz-range-thumb { width: 26px; height: 26px; border-radius: 8px; background: var(--cream); border: 0; }
.ch__val { font: 700 .82rem ui-monospace, Menlo, monospace; color: var(--cream-2); }
.radio__scope { display: block; width: 100%; height: 70px; margin-top: 18px; }
.radio__controls { display: grid; gap: 16px; margin-top: 22px; }
.radio__group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.radio__glabel { width: 110px; font: 700 .74rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.radio__note { margin-top: 18px; }

/* ---------- EXP-05 postcard ---------- */
.pc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.pc__form { display: grid; gap: 26px; }
.pc fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }
.pc legend { font: 700 .76rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.pc__scenes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pc__scene { position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; }
.pc__scene input { position: absolute; opacity: 0; }
.pc__scene img { aspect-ratio: 4/3; width: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .4s; filter: brightness(.75); }
.pc__scene span { position: absolute; left: 8px; bottom: 6px; font-size: .74rem; font-weight: 700; text-shadow: 0 1px 6px #000; }
.pc__scene:hover img { transform: scale(1.06); }
.pc__scene input:checked + img { filter: none; outline: 3px solid var(--ember); outline-offset: -3px; border-radius: 14px; }
.pc__scene input:focus-visible + img { outline: 3px solid var(--cream); outline-offset: -3px; }
.pc__styles { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-radio input { position: absolute; opacity: 0; }
.chip-radio span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; font-size: .88rem; cursor: pointer; }
.chip-radio input:checked + span { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.chip-radio input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 3px; }
.pc__field { display: grid; gap: 6px; }
.pc__field > span { font-size: .8rem; font-weight: 700; color: var(--cream-2); display: flex; justify-content: space-between; }
.pc__count { font-style: normal; color: var(--muted); font-weight: 500; }
.pc__field input, .pc__field textarea { width: 100%; padding: 13px 15px; border-radius: 14px; border: 1px solid var(--line); background: var(--bark); color: var(--cream); font: 500 1rem var(--sans); }
.pc__field input:focus, .pc__field textarea:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 4px rgba(226,118,58,.18); }
.pc__preview { position: sticky; top: 100px; perspective: 1600px; }
.pc__card { position: relative; aspect-ratio: 3/2; transform-style: preserve-3d; transition: transform 1s var(--ease); transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--flip, 0deg))); cursor: pointer; outline: none; }
.pc__card.is-flipped { --flip: 180deg; }
.pc__card:focus-visible { outline: 2px solid var(--ember); outline-offset: 8px; border-radius: 16px; }
.pc__face { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 40px 80px -30px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.06); }
.pc__front img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pc__greet { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 6% 7%; }
.pc__greet-small { font: 700 clamp(.6rem, 1.2vw, .8rem) var(--sans); letter-spacing: .3em; text-transform: uppercase; }
.pc__greet-big { font-family: var(--serif); font-weight: 300; font-size: clamp(2.4rem, 6.2vw, 5rem); line-height: 1; }
.pc__greet-loc { font: 600 clamp(.6rem, 1.1vw, .78rem) var(--sans); letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin-top: 6px; }
.pc__front[data-style="vintage"] { background: #f6efe3; padding: 3%; }
.pc__front[data-style="vintage"] img { inset: 3%; width: 94%; height: 94%; border-radius: 10px; filter: sepia(.25) saturate(1.1); }
.pc__front[data-style="vintage"] .pc__greet { inset: 3%; align-items: center; text-align: center; border-radius: 10px; background: linear-gradient(180deg, transparent 40%, rgba(20,12,6,.7)); }
.pc__front[data-style="vintage"] .pc__greet-big { font-style: italic; color: #ffd7ae; }
.pc__front[data-style="modern"] .pc__greet { background: linear-gradient(90deg, rgba(10,8,6,.72), transparent 65%); }
.pc__front[data-style="modern"] .pc__greet-loc::before { content: ""; display: inline-block; width: 36px; height: 3px; background: var(--ember); vertical-align: middle; margin-right: 10px; }
.pc__front[data-style="night"] img { filter: brightness(.55) saturate(.8) hue-rotate(-12deg); }
.pc__front[data-style="night"] .pc__greet { background: linear-gradient(90deg, rgba(10,14,40,.75), rgba(20,30,80,.25)); }
.pc__front[data-style="night"] .pc__greet-big { color: #cfe0ff; }
.pc__back { transform: rotateY(180deg); background: #f7f1e6; color: #2b2019; display: grid; grid-template-columns: 56% 44%; }
.pc__msg { padding: 9% 6% 6% 7%; border-right: 2px solid #d9cdbb; margin: 6% 0; font: 500 clamp(1.05rem, 2.2vw, 1.7rem)/1.2 Caveat, cursive; white-space: pre-wrap; overflow: hidden; }
.pc__addr { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 0; padding: 8% 9% 14%; }
.pc__stamp { position: absolute; top: 9%; right: 9%; width: 26%; aspect-ratio: 5/6; background: #fff; padding: 5%; outline: 3px dotted #f7f1e6; outline-offset: -2px; box-shadow: 0 0 0 4px #fff, 0 3px 8px rgba(0,0,0,.18); }
.pc__stamp img:first-child { width: 100%; height: 100%; object-fit: cover; }
.pc__stamplogo { position: absolute; right: 10%; bottom: 8%; width: 30%; }
.pc__postmark { position: absolute; top: 24%; right: 30%; width: 34%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(70,60,120,.55); box-shadow: inset 0 0 0 6px #f7f1e6, inset 0 0 0 8px rgba(70,60,120,.45); display: grid; place-items: center; text-align: center; padding: 12%; transform: rotate(-12deg); font: 700 clamp(.42rem, .8vw, .6rem)/1.3 var(--sans); color: rgba(70,60,120,.75); letter-spacing: .08em; }
.pc__line { display: block; min-height: 2.2em; border-bottom: 2px solid #cdbfab; font: 700 clamp(1.1rem, 2.4vw, 1.9rem)/1.6 Caveat, cursive; }
.pc__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

@media (max-width: 900px) {
	.bp, .pc { grid-template-columns: 1fr; }
	.bp__panel, .pc__preview { position: static; }
	.pc__preview { order: -1; }
}
@media (max-width: 680px) {
	.mixer { grid-template-columns: 1fr; gap: 8px; }
	.ch { grid-template-columns: 24px 64px minmax(0, 1fr) 30px; align-items: center; justify-items: start; gap: 10px; padding: 8px 14px; text-align: left; }
	.ch__sub { display: none; }
	.ch__name { font-size: 1.05rem; }
	.ch__fader { height: 44px; }
	.ch__fader input { width: 100%; transform: none; }
	.ch__val { justify-self: end; }
	.radio__glabel { width: 100%; }
	.dial__readout { padding: 10px 14px; }
	.dial__tip { display: none; }
	.pc__scenes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
