:root {
  /* Palette 1 Upgraded: Crisp Silver-Alabaster & Burnt Copper (Light Acts) */
  --mist: #f3f5f8;
  --surface: #ffffff;
  --signal: #c2410c;
  --signal-text: #b03706;
  --signal-hover: #9a3412;
  --copper-soft: #fae9e1;
  --ink: #111419;
  --ink-soft: #48505e;
  --line-light: #d7dde6;
  --line-strong: #b4becb;

  /* Palette 1 Upgraded: Obsidian Asphalt, Tungsten Copper & Petrol Teal (Dark Acts) */
  --console-bg: #0d0f13;
  --console-elevated: #151820;
  --console-well: #080a0d;
  --console-border: #252b36;
  --console-border-hi: #3a4354;
  --console-ink: #f3f5f9;
  --console-muted: #b4becd;
  --copper: #f37032;
  --copper-hi: #f78b54;
  --petrol: #2bb0b8;
  --petrol-deep: #0f525c;
  --console-green: #5ee39a;

  --display: 'Schibsted Grotesk', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --pad: clamp(20px, 5vw, 72px);
  --max-w: 1220px;
  --header-h: 58px;
  --rail-h: 52px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--line-strong) var(--mist);
  scrollbar-width: thin;
  overflow-x: clip;
}

body {
  background: var(--mist);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  caret-color: var(--signal);
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.tp-opening :focus-visible,
.band-dark :focus-visible,
.telemetry-card :focus-visible,
.workshop-lightbox :focus-visible {
  outline-color: var(--copper);
}

::selection {
  background: var(--signal);
  color: var(--surface);
}

.tp-opening ::selection,
.band-dark ::selection,
.telemetry-card ::selection {
  background: var(--copper);
  color: var(--console-well);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

code.tabular {
  font-family: var(--mono);
  font-size: 0.9em;
  font-weight: 500;
}

.inline-accent-link {
  font-family: var(--mono);
  font-size: 0.92em;
  font-weight: 500;
  color: var(--signal-text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--signal-text) 42%, transparent);
}

.inline-accent-link:hover {
  color: var(--signal-hover);
}

/* ============================================
   SKIP LINK, AUTO-ADAPTIVE TOPBAR & CHAPTER RAIL
   ============================================ */
.project-skip {
  position: fixed;
  inset: 10px auto auto 10px;
  z-index: 80;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--signal);
  color: var(--surface);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.project-skip:focus {
  transform: none;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
  padding: 12px var(--pad);
  background: color-mix(in srgb, var(--mist) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-light);
  color: var(--ink);
  transition: background-color 240ms ease, border-color 240ms ease, color 240ms ease;
}

.topbar.is-on-dark {
  background: rgba(13, 15, 19, 0.78);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: var(--console-ink);
}

.topbar .mark {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 15px;
  text-decoration: none;
  color: inherit;
}

.navlinks {
  margin-left: auto;
  display: flex;
  gap: 24px;
}

.navlinks a {
  position: relative;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink-soft);
  padding-block: 4px;
  transition: color 180ms ease;
}

.topbar.is-on-dark .navlinks a {
  color: var(--console-muted);
}

.navlinks a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar.is-on-dark .navlinks a::after {
  background: var(--copper);
}

.navlinks a:hover {
  color: var(--signal-text);
}

.topbar.is-on-dark .navlinks a:hover {
  color: #ffffff;
}

.navlinks a:hover::after {
  transform: scaleX(1);
}

.chapter-rail {
  position: sticky;
  top: var(--header-h);
  z-index: 45;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-light);
  transition: background-color 240ms ease, border-color 240ms ease, color 240ms ease;
}

.chapter-rail.is-on-dark {
  background: rgba(13, 15, 19, 0.92);
  border-bottom-color: var(--console-border);
  color: var(--console-ink);
}

.chapter-rail-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 8px var(--pad);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chapter-rail-inner::-webkit-scrollbar {
  display: none;
}

.chapter-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease, background-color 180ms ease;
}

.chapter-link:hover {
  color: var(--signal-text);
  background: var(--copper-soft);
}

.chapter-link[aria-current='location'] {
  color: var(--surface);
  background: var(--signal);
}

.chapter-rail.is-on-dark .chapter-link {
  color: var(--console-muted);
}

.chapter-rail.is-on-dark .chapter-link:hover {
  color: var(--console-ink);
  background: rgba(255, 255, 255, 0.07);
}

