:root {
  color-scheme: dark;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  --void: #050505;
  --off-white: #f3f2ee;
  --glass: rgba(8, 8, 10, 0.46);
  --glass-solid: rgba(15, 15, 17, 0.94);
  --line: rgba(255, 255, 255, 0.18);
  --text: rgba(255, 255, 255, 0.96);
  --muted: rgba(255, 255, 255, 0.72);
  --card-radius: 22px;
  --button-radius: 999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--void);
  overscroll-behavior: none;
}

body {
  min-width: 320px;
  overflow: hidden;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.experience {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--void);
  outline: none;
  touch-action: none;
  user-select: none;
}

.backdrop,
.backdrop-layer,
.color-panel,
#stage,
.film-grain,
.vignette {
  position: absolute;
  inset: 0;
}

.backdrop {
  z-index: 0;
  overflow: hidden;
  background: var(--void);
}

.backdrop-layer {
  overflow: hidden;
  transform-origin: 50% 50%;
}

.backdrop-layer--current {
  z-index: 0;
}

.backdrop-layer--next {
  z-index: 1;
  visibility: hidden;
}

.color-panel {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--void);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

#stage {
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
}

.film-grain {
  z-index: 3;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.58'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.vignette {
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 20%, transparent 72%, rgba(0, 0, 0, 0.3)),
    radial-gradient(circle at 50% 44%, transparent 45%, rgba(0, 0, 0, 0.2) 100%);
}

.topbar {
  position: absolute;
  z-index: 8;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 76px;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 58px) 0;
  pointer-events: none;
}

.wordmark,
.language-toggle,
.download-link,
.control-button {
  pointer-events: auto;
}

.wordmark {
  color: var(--off-white);
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
  mix-blend-mode: difference;
}

.topbar-actions {
  margin-left: auto;
  margin-right: clamp(112px, 10vw, 146px);
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
  pointer-events: auto;
}

.language-toggle,
.download-link {
  color: var(--off-white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
  mix-blend-mode: difference;
  transition: opacity 180ms ease;
}

.language-toggle {
  min-width: 34px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.language-toggle:hover,
.download-link:hover {
  opacity: 0.68;
}

.hero-gate {
  position: absolute;
  z-index: 11;
  inset: 0;
  overflow: hidden;
  background: #000;
  visibility: visible;
  opacity: 1;
  transition:
    opacity 620ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 620ms;
}

.hero-gate__title {
  position: absolute;
  top: 39%;
  left: 50%;
  width: max-content;
  margin: 0;
  color: #f7f7f5;
  font-size: clamp(88px, 15.5vw, 230px);
  font-weight: 720;
  letter-spacing: -0.075em;
  line-height: 0.82;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  transition:
    opacity 440ms ease,
    transform 620ms cubic-bezier(0.4, 0, 0.2, 1),
    filter 620ms cubic-bezier(0.4, 0, 0.2, 1);
}

.experience.has-started .hero-gate {
  visibility: hidden;
  opacity: 0;
}

.experience.has-started .hero-gate__title {
  filter: blur(14px);
  opacity: 0;
  transform: translate(-50%, -54%) scale(1.055);
}

.control-button,
.replay-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  background: rgba(7, 7, 9, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 38px rgba(0, 0, 0, 0.14);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), background-color 180ms ease;
}

.control-button {
  min-width: 104px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

#play-toggle {
  position: fixed;
  z-index: 13;
  top: 50%;
  left: 50%;
  width: clamp(260px, 32vw, 440px);
  height: clamp(112px, 18vh, 150px);
  padding: 0 30px;
  border-color: rgba(255, 255, 255, 0.3);
  border-radius: 40px;
  background: rgba(7, 7, 9, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 30px 90px rgba(0, 0, 0, 0.28);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 720;
  letter-spacing: -0.045em;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  opacity: 1;
  backdrop-filter: blur(30px) saturate(155%);
  -webkit-backdrop-filter: blur(30px) saturate(155%);
  transition:
    top 680ms cubic-bezier(0.16, 1, 0.3, 1),
    left 680ms cubic-bezier(0.16, 1, 0.3, 1),
    width 680ms cubic-bezier(0.16, 1, 0.3, 1),
    height 680ms cubic-bezier(0.16, 1, 0.3, 1),
    padding 680ms cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 680ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 220ms ease,
    box-shadow 680ms cubic-bezier(0.16, 1, 0.3, 1),
    font-size 680ms cubic-bezier(0.16, 1, 0.3, 1),
    letter-spacing 680ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 260ms ease,
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.experience:not(.has-started) #play-toggle {
  top: 65%;
}

.experience.has-started:not(.is-playing) #play-toggle {
  top: 50%;
}

.experience.is-playing #play-toggle {
  top: max(46px, calc(env(safe-area-inset-top) + 22px));
  left: calc(100% - clamp(70px, 8vw, 104px));
  width: 104px;
  height: 42px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--button-radius);
  background: rgba(7, 7, 9, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 38px rgba(0, 0, 0, 0.14);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.experience.is-loading #play-toggle {
  pointer-events: none;
  opacity: 0;
}

