/* Native scene/card chapters. The short sticky runway belongs to the artwork,
   never to the document or a reading pane. Desktop's camera keeps its layout. */
.scene-chapter, .scene-stage, .scene-pin { display: contents; }
.scene-welcome, .scene-scroll, .scene-marker { display: none; }

html:not([data-journey="cinematic"]) {
  --scene-header: 79px;
  scroll-padding-top: calc(var(--scene-header) + 16px);
}
@media (max-width: 1200px) { html:not([data-journey="cinematic"]) { --scene-header: 73px; } }
@media (max-width: 480px) { html:not([data-journey="cinematic"]) { --scene-header: 66px; } }

html:not([data-journey="cinematic"]) .overworld-home {
  --scene-height: clamp(320px, 58svh, 600px);
  --scene-pin-travel: clamp(100px, 20svh, 180px);
  --scene-overlap: 48px;
  --scene-card-width: 960px;
}
html:not([data-journey="cinematic"]) .scene-chapter,
html:not([data-journey="cinematic"]) .home-hero {
  display: flow-root;
  position: relative;
  isolation: isolate;
  border: 0;
  padding-bottom: 40px;
}
html:not([data-journey="cinematic"]) .home-hero {
  --scene-height: clamp(360px, calc(100svh - var(--scene-header) - var(--home-footer-height) - 72px), 680px);
}
html:not([data-journey="cinematic"]) .scene-stage,
html:not([data-journey="cinematic"]) .home-journey {
  display: block;
  position: relative;
  height: calc(var(--scene-height) + var(--scene-pin-travel));
  padding: 0;
  margin: 0;
  background: none;
  scroll-margin-top: 0;
}
html:not([data-journey="cinematic"]) .scene-pin,
html:not([data-journey="cinematic"]) .home-section__scene {
  display: block;
  position: sticky;
  top: var(--scene-header);
  width: 100%;
  height: var(--scene-height);
  max-width: none;
  aspect-ratio: auto;
  overflow: hidden;
  isolation: isolate;
  background: var(--world-bg);
}
/* Keep each interior's art and SVG effects at the same original 3:2 ratio.
   The outer stage crops the shared layer, rather than stretching the effects. */
html:not([data-journey="cinematic"])[data-world="overworld"] .home-section__scene .world-scene {
  width: max(100%, calc(var(--scene-height) * 1.5));
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 2;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  background-size: 100% 100%;
}
html:not([data-journey="cinematic"])[data-world="overworld"] .scene-pin > .world-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  background-size: cover;
  background-position: 38% center;
  background-repeat: no-repeat;
}
html:not([data-journey="cinematic"]) .home-section__scene::after,
html:not([data-journey="cinematic"]) .scene-pin::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 64px;
  pointer-events: none;
  box-shadow: none;
  background: linear-gradient(transparent, var(--world-bg));
}
html:not([data-journey="cinematic"]) .home-hero__inner,
html:not([data-journey="cinematic"]) .home-section {
  position: relative;
  z-index: 3;
  margin-top: calc(-1 * (var(--scene-pin-travel) + var(--scene-overlap)));
  padding: 0;
  scroll-margin-top: 0;
}
html:not([data-journey="cinematic"]) .home-hero__inner,
html:not([data-journey="cinematic"]) .home-section > .home-container {
  width: min(calc(100% - 32px), var(--scene-card-width));
  min-height: 0;
  margin-inline: auto;
  display: block;
  padding: clamp(24px, 4vw, 48px);
  background: var(--world-surface);
  border: 1px solid var(--world-border);
  border-top: 3px solid var(--world-gold);
  box-shadow: 4px 5px 0 var(--world-shadow);
}
html:not([data-journey="cinematic"]) .home-section::before,
html:not([data-journey="cinematic"]) .home-section > .home-container::before,
html:not([data-journey="cinematic"]) .home-hero__panel::before,
html:not([data-journey="cinematic"]) .home-hero__panel::after { display: none; }
html:not([data-journey="cinematic"]) .home-hero__panel {
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: none;
}
html:not([data-journey="cinematic"]) .home-hero__identity { display: none; }
html:not([data-journey="cinematic"]) .home-hero__explore {
  min-height: 0;
  align-items: stretch;
  padding: 28px 0 0;
  margin-top: 28px;
  border-top: 1px solid var(--world-border);
}
html:not([data-journey="cinematic"]) .home-world-caption { text-align: center; }
html:not([data-journey="cinematic"]) .home-world-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html:not([data-journey="cinematic"]) .home-world-links a { min-width: 0; }
html:not([data-journey="cinematic"]) .home-world-links::before { display: none; }

