/* ClaudeCraft — Scroll edition
   Single-page infinite-scroll variant with terminal/IDE-themed transitions.
   Palette: white / orange / black
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

@view-transition { navigation: auto; }

:root {
  --black: #0A0A0A;
  --ink: #1A1A1A;
  --white: #FAFAF7;
  --paper: #FFFFFF;
  --orange: #FF6B35;
  --orange-deep: #E04A12;
  --orange-soft: #FFE9DF;
  --line: #E5E2DC;
  --line-dark: #2A2A2A;
  --muted: #6B6B6B;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1100px;
  --readw: 680px;
  --radius: 14px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ----------- Layout primitives ----------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}
.read {
  max-width: var(--readw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ----------- Top navigation / journey progress ----------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--black);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  view-transition-name: brand;
}
.brand-mark {
  width: 22px; height: 22px;
  background: var(--orange);
  border-radius: 6px;
  display: inline-block;
  transform: rotate(45deg);
  transition: transform .4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(135deg); }

.journey {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  view-transition-name: journey;
}
.journey a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all .25s var(--ease);
  white-space: nowrap;
}
.journey a:hover {
  color: var(--black);
  border-color: var(--line);
}
.journey a.is-current {
  color: var(--paper);
  background: var(--black);
  border-color: var(--black);
}
.journey .sep {
  width: 6px; height: 1px; background: var(--line);
}

/* ----------- Hero (black slab) ----------- */
.hero {
  background: var(--black);
  color: var(--white);
  padding: 120px 0 100px;
  position: relative;
  overflow: hidden;
  view-transition-name: hero;
}
.hero::after {
  /* subtle orange glow */
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 60%; height: 80%;
  background: radial-gradient(closest-side, rgba(255,107,53,.35), transparent 70%);
  pointer-events: none;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 18px;
  display: inline-block;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 22px;
  max-width: 18ch;
}
.hero h1 .accent { color: var(--orange); }
.hero p.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: rgba(250,250,247,.78);
  max-width: 56ch;
}
.hero-actions {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ----------- Buttons ----------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.btn-primary {
  background: var(--orange);
  color: var(--black);
}
.btn-primary:hover {
  background: var(--paper);
  color: var(--black);
  transform: translateY(-1px);
}
.btn-ghost {
  color: var(--white);
  border-color: rgba(250,250,247,.25);
}
.btn-ghost:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.btn .arrow {
  transition: transform .25s var(--ease);
}
.btn:hover .arrow { transform: translateX(4px); }

/* ----------- Content sections ----------- */
.section {
  padding: 90px 0;
}
.section.tight { padding: 60px 0; }
.section.dark {
  background: var(--black);
  color: var(--white);
}
.section.cream {
  background: var(--orange-soft);
}

h2.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  color: var(--black);
}
.section.dark h2.section-title { color: var(--white); }

h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 28px 0 10px;
  color: var(--black);
}
.section.dark h3 { color: var(--white); }

p { margin-bottom: 16px; }
p.lead {
  font-size: 19px;
  color: var(--ink);
}
.section.dark p { color: rgba(250,250,247,.82); }

ul, ol { padding-left: 22px; margin-bottom: 18px; }
li { margin-bottom: 8px; }

a.inline {
  color: var(--orange-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--orange);
  transition: color .2s var(--ease);
}
a.inline:hover { color: var(--black); }

/* ----------- Cards / grids ----------- */
.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--orange);
  box-shadow: 0 18px 40px -22px rgba(255,107,53,.4);
}
.card .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--orange-deep);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.card h3 { margin-top: 8px; }
.card p { color: var(--muted); margin-bottom: 0; }

/* ----------- Code / quote blocks ----------- */
pre, code {
  font-family: var(--font-mono);
  font-size: 13.5px;
}
pre {
  background: var(--black);
  color: #E8E5DE;
  padding: 22px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.6;
  margin: 22px 0;
  border-left: 3px solid var(--orange);
}
code.inline {
  background: var(--orange-soft);
  color: var(--orange-deep);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.9em;
}

blockquote {
  border-left: 3px solid var(--orange);
  padding: 6px 0 6px 22px;
  margin: 26px 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.4;
  color: var(--black);
  letter-spacing: -0.01em;
}

