:root {
  --bg-base: #060d14;
  --accent: #63d1d4;
  --accent-soft: rgba(99, 209, 212, 0.22);
  --accent-warm: #f0ca8a;
  --orb-color: #f7e4be;
  --horizon-far: #3eb9bf;
  --horizon-near: #e5bb7c;
  --text-primary: #f5f2eb;
  --text-secondary: rgba(242, 239, 232, 0.68);
  --text-muted: rgba(242, 239, 232, 0.44);
  --glass-bg: rgba(10, 18, 26, 0.56);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.26);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Young Serif', 'New York', Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Nunito', system-ui, sans-serif;
}

body[data-biome="ocean"] {
  --bg-base: #061018;
  --accent: #6ad3d6;
  --accent-soft: rgba(106, 211, 214, 0.22);
  --horizon-far: #3cb5be;
  --horizon-near: #e6bc7c;
}

body[data-biome="savanna"] {
  --bg-base: #140f0a;
  --accent: #f0b86b;
  --accent-soft: rgba(240, 184, 107, 0.24);
  --horizon-far: #c97c3e;
  --horizon-near: #efc482;
}

body[data-biome="alpine"] {
  --bg-base: #091119;
  --accent: #a6d4f2;
  --accent-soft: rgba(166, 212, 242, 0.24);
  --horizon-far: #6d9fc2;
  --horizon-near: #dcecf7;
}

body[data-biome="forest"] {
  --bg-base: #07120d;
  --accent: #7fd49a;
  --accent-soft: rgba(127, 212, 154, 0.22);
  --horizon-far: #3d8c60;
  --horizon-near: #b5d99c;
}

body[data-biome="nocturnal"] {
  --bg-base: #080c0f;
  --accent: #d4b679;
  --accent-soft: rgba(212, 182, 121, 0.2);
  --horizon-far: #4e635a;
  --horizon-near: #cbb382;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  transition: background-color 700ms var(--ease-expo);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link, .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;
}

/* ================================
   Dynamic Atmospheric Background
================================ */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 900ms var(--ease-expo);
}

body[data-stage="explorer"] .atmosphere {
  opacity: 1;
}

.ambient-canvas {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  filter: blur(42px) saturate(1.18) brightness(0.58);
  transform: scale(1.06) translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform 280ms ease-out;
}

.atmosphere-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 72% 58% at 50% 42%, transparent 18%, rgba(4, 9, 14, 0.60) 100%),
    linear-gradient(180deg, rgba(4, 9, 14, 0.52) 0%, rgba(4, 9, 14, 0.08) 38%, rgba(4, 9, 14, 0.36) 70%, rgba(3, 7, 11, 0.88) 100%);
}

.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.72;
}

.studio-horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  background:
    radial-gradient(ellipse 56% 52% at 50% 20%, var(--accent-soft), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(4, 8, 12, 0.45) 4%, rgba(3, 7, 11, 0.90) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 700ms var(--ease-expo);
}

/* ================================
   Shared Living Media Layer
================================ */
.scene-media {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  background: #050c12;
  transform-origin: center center;
}

body[data-stage="explorer"] .scene-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.scene-media video,
.soon-stage-img,
.swap-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body[data-stage="landing"].arrival-play .scene-media video {
  animation: cinema-focus-pull 1250ms var(--ease-expo) both;
}

@keyframes cinema-focus-pull {
  0% {
    transform: scale(1.065);
    filter: blur(8px) brightness(0.72);
  }
  100% {
    transform: scale(1);
    filter: blur(0px) brightness(1);
  }
}

.soon-stage-img {
  transform: scale(1.03);
  filter: brightness(0.84) saturate(1.05);
  transition: opacity 420ms var(--ease-expo), transform 1100ms var(--ease-expo);
}

.swap-frame {
  z-index: 3;
  pointer-events: none;
}

/* ================================
   Brand Mark (Wordmark + Aperture)
================================ */
.brand-mark {
  color: #f7f3eb;
}

.wm-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-left: 0.22em;
  font-family: var(--font-ui);
  font-size: clamp(11px, 0.95vw, 12px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(246, 242, 234, 0.82);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.58);
  opacity: 0;
  transform: translateY(10px);
}

.wm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transition: background 600ms ease, box-shadow 600ms ease;
  animation: live-pulse 2.8s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; box-shadow: 0 0 8px var(--accent); }
  50% { transform: scale(1.22); opacity: 1; box-shadow: 0 0 16px var(--accent); }
}

.wm-explore {
  color: rgba(248, 244, 236, 0.86);
  transition: color 240ms ease, letter-spacing 360ms var(--ease-expo);
}

