/* ============================================================================
   ELECT landing — landing.css
   The site chrome is the ALARIC DS (site/alaric/app.css, frozen — D38: buttons, segmented, links, cards, code, footer —
   owner, 2026-10-04). This file holds only the landing's own pieces (hero, story, stage, bands), on --site-* tokens
   (bridged to Alaric's); the story's stage is themed by the --elect-* tokens the engine generates from the brand.
   ============================================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }   /* type, colour and background: Alaric's .ds-root */
:focus-visible { outline: 2px solid var(--site-focus); outline-offset: 3px; }
a { color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- hero ---------------------------------------------------------------------------- */
/* A faint chart-paper grid behind the hero, fading out toward the edges. */
.hero { position: relative; min-height: calc(100vh - var(--site-header-height)); padding: var(--site-space-6);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--site-line) 1px, transparent 1px), linear-gradient(90deg, var(--site-line) 1px, transparent 1px);
  background-size: var(--site-space-7) var(--site-space-7); background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, black 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, black 20%, transparent 75%); }
.hero > * { position: relative; }
.hero-logo { margin: 0 0 var(--site-space-7); width: 100%; display: flex; justify-content: center; }
.hero-logo .elect-logo { max-width: min(100%, 640px); height: auto; }
p.hero-tag { margin: 0 0 var(--site-space-4); padding: var(--site-space-1) var(--site-space-3); border: 1px solid var(--site-line-strong);
  border-radius: var(--site-radius-pill); background: var(--site-card); font-size: var(--site-text-xs); font-weight: var(--site-weight-medium);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--site-text-2); }
p.hero-headline { margin: 0 0 var(--site-space-4); font-size: var(--site-text-4xl); line-height: 1.05;
  font-weight: var(--site-weight-bold); letter-spacing: -0.025em; }
.hero-headline span { display: block; color: var(--site-text-3); }
p.hero-lede { margin: 0 0 var(--site-space-6); font-size: var(--site-text-2xl); color: var(--site-text-2); max-width: 48ch; }
.hero-actions { display: flex; gap: var(--site-space-3); flex-wrap: wrap; justify-content: center; }
.scroll-cue { position: absolute; bottom: var(--site-space-6); left: 50%; transform: translateX(-50%); display: block;
  line-height: 0; animation: cue-bob 2.4s var(--elect-motion-easing-standard) infinite; }
.cue-arrow polygon { stroke-linejoin: miter; fill: var(--site-logo-1-fill); stroke: var(--site-logo-1-stroke); stroke-width: 1.5; }
@keyframes cue-bob { 50% { transform: translate(-50%, var(--site-space-1)); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue { animation: none; } }
@media (max-width: 720px) { .hero-headline { font-size: var(--site-text-3xl); } }
/* A short window (owner, 2026-10-04 — her 1536 × 733 screen): the scroll arrow smaller (80 → 56px wide) and lower
   (32 → 12px from the bottom), so it clears the hero's button. Nothing else moves; tall windows unchanged. */
@media (max-height: 820px) { .scroll-cue { bottom: var(--site-space-3); } .cue-arrow { width: var(--site-space-7); height: auto; } }

/* --- buttons: Alaric's .btn; the hero's call to action is a PILL (the site header's shape) ---------------- */
.btn.pill { border-radius: var(--radius-pill); padding: var(--site-space-3) var(--site-space-5); }
.btn.pill:hover { transform: translateY(-1px); }
.btn.pill:active { transform: translateY(0) scale(0.97); }
@media (prefers-reduced-motion: reduce) { .btn.pill:hover, .btn.pill:active { transform: none; } }
/* the step numbers: Alaric's .text-overline, with the landing's spacing */
p.eyebrow { margin: 0 0 var(--site-space-2); }

/* --- the story: steps (left) scroll past a sticky stage (right) -------------------------- */
.story { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--site-space-7);
  max-width: calc(var(--site-content-width) + 2 * var(--site-space-6)); margin: 0 auto; padding: 0 var(--site-space-6); }