.callout {
  background: var(--orange-soft);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 26px 0;
  border-left: 4px solid var(--orange);
}
.callout strong { color: var(--orange-deep); }

/* ----------- Foot nav (prev/next) ----------- */
.footnav {
  border-top: 1px solid var(--line);
  padding: 50px 0 80px;
  background: var(--white);
}
.footnav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footnav a {
  text-decoration: none;
  color: var(--black);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .25s var(--ease);
  min-width: 220px;
}
.footnav a:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
  transform: translateY(-2px);
}
.footnav .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.footnav .title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}
.footnav a.next { text-align: right; align-items: flex-end; }
.footnav a.next:hover .arrow { transform: translateX(6px); }
.footnav a.prev:hover .arrow { transform: translateX(-6px); }
.footnav .arrow {
  display: inline-block;
  color: var(--orange-deep);
  font-weight: 700;
  transition: transform .25s var(--ease);
}

/* ----------- Reveal-on-scroll ----------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ----------- Page-load fade (fallback for non-VT browsers) ----------- */
@media (prefers-reduced-motion: no-preference) {
  body { animation: pageIn .5s var(--ease) both; }
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ----------- View Transitions ----------- */
::view-transition-old(root) {
  animation: vt-out .35s var(--ease) both;
}
::view-transition-new(root) {
  animation: vt-in .45s var(--ease) both;
}
@keyframes vt-out {
  to { opacity: 0; transform: translateY(-12px) scale(.99); filter: blur(2px); }
}
@keyframes vt-in {
  from { opacity: 0; transform: translateY(14px) scale(.99); filter: blur(2px); }
}

/* ----------- Footer ----------- */
.site-footer {
  background: var(--black);
  color: rgba(250,250,247,.6);
  padding: 50px 0 60px;
  font-size: 13px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer a {
  color: var(--orange);
  text-decoration: none;
}

/* ----------- Cursor follower (home only) ----------- */
.cursor-glow {
  position: fixed;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,53,.18), transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1;
  transition: opacity .3s var(--ease);
  opacity: 0;
}

/* ----------- Numbered step header ----------- */
.step-marker {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
}
.step-marker .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 88px;
  line-height: 1;
  color: var(--orange);
  letter-spacing: -0.04em;
}
.step-marker .of {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(250,250,247,.6);
}

/* ----------- Responsive ----------- */
@media (max-width: 720px) {
  .hero { padding: 80px 0 70px; }
  .section { padding: 60px 0; }
  .topnav-inner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 12px 20px; }
  .journey { gap: 4px; }
  .journey a { padding: 5px 8px; font-size: 11px; }
  .step-marker .num { font-size: 64px; }
  .footnav-inner { flex-direction: column; }
  .footnav a { min-width: 0; }
}

/* ============================================================
   SCROLL EDITION — single-page additions
   ============================================================ */

html, body { background: var(--white); }

body.scroll-mode {
  background:
    linear-gradient(transparent 31px, rgba(10,10,10,.04) 32px) 0 0 / 100% 32px,
    var(--white);
}

/* ---------- Top scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--orange-deep));
  z-index: 200;
  transition: width .08s linear;
  box-shadow: 0 0 12px rgba(255,107,53,.6);
}

/* ---------- IDE-style sticky header ---------- */
.ide-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--black);
  color: var(--white);
  border-bottom: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 12px;
}
.ide-bar-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  height: 38px;
}
.ide-tabs {
  display: flex;
  align-items: stretch;
  height: 100%;
}
.ide-traffic {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-right: 1px solid var(--line-dark);
}
.ide-traffic span {
  width: 11px; height: 11px; border-radius: 50%;
  background: #555;
  display: inline-block;
}
.ide-traffic span:nth-child(1) { background: #FF5F56; }
.ide-traffic span:nth-child(2) { background: #FFBD2E; }
.ide-traffic span:nth-child(3) { background: #27C93F; }

.ide-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--ink);
  color: var(--white);
  border-right: 1px solid var(--line-dark);
  position: relative;
  letter-spacing: .02em;
}
.ide-tab::before {
  content: "●";
  color: var(--orange);
  font-size: 8px;
}
.ide-tab.is-active::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--orange);
}