/* ================================
   Stage 1: Full-Bleed Entrance
================================ */
.landing {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  transition: opacity 420ms var(--ease-expo), visibility 420ms;
}

body[data-stage="explorer"] .landing {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.landing-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 58% at 50% 48%, rgba(4, 12, 19, 0.16) 0%, rgba(4, 11, 18, 0.56) 100%),
    linear-gradient(180deg, rgba(4, 11, 18, 0.24) 0%, rgba(4, 11, 18, 0.1) 50%, rgba(4, 11, 18, 0.42) 100%);
  pointer-events: none;
}

.enter-trigger {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-align: center;
  transition: transform 420ms var(--ease-expo);
}

.enter-trigger:hover {
  transform: translateY(-2px);
}

.enter-trigger:hover .wm-explore {
  color: #ffffff;
  letter-spacing: 0.26em;
}

.enter-trigger:hover .hero-brand::before,
.enter-trigger:hover .hero-brand::after {
  inset: 3px;
  opacity: 0.96;
}

.hero-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2vw, 22px);
  padding: clamp(28px, 3.6vw, 40px) clamp(34px, 4.8vw, 58px);
}

.hero-brand::before,
.hero-brand::after {
  content: "";
  position: absolute;
  inset: -26px;
  pointer-events: none;
  opacity: 0;
  transition: inset 460ms var(--ease-expo), opacity 460ms var(--ease-expo);
}

body.arrival-play .hero-brand::before,
body.arrival-play .hero-brand::after {
  animation: viewfinder-lock 980ms var(--ease-expo) 120ms forwards;
}

@keyframes viewfinder-lock {
  0% { inset: -28px; opacity: 0; }
  100% { inset: 0; opacity: 0.64; }
}

.hero-brand::before {
  background:
    linear-gradient(to right, rgba(248, 244, 236, 0.88) 16px, transparent 16px) 0 0 / 100% 1.25px no-repeat,
    linear-gradient(to bottom, rgba(248, 244, 236, 0.88) 16px, transparent 16px) 0 0 / 1.25px 100% no-repeat,
    linear-gradient(to left, rgba(248, 244, 236, 0.88) 16px, transparent 16px) 100% 0 / 100% 1.25px no-repeat,
    linear-gradient(to bottom, rgba(248, 244, 236, 0.88) 16px, transparent 16px) 100% 0 / 1.25px 100% no-repeat;
}

.hero-brand::after {
  background:
    linear-gradient(to right, rgba(248, 244, 236, 0.88) 16px, transparent 16px) 0 100% / 100% 1.25px no-repeat,
    linear-gradient(to top, rgba(248, 244, 236, 0.88) 16px, transparent 16px) 0 100% / 1.25px 100% no-repeat,
    linear-gradient(to left, rgba(248, 244, 236, 0.88) 16px, transparent 16px) 100% 100% / 100% 1.25px no-repeat,
    linear-gradient(to top, rgba(248, 244, 236, 0.88) 16px, transparent 16px) 100% 100% / 1.25px 100% no-repeat;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.8vw, 68px);
  font-weight: 400;
  line-height: 1.08;
  padding: 0.04em 0;
  letter-spacing: -0.015em;
  color: #f8f4ec;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.52);
  opacity: 0;
  transform: translateY(20px);
  clip-path: inset(0 0 100% 0);
}

body.arrival-play .wm-live-pill {
  animation: fade-up 780ms var(--ease-expo) 300ms forwards;
}

body.arrival-play .hero-title {
  animation: title-unveil 920ms var(--ease-expo) 360ms forwards;
}

body.arrival-play .wm-explore {
  animation: fade-up 780ms var(--ease-expo) 580ms forwards;
}

@keyframes title-unveil {
  0% {
    opacity: 0;
    transform: translateY(20px);
    letter-spacing: 0.018em;
    clip-path: inset(0 0 100% 0);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: -0.015em;
    clip-path: inset(0 0 0% 0);
  }
}

@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}

.landing-pause {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 4;
}

/* ================================
   Stage 2: Single-Viewport Explorer
================================ */
.explorer {
  position: relative;
  z-index: 4;
  height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 16px clamp(20px, 3vw, 40px) 18px;
  gap: 10px;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 620ms var(--ease-expo), transform 700ms var(--ease-expo);
}

body[data-stage="explorer"] .explorer {
  opacity: 1;
  transform: scale(1);
}

/* Top Bar */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 40px;
  gap: 16px;
}

.header-brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  transition: opacity 200ms ease, transform 220ms var(--ease-expo);
}

.header-brand:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.header-wordmark {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.5vw, 21px);
  letter-spacing: -0.012em;
  color: var(--text-primary);
}

