/* Home page scroll story styles (overrides site.css). */

/* `overflow-x: hidden` on body can turn it into a scroll container in some browsers and break
   position: sticky. `clip` hides horizontal overflow without creating a scroll container. */
html, body { overflow-x: clip; }

/* ---------- stage (desktop and shared) ---------- */
.stage {
  background: radial-gradient(120% 90% at 50% 40%, var(--panel) 0%, var(--panel-2) 60%, var(--bg) 100%);
  border-left: 1px solid var(--line);
  isolation: isolate;
}
.stage canvas { position: relative; z-index: 0; touch-action: pan-y; pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.stage.is-ready canvas { opacity: 1; }
.stage::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(140% 100% at 50% 45%, transparent 55%, rgba(10, 9, 8, .55) 100%);
}
.stage__labels { z-index: 2; }
.stage__corner { z-index: 3; border-color: var(--brass); opacity: .85; }
.stage__steps { z-index: 3; }

/* labels pinned to points in the room */
.lbl { font-family: var(--body); letter-spacing: .01em; }
.lbl--dim {
  color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--brass); padding: 3px 8px; border-radius: 2px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.lbl--zone {
  color: var(--text); font-weight: 500;
  border: 1px dashed rgba(236, 232, 228, .7); padding: 4px 10px; border-radius: 2px;
  background: rgba(20, 18, 17, .6);
}
.lbl--tag {
  color: var(--text); font-weight: 500; padding: 7px 11px;
  background: rgba(20, 18, 17, .82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-left: 2px solid var(--brass); border-radius: 2px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

/* step indicator */
.stage__steps {
  background: rgba(20, 18, 17, .78);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.stage__steps li { font-family: var(--body); color: var(--muted); border-left: 1px solid var(--line); letter-spacing: .02em; }
.stage__steps li.is-done { color: var(--text); }
.stage__steps li.is-current { color: var(--ink, #141211); background: var(--brass); font-weight: 600; }

.stage__fallback { z-index: 4; }

/* ---------- mobile: stage pinned full screen, steps scroll over it as cards ---------- */
@media (max-width: 860px) {
  .story { grid-template-columns: minmax(0, 1fr); }
  .stage {
    grid-area: 1 / 1; order: 0; align-self: start;
    position: -webkit-sticky; position: sticky; top: 0;
    height: 100vh; height: 100svh;
    z-index: 0; border: 0;
  }
  .story__steps { grid-area: 1 / 1; position: relative; z-index: 2; padding: 0 12px; pointer-events: none; }
  .story__step {
    pointer-events: auto;
    min-height: 0; max-width: 560px;
    margin: 0 auto 72vh; margin-bottom: 72svh;
    padding: 18px 20px 20px;
    background: rgba(20, 18, 17, .8);
    -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
    border: 1px solid var(--line); border-top: 2px solid var(--brass); border-radius: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .45);
  }
  .story__step:last-child { margin-bottom: 38vh; margin-bottom: 38svh; }
  .story__step h2 { font-size: clamp(1.6rem, 7vw, 2.1rem); margin-bottom: .3em; }
  .story__step p { font-size: 1rem; margin-bottom: 0; color: var(--text); opacity: .86; }
  .story__num { margin-bottom: 4px; }

  /* hero: text on a scrim at the bottom of the first screen, room visible above */
  .story__step--hero {
    min-height: calc(100vh - 72px); min-height: calc(100svh - 72px);
    margin: 0 -12px 46vh; margin-bottom: 46svh; max-width: none;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 0 var(--gut) 26px;
    background: linear-gradient(to top, var(--bg) 0%, rgba(20, 18, 17, .92) 34%, rgba(20, 18, 17, .55) 52%, rgba(20, 18, 17, 0) 66%);
    -webkit-backdrop-filter: none; backdrop-filter: none;
    border: 0; border-radius: 0; box-shadow: none;
  }
  .story__step--hero p { color: var(--text); opacity: .82; }

  .stage__steps { top: 12px; bottom: auto; max-width: calc(100% - 20px); }
  .stage__steps li { padding: 5px 8px; font-size: .7rem; }
  .stage__corner { display: none; }
  .lbl { font-size: 11px; }
  .lbl--tag { padding: 4px 8px; }
}
@media (max-width: 380px) {
  .stage__steps li { padding: 5px 6px; font-size: .64rem; }
}