.chapter-rail.is-on-dark .chapter-link[aria-current='location'] {
  color: var(--console-well);
  background: var(--copper);
  font-weight: 600;
}

.chapter-progress {
  height: 2px;
  width: 100%;
  background: color-mix(in srgb, var(--line-light) 65%, transparent);
  overflow: hidden;
}

.chapter-rail.is-on-dark .chapter-progress {
  background: var(--console-border);
}

.chapter-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--signal);
  transform-origin: left;
  transform: scaleX(0);
}

.chapter-rail.is-on-dark .chapter-progress-bar {
  background: var(--copper);
}

/* ============================================
   ACT 01: MOODY EDITORIAL HERO & SPLIT BRIDGE
   ============================================ */
.tp-opening {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: end;
  overflow: clip;
  min-height: clamp(620px, 86svh, 840px);
  padding: 136px 48px 72px;
  background: var(--console-bg);
  color: var(--console-ink);
}

.tp-scene {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.tp-scene img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 52%;
}

.tp-opening::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(92deg, rgba(13, 15, 19, 0.94) 4%, rgba(13, 15, 19, 0.72) 34%, rgba(13, 15, 19, 0.14) 62%, transparent 88%),
    linear-gradient(0deg, #0d0f13 0%, rgba(13, 15, 19, 0.32) 18%, transparent 44%),
    linear-gradient(180deg, rgba(13, 15, 19, 0.55) 0%, transparent 24%);
}

.backbar {
  position: absolute;
  top: calc(var(--header-h) + 20px);
  left: var(--pad);
  z-index: 2;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--console-muted);
  text-decoration: none;
  transition: color 180ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.back-link:hover {
  color: #ffffff;
  transform: translateX(-3px);
}

.dhero {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
}

.dhero-inner {
  max-width: 600px;
}

.dhero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.15rem, 6.2vw, 5.15rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: #f6f8fb;
  text-wrap: balance;
}

.dhero h1 em {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-style: normal;
  font-weight: 600;
  font-size: clamp(1.85rem, 3.6vw, 2.95rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--copper-hi);
}

.hero-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--console-muted);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--console-green);
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms ease;
}

.live-indicator:hover {
  color: #ffffff;
  text-decoration: underline;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--console-green);
  flex: none;
}

.meta-sep {
  color: var(--console-border-hi);
}

.dpitch {
  margin-top: 20px;
  max-width: 49ch;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.66;
  color: #cdd4df;
  text-wrap: pretty;
}

.tp-stack {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--console-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.btn-primary,
.btn-secondary,
.btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.btn-primary {
  padding: 12px 20px;
  border: 1px solid #d95218;
  background: var(--signal);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 24px -12px rgba(0, 0, 0, 0.58);
}

.btn-primary:hover {
  background: var(--signal-hover);
  border-color: var(--copper);
}

.btn-secondary {
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(21, 24, 32, 0.72);
  color: var(--console-ink);
}

.btn-secondary:hover {
  border-color: var(--copper);
  color: #ffffff;
  background: rgba(31, 36, 48, 0.9);
}

.btn-quiet {
  padding: 12px 10px;
  color: var(--console-muted);
}

.btn-quiet:hover {
  color: var(--copper-hi);
}

/* Dark-to-Light Split Emergence Bridge */
.platform-emergence {
  background: linear-gradient(180deg, var(--console-bg) 0%, var(--console-bg) 48%, var(--mist) 48%, var(--mist) 100%);
  padding: clamp(28px, 4vw, 48px) var(--pad) clamp(56px, 7.5vw, 84px);
}

.emergence-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  perspective: 1100px;
}

.emergence-shell {
  border-radius: var(--r-lg);
  border: 1px solid var(--console-border-hi);
  background: var(--console-well);
  box-shadow: 0 32px 72px -28px rgba(8, 10, 14, 0.56);
  overflow: hidden;
  transform-origin: center top;
}

.emergence-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--console-elevated);
  border-bottom: 1px solid var(--console-border);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--console-muted);
}

.emergence-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.led-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--copper);
  flex: none;
}

.emergence-bar-title {
  color: var(--console-ink);
  font-weight: 500;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emergence-bar-title:hover {
  color: var(--copper-hi);
  text-decoration: underline;
}

.emergence-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.emerge-tab {
  min-height: 36px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--console-border-hi);
  background: var(--console-well);
  color: var(--console-muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.emerge-tab:hover {
  color: var(--console-ink);
  border-color: var(--copper);
}

.emerge-tab[aria-pressed='true'] {
  background: var(--copper);
  border-color: var(--copper);
  color: var(--console-well);
  font-weight: 600;
}

.emergence-media {
  position: relative;
  padding: clamp(14px, 2.2vw, 22px);
  background: #080a0d;
}

.emergence-media button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.emergence-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-sm);
}

