/* ============================================================
   QA Automation ROI — Cale Maynard
   Palette (locked): bg #0A0A0B · panels #16161A · cyan #22D3EE (action)
   green #00E676 (PASS ONLY) · text #EDEDED / #8A8A94
   Mobile-first. Zero dependencies. Every animation persuades.
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #0A0A0B;
  --panel: #16161A;
  --panel-2: #1D1D23;
  --border: #2A2A32;
  --cyan: #22D3EE;
  --cyan-dim: rgba(34, 211, 238, 0.12);
  --green: #00E676;            /* pass states ONLY */
  --green-dim: rgba(0, 230, 118, 0.10);
  --text: #EDEDED;
  --muted: #8A8A94;
  --danger: #FF5F57;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono { font-family: var(--font-mono); }
.accent { color: var(--cyan); }
.accent-green { color: var(--green); }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); margin-bottom: 0.5rem; }
h3 { font-size: 1.05rem; }

main > section {
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6.5rem) 1.25rem;
}

.band { position: relative; }
.band::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.025) 30%, rgba(34, 211, 238, 0.025) 70%, transparent);
  pointer-events: none;
}

.section-sub { color: var(--muted); max-width: 46rem; margin-bottom: 2rem; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1060px; margin: 0 auto; padding: 0.65rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { color: var(--text); text-decoration: none; font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.brand-sub { color: var(--muted); font-weight: 400; display: none; }
@media (min-width: 560px) { .brand-sub { display: inline; } }

/* ---------- buttons / links ---------- */
.btn {
  display: inline-block;
  border: none; border-radius: 10px;
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--cyan); color: #06272C;
  padding: 0.85rem 1.6rem; font-size: 1rem;
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(34, 211, 238, 0.35); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.2rem; font-size: 1.1rem; }
.link-quiet { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--border); }
.link-quiet:hover { color: var(--cyan); }

/* ---------- hero ---------- */
.hero { text-align: left; padding-top: clamp(3rem, 8vw, 5.5rem); }
.hero-headline { font-size: clamp(1.9rem, 6vw, 3.4rem); max-width: 18ch; margin-bottom: 1rem; }
.hero-sub { color: var(--muted); font-size: clamp(1rem, 2.6vw, 1.25rem); margin-bottom: 1.75rem; }
.hero-ctas { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 2.5rem; }

