:root {
  color-scheme: dark;
  --ink: #07090b;
  --paper: #f4f1ea;
  --red: #df2638;
  --line: rgba(255, 255, 255, 0.24);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--ink); color: var(--paper); }
button, a { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.experience, .scene { width: 100%; height: 100%; min-height: 100svh; }

.scene {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #0b0c0d;
  touch-action: none;
  user-select: none;
}

.panorama-viewer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #121314;
}
.panorama-viewer .pnlm-render-container { cursor: grab; }
.panorama-viewer .pnlm-render-container:active { cursor: grabbing; }
.panorama-viewer .pnlm-load-box { background: rgba(7,9,11,.72); }
.panorama-viewer .pnlm-controls-container {
  top: auto;
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 58px));
}
.panorama-viewer .pnlm-control {
  border: 1px solid rgba(255,255,255,.2);
  background-color: rgba(8,10,12,.68);
  filter: invert(1);
}
.is-hidden { display: none !important; }

.scene-viewport {
  --pan-x: 0px;
  --pan-y: 0px;
  position: absolute;
  top: -5%;
  bottom: auto;
  left: 50%;
  width: 400vw;
  height: 110%;
  transform: translate3d(calc(-50% + var(--pan-x)), var(--pan-y), 0);
  will-change: transform;
}

.scene-img, .scene video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: grayscale(1) contrast(1.08) brightness(.88);
  pointer-events: none;
}
.scene video { opacity: 0; transition: opacity .45s ease; }
.scene video.is-playing { opacity: 1; }

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4,6,8,.45), transparent 24%, transparent 68%, rgba(4,6,8,.68));
}

.topbar {
  position: absolute;
  z-index: 4;
  top: max(14px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: clamp(.72rem, 2.4vw, .9rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
}
.brand::before { content: ""; width: 3px; height: 30px; background: var(--red); }
.controls { display: flex; gap: 8px; pointer-events: auto; }

.icon-button {
  min-width: 44px;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8,10,12,.56);
  backdrop-filter: blur(14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: .72rem;
  font-weight: 750;
}
.icon-button.is-active { border-color: var(--red); background: rgba(211,38,49,.25); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.scene-copy {
  position: absolute;
  z-index: 3;
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  bottom: max(28px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}
.scene-title { min-width: 0; }
.eyebrow { margin: 0 0 5px; color: var(--red); font-size: .7rem; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.35rem, 5vw, 2.7rem); line-height: .92; letter-spacing: -.045em; text-transform: uppercase; text-shadow: 0 2px 18px rgba(0,0,0,.65); }
.hint { margin: 7px 0 0; color: rgba(255,255,255,.8); font-size: clamp(.68rem, 2vw, .82rem); }
.point-number { color: var(--red); font-size: .76rem; font-weight: 850; letter-spacing: .1em; }
.progress { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.2); }
.progress span { display: block; width: 0; height: 100%; background: var(--red); }

.start-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5,7,9,.58);
  backdrop-filter: blur(8px);
}
.start-card { max-width: 430px; text-align: center; }
.rotate-phone { width: 58px; height: 58px; margin: 0 auto 18px; animation: motion-hint 2.2s ease-in-out infinite; }
.start-card h2 { margin: 0; font-size: clamp(1.65rem, 7vw, 2.4rem); line-height: 1; letter-spacing: -.04em; }
.start-card p { margin: 12px auto 20px; max-width: 35ch; color: rgba(255,255,255,.72); font-size: .92rem; line-height: 1.45; }
.primary-button {
  min-width: 210px;
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 850;
  box-shadow: 0 14px 34px rgba(211,38,49,.35);
}
.secure-note { display: block; margin-top: 12px; color: rgba(255,255,255,.5); font-size: .68rem; }

.viewer-status {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(82px, calc(env(safe-area-inset-bottom) + 60px));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 40px);
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6,8,10,.8);
  backdrop-filter: blur(12px);
  font-size: .75rem;
  text-align: center;
}

.info-panel { position: fixed; inset: 0; z-index: 25; display: grid; place-items: end center; background: rgba(0,0,0,.45); }
.info-card {
  width: min(100%, 620px);
  max-height: 82svh;
  overflow: auto;
  padding: 24px max(22px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  border-radius: 22px 22px 0 0;
  background: #111416;
  box-shadow: 0 -20px 60px rgba(0,0,0,.45);
}
.info-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.info-head h2 { margin: 0; font-size: 1.3rem; }
.close-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 1.3rem; }
.lead { color: #d7d7d3; line-height: 1.55; }
.meta { color: #8f9493; font-size: .8rem; }
.route { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.route a { min-height: 62px; padding: 10px; border: 1px solid var(--line); color: #fff; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; }
.route a[aria-current="page"] { border-color: var(--red); background: rgba(211,38,49,.12); }
.route small { color: var(--red); font-weight: 800; }
.route strong { font-size: .7rem; line-height: 1.1; }
.disclosure { color: #777c7b; font-size: .7rem; line-height: 1.45; }

@keyframes motion-hint {
  0%, 100% { transform: translateX(-7px) rotate(-5deg); }
  50% { transform: translateX(7px) rotate(5deg); }
}

@media (orientation: portrait) and (max-width: 759px) {
  .topbar { align-items: flex-start; }
  .brand { font-size: .72rem; }
  .controls { gap: 6px; }
  .icon-button { width: 42px; min-width: 42px; height: 42px; padding: 0; }
  .icon-button > span:not(:only-child) { display: none; }
  .scene-copy { bottom: max(24px, env(safe-area-inset-bottom)); }
  h1 { max-width: 8.5ch; font-size: clamp(2rem, 12vw, 3.2rem); }
}

@media (orientation: landscape) and (max-height: 560px) {
  .start-screen { padding: 12px 24px; }
  .start-card { display: grid; grid-template-columns: 60px minmax(200px, 1fr) auto; align-items: center; gap: 18px; max-width: 760px; text-align: left; }
  .rotate-phone { margin: 0; }
  .start-card p { margin: 7px 0 0; font-size: .78rem; }
  .secure-note { display: none; }
  .primary-button { min-width: 170px; }
  .scene-copy { max-width: 62%; }
  .hint { display: none; }
  .info-card { width: min(78%, 680px); max-height: 96svh; border-radius: 18px 18px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .scene video { display: none; }
  .rotate-phone { animation: none; }
}
