/* Ovo Studio, immersive edition.
 * The page is one fixed WebGL canvas with fixed HUD and text layers over it.
 * A tall empty #scroller gives the browser something to scroll; the scroll
 * position becomes a timeline that immersive.js turns into camera moves,
 * scene changes and panel fades. Nothing in .panels scrolls by itself.
 */
:root {
  --shell: #F3EFE6;
  --ink: #151515;
  --yolk: #F4A300;
  --frost: #9ea5b3;
  --text: #f6f7f9;
  --dim: rgba(246, 247, 249, 0.62);
  --hair: rgba(246, 247, 249, 0.28);
  --gutter: clamp(16px, 3.2vw, 44px);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  background: var(--frost);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
::selection { background: var(--yolk); color: var(--ink); }

#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#scroller { height: 1100vh; }

/* ------------------------------------------------------------------ loader */
#loader {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-content: center; justify-items: center; gap: 18px;
  background: var(--frost);
  transition: opacity 1.1s ease, visibility 0s linear 1.1s;
}
body.is-in #loader { opacity: 0; visibility: hidden; pointer-events: none; }
.ld-count { font-family: var(--mono); font-size: 13px; letter-spacing: 0.34em; color: #fff; font-variant-numeric: tabular-nums; }
.ld-bar { width: 180px; height: 1px; background: rgba(255,255,255,0.28); position: relative; overflow: hidden; }
.ld-bar i { position: absolute; inset: 0; background: #fff; transform-origin: left; transform: scaleX(0); }
.ld-file { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.72); min-height: 1.3em; }
.ld-count, .ld-bar { transition: opacity .5s; }
.ld-enter { display: flex; flex-direction: column; align-items: center; gap: 10px; opacity: 0; transform: translateY(6px); transition: opacity .6s, transform .6s; pointer-events: none; }
#loader.ready .ld-enter { opacity: 1; transform: none; pointer-events: auto; }
#loader.ready .ld-count, #loader.ready .ld-bar { opacity: 0; }
.ld-btn { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; padding: 10px 16px; color: #fff; transition: color .2s; }
.ld-btn:hover, .ld-btn:focus-visible { color: var(--ink); background: #fff; outline: none; }
.ld-btn.ghost { font-size: 10.5px; color: rgba(255,255,255,0.7); padding: 6px 10px; }
.ld-note { position: absolute; bottom: 28px; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.55); }

/* --------------------------------------------------------------------- HUD */
.hud { position: fixed; z-index: 20; pointer-events: none; opacity: 0; transition: opacity 1.2s ease .3s; }
body.is-in .hud { opacity: 1; }
.hud a, .hud button { pointer-events: auto; }

.hud-top {
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px var(--gutter);
}
.brand svg { width: 78px; height: auto; display: block; fill: var(--text); transition: fill .3s; }
.brand svg .v { fill: var(--yolk); }
.hud-nav { display: flex; gap: 28px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.hud-nav a { position: relative; padding: 4px 0; opacity: .78; transition: opacity .2s; }
.hud-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.hud-nav a:hover, .hud-nav a.on { opacity: 1; }
.hud-nav a:hover::after, .hud-nav a.on::after { transform: scaleX(1); }

.sound { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; padding: 6px 0; }
.sound b { font-weight: 500; }
.eq { display: flex; gap: 2px; align-items: flex-end; height: 11px; }
.eq i { width: 2px; height: 3px; background: currentColor; transition: height .3s; }
.sound[aria-pressed="true"] .eq i { animation: eq 0.9s ease-in-out infinite alternate; }
.sound[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: -.3s; }
.sound[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: -.6s; }
.sound[aria-pressed="true"] .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { from { height: 2px; } to { height: 11px; } }

/* thin corner brackets around the viewport */
.frame { inset: 12px; }
.frame i { position: absolute; width: 14px; height: 14px; border-color: var(--hair); border-style: solid; border-width: 0; }
.frame .tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.frame .tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.frame .bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.frame .br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.hud-bottom {
  left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end;
  padding: 22px var(--gutter);
  color: var(--dim);
}
.telemetry { font-size: 10px; white-space: nowrap; }
.chapter { justify-self: end; font-size: 10px; }
.chapter #chapNum { color: var(--text); margin-right: 6px; }
.scroll-hint { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text); font-size: 10px; transition: opacity .5s; }
.scroll-hint i { width: 1px; height: 34px; background: linear-gradient(var(--text), transparent); transform-origin: top; animation: drip 2.2s cubic-bezier(.6,0,.2,1) infinite; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.scroll-hint.gone { opacity: 0; }

/* left progress rail */
.rail { left: var(--gutter); top: 50%; transform: translateY(-50%); display: flex; gap: 14px; align-items: stretch; }
.rail ol { list-style: none; display: flex; flex-direction: column; gap: 18px; order: 2; }
.rail button { display: flex; align-items: baseline; gap: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); transition: color .3s; }
.rail button b { font-weight: 500; }
.rail button span { opacity: 0; transform: translateX(-4px); transition: opacity .3s, transform .3s; }
.rail li.on button, .rail button:hover { color: var(--text); }
.rail li.on button span, .rail button:hover span { opacity: 1; transform: none; }
.rail-bar { width: 1px; background: var(--hair); position: relative; order: 1; }
.rail-bar i { position: absolute; left: 0; top: 0; width: 1px; height: 100%; background: var(--text); transform-origin: top; transform: scaleY(0); }

/* ------------------------------------------------------------------ panels */
.panels { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.panel {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 96px var(--gutter);
  opacity: 0; visibility: hidden;
}
.panel.live { visibility: visible; }
.panel.live a, .panel.live button { pointer-events: auto; }

.p-hero { justify-content: flex-end; padding-bottom: clamp(96px, 16vh, 150px); padding-left: calc(var(--gutter) + 90px); }
.kicker { margin-bottom: 18px; color: var(--text); }
.display { font-weight: 300; font-size: clamp(54px, 9vw, 150px); line-height: 0.86; letter-spacing: -0.045em; text-shadow: 0 2px 40px rgba(60, 70, 90, 0.18); }
.display.sm { font-size: clamp(44px, 7.6vw, 118px); }
.lede { margin-top: 22px; font-size: clamp(15px, 1.35vw, 19px); max-width: 30ch; color: var(--text); line-height: 1.45; }

.p-copy { max-width: none; }
.p-copy .idx { margin-bottom: 22px; color: var(--text); }
.p-copy .big { font-size: clamp(22px, 2.55vw, 38px); line-height: 1.22; font-weight: 400; letter-spacing: -0.015em; max-width: 21ch; text-shadow: 0 1px 30px rgba(40, 48, 64, 0.25); }
.p-copy .big em { font-style: italic; color: var(--yolk); }
.p-copy.left { align-items: flex-start; padding-left: calc(var(--gutter) + 110px); }
.p-copy.right { align-items: flex-end; text-align: left; }
.p-copy.right > * { width: min(100%, 30rem); }
.p-copy.right .big { max-width: none; }
.stats { display: flex; gap: 34px; margin-top: 34px; }
.stats dt { color: var(--dim); font-size: 10px; margin-bottom: 6px; }
.stats dd { font-size: clamp(30px, 3.2vw, 46px); font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* work: text column on the left, the stone owns the rest of the screen */
.p-work { align-items: flex-start; padding-left: calc(var(--gutter) + 110px); }
.w-head { display: flex; gap: 26px; margin-bottom: 26px; color: var(--text); }
.w-count { color: var(--dim); }
.w-count b { color: var(--yolk); font-weight: 500; }
.w-title { font-weight: 300; font-size: clamp(48px, 7vw, 108px); line-height: 0.9; letter-spacing: -0.045em; }
.w-type { margin-top: 14px; color: var(--yolk); }
.w-line { margin-top: 22px; max-width: 34ch; font-size: clamp(15px, 1.2vw, 18px); line-height: 1.5; color: var(--text); min-height: 4.5em; }
.w-specs { margin-top: 26px; display: grid; grid-template-columns: auto auto; gap: 8px 26px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; max-width: 380px; }
.w-specs dt { color: var(--dim); }
.w-specs dd { color: var(--text); }
.w-link { margin-top: 34px; display: inline-flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; padding: 13px 18px; border: 1px solid var(--hair); transition: background .25s, color .25s, border-color .25s; }
.w-link i { font-style: normal; transition: transform .25s; }
.w-link:hover { background: var(--text); color: var(--ink); border-color: var(--text); }
.w-link:hover i { transform: translateX(4px); }
.w-link.soon { pointer-events: none !important; opacity: .55; }
.w-note { position: absolute; left: calc(var(--gutter) + 110px); bottom: 70px; color: var(--dim); font-size: 10px; max-width: 46ch; line-height: 1.6; }

/* contact */
.p-contact { align-items: flex-start; justify-content: center; padding-left: calc(var(--gutter) + 110px); }
.p-contact .idx { margin-bottom: 20px; }
.links { list-style: none; margin-top: 44px; width: min(100%, 560px); border-top: 1px solid var(--hair); }
.links li { border-bottom: 1px solid var(--hair); }
.links a { display: grid; grid-template-columns: 44px 1fr auto; align-items: baseline; padding: 16px 4px; font-size: clamp(20px, 2vw, 28px); font-weight: 400; letter-spacing: -0.01em; transition: padding .3s ease, color .2s; }
.links a span { color: var(--dim); font-size: 10px; }
.links a em { font-style: normal; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--dim); text-transform: uppercase; }
.links a:hover, .links a:focus-visible { padding-left: 14px; color: var(--yolk); outline: none; }
.foot { position: absolute; left: calc(var(--gutter) + 110px); right: var(--gutter); bottom: 62px; display: flex; flex-wrap: wrap; gap: 10px 34px; color: var(--dim); font-size: 10px; }
.foot button { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); margin-left: auto; }
.foot button:hover { color: var(--yolk); }

/* words lift out of their own masks when a panel arrives */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.w > span { display: inline-block; transform: translateY(108%); transition: transform 0.95s cubic-bezier(.2, .7, .1, 1) var(--d, 0s); }
.panel.in .w > span { transform: none; }
.p-work .w-line, .p-work .w-specs { transition: opacity .3s ease; }
.p-work.swapping .w-line, .p-work.swapping .w-specs { opacity: 0; }

/* reticle around the active stone */
.reticle { left: 0; top: 0; width: 10px; height: 10px; opacity: 0 !important; transition: opacity .5s; will-change: transform; }
.reticle.on { opacity: 1 !important; }
.reticle i { position: absolute; width: 16px; height: 16px; border: 0 solid var(--text); }
.reticle .tl { left: 0; top: 0; border-top-width: 1px; border-left-width: 1px; }
.reticle .tr { right: 0; top: 0; border-top-width: 1px; border-right-width: 1px; }
.reticle .bl { left: 0; bottom: 0; border-bottom-width: 1px; border-left-width: 1px; }
.reticle .br { right: 0; bottom: 0; border-bottom-width: 1px; border-right-width: 1px; }
.ret-tag { position: absolute; left: 0; top: calc(100% + 10px); white-space: nowrap; font-size: 10px; color: var(--text); }

#noGL { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; gap: 14px; text-align: center; padding: 24px; background: var(--frost); font-size: 17px; }
#noGL[hidden] { display: none; }
#noGL a { font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; text-decoration: underline; }

body.grab { cursor: grab; }
body.grabbing { cursor: grabbing; }

/* ----------------------------------------------------------------- narrow */
@media (max-width: 860px) {
  .hud-nav { display: none; }
  .rail { display: none; }
  .telemetry { display: none; }
  .hud-bottom { grid-template-columns: 1fr auto; padding: 16px; }
  .scroll-hint { justify-self: start; align-items: flex-start; }
  .hud-top { padding: 16px; }
  .frame { inset: 8px; }
  .panel { padding: 84px 16px; }
  .p-hero { padding-left: 16px; padding-bottom: 110px; }
  .p-copy.left, .p-copy.right, .p-work, .p-contact { padding-left: 16px; align-items: flex-start; }
  .p-copy { justify-content: flex-end; padding-bottom: 110px; }
  .p-copy .big { font-size: 22px; max-width: 26ch; }
  .stats { gap: 22px; }
  .p-work { justify-content: flex-end; padding-bottom: 100px; }
  .w-title { font-size: 48px; }
  .w-line { font-size: 14.5px; min-height: 0; }
  .w-specs { margin-top: 16px; }
  .w-link { margin-top: 20px; }
  .w-note { display: none; }
  .p-contact { justify-content: flex-end; padding-bottom: 104px; }
  .display.sm { font-size: 42px; }
  .links { margin-top: 24px; }
  .links a { grid-template-columns: 34px 1fr; padding: 12px 4px; font-size: 19px; }
  .links a em { display: none; }
  .foot { left: 16px; right: 16px; bottom: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint i, .sound[aria-pressed="true"] .eq i { animation: none; }
}
