/* =========================================================
   HarnessTron Concept B: Graph Story Stylesheet
   Direction: 100svh Sticky Story, Left Vertical Rail,
   Full-Bleed 3D ASCII Graph, Right-Aligned Header.
   ========================================================= */

/* --- CSS Variables & Design Tokens --- */
:root {
  --font-sans: 'Inter', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, ui-monospace, Menlo, monospace;

  /* Dark Theme (Default) */
  --color-bg: #07090c;
  --color-bg-alt: #0d1117;
  --color-card-bg: rgba(13, 17, 23, 0.75);
  --color-text-main: #f1f5f9;
  --color-text-dim: #cbd5e1;
  --color-text-muted: #64748b;
  --color-border: rgba(148, 163, 184, 0.16);
  --color-border-bright: rgba(148, 163, 184, 0.35);

  --color-accent: #60a5fa;
  --color-accent-hover: #93c5fd;
  --color-accent-glow: rgba(96, 165, 250, 0.35);
  --color-purple-glow: rgba(168, 85, 247, 0.25);

  --color-terminal-bg: rgba(9, 12, 18, 0.85);
  --color-terminal-border: rgba(96, 165, 250, 0.25);
  --color-terminal-text: #38bdf8;

  --scrim-gradient: radial-gradient(ellipse at 20% 50%, rgba(7, 9, 14, 0.94) 0%, rgba(7, 9, 14, 0.82) 60%, rgba(7, 9, 14, 0.4) 85%, transparent 100%);
  --shadow-window: 0 0 50px rgba(96, 165, 250, 0.12), 0 25px 60px rgba(0, 0, 0, 0.75);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --color-bg: #f8fafc;
  --color-bg-alt: #f1f5f9;
  --color-card-bg: rgba(255, 255, 255, 0.82);
  --color-text-main: #0f172a;
  --color-text-dim: #334155;
  --color-text-muted: #64748b;
  --color-border: rgba(15, 23, 42, 0.12);
  --color-border-bright: rgba(15, 23, 42, 0.25);

  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-glow: rgba(37, 99, 235, 0.2);
  --color-purple-glow: rgba(147, 51, 234, 0.15);

  --color-terminal-bg: rgba(248, 250, 252, 0.92);
  --color-terminal-border: rgba(37, 99, 235, 0.35);
  --color-terminal-text: #025a8c;

  --scrim-gradient: radial-gradient(ellipse at 20% 50%, rgba(248, 250, 252, 0.96) 0%, rgba(248, 250, 252, 0.88) 60%, rgba(248, 250, 252, 0.45) 85%, transparent 100%);
  --shadow-window: 0 0 40px rgba(37, 99, 235, 0.08), 0 20px 45px rgba(15, 23, 42, 0.12);
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip; /* Strict prevention of horizontal scroll, preserves sticky */
}

body {
  min-height: 100vh;
  position: relative;
  background-color: var(--color-bg);
  color: var(--color-text-main);
  overflow-x: clip;
}

.mono {
  font-family: var(--font-mono);
}

/* --- Background Aurora & ASCII Canvas System --- */
.bg-system {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

#graph-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.corner-glow {
  position: absolute;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.35;
  transition: opacity var(--transition-smooth);
}

.glow-top-left {
  top: -20vw;
  left: -20vw;
  background: radial-gradient(circle, #4f46e5 0%, rgba(79, 70, 229, 0.2) 50%, transparent 75%);
}

.glow-top-right {
  top: -20vw;
  right: -20vw;
  background: radial-gradient(circle, #7c3aed 0%, rgba(124, 58, 237, 0.18) 50%, transparent 75%);
}

.glow-bottom-left {
  bottom: -20vw;
  left: -20vw;
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0.18) 50%, transparent 75%);
}

.glow-bottom-right {
  bottom: -20vw;
  right: -20vw;
  background: radial-gradient(circle, #8b5cf6 0%, rgba(139, 92, 246, 0.18) 50%, transparent 75%);
}

[data-theme="light"] .corner-glow {
  opacity: 0.05;
}

/* --- Content Wrapper --- */
.content-wrap {
  width: 100%;
  max-width: 1380px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 4vw, 48px);
  padding-right: clamp(20px, 4vw, 48px);
}

