:root {
  --ink: #0b0d0c;
  --charcoal: #111513;
  --fog: #879087;
  --mist: #b0b6aa;
  --paper: #ded2b9;
  --amber: #d19045;
  --red: #7e302b;
  --red-bright: #9e4036;
  --line: rgba(222, 210, 185, 0.28);
  --ui: "Courier New", Courier, monospace;
  --display: "Arial Narrow", "Aptos Narrow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--charcoal);
  color: var(--paper);
}

body {
  font-family: var(--ui);
  text-rendering: optimizeSpeed;
}

button,
a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

[hidden] { display: none !important; }

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

.skip-link {
  position: fixed;
  z-index: 200;
  top: 14px;
  left: 14px;
  padding: 10px 14px;
  transform: translateY(-180%);
  border: 1px solid var(--charcoal);
  background: var(--paper);
  color: var(--charcoal);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}

.experience {
  position: fixed;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  background: #242a26;
  cursor: default;
}

.experience.has-entered .webgl-stage { cursor: grab; }
.experience.has-entered .webgl-stage.is-dragging { cursor: grabbing; }

.fallback-scene,
.fallback-scene::after,
.fallback-scene img,
.webgl-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fallback-scene {
  z-index: -10;
  margin: 0;
  background: #242a26;
  transition: opacity 1.2s ease;
}

.fallback-scene::after {
  content: "";
  background:
    linear-gradient(90deg, rgba(10, 13, 12, 0.6), transparent 52%),
    linear-gradient(180deg, rgba(12, 15, 14, 0.24), rgba(10, 12, 11, 0.58));
}

.fallback-scene img {
  object-fit: cover;
  object-position: center;
  filter: saturate(0.64) contrast(1.08) brightness(0.76) sepia(0.06);
}

.webgl-stage {
  z-index: -8;
  opacity: 0;
  outline: 0;
  background: transparent;
  transition: opacity 1.1s ease;
  touch-action: none;
}

.webgl-stage:focus-visible {
  outline: 2px solid rgba(222, 210, 185, 0.74);
  outline-offset: -7px;
}

.webgl-stage canvas {
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: contrast(1.07) saturate(0.84) brightness(0.98);
}

.experience.is-ready .webgl-stage { opacity: 1; }
.experience.is-ready .fallback-scene { opacity: 0; }

.post-fx {
  position: absolute;
  z-index: 30;
  inset: 0;
  pointer-events: none;
}

.post-fx--dither {
  opacity: 0.03;
  background-image:
    linear-gradient(45deg, rgba(210, 218, 201, 0.45) 25%, transparent 25%, transparent 75%, rgba(210, 218, 201, 0.45) 75%),
    linear-gradient(45deg, rgba(210, 218, 201, 0.35) 25%, transparent 25%, transparent 75%, rgba(210, 218, 201, 0.35) 75%);
  background-position: 0 0, 2px 2px;
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
}

.post-fx--scanlines {
  opacity: 0.018;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(5, 7, 6, 0.32) 3px 4px);
  mix-blend-mode: multiply;
}

.post-fx--vignette {
  background:
    radial-gradient(ellipse at center, transparent 38%, rgba(5, 8, 7, 0.18) 70%, rgba(3, 5, 4, 0.82) 118%),
    linear-gradient(180deg, rgba(2, 4, 3, 0.2), transparent 24%, transparent 72%, rgba(2, 4, 3, 0.36));
}

.post-fx--grain {
  inset: -50%;
  width: 200%;
  height: 200%;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.78'/%3E%3C/svg%3E");
  animation: grain 0.16s steps(2, end) infinite;
  mix-blend-mode: screen;
}

@keyframes grain {
  0% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(2%, -1%, 0); }
  40% { transform: translate3d(-1%, 2%, 0); }
  60% { transform: translate3d(1%, 1%, 0); }
  80% { transform: translate3d(-2%, -1%, 0); }
  100% { transform: translate3d(1%, -2%, 0); }
}

.loading-screen {
  position: absolute;
  z-index: 90;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: #111513;
  color: rgba(222, 210, 185, 0.6);
  transition: opacity 700ms ease, visibility 700ms ease;
}

