/* OperatorFlow — Console palette + Inter/JetBrains Mono.
   Per DESIGN.md: dark-first, one signal color, hairline aesthetic. */

:root {
  /* Console palette */
  --bg:          #0B0D10;
  --bg-elev:     #14171C;
  --bg-elev-2:   #181C22;
  --ink:         #E6E8EB;
  --ink-muted:   #8A929C;
  --ink-dim:     #5E6770;
  --line:        #1F242B;
  --line-strong: #2A313A;
  --signal:      #7CF2B6;
  --signal-dim:  #2F6A52;
  --signal-glow: rgba(124, 242, 182, 0.18);
  --warn:        #F2C46B;
  --danger:      #F26B6B;

  /* Type scale (fluid) */
  --text-xs:    clamp(11px, 0.72vw, 12px);
  --text-sm:    clamp(13px, 0.9vw, 14px);
  --text-base:  clamp(15px, 1.05vw, 16px);
  --text-lg:    clamp(17px, 1.25vw, 19px);
  --text-xl:    clamp(20px, 1.6vw, 24px);
  --text-2xl:   clamp(28px, 2.6vw, 36px);
  --text-3xl:   clamp(36px, 4vw, 56px);
  --display:    clamp(42px, 5.2vw, 72px);

  /* Layout */
  --max-w:    1180px;
  --gutter:   24px;
  --pad-x:    clamp(20px, 4vw, 36px);
  --section-y: clamp(56px, 7vw, 88px);

  /* Type */
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Accent overrides (driven by Tweaks) */
.of-accent-green  { --signal:#7CF2B6; --signal-dim:#2F6A52; --signal-glow:rgba(124,242,182,.18); }
.of-accent-amber  { --signal:#F2C46B; --signal-dim:#6F5424; --signal-glow:rgba(242,196,107,.18); }
.of-accent-cyan   { --signal:#7CDFF2; --signal-dim:#2D5E6A; --signal-glow:rgba(124,223,242,.18); }
.of-accent-orange { --signal:#F2A06B; --signal-dim:#6A4424; --signal-glow:rgba(242,160,107,.18); }

/* Density */
.of-density-comfortable { --section-y: clamp(96px, 11vw, 140px); }
.of-density-compact     { --section-y: clamp(56px, 7vw, 92px); }

/* ───────────── base ───────────── */

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

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.of-root {
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
  width: 100%;
  max-width: 100vw;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Container-query root so artboards (380px / 1320px) get the right
     responsive treatment regardless of the outer window width. */
  container-type: inline-size;
  container-name: of;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--signal); color: #0B0D10; }

/* Hairline ambient glow behind hero */
.of-ambient {
  position: absolute;
  inset: 0 0 auto 0;
  height: 720px;
  background:
    radial-gradient(60% 50% at 78% 18%, var(--signal-glow), transparent 70%),
    radial-gradient(40% 30% at 12% 6%, rgba(124,242,182,.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ───────────── shell ───────────── */

.shell {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  position: relative;
  z-index: 1;
  min-width: 0;
}

section { padding: var(--section-y) 0; position: relative; }
section + section { border-top: 1px solid var(--line); }

/* ───────────── type ───────────── */

.mono { font-family: var(--mono); font-feature-settings: "ss01", "ss02"; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.eyebrow .accent { color: var(--signal); }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 720;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
h1.display {
  font-size: var(--display);
  line-height: 0.96;
  letter-spacing: -0.025em;
  font-weight: 720;
}
h2.title {
  font-size: var(--text-3xl);
  line-height: 1.02;
}
h3 { font-size: var(--text-xl); line-height: 1.2; }

p.lead {
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 56ch;
  margin: 24px 0 0;
  text-wrap: pretty;
}
p.body { color: var(--ink-muted); max-width: 64ch; }

.section-head {
  display: grid;
  gap: 14px;
  max-width: 760px;
  margin-bottom: 56px;
}

/* ───────────── pill / status ───────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 9px 4px 9px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  color: var(--ink-muted);
  background: rgba(255,255,255,0.012);
  white-space: nowrap;
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-dim);
  flex: 0 0 auto;
}
.pill.ready   { color: var(--signal);  border-color: color-mix(in oklab, var(--signal) 35%, var(--line-strong)); }
.pill.ready .dot   { background: var(--signal); box-shadow: 0 0 0 3px var(--signal-glow); }
.pill.running { color: var(--signal);  border-color: color-mix(in oklab, var(--signal) 35%, var(--line-strong)); }
.pill.running .dot { background: var(--signal); animation: pulse 1.6s ease-in-out infinite; }
.pill.queued  { color: var(--warn);    border-color: color-mix(in oklab, var(--warn) 30%, var(--line-strong)); }
.pill.queued .dot  { background: var(--warn); }
.pill.done    { color: var(--ink-muted); }
.pill.done .dot    { background: var(--ink-muted); }
.pill.failed  { color: var(--danger);  border-color: color-mix(in oklab, var(--danger) 30%, var(--line-strong)); }
.pill.failed .dot  { background: var(--danger); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--signal-glow); opacity: 1; }
  50%      { box-shadow: 0 0 0 6px transparent; opacity: 0.55; }
}

/* ───────────── CTA ───────────── */

.cta {
  display: inline-grid;
  grid-template-rows: auto auto;
  justify-items: start;
  gap: 8px;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  border: 1px solid transparent;
  text-decoration: none;
}
.cta-btn.primary {
  background: var(--signal);
  color: #07120C;
  border-color: var(--signal);
}
.cta-btn.primary:hover { transform: translateY(-1px); filter: brightness(1.06); }
.cta-btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.cta-btn.ghost:hover { border-color: var(--signal); color: var(--signal); }
.cta-btn .arrow { font-family: var(--mono); font-weight: 500; opacity: 0.7; transition: transform 160ms ease, opacity 160ms ease; }
.cta-btn:hover .arrow { transform: translateX(2px); opacity: 1; }
.cta-caption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}

/* ───────────── nav ───────────── */

.of-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.of-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}
.of-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.of-nav-links a {
  font-size: 13.5px;
  color: var(--ink-muted);
  padding: 8px 12px;
  border-radius: 4px;
  transition: color 140ms ease, background 140ms ease;
}
.of-nav-links a:hover { color: var(--ink); background: var(--bg-elev); }
.of-nav-right { display: flex; align-items: center; gap: 14px; }

/* ───────────── logo ───────────── */

.of-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 620;
  font-size: 15px;
  letter-spacing: -0.015em;
}
.of-logo .glyph {
  width: 22px; height: 22px;
  flex: 0 0 auto;
}
.of-logo .wordmark { line-height: 1; }
.of-logo .wordmark .accent { color: var(--signal); }

/* ───────────── hero ───────────── */

.hero {
  padding-top: clamp(44px, 6vw, 82px);
  padding-bottom: clamp(28px, 4vw, 52px);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.hero-grid > * { min-width: 0; }
.hero h1.display { margin-top: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero-meta {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px 36px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}
.hero-meta .kv strong {
  display: block;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}

/* ───────────── runcard ───────────── */

.runcard {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--sans);
  position: relative;
}
.runcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev-2);
}
.runcard-head .name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.runcard-head .name .scope { color: var(--ink-dim); }
.runcard-rows { display: grid; gap: 0; }
.runcard-row {
  display: grid;
  grid-template-columns: 56px 14px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.runcard-row:last-child { border-bottom: 0; }
.runcard-row .ts {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
  padding-top: 3px;
  white-space: nowrap;
}
.runcard-row .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink-dim);
  margin-top: 7px;
}
.runcard-row[data-status="done"] .dot   { background: var(--signal); }
.runcard-row[data-status="run"]  .dot   { background: var(--signal); animation: pulse 1.6s ease-in-out infinite; }
.runcard-row[data-status="queue"] .dot  { background: var(--warn); }
.runcard-row[data-status="fail"] .dot   { background: var(--danger); }
.runcard-row .step-title {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}
.runcard-row .step-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}
.runcard-row .step-meta code { color: var(--ink-muted); }
.runcard-row .runtime {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  white-space: nowrap;
  padding-top: 3px;
}
.runcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elev-2);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}
.runcard-foot .approve {
  color: var(--signal);
  cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--signal) 40%, var(--line-strong));
  padding: 4px 9px;
  border-radius: 4px;
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.runcard-foot .approve:hover { background: var(--signal-glow); }

