/* ---------- Tokens ----------
   6 named tokens; everything else (borders, tints, hover states)
   is derived from these with color-mix(). */
:root {
  --font-display: "Manrope", ui-sans-serif, system-ui;
  --font-sans: "Manrope", ui-sans-serif, system-ui;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --bg: #F5F7FA;       /* page background, cool near-white */
  --surface: #FFFFFF;  /* card / panel surface */
  --ink: #14161A;      /* primary text */
  --slate: #5B6270;    /* secondary text, borders, muted UI */
  --accent: #DD0031;   /* Angular red — single primary accent */
  --success: #146C43;  /* reserved: "compiled ✓ checked ✓" only */

  --line: color-mix(in srgb, var(--slate) 28%, var(--bg));
  --line-strong: color-mix(in srgb, var(--slate) 50%, var(--bg));
  --panel: color-mix(in srgb, var(--slate) 6%, var(--surface));
  --accent-strong: color-mix(in srgb, var(--accent) 84%, black);
  --accent-tint: color-mix(in srgb, var(--accent) 10%, var(--surface));

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --gutter: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
ul, ol { padding: 0; margin: 0; list-style: none; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; margin: 0; letter-spacing: -0.015em; }
code, pre { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  z-index: 10000;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--slate);
  font-family: var(--font-mono);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  padding: 40px 0 56px;
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--slate) 24%, transparent) 1px, transparent 0);
  background-size: 22px 22px;
}
.hero-inner {
  display: grid;
  gap: 32px;
}
.hero-copy h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  line-height: 1.1;
  max-width: 16ch;
  font-weight: 800;
}
.hero-copy p {
  margin-top: 16px;
  font-size: 1.05rem;
  color: var(--slate);
  max-width: 42ch;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary[disabled] {
  background: var(--panel);
  color: var(--slate);
  border: 1px dashed var(--line-strong);
  cursor: not-allowed;
}
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Generator mock ---------- */
.generator {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  gap: 20px;
  min-width: 0;
}
@media (min-width: 900px) {
  .generator { grid-template-columns: 260px 1fr; align-items: start; }
}

.generator-options { border: none; padding: 0; margin: 0; min-width: 0; }
.generator-options legend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 0 12px;
}
.option-list { display: grid; gap: 8px; }
.option-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}
.option-toggle:hover { border-color: var(--line-strong); }
.option-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.switch {
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  position: relative;
  margin-top: 2px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--slate);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.option-toggle input:checked + .switch { background: var(--accent); border-color: var(--accent); }
.option-toggle input:checked + .switch::after { transform: translateX(16px); background: #fff; }
.option-toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.option-text { display: flex; flex-direction: column; gap: 2px; }
.option-name { font-weight: 600; font-size: 0.9rem; }
.option-desc { font-size: 0.78rem; color: var(--slate); }

.generator-output { display: grid; gap: 16px; min-width: 0; }
.panel-label {
  margin: 0;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--slate);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.tree-panel, .terminal-panel, .agent-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
  min-width: 0;
}
.tree, .terminal {
  margin: 0;
  padding: 14px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre;
}
.tree-node { display: block; }
.tree-node.is-optional {
  overflow: hidden;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.25s var(--ease), opacity 0.2s var(--ease);
}
.tree-node.is-optional > span { overflow: hidden; }
.tree-node.is-optional.is-on {
  grid-template-rows: 1fr;
  opacity: 1;
}
.tree-node.reveal { animation: tree-in 0.3s var(--ease) both; }
@keyframes tree-in {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

.terminal { color: var(--slate); }
.terminal-cmd { color: var(--ink); display: block; }
.terminal-status { color: var(--success); display: block; margin-top: 4px; font-weight: 600; }
.terminal-line-enter { animation: tree-in 0.3s var(--ease) both; }

.agent-files { display: grid; gap: 8px; padding: 14px; }
.agent-files li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-size: 0.82rem;
}
.agent-files code {
  color: var(--accent);
  font-size: 0.8rem;
}
.agent-files span { color: var(--slate); }

.generate-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.coming-soon-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}

/* ---------- Differentiators ---------- */
.differentiators { padding: 64px 0; border-top: 1px solid var(--line); }
.differentiators h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 32px; max-width: 24ch; }
.diff-grid { display: grid; gap: 20px; }
@media (min-width: 900px) {
  .diff-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
}
.diff {
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
}
.diff h3 { font-size: 1.1rem; }
.diff p { color: var(--slate); font-size: 0.92rem; }

/* flow card: dotted blueprint grid as its own inner background */
.flow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--slate) 26%, transparent) 1px, transparent 0);
  background-size: 16px 16px;
}
.flow-step {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  min-width: 0;
}
.flow-step ul { display: grid; gap: 4px; margin-top: 8px; }
.flow-step li { font-size: 0.8rem; font-family: var(--font-mono); color: var(--ink); }
.flow-tag {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--slate);
  font-family: var(--font-mono);
}
.flow-out { border-color: var(--accent); }
.flow-arrow {
  width: 20px;
  height: 2px;
  background: var(--line-strong);
  position: relative;
  flex-shrink: 0;
}
.flow-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--line-strong);
  border-right: 2px solid var(--line-strong);
  transform: rotate(45deg);
}

/* files card: editor-pane treatment, matching the hero tree panel */
.diff-files { padding: 0; overflow: hidden; }
.diff-files h3, .diff-files > p {
  padding-left: 24px;
  padding-right: 24px;
}
.diff-files h3 { padding-top: 24px; }
.diff-files > p { padding-bottom: 24px; }
.file-list {
  display: grid;
  gap: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.file-list li:last-child { border-bottom: none; }
.file-list code { color: var(--accent); font-size: 0.82rem; }
.file-list span { color: var(--slate); text-align: right; }

.checklist { display: grid; gap: 12px; }
.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}
.check {
  color: var(--accent);
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* ---------- How it works ---------- */
.how-it-works { padding: 64px 0; border-top: 1px solid var(--line); }
.how-it-works h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 32px; }
.steps { display: grid; gap: 24px; counter-reset: none; }
.steps li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  position: relative;
  padding-bottom: 24px;
}
.steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.step-index {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  flex-shrink: 0;
}
.steps h3 { font-size: 1.05rem; margin-bottom: 4px; }
.steps p { color: var(--slate); font-size: 0.92rem; }

/* ---------- CTA block ---------- */
.cta-block { padding: 64px 0; border-top: 1px solid var(--line); }
.cta-inner { text-align: left; max-width: 640px; }
.cta-block h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.cta-block p { color: var(--slate); margin-top: 12px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--slate);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.footer-inner a:hover { color: var(--accent); }

/* ---------- Small screens ---------- */
@media (max-width: 389px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Reduced motion: no active animations or transitions ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