.ide-status {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  color: rgba(250,250,247,.7);
}
.ide-status .branch::before {
  content: "⎇ ";
  color: var(--orange);
}
.ide-status .pos {
  color: var(--orange);
  letter-spacing: .04em;
}

@media (max-width: 720px) {
  .ide-bar-inner { height: 34px; font-size: 11px; }
  .ide-status { gap: 10px; padding: 0 12px; }
  .ide-status .branch { display: none; }
  .ide-tab { padding: 0 10px; }
}

/* ---------- Side minimap ---------- */
.minimap {
  position: fixed;
  top: 50%;
  right: 22px;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 8px;
  background: rgba(10,10,10,.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.minimap a {
  position: relative;
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line);
  text-decoration: none;
  transition: all .25s var(--ease);
}
.minimap a:hover { background: var(--orange); transform: scale(1.4); }
.minimap a.is-active {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255,107,53,.18);
}
.minimap a::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--black);
  background: var(--paper);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease);
}
.minimap a:hover::after { opacity: 1; }

@media (max-width: 720px) { .minimap { display: none; } }

/* ---------- Hero (scroll edition) ---------- */
.hero-scroll {
  min-height: calc(100vh - 38px);
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 60px 0;
}
.hero-scroll::before {
  /* dotted code-grid backdrop */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(250,250,247,.06) 1px, transparent 0);
  background-size: 22px 22px;
  pointer-events: none;
}
.hero-scroll::after {
  /* orange glow */
  content: "";
  position: absolute;
  right: -10%; bottom: -20%;
  width: 60%; height: 70%;
  background: radial-gradient(closest-side, rgba(255,107,53,.32), transparent 70%);
  pointer-events: none;
}
.hero-scroll .wrap { position: relative; z-index: 1; }

.terminal-window {
  background: rgba(20,20,20,.85);
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #E8E5DE;
  padding: 0;
  overflow: hidden;
  max-width: 720px;
  margin-bottom: 36px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.6);
}
.terminal-window .tw-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(40,40,40,.7);
  border-bottom: 1px solid var(--line-dark);
}
.terminal-window .tw-header span {
  width: 11px; height: 11px; border-radius: 50%;
}
.terminal-window .tw-header span:nth-child(1) { background: #FF5F56; }
.terminal-window .tw-header span:nth-child(2) { background: #FFBD2E; }
.terminal-window .tw-header span:nth-child(3) { background: #27C93F; }
.terminal-window .tw-header .title {
  width: auto;
  height: auto;
  border-radius: 0;
  margin-left: 12px;
  background: none;
  font-size: 11.5px;
  color: rgba(250,250,247,.55);
  letter-spacing: .04em;
}
.terminal-window .tw-body {
  padding: 18px 18px 22px;
  line-height: 1.7;
  min-height: 180px;
}
.tw-body .line { display: block; }
.tw-body .prompt { color: var(--orange); margin-right: 8px; }
.tw-body .ok { color: #27C93F; }
.tw-body .key { color: #FFBD2E; }
.tw-body .dim { color: rgba(232,229,222,.5); }
.tw-body .typed { display: inline; }
.tw-body .cursor {
  display: inline-block;
  width: 8px; height: 1.1em;
  background: var(--orange);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1.05s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-scroll h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  max-width: 18ch;
}
.hero-scroll h1 .accent { color: var(--orange); }
.hero-scroll p.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: rgba(250,250,247,.78);
  max-width: 56ch;
  margin-bottom: 28px;
}
.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(250,250,247,.5);
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.scroll-cue .arrow {
  display: block;
  font-size: 18px;
  color: var(--orange);
  animation: bob 1.6s var(--ease) infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: .9; }
  50% { transform: translateY(6px); opacity: .4; }
}

/* ---------- Terminal interstitials between sections ---------- */
.terminal-strip {
  background: var(--black);
  color: var(--white);
  padding: 28px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  position: relative;
  overflow: hidden;
}
.terminal-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 38px,
      rgba(255,107,53,.04) 38px,
      rgba(255,107,53,.04) 39px
    );
  pointer-events: none;
}
.terminal-strip .wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.terminal-strip .prompt {
  color: var(--orange);
  font-weight: 600;
}
.terminal-strip .cmd {
  color: var(--white);
  letter-spacing: .02em;
}
.terminal-strip .out {
  color: rgba(39,201,63,.95);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.terminal-strip .out::before { content: "↳"; color: rgba(250,250,247,.4); }
.terminal-strip .bar {
  flex: 1;
  height: 4px;
  background: rgba(255,107,53,.15);
  border-radius: 2px;
  overflow: hidden;
  min-width: 80px;
  max-width: 220px;
}
.terminal-strip .bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--orange);
  transition: width .9s var(--ease);
}
.terminal-strip.is-in .bar > i { width: 100%; }

