/* Brand tokens — the working identity lives here so a rename/rebrand is a
   variable swap, not a rewrite. See apps/website/README.md. */
:root {
  --brand-accent: #a4470f; /* forge ember */
  --brand-accent-dark: #7e360b;
  --ink: #1c1917;
  --ink-soft: #57534e;
  --paper: #faf9f7;
  --paper-alt: #f2efe9;
  --hairline: #ddd8d0;
  --font-display: georgia, "Times New Roman", serif;
  --font-body:
    system-ui, -apple-system, "Segoe UI", roboto, "Helvetica Neue", arial,
    sans-serif;
  --font-mono:
    ui-monospace, "SF Mono", "SFMono-Regular", menlo, consolas, monospace;
  --measure: 64ch;
  /* Demo-only additions (extraction reveal). */
  --card: #ffffff;
  --ink-faint: #8a8279;
  --accent-wash: #f6ece4;
  --warn: #b45309;
  --warn-wash: #fbeede;
}

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

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  margin: 1rem 0 1.25rem;
}

/* The hero's hard break is for wide screens; let narrow ones wrap naturally. */
@media (max-width: 719px) {
  h1 br {
    display: none;
  }
}

h2 {
  font-size: clamp(1.4rem, 3.5vw, 1.75rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

p + p {
  margin-top: 1rem;
}

strong {
  font-weight: 600;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--hairline);
  padding: 1rem 0;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

/* Sections */

section {
  padding: 3.5rem 0;
}

section.alt {
  background: var(--paper-alt);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.hero {
  padding: 4.5rem 0 4rem;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-accent);
}

.lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 44ch;
}

/* CTAs */

.cta-row {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  background: var(--brand-accent);
  color: var(--paper);
  padding: 0.7rem 1.4rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

.button:hover {
  background: var(--brand-accent-dark);
}

.button-small {
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
}

.button-outline {
  background: transparent;
  color: var(--brand-accent);
  border: 1px solid var(--brand-accent);
}

.button-outline:hover {
  background: var(--paper-alt);
  color: var(--brand-accent-dark);
}

.cta-secondary {
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 34ch;
}

/* Stat callout */

.stat {
  border-left: 3px solid var(--brand-accent);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--brand-accent);
}

.stat-label {
  display: block;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 40ch;
}

/* Workflow steps */

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3.25rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--brand-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--brand-accent);
}

/* Pilot */

.pilot-list {
  list-style: none;
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
}

.pilot-list li {
  padding-left: 1.25rem;
  border-left: 2px solid var(--hairline);
}

/* Start options */

.start-options {
  display: grid;
  gap: 2rem;
  margin-top: 1.5rem;
}

.start-option .button {
  margin-top: 1rem;
}

@media (min-width: 720px) {
  .start-options {
    grid-template-columns: 1fr 1fr;
  }
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 2rem 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.site-footer .wordmark {
  font-size: 1rem;
  color: var(--ink);
}

/* Extraction demo — a spoken walkthrough revealed as structured findings.
   Pre-baked (static data, no backend); see apps/website/README.md. */

.demo {
  border-top: 1px solid var(--hairline);
}

.demo .eyebrow {
  margin-bottom: 0.6rem;
}

.demo-intro {
  color: var(--ink-soft);
  max-width: 52ch;
}

/* The interactive module bleeds wider than the reading column on purpose. */
.demo-stage-wrap {
  max-width: 50rem;
  margin: 2rem auto 0;
  padding: 0 1.25rem;
}

.stage {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 780px) {
  .stage {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.panel {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--hairline);
  background: var(--paper-alt);
}

.panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.panel-meta {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.wave span {
  width: 3px;
  border-radius: 2px;
  background: var(--brand-accent);
  opacity: 0.55;
}

.transcript {
  position: relative;
  padding: 1.1rem;
  font-size: 1.02rem;
}

.transcript .lead {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}

/* Sweep overlay while "reading" the walkthrough. */
.demo-processing .transcript::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    var(--accent-wash) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: sweep 1.1s ease-in-out infinite;
  mix-blend-mode: multiply;
  pointer-events: none;
}

@keyframes sweep {
  from {
    background-position: 180% 0;
  }
  to {
    background-position: -80% 0;
  }
}

.control {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.button:disabled {
  opacity: 0.65;
  cursor: default;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 0.4rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

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

.findings-body {
  padding: 0.7rem;
  min-height: 12rem;
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 11rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.92rem;
}

.flist {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.finding {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--brand-accent);
  border-radius: 5px;
  background: var(--paper);
  padding: 0.75rem 0.85rem;
  opacity: 0;
  transform: translateY(6px);
  animation: rise 0.4s ease forwards;
}

.finding.flagged {
  border-left-color: var(--warn);
  background: var(--warn-wash);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

.f-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.sec {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-accent);
  background: var(--accent-wash);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
}

.flagged .sec {
  color: var(--warn);
  background: transparent;
  border: 1px solid var(--warn);
}

.f-type {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.conf {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.conf.low {
  color: var(--warn);
  background: var(--warn-wash);
  border: 1px solid var(--warn);
  border-radius: 3px;
  padding: 0.08rem 0.4rem;
  text-transform: none;
  letter-spacing: 0.02em;
}

.f-loc {
  font-weight: 600;
  font-size: 0.98rem;
}

.f-desc {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: 0.1rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  background: var(--paper-alt);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
}

.chip.code {
  color: var(--ink);
  font-weight: 600;
}

.chip.treat {
  color: var(--brand-accent);
}

.demo-note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

@media (prefers-reduced-motion: reduce) {
  .finding {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .demo-processing .transcript::after {
    animation: none;
  }
  .spinner {
    animation: none;
  }
}