/* ───────────── diagram (hero) ───────────── */

.diagram {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 22px 18px;
  position: relative;
  overflow: hidden;
  max-width: 100%;
}
.hero .diagram {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(124, 242, 182, 0.03) inset;
}
.diagram-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.diagram svg { width: 100%; height: auto; display: block; }
.diagram .node-label {
  font-family: var(--mono);
  font-size: 10.5px;
  fill: var(--ink-muted);
  letter-spacing: 0.04em;
}
.diagram .node-rect {
  fill: var(--bg-elev-2);
  stroke: var(--line-strong);
  stroke-width: 1;
  transition: fill 220ms ease, stroke 220ms ease, filter 220ms ease;
}
.diagram .node-rect.active {
  stroke: var(--signal);
  fill: color-mix(in oklab, var(--signal) 12%, var(--bg-elev-2));
  filter: drop-shadow(0 0 7px var(--signal-glow));
}
.diagram .edge {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  transition: stroke 220ms ease, filter 220ms ease, stroke-dasharray 220ms ease;
}
.diagram .edge.active {
  stroke: var(--signal);
  stroke-dasharray: none;
  filter: drop-shadow(0 0 6px var(--signal-glow));
}
.diagram .legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-dim);
}

/* ───────────── terminal hero ───────────── */