.topbar-left {
  justify-self: start;
  display: flex;
  align-items: center;
}

.ocean-world-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #62d7db 0%, #2ab2ba 100%);
  color: #04151d;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 4px 20px rgba(72, 206, 212, 0.34);
  transition: transform 200ms var(--ease-expo), box-shadow 220ms ease, filter 180ms ease;
}

.ocean-world-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 8px 28px rgba(84, 218, 224, 0.48);
}

.ocean-world-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.ocean-world-btn:focus-visible {
  outline: 2px solid #7fe5e8;
  outline-offset: 3px;
}

.ocean-btn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: #042530;
  box-shadow: 0 0 0 2px rgba(4, 37, 48, 0.22);
  animation: ocean-btn-pulse 2.8s ease-in-out infinite;
}

@keyframes ocean-btn-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.22); opacity: 1; }
}

.topbar-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
}

.text-action {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}

.text-action:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(255, 255, 255, 0.36);
}

/* Centerpiece Stage */
.stage {
  width: min(1480px, 100%);
  min-height: 0;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "info actions"
    "display display";
  align-items: center;
  gap: 10px 18px;
}

.stage-info {
  grid-area: info;
  min-width: 0;
}

.stage-actions {
  grid-area: actions;
  justify-self: end;
  text-align: end;
}

.scene-stats {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  font-variant-numeric: tabular-nums;
}

.stats-context {
  display: grid;
  gap: 4px;
}

.fps-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.fps-value strong {
  font-size: clamp(27px, 2.9vw, 42px);
  font-weight: 650;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.fps-unit {
  white-space: nowrap;
}

.fps-unit small {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0;
}

.stats-context,
.download-meta {
  color: rgba(242, 239, 232, 0.76);
  font-size: 11px;
  line-height: 1.45;
}

.stats-context strong,
.live-sample strong {
  font-weight: 650;
}

.live-sample {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  align-items: baseline;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(242, 239, 232, 0.2);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.live-sample strong {
  color: var(--accent);
}

#habitat-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(23px, 2.1vw, 32px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.032em;
  color: var(--text-primary);
}

#habitat-title.swap {
  animation: title-swap 520ms var(--ease-expo);
}

@keyframes title-swap {
  0% {
    opacity: 0;
    transform: translateY(10px);
    clip-path: inset(0 0 100% 0);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    clip-path: inset(0 0 0% 0);
  }
}

.action-bar {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.secondary-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 242, 234, 0.74);
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}

.secondary-action:hover {
  color: #f8f4ec;
  border-bottom-color: rgba(248, 244, 236, 0.36);
}

.secondary-action.is-live {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transition: background 500ms ease, box-shadow 500ms ease;
}

.primary-download {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f8f4ec;
  border-bottom: 1px solid rgba(248, 244, 236, 0.56);
  transition: color 200ms ease, border-color 200ms ease, transform 200ms var(--ease-expo);
}

.primary-download:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
  transform: translateY(-1px);
}

.primary-download svg {
  width: 14px;
  height: 14px;
  opacity: 0.88;
}

.soon-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ================================
   Precision MacBook Pro Frame
================================ */
.macbook-stage {
  grid-area: display;
  align-self: stretch;
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  perspective: 1700px;
  container-type: size;
}

.macbook {
  position: relative;
  /* Keep the chassis inside the available stage track. */
  width: min(1120px, 100%, calc((100dvh - 295px) * 1.52));
  width: min(1120px, 100%, max(80px, calc((100cqh - 38px) * 1.64)));
  max-width: 100%;
  transform-style: preserve-3d;
  transform:
    translate3d(calc(var(--px, 0px) * -0.22), calc(var(--py, 0px) * -0.22), 0)
    rotateY(var(--ry, 0deg))
    rotateX(var(--rx, 0deg));
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.macbook-lid {
  position: relative;
  width: 92%;
  margin: 0 auto;
  padding: 1.55% 1.55% 2.1%;
  border-radius: clamp(12px, 1.5vw, 20px) clamp(12px, 1.5vw, 20px) 4px 4px;
  background: linear-gradient(160deg, #272b31 0%, #14171c 48%, #0d1014 100%);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 70px rgba(0, 0, 0, 0.62),
    0 0 80px -24px var(--accent-soft);
  transition: box-shadow 700ms var(--ease-expo);
}

.macbook-bezel {
  position: relative;
  border-radius: clamp(8px, 1vw, 13px) clamp(8px, 1vw, 13px) 2px 2px;
  overflow: hidden;
  background: #04080c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.macbook-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 13.5%;
  height: 15px;
  background: #0a0c0f;
  border-radius: 0 0 8px 8px;
  z-index: 6;
  display: grid;
  place-items: center;
}

.macbook-cam {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2e5c78, #0b1620 70%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.screen {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  overflow: hidden;
  background: #050c12;
}

.media-target {
  position: absolute;
  inset: 0;
}

.live-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 4;
  background: #050c12;
}

.screen-glare {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 64% 52% at var(--gx, 24%) var(--gy, 18%), rgba(255, 255, 255, 0.08), transparent 62%),
    linear-gradient(122deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.01) 34%, transparent 56%);
}