/* ---------- Step section ---------- */
.step {
  padding: 110px 0;
  position: relative;
  scroll-margin-top: 60px;
}
.step.alt {
  background: var(--orange-soft);
}
.step.dark {
  background: var(--black);
  color: var(--white);
}
.step.dark .step-file,
.step.dark .step-title,
.step.dark p { color: var(--white); }
.step.dark p.lede { color: rgba(250,250,247,.8); }

.step-file {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .04em;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.step-file::before {
  content: "//";
  color: var(--orange);
  font-weight: 700;
}
.step.dark .step-file { color: rgba(250,250,247,.6); }

.step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--black);
  margin-bottom: 22px;
  display: inline-block;
  position: relative;
}
.step-title .accent { color: var(--orange); }
.step-title::after {
  content: "█";
  display: inline-block;
  margin-left: 10px;
  color: var(--orange);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.7em;
  vertical-align: 6px;
  animation: blink 1.05s steps(2) infinite;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange-deep);
  margin-bottom: 8px;
  display: inline-block;
}
.step.dark .step-num { color: var(--orange); }

.step p.lede {
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.5;
  color: var(--ink);
  max-width: 60ch;
  margin-bottom: 28px;
}

/* ---------- Glitch / scramble title (JS-driven) ---------- */
.glitch[data-glitch="ready"] {
  position: relative;
}
.glitch[data-glitch="running"] {
  color: var(--orange);
}
.glitch[data-glitch="running"] .accent {
  color: var(--white);
}
.step.dark .glitch[data-glitch="running"] .accent {
  color: var(--black);
}

/* ---------- Final CTA ---------- */
.finale {
  background: var(--black);
  color: var(--white);
  padding: 140px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.finale::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,107,53,.08) 1px, transparent 0);
  background-size: 26px 26px;
  pointer-events: none;
}
.finale .wrap { position: relative; }
.finale h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 22px;
  color: var(--white);
}
.finale h2 .accent { color: var(--orange); }
.finale p {
  color: rgba(250,250,247,.78);
  max-width: 56ch;
  margin: 0 auto 36px;
  font-size: 18px;
}
.finale .actions {
  display: inline-flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Section transitions on entry ---------- */
.step .reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.step.in .reveal-up { opacity: 1; transform: none; }
.step.in .reveal-up:nth-child(2) { transition-delay: .08s; }
.step.in .reveal-up:nth-child(3) { transition-delay: .16s; }
.step.in .reveal-up:nth-child(4) { transition-delay: .24s; }
.step.in .reveal-up:nth-child(5) { transition-delay: .32s; }
.step.in .reveal-up:nth-child(6) { transition-delay: .40s; }

/* Bracket-sweep border on step entry */
.step .frame {
  position: relative;
  padding-left: 24px;
}
.step .frame::before,
.step .frame::after {
  content: "";
  position: absolute;
  left: 0;
  width: 12px;
  height: 0;
  border-color: var(--orange);
  border-style: solid;
  border-width: 0;
  transition: height .8s var(--ease);
}
.step .frame::before { top: 0; border-width: 2px 0 0 2px; }
.step .frame::after { bottom: 0; border-width: 0 0 2px 2px; }
.step.in .frame::before,
.step.in .frame::after { height: 24px; }

/* ---------- Two-col layout for some steps ---------- */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; gap: 28px; } }

