@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/InstrumentSerif-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  color-scheme: dark;
  background: #000;
  color: #fff;
  font-family: 'Instrument Serif', Georgia, serif;
  --brand-move-ms: 550ms;
  --logo-pulse-ms: 2200ms;
  --indicator-ms: 1800ms;
  --text-delay-ms: 200ms;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body { position: relative; }
button { font: inherit; }
[hidden] { display: none !important; }

#scene-root,
.scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.scene { background: #000; }
.scene-still { background: #fff; color: #181818; }

.scene-media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scene-completion-video .scene-media { object-fit: cover; }

.scene-video { opacity: 0; }
.scene-video.is-playing { opacity: 1; }
.video-poster { pointer-events: none; }

.scene-copy {
  position: absolute;
  z-index: 3;
  font-weight: 400;
  line-height: 0.93;
  pointer-events: none;
}

.dice-copy {
  top: 39%;
  left: 11%;
  width: min(42vw, 690px);
  text-align: center;
  text-shadow: 0 2px 14px rgb(0 0 0 / 55%);
}

.dice-headline,
.dice-stack { width: 100%; }

.headline-line,
.dice-stack-line,
.banana-line { display: block; white-space: nowrap; }

.headline-line-1 {
  font-size: clamp(42px, 4.8vw, 90px);
  letter-spacing: -0.055em;
}

.headline-line-2 {
  font-size: clamp(21px, 1.7vw, 36px);
  letter-spacing: -0.01em;
  margin-top: 0.15em;
}

.accent { color: #aa7b3e; }

.dice-stack {
  min-height: 6.1em;
  font-size: clamp(28px, 2.7vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.dice-stack-line-2,
.dice-stack-line-3 { margin-top: 0.05em; }

.banana-copy {
  top: 37%;
  left: 58%;
  width: 32%;
  text-align: left;
  text-shadow: 0 1px 10px rgb(255 255 255 / 50%);
}

.banana-line-1 { font-size: clamp(29px, 2.65vw, 54px); }
.banana-line-2 { font-size: clamp(72px, 7vw, 144px); letter-spacing: -0.065em; }

.brand {
  position: fixed;
  z-index: 20;
  top: 50%;
  left: 50%;
  width: clamp(140px, 13vw, 245px);
  transform: translate(-50%, -54%);
  text-align: center;
  pointer-events: none;
  transition: top var(--brand-move-ms) ease, left var(--brand-move-ms) ease,
    width var(--brand-move-ms) ease, transform var(--brand-move-ms) ease;
}

.brand-mark { position: relative; width: 100%; aspect-ratio: 1; }
.brand-mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.brand-mark-white { opacity: 0; transition: opacity var(--brand-move-ms) ease; }
.brand-mark-dark { opacity: 1; transition: opacity var(--brand-move-ms) ease; }
.brand-name {
  margin-top: -0.11em;
  white-space: nowrap;
  font-size: clamp(24px, 2.45vw, 46px);
  line-height: 1;
  transition: opacity var(--brand-move-ms) ease, transform var(--brand-move-ms) ease;
}

.is-loading .brand-mark { animation: logo-pulse var(--logo-pulse-ms) ease-in-out infinite alternate; }
.is-loading .brand-name { animation: name-arrive var(--brand-move-ms) ease-out var(--text-delay-ms) both; }
.is-ready .brand-mark-white { opacity: 1; }
.is-ready .brand-mark-dark { opacity: 0; }
.is-ready[data-scene='opening'] .brand-name { animation: name-arrive var(--brand-move-ms) ease-out both; }

body:not([data-scene='opening']) .brand {
  top: clamp(13px, 1.8vw, 30px);
  left: clamp(13px, 1.8vw, 30px);
  width: clamp(42px, 3.2vw, 66px);
  transform: none;
}

body:not([data-scene='opening']) .brand-name { opacity: 0; transform: translateY(-10px); }

.controls {
  position: fixed;
  z-index: 30;
  bottom: clamp(18px, 2.8vw, 44px);
  left: clamp(18px, 2.8vw, 44px);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.controls button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  cursor: pointer;
}

.controls button:disabled { opacity: 0.3; cursor: default; }
.controls button:focus-visible { outline: 2px solid #98d46e; outline-offset: 3px; }
.audio-off { display: inline-flex; align-items: center; gap: 0.35rem; opacity: 0.72; }
.audio-dot { width: 5px; height: 5px; border-radius: 50%; background: #9d9d9d; }
body[data-scene='banana'] .controls { color: #151515; }

.scroll-cue {
  position: fixed;
  z-index: 30;
  right: clamp(18px, 2.8vw, 44px);
  bottom: clamp(18px, 2.8vw, 44px);
  width: 24px;
  height: 39px;
  border: 1.5px solid currentColor;
  border-radius: 14px;
  opacity: 0.75;
}

.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  transform: translateX(-50%);
  animation: scroll-hint var(--indicator-ms) ease-in-out infinite;
}

body[data-scene='banana'] .scroll-cue { color: #151515; }
.transition-veil { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.media-notice {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 5.2rem;
  width: min(90vw, 420px);
  margin: 0;
  padding: 0.65rem 0.9rem;
  transform: translateX(-50%);
  border-radius: 3px;
  background: rgb(20 20 20 / 88%);
  color: #fff;
  font: 12px/1.4 Arial, Helvetica, sans-serif;
  text-align: center;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@keyframes logo-pulse { from { opacity: 0.68; } to { opacity: 1; } }
@keyframes name-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scroll-hint { 0%, 100% { transform: translate(-50%, 0); opacity: 0.4; } 50% { transform: translate(-50%, 10px); opacity: 1; } }

@media (max-width: 700px), (orientation: portrait) {
  .brand { width: clamp(128px, 33vw, 210px); }
  .brand-name { font-size: clamp(24px, 7vw, 40px); }
  body:not([data-scene='opening']) .brand { top: 16px; left: 16px; width: 48px; }
  .dice-copy {
    top: 20%;
    left: 7%;
    width: 86%;
  }
  .headline-line-1 { font-size: clamp(38px, 10.5vw, 70px); }
  .headline-line-2 { font-size: clamp(20px, 5.3vw, 34px); }
  .dice-stack { font-size: clamp(28px, 7.3vw, 48px); }
  .banana-copy { top: 19%; left: 49%; width: 45%; }
  .banana-line-1 { font-size: clamp(21px, 5.4vw, 36px); }
  .banana-line-2 { font-size: clamp(50px, 14vw, 90px); }
  .controls { gap: 0.55rem; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand,
  .brand-mark img,
  .brand-name { transition-duration: 0ms; }
  .is-loading .brand-mark,
  .is-loading .brand-name,
  .scroll-cue span { animation: none; }
}
