:root {
  color: #f5efe4;
  background: #080403;
  font-family: "Special Elite", ui-serif, Georgia, serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body,
#root {
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
  background: #060606;
}

body.is-modal-open {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

.scene-shell {
  position: relative;
  min-height: 185vh;
  min-height: 185svh;
  overflow: visible;
  isolation: isolate;
  background: #060606;
}

.corridor-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #060606;
}

.scene-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.depth-scene-canvas,
.depth-scene-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.depth-scene-canvas {
  display: block;
  cursor: crosshair;
}

.depth-scene-fallback {
  object-fit: cover;
  filter: brightness(0.88) contrast(1.08) saturate(0.78);
  pointer-events: none;
}

.scene-depth-shadow {
  z-index: 4;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 0 24%, rgba(0, 0, 0, 0.12) 52%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.62), transparent 20%, transparent 82%, rgba(0, 0, 0, 0.6)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 34%, rgba(0, 0, 0, 0.06) 78%, rgba(0, 0, 0, 0.22));
}

.scene-light {
  z-index: 5;
  top: 0;
  left: 50%;
  width: 18vw;
  height: 62vh;
  transform-origin: 50% 0;
  background: radial-gradient(ellipse at 50% 0, rgba(244, 250, 255, 0.42), rgba(208, 223, 232, 0.12) 34%, transparent 72%);
  filter: blur(18px);
  mix-blend-mode: screen;
  opacity: 0.5;
  animation: lightBreath 7.4s ease-in-out infinite;
}

.scene-light-one {
  transform: translateX(-51%) translateY(10vh) rotate(0deg);
}

.scene-light-two {
  width: 13vw;
  height: 42vh;
  opacity: 0.32;
  transform: translateX(-51%) translateY(28vh) scaleX(0.72);
  animation-delay: -1.4s;
}

.scene-light-three {
  width: 9vw;
  height: 32vh;
  opacity: 0.24;
  transform: translateX(-51%) translateY(38vh) scaleX(0.58);
  animation-delay: -2.8s;
}

.scene-red-sigil {
  z-index: 6;
  left: 30%;
  right: 30%;
  top: 70%;
  bottom: 0;
  background: radial-gradient(ellipse at 50% 12%, rgba(122, 15, 10, 0.38), rgba(122, 15, 10, 0.12) 38%, transparent 70%);
  filter: blur(18px);
  mix-blend-mode: screen;
  animation: sigilHeat 10s ease-in-out infinite;
}

.scene-film {
  z-index: 11;
  opacity: 0.14;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
  animation: grainJitter 1.8s steps(2, end) infinite;
}

.scene-coords-helper {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 80;
  padding: 6px 8px;
  color: #f3e2bd;
  border: 1px solid rgba(211, 182, 119, 0.45);
  border-radius: 4px;
  background: rgba(5, 4, 3, 0.78);
  font: 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  pointer-events: none;
}

.scene-menu {
  position: fixed;
  left: 12px;
  top: 50%;
  z-index: 20;
  width: clamp(222px, 18.6vw, 318px);
  aspect-ratio: 941 / 1672;
  padding: 0;
  transform: translateY(-50%);
  color: #f4ead4;
  filter: drop-shadow(0 20px 70px rgba(0, 0, 0, 0.82));
}

.menu-panel {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 2px;
  opacity: 0.92;
  pointer-events: none;
  user-select: none;
}

.menu-logo {
  position: absolute;
  left: 11.5%;
  top: 7.6%;
  z-index: 2;
  width: 73%;
  height: auto;
  opacity: 0.88;
  filter:
    sepia(0.28)
    saturate(0.72)
    brightness(0.86)
    contrast(1.22)
    drop-shadow(0 7px 13px rgba(0, 0, 0, 0.94))
    drop-shadow(0 0 9px rgba(126, 72, 38, 0.18));
  mix-blend-mode: screen;
}

.menu-meta {
  position: absolute;
  left: 14%;
  top: 25.8%;
  z-index: 2;
  display: grid;
  gap: 0.42em;
  width: 68%;
  color: #ead9bc;
  font-family: "Special Elite", ui-serif, Georgia, serif;
  font-size: clamp(0.72rem, 0.9vw, 0.96rem);
  line-height: 1.15;
  text-align: center;
  text-transform: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.94);
}

.menu-list {
  position: absolute;
  left: 0;
  top: 39.5%;
  z-index: 3;
  width: 100%;
  height: 38%;
}

.menu-item,
.icon-button {
  display: inline-flex;
  align-items: center;
  border: 0;
  color: #fff2d4;
  background: transparent;
  cursor: pointer;
}

.menu-item {
  position: absolute;
  left: 15%;
  align-items: center;
  justify-content: flex-start;
  width: 68%;
  height: 12%;
  padding: 0 8% 0 13.5%;
  color: rgba(238, 225, 197, 0.92);
  font-family: "Special Elite", ui-serif, Georgia, serif;
  font-size: clamp(1.02rem, 1.42vw, 1.46rem);
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  overflow: visible;
  isolation: isolate;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
  transition: color 220ms ease, text-shadow 220ms ease;
}

.menu-label {
  display: block;
  transform: translateY(0.02em);
}

.menu-item::before,
.menu-item::after {
  content: none;
}

.menu-item-selected,
.menu-item:hover,
.menu-item:focus-visible {
  color: #fff7df;
  outline: 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 1);
}

.menu-item:nth-child(1) {
  top: 0;
}

.menu-item:nth-child(2) {
  top: 19.4%;
}

.menu-item:nth-child(3) {
  top: 38.8%;
}