.emergence-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 18px;
  background: var(--console-elevated);
  border-top: 1px solid var(--console-border);
  font-size: 14px;
  color: var(--console-muted);
}

.emergence-foot strong {
  color: var(--console-ink);
  font-weight: 500;
}

.zoom-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--copper-hi);
}

/* ============================================
   SHARED SECTION BANDS (LIGHT & DARK)
   ============================================ */
.band {
  scroll-margin-top: calc(var(--header-h) + var(--rail-h) + 16px);
  padding: 88px 48px;
}

.band-light {
  background: var(--mist);
  color: var(--ink);
  border-top: 1px solid var(--line-light);
}

.band-dark {
  background: var(--console-bg);
  color: var(--console-ink);
  border-top: 1px solid var(--console-border);
}

.band-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-header {
  max-width: 72ch;
  margin-bottom: clamp(32px, 4.5vw, 48px);
}

.section-header h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 3.9vw, 3.15rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.section-header h2 em {
  font-family: var(--display);
  font-style: normal;
  font-weight: 700;
  color: var(--signal-text);
}

.band-dark .section-header h2 em {
  color: var(--copper-hi);
}

.section-header p {
  margin-top: 14px;
  font-size: 16.5px;
  max-width: 64ch;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.band-dark .section-header p {
  color: var(--console-muted);
}

/* ============================================
   ACT 02: OVERVIEW & OBJECTIVES
   ============================================ */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.overview-copy p {
  font-size: 16px;
  line-height: 1.72;
  color: var(--ink-soft);
  max-width: 62ch;
}

.overview-copy p + p {
  margin-top: 16px;
}

.overview-copy strong {
  color: var(--ink);
  font-weight: 600;
}

.scope-panel {
  padding: 26px 28px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-light);
  background: var(--surface);
  box-shadow: 0 12px 30px -24px rgba(17, 20, 25, 0.14);
}

.scope-panel h3 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--signal-text);
  margin-bottom: 10px;
}

.scope-panel p {
  font-size: 14.5px;
  color: var(--ink-soft);
}

.scope-specs {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-light);
  display: grid;
  gap: 10px;
  list-style: none;
}

.scope-specs li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.scope-specs span {
  color: var(--ink-soft);
}

.scope-specs strong {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
}

.scope-specs a {
  color: var(--signal-text);
  text-decoration: underline;
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 44px;
  border: 1px solid var(--line-light);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}

.fact {
  padding: 24px 24px;
  border-right: 1px solid var(--line-light);
}

.fact:last-child {
  border-right: 0;
}

.fact strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.85rem, 2.8vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--signal-text);
  margin-bottom: 8px;
}

.fact span {
  display: block;
  font-size: 14px;
  color: var(--ink-soft);
}

.objectives-block {
  margin-top: 52px;
}

.sub-heading {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.1vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 18px;
}

.objective-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line-light);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}

.objective {
  padding: 24px 26px;
  border-right: 1px solid var(--line-light);
}

.objective:last-child {
  border-right: 0;
}

.objective h3 {
  font-family: var(--display);
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 8px;
}

.objective p {
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink-soft);
}

/* ============================================
   ACT 03: PINNED DUAL-PORTAL STORY STAGE (DARK)
   ============================================ */
.story-band {
  position: relative;
}

.story-mobile-tabs {
  display: none;
}

.story-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(28px, 4.5vw, 52px);
  align-items: start;
}

.story-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.story-step {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 40svh;
  padding: 26px 26px;
  border-radius: var(--r-lg);
  border: 1px solid var(--console-border);
  background: color-mix(in srgb, var(--console-elevated) 54%, transparent);
  cursor: pointer;
  transition: border-color 220ms ease, background-color 220ms ease, opacity 220ms ease;
  opacity: 0.62;
}

.story-step:hover {
  opacity: 0.9;
  border-color: var(--console-border-hi);
}

.story-step.is-active {
  opacity: 1;
  border-color: var(--copper);
  background: var(--console-elevated);
}

.story-step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 10px;
}

.step-num {
  display: inline-block;
  margin-right: 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--copper-hi);
}

.step-role-tag {
  flex: none;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--console-border-hi);
  background: var(--console-well);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  color: var(--petrol);
}

