/* Layout + components for the story scaffold.
 * Colors, type, spacing and motion all come from css/tokens.css
 * (introduced by task-scaffold-design).
 */

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  padding: 0 var(--space-4);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 10;
  padding: var(--space-2) var(--space-3);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
}

.skip-link:focus {
  left: 0;
}

/* Header ---------------------------------------------------------------- */

.site-header {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--content-max);
  margin-inline: auto;
}

.site-kicker {
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

.site-title {
  font-family: var(--font-mono);
  font-size: var(--step-5);
  line-height: 1.05;
  margin-top: var(--space-2);
}

.site-subtitle {
  margin-top: var(--space-3);
  font-size: var(--step-1);
  color: var(--ink-dim);
}

.site-hint {
  margin-top: var(--space-6);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--step-0);
}

/* Scenes ----------------------------------------------------------------- */

/* Scenes are normal-flow sections (task-motion-premium): no pinning, no
 * sticky scrub range, so native scroll always moves the content. Scene
 * animations are driven by how far the section has travelled through the
 * viewport (js/scrub.js viewProgress). */
.scene {
  position: relative;
}

.scene-inner {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-block: var(--space-7);
}

/* The final chapter needs no scrub range. */
#ch8 {
  min-height: 100vh;
}

.chapter-kicker {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.chapter-title {
  font-family: var(--font-mono);
  font-size: var(--step-4);
  line-height: 1.15;
  margin-top: var(--space-3);
}

.chapter-body {
  margin-top: var(--space-4);
  font-size: var(--step-1);
}

.scene-stage {
  margin-top: var(--space-5);
  min-height: 14rem;
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

.scene-stage::after {
  content: "scene stage — " attr(data-stage);
}

/* Chapter copy helpers (task-chapters-copy) -------------------------------- */

.chapter-takeaway {
  margin-top: var(--space-3);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--step-0);
}

.chapter-takeaway::before {
  content: "> ";
}

.chapter-body code {
  font-family: var(--font-mono);
  color: var(--accent);
}

.chapter-contact {
  margin-top: var(--space-4);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

.chapter-contact a {
  color: var(--accent);
}

/* Reveal ------------------------------------------------------------------ */

/* Content is never dimmed at rest; the subtle per-element reveal lives in
   css/polish.css behind html.polish + no-preference. */

@media (prefers-reduced-motion: reduce) {
  .scene {
    opacity: 1;
    transform: none;
    transition: none;
  }

}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  padding: var(--space-7) 0 var(--space-6);
  color: var(--ink-dim);
  max-width: var(--content-max);
  margin-inline: auto;
  font-size: var(--step--1);
}

/* Accessibility helper (task-timeline-progress) --------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
