:root {
  color-scheme: dark;
  --cream: #f0e4cf;
  --muted: #b7aa96;
  --gold: #c89b4d;
  --gold-bright: #efc979;
  --green: #9cc875;
  --night: #070605;
  --panel: rgba(12, 9, 7, 0.94);
  --line: rgba(225, 190, 120, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #020202;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
audio {
  font: inherit;
}

button {
  color: inherit;
}

.experience,
.stage-shell {
  width: 100vw;
  height: 100vh;
}

.stage-shell {
  display: grid;
  place-items: center;
  background: #020202;
}

.stage {
  position: relative;
  width: min(100vw, 177.7778vh);
  height: min(100vh, 56.25vw);
  overflow: hidden;
  background: var(--night);
  isolation: isolate;
  user-select: none;
}

.room-frame-stack,
.room-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.room-frame {
  z-index: 1;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.012);
  transition: opacity 430ms ease, transform 650ms cubic-bezier(0.2, 0.68, 0.2, 1);
}

.room-frame.is-active {
  opacity: 1;
  transform: scale(1);
}

.stage.is-turning-left .room-frame:not(.is-active) {
  transform: translateX(-1.5%) scale(1.015);
}

.stage.is-turning-right .room-frame:not(.is-active) {
  transform: translateX(1.5%) scale(1.015);
}

.world-layer {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  background: #071014;
  box-shadow: inset 0 0 1.5vw rgba(0, 0, 0, 0.58);
}

.stage[data-view="front-level"] .world-layer {
  opacity: 1;
}

.world-layer--city {
  left: 20.65%;
  top: 18.65%;
  width: 26.05%;
  height: 47.15%;
}

.world-layer--underwater {
  left: 52.7%;
  top: 18.65%;
  width: 27.5%;
  height: 47.15%;
}

.world-layer img,
.world-layer video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.world-layer--city .world-still {
  object-position: 58% center;
}

.world-layer--underwater .world-still {
  object-position: center;
}

.world-layer.has-video .world-still {
  opacity: 0;
}

.world-layer .world-still {
  transition: opacity 180ms ease;
}

.stage.is-playing-interaction[data-view="front-level"] .world-layer {
  z-index: 5;
  opacity: 1;
}

.interaction-video-layer {
  position: absolute;
  z-index: 4;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: transparent;
  transition: opacity 220ms ease;
}

.interaction-video-layer.is-visible {
  opacity: 1;
}

.stage.is-playing-interaction .nav-zone {
  pointer-events: none;
}

.interaction-video-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.paris-glow,
.caustics {
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
}

.paris-glow {
  background: radial-gradient(circle at 67% 23%, rgba(255, 206, 105, 0.19), transparent 22%);
  animation: beacon 7s ease-in-out infinite;
}

.caustics {
  opacity: 0.22;
  background:
    radial-gradient(ellipse at 25% 0, rgba(114, 226, 241, 0.42), transparent 27%),
    radial-gradient(ellipse at 78% 6%, rgba(66, 195, 221, 0.32), transparent 34%);
  filter: blur(10px);
  animation: caustic-sway 8s ease-in-out infinite alternate;
}

.bubble {
  position: absolute;
  bottom: -12%;
  width: 0.5vw;
  aspect-ratio: 1;
  border: 1px solid rgba(194, 239, 244, 0.65);
  border-radius: 50%;
  opacity: 0;
  animation: bubble-rise 9s ease-in infinite;
}

.bubble--1 { left: 23%; animation-delay: -2s; }
.bubble--2 { left: 68%; width: 0.35vw; animation-delay: -6s; }
.bubble--3 { left: 82%; width: 0.7vw; animation-delay: -4s; }

.manta-shadow {
  position: absolute;
  top: 20%;
  left: -32%;
  width: 31%;
  height: 12%;
  border-radius: 100% 12% 100% 12%;
  opacity: 0.11;
  background: #001419;
  filter: blur(7px);
  transform: skewX(-23deg);
  animation: manta-pass 22s linear infinite;
}

.world-layer--underwater.is-resetting {
  animation: feed-reset 320ms steps(2, end);
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  pointer-events: auto;
  background: transparent;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.hotspot::before,
.hotspot::after {
  position: absolute;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.hotspot::before {
  inset: 0;
  border: 1px solid rgba(236, 203, 133, 0.78);
  border-radius: inherit;
  content: "";
  box-shadow: inset 0 0 2vw rgba(222, 181, 100, 0.08), 0 0 1.4vw rgba(0, 0, 0, 0.48);
}

.hotspot::after {
  left: 50%;
  bottom: 9px;
  padding: 5px 8px;
  border: 1px solid rgba(222, 190, 124, 0.35);
  color: var(--cream);
  background: rgba(6, 5, 4, 0.82);
  content: attr(data-label);
  font-size: clamp(7px, 0.65vw, 11px);
  font-weight: 750;
  letter-spacing: 0.13em;
  white-space: nowrap;
  transform: translate(-50%, 6px);
}

.hotspot:hover::before,
.hotspot:hover::after,
.hotspot:focus-visible::before,
.hotspot:focus-visible::after {
  opacity: 1;
}

.hotspot:hover::after,
.hotspot:focus-visible::after {
  transform: translate(-50%, 0);
}

.hotspot.is-discovered::before {
  opacity: 0.7;
  border-color: rgba(149, 199, 112, 0.78);
  box-shadow: inset 0 0 2vw rgba(113, 181, 86, 0.09), 0 0 1vw rgba(77, 139, 66, 0.15);
}

.hotspot.is-video-clue::after {
  display: none;
}

.nav-zone {
  position: absolute;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  outline: 0;
  color: rgba(241, 224, 192, 0.58);
  cursor: pointer;
  background: transparent;
  opacity: 0;
  transition: opacity 180ms ease, background 180ms ease;
}

.nav-zone:hover,
.nav-zone:focus-visible,
.nav-zone.is-dwelling {
  opacity: 1;
}

.nav-zone span {
  position: relative;
  z-index: 2;
  font-size: clamp(8px, 0.62vw, 11px);
  font-weight: 760;
  letter-spacing: 0.18em;
}

.nav-zone i {
  position: absolute;
  display: block;
  background: rgba(217, 175, 91, 0.55);
  transform-origin: left center;
}

.nav-zone.is-dwelling i {
  animation: dwell-progress 520ms linear forwards;
}

.nav-zone--left,
.nav-zone--right {
  top: 16%;
  bottom: 11%;
  width: 8%;
  background: linear-gradient(90deg, rgba(3, 3, 3, 0.54), transparent);
}

.nav-zone--left { left: 0; }
.nav-zone--right { right: 0; transform: scaleX(-1); }
.nav-zone--right span { transform: scaleX(-1); }

.nav-zone--left i,
.nav-zone--right i {
  left: 20%;
  bottom: 25%;
  width: 60%;
  height: 1px;
}

.nav-zone--up,
.nav-zone--down {
  right: 10%;
  left: 10%;
  height: 12%;
  background: linear-gradient(180deg, rgba(3, 3, 3, 0.46), transparent);
}

.nav-zone--up { top: 0; }
.nav-zone--down { bottom: 0; transform: scaleY(-1); }
.nav-zone--down span { transform: scaleY(-1); }

.nav-zone--up i,
.nav-zone--down i {
  bottom: 21%;
  left: 40%;
  width: 20%;
  height: 1px;
}

.nav-zone.is-disabled {
  display: none;
}

.topbar {
  position: absolute;
  z-index: 12;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 20px;
  padding: clamp(13px, 1.7vw, 28px) clamp(14px, 2vw, 34px);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 3, 3, 0.72), transparent);
}

.eyebrow {
  color: var(--gold-bright);
  font-size: clamp(7px, 0.65vw, 11px);
  font-weight: 800;
  letter-spacing: 0.2em;
}

.hotel-mark h1 {
  margin: 3px 0 0;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(16px, 1.9vw, 31px);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.view-readout {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 4px;
  padding-top: 3px;
  color: rgba(239, 228, 209, 0.72);
  font-size: clamp(7px, 0.58vw, 10px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.view-readout strong {
  color: var(--cream);
  font-size: clamp(8px, 0.72vw, 12px);
  font-weight: 690;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
}

.icon-button,
.cycle-readout {
  min-height: 34px;
  border: 1px solid rgba(222, 190, 124, 0.24);
  color: rgba(241, 228, 204, 0.8);
  background: rgba(7, 5, 4, 0.67);
  backdrop-filter: blur(12px);
  font-size: clamp(7px, 0.62vw, 10px);
  font-weight: 760;
  letter-spacing: 0.11em;
}

.icon-button {
  padding: 0 12px;
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(233, 199, 130, 0.66);
  color: var(--cream);
}

.cycle-readout {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

.cycle-readout.is-visible {
  display: flex;
}

.cycle-readout strong {
  color: var(--gold-bright);
  font-size: 1.25em;
}

.opening-message {
  position: absolute;
  z-index: 14;
  top: 50%;
  left: 50%;
  width: min(540px, 48%);
  padding: clamp(15px, 2vw, 28px);
  border: 1px solid rgba(219, 183, 112, 0.35);
  color: var(--cream);
  background: rgba(8, 6, 5, 0.88);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, -42%);
  transition: opacity 500ms ease, transform 500ms ease;
  backdrop-filter: blur(18px);
}

.opening-message.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.opening-message span,
.opening-message strong {
  display: block;
}

.opening-message span {
  margin-bottom: 12px;
  color: var(--gold);
  font-size: clamp(7px, 0.65vw, 11px);
  letter-spacing: 0.16em;
}

.opening-message strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(17px, 2vw, 33px);
  font-weight: 400;
  line-height: 1.25;
}

.cursor-guide {
  position: absolute;
  z-index: 13;
  bottom: 4.5%;
  left: 50%;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  color: rgba(239, 227, 205, 0.75);
  background: rgba(5, 4, 3, 0.58);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 350ms ease;
  backdrop-filter: blur(10px);
}

.cursor-guide.is-visible {
  opacity: 1;
}

.cursor-guide span {
  font-size: clamp(7px, 0.62vw, 10px);
  font-weight: 760;
  letter-spacing: 0.15em;
}

.cursor-guide small {
  color: rgba(203, 191, 171, 0.62);
  font-size: clamp(7px, 0.55vw, 9px);
}

.evidence {
  position: absolute;
  z-index: 25;
  top: 0;
  right: 0;
  width: min(420px, 37%);
  height: 100%;
  padding: clamp(22px, 3vw, 48px);
  border-left: 1px solid var(--line);
  color: var(--cream);
  background: var(--panel);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.45);
  transform: translateX(103%);
  transition: transform 350ms cubic-bezier(0.22, 0.75, 0.18, 1);
  backdrop-filter: blur(20px);
}

.evidence.is-open {
  transform: translateX(0);
}

.evidence-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.evidence h2 {
  margin: 7px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 400;
  line-height: 1;
}

.close-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  color: var(--cream);
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
  font-size: 23px;
  line-height: 1;
}

.evidence-progress {
  margin: 30px 0 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.evidence-progress strong {
  color: var(--gold-bright);
}

.evidence-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: clue;
}

.evidence-list li {
  position: relative;
  min-height: 61px;
  padding: 12px 10px 12px 42px;
  border-top: 1px solid rgba(226, 193, 128, 0.13);
  color: rgba(188, 176, 156, 0.45);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(12px, 1vw, 16px);
  counter-increment: clue;
}

.evidence-list li::before {
  position: absolute;
  top: 12px;
  left: 8px;
  color: rgba(198, 155, 77, 0.45);
  content: counter(clue, upper-roman);
  font-family: Inter, sans-serif;
  font-size: 0.63rem;
  font-weight: 800;
}

.evidence-list li.is-found {
  color: var(--cream);
}

.evidence-list small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: Inter, sans-serif;
  font-size: clamp(8px, 0.64vw, 10px);
  line-height: 1.42;
}