.screen-glare::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(108deg, transparent 36%, rgba(255, 255, 255, 0.16) 50%, transparent 64%);
  transform: translateX(-115%);
  opacity: 0;
}

.screen.glint-sweep .screen-glare::after {
  animation: glare-sweep 920ms var(--ease-expo);
}

@keyframes glare-sweep {
  0% { transform: translateX(-115%); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateX(115%); opacity: 0; }
}

/* Staggered Explorer UI choreography */
.explorer .stage-info,
.explorer .stage-actions,
.explorer .topbar-left,
.explorer .topbar-right,
.explorer .dock {
  will-change: transform, opacity;
}

.header-wordmark {
  display: inline-block;
  transform-origin: center center;
}

.soon-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 24px 28px 26px;
  text-align: center;
  background: linear-gradient(180deg, rgba(5, 10, 15, 0.04) 20%, rgba(5, 10, 15, 0.78) 100%);
  pointer-events: none;
}

.soon-overlay[hidden] {
  display: none;
}

.soon-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.soon-overlay strong {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 400;
  color: #f8f4ec;
}

.soon-overlay p {
  margin: 5px 0 0;
  font-size: 13px;
  color: rgba(245, 240, 232, 0.76);
}

.screen-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 7;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 220ms ease;
}

.screen:hover .screen-controls,
.screen:focus-within .screen-controls,
.screen.is-paused .screen-controls {
  opacity: 1;
}

@media (hover: none) {
  .screen-controls { opacity: 1; }
}

.ghost-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(8, 14, 20, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.ghost-circle:hover {
  background: rgba(14, 24, 34, 0.78);
  border-color: rgba(255, 255, 255, 0.36);
}

.pause-glyph {
  width: 10px;
  height: 11px;
  border-left: 2.5px solid #f5f1e8;
  border-right: 2.5px solid #f5f1e8;
}

.is-paused .pause-glyph,
.ghost-circle.is-paused .pause-glyph {
  width: 0;
  height: 0;
  border-left: 9px solid #f5f1e8;
  border-right: 0;
  border-top: 5.5px solid transparent;
  border-bottom: 5.5px solid transparent;
  margin-left: 2px;
}

.expand-glyph {
  width: 11px;
  height: 11px;
  border: 1.75px solid #f5f1e8;
  border-radius: 2px;
  position: relative;
}

.macbook-base {
  position: relative;
  width: 100%;
  height: clamp(10px, 1.3vw, 15px);
  border-radius: 2px 2px 12px 12px;
  background: linear-gradient(180deg, #565b64 0%, #31353c 44%, #191c22 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 12px 34px rgba(0, 0, 0, 0.65);
}

.macbook-lip {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 14%;
  height: 44%;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, #272a30, #3f444d);
}

.macbook-shadow {
  width: 88%;
  height: 22px;
  margin: -4px auto 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.72) 0%, transparent 72%);
  filter: blur(6px);
}

/* Fullscreen Screen Expansion */
.screen:fullscreen {
  border-radius: 0;
}

/* Habitat picker */
.dock {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 12px 0 2px;
  border-top: 1px solid rgba(239, 245, 247, 0.16);
  display: grid;
  grid-template-columns: minmax(282px, 0.78fr) minmax(0, 1.22fr);
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
}

.dock-tiles {
  display: grid;
  min-width: 0;
}

.dock-tiles-live {
  grid-template-columns: repeat(3, max-content);
  gap: clamp(24px, 3.5vw, 54px);
}

.dock-soon {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  column-gap: clamp(16px, 2.4vw, 32px);
  border-inline-start: 1px solid rgba(239, 245, 247, 0.12);
  padding-inline-start: clamp(16px, 2.4vw, 32px);
}

.dock-label {
  padding-top: 9px;
  color: rgba(245, 242, 235, 0.64);
  font-size: 11px;
  font-weight: 550;
  line-height: 16px;
  white-space: nowrap;
}

.dock-tiles-soon {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 clamp(8px, 1.25vw, 20px);
}