.step { min-height: 85vh; display: flex; flex-direction: column; justify-content: center; opacity: 0.35;
  transition: opacity var(--elect-motion-effects-duration) var(--elect-motion-easing-standard); }
.step.is-active { opacity: 1; }
.step h2 { margin: 0 0 var(--site-space-3); font-size: var(--site-text-3xl); line-height: 1.15; font-weight: var(--site-weight-bold); letter-spacing: -0.01em; }
.step p:not(.eyebrow) { margin: 0 0 var(--site-space-4); font-size: var(--site-text-lg); color: var(--site-text-2); }
.step .btn { align-self: flex-start; }
.swatch-input { display: inline-flex; align-items: center; gap: var(--site-space-3); font-size: var(--site-text-md); color: var(--site-text-2); }
.swatch-input input { width: 56px; height: 40px; padding: 0; border: 1px solid var(--site-line-strong); border-radius: var(--site-radius-sm); background: none; cursor: pointer; }
#brand-hex { font-family: ui-monospace, Consolas, monospace; }

/* the stage stays under the sticky site header */
.story { scroll-margin-top: var(--site-header-height); }
.stage-wrap { position: sticky; top: calc(var(--site-header-height) + var(--site-space-4)); height: calc(100vh - var(--site-header-height) - var(--site-space-4) - var(--site-space-5));
  display: flex; align-items: center; }
.stage { position: relative; width: 100%; height: min(100%, 620px); background: var(--elect-chart-surface);
  border: 1px solid var(--site-line); border-radius: var(--site-radius); overflow: hidden; }

/* The six swatches: proof-1's mark — true fill + a same-hue, slightly darker border. */
.sw, .cvd-cell { position: absolute; background: var(--c); border: 1.5px solid var(--cs, oklch(from var(--c) calc(l - 0.12) c h)); }
/* A hatched slot (--tx: 1, D26) shows its hatch in the outline color, as on the marks; an outline-only
   slot (--ol: 1) is its outline on the surface. */
.sw, .cvd-cell { background-color: color-mix(in srgb, var(--c) calc((1 - var(--ol, 0)) * 100%), var(--elect-chart-surface)); }
.sw, .cvd-cell { background-image: repeating-linear-gradient(-45deg, transparent 0 calc(var(--elect-hatch-step) * 2 - var(--elect-hatch-width) * 2),
  color-mix(in srgb, var(--ci, var(--cs, oklch(from var(--c) calc(l - 0.12) c h))) calc(var(--tx, 0) * 100%), transparent) calc(var(--elect-hatch-step) * 2 - var(--elect-hatch-width) * 2) calc(var(--elect-hatch-step) * 2)); }
/* Each scene its own entrance (story.js sets the starting point):
   color = the square expands + slides right; palette = it SPLITS (the swatches move); check = GROW from the baseline,
   column by column (--i), like a chart's bars. Colors cross-fade. */
.sw { transition: left var(--elect-motion-spatial-duration) var(--elect-motion-easing-standard),
  top var(--elect-motion-spatial-duration) var(--elect-motion-easing-standard),
  width var(--elect-motion-spatial-duration) var(--elect-motion-easing-standard),
  height var(--elect-motion-spatial-duration) var(--elect-motion-easing-standard),
  opacity var(--elect-motion-effects-duration) var(--elect-motion-easing-standard),
  background var(--elect-motion-spatial-duration) ease, border-color var(--elect-motion-spatial-duration) ease; }
.stage[data-mode="check"] .sw, .cvd-cell {
  transition: top var(--elect-motion-reveal-duration) var(--elect-motion-easing-standard) calc(var(--i) * 60ms),
    height var(--elect-motion-reveal-duration) var(--elect-motion-easing-standard) calc(var(--i) * 60ms),
    opacity var(--elect-motion-effects-duration) var(--elect-motion-easing-standard),
    background var(--elect-motion-spatial-duration) ease, border-color var(--elect-motion-spatial-duration) ease; }