.control-button:hover,
.replay-button:hover {
  background: rgba(7, 7, 9, 0.68);
}

.control-button:active,
.replay-button:active {
  transform: scale(0.98) translateY(1px);
}

.other-projects-link {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: min(1120px, calc(100vw - 80px));
  min-height: clamp(150px, 26vh, 240px);
  padding: 28px 42px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 48px;
  background: rgba(8, 8, 10, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 36px 110px rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: clamp(42px, 7.2vw, 108px);
  font-weight: 720;
  letter-spacing: -0.07em;
  line-height: 0.95;
  text-align: center;
  text-decoration: none;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  transition:
    background-color 180ms ease,
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.other-projects-link:hover {
  background: rgba(8, 8, 10, 0.66);
  transform: translate(-50%, -50%) scale(1.012);
}

.other-projects-link:active {
  transform: translate(-50%, -50%) scale(0.985);
}

.experience.is-complete .story-copy {
  pointer-events: none;
  opacity: 0 !important;
}

#play-toggle:active {
  transform: translate(-50%, -50%) scale(0.97);
}

.control-button:focus-visible,
.replay-button:focus-visible,
.download-link:focus-visible,
.language-toggle:focus-visible,
.other-projects-link:focus-visible,
.scene-progress button:focus-visible,
.wordmark:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 4px;
}

.control-button:disabled {
  cursor: wait;
  opacity: 0.48;
}

.story-copy {
  position: absolute;
  z-index: 7;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: clamp(112px, 16vh, 154px);
  padding: 0 clamp(22px, 5vw, 72px) env(safe-area-inset-bottom);
  overflow: hidden;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  background: rgba(8, 8, 10, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 -28px 90px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transform-origin: 50% 100%;
  backdrop-filter: blur(30px) saturate(150%) contrast(1.04);
  -webkit-backdrop-filter: blur(30px) saturate(150%) contrast(1.04);
  will-change: transform, opacity;
}

.story-copy[data-position="top"] {
  top: 0;
  bottom: auto;
  padding-top: env(safe-area-inset-top);
  border-top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 28px 90px rgba(0, 0, 0, 0.1);
}

.story-copy[data-position="middle"] {
  top: calc(50% - clamp(56px, 8vh, 77px));
  bottom: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 22px 70px rgba(0, 0, 0, 0.1);
}

.story-copy[data-width="center"] {
  right: auto;
  left: max(18px, calc(50% - 360px));
  width: min(720px, calc(100vw - 36px));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--card-radius);
}

.status-kicker {
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.18em;
  line-height: 1;
}

.story-copy h1 {
  max-width: none;
  margin: 0;
  color: var(--text);
  font-size: clamp(58px, 9vw, 112px);
  font-weight: 720;
  letter-spacing: -0.07em;
  line-height: 0.82;
  white-space: nowrap;
  will-change: transform, opacity, filter;
}

.scene-title-mask {
  padding: 20px 24px;
  margin: -20px -24px;
  clip-path: inset(0% 0% 0% 0%);
  will-change: clip-path;
}

.scene-progress {
  display: none;
}