.tile {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  text-align: left;
  color: rgba(245, 242, 235, 0.8);
  transition: color 160ms ease;
}

.tile-name {
  position: relative;
  display: inline-block;
  padding: 2px 0;
  font-size: 12px;
  line-height: 1.25;
}

.tile-name::after {
  position: absolute;
  content: "";
  inset: auto 0 -3px;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 160ms ease, transform 200ms var(--ease-expo);
}

.tile-live {
  min-height: 48px;
}

.tile-live .tile-name {
  font-size: clamp(14px, 1.2vw, 17px);
  font-weight: 600;
  white-space: nowrap;
}

.tile-live .tile-name::after {
  height: 2px;
}

.tile:hover,
.tile:focus-visible {
  color: #fff;
}

.tile:focus-visible {
  outline-offset: 2px;
}

.tile[aria-pressed="true"] {
  color: var(--accent);
}

.tile[aria-pressed="true"] .tile-name::after {
  opacity: 1;
  transform: none;
}

/* ================================
   Install Dialog
================================ */
.install-dialog {
  width: min(440px, 90vw);
  padding: 28px 28px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(11, 19, 27, 0.94);
  color: var(--text-primary);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
}

.install-dialog::backdrop {
  background: rgba(3, 7, 11, 0.68);
  backdrop-filter: blur(6px);
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
}

.dialog-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.install-dialog h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
}

.install-dialog ol {
  margin: 0 0 14px;
  padding-left: 20px;
  display: grid;
  gap: 9px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.install-dialog strong {
  color: var(--text-primary);
}

.dialog-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

.install-storage {
  color: var(--text-secondary);
}

/* ================================
   Tablet & Mobile Single-Screen Fit
================================ */
@media (max-width: 1060px) {
  .dock {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-top: 5px;
  }

  .dock-soon {
    padding: 0;
    border: 0;
  }

  .dock-tiles-soon {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

}

@media (max-width: 720px) {
  .explorer {
    padding: 10px 14px 12px;
    gap: 8px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 8px;
    column-gap: 10px;
  }

  .header-brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    padding-left: 0;
  }

  .topbar-right {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar-left {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }

  .ocean-world-btn {
    min-height: 32px;
    padding: 6px 14px;
    font-size: 12px;
  }

  .header-wordmark {
    font-size: 16px;
    white-space: nowrap;
  }

  .text-action {
    font-size: 10px;
    letter-spacing: 0.1em;
    white-space: nowrap;
  }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "info"
      "display"
      "actions";
    row-gap: 6px;
  }

  #habitat-title {
    font-size: 24px;
  }

  .scene-stats {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 16px;
    row-gap: 6px;
    margin-top: 8px;
  }

  .live-sample {
    grid-column: 1 / -1;
    padding-top: 5px;
  }

  .stage-actions {
    justify-self: stretch;
    text-align: start;
  }

  .action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
  }

  .download-meta {
    width: 100%;
  }

  .secondary-action,
  .primary-download {
    font-size: 11px;
    letter-spacing: 0.14em;
    padding: 4px 0;
  }

  .macbook-notch {
    height: 9px;
  }

  .dock-tiles-live {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }

  .dock-soon {
    grid-template-columns: minmax(0, 1fr);
  }

  .dock-tiles-soon {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0 8px;
  }

  .dock-label {
    padding-top: 4px;
  }

  .tile-soon {
    min-height: 44px;
  }
}

@media (min-width: 1220px), (min-width: 960px) and (max-height: 800px) {
  .stage {
    --side-width: clamp(136px, 10.8vw, 170px);
    grid-template-columns: var(--side-width) minmax(0, 1fr) var(--side-width);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "info display actions";
    column-gap: clamp(12px, 1.45vw, 23px);
  }

  .stage-info,
  .stage-actions {
    justify-self: stretch;
    align-self: center;
  }

  .scene-stats {
    margin-top: 22px;
  }

  .primary-download {
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.085em;
    white-space: nowrap;
  }

  .primary-download svg {
    width: 12px;
  }
}

@media (min-width: 960px) and (max-width: 1100px) and (max-height: 800px) {
  .primary-download {
    gap: 4px;
    font-size: 10px;
    letter-spacing: 0.03em;
  }

  .primary-download svg {
    width: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mark .mark-frame { stroke-dashoffset: 0 !important; }
  .hero-mark .mark-horizon-far,
  .hero-mark .mark-horizon-near,
  .hero-mark .mark-orb,
  .hero-eyebrow,
  .hero-title,
  .enter-cta {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .ambient-canvas, .macbook {
    transform: none !important;
  }
  .ocean-btn-dot {
    animation: none !important;
  }
}