html:not([data-journey="cinematic"]) .scene-welcome {
  display: block;
  position: absolute;
  z-index: 3;
  top: 20px;
  left: max(20px, calc((100% - 960px) / 2));
  width: min(350px, calc(100% - 40px));
  padding: 16px 20px 10px;
  border: 1px solid var(--world-border);
  border-left: 3px solid var(--world-gold);
  background: var(--world-surface);
  box-shadow: 3px 3px 0 var(--world-shadow);
}
.overworld-home .scene-welcome p { font: 600 25px/1.25 "Exo 2", sans-serif; margin: 0; }
.scene-welcome p > span { display: block; margin-top: 5px; color: var(--world-muted); font-size: 15px; font-weight: 400; }
.scene-welcome nav { display: flex; gap: 24px; margin-top: 8px; }
.scene-welcome a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 500; color: var(--world-accent); }
html:not([data-journey="cinematic"]) .scene-scroll {
  display: flex;
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(var(--scene-overlap) + 16px);
  transform: translateX(-50%);
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--world-border);
  background: var(--world-surface);
  color: var(--world-text);
  font-size: 14px;
  white-space: nowrap;
}
.scene-scroll svg { width: 16px; height: 16px; }
html[data-world-motion="running"] .scene-scroll svg { animation: scene-scroll-nudge 2.6s ease-in-out infinite; }
@keyframes scene-scroll-nudge { 0%, 65%, 100% { transform: translateY(0); } 35% { transform: translateY(4px); } }
html:not([data-journey="cinematic"]) .scene-marker {
  display: block;
  position: absolute;
  z-index: 3;
  top: 24px;
  left: max(20px, calc((100% - 960px) / 2));
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--world-border);
  background: var(--world-surface);
  color: var(--world-gold);
  font: 12px/1.5 "JetBrains Mono", monospace;
}
html:not([data-journey="cinematic"]) .scene-chapter:has(#contact) {
  --scene-height: clamp(300px, 48svh, 520px);
  --scene-overlap: 100px;
}
html:not([data-journey="cinematic"]) #contact .home-eyebrow { display: none; }
html:not([data-journey="cinematic"]) #main-content { scroll-margin-top: 0; }

@media (min-width: 701px) {
  html:not([data-journey="cinematic"]) .home-hero__title { font-size: 32px; }
  html:not([data-journey="cinematic"]) .home-about__grid { grid-template-columns: 260px minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 480px) {
  html:not([data-journey="cinematic"]) .overworld-home .home-hero__title { font-size: clamp(16px, 4.5vw, 22px); line-height: 1.65; }
  html:not([data-journey="cinematic"]) .home-hero__inner,
  html:not([data-journey="cinematic"]) .home-section > .home-container { padding: 24px 20px; }
  html:not([data-journey="cinematic"]) .home-world-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  html:not([data-journey="cinematic"]) .home-world-links a { font-size: 14px; }
}
/* Explicit still presentation for motion-sensitive visitors. Every section is
   still illustrated; the same complete content follows without a pin runway. */
@media (prefers-reduced-motion: reduce), (max-height: 500px) {
  html:not([data-journey="cinematic"]) .overworld-home { --scene-pin-travel: 0px; }
  html:not([data-journey="cinematic"]) .scene-pin,
  html:not([data-journey="cinematic"]) .home-section__scene { position: relative; top: 0; }
}
@media (max-height: 500px) and (min-width: 600px) {
  html:not([data-journey="cinematic"]) .scene-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: min(600px, calc(100% - 40px));
    padding: 12px 16px;
  }
  .overworld-home .scene-welcome p { font-size: 22px; }
  .scene-welcome nav { margin: 0; gap: 16px; }
}
@media print {
  .scene-stage, .home-journey { display: none !important; }
  html:not([data-journey="cinematic"]) .home-hero__inner,
  html:not([data-journey="cinematic"]) .home-section { margin-top: 0; }
  html:not([data-journey="cinematic"]) .home-hero__identity { display: block; }
}