.aside-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
}
.step.dark .aside-card {
  background: rgba(255,255,255,.04);
  border-color: var(--line-dark);
  color: rgba(250,250,247,.85);
}
.aside-card .key { color: var(--orange-deep); }
.step.dark .aside-card .key { color: var(--orange); }
.aside-card .label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.step.dark .aside-card .label { color: rgba(250,250,247,.55); }

/* ---------- Inline pill list ---------- */
.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 0;
}
.pill-row span {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-deep);
  border: 1px solid rgba(255,107,53,.25);
}
.step.dark .pill-row span {
  background: rgba(255,107,53,.15);
  color: var(--orange);
  border-color: rgba(255,107,53,.3);
}

/* ---------- Compact card row ---------- */
.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.row .item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  background: var(--paper);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.row .item:hover { border-color: var(--orange); transform: translateY(-2px); }
.step.dark .row .item {
  background: rgba(255,255,255,.03);
  border-color: var(--line-dark);
}
.row .item .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--orange-deep);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.step.dark .row .item .num { color: var(--orange); }
.row .item h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  margin: 6px 0 6px;
  color: var(--black);
}
.step.dark .row .item h4 { color: var(--white); }
.row .item p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}
.step.dark .row .item p { color: rgba(250,250,247,.72); }

/* ---------- Pull quote (scroll edition) ---------- */
.pull {
  border: none;
  padding: 32px 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--black);
  position: relative;
}
.step.dark .pull { color: var(--white); }
.pull::before {
  content: "“";
  position: absolute;
  left: -8px; top: -18px;
  font-size: 64px;
  color: var(--orange);
  line-height: 1;
  font-family: var(--font-display);
}

/* ---------- Footer (scroll) ---------- */
.scroll-footer {
  background: var(--black);
  color: rgba(250,250,247,.55);
  padding: 36px 0 44px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  border-top: 1px solid var(--line-dark);
}
.scroll-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.scroll-footer a { color: var(--orange); text-decoration: none; }
.scroll-footer .prompt { color: var(--orange); margin-right: 6px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue .arrow,
  .terminal-window .tw-body .cursor,
  .step-title::after { animation: none; }
  .step .reveal-up { transition: none; opacity: 1; transform: none; }
}

/* ============================================================
   COMBINED edition extensions
   Long-form content + dark sub-blocks inside each step.
   ============================================================ */

/* More stagger slots — combined steps have more reveal-up children */
.step.in .reveal-up:nth-child(7)  { transition-delay: .48s; }
.step.in .reveal-up:nth-child(8)  { transition-delay: .56s; }
.step.in .reveal-up:nth-child(9)  { transition-delay: .60s; }
.step.in .reveal-up:nth-child(10) { transition-delay: .64s; }
.step.in .reveal-up:nth-child(n+11) { transition-delay: .68s; }

/* Breathing room between major reveal blocks inside a step */
.step .frame > .reveal-up + .reveal-up,
.step .frame > .reveal-up + .glitch,
.step .frame > .glitch + .reveal-up,
.step .frame > .reveal-up + .pull,
.step .frame > .pull + .reveal-up,
.step .frame > .reveal-up + .callout,
.step .frame > .callout + .reveal-up,
.step .frame > .reveal-up + .subdark,
.step .frame > .subdark + .reveal-up { margin-top: 36px; }

/* Long-form prose block — readable measure */
.step .prose { max-width: 64ch; }
.step .prose p { margin-bottom: 16px; }
.step .prose p:last-child { margin-bottom: 0; }
.step .prose p.lead {
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--black);
  margin-bottom: 20px;
}
.step.alt .prose p.lead { color: var(--black); }
.step.dark .prose p { color: rgba(250,250,247,.84); }
.step.dark .prose p.lead { color: var(--white); }

/* Optional sub-headings inside a step */
.step h3.sub {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
  color: var(--black);
}
.step.dark h3.sub { color: var(--white); }