/* --- Header: Strictly Right-Aligned & Transparent --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 90;
  background: transparent !important;
  border: none !important;
  backdrop-filter: none !important;
  pointer-events: none; /* Allows canvas clicks through, child links enable pointer-events */
}

.header-inner {
  display: flex;
  justify-content: flex-end; /* Strictly right-aligned, nothing on the left */
  align-items: center;
  padding: clamp(14px, 2.5vw, 24px) clamp(20px, 4vw, 48px);
  max-width: 1540px;
  margin-left: auto;
  margin-right: 0;
}

.nav-cluster-right {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
  background: transparent;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: var(--color-text-main);
  transition: opacity var(--transition-fast);
}

.brand-link:hover {
  opacity: 0.85;
}

.brand-icon {
  width: 52px;
  height: 20px;
  color: var(--color-accent);
}

.brand-text {
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  -webkit-text-stroke: 0.5px currentColor; /* fallback mono fonts stop at 700; this makes 900 read as black */
  color: var(--color-text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Theme + menu buttons: bare SVG icons only. No circle, no border, no background. */
.icon-toggle-btn,
.nav-drawer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--color-text-main);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.icon-toggle-btn svg,
.nav-drawer-toggle svg {
  width: 28px;
  height: 28px;
  display: block;
}

.icon-toggle-btn:hover,
.nav-drawer-toggle:hover {
  background: none;
  color: var(--color-accent);
}

.icon-toggle-btn:focus-visible,
.nav-drawer-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Dark theme shows the sun (click = go light); light theme shows the moon (click = go dark) */
.icon-toggle-btn .theme-icon-moon { display: none; }
[data-theme="light"] .icon-toggle-btn .theme-icon-sun { display: none; }
[data-theme="light"] .icon-toggle-btn .theme-icon-moon { display: block; }

/* --- Slide-out Navigation Drawer --- */
.site-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--color-bg-alt);
  border-left: 1px solid var(--color-border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  transition: right var(--transition-smooth);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.site-drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
}

.drawer-title {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.drawer-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--color-text-dim);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.drawer-footer {
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-pill-primary {
  background-color: var(--color-accent);
  color: #ffffff;
  border: 1px solid transparent;
  box-shadow: 0 2px 14px var(--color-accent-glow);
}

[data-theme="light"] .btn-pill-primary {
  color: #ffffff;
}

.btn-pill-primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--color-accent-glow);
}

.btn-pill-ghost {
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
}

.btn-pill-ghost:hover {
  background: rgba(148, 163, 184, 0.2);
  border-color: var(--color-border-bright);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 14px 30px;
  font-size: 1rem;
}

/* --- Shared Micro Typography --- */
.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--color-text-dim);
  margin-bottom: 20px;
}

.version-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: var(--color-accent);
  font-weight: 600;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-xs {
  font-size: 0.75rem;
}

/* =========================================================
   1. INTRO HERO SECTION
   ========================================================= */
.intro-section {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  z-index: 10;
  padding-top: 100px;
  padding-bottom: 60px;
}

.intro-grid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100svh - 160px);
}

.intro-body {
  position: relative;
  max-width: 820px;
}

.scrim-panel {
  display: none;
}

.main-headline {
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--color-text-main);
  margin-bottom: 24px;
}

.main-subline {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.6;
  color: var(--color-text-dim);
  max-width: 680px;
  margin-bottom: 36px;
}

.intro-cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.cli-pills-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--color-text-dim);
  flex-wrap: wrap;
}

.cli-pill {
  padding: 4px 10px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-main);
}

.cli-sep {
  color: var(--color-text-muted);
}

.intro-scroll-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 48px;
  letter-spacing: 0.04em;
}

.scroll-arrow {
  display: inline-block;
  animation: bounceDown 1.8s infinite;
  color: var(--color-accent);
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}


/* =========================================================
   2. PINNED 11-CHAPTER GRAPH STORY (100svh Sticky Stage)
   Reference: ff000f01
   ========================================================= */
.story-scroll-container {
  position: relative;
  /* one viewport of scroll per chapter (--chapters is set on the element in index.html) */
  height: calc(var(--chapters, 5) * 100vh);
  z-index: 20;
}