.loading-screen p {
  margin: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.loading-screen__mark {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 28px;
}

.loading-screen__mark i {
  display: block;
  width: 3px;
  height: 9px;
  background: var(--amber);
  animation: load-bars 1.1s steps(3) infinite;
}

.loading-screen__mark i:nth-child(2) { animation-delay: -0.35s; }
.loading-screen__mark i:nth-child(3) { animation-delay: -0.7s; }

@keyframes load-bars {
  0%, 100% { height: 7px; opacity: 0.4; }
  50% { height: 26px; opacity: 1; }
}

.experience.is-ready .loading-screen {
  visibility: hidden;
  opacity: 0;
}

.no-js .loading-screen,
.webgl-failed .loading-screen { display: none; }

.hud-header {
  position: absolute;
  z-index: 50;
  top: max(22px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 24px;
}

.wordmark {
  position: relative;
  display: grid;
  color: var(--paper);
  font-family: var(--display);
  font-size: 18px;
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 0.79;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.wordmark::before,
.wordmark::after {
  position: absolute;
  left: -11px;
  width: 5px;
  height: 2px;
  content: "";
  background: var(--red-bright);
}

.wordmark::before { top: 2px; }
.wordmark::after { bottom: 1px; }

.signal {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: rgba(222, 210, 185, 0.56);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.signal i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #697169;
}

.is-ready .signal i {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(209, 144, 69, 0.65);
}

.hud-actions {
  position: absolute;
  z-index: 55;
  top: max(20px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
}

.hud-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(222, 210, 185, 0.24);
  background: rgba(11, 14, 12, 0.48);
  color: rgba(222, 210, 185, 0.72);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.hud-button:hover {
  border-color: rgba(222, 210, 185, 0.6);
  color: var(--paper);
}

kbd {
  min-width: 19px;
  padding: 3px 5px;
  border: 1px solid rgba(222, 210, 185, 0.28);
  border-radius: 0;
  background: rgba(222, 210, 185, 0.05);
  color: inherit;
  font-family: var(--ui);
  font-size: 9px;
  text-align: center;
}

.sound-meter {
  display: flex;
  width: 13px;
  height: 12px;
  align-items: center;
  gap: 2px;
}

.sound-meter i {
  display: block;
  width: 2px;
  height: 3px;
  background: currentColor;
}

.sound-button[aria-pressed="true"] { color: var(--amber); }

.sound-button[aria-pressed="true"] .sound-meter i {
  animation: meter 1.2s steps(3) infinite;
}

.sound-button[aria-pressed="true"] .sound-meter i:nth-child(2) { animation-delay: -0.4s; }
.sound-button[aria-pressed="true"] .sound-meter i:nth-child(3) { animation-delay: -0.8s; }

@keyframes meter {
  0%, 100% { height: 3px; }
  50% { height: 11px; }
}

.project-info {
  position: absolute;
  z-index: 45;
  bottom: max(52px, calc(env(safe-area-inset-bottom) + 30px));
  left: max(24px, env(safe-area-inset-left));
  max-width: 320px;
  padding-left: 14px;
  border-left: 2px solid var(--red-bright);
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
  transition: opacity 500ms ease, transform 500ms ease;
}

.project-info p {
  margin: 0 0 7px;
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.project-info h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.8rem, 5vw, 5.4rem);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.78;
  text-transform: uppercase;
}

.project-info > span {
  display: block;
  margin-top: 12px;
  color: rgba(222, 210, 185, 0.66);
  font-size: 11px;
}

.has-entered .project-info {
  max-width: 240px;
}

.has-entered .project-info h1 {
  font-size: clamp(2.15rem, 3vw, 3.25rem);
}

.experience:not(.has-entered) .project-info {
  opacity: 0.62;
  transform: translateY(8px);
}

.entry-gate {
  position: absolute;
  z-index: 60;
  top: 50%;
  right: clamp(24px, 8vw, 130px);
  width: min(390px, calc(100vw - 48px));
  padding: 31px 32px 29px;
  transform: translateY(-45%);
  border: 1px solid rgba(222, 210, 185, 0.26);
  background: rgba(10, 13, 12, 0.68);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  transition: opacity 450ms ease, transform 450ms ease, visibility 450ms;
}

.entry-gate::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 36%;
  height: 2px;
  content: "";
  background: var(--red-bright);
}

.entry-gate__index {
  margin: 0 0 16px;
  color: var(--amber);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.entry-gate h2 {
  margin: 0 0 17px;
  font-family: var(--display);
  font-size: clamp(3.2rem, 4.4vw, 4.15rem);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.79;
  text-transform: uppercase;
}

.entry-gate > p:not(.entry-gate__index) {
  max-width: 310px;
  margin: 0 0 24px;
  color: rgba(222, 210, 185, 0.61);
  font-size: 10px;
  line-height: 1.65;
}

.enter-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px 11px 17px;
  border: 1px solid var(--paper);
  background: var(--paper);
  color: var(--charcoal);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.enter-button:hover {
  background: #eee4d0;
  box-shadow: 0 0 24px rgba(222, 210, 185, 0.13);
}

.enter-button kbd {
  border-color: rgba(17, 21, 19, 0.3);
  background: rgba(17, 21, 19, 0.06);
}

.has-entered .entry-gate {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-40%);
}

.controls-panel {
  position: absolute;
  z-index: 75;
  top: 76px;
  right: max(24px, env(safe-area-inset-right));
  width: min(335px, calc(100vw - 48px));
  padding: 23px;
  border: 1px solid rgba(222, 210, 185, 0.28);
  background: rgba(10, 13, 12, 0.88);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.controls-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(222, 210, 185, 0.15);
}

.controls-panel__header p {
  margin: 0;
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.controls-panel__header button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(222, 210, 185, 0.22);
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-size: 18px;
}

.controls-panel dl { margin: 0; }

.controls-panel dl div {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px dotted rgba(222, 210, 185, 0.13);
}

.controls-panel dt,
.controls-panel dd {
  margin: 0;
  color: rgba(222, 210, 185, 0.64);
  font-size: 10px;
}

.controls-panel dd {
  color: var(--paper);
  text-transform: uppercase;
}

.controls-panel > p {
  margin: 18px 0 0;
  color: rgba(222, 210, 185, 0.4);
  font-size: 10px;
  line-height: 1.6;
}

.control-hint {
  position: absolute;
  z-index: 45;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 13px;
  transform: translate(-50%, 12px);
  opacity: 0;
  color: rgba(222, 210, 185, 0.55);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: opacity 450ms ease 450ms, transform 450ms ease 450ms;
}

.control-hint i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--amber);
}