.terminal {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.65;
}
.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev-2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
}
.terminal-head .dots { display: flex; gap: 6px; }
.terminal-head .dots i {
  display: block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--line-strong);
  font-style: normal;
}
.terminal-body { padding: 14px 16px 18px; }
.terminal-line { display: grid; grid-template-columns: 60px 1fr auto; gap: 10px; padding: 2px 0; }
.terminal-line .ts { color: var(--ink-dim); }
.terminal-line .msg { color: var(--ink-muted); }
.terminal-line .msg .ok { color: var(--signal); }
.terminal-line .msg .warn { color: var(--warn); }
.terminal-line .msg .agent { color: var(--ink); }
.terminal-line .runtime { color: var(--ink-dim); }
.terminal-line .prompt { color: var(--signal); }
.terminal-cursor {
  display: inline-block;
  width: 7px; height: 13px;
  background: var(--signal);
  vertical-align: -2px;
  margin-left: 4px;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ───────────── problem steps ───────────── */

.problem-list { display: grid; gap: 6px; max-width: 760px; }
.problem-step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.problem-step:last-child { border-bottom: 0; }
.problem-step .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}
.problem-step .num .accent { color: var(--signal); }
.problem-step h3 { font-size: var(--text-xl); margin-bottom: 8px; }
.problem-step p { margin: 0; color: var(--ink-muted); max-width: 60ch; }

/* ───────────── workflow grid ───────────── */

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* ───────────── manifest ───────────── */

.manifest {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  overflow: hidden;
}
.manifest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg-elev-2);
}
.manifest-body { padding: 6px 0; }
.manifest-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.manifest-row:last-child { border-bottom: 0; }
.manifest-row .k {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}
.manifest-row .v {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
}
.manifest-row .v .muted { color: var(--ink-muted); }

/* ───────────── sprint section ───────────── */

.sprint-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
}
.sprint-timeline { display: grid; gap: 0; }

/* ───────────── why us ───────────── */