.story-sticky-stage {
  --stage-pad: clamp(20px, 3vw, 44px);
  --hdr-zone: 72px;   /* room for the 2x logo lockup */
  --bot-pad: 16px;
  --bar-h: 34px;      /* window title bar */
  --cap-h: 84px;      /* [ht-traffic] caption box */
  --col-gap: 12px;
  /* widest window (16:9 video area) that still fits between the header and the bottom edge */
  --win-max: calc((100svh - var(--hdr-zone) - var(--bot-pad) - var(--bar-h) - var(--col-gap) - var(--cap-h)) * 1.7778);
  position: sticky;
  top: 0;
  height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  overflow: visible;
  z-index: 25;
}

.stage-layout {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: none;
  height: 100%;
  box-sizing: border-box;
  padding-left: var(--stage-pad);
  padding-right: var(--stage-pad);
  padding-top: var(--hdr-zone);
  padding-bottom: var(--bot-pad);
  gap: clamp(20px, 2.4vw, 36px);
  position: relative;
}

/* --- Left Vertical Progress Rail (Reference ff000f01) --- */
.vertical-rail {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 50px;
  height: min(540px, calc(100svh - var(--hdr-zone) - var(--bot-pad) - 24px));
  position: relative;
}

/* The rail is a wheel, like a date roll: all chapters sit on a drum, the selected one at the centre,
   the neighbours tilt away and fade, and the rest roll in from either end and wrap around.
   main.js sets transform / opacity / visibility of every .rail-item on each frame of the roll. */
.rail-track {
  --slot: 88px;              /* each button's length along the wheel axis */
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 720px;
  touch-action: none;        /* dragging the wheel scrolls the story; the page does not pan from here */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.rail-track.dragging {
  cursor: grabbing;
}

/* the rail line fades out toward both ends of the wheel */
.rail-track::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent 0%, var(--color-border) 16%, var(--color-border) 84%, transparent 100%);
  pointer-events: none;
}

/* fixed selection mark at the centre of the wheel; height follows the active label (set in main.js) */
.rail-active-pill {
  position: absolute;
  right: -1px;
  top: 50%;
  width: 3px;
  height: var(--pill-len, 56px);
  transform: translateY(-50%);
  background-color: var(--color-accent);
  border-radius: var(--radius-full);
  box-shadow: 0 0 14px var(--color-accent);
  transition: height var(--transition-smooth);
  pointer-events: none;
  z-index: 3;
}

.rail-item {
  position: absolute;
  top: 50%;
  left: 0;
  width: calc(100% - 12px);
  height: var(--slot);
  margin-top: calc(var(--slot) / -2);
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
  -webkit-tap-highlight-color: transparent;
}

/* before main.js has placed the wheel, show only the first chapter instead of eleven stacked labels */
.rail-track:not(.wheel-ready) .rail-item:not(.active) {
  visibility: hidden;
}

.rail-item:focus-visible {
  outline: 1px solid var(--color-accent);
  outline-offset: -2px;
  border-radius: 6px;
}