/* Card adjustments for dark steps */
.step.dark .card {
  background: rgba(255,255,255,.04);
  border-color: var(--line-dark);
}
.step.dark .card h3 { color: var(--white); }
.step.dark .card p { color: rgba(250,250,247,.7); }
.step.dark .card .num { color: var(--orange); }
.step.dark .card:hover {
  border-color: var(--orange);
  box-shadow: 0 18px 40px -22px rgba(255,107,53,.4);
}

/* Inline code/links inside steps */
.step a.inline { color: var(--orange-deep); }
.step.dark a.inline { color: var(--orange); border-bottom-color: var(--orange); }
.step.dark code.inline {
  background: rgba(255,107,53,.18);
  color: var(--orange);
}

/* Lists */
.step ul, .step ol { padding-left: 22px; margin-bottom: 0; }
.step li { margin-bottom: 8px; line-height: 1.6; }
.step.dark li { color: rgba(250,250,247,.85); }

/* Pre blocks already styled, but tighten margin inside frame */
.step pre { margin: 0; }

/* Dark sub-block — inversion of the section, used for callout-style mid-step asides */
.subdark {
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  padding: 36px 40px;
  position: relative;
  overflow: hidden;
}
.subdark::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,107,53,.07) 1px, transparent 0);
  background-size: 22px 22px;
  pointer-events: none;
}
.subdark > * { position: relative; z-index: 1; }
.subdark .sub-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange);
  display: block;
  margin-bottom: 10px;
}
.subdark h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--white);
  margin: 0 0 14px;
}
.subdark p {
  color: rgba(250,250,247,.82);
  max-width: 60ch;
  margin-bottom: 14px;
}
.subdark p:last-of-type { margin-bottom: 0; }
.subdark blockquote {
  border-left: 3px solid var(--orange);
  padding: 6px 0 6px 20px;
  margin-top: 20px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.35;
  color: var(--white);
  letter-spacing: -0.01em;
}

/* On already-dark steps, invert the subdark to feel like an orange-tinted lift */
.step.dark .subdark {
  background: rgba(255,107,53,.06);
  border: 1px solid rgba(255,107,53,.22);
  color: var(--white);
}
.step.dark .subdark::before { display: none; }

/* Step actions row */
.step .step-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Two-column with prose left + aside-card right (used in some steps) */
.step .layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
@media (max-width: 880px) {
  .step .layout-2 { grid-template-columns: 1fr; gap: 28px; }
}

/* Final CTA buttons inside finale already styled by .btn */

/* Callouts: keep dark text regardless of section bg (callout is always light) */
.step .callout { color: var(--ink); }
.step .callout strong { color: var(--orange-deep); }
.step .callout em { color: var(--ink); }
.step .callout a { color: var(--orange-deep); }

/* On alt (orange-soft) sections, the orange-soft callout bg blends in.
   Swap to a white bg with a soft orange border so it stays distinct. */
.step.alt .callout {
  background: var(--paper);
  border: 1px solid rgba(255,107,53,.28);
  border-left: 4px solid var(--orange);
}

/* ============================================================
   DECK EDITION — one stop at a time, blur + fade between stops
   Layered on top of the scroll/combined styles above; these win
   by cascade order. The page never scrolls; each stop is a panel.
   ============================================================ */

html, body { height: 100%; }

body.deck-mode {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;            /* the page itself never scrolls */
  display: flex;
  flex-direction: column;
  background: var(--white);
}

/* Top progress line — JS sets width to (stop + 1) / total */
.scroll-progress { transition: width .4s var(--ease); }

/* ---------- IDE bar = top chrome, now carries the dot nav ---------- */
.ide-bar { position: relative; flex: 0 0 auto; }
.ide-bar-inner { gap: 8px; }
.ide-tabs { flex: 0 0 auto; }
.ide-status { flex: 0 0 auto; }

.deck-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
}
.deck-nav .dot {
  position: relative;
  width: 9px; height: 9px;
  padding: 0; border: 0;
  border-radius: 50%;
  background: #3a3a3a;
  cursor: pointer;
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.deck-nav .dot:hover { background: var(--orange); transform: scale(1.35); }
.deck-nav .dot.is-active {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255,107,53,.20);
}
.deck-nav .dot::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--black);
  background: var(--paper);
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid var(--line);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease);
  z-index: 5;
}
.deck-nav .dot:hover::after,
.deck-nav .dot:focus-visible::after { opacity: 1; }