.confidence {
  margin-top: 23px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.confidence-row {
  display: grid;
  grid-template-columns: 72px 1fr 35px;
  align-items: center;
  gap: 9px;
  margin: 9px 0;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 760;
  letter-spacing: 0.12em;
}

.confidence-bar {
  height: 3px;
  background: rgba(222, 190, 124, 0.12);
}

.confidence-bar i {
  display: block;
  height: 100%;
  background: var(--gold);
  transition: width 450ms ease;
}

.confidence-row:first-child .confidence-bar i {
  background: var(--green);
}

.toast {
  position: absolute;
  z-index: 30;
  bottom: 5%;
  left: 50%;
  padding: 9px 14px;
  border: 1px solid var(--line);
  color: var(--cream);
  background: rgba(7, 5, 4, 0.88);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 220ms ease, transform 220ms ease;
  font-size: clamp(8px, 0.68vw, 11px);
  letter-spacing: 0.08em;
  backdrop-filter: blur(12px);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.opening {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--cream);
  background: #050403;
  transition: opacity 900ms ease, visibility 900ms;
}

.opening.is-gone {
  opacity: 0;
  visibility: hidden;
}

.opening-room,
.opening-grain {
  position: absolute;
  inset: 0;
}

.opening-room {
  background:
    linear-gradient(rgba(5, 4, 3, 0.42), rgba(5, 4, 3, 0.78)),
    url("assets/concept/midnight-paris-nano-v3/frames/01-front-level-baked.png") center / cover;
  filter: blur(2px) saturate(0.72);
  transform: scale(1.03);
}

.opening-grain {
  opacity: 0.08;
  pointer-events: none;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.opening-copy {
  position: relative;
  width: min(690px, calc(100% - 40px));
  text-align: center;
}

.opening-copy h2,
.ending-copy h2 {
  margin: clamp(16px, 2vw, 28px) 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(55px, 9vw, 135px);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.76;
}

.opening-copy p {
  max-width: 520px;
  margin: 0 auto 30px;
  color: #c5b8a4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 1.4vw, 22px);
}

.primary-button,
.latch-button {
  border: 1px solid rgba(236, 201, 130, 0.72);
  color: #0b0805;
  cursor: pointer;
  background: var(--gold-bright);
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.24);
  font-weight: 820;
  letter-spacing: 0.15em;
}

.primary-button {
  min-width: 230px;
  padding: 15px 24px;
  font-size: 0.73rem;
}

.primary-button:hover,
.primary-button:focus-visible,
.latch-button:hover,
.latch-button:focus-visible {
  background: #ffe0a0;
}

.opening-copy small {
  display: block;
  margin-top: 17px;
  color: rgba(211, 198, 175, 0.58);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
}

.inspection {
  width: min(1050px, 86vw);
  max-width: none;
  max-height: 88vh;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(226, 191, 121, 0.34);
  color: var(--cream);
  background: #0b0907;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.72);
}

.inspection::backdrop {
  background: rgba(2, 2, 2, 0.76);
  backdrop-filter: blur(8px);
}

.inspection-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  min-height: min(620px, 76vh);
}

