:root {
  color-scheme: dark;
  --bg: #071019;
  --panel: rgba(7, 16, 25, 0.74);
  --panel-strong: rgba(7, 16, 25, 0.92);
  --text: #f5f1e8;
  --muted: #b8c3ca;
  --accent: #d6a04f;
  --line: rgba(255, 255, 255, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
}
.skip-link:focus { transform: translateY(0); }

#experience,
#scene,
.shade {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
#experience { z-index: 0; background: var(--bg); }
#scene { display: block; }
.shade { pointer-events: none; }
.shade-left { background: linear-gradient(90deg, rgba(4, 9, 15, 0.88) 0%, rgba(4, 9, 15, 0.34) 38%, transparent 68%); }
.shade-bottom { background: linear-gradient(0deg, rgba(4, 9, 15, 0.78) 0%, transparent 34%); }

.hud {
  position: fixed;
  z-index: 6;
  top: 0;
  left: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 56px) 18px;
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: .08em;
}
.brand strong,
.brand small { display: block; }
.brand strong { font-size: .96rem; letter-spacing: .02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.status { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .78rem; }
.status strong { min-width: 38px; color: var(--text); text-align: right; }
.progress-track {
  grid-column: 1 / -1;
  height: 2px;
  overflow: hidden;
  background: rgba(255,255,255,.15);
}
.progress-track span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--accent);
  will-change: transform;
}