.scene-progress button {
  width: 28px;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: var(--button-radius);
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), background-color 260ms ease;
}

.scene-progress button[aria-current="step"] {
  background: rgba(255, 255, 255, 0.95);
  transform: scaleX(1.65);
  transform-origin: 100% 50%;
}

.replay-button {
  position: absolute;
  z-index: 9;
  top: max(18px, env(safe-area-inset-top));
  right: clamp(18px, 4vw, 58px);
  min-width: 112px;
  padding: 12px 21px;
  font-size: 14px;
  font-weight: 680;
}

.replay-button:active {
  transform: scale(0.98) translateY(1px);
}

.status-panel {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100vw - 40px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--glass-solid);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.status-panel--loading {
  z-index: 8;
}

.status-panel--error {
  z-index: 14;
}

.status-title {
  margin: 12px 0 0;
  color: var(--text);
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 620;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.status-panel--error .control-button {
  margin-top: 22px;
}

.loading-line {
  position: relative;
  width: 100%;
  height: 2px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: var(--button-radius);
  background: rgba(255, 255, 255, 0.14);
}

.loading-line i {
  position: absolute;
  inset: 0;
  display: block;
  background: rgba(255, 255, 255, 0.94);
  transform: scaleX(0.04);
  transform-origin: 0 50%;
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.experience.is-ready .status-panel--loading {
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, -46%) scale(0.98);
  transition:
    opacity 480ms ease,
    visibility 0s linear 480ms,
    transform 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

.experience.is-loading .story-copy,
.experience.is-loading .scene-progress,
.experience.is-loading .topbar {
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .story-copy,
  .control-button,
  .replay-button,
  .other-projects-link,
  .status-panel {
    background: var(--glass-solid);
  }
}

@media (max-width: 767px) {
  .topbar {
    height: 66px;
    padding-inline: 16px;
  }

  .wordmark {
    font-size: 17px;
  }

  .topbar-actions {
    margin-right: 112px;
    gap: 13px;
  }

  .language-toggle,
  .download-link {
    font-size: 11px;
  }

  .control-button {
    min-width: 94px;
    min-height: 38px;
    padding-inline: 15px;
    font-size: 12px;
  }

  #play-toggle {
    width: min(350px, calc(100vw - 40px));
    height: 112px;
    font-size: 40px;
  }

  .hero-gate__title {
    top: 39%;
    font-size: clamp(64px, 20vw, 92px);
  }

  .experience:not(.has-started) #play-toggle {
    top: 61%;
  }

  .experience.is-playing #play-toggle {
    top: max(42px, calc(env(safe-area-inset-top) + 19px));
    left: calc(100% - 63px);
    width: 94px;
    height: 38px;
    min-height: 38px;
    padding-inline: 15px;
    font-size: 12px;
  }

  .story-copy {
    height: max(112px, calc(96px + env(safe-area-inset-bottom)));
    min-height: 0;
    padding: 0 18px env(safe-area-inset-bottom);
  }

  .story-copy[data-width="center"] {
    left: 12px;
    width: calc(100vw - 24px);
  }

  .story-copy h1 {
    font-size: clamp(48px, 15vw, 68px);
  }

  .film-grain {
    opacity: 0.035;
  }

  .other-projects-link {
    width: calc(100vw - 32px);
    min-height: 168px;
    padding: 24px 16px;
    border-radius: 36px;
    font-size: clamp(38px, 10.8vw, 50px);
    letter-spacing: -0.075em;
    white-space: nowrap;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .topbar {
    height: 58px;
    padding-top: 12px;
  }

  .hero-gate__title {
    top: 34%;
    font-size: clamp(64px, 13vw, 128px);
  }

  .experience:not(.has-started) #play-toggle {
    top: 69%;
    height: 84px;
  }

  .story-copy {
    height: 88px;
    min-height: 0;
    padding: 0 20px env(safe-area-inset-bottom);
  }

  .story-copy h1 {
    font-size: clamp(40px, 9vw, 68px);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .story-copy,
  .control-button,
  .replay-button,
  .other-projects-link,
  .status-panel {
    background: var(--glass-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .film-grain {
    display: none;
  }
}