.story-step h3 {
  font-family: var(--display);
  font-size: clamp(1.3rem, 1.95vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.024em;
  line-height: 1.18;
  color: var(--console-ink);
}

.story-step p {
  font-size: 15px;
  color: var(--console-muted);
  max-width: 48ch;
}

.story-step-points {
  list-style: none;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--console-border);
  display: grid;
  gap: 8px;
}

.story-step-points li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  color: var(--console-ink);
}

.story-step-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--copper);
}

.story-monitor-wrap {
  position: sticky;
  top: calc(var(--header-h) + var(--rail-h) + 20px);
  perspective: 1200px;
}

.terminal-frame {
  border-radius: var(--r-lg);
  border: 1px solid var(--console-border-hi);
  background: var(--console-well);
  box-shadow: 0 32px 72px -28px rgba(0, 0, 0, 0.72);
  overflow: hidden;
  transform-origin: center top;
}

.terminal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 12px 16px;
  background: var(--console-elevated);
  border-bottom: 1px solid var(--console-border);
}

.terminal-ident {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.terminal-ident strong {
  color: var(--console-ink);
  font-weight: 500;
}

.terminal-counter {
  color: var(--copper-hi);
  font-size: 12px;
  font-weight: 500;
}

.terminal-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.terminal-sim-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  border: 1px solid color-mix(in srgb, var(--copper) 52%, transparent);
  background: color-mix(in srgb, var(--copper) 12%, var(--console-well));
  color: var(--copper-hi);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.terminal-sim-toggle:hover,
.terminal-sim-toggle[aria-pressed='true'] {
  background: var(--copper);
  color: var(--console-well);
  border-color: var(--copper);
  font-weight: 600;
}

.terminal-progress-track {
  height: 2px;
  background: var(--console-border);
}

.terminal-progress-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--copper);
  transform-origin: left;
  transform: scaleX(0.25);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-viewport {
  position: relative;
  padding: clamp(14px, 2vw, 20px);
  display: grid;
  place-items: center;
  background: #080a0d;
}

.terminal-viewport[hidden] {
  display: none;
}

.terminal-screen-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.terminal-screen-btn img {
  display: block;
  max-width: 100%;
  width: 100%;
  max-height: 400px;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-sm);
}

.terminal-zoom-pill {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--console-border-hi);
  background: rgba(10, 12, 16, 0.92);
  color: var(--console-ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  pointer-events: none;
}

.terminal-caption-bar {
  padding: 16px 18px;
  background: var(--console-elevated);
  border-top: 1px solid var(--console-border);
}

.terminal-caption-bar[hidden] {
  display: none;
}

.terminal-caption-bar strong {
  display: block;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--console-ink);
}

.terminal-caption-bar p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--console-muted);
}

.terminal-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 16px;
  background: var(--console-well);
  border-top: 1px solid var(--console-border);
}

.terminal-subtabs[hidden] {
  display: none;
}

.subtab-btn {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--console-border);
  background: var(--console-elevated);
  color: var(--console-muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.subtab-btn:hover {
  border-color: var(--console-border-hi);
  color: var(--console-ink);
}

.subtab-btn[aria-pressed='true'] {
  border-color: var(--copper);
  background: color-mix(in srgb, var(--copper) 16%, var(--console-well));
  color: var(--copper-hi);
}

/* Interactive Simulators inside Dark Console Frame */
.terminal-sim {
  padding: 20px 18px 22px;
  background: #080a0d;
  color: var(--console-ink);
  display: grid;
  gap: 16px;
}

.terminal-sim[hidden] {
  display: none;
}

.sim-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sim-heading {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--console-ink);
}

.sim-intro {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--console-muted);
}

.sim-race-btn {
  min-height: 38px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--copper);
  background: var(--copper);
  color: var(--console-well);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.sim-race-btn:hover {
  background: var(--copper-hi);
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.slot-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--console-border-hi);
  background: var(--console-elevated);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.slot-btn strong {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--console-ink);
}

.slot-btn span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--petrol);
}

.slot-btn:hover:not(:disabled) {
  border-color: var(--copper);
}

.slot-btn:disabled {
  border-color: var(--console-border);
  background: var(--console-well);
  opacity: 0.55;
  cursor: not-allowed;
}

.slot-btn:disabled span {
  color: var(--console-muted);
}

.slot-btn.is-booked {
  border-color: var(--copper);
  background: var(--copper);
}

.slot-btn.is-booked strong,
.slot-btn.is-booked span {
  color: var(--console-well);
}