/* ---------- terminal / test runner ---------- */
.terminal { overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 0.6rem 0.9rem; background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.dot-r { background: #FF5F57; } .dot-y { background: #FEBC2E; } .dot-g { background: #28C840; }
.terminal-title { color: var(--muted); font-size: 0.78rem; margin-left: 0.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-badge {
  margin-left: auto; flex-shrink: 0;
  color: var(--muted); font-size: 0.68rem;
  border: 1px dashed var(--border); border-radius: 6px;
  padding: 0.1rem 0.45rem;
}
.mute-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 6px; color: var(--muted); cursor: pointer;
  font-size: 0.8rem; padding: 0.15rem 0.45rem;
  min-width: 44px; min-height: 32px; /* thumb-friendly hit area */
}
.mute-btn[aria-pressed="true"] { color: var(--cyan); border-color: var(--cyan); }

.terminal-body {
  height: 262px; padding: 0.9rem 1rem;
  font-size: 0.8rem; line-height: 1.9;
  overflow: hidden; position: relative;
}
.terminal-body::after { /* fade at top so rows appear to scroll away */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2rem;
  background: linear-gradient(180deg, var(--panel), transparent);
  pointer-events: none;
}
.run-row { display: flex; gap: 0.75rem; white-space: nowrap; overflow: hidden; }
.run-status { flex-shrink: 0; width: 1.2em; }
.run-row.pass .run-status { color: var(--green); }
.run-row.running .run-status { color: var(--cyan); animation: spin-char 0.6s steps(4) infinite; }
.run-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.run-ms { color: var(--muted); margin-left: auto; }
.cursor::after { content: "▋"; color: var(--cyan); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes spin-char { 0% { opacity: 1; } 50% { opacity: 0.35; } 100% { opacity: 1; } }

.terminal-status {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.6rem 1rem; border-top: 1px solid var(--border);
  background: var(--panel-2); font-size: 0.85rem; color: var(--muted);
}
.replay-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--cyan); cursor: pointer; font-size: 0.8rem; padding: 0.15rem 0.9rem;
  min-height: 44px; /* thumb-friendly */
}
.replay-btn:hover { border-color: var(--cyan); }

/* ---------- personalization ---------- */
.inputs-grid {
  display: grid; gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.inputs-grid label {
  display: flex; flex-direction: column; gap: 0.35rem;
  font-size: 0.8rem; color: var(--muted);
}
.inputs-grid input {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: var(--font-mono); font-size: 1.05rem;
  padding: 0.7rem 0.8rem; width: 100%; min-height: 44px; /* thumb-friendly */
}
.inputs-grid input:focus { outline: 2px solid var(--cyan); border-color: transparent; }

/* ---------- timeline ---------- */
.timeline { list-style: none; display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.timeline-step {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.1rem;
  transition: opacity 0.55s ease, transform 0.55s ease, border-color 0.55s ease;
}
/* scroll-reveal is progressive enhancement: hidden ONLY when JS is running */
.js .timeline-step { opacity: 0; transform: translateY(18px); }
.js .timeline-step.lit { opacity: 1; transform: none; }
.timeline-step.lit { border-color: rgba(34, 211, 238, 0.35); }
.step-marker {
  color: var(--cyan); font-size: 0.85rem; border: 1px solid var(--border);
  border-radius: 8px; padding: 0.3rem 0.5rem; flex-shrink: 0;
}
.step-body p { color: var(--muted); font-size: 0.92rem; }
.step-time { color: var(--cyan); font-size: 0.8rem; }
.timeline-total { color: var(--muted); }

/* ---------- race ---------- */
.race { padding: 1.4rem; display: grid; gap: 1.4rem; }
.lane-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.9rem; margin-bottom: 0.45rem; gap: 1rem;
}
.lane-label .mono { font-size: 0.78rem; color: var(--muted); }
.bar-track {
  height: 16px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; overflow: hidden;
}
.bar { height: 100%; width: 0%; border-radius: 999px; }
.bar-manual { background: var(--muted); }
.bar-auto { background: var(--green); box-shadow: 0 0 12px rgba(0, 230, 118, 0.5); }
.race-caption { color: var(--muted); font-size: 0.8rem; text-align: center; }

/* ---------- pipeline (sticky scrollytelling) ---------- */
.pipeline-section { padding-bottom: 0; }
.pipeline-sticky {
  position: sticky; top: 3.2rem; z-index: 5;
  background: linear-gradient(180deg, var(--bg) 82%, transparent);
  padding-bottom: 1.5rem;
}
.pipeline {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.3rem; padding: 1.1rem 1rem; margin-top: 1.25rem;
}
.pipe-stage {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding: 0.7rem 0.9rem; border-radius: 10px; border: 1px solid var(--border);
  color: var(--muted); transition: all 0.4s ease; flex: 1; min-width: 0;
}
.pipe-stage .pipe-icon { font-size: 1.15rem; }
.pipe-stage .pipe-name { font-size: 0.72rem; }
.pipe-stage.active {
  color: var(--text); border-color: var(--cyan);
  background: var(--cyan-dim); box-shadow: 0 0 18px rgba(34, 211, 238, 0.18);
}
.pipe-stage.done { color: var(--green); border-color: rgba(0, 230, 118, 0.4); }
.pipe-arrow { color: var(--border); flex-shrink: 0; }
.pipe-annotation {
  min-height: 4.2em; color: var(--muted); max-width: 46rem;
  padding-top: 1rem; transition: opacity 0.3s ease;
}
.pipe-sentinel {
  min-height: 30vh;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 1rem 0;
}
/* zigzag: alternate cards to the right so desktop widths don't feel half-empty */
@media (min-width: 700px) {
  .pipe-sentinel[data-stage="1"], .pipe-sentinel[data-stage="3"] { justify-content: flex-end; }
}
.pipe-fact {
  max-width: 30rem; padding: 1.1rem 1.3rem;
  opacity: 0.55; transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.pipe-sentinel:hover .pipe-fact { opacity: 1; }
.js .pipe-sentinel.current .pipe-fact { opacity: 1; transform: none; border-color: rgba(34, 211, 238, 0.35); }
.pipe-fact-stage { display: block; color: var(--cyan); font-size: 0.75rem; margin-bottom: 0.4rem; }
.pipe-fact p { color: var(--muted); font-size: 0.95rem; }
.pipe-fact strong { color: var(--text); }

/* ---------- bento ---------- */
.bento {
  display: grid; gap: 0.9rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .bento { grid-template-columns: repeat(3, 1fr); }
  .bento-lg { grid-column: span 2; }
}
.bento-card {
  text-align: left; padding: 1.2rem; cursor: pointer;
  color: var(--text); font: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.bento-card:hover { transform: translateY(-3px); border-color: rgba(34, 211, 238, 0.45); }
.bento-title { display: block; font-weight: 700; font-size: 1.05rem; line-height: 1.15; letter-spacing: -0.02em; }
.bento-card p { color: var(--muted); font-size: 0.9rem; margin: 0.35rem 0 0.8rem; }
.bento-compare { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.35s ease, opacity 0.35s ease; }
.bento-card[aria-expanded="true"] .bento-compare { max-height: 4rem; opacity: 1; }
.bc-manual { color: var(--muted); }
.bc-auto { color: var(--green); }

/* ---------- break-even chart ---------- */
.chart-card { padding: 1.2rem; position: relative; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.45rem 0.6rem; font-size: 0.72rem; line-height: 1.5;
  color: var(--text); white-space: nowrap; transform: translate(-50%, -115%);
}
.chart-tip .tip-manual { color: var(--muted); }
.chart-tip .tip-auto { color: var(--cyan); }
.be-guide { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
#be-chart { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.78rem; padding-top: 0.75rem; }
.lg-manual { color: var(--muted); }
.lg-auto { color: var(--cyan); }
.chart-callout { color: var(--cyan); font-size: 0.85rem; padding-top: 0.4rem; min-height: 1.6em; }

.be-line { fill: none; stroke-width: 2.5; }
.be-line-manual { stroke: var(--muted); }
.be-line-auto { stroke: var(--cyan); }
.be-grid { stroke: var(--border); stroke-width: 1; }
.be-label { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.be-cross { fill: var(--cyan); }
.be-cross-ring { fill: none; stroke: var(--cyan); animation: pulse-ring 1.8s ease-out infinite; transform-origin: center; }
@keyframes pulse-ring {
  0% { opacity: 0.9; stroke-width: 2; }
  100% { opacity: 0; stroke-width: 14; }
}

/* ---------- ROI calculator ---------- */
.calc { padding: 1.5rem; display: grid; gap: 1.5rem; }
.calc-controls label { display: flex; flex-direction: column; gap: 0.5rem; color: var(--muted); font-size: 0.85rem; }
.calc-controls input[type="range"] { accent-color: var(--cyan); min-height: 32px; }
.calc-results { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.result-tile {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.3rem; display: flex; flex-direction: column; gap: 0.2rem;
}
.result-num { font-family: var(--font-mono); font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 700; }
.result-label { color: var(--muted); font-size: 0.85rem; }
.equivalents { color: var(--muted); font-size: 0.95rem; max-width: 46rem; }
.equivalents strong { color: var(--text); }

/* ---------- live ticker ---------- */
.ticker-section { text-align: center; }
.ticker { color: var(--muted); font-size: clamp(0.9rem, 2.4vw, 1.05rem); max-width: 44rem; margin: 0 auto; }
.tick-num { font-weight: 700; }

/* ---------- builder strip ---------- */
.builder { padding: 1.5rem; }
.builder-stats { list-style: none; display: grid; gap: 0.45rem; margin: 1rem 0; }
.builder-stats li { color: var(--muted); font-size: 0.95rem; }
.builder-note { color: var(--muted); font-size: 0.85rem; font-style: italic; }

/* ---------- closing ---------- */
.closing { text-align: center; }
.closing-stat { font-size: clamp(1.7rem, 5vw, 2.6rem); margin-bottom: 0.6rem; }
.closing .section-sub { margin-left: auto; margin-right: auto; }
.closing-alt { margin-top: 1.1rem; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem 3rem; text-align: center;
  color: var(--muted); font-size: 0.8rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--cyan); }
.footer-fineprint { margin-top: 0.5rem; font-size: 0.75rem; } /* full --muted: the honesty disclaimer must pass AA */

/* ---------- reduced motion: show final states, skip theater ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important; /* infinite loops must STOP, not flicker */
    transition-duration: 0.001s !important;
  }
  .js .timeline-step { opacity: 1; transform: none; }
}