.menu-item:nth-child(4) {
  top: 58.2%;
}

.menu-item:nth-child(5) {
  top: 77.6%;
}

.scene-card-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: auto;
}

.scene-transmission-layer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 18px;
}

.scene-card {
  --card-border-width: 0;
  --card-border-image: none;
  --card-border-slice: 0;
  --card-padding: 0;
  --card-background: transparent;
  position: relative;
  color: #f7edd7;
  border: var(--card-border-width) solid transparent;
  border-image-source: var(--card-border-image);
  border-image-slice: var(--card-border-slice);
  border-image-width: var(--card-border-width);
  border-image-repeat: stretch;
  border-radius: 0;
  padding: var(--card-padding);
  background: var(--card-background);
  background-clip: padding-box;
  overflow: hidden;
}

.scene-card::before,
.scene-card::after {
  content: none;
}

.scene-card > * {
  position: relative;
  z-index: 1;
}

.transmission-modal {
  --card-border-width: clamp(14px, 1.8vw, 24px);
  --card-border-image: url('../ui/modal-frame-simple-video.png');
  --card-border-slice: 92 60 92 60 fill;
  --card-padding: 10px 10px 12px;
  --card-background: linear-gradient(180deg, rgba(16, 10, 7, 0.72), rgba(5, 4, 3, 0.88));
  width: min(372px, calc(100vw - 28px));
  margin-right: min(7vw, 94px);
}

.scene-bio-layer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.transmission-header {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  min-height: 0;
  margin-bottom: 8px;
  padding: 0;
}

.transmission-screen {
  position: relative;
  aspect-ratio: 9 / 16;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(107, 70, 37, 0.42);
  border-radius: 2px;
  background: #020202;
}

.transmission-screen::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.32), transparent 13%, transparent 84%, rgba(0, 0, 0, 0.42)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.18));
  mix-blend-mode: overlay;
}

.transmission-screen iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.bio-modal {
  --card-border-width: clamp(14px, 1.9vw, 24px);
  --card-border-image: url('../ui/modal-frame-simple-wide.png');
  --card-border-slice: 72 72 72 72 fill;
  --card-padding: 14px 18px 16px;
  --card-background: linear-gradient(180deg, rgba(22, 15, 11, 0.88), rgba(7, 5, 4, 0.95));
  width: min(820px, 100%);
  height: min(70svh, 610px);
  max-height: calc(100svh - 40px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.bio-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  justify-content: flex-end;
  padding: 0 0 8px;
  border-bottom: 0;
}

.icon-button {
  justify-content: center;
  border: 0;
  background: rgba(8, 5, 3, 0.18);
  backdrop-filter: blur(6px);
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 5px;
  color: rgba(245, 226, 188, 0.9);
}

.icon-button:hover,
.icon-button:focus-visible {
  color: #fff3d1;
  background: rgba(36, 18, 11, 0.36);
  outline: 0;
}

.bio-copy {
  min-height: 0;
  overflow: hidden auto;
  padding: 0 12px 0 0;
  color: #e9dcc4;
  line-height: 1.62;
  scrollbar-color: rgba(202, 172, 111, 0.62) rgba(11, 7, 5, 0.7);
  scrollbar-width: thin;
}

.bio-copy::-webkit-scrollbar {
  width: 8px;
}

.bio-copy::-webkit-scrollbar-track {
  background: rgba(11, 7, 5, 0.72);
}

.bio-copy::-webkit-scrollbar-thumb {
  border: 2px solid rgba(11, 7, 5, 0.72);
  border-radius: 999px;
  background: rgba(202, 172, 111, 0.62);
}

.bio-copy p {
  margin: 0 0 1rem;
}

@keyframes lightBreath {
  0%, 100% { opacity: 0.38; }
  12% { opacity: 0.74; }
  19% { opacity: 0.34; }
  27% { opacity: 0.82; }
  41% { opacity: 0.46; }
  58% { opacity: 0.78; }
  72% { opacity: 0.36; }
  86% { opacity: 0.68; }
}

@keyframes sigilHeat {
  0%,
  100% {
    opacity: 0.28;
    transform: scaleX(1);
  }

  50% {
    opacity: 0.46;
    transform: scaleX(1.035);
  }
}

@keyframes grainJitter {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-1%, 1%, 0);
  }
}

@media (max-width: 767px) {
  .scene-shell {
    min-height: 260vh;
    min-height: 260svh;
  }

  .depth-scene-canvas,
  .depth-scene-fallback {
    width: 100vw;
    height: 100svh;
  }

  .depth-scene-fallback {
    object-fit: fill;
  }

  .scene-menu {
    left: 8px;
    top: auto;
    bottom: 8px;
    width: min(184px, calc(100vw - 18px));
    transform: none;
  }

  .menu-logo {
    left: 11.5%;
    top: 7.6%;
    width: 73%;
    margin: 0;
  }

  .menu-meta {
    font-size: clamp(0.48rem, 1.72vw, 0.58rem);
  }

  .menu-list {
    left: 0;
    top: 39.5%;
    width: 100%;
    height: 38%;
  }

  .menu-item {
    left: 15%;
    width: 68%;
    height: 12%;
    padding: 0 7% 0 13.5%;
    font-size: clamp(0.66rem, 3.3vw, 0.82rem);
  }

  .transmission-modal {
    width: min(318px, calc(100vw - 22px));
    margin-inline: auto;
  }

  .bio-modal {
    width: min(100%, calc(100vw - 22px));
    height: min(76svh, 620px);
  }
}

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

  .depth-scene-canvas {
    cursor: default;
  }
}