.stage[data-mode="color"] .sw:not(:first-child), .stage[data-mode="pre"] .sw:not(:first-child) { opacity: 0; }
/* palette → square (the split, reversed): the six gather ONE OVER ANOTHER — brand on top —
   and only once they are stacked do the ones underneath fade. */
.sw:first-child { z-index: 1; }
.stage[data-mode="color"] .sw:not(:first-child) { transition-property: left, top, width, height, opacity, background, border-color;
  transition-delay: 0s, 0s, 0s, 0s, var(--elect-motion-spatial-duration), 0s, 0s; }
.stage[data-mode="dashboard"] .sw { opacity: 0; }

.cvd > * { opacity: 0; }
.row-label, .ratio { transition: opacity var(--elect-motion-effects-duration) var(--elect-motion-easing-standard), color var(--elect-motion-spatial-duration) ease; }
.stage[data-mode="check"] .cvd > * { opacity: 1; }
.row-label, .ratio { position: absolute; font-size: var(--site-text-xs); line-height: 20px; color: var(--elect-chart-text-secondary); }
/* Check: "most people" on top, alone; a divider; then the color-blind rows, each named. */
.group-head, .divider { position: absolute; }
.group-head { font-size: var(--site-text-sm); font-weight: var(--site-weight-bold); line-height: 20px; color: var(--elect-chart-text-primary);
  transition: opacity var(--elect-motion-effects-duration) var(--elect-motion-easing-standard); }