.why-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: start;
}
.why-quote {
  font-size: var(--text-2xl);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 620;
  border-left: 2px solid var(--signal);
  padding-left: 22px;
  text-wrap: balance;
}
.why-quote-attr {
  margin-top: 22px;
  padding-left: 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

/* ───────────── lead demo ───────────── */

.lead-demo {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  overflow: hidden;
}
.lead-demo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev-2);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}
.lead-demo-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
}
.lead-demo-pane { padding: 18px 18px 16px; min-height: 280px; display: flex; flex-direction: column; }
.lead-demo-divider { background: var(--line); }
.lead-demo-label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lead-demo textarea {
  width: 100%;
  flex: 1;
  background: transparent;
  border: 0;
  resize: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
  outline: none;
  padding: 0;
}
.lead-demo textarea::placeholder { color: var(--ink-dim); }
.lead-demo .draft {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  font-family: var(--sans);
  min-height: 200px;
  position: relative;
}
.lead-demo .draft.placeholder { color: var(--ink-dim); font-style: normal; }
.lead-demo .draft .cursor { animation: blink 1.1s steps(2) infinite; color: var(--signal); }
.lead-demo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-elev-2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
}
.lead-demo-foot .examples {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lead-demo-foot .examples button {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}
.lead-demo-foot .examples button:hover { color: var(--signal); border-color: color-mix(in oklab, var(--signal) 40%, var(--line-strong)); }
.lead-demo-foot .examples button:disabled { opacity: 0.4; cursor: not-allowed; }
.lead-demo .run-btn {
  background: var(--signal);
  color: #07120C;
  border: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.lead-demo .run-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.demo-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.demo-meta span span { color: var(--ink-muted); }

/* ───────────── teardown cards / FAQ ───────────── */

.teardown-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.teardown-card,
.faq-item {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.026), rgba(255,255,255,.012));
  border-radius: 6px;
  padding: 22px;
  min-height: 100%;
}
.teardown-card {
  display: grid;
  gap: 16px;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}
.teardown-card:hover {
  border-color: color-mix(in oklab, var(--signal) 42%, var(--line-strong));
  background: linear-gradient(180deg, rgba(124,242,182,.055), rgba(255,255,255,.014));
  transform: translateY(-2px);
}
.teardown-card h3,
.faq-item h3 {
  font-size: var(--text-xl);
}
.teardown-card p,
.faq-item p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.55;
}
.teardown-link {
  align-self: end;
  color: var(--signal);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
}

/* ───────────── teardown detail pages ───────────── */

.teardown-hero {
  padding-top: clamp(64px, 8vw, 104px);
}
.teardown-hero .shell {
  max-width: 980px;
}
.teardown-hero h1.display {
  max-width: 11ch;
  margin-top: 18px;
}
.back-link {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
}
.back-link:hover { color: var(--signal); }
.teardown-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 52px;
  align-items: start;
}
.teardown-main {
  display: grid;
  gap: 26px;
}
.teardown-block {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.teardown-block:first-child {
  border-top: 0;
  padding-top: 0;
}
.teardown-block h2 {
  font-size: var(--text-xl);
  margin-bottom: 10px;
}
.teardown-block p,
.teardown-block li {
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.65;
}
.teardown-block p {
  margin: 0;
}
.teardown-block ol,
.teardown-block ul {
  margin: 0;
  padding-left: 22px;
}
.teardown-block li + li {
  margin-top: 8px;
}
.teardown-aside {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 20px;
}
.aside-links {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  display: grid;
  gap: 12px;
  background: rgba(255,255,255,.014);
}
.aside-links a {
  color: var(--ink-muted);
  font-size: 13px;
}
.aside-links a:hover {
  color: var(--signal);
}

/* ───────────── final CTA ───────────── */

.final-cta {
  padding: clamp(72px, 9vw, 120px) 0;
}
.final-cta-inner {
  display: grid;
  gap: 32px;
}
.final-cta h2 {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 18ch;
}
.final-cta .actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* ───────────── footer ───────────── */

.of-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}
.of-footer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}
.of-footer .commit { justify-self: end; color: var(--ink-dim); }
.of-footer .links { display: flex; gap: 18px; justify-self: end; }
.of-footer .links a:hover { color: var(--ink-muted); }

/* ───────────── scroll reveals ───────────── */

[data-reveal] {
  opacity: 1;
  transform: none;
  transition: opacity 280ms cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
[data-reveal].in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .pill.running .dot, .runcard-row[data-status="run"] .dot { animation: none; }
  .terminal-cursor, .lead-demo .draft .cursor { animation: none; }
}

/* ───────────── responsive (container queries) ─────────────
   Driven by the .of-root width, not the window width — so each
   artboard in the design canvas adapts independently. */

@container of (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .sprint-grid, .why-grid { grid-template-columns: 1fr; }
  .workflow-grid, .teardown-grid, .faq-grid { grid-template-columns: 1fr; }
  .teardown-layout { grid-template-columns: 1fr; }
  .teardown-aside { position: static; }
  .lead-demo-body { grid-template-columns: 1fr; }
  .lead-demo-divider { width: 100%; height: 1px; }
  .of-nav-links { display: none; }
  .runcard-row { grid-template-columns: 48px 12px 1fr auto; }
  .manifest-row { grid-template-columns: 1fr; gap: 4px; }
  .manifest-row .k { font-size: 11px; }
}