.inspection-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
}

.inspection-visual {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background:
    linear-gradient(rgba(6, 5, 4, 0.08), rgba(6, 5, 4, 0.3)),
    url("assets/concept/midnight-paris-nano-v3/frames/04-reverse-level.png") var(--focus-x, center) var(--focus-y, center) / var(--focus-size, cover) no-repeat;
}

.inspection-visual::after {
  position: absolute;
  inset: 0;
  border-right: 1px solid rgba(226, 191, 121, 0.2);
  content: "";
  pointer-events: none;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.28);
}

.inspection-copy {
  display: flex;
  padding: clamp(36px, 4vw, 65px);
  flex-direction: column;
}

.inspection-copy h2 {
  margin: 15px 0 23px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 55px);
  font-weight: 400;
  line-height: 0.96;
}

.inspection-copy .observation {
  color: #d1c3ad;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 1.45vw, 20px);
  line-height: 1.55;
}

.inspection-copy .detail {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: clamp(10px, 0.85vw, 13px);
  line-height: 1.65;
}

.latch-button {
  display: none;
  margin-top: auto;
  padding: 14px 18px;
  text-align: left;
  font-size: 0.72rem;
}

.latch-button.is-visible {
  display: block;
}

.latch-button span {
  display: block;
  margin-top: 4px;
  opacity: 0.62;
  font-size: 0.59rem;
  font-weight: 650;
  letter-spacing: 0.07em;
}