.sim-invoice-badge {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--console-border-hi);
  background: var(--console-elevated);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  color: var(--console-ink);
}

.sim-invoice-badge.is-issued {
  border-color: var(--copper);
  color: var(--copper-hi);
}

.sim-invoice-badge.is-paid {
  border-color: var(--console-green);
  color: var(--console-green);
}

.job-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.job-stage-btn {
  min-height: 40px;
  padding: 10px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--console-border-hi);
  background: var(--console-elevated);
  color: var(--console-muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.job-stage-btn:hover {
  color: var(--console-ink);
  border-color: var(--copper);
}

.job-stage-btn[aria-pressed='true'] {
  background: var(--copper);
  border-color: var(--copper);
  color: var(--console-well);
  font-weight: 600;
}

.job-parts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.part-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--console-border-hi);
  background: var(--console-elevated);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.part-chip strong {
  font-size: 13.5px;
  color: var(--console-ink);
}

.part-chip span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--console-muted);
}

.part-chip[aria-pressed='true'] {
  border-color: var(--petrol);
  background: color-mix(in srgb, var(--petrol) 14%, var(--console-elevated));
}

.part-chip[aria-pressed='true'] span {
  color: var(--petrol);
}

.job-settlement-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--console-border);
}

.job-total-box span {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--console-muted);
}

.job-total-box strong {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--copper-hi);
}

.job-pay-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pay-btn {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--console-border-hi);
  background: var(--console-elevated);
  color: var(--console-ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.pay-btn:hover {
  border-color: var(--console-green);
}

.pay-btn.is-selected {
  background: var(--console-green);
  border-color: var(--console-green);
  color: var(--console-well);
  font-weight: 600;
}

.sim-receipt-box {
  padding: 16px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--console-border-hi);
  background: var(--console-well);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
}

.sim-receipt-title {
  color: var(--console-green);
  margin-bottom: 6px;
}

/* ============================================
   ACT 04: LIVE 5-NODE ARCHITECTURE EXPLORER
   ============================================ */
.erd-band {
  background:
    radial-gradient(60% 50% at 50% 42%, rgba(243, 112, 50, 0.08), transparent 72%),
    var(--console-bg);
}

.erd-stage {
  position: relative;
  padding: clamp(20px, 3vw, 36px);
  border-radius: var(--r-lg);
  border: 1px solid var(--console-border);
  background: color-mix(in srgb, var(--console-well) 86%, transparent);
}

.erd-svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.erd-path-base {
  fill: none;
  stroke: rgba(43, 176, 184, 0.32);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.erd-path-live {
  fill: none;
  stroke: var(--petrol);
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: stroke 200ms ease, stroke-width 200ms ease, opacity 200ms ease;
}

.erd-path-live.is-highlighted {
  stroke: var(--copper);
  stroke-width: 3;
  opacity: 1;
}

.erd-path-live.is-dimmed {
  opacity: 0.28;
}

.erd-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    'web-client . http-api'
    '. domain-core .'
    'mysql-locks . docker-ci';
  gap: clamp(18px, 3vw, 30px);
  align-items: center;
}

.erd-node {
  display: block;
  width: 100%;
  padding: 18px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--console-border-hi);
  background: var(--console-elevated);
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.erd-node:hover {
  border-color: var(--petrol);
  transform: translateY(-2px);
}

.erd-node[aria-pressed='true'] {
  border-color: var(--copper);
  background: color-mix(in srgb, var(--copper) 12%, var(--console-elevated));
}

.erd-node[data-node='web-client'] { grid-area: web-client; }
.erd-node[data-node='http-api'] { grid-area: http-api; }
.erd-node[data-node='domain-core'] {
  grid-area: domain-core;
  border-color: var(--petrol);
  background: color-mix(in srgb, var(--petrol-deep) 28%, var(--console-elevated));
}
.erd-node[data-node='mysql-locks'] { grid-area: mysql-locks; }
.erd-node[data-node='docker-ci'] { grid-area: docker-ci; }

.erd-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--console-border);
}

.erd-node-name {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--console-ink);
}

.erd-node-role {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--copper-hi);
  letter-spacing: 0.02em;
}

.erd-fields {
  list-style: none;
  display: grid;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--console-muted);
}

.erd-fields li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.erd-key {
  font-size: 12px;
  font-weight: 500;
  color: var(--petrol);
}

.erd-key.is-pk {
  color: var(--copper-hi);
}

.erd-inspector {
  margin-top: 22px;
  padding: 22px 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--console-border-hi);
  background: var(--console-elevated);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px 28px;
  align-items: start;
}