.story { position: relative; z-index: 2; }
.chapter {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 110px clamp(20px, 7vw, 110px) 70px;
}
.chapter-left { justify-content: flex-start; }
.chapter-right { justify-content: flex-end; }
.chapter-center { justify-content: center; align-items: flex-end; padding-bottom: 9vh; }
.copy {
  width: min(440px, 100%);
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.copy h1,
.copy h2 {
  margin: 10px 0 14px;
  max-width: 13ch;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: .98;
  letter-spacing: -.045em;
}
.copy h2 { font-size: clamp(1.8rem, 4vw, 3.6rem); }
.copy p { margin: 0; color: var(--muted); font-size: clamp(.98rem, 1.4vw, 1.1rem); line-height: 1.65; }
.eyebrow { color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.scroll-cue { display: inline-flex; gap: 8px; margin-top: 24px; color: var(--text); font-size: .84rem; }
.final-copy { width: min(760px, 100%); text-align: center; background: var(--panel-strong); }
.final-copy h2 { max-width: 17ch; margin-left: auto; margin-right: auto; }
.final-copy p { max-width: 65ch; margin-inline: auto; }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 26px; }
.specs span { padding: 14px 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.specs strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 1.35rem; }

.fallback,
.noscript {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 24px;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px;
  background: var(--panel-strong);
}
.fallback p { margin: 5px 0 0; color: var(--muted); }

@media (max-width: 760px) {
  .hud { padding-inline: 16px; }
  .brand small { display: none; }
  .status span { max-width: 120px; text-align: right; }
  .shade-left { background: linear-gradient(0deg, rgba(4,9,15,.72) 0%, transparent 58%); }
  .chapter,
  .chapter-left,
  .chapter-right {
    align-items: flex-end;
    justify-content: center;
    padding: 100px 16px 38px;
  }
  .copy { width: 100%; padding: 20px; border-radius: 20px; }
  .copy h1,
  .copy h2 { max-width: 16ch; font-size: clamp(1.85rem, 10vw, 3rem); }
  .specs { grid-template-columns: 1fr; }
  .specs span { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-track span { transition: none; }
  .scroll-cue { display: none; }
}

/* SCROLL_HOUSE_MOBILE_RESPONSIVE_V1 */
@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow-x: clip;
    }

    #experience,
    #scene,
    .shade {
        width: 100dvw;
        height: 100dvh;
    }

    #scene {
        touch-action: pan-y;
    }

    .hud {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 10px;
        padding:
            max(10px, env(safe-area-inset-top))
            12px
            10px;
        background:
            linear-gradient(
                180deg,
                rgba(4, 9, 15, 0.88) 0%,
                rgba(4, 9, 15, 0.45) 70%,
                transparent 100%
            );
    }

    .brand {
        gap: 8px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        font-size: 0.76rem;
    }

    .brand strong {
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .brand small {
        display: none;
    }

    .status {
        gap: 7px;
        min-width: 0;
        font-size: 0.66rem;
        white-space: nowrap;
    }

    .status span {
        display: block;
        max-width: 92px;
        overflow: hidden;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .status strong {
        min-width: 32px;
        font-size: 0.72rem;
    }

    .progress-track {
        height: 3px;
    }

    .shade-left {
        background:
            linear-gradient(
                0deg,
                rgba(4, 9, 15, 0.95) 0%,
                rgba(4, 9, 15, 0.62) 32%,
                rgba(4, 9, 15, 0.08) 62%,
                transparent 78%
            );
    }

    .shade-bottom {
        background:
            linear-gradient(
                0deg,
                rgba(4, 9, 15, 0.72) 0%,
                transparent 42%
            );
    }

    .chapter,
    .chapter-left,
    .chapter-right,
    .chapter-center {
        min-height: 125svh;
        align-items: flex-end;
        justify-content: center;
        padding:
            calc(max(76px, env(safe-area-inset-top) + 64px))
            12px
            max(14px, env(safe-area-inset-bottom));
    }

    .copy {
        width: min(100%, 400px);
        padding: 15px 16px;
        border-radius: 18px;
        background: rgba(7, 16, 25, 0.82);
        box-shadow: none;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .copy h1,
    .copy h2 {
        max-width: 17ch;
        margin: 6px 0 8px;
        font-size: clamp(1.55rem, 7.5vw, 2.3rem);
        line-height: 1;
        letter-spacing: -0.035em;
    }

    .copy p {
        font-size: clamp(0.84rem, 3.7vw, 0.95rem);
        line-height: 1.42;
    }

    .eyebrow {
        font-size: 0.62rem;
        letter-spacing: 0.13em;
    }

    .scroll-cue {
        margin-top: 12px;
        font-size: 0.72rem;
    }

    .final-copy {
        width: min(100%, 420px);
        text-align: left;
    }

    .final-copy h2,
    .final-copy p {
        margin-left: 0;
        margin-right: 0;
    }

    .specs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        margin-top: 12px;
    }

    .specs span {
        min-width: 0;
        padding: 8px 4px;
        font-size: 0.58rem;
        text-align: center;
    }

    .specs strong {
        margin-bottom: 2px;
        font-size: 0.88rem;
    }

    .fallback,
    .noscript {
        bottom: max(12px, env(safe-area-inset-bottom));
        width: calc(100% - 24px);
        padding: 12px 14px;
        border-radius: 14px;
        font-size: 0.86rem;
    }
}

@media (max-width: 420px) {
    .status span {
        display: none;
    }

    .copy {
        padding: 14px;
    }

    .copy h1,
    .copy h2 {
        font-size: clamp(1.45rem, 7.8vw, 2rem);
    }

    .copy p {
        font-size: 0.83rem;
    }

    .chapter,
    .chapter-left,
    .chapter-right,
    .chapter-center {
        min-height: 130svh;
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .hud {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .chapter,
    .chapter-left,
    .chapter-right,
    .chapter-center {
        min-height: 145svh;
        align-items: flex-end;
        justify-content: flex-start;
        padding:
            58px
            max(12px, env(safe-area-inset-right))
            10px
            max(12px, env(safe-area-inset-left));
    }

    .copy {
        width: min(370px, 56vw);
        padding: 12px 14px;
    }

    .copy h1,
    .copy h2 {
        margin: 4px 0 6px;
        font-size: clamp(1.25rem, 4.4vw, 1.8rem);
    }

    .copy p {
        font-size: 0.76rem;
        line-height: 1.32;
    }

    .scroll-cue {
        margin-top: 8px;
    }
}
/* END_SCROLL_HOUSE_MOBILE_RESPONSIVE_V1 */

