/* Lumen Gallery. Tokens are copied from assets/index-merged.css; see docs/gallery-ui-audit.md. */
:root {
  --desk: #f1f2f6; --screen: #ffffff;
  --ink: #1d1d22; --ink-2: #5c5f6a; --ink-3: #8e919c; --line: #eeeff3; --fill: #f3f3f5;
  --serif: "Newsreader", Georgia, serif;
  --pink: #f7b8d2; --peach: #ffc9a8; --lilac: #c9b8f5; --sky: #b8d8fa; --mint: #bfe8d4; --butter: #fff1c2;
  --grad-button: linear-gradient(90deg, #f1dcf8 0%, #fbd3df 100%);
  --r-sm: 14px; --r-md: 20px; --r-lg: 28px;
  --shadow-card: 0 12px 32px rgba(29, 29, 34, .06);
  --shadow-float: 0 24px 60px rgba(120, 110, 200, .22);
  --dur-instant: 90ms; --dur-fast: 160ms; --dur-base: 240ms; --dur-slow: 320ms; --dur-moment: 700ms;
  --ease-out: cubic-bezier(.16,1,.3,1); --ease-in: cubic-bezier(.4,0,1,1); --ease-in-out: cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.3,1.6,.5,1); --ease-spring-soft: cubic-bezier(.2,.9,.25,1.2);
  /* Derived (see audit §5) */
  --ease-glide: cubic-bezier(.65,0,.35,1);
  --accent: var(--lilac); --accent-strong: #8b74e8;
  color-scheme: light;
  font-family: Geist, system-ui, -apple-system, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--desk); overflow: hidden; overscroll-behavior: none; }
body { touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; padding: 0; }
:focus-visible { outline: 2px solid #8fb7f0; outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; font-size: 16px; color: var(--ink-2); }

/* ---------- Lumen components, as in the app ---------- */
.pill { height: 54px; border-radius: 27px; background: var(--ink); color: #fff; font-size: 16px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 28px; transition: transform var(--dur-slow) var(--ease-spring), filter .15s ease; }
.pill:hover, .pill:focus-visible { transform: rotate(-3deg) scale(1.03); }
.pill:active { transform: rotate(-3deg) scale(.97); }
.pill.small { height: 44px; font-size: 14px; padding: 0 18px 0 12px; }
.pill.light { background: #fff; color: var(--ink); box-shadow: var(--shadow-card); }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; background: var(--fill); display: inline-flex; align-items: center; justify-content: center; color: var(--ink);
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast); }
.icon-btn:active { transform: scale(.9); }
/* No backdrop-filter: combined with the portfolio embed's transform: scale(0.333)
   on the iframe, the blur's reference box balloons into a big blurred "dome" next to
   the arrows. A near-opaque fill reads the same without that bug. */
.icon-btn.ghost, .glass { background: rgba(255,255,255,.92); }
.brand { display: flex; align-items: center; gap: 10px; }
a.brand { text-decoration: none; color: inherit; }
.brand .w { font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: -.01em; color: #111214; }
.brand .eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ring { position: relative; }
.ring i { position: absolute; left: 50%; top: 0; border-radius: 2px; background: #111214; }

/* ---------- Enter screen (Lumen welcome) ---------- */
.enter { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; text-align: center; background: #fff; overflow: hidden;
  transition: opacity var(--dur-moment) var(--ease-out), visibility var(--dur-moment); padding: 16px; }
.enter.gone { opacity: 0; visibility: hidden; }
.blob { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(80px); opacity: .6; animation: lumenDrift 14s ease-in-out infinite alternate; }
@keyframes lumenDrift { to { transform: translate(5%, -4%) rotate(10deg) scale(1.08); } }
.oval { position: absolute; left: 50%; top: 50%; width: 70vmin; height: 52vmin; margin: -26vmin 0 0 -35vmin; border-radius: 50%; background: #fff; filter: blur(30px); }
.enter-body { position: relative; }
.brand-center { justify-content: center; gap: 12px; }
.enter h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6vw, 72px); letter-spacing: -.02em; line-height: 1.05; margin: 18px 0 10px; }
.enter p { color: var(--ink-2); font-size: 16px; line-height: 1.45; margin: 0 0 30px; }
.enter .small { margin-top: 18px; font-size: 13px; color: var(--ink-3); }
.enter .pill[aria-busy="true"] { filter: brightness(1.4); }

/* ---------- Hall ---------- */
.hall { position: fixed; inset: 0; background: linear-gradient(#f7f8fb, #f2f3f7); outline: none; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#scene.pointing { cursor: pointer; }

/* 2D fallback when WebGL isn't available: the same four works, hung in a row */
.fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 96px 104px 120px; overflow: auto; touch-action: pan-y; }
.fallback .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; width: min(1100px, 100%); }
.fallback .work { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.fallback .work .art { aspect-ratio: 4 / 3; border-radius: 3px; overflow: hidden; background: #fff;
  box-shadow: 0 24px 70px -36px var(--c); transition: box-shadow var(--dur-slow) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.fallback .work .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fallback .work:hover .art, .fallback .work.lit .art { box-shadow: 0 28px 90px -30px var(--c); transform: translateY(-2px); }
.fallback .card { align-self: flex-start; background: #fff; padding: 8px 10px; font-size: 11px; line-height: 1.35; box-shadow: -3px 6px 14px -4px rgba(29,29,34,.08); }
.fallback .card b { font-weight: 600; display: block; }
.fallback .card em { font-family: var(--serif); font-size: 14px; }

/* ---------- Chrome ---------- */
.ui { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
.ui > * { pointer-events: auto; }
.ui .brand { position: absolute; left: 28px; top: max(24px, env(safe-area-inset-top)); transition: opacity var(--dur-slow); }
.ambient { position: absolute; right: 24px; top: max(20px, env(safe-area-inset-top)); box-shadow: var(--shadow-card); transition: opacity var(--dur-slow), background var(--dur-fast), transform var(--dur-fast) var(--ease-spring); }
.ambient[aria-pressed="true"] { background: var(--lilac); }
.edge { position: absolute; top: 50%; width: 60px; height: 60px; margin-top: -30px; border-radius: 30px; box-shadow: var(--shadow-card);
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast), opacity var(--dur-slow); }
.edge:hover { background: #fff; transform: scale(1.06); }
.edge:active { transform: scale(.9); }
.edge.l { left: 24px; } .edge.r { right: 24px; }
.chips { position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; padding: 6px;
  border-radius: 999px; box-shadow: var(--shadow-float); max-width: calc(100% - 32px); overflow-x: auto; scrollbar-width: none;
  transition: opacity var(--dur-slow), transform var(--dur-slow) var(--ease-out); }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 40px; border-radius: 20px; padding: 0 16px 0 6px; display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-size: 14px; color: var(--ink-2); white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base), transform var(--dur-fast) var(--ease-spring); }
.chip b { width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; font-weight: 500; font-size: 13px; background: var(--fill); color: var(--ink); transition: background var(--dur-base); }
.chip:hover { background: var(--fill); color: var(--ink); }
.chip:hover b { background: var(--c); }
.chip:active { transform: scale(.96); }
.chip[aria-current="true"] { background: var(--ink); color: #fff; }
.chip[aria-current="true"] b { background: var(--c); color: var(--ink); }
.hint { position: absolute; left: 50%; bottom: calc(max(22px, env(safe-area-inset-bottom)) + 64px); transform: translateX(-50%); font-size: 14px; color: var(--ink-2); white-space: nowrap;
  padding: 9px 16px; border-radius: 20px; box-shadow: var(--shadow-card); transition: opacity var(--dur-slow), transform var(--dur-slow) var(--ease-out); }
.hint kbd { font: inherit; font-size: 12px; padding: 1px 7px; border-radius: 6px; background: var(--fill); color: var(--ink); margin: 0 2px; }
.hint.gone { opacity: 0; transform: translate(-50%, 8px); pointer-events: none; }
.ui.watching .brand, .ui.watching .hint, .ui.watching .ambient { opacity: 0; pointer-events: none; }
.ui.watching .chips { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }

/* ---------- Hover states ---------- */
/* Arrows and the music button say what they do: a label slides out beside them */
.edge[data-tip]::after, .ambient[data-tip]::after { content: attr(data-tip); position: absolute; top: 50%; padding: 8px 14px; border-radius: 18px;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; pointer-events: none;
  box-shadow: var(--shadow-card), inset 0 -2px 0 var(--c, var(--accent)); opacity: 0;
  transition: opacity var(--dur-fast), transform var(--dur-base) var(--ease-spring); }
.edge.l::after { left: calc(100% + 12px); transform: translate(-8px, -50%) scale(.96); }
.edge.r::after, .ambient::after { right: calc(100% + 12px); transform: translate(8px, -50%) scale(.96); }
.edge:hover::after, .edge:focus-visible::after, .ambient:hover::after, .ambient:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
.ambient:hover { transform: scale(1.06); }
/* Round buttons tilt their icon, so the label beside them stays level */
.icon-btn svg { transition: transform var(--dur-slow) var(--ease-spring); }
.edge:hover svg, .edge:focus-visible svg { transform: rotate(-10deg); }
.next .acts button { transition: transform var(--dur-slow) var(--ease-spring), background var(--dur-fast); }
.next .acts button:hover { transform: rotate(-3deg) scale(1.04); }
.ambient:hover svg { animation: noteBob .7s var(--ease-spring); }
@keyframes noteBob { 40% { transform: translateY(-3px) rotate(-8deg); } }

/* Header: "Gallery" turns into the way back */
.brand.home .eyebrow { display: grid; }
.brand.home .eyebrow > span { grid-area: 1 / 1; transition: opacity var(--dur-fast), transform var(--dur-base) var(--ease-spring); }
.brand.home .eyebrow .back { opacity: 0; transform: translateX(-6px); color: var(--ink); }
.brand.home:hover .eyebrow .now, .brand.home:focus-visible .eyebrow .now { opacity: 0; transform: translateX(6px); }
.brand.home:hover .eyebrow .back, .brand.home:focus-visible .eyebrow .back { opacity: 1; transform: none; }
.brand.home .ring { transition: transform var(--dur-moment) var(--ease-spring); }
.brand.home:hover .ring { transform: rotate(-90deg); }
@media (max-width: 760px) { .edge[data-tip]::after { display: none; } }

/* Hover pill (js/cursor.js): dot -> circle -> "Watch" pill over a screen. JS sets the size, scale and opacity;
   the wrapper is 0×0 at the pointer and flex-centres the pill on it. */
.hover-pill { position: fixed; left: 0; top: 0; z-index: 9999; width: 0; height: 0; display: none; align-items: center; justify-content: center;
  pointer-events: none; will-change: transform; transform: translate3d(-100px, -100px, 0); }
.hover-pill .hp-bg { flex-shrink: 0; height: 44px; width: 44px; border-radius: 999px; border: .5px solid #fff; background: var(--ink);
  box-shadow: 0 6px 18px rgba(29, 29, 34, .22); opacity: 0; }
/* The measuring twin and the label must share these text styles, or the measured width won't match. */
.hover-pill .hp-measure, .hover-pill .hp-text { white-space: nowrap; font-family: Geist, system-ui, sans-serif; font-size: 17px; font-weight: 500; line-height: 20px; letter-spacing: -.01em; }
.hover-pill .hp-measure { position: absolute; left: 0; top: 0; visibility: hidden; }
.hover-pill .hp-wrap { position: absolute; left: 0; top: 0; width: 0; height: 0; display: flex; align-items: center; justify-content: center; }
.hover-pill .hp-text { color: #fff; opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .hover-pill { display: flex; }
  /* The native cursor hides while the pill is on screen; the class is removed once the exit finishes. */
  html.cursor-morph-active, html.cursor-morph-active * { cursor: none !important; }
}

/* ---------- Player ---------- */
.player { position: fixed; inset: 0; z-index: 10; visibility: hidden; pointer-events: none; }
.player.on { visibility: visible; pointer-events: auto; }
.backdrop { position: absolute; inset: 0; background: var(--desk); opacity: 0; transition: opacity 520ms var(--ease-in-out); } /* = DISSOLVE_MS in js/main.js */
.player.show .backdrop { opacity: 1; }
/* The frame is the screen lifted off the wall; JS flies it between the wall and the centre */
/* No shadow: the 3D copy that flies in has none, so nothing appears at the handoff. */
.frame { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: hidden; background: var(--desk); border-radius: var(--r-md); }
.frame video, .frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.frame canvas { transition: opacity .45s var(--ease-out); }
/* The roundtable (js/player.js): films on a ring around you while watching. The ring carries its own perspective
   so it can fade without flattening the 3D. */
.roundtable { position: absolute; inset: 0; perspective: 1800px; pointer-events: none; opacity: 0; transition: opacity 420ms var(--ease-out); }
.player.show .roundtable.on { opacity: 1; }
.player.idle .roundtable { opacity: 0; }
.roundtable .card { position: absolute; border-radius: var(--r-md); overflow: hidden; background: var(--desk); backface-visibility: hidden;
  box-shadow: 0 30px 90px -45px rgba(29, 29, 34, .35); }
.roundtable .card img, .roundtable .card canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.frame video::cue { font-family: Geist, system-ui, sans-serif; background: rgba(29,29,34,.72); color: #fff; }
.player .top, .player .bar { opacity: 0; pointer-events: none; }
.player.show .top, .player.show .bar { opacity: 1; pointer-events: auto; transition-delay: .3s; }
/* The title row (Back to gallery, title) stays whenever a film is open; only the player bar waits for a hover. */
.player.show.idle .bar { opacity: 0; pointer-events: none; transition-delay: 0s; }
.top { position: absolute; left: 24px; right: 24px; top: max(17px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 16px; transition: opacity var(--dur-slow); }
.top .title { font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -.015em; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.top .title small { font-family: Geist, sans-serif; font-size: 13px; color: var(--ink-3); margin-left: 10px; letter-spacing: 0; }
.bar { position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); width: min(960px, calc(100% - 32px)); transform: translate(-50%, 10px); padding: 8px 14px;
  border-radius: var(--r-lg); box-shadow: var(--shadow-float); transition: opacity var(--dur-slow), transform var(--dur-slow) var(--ease-out); }
.player.show .bar { transform: translateX(-50%); }
.player.show.idle .bar { transform: translate(-50%, 10px); }
.scrub { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.track { position: relative; width: 100%; height: 4px; border-radius: 2px; background: var(--line); transition: height var(--dur-fast) var(--ease-out); }
.scrub:hover .track, .scrub.drag .track { height: 6px; }
.track .buf { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: #dfe1e8; }
.track .played { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--ink); }
.thumb { position: absolute; top: 50%; left: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px var(--accent), 0 2px 6px rgba(29,29,34,.2); transform: scale(0); transition: transform var(--dur-fast) var(--ease-spring); }
.scrub:hover .thumb, .scrub.drag .thumb, .scrub:focus-visible .thumb { transform: scale(1); }
.tip { position: absolute; bottom: 28px; left: 0; transform: translateX(-50%); padding: 5px 9px; border-radius: 8px; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity var(--dur-fast); pointer-events: none; }
.scrub:hover .tip, .scrub.drag .tip { opacity: 1; }
.row { display: flex; align-items: center; gap: 4px; }
.ib { width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; color: var(--ink); flex-shrink: 0;
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-spring); position: relative; }
.ib:hover { background: var(--fill); } .ib:active { transform: scale(.9); }
.ib.big { background: var(--ink); color: #fff; }
.ib.big:hover { background: var(--ink); transform: scale(1.05); }
.ib[aria-pressed="true"] { background: var(--lilac); }
.ib.speed { width: auto; padding: 0 12px; font-size: 14px; font-weight: 500; }
.time { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin: 0 8px; white-space: nowrap; }
.grow { flex: 1; }
.volwrap { display: flex; align-items: center; }
.vol { width: 0; overflow: hidden; transition: width var(--dur-base) var(--ease-out); display: flex; align-items: center; }
.volwrap:hover .vol, .volwrap:focus-within .vol { width: 96px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 84px; height: 4px; border-radius: 2px; margin: 0 6px; cursor: pointer;
  background: linear-gradient(90deg, var(--ink) var(--v, 100%), var(--line) var(--v, 100%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(29,29,34,.3); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(29,29,34,.3); }
.menu { position: absolute; bottom: 70px; right: 60px; padding: 6px; border-radius: var(--r-sm); background: #fff; color: var(--ink);
  box-shadow: var(--shadow-float); display: grid; gap: 2px; min-width: 120px; transform-origin: bottom right;
  transform: scale(.92); opacity: 0; pointer-events: none; transition: transform var(--dur-base) var(--ease-spring), opacity var(--dur-fast); }
.menu.on { transform: none; opacity: 1; pointer-events: auto; }
.menu button { text-align: left; padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.menu button:hover, .menu button:focus-visible { background: var(--fill); }
.menu button[aria-checked="true"] { font-weight: 600; }
.burst { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px; border-radius: 50%; background: rgba(255,255,255,.9);
  color: var(--ink); display: grid; place-items: center; opacity: 0; pointer-events: none; }
.burst.go { animation: burst .55s var(--ease-out); }
@keyframes burst { 0% { opacity: .95; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.4); } }

.next { position: absolute; right: 44px; bottom: 136px; width: min(320px, calc(100% - 32px)); padding: 16px; border-radius: var(--r-md); background: #fff; color: var(--ink);
  box-shadow: var(--shadow-float); transform: translateY(16px) scale(.97); opacity: 0; pointer-events: none;
  transition: transform var(--dur-slow) var(--ease-spring), opacity var(--dur-base); }
.next.on { transform: none; opacity: 1; pointer-events: auto; }
.next .k { font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.next .t { font-family: var(--serif); font-size: 22px; line-height: 1.15; margin: 4px 0 12px; }
.next .cd { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; margin-bottom: 12px; }
.next .cd i { display: block; height: 100%; background: var(--grad-button); width: 100%; }
.next .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.next .acts button { height: 38px; padding: 0 14px; border-radius: 19px; font-size: 14px; font-weight: 500; background: var(--fill); transition: transform .15s ease; }
.next .acts button:active { transform: scale(.98); }
.next .acts button.go { background: var(--ink); color: #fff; }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .ui .brand { left: 16px; }
  .fallback { padding: 80px 72px 110px; }
  .ambient { right: 16px; }
  .edge { width: 48px; height: 48px; margin-top: 0; top: auto; bottom: calc(max(22px, env(safe-area-inset-bottom)) + 2px); }
  .edge.l { left: 12px; } .edge.r { right: 12px; }
  .ui.watching .edge { opacity: 0; pointer-events: none; } /* swipe left or right instead; the player bar needs the room */
  .chip { padding: 0 6px; }
  .chip span { display: none; }
  .chip[aria-current="true"] span { display: inline; padding-right: 8px; }
  .top { left: 16px; right: 16px; gap: 10px; }
  .top .title { font-size: 20px; }
  .top .title small { display: none; }
  .bar { padding: 6px 8px; }
  .row { gap: 0; }
  .volwrap .vol, #b10, #f10 { display: none; }
  .next { right: 16px; bottom: 120px; }
}