.rail-label {
  /* Rotated 90 degrees reading bottom-to-top as in reference ff000f01 */
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.rail-item:hover .rail-label {
  color: var(--color-text-dim);
}

.rail-item.active .rail-label {
  color: var(--color-accent);
  font-weight: 700;
}

/* --- Stage Content Grid (Left Headline & Right Frame) --- */
.stage-content-grid {
  display: grid;
  grid-template-columns: clamp(250px, 28%, 420px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 3vw, 48px);
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* Left Editorial Column */
.chapter-text-column {
  position: relative;
  z-index: 10;
}

.text-scrim {
  display: none;
}

.chapter-headlines-stack {
  position: relative;
  min-height: 280px;
}

.chapter-pane {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--transition-smooth), transform var(--transition-smooth);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chapter-pane.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chapter-title {
  font-size: clamp(1.8rem, 2.6vw, 2.8rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-text-main);
  margin-bottom: 20px;
}

.chapter-description {
  font-size: clamp(0.9rem, 1.05vw, 1.05rem);
  line-height: 1.65;
  color: var(--color-text-dim);
  margin-bottom: 28px;
  max-width: 520px;
}

.chapter-counter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.counter-display {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.counter-tag {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  padding: 3px 8px;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: var(--radius-sm);
}

/* Right App Window & Terminal Echo Column */
.chapter-visual-column {
  display: flex;
  flex-direction: column;
  gap: var(--col-gap);
  width: min(100%, var(--win-max));
  justify-self: end; /* right margin = left rail margin, no empty gutter */
  position: relative;
  z-index: 10;
}

/* App Window Frame (Reference styling) */
.app-window-frame {
  background: #090c12;
  border: 1px solid var(--color-border-bright);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-window);
  overflow: hidden;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

[data-theme="light"] .app-window-frame {
  background: #0f172a; /* Keep inner preview dark for code/graph screen clips */
  border-color: rgba(37, 99, 235, 0.25);
}

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(18, 24, 38, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  user-select: none;
}

.window-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.window-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.window-dots .red { background-color: #ef4444; }
.window-dots .yellow { background-color: #f59e0b; }
.window-dots .green { background-color: #10b981; }

.window-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.tab-indicator {
  font-size: 0.6rem;
  color: var(--color-accent);
}

.window-meta {
  letter-spacing: 0.05em;
}

[data-theme="light"] .window-titlebar .window-tab,
[data-theme="light"] .window-titlebar #window-tab-title,
[data-theme="light"] .window-titlebar .window-meta,
[data-theme="light"] .window-titlebar #window-meta-tag {
  color: #cbd5e1;
}

.window-screen-body {
  position: relative;
  flex: none;
  aspect-ratio: 16 / 9; /* matches the 1280x720 clips (the whole app window): nothing is cropped or stretched */
  width: 100%;
  background: #05070a;
  overflow: hidden;
}

.screen-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* never crop: show the whole window even if a clip's ratio differs */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.screen-video.active {
  opacity: 1;
  pointer-events: auto;
}

/* --- Live Message Echo Caption Box (Reference ff000f01) --- */
.echo-caption-box {
  background: var(--color-terminal-bg);
  border: 1px solid var(--color-terminal-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  min-height: 0;
  max-height: var(--cap-h);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  position: relative;
}

.echo-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  padding-bottom: 6px;
  margin-bottom: 2px;
}

.echo-badge {
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.echo-time {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.echo-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.echo-stream {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.echo-line.primary {
  color: var(--color-terminal-text);
  font-weight: 600;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.echo-line.muted {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

/* Virtual Scroll Steps */
.story-scroll-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  visibility: hidden;
}

.scroll-step {
  height: calc(100% / var(--chapters, 5));
  width: 100%;
}


/* =========================================================
   3. CLOSING SECTION: Download & Launch Disclosure
   ========================================================= */
.closing-section {
  position: relative;
  z-index: 20;
  padding: 120px 0 140px;
}

.closing-card {
  display: flex;
  justify-content: center;
}

.closing-body {
  position: relative;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border-bright);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 6vw, 64px);
  text-align: center;
  max-width: 840px;
  width: 100%;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.closing-headline {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.closing-subline {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.6;
  color: var(--color-text-dim);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 36px;
}

.closing-cta-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.closing-pricing-note {
  font-size: 0.95rem;
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.system-reqs {
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
}


/* =========================================================
   4. FOOTER
   ========================================================= */
.site-footer {
  position: relative;
  z-index: 20;
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
  background: var(--color-bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--color-text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-micro {
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: 0.08em;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-accent);
}

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


/* =========================================================
   5. RESPONSIVE BREAKPOINTS (1100px, 834px, 390px, 320px)
   ========================================================= */

/* Tablet portrait and below (< 900px): rail becomes a top bar, window stacks under the text.
   Landscape tablets (1024x768) keep the two-column layout. */
@media (max-width: 899px) {
  .story-sticky-stage {
    align-items: flex-start;
  }

  .stage-layout {
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    height: auto;
    padding-top: 76px;
  }

  /* The wheel turns on its side: a horizontal top bar, same drum, labels upright */
  .vertical-rail {
    width: 100%;
    height: auto;
  }

  .rail-track {
    --slot: 92px;
    height: 44px;
    touch-action: pan-y;   /* vertical swipes still scroll the page; horizontal drags spin the wheel */
  }

  .rail-track::before {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, var(--color-border) 12%, var(--color-border) 88%, transparent 100%);
  }

  .rail-item {
    top: 0;
    left: 50%;
    width: var(--slot);
    height: 100%;
    margin-top: 0;
    margin-left: calc(var(--slot) / -2);
  }

  .rail-label {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 0.75rem;
  }

  .rail-active-pill {
    top: auto;
    right: auto;
    left: 50%;
    bottom: -1px;
    width: var(--pill-len, 56px);
    height: 2px;
    transform: translateX(-50%);
    transition: width var(--transition-smooth);
  }

  .stage-content-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .chapter-headlines-stack {
    min-height: 180px;
  }

  .chapter-visual-column {
    width: min(100%, var(--win-max), 860px);
    margin: 0 auto;
  }
}

/* Tablet Portrait & Large Mobile (< 834px) */
@media (max-width: 834px) {
  .intro-section {
    padding-top: 80px;
    padding-bottom: 40px;
  }

  .chapter-title {
    font-size: 2.2rem;
  }

  .main-headline {
    font-size: 2.6rem;
  }

  .closing-section {
    padding: 80px 0 100px;
  }
}

/* Mobile Devices (< 640px) */
@media (max-width: 639px) {
  .header-inner {
    padding: 12px 16px;
  }

  .brand-text {
    font-size: 1.35rem;
  }

  .brand-icon {
    width: 44px;
    height: 17px;
  }

  .brand-link {
    gap: 12px;
  }

  .nav-cluster-right {
    gap: 8px;
  }

  .header-actions {
    gap: 0;
  }

  .icon-toggle-btn,
  .nav-drawer-toggle {
    width: 34px;
    height: 34px;
  }

  .icon-toggle-btn svg,
  .nav-drawer-toggle svg {
    width: 24px;
    height: 24px;
  }

  .content-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .intro-section {
    padding-top: 72px;
  }

  .main-headline {
    font-size: 2.1rem;
    line-height: 1.15;
  }

  .main-subline {
    font-size: 0.95rem;
  }

  .intro-cta-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .btn-lg {
    padding: 12px 20px;
    font-size: 0.95rem;
  }

  .chapter-title {
    font-size: 1.75rem;
  }

  .chapter-description {
    font-size: 0.9rem;
    margin-bottom: 16px;
  }

  .chapter-headlines-stack {
    min-height: 200px;
  }

  .window-screen-body {
    overflow: hidden;
  }

  .window-meta {
    display: none; /* keeps the title bar on one line */
  }

  .window-tab {
    white-space: nowrap;
  }

  .echo-stream {
    font-size: 0.72rem;
  }

  .echo-caption-box {
    padding: 10px 14px;
  }

  .rail-track {
    --slot: 84px;
  }

  .rail-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .closing-body {
    padding: 32px 16px;
  }

  .closing-headline {
    font-size: 1.8rem;
  }
}

/* Short phones: drop the decorative caption so the whole window stays on screen */
@media (max-width: 639px) and (max-height: 700px) {
  .echo-caption-box {
    display: none;
  }
}

/* Extra Compact Mobile (320px) */
@media (max-width: 360px) {
  .main-headline {
    font-size: 1.75rem;
  }

  .chapter-title {
    font-size: 1.5rem;
  }

  .cli-pills-row {
    font-size: 0.75rem;
    gap: 6px;
  }

  .cli-pill {
    padding: 2px 6px;
  }

  .rail-label {
    font-size: 0.65rem;
  }

  .brand-text {
    font-size: 1.15rem;
  }

  .brand-icon {
    width: 38px;
    height: 15px;
  }

  .window-meta {
    display: none;
  }
}


/* =========================================================
   6. CONVERSION SECTIONS: hero clip, pricing, download cards, FAQ, trust footer, after-purchase page
   ========================================================= */

/* --- Hero: headline column + a loop running in the app window --- */
.intro-main {
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
  width: 100%;
}

.intro-main .intro-body {
  flex: 1 1 0;
  min-width: 0;
  max-width: 640px;
}

.hero-window {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 700px;
}

.hero-kicker {
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--color-accent);
  margin: -6px 0 22px;
}

.hero-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* the whole app window, never cropped */
}

.hero-caption {
  margin-top: 12px;
  line-height: 1.55;
}

.cli-pill.cli-pro {
  border-style: dashed;
  color: var(--color-text-dim);
}

.cli-note {
  margin-top: 10px;
}

.btn.disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* --- Info sections (pricing, FAQ) share the closing card's glass look --- */
.info-section {
  position: relative;
  z-index: 20;
  padding: 70px 0;
}

.info-card {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px);
  background: var(--color-card-bg);
  border: 1px solid var(--color-border-bright);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-window);
}

.info-card a:not(.btn),
.closing-body a:not(.btn),
.drawer-footer a {
  color: var(--color-accent);
}

.info-headline {
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.info-subline {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.6;
  color: var(--color-text-dim);
  margin-bottom: 28px;
}

.info-subline strong {
  color: var(--color-text-main);
}

.price-live {
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: 24px clamp(18px, 3vw, 32px);
  margin-bottom: 32px;
  background: rgba(96, 165, 250, 0.06);
}

.price-live-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.price-live-value {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 6px 0;
}

.price-live-note {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--color-accent);
}

.price-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.table-scroll {
  overflow-x: auto;
  margin-bottom: 28px;
}

table.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.compare th,
.compare td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.compare thead th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom-color: var(--color-border-bright);
}

.compare tbody th {
  font-weight: 500;
  color: var(--color-text-dim);
}

.compare td.yes {
  color: #34d399;
  font-weight: 600;
}

[data-theme="light"] .compare td.yes {
  color: #047857;
}

.compare td.no {
  color: var(--color-text-muted);
}

.compare tr.now td {
  background: rgba(96, 165, 250, 0.16);
  font-weight: 600;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.fact {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(148, 163, 184, 0.05);
}

.fact-k {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.fact p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text-dim);
}

.launch-details,
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin: 10px 0;
  background: rgba(148, 163, 184, 0.04);
}

.launch-details summary,
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text-main);
}

.launch-details[open] summary,
.faq-item[open] summary {
  margin-bottom: 4px;
}

.launch-details p,
.faq-item p {
  margin: 10px 0 12px;
  line-height: 1.65;
  color: var(--color-text-dim);
}

.fine-print {
  margin-top: 24px;
  line-height: 1.6;
}

/* --- Download cards --- */
.os-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin: 0 0 24px;
  text-align: left;
}

