/* How it works page + charts. Palette validated with the dataviz checker (light and dark). */
:root { --series-1: #3a62b5; --series-2: #d9541a; --series-muted: #d6d3ca; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #5f80d6; --series-2: #d9662c; --series-muted: #45443f; } }

.how-hero { padding: 64px 0 56px; border-bottom: 1px solid var(--border); }
.kicker { margin: 0 0 14px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.how-hero h1 { font-size: clamp(44px, 8vw, 88px); line-height: .98; margin: 0 0 22px; letter-spacing: -.03em; }
.how-hero .lede { font-size: 19px; max-width: 640px; }
.hero-figures { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 48px; border-top: 2px solid var(--text); }
.hero-figures div { padding: 18px 20px 0 0; }
.hero-figures b { display: block; font-size: clamp(40px, 5.5vw, 64px); font-weight: 650; letter-spacing: -.04em; line-height: 1.05; }
.hero-figures span { display: block; color: var(--muted); font-size: 14.5px; max-width: 210px; margin-top: 4px; }

.how-section { padding: 72px 0; border-bottom: 1px solid var(--border); }
.how-head { display: grid; grid-template-columns: 80px 1fr; gap: 8px 24px; margin-bottom: 34px; }
.how-head .num { font-size: 15px; font-weight: 600; color: var(--muted); padding-top: 14px; border-top: 2px solid var(--text); font-variant-numeric: tabular-nums; }
.how-head h2 { font-size: clamp(32px, 4.5vw, 48px); line-height: 1.05; margin: 6px 0 12px; }
.how-head p { margin: 0; color: var(--muted); font-size: 17.5px; max-width: 680px; }

.pipeline { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(5, 1fr); counter-reset: p; }
.pipeline li { position: relative; padding: 16px 18px 18px; background: var(--surface); border: 1px solid var(--border); margin-left: -1px; counter-increment: p; }
.pipeline li:first-child { border-radius: 10px 0 0 10px; margin-left: 0; }
.pipeline li:last-child { border-radius: 0 10px 10px 0; background: var(--text); color: var(--bg); border-color: var(--text); }
.pipeline li:last-child span { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.pipeline li::before { content: counter(p, decimal-leading-zero); display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.pipeline li:last-child::before { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.pipeline li:not(:last-child)::after { content: ""; position: absolute; right: -7px; top: 50%; width: 12px; height: 12px; background: var(--surface); border-top: 1px solid var(--border); border-right: 1px solid var(--border); transform: translateY(-50%) rotate(45deg); z-index: 1; }
.pipeline b { display: block; font-size: 15.5px; margin-bottom: 4px; }
.pipeline span { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.45; }

.chart-card { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px 20px 14px; }
.chart-card figcaption { margin-bottom: 14px; }
.chart-card figcaption b { display: block; font-size: 16px; }
.chart-card figcaption span { color: var(--muted); font-size: 14px; }
.chart-pair { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; stroke: none; }
svg.chart .grid { stroke: var(--border); stroke-width: 1; }
svg.chart .axis { stroke: var(--border-strong); stroke-width: 1; }
svg.chart text { fill: var(--muted); font: 12.5px var(--sans); stroke: none; }
svg.chart text.row-label { fill: var(--text); font-size: 13.5px; }
svg.chart text.value { fill: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
svg.chart text.value.small { font-size: 12px; }
svg.chart text.strong { font-weight: 700; }
svg.chart .mark { stroke: none; transition: opacity .12s; }
svg.chart .mark:hover, svg.chart .mark:focus { opacity: .78; outline: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; margin-bottom: 8px; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart-tip { position: absolute; z-index: 60; pointer-events: none; background: var(--ink); color: var(--ink-text); border-radius: 7px; padding: 6px 10px; font-size: 13px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.chart-tip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.chart-tip span { opacity: .8; }
.chart-table { margin-top: 8px; font-size: 13.5px; }
.chart-table summary { cursor: pointer; color: var(--link); width: max-content; }
.chart-table table { border-collapse: collapse; margin-top: 8px; width: 100%; }
.chart-table th, .chart-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.callout { margin: 20px 0 0; padding: 14px 18px; border-left: 3px solid var(--unsure); background: var(--unsure-soft); border-radius: 0 8px 8px 0; max-width: 760px; }

.scale { display: flex; gap: 2px; border-radius: 10px; overflow: hidden; }
.scale .zone { padding: 16px 14px 14px; min-width: 0; }
.scale .zone b { display: block; font-size: 15px; }
.scale .zone span { font-size: 13px; opacity: .85; font-variant-numeric: tabular-nums; }
.scale .h { background: var(--human); color: #fff; }
.scale .lh { background: var(--human-soft); color: var(--human); }
.scale .u { background: var(--unsure-soft); color: var(--unsure); }
.scale .la { background: var(--ai-soft); color: var(--ai); }
.scale .a { background: var(--ai); color: #fff; }

.big-words { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--text); }
.big-words div { padding: 18px 24px 0 0; }
.big-words b { display: block; font-size: clamp(52px, 7vw, 84px); font-weight: 650; letter-spacing: -.04em; line-height: 1; }
.big-words span { display: block; color: var(--muted); font-size: 15px; max-width: 260px; margin-top: 8px; }
.big-words.spaced { margin-top: 32px; }
.sub-head { font-family: var(--serif); font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -.01em; margin: 64px 0 10px; }
.sub-intro { max-width: 760px; color: var(--muted); margin: 0 0 24px; }

table.example { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.example th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border-strong); }
table.example td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.example td:first-child { max-width: 380px; }
table.example .label { margin: 0; white-space: nowrap; }

.promise { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.promise li { padding: 18px 0; border-top: 1px solid var(--border); color: var(--muted); }
.promise b { display: block; color: var(--text); font-family: var(--serif); font-size: 21px; font-weight: 600; margin-bottom: 4px; }

@media (max-width: 860px) {
  .hero-figures { grid-template-columns: 1fr 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline li { margin-left: 0; margin-top: -1px; }
  .pipeline li:first-child { border-radius: 10px 10px 0 0; margin-top: 0; }
  .pipeline li:last-child { border-radius: 0 0 10px 10px; }
  .pipeline li:not(:last-child)::after { right: auto; left: 26px; top: auto; bottom: -7px; transform: rotate(135deg); }
  .chart-pair { grid-template-columns: 1fr; }
  .scale { flex-wrap: wrap; }
  .scale .zone { flex: 1 1 30% !important; }
}
@media (max-width: 620px) {
  .how-head { grid-template-columns: 1fr; }
  .how-head .num { width: 60px; }
  .big-words, .promise { grid-template-columns: 1fr; }
  .big-words div { padding-bottom: 14px; }
  .how-section { padding: 52px 0; }
  table.example { font-size: 13.5px; }
  table.example th:last-child, table.example td:last-child { display: none; }
}