.divider { background: var(--elect-chart-axis-line); transition: opacity var(--elect-motion-effects-duration) ease; }
.row-label:not(.ratio-head) { transform: translateY(-50%); line-height: 1.35; }
.row-name { color: var(--elect-chart-text-primary); font-weight: var(--site-weight-medium); }
.row-who { color: var(--elect-chart-text-secondary); }
.ratio { text-align: center; font-family: ui-monospace, Consolas, monospace; }
/* A narrow stage (story.js NARROW_W): each row's name sits above its row, name · who on one line. */
.cvd.narrow .row-label:not(.ratio-head) { transform: none; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cvd.narrow .row-name, .cvd.narrow .row-who { display: inline; }
.cvd.narrow .row-who::before { content: " · "; }


.ratio.fail { color: var(--elect-data-negative); font-weight: var(--site-weight-bold); }
.ratio.edge { color: var(--site-warn); font-weight: var(--site-weight-bold); }   /* passes, only just (story.js BORDERLINE) */

/* Charts: the swatches step aside and a REAL ELECT chart grows in their place. */
.chart-layer { position: absolute; inset: 0; padding: var(--site-space-5); opacity: 0;
  transition: opacity var(--elect-motion-effects-duration) var(--elect-motion-easing-standard); }
.chart-layer { display: flex; align-items: center; justify-content: center; }
.chart-layer > * { display: block; width: 100%; height: 100%; }
/* Desktop: the chart sits centered in the stage, not edge to edge (owner). */
@media (min-width: 901px) { .chart-layer > * { width: 78%; height: 66%; } }
/* palette → chart: the swatches move onto the bars and take the brand color (one series);
   once "landed", the real chart takes over in the same instant (no fade: same pixels). */
.stage.as-bars .sw { --c: var(--elect-data-categorical-1) !important; --cs: var(--elect-data-categorical-1-stroke) !important; --tx: 0 !important; --ol: 0 !important; }
.stage.landed .chart-layer, .stage.flying .chart-layer { opacity: 1; transition: none; }
.stage.landed .sw { opacity: 0; transition: none; }
/* charts → dashboard: the chart flies to its tile; that tile shows once it has landed. */
.dash .tile { transition: opacity calc(var(--elect-motion-spatial-duration) / 2) ease; }
.dash .tile.arriving { opacity: 0; transition: none; }
.step-actions { display: flex; align-items: center; gap: var(--site-space-3); flex-wrap: wrap; margin-bottom: var(--site-space-3); }
.chart-count { margin-left: var(--site-space-1); font-variant-numeric: tabular-nums; color: var(--site-text-3); }
.step-cta { align-self: flex-start; }

/* Step 5: a real dashboard, on the same theme. */
.dash { position: absolute; inset: 0; padding: var(--site-space-4); display: grid; gap: var(--site-space-3);
  grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
  opacity: 0; transition: opacity var(--elect-motion-reveal-duration) var(--elect-motion-easing-standard); }
.stage[data-mode="dashboard"] .dash { opacity: 1; }
/* The landing's KPI cards stay OUTLINED (as they were): its charts sit on the stage without cards of their own. */
.dash .kpis { grid-column: 1 / -1; display: flex; gap: var(--site-space-3);
  --elect-card-bg: var(--elect-chart-surface); --elect-card-border: var(--elect-chart-axis-line); --elect-card-shadow: none; }
.dash .kpis > * { flex: 1; min-width: 0; }
.dash .tile.wide { grid-column: 1 / -1; }
.dash .tile { min-height: 0; }
.dash .tile > * { display: block; height: 100%; }
/* A phone: three KPI cards, a line and two charts side by side don't fit a 390px stage (cards cut, the donut out of
   frame; with the bars too, the line got ~100px). The scene keeps two cards and the line, one column — a demo scene,
   not a chart (no chart drops data). A chart coming from step 03 doesn't fly to a tile that isn't there: it gives way,
   as shapes that differ do. */
@media (max-width: 600px) {
  .dash { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .dash .kpis { --elect-kpi-min-width: 0; --elect-text-display: var(--site-text-xl); }   /* the value and its arrow fit the half-width card */
  .dash .kpis > :nth-child(n + 3), .dash .tile:not(.wide) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sw, .cvd > *, .dash, .step, .chart-layer { transition: none; }
}
@media (max-width: 900px) {
  .story { grid-template-columns: 1fr; gap: 0; }
  .stage-wrap { order: -1; top: var(--site-header-height); height: 50vh; z-index: 2; background: var(--site-bg); }
  .step { min-height: 70vh; }
}

/* --- take it ----------------------------------------------------------------------------- */
.band { padding: var(--site-space-8) var(--site-space-6); background: var(--site-panel); border-top: 1px solid var(--site-line); }
.band > * { max-width: var(--site-content-width); margin-left: auto; margin-right: auto; }
.band-head { margin-bottom: var(--site-space-5); }
.band-head h2 { margin: 0 0 var(--site-space-2); font-size: var(--site-text-3xl); line-height: 1.15; font-weight: var(--site-weight-bold); }
.band-head p:not(.eyebrow) { margin: 0; font-size: var(--site-text-lg); color: var(--site-text-2); max-width: 64ch; }
/* Alaric's pre — its ".ds-root pre { margin: 0 }" would undo the band's width and spacing, hence the longer selector */
.band pre.code-sample { margin: 0 auto var(--site-space-5); }
.actions { display: flex; gap: var(--site-space-3); flex-wrap: wrap; }
.band.light { background: var(--site-bg); }
.features { list-style: none; padding: 0; margin-bottom: var(--site-space-5); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--site-space-4); }
.features li { display: block; color: var(--site-text-2); }   /* Alaric's .card */
.features strong { display: block; color: var(--site-text); margin-bottom: var(--site-space-1); }
@media (max-width: 720px) { .features { grid-template-columns: 1fr; } }

.foot { justify-content: center; text-align: center; }   /* Alaric's .footer, one centred line */
.reset-link { align-self: flex-start; margin-top: var(--site-space-2); }   /* Alaric's .link */

/* The palette TYPE toggle (D26): Alaric's .segmented */
.step .segmented { align-self: flex-start; margin-bottom: var(--site-space-3); }
