:root {
  --void: #000;
  --steel: #c9d0d8;
  --mute: #7d8796;
  --flux: #4cc9ff;
  --amber: #ffb000;
  --red: #ff3b30;
  --pad: clamp(16px, 4vw, 48px);
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
/* the page never scrolls natively — progress is virtual so the story can loop */
html, body { height: 100%; overflow: hidden; background: var(--void); color: var(--steel); }
body { font: 300 16px/1.5 var(--sans); touch-action: none; }
a, button { color: inherit; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--flux); outline-offset: 3px; }

#gl, #veil { position: fixed; inset: 0; width: 100%; height: 100%; }
#veil { pointer-events: none; opacity: 0; background: #fff; }

.top {
  position: fixed; z-index: 2; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--pad) 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; letter-spacing: .01em; }
.brand img { filter: invert(1); }
#assetStatus { position: fixed; right: var(--pad); top: 84px; z-index: 3; color: var(--mute); font: 11px/1.5 var(--mono); pointer-events: none; }
.static #assetStatus { display: none; }
.talk {
  text-decoration: none; font-weight: 400; padding: 9px 18px; border-radius: 999px;
  border: 1px solid rgba(201, 208, 216, .35); transition: background .15s, border-color .15s;
}
.talk:active { background: rgba(76, 201, 255, .18); }
.acts { display: flex; gap: 8px; }
.back { background: rgba(201, 208, 216, .1); }
@media (max-width: 370px) { .brand span { display: none; } }

.scene {
  position: fixed; z-index: 1; left: var(--pad); bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
  max-width: 34rem; opacity: 0; visibility: hidden; will-change: opacity, transform;
}
h1, h2 { font-weight: 300; font-size: clamp(2.1rem, 5.4vw, 4.6rem); line-height: 1.02; letter-spacing: -.025em; color: #fff; }
h1 span, h2 span { display: block; color: var(--mute); }
.scene p { margin-top: 1.1rem; max-width: 27rem; font-size: clamp(1rem, 1.3vw, 1.15rem); color: var(--steel); }

.ways { list-style: none; margin-top: 1.4rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ways a {
  display: block; padding: 12px 14px; border-radius: 14px; text-decoration: none; font-weight: 400;
  background: rgba(10, 14, 22, .62); border: 1px solid rgba(201, 208, 216, .16);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color .15s, background .15s;
}
.ways small { display: block; font: 400 12px/1.4 var(--mono); color: var(--amber); }
.ways a:active { background: rgba(255, 176, 0, .14); }
.full { display: inline-block; margin-top: 1rem; color: var(--mute); font-size: .95rem; }

/* the BTTF time-circuit display doubles as scene navigation */
.circuit {
  position: fixed; z-index: 2; right: var(--pad); bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  display: flex; align-items: center; gap: 18px; font: 500 13px/1 var(--mono); color: var(--amber);
}
.clock { display: flex; gap: 8px; padding: 8px 10px; border-radius: 6px; background: rgba(30, 12, 0, .55); border: 1px solid rgba(255, 176, 0, .25); text-shadow: 0 0 8px rgba(255, 176, 0, .6); }
.clock i { font-style: normal; color: var(--red); }
.circuit ol { list-style: none; display: flex; gap: 2px; }
.circuit button { width: 26px; height: 26px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.circuit button::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: rgba(201, 208, 216, .3); transition: background .2s, transform .2s; }
.circuit button[aria-current]::after { background: var(--amber); transform: scale(1.35); box-shadow: 0 0 10px var(--amber); }

.hint {
  position: fixed; left: var(--pad); bottom: calc(env(safe-area-inset-bottom, 0px) + 32px);
  font: 400 12px/1 var(--mono); color: var(--mute); transition: opacity .4s;
}
.hint::after { content: ''; display: inline-block; width: 1px; height: 14px; margin-left: 10px; vertical-align: middle; background: var(--mute); animation: drip 1.6s ease-in-out infinite; }
@keyframes drip { 50% { transform: translateY(6px); opacity: .2; } }

@media (hover: hover) and (pointer: fine) {
  .talk:hover { border-color: var(--flux); }
  .ways a:hover { border-color: var(--amber); }
  .full:hover { color: var(--steel); }
}

@media (max-width: 640px) {
  .scene { right: var(--pad); bottom: calc(env(safe-area-inset-bottom, 0px) + 78px); }
  .contacts { bottom: calc(env(safe-area-inset-bottom, 0px) + 70px); }
  .ways { grid-template-columns: 1fr 1fr; gap: 6px; }
  .ways a { padding: 10px 12px; font-size: 14px; }
  .clock { display: none; }
  .circuit { left: 0; right: 0; justify-content: center; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hint::after { animation: none; }
}

/* no WebGL: plain readable document */
.static html, html.static, .static body { overflow: auto; touch-action: auto; }
.static #gl, .static #veil, .static .circuit, .static .hint { display: none; }
.static main { padding: 110px var(--pad) 60px; display: grid; gap: 72px; }
.static .scene { position: static; opacity: 1; visibility: visible; }