.has-entered .control-hint {
  transform: translate(-50%, 0);
  opacity: 1;
}

.touch-controls {
  position: absolute;
  z-index: 60;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: none;
  grid-template: repeat(2, 48px) / repeat(3, 48px);
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease 350ms;
}

.touch-controls button {
  border: 1px solid rgba(222, 210, 185, 0.28);
  background: rgba(10, 13, 12, 0.52);
  color: rgba(222, 210, 185, 0.7);
  touch-action: none;
  backdrop-filter: blur(6px);
}

.touch-controls button:active,
.touch-controls button.is-active {
  border-color: var(--amber);
  color: var(--amber);
}

.touch-controls button:nth-child(1) { grid-area: 1 / 2; }
.touch-controls button:nth-child(2) { grid-area: 2 / 1; }
.touch-controls button:nth-child(3) { grid-area: 2 / 2; }
.touch-controls button:nth-child(4) { grid-area: 2 / 3; }

.fallback-note,
.noscript-note {
  position: absolute;
  z-index: 70;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(28px, env(safe-area-inset-bottom));
  width: min(310px, calc(100vw - 48px));
  margin: 0;
  padding: 13px 15px;
  border-left: 2px solid var(--amber);
  background: rgba(10, 13, 12, 0.72);
  color: rgba(222, 210, 185, 0.68);
  font-size: 10px;
  line-height: 1.6;
}

.fallback-note { display: none; }
.webgl-failed .fallback-note { display: block; }