.receipt-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(320px, 62%);
  padding: 34px;
  color: #2d251d;
  background: #e5dbc6;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%) rotate(-2deg);
  font-family: "Courier New", monospace;
}

.receipt-card h3 {
  margin: 0 0 10px;
  text-align: center;
  letter-spacing: 0.12em;
}

.receipt-card p {
  margin: 5px 0;
  font-size: 0.8rem;
}

.receipt-rule {
  margin: 12px 0;
  border-top: 1px dashed #645747;
}

.receipt-card .address {
  margin-top: 18px;
  font-weight: 800;
  text-align: center;
}

.clock-face {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(240px, 50%);
  aspect-ratio: 1;
  place-items: center;
  border: 14px solid #73542d;
  border-radius: 50%;
  color: #2e2419;
  background: radial-gradient(circle, #eee1c6, #caba99);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.58), inset 0 0 0 3px #b98a4d;
  transform: translate(-50%, -50%);
}

.clock-face strong,
.clock-face span {
  position: absolute;
}

.clock-face strong {
  font-family: Georgia, serif;
  font-size: clamp(50px, 7vw, 88px);
}

.clock-face span {
  bottom: 18%;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.ending {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  color: var(--cream);
  background: #050403;
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms ease, visibility 700ms;
}

.ending.is-visible {
  opacity: 1;
  visibility: visible;
}

.ending-scene {
  position: relative;
  overflow: hidden;
  background-position: center;
  background-size: cover;
}

.ending-scene::before,
.ending-scene::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.ending-scene--out {
  background-image: url("assets/concept/midnight-paris-nano-v3/frames/07-paris-plate.png");
  animation: ending-out 10s ease-out forwards;
}

.ending-scene--below {
  background-image: url("assets/concept/midnight-paris-nano-v3/frames/08-underwater-plate.png");
  animation: ending-below 9s ease-in forwards;
}

.ending-scene--below::after {
  background: linear-gradient(180deg, transparent 0 36%, rgba(1, 35, 49, 0.16) 52%, rgba(0, 23, 34, 0.7));
  animation: flood-rise 5s ease-in forwards;
}

.generated-ending {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 180ms ease;
}

.generated-ending.is-ready {
  opacity: 1;
}

.ending.has-generated-video {
  display: block;
}

.ending.has-generated-video .ending-scene {
  position: absolute;
  inset: 0;
}

.ending.has-generated-video .ending-copy {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 42%;
  justify-content: flex-end;
  background: linear-gradient(transparent, rgba(6, 5, 4, 0.95) 55%);
  transition: opacity 450ms ease;
}

.ending.has-generated-video .ending-copy p {
  max-width: 720px;
}

.ending.is-playing-video .ending-copy {
  opacity: 0;
  pointer-events: none;
}

.ending-copy {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: clamp(35px, 5vw, 80px);
  flex-direction: column;
  background: radial-gradient(circle at 0 50%, rgba(78, 55, 28, 0.23), transparent 60%), #090705;
}

.ending-copy h2 {
  font-size: clamp(70px, 10vw, 150px);
}

.ending-copy p {
  max-width: 480px;
  margin: 0 0 32px;
  color: #c7baa5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 1.35vw, 21px);
  line-height: 1.6;
}

.ending-copy .primary-button {
  align-self: flex-start;
}

@keyframes city-breathe {
  from { transform: scale(1.025) translateX(-0.25%); filter: brightness(0.97); }
  to { transform: scale(1.04) translateX(0.25%); filter: brightness(1.04); }
}

@keyframes water-drift {
  from { transform: scale(1.02) translate3d(-0.3%, -0.15%, 0); }
  to { transform: scale(1.045) translate3d(0.3%, 0.25%, 0); }
}

@keyframes beacon {
  0%, 76%, 100% { opacity: 0.2; }
  84% { opacity: 0.85; }
}

@keyframes caustic-sway {
  from { transform: translateX(-4%) skewX(-4deg); }
  to { transform: translateX(5%) skewX(5deg); }
}

@keyframes bubble-rise {
  0% { opacity: 0; transform: translateY(0) translateX(0); }
  15% { opacity: 0.6; }
  80% { opacity: 0.35; }
  100% { opacity: 0; transform: translateY(-650%) translateX(130%); }
}

@keyframes manta-pass {
  0%, 18% { transform: translateX(0) skewX(-23deg); }
  68%, 100% { transform: translateX(450%) skewX(-23deg); }
}

@keyframes feed-reset {
  0% { filter: none; transform: translateX(0); }
  35% { filter: hue-rotate(35deg) brightness(1.7); transform: translateX(-1.4%); }
  67% { filter: saturate(0) contrast(2); transform: translateX(1%); }
  100% { filter: none; transform: translateX(0); }
}

@keyframes dwell-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes opening-breathe {
  from { transform: scale(1.03); }
  to { transform: scale(1.07); }
}

@keyframes ending-out {
  from { transform: scale(1.02); }
  to { transform: scale(1.14); }
}

@keyframes ending-below {
  from { transform: scale(1.02); filter: brightness(1); }
  to { transform: scale(1.1); filter: brightness(0.65) saturate(1.25); }
}

@keyframes flood-rise {
  from { transform: translateY(70%); }
  to { transform: translateY(0); }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr 1fr;
  }

  .view-readout {
    display: none;
  }

  .evidence {
    width: min(480px, 82%);
  }

  .inspection {
    width: 92vw;
  }

  .inspection-card {
    grid-template-columns: 1fr 0.82fr;
  }

  .ending {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

@media (max-width: 640px), (max-height: 520px) {
  .hotel-mark .eyebrow,
  .cycle-readout {
    display: none !important;
  }

  .hotel-mark h1 {
    margin: 0;
  }

  .icon-button {
    min-height: 28px;
    padding-inline: 8px;
  }

  .inspection-card {
    grid-template-columns: 1fr;
  }

  .inspection-visual {
    min-height: 34vh;
  }

  .inspection-copy {
    padding: 25px;
  }

  .inspection-copy .detail {
    display: none;
  }

  .latch-button {
    margin-top: 18px;
  }

  .ending {
    grid-template-columns: 1fr;
  }

  .ending-scene {
    min-height: 48vh;
  }

  .ending-copy {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(transparent, rgba(6, 5, 4, 0.97) 25%);
  }

  .ending-copy h2 {
    margin: 8px 0;
  }

  .ending-copy p {
    margin-bottom: 15px;
  }
}

@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;
  }
}