.os-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.05);
}

.os-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.os-btn {
  margin-top: 6px;
}

.need-first {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text-dim);
  margin-bottom: 24px;
  text-align: left;
}

code.mono {
  padding: 1px 6px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.08);
  font-size: 0.9em;
}

/* --- Trust footer --- */
.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.footer-legal .footer-links {
  flex-wrap: wrap;
}

.footer-legal p {
  line-height: 1.6;
}

/* --- After-purchase page (thanks/index.html) --- */
.simple-main {
  position: relative;
  z-index: 20;
  padding: 130px 0 90px;
}

.keybox {
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 8px 0 28px;
  background: rgba(96, 165, 250, 0.06);
}

.keybox[hidden] {
  display: none;
}

.keybox code {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  word-break: break-all;
  margin: 10px 0 14px;
}

ol.steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 28px;
}

ol.steps li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 18px 54px;
  line-height: 1.65;
  color: var(--color-text-dim);
}

ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-full);
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-weight: 600;
}

ol.steps li strong {
  color: var(--color-text-main);
}

.good-to-know {
  margin: 10px 0 0 18px;
  line-height: 1.7;
  color: var(--color-text-dim);
}

@media (max-width: 1099px) {
  .intro-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .intro-main .intro-body {
    flex: none;
    width: 100%;
    max-width: 820px;
  }

  .hero-window {
    flex: none;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 639px) {
  .info-section {
    padding: 44px 0;
  }

  .price-cta .btn {
    width: 100%;
  }

  .compare th,
  .compare td {
    padding: 9px 8px;
    font-size: 0.85rem;
  }
}