@container of (max-width: 640px) {
  .of-root { --pad-x: 18px; --section-y: clamp(56px, 12cqi, 88px); }
  /* The hero headline has a <br> for desktop drama — let it wrap naturally
     at narrow widths instead. */
  .hero h1.display br { display: none; }
  /* Override the vw-driven type scale at narrow widths — vw reads from the
     window viewport, which lies inside artboards. cqi is container-relative. */
  .hero h1.display {
    font-size: clamp(30px, 8cqi, 36px);
    line-height: 1.04;
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
    max-width: 100%;
  }
  .hero-grid,
  .hero-grid > *,
  .section-head,
  p.lead {
    max-width: 100%;
    min-width: 0;
  }
  h2.title {
    font-size: clamp(26px, 7.5cqi, 34px);
    line-height: 1.08;
  }
  .why-quote { font-size: clamp(20px, 6cqi, 26px); line-height: 1.22; padding-left: 16px; }
  p.lead { font-size: 16px; }
  .eyebrow { font-size: 10.5px; }
  .problem-step { grid-template-columns: 1fr; gap: 8px; padding: 22px 0; }
  .problem-step h3 { font-size: 18px; }
  .hero-meta { gap: 14px 22px; margin-top: 32px; }
  .hero-meta .kv strong { font-size: 13px; }
  .hero-actions { gap: 10px; }
  .hero-actions .cta { width: 100%; }
  .hero-actions .cta-btn { width: 100%; justify-content: space-between; }
  .of-footer-row { grid-template-columns: 1fr; gap: 14px; justify-items: start; }
  .of-footer .commit, .of-footer .links { justify-self: start; }
  .of-nav-right { display: none; }
  .of-nav-row { padding: 12px 0; }
  .runcard-row { padding: 12px; }
  .runcard-row .ts { font-size: 10.5px; }
  .runcard-row .step-title { font-size: 13px; }
  .runcard-row .step-meta { font-size: 10.5px; }
  .runcard-row .runtime { font-size: 10.5px; }
  .runcard-head .name { font-size: 11.5px; }
  .terminal { font-size: 11.5px; }
  .terminal-line { grid-template-columns: 54px 1fr auto; }
  .lead-demo-pane { min-height: 220px; padding: 14px; }
  .lead-demo-foot { flex-direction: column; gap: 10px; align-items: stretch; }
  .lead-demo-foot .examples { justify-content: flex-start; }
  .lead-demo .run-btn { width: 100%; padding: 8px; }
  .manifest-row { padding: 10px 14px; }
  .final-cta h2 { font-size: clamp(28px, 8.5cqi, 40px); }
  .section-head { margin-bottom: 36px; }
  .diagram { padding: 16px 12px; }
  .hero .diagram {
    display: block;
    margin-top: 4px;
  }
  .diagram-head {
    align-items: flex-start;
    gap: 8px;
    line-height: 1.35;
  }
  .legend { font-size: 9.5px; gap: 10px; flex-wrap: wrap; }
  .why-quote-attr { padding-left: 18px; }
}

/* Window-level fallback for when this site renders outside an artboard
   (e.g. previewing a single component file). Mirrors the container rules. */
@media (max-width: 980px) {
  .of-root:not(:has(*)) { /* no-op selector to keep specificity but inert */ }
}

@media (max-width: 640px) {
  .of-root { --pad-x: 20px; --section-y: 64px; width: 100vw; max-width: 100vw; }
  .shell { width: 100vw; max-width: 100vw; overflow: hidden; }
  .of-nav-links, .of-nav-right { display: none; }
  .hero-grid, .sprint-grid, .why-grid, .workflow-grid, .teardown-grid, .faq-grid, .teardown-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
  }
  h1.display, .hero h1.display {
    font-size: 36px;
    line-height: 1.06;
    max-width: 100%;
  }
  p.lead {
    font-size: 16px;
    max-width: 100%;
  }
  .hero-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .hero-actions .cta,
  .hero-actions .cta-btn {
    width: 100%;
  }
}