.scene-footer {
  position: absolute;
  z-index: 45;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(17px, env(safe-area-inset-bottom));
  display: flex;
  gap: 16px;
  color: rgba(222, 210, 185, 0.3);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.webgl-failed .entry-gate,
.webgl-failed .hud-actions,
.webgl-failed .control-hint,
.webgl-failed .touch-controls,
.no-js .entry-gate,
.no-js .hud-actions,
.no-js .control-hint,
.no-js .touch-controls,
.no-js .webgl-stage { display: none; }

.experience.webgl-failed .project-info,
.no-js .experience .project-info {
  opacity: 1;
  transform: none;
}

.webgl-failed .signal span,
.no-js .signal span { font-size: 0; }
.webgl-failed .signal span::after,
.no-js .signal span::after { content: "Still scene"; font-size: 9px; }

@media (pointer: coarse), (max-width: 760px) {
  .has-entered .touch-controls {
    display: grid;
    opacity: 1;
    pointer-events: auto;
  }

  .has-entered .control-hint { display: none; }
}

@media (max-width: 720px) {
  .fallback-scene img { object-position: 69% center; }

  .hud-header {
    top: max(17px, env(safe-area-inset-top));
    left: max(17px, env(safe-area-inset-left));
  }

  .wordmark { font-size: 15px; }
  .signal { display: none; }

  .hud-actions {
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
  }

  .hud-button {
    min-width: 43px;
    min-height: 43px;
    justify-content: center;
    padding: 8px;
  }

  .hud-button > span:not(.sound-meter),
  .hud-button:not(.sound-button) { font-size: 0; }

  .hud-button:not(.sound-button)::before {
    content: "?";
    font-size: 11px;
  }

  .hud-button kbd { display: none; }

  .entry-gate {
    top: auto;
    right: 16px;
    bottom: max(138px, calc(env(safe-area-inset-bottom) + 112px));
    left: 16px;
    width: auto;
    padding: 24px 22px 22px;
    transform: none;
  }

  .entry-gate h2 {
    font-size: clamp(3.1rem, 14vw, 3.75rem);
  }

  .has-entered .entry-gate { transform: translateY(12px); }

  .project-info {
    bottom: max(24px, env(safe-area-inset-bottom));
    left: max(16px, env(safe-area-inset-left));
    max-width: 215px;
  }

  .project-info h1 { font-size: 2.7rem; }

  .has-entered .project-info {
    bottom: max(25px, env(safe-area-inset-bottom));
    max-width: 180px;
  }

  .has-entered .project-info h1 { font-size: 2rem; }
  .has-entered .project-info > span { display: none; }

  .controls-panel {
    top: 67px;
    right: 14px;
    width: min(330px, calc(100vw - 28px));
  }

  .scene-footer { display: none; }

  .fallback-note,
  .noscript-note {
    right: 16px;
    bottom: 20px;
    left: 16px;
    width: auto;
  }

  .experience.webgl-failed .project-info,
  .no-js .experience .project-info {
    bottom: max(132px, calc(env(safe-area-inset-bottom) + 112px));
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  .entry-gate {
    top: 50%;
    right: 30px;
    bottom: auto;
    left: auto;
    width: min(340px, calc(100vw - 60px));
    max-height: calc(100dvh - 88px);
    padding: 18px 22px;
    overflow-y: auto;
    transform: translateY(-50%);
  }

  .entry-gate__index { margin-bottom: 10px; }
  .entry-gate h2 {
    margin-bottom: 10px;
    font-size: 2.55rem;
  }
  .entry-gate > p:not(.entry-gate__index) {
    margin-bottom: 12px;
    font-size: 9px;
    line-height: 1.4;
  }
  .entry-gate .enter-button { min-height: 44px; }
  .has-entered .entry-gate { transform: translateY(-46%); }
  .project-info h1 { font-size: 2.4rem; }

  .controls-panel {
    max-height: calc(100dvh - 81px - env(safe-area-inset-bottom));
    overflow-y: auto;
  }
}

@media (max-width: 360px) {
  .has-entered .project-info {
    max-width: calc(100vw - 194px);
  }

  .has-entered .project-info p { display: none; }
  .has-entered .project-info h1 { font-size: 1.55rem; }
}

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

  .post-fx--grain {
    animation: none !important;
    transform: none;
  }
}

@media (prefers-contrast: more) {
  .entry-gate,
  .controls-panel,
  .hud-button { background: rgba(5, 7, 6, 0.94); }

  .entry-gate > p:not(.entry-gate__index),
  .project-info > span { color: var(--paper); }
}