.erd-inspector h3 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--copper-hi);
  line-height: 1.2;
}

.erd-inspector p {
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--console-muted);
}

.erd-inspector-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.erd-inspector-cols li {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--console-border);
  background: var(--console-well);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--console-ink);
}

/* ============================================
   ACT 05: LIVE WORKSHOP TELEMETRY
   ============================================ */
.telemetry-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--console-border);
  background: var(--console-bg);
  color: var(--console-ink);
  box-shadow: 0 24px 60px -28px rgba(13, 15, 19, 0.35);
  overflow: hidden;
}

.telemetry-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 16px 22px;
  background: var(--console-elevated);
  border-bottom: 1px solid var(--console-border);
}

.telemetry-top-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--console-ink);
}

.telemetry-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--console-border);
}

.telemetry-kpi {
  padding: 22px 22px;
}

.telemetry-kpi + .telemetry-kpi {
  border-left: 1px solid var(--console-border);
}

.telemetry-kpi strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.75rem, 2.7vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--console-ink);
}

.telemetry-kpi.is-accent strong {
  color: var(--copper-hi);
}

.telemetry-kpi span {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--console-muted);
}

.telemetry-body {
  padding: clamp(20px, 3vw, 32px);
}

.telemetry-chart-view[hidden],
.telemetry-raw-view[hidden] {
  display: none;
}

.sales-chart-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-color: var(--console-border-hi) var(--console-bg);
  scrollbar-width: thin;
}

.sales-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
  align-items: end;
  height: 256px;
  padding-top: 24px;
}

.sales-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 8px;
}

.sales-val {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--console-ink);
  white-space: nowrap;
}

.sales-col.is-peak .sales-val {
  color: var(--copper-hi);
  font-weight: 600;
}

.sales-col.is-open .sales-val {
  color: var(--console-muted);
}

.sales-bar-wrap {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--console-border-hi);
}

.sales-bar {
  width: min(54px, 100%);
  height: var(--bar-h, 20%);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--petrol) 0%, var(--petrol-deep) 100%);
  transform-origin: bottom;
}

.sales-col.is-peak .sales-bar {
  background: linear-gradient(180deg, var(--copper-hi) 0%, var(--signal) 100%);
}

.sales-col.is-open .sales-bar {
  background: var(--console-border);
}

.sales-month {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--console-muted);
  white-space: nowrap;
}

.sales-col.is-peak .sales-month {
  color: var(--copper-hi);
  font-weight: 500;
}

.telemetry-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--console-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  font-size: 14px;
  color: var(--console-muted);
}

.telemetry-note strong {
  color: var(--console-ink);
  font-weight: 500;
}

.telemetry-raw-view button {
  display: block;
  width: 100%;
  border: 1px solid var(--console-border);
  background: #080a0d;
  padding: 16px;
  border-radius: var(--r-md);
  cursor: zoom-in;
}

.telemetry-raw-view img {
  display: block;
  width: 100%;
  max-height: 480px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  border-radius: var(--r-sm);
}

/* ============================================
   ACT 06: FULL-STACK ENGINEERING DEEP DIVE
   ============================================ */
.code-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.code-tab {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.code-tab:hover {
  border-color: var(--signal);
  color: var(--signal-text);
}

.code-tab[aria-selected='true'] {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--surface);
}

.code-panel {
  border-radius: var(--r-lg);
  border: 1px solid var(--line-light);
  background: var(--surface);
  padding: 28px;
  box-shadow: 0 12px 32px -24px rgba(17, 20, 25, 0.12);
}

.code-panel[hidden] {
  display: none;
}

.code-panel-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 20px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-light);
}

.code-panel-summary h3 {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.024em;
  color: var(--ink);
}

.code-panel-summary p {
  max-width: 64ch;
  font-size: 15px;
  color: var(--ink-soft);
}

.code-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.code-evidence-grid > * {
  min-width: 0;
}

.code-shot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.code-shot-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--console-border);
  background: var(--console-well);
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color 180ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.code-shot-btn:hover {
  border-color: var(--signal);
  transform: translateY(-2px);
}

.code-shot-btn img {
  display: block;
  width: 100%;
  max-height: 290px;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-sm);
}

.code-shot figcaption strong {
  display: block;
  font-family: var(--display);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.code-shot figcaption span {
  font-size: 14px;
  color: var(--ink-soft);
}

.code-spec-box {
  min-width: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--console-border);
  background: var(--console-bg);
  color: var(--console-ink);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.code-spec-bar {
  padding: 12px 18px;
  background: var(--console-elevated);
  border-bottom: 1px solid var(--console-border);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--copper-hi);
}