/* ---------- Deck viewport + panels ---------- */
.deck {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;               /* lets the panel scroll inside the flex column */
  overflow: hidden;
}
.panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  outline: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.995);
  filter: blur(8px);
  transition: opacity .4s var(--ease), filter .4s var(--ease),
              transform .4s var(--ease), visibility .4s var(--ease);
  /* faint code-grid texture on the light panels */
  background:
    linear-gradient(transparent 31px, rgba(10,10,10,.03) 32px) 0 0 / 100% 32px,
    var(--white);
}
.panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  filter: none;
  z-index: 2;
}
.panel.panel-alt  { background: var(--orange-soft); }
.panel.panel-dark { background: var(--black); }

/* Hero fills its panel; finale centres vertically */
.panel .hero-scroll { min-height: 100%; }
.panel .step { padding: 56px 0 88px; scroll-margin-top: 0; }

/* Hero deck extras */
.panel .hero-scroll .hero-actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }
.deck-hint {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(250,250,247,.5);
  letter-spacing: .03em;
}
.deck-hint kbd {
  font-family: var(--font-mono);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 5px;
  padding: 1px 7px;
  color: var(--orange);
  font-size: 11px;
}

/* Finale credit line */
.finale .credit {
  margin-top: 44px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(250,250,247,.5);
}
.finale .credit .prompt { color: var(--orange); margin-right: 6px; }
.finale .credit a { color: var(--orange); text-decoration: none; }

/* ---------- Bottom control bar ---------- */
.deck-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  z-index: 60;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 156px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--black);
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform .2s var(--ease), border-color .2s var(--ease),
              background .2s var(--ease), color .2s var(--ease), opacity .2s var(--ease);
}
.nav-btn .meta { display: flex; flex-direction: column; line-height: 1.15; }
.nav-btn .cap {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-btn .lbl { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.nav-btn .arrow {
  font-size: 22px; line-height: 1;
  color: var(--orange-deep);
  transition: transform .2s var(--ease);
}
.nav-btn.prev { justify-content: flex-start; }
.nav-btn.prev .meta { align-items: flex-start; }
.nav-btn.next { justify-content: flex-end; }
.nav-btn.next .meta { align-items: flex-end; }
.nav-btn:hover:not(:disabled) { border-color: var(--orange); background: var(--orange-soft); transform: translateY(-1px); }
.nav-btn.prev:hover:not(:disabled) .arrow { transform: translateX(-4px); }
.nav-btn.next:hover:not(:disabled) .arrow { transform: translateX(4px); }
.nav-btn:disabled { opacity: .3; cursor: default; }

/* Next gets the dark/accent treatment to pull the reader forward */
.nav-btn.next { background: var(--black); border-color: var(--black); color: var(--white); }
.nav-btn.next .cap { color: rgba(250,250,247,.6); }
.nav-btn.next .arrow { color: var(--orange); }
.nav-btn.next:hover:not(:disabled) { background: var(--orange); border-color: var(--orange); color: var(--black); }
.nav-btn.next:hover:not(:disabled) .cap { color: rgba(10,10,10,.6); }
.nav-btn.next:hover:not(:disabled) .arrow { color: var(--black); }

.deck-controls .counter {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--muted);
  white-space: nowrap;
}
.deck-controls .counter .cur { color: var(--orange-deep); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .deck-nav { gap: 8px; }
  .deck-nav .dot { width: 8px; height: 8px; }
  .nav-btn { min-width: 0; padding: 8px 12px; gap: 8px; }
  .nav-btn .lbl { display: none; }
  .deck-controls { padding: 8px 12px; }
  .panel .step { padding: 40px 0 72px; }
}

/* ---------- Reduced motion: instant swap, no blur/slide ---------- */
@media (prefers-reduced-motion: reduce) {
  .panel {
    transition: opacity .12s linear, visibility .12s linear;
    transform: none;
    filter: none;
  }
  .scroll-progress { transition: none; }
}