.code-spec-box pre {
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--console-ink);
}

/* ============================================
   ACT 07: EVOLUTION TABLE & CLOSING LINKS
   ============================================ */
.evo-table-wrap {
  overflow-x: auto;
}

.evo-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  border: 1px solid var(--line-light);
  background: var(--surface);
  text-align: left;
}

.evo-table th,
.evo-table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-light);
  vertical-align: top;
  font-size: 14.5px;
  line-height: 1.6;
}

.evo-table tbody tr:last-child th,
.evo-table tbody tr:last-child td {
  border-bottom: 0;
}

.evo-table thead th {
  background: var(--console-bg);
  color: var(--console-ink);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
}

.evo-table thead th.is-v2 {
  color: var(--copper-hi);
}

.evo-table tbody th {
  width: 22%;
  font-weight: 600;
  color: var(--ink);
}

.evo-table td.is-v1 {
  width: 36%;
  color: var(--ink-soft);
}

.evo-table td.is-v2 {
  width: 42%;
  color: var(--ink);
  font-weight: 500;
}

/* Closing Links & Origin Case Study */
.links-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.link-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.link-rows a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  font-family: var(--mono);
  font-size: 14.5px;
  color: var(--ink);
  text-decoration: none;
  transition: color 180ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.link-rows a.is-live-link {
  color: var(--signal-text);
  font-weight: 500;
}

.link-rows a:hover {
  color: var(--signal-text);
  transform: translateX(4px);
}

.link-rows svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: var(--signal-text);
}

.link-note {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
}

.next-project-link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 26px 28px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 200ms ease, box-shadow 220ms ease;
}

.next-project-link:hover {
  border-color: var(--signal);
  box-shadow: 0 20px 44px -26px rgba(17, 20, 25, 0.24);
}

.next-project-cta svg {
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.next-project-link:hover .next-project-cta svg {
  transform: translateX(5px);
}

.next-project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
}

.next-project-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--signal-text);
}

.next-project-link h3 {
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--ink);
}

.next-project-link p {
  font-size: 15px;
  color: var(--ink-soft);
}

.next-project-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--signal-text);
}

.site-footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 26px var(--pad);
  border-top: 1px solid var(--line-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.site-footer span:last-child {
  color: var(--signal-text);
}

/* ============================================
   NATIVE LIGHTBOX DIALOG
   ============================================ */
.workshop-lightbox {
  width: min(1140px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--console-border-hi);
  border-radius: var(--r-lg);
  background: var(--console-bg);
  color: var(--console-ink);
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}

.workshop-lightbox::backdrop {
  background: rgba(8, 10, 14, 0.84);
  backdrop-filter: blur(6px);
}

.workshop-lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--console-elevated);
  border-bottom: 1px solid var(--console-border);
}

.lightbox-title-wrap {
  min-width: 0;
}

.lightbox-title-wrap strong {
  display: block;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--console-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-counter {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--copper-hi);
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lightbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  min-width: 40px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--console-border-hi);
  background: var(--console-well);
  color: var(--console-ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.lightbox-btn:hover {
  border-color: var(--copper);
  color: var(--copper-hi);
}

.lightbox-stage {
  overflow: auto;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2.5vw, 28px);
  background: #080a0d;
}

.lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: 70dvh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-stage.is-zoomed {
  place-items: start;
}

.lightbox-stage.is-zoomed img {
  max-width: none;
  max-height: none;
}

.lightbox-foot {
  padding: 14px 18px;
  background: var(--console-elevated);
  border-top: 1px solid var(--console-border);
  font-size: 14px;
  color: var(--console-muted);
}

/* ============================================
   SCROLL & 3D PARALLAX MOTION STAGES
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
  #overview .band-inner,
  .erd-band .band-inner,
  #live-telemetry .band-inner,
  #evolution-v1 .band-inner {
    perspective: 1200px;
  }

  .fact-strip,
  .objective-list,
  .erd-stage,
  .telemetry-card,
  .evo-table-wrap,
  .code-inspector {
    transform-origin: center top;
  }

  .tp-scene img {
    transform-origin: center 55%;
  }

  .dhero-inner {
    transform-origin: left center;
  }
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 960px) {
  .band {
    padding: 64px 28px;
  }

  .overview-grid,
  .links-grid,
  .erd-inspector {
    grid-template-columns: 1fr;
  }

  .fact-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fact:nth-child(2n) {
    border-right: 0;
  }

  .fact:nth-child(n + 3) {
    border-top: 1px solid var(--line-light);
  }

  .objective-list {
    grid-template-columns: 1fr;
  }

  .objective {
    border-right: 0;
    border-bottom: 1px solid var(--line-light);
  }

  .objective:last-child {
    border-bottom: 0;
  }

  .story-mobile-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 14px;
    margin-bottom: 14px;
    scrollbar-width: none;
  }

  .story-mobile-tabs::-webkit-scrollbar {
    display: none;
  }

  .story-mobile-tab {
    flex: none;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--console-border-hi);
    background: var(--console-elevated);
    color: var(--console-muted);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
  }

  .story-mobile-tab[aria-pressed='true'] {
    background: var(--copper);
    border-color: var(--copper);
    color: var(--console-well);
    font-weight: 600;
  }

  .story-stage {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .story-monitor-wrap {
    position: static;
    order: -1;
  }

  .story-step {
    min-height: 0;
    padding: 20px;
    opacity: 1;
  }

  .story-stage.is-compact-ready .story-step:not(.is-active) {
    display: none;
  }

  .erd-svg {
    display: none;
  }

  .erd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      'domain-core domain-core'
      'web-client http-api'
      'mysql-locks docker-ci';
  }

  .telemetry-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .telemetry-kpi:nth-child(3) {
    border-left: 0;
  }

  .telemetry-kpi:nth-child(n + 3) {
    border-top: 1px solid var(--console-border);
  }

  .code-evidence-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tp-opening {
    min-height: 0;
    padding: 256px 24px 40px;
  }

  .tp-scene {
    top: var(--header-h);
    height: clamp(220px, 54vw, 320px);
    mask-image: linear-gradient(#000 0 68%, transparent);
    -webkit-mask-image: linear-gradient(#000 0 68%, transparent);
  }

  .tp-scene img {
    object-position: 78% 48%;
  }

  .tp-opening::after {
    content: none;
  }

  .slot-grid,
  .job-stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .job-parts-grid {
    grid-template-columns: 1fr;
  }

  .evo-table-wrap {
    overflow-x: visible;
  }

  .evo-table {
    min-width: 0;
  }

  .evo-table thead {
    display: none;
  }

  .evo-table,
  .evo-table tbody,
  .evo-table tr,
  .evo-table th,
  .evo-table td {
    display: block;
    width: 100%;
  }

  .evo-table tr {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line-light);
  }

  .evo-table tbody tr:last-child {
    border-bottom: 0;
  }

  .evo-table tbody th,
  .evo-table td.is-v1,
  .evo-table td.is-v2 {
    width: 100%;
    padding: 0;
    border-bottom: 0;
  }

  .evo-table tbody th {
    font-family: var(--display);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
  }

  .evo-table td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-soft);
    margin-bottom: 4px;
  }

  .evo-table td.is-v1 {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--line-light);
  }

  .evo-table td.is-v2::before {
    color: var(--signal-text);
  }
}

@media (max-width: 640px) {
  .tp-opening {
    padding: 236px 20px 36px;
  }

  .band {
    padding: 56px 20px;
  }

  .code-panel {
    padding: 20px;
  }

  .navlinks {
    display: none;
  }

  .fact-strip,
  .erd-grid {
    grid-template-columns: 1fr;
  }

  .erd-grid {
    grid-template-areas:
      'domain-core'
      'web-client'
      'http-api'
      'mysql-locks'
      'docker-ci';
  }

  .fact {
    border-right: 0;
    border-top: 1px solid var(--line-light);
  }

  .fact:first-child {
    border-top: 0;
  }

  .sales-chart {
    min-width: 440px;
    height: 230px;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tp-scene,
  .tp-scene img,
  .dhero-inner,
  .backbar,
  .emergence-shell,
  .emergence-media img,
  .section-header,
  .overview-copy,
  .scope-panel,
  .fact-strip,
  .fact,
  .objective-list,
  .objective,
  .story-step,
  .terminal-frame,
  .erd-stage,
  .erd-node,
  .erd-inspector,
  .telemetry-card,
  .code-inspector,
  .code-shot,
  .code-shot-btn,
  .code-spec-box,
  .evo-table-wrap,
  .evo-table tbody tr,
  .links-grid > div,
  .next-project-link {
    transform: none !important;
    opacity: 1 !important;
    clip-path: none !important;
  }
}
