/* Acceleratia: visual identity.
   Palette from the Acceleratia logo: the blue "A" (Dx, main accent) and the red swoosh (Tx),
   darkened for text contrast (WCAG AA). Cool "slide glass" background. System fonts only. */
:root {
  --bg: #f3f5f8;          /* slide glass */
  --surface: #ffffff;
  --fg: #17202e;          /* ink */
  --muted: #5a6475;
  --accent: #225da8;      /* logo blue: Dx, links, primary actions */
  --accent-soft: #dbe7f5;
  --accent-tx: #b8392f;   /* logo red: Tx */
  --tx-soft: #f8e1de;
  --line: #d9dee6;
  --bar: #c7cfdb;
  --logo-a1: #2aa6e6; --logo-a2: #3172c8; --logo-swoosh: #d0524a;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Modular scale, ratio 1.25 */
  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.33rem;
  --step-2: clamp(1.6rem, 3vw, 2.1rem);
  --step-3: clamp(2.3rem, 6vw, 4.2rem);

  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 2rem;
  --space-4: 3.5rem;
  --space-5: clamp(4rem, 10vw, 7.5rem);
  --max: 70rem;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101826; --surface: #172235; --fg: #e8edf4; --muted: #9aa6b8;
    --accent: #6bb6ee; --accent-soft: #1d3350; --accent-tx: #f2867b; --tx-soft: #3a2026;
    --line: #253247; --bar: #34435b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: var(--step-0)/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: max(1rem, 4vw); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 3.75rem; }
.wordmark {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 44px;
  font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; text-decoration: none; color: var(--fg);
}
.wordmark svg { width: 1.7rem; height: 1.7rem; }
.logo-a { fill: url(#logo-grad); }
.logo-swoosh { fill: var(--logo-swoosh); }
nav { display: flex; gap: var(--space-3); flex-wrap: wrap; }
nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: .95rem; }
nav a:hover { color: var(--fg); }
@media (max-width: 34rem) { nav { gap: var(--space-2); } nav a:not(:last-child) { display: none; } }

/* Sections */
section { padding-block: var(--space-5); }
section + section { border-top: 1px solid var(--line); }
h1, h2, h3 { line-height: 1.1; text-wrap: balance; margin: 0 0 var(--space-2); font-weight: 700; }
h1 { font-size: var(--step-3); max-width: 15ch; letter-spacing: -.035em; line-height: 1.02; }
h2 { font-size: var(--step-2); letter-spacing: -.02em; max-width: 24ch; }
h3 { font-size: var(--step-1); letter-spacing: -.01em; }
p { max-width: 62ch; margin: 0 0 var(--space-2); text-wrap: pretty; }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 46ch; }
.note { color: var(--muted); font-size: var(--step--1); }
.tbc { background: #ffe9a8; color: #5a4300; font-size: .8em; padding: 0 .3em; border-radius: 3px; }

.button {
  display: inline-flex; align-items: center; padding: .8rem 1.35rem; min-height: 44px;
  background: var(--accent); color: var(--bg); text-decoration: none; border-radius: 999px; font-weight: 600; border: 0;
  transition: background-color .15s ease;
}
.button:hover { background: color-mix(in srgb, var(--accent) 85%, var(--fg)); }
.button.secondary { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* Hero: the differential settles from uncertainty into a few strong signals */
.hero { padding-block: clamp(4rem, 11vw, 8rem) var(--space-4); }
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.differential { margin: var(--space-4) 0 0; }
.differential svg { display: block; width: 100%; height: auto; overflow: visible; }
.differential .bar {
  fill: var(--bar);
  transform-box: fill-box; transform-origin: 50% 100%;
  transform: scaleY(var(--h));
  transition: transform 1.1s var(--ease-out) calc(var(--i) * 22ms), fill .6s ease .9s;
}
.differential .mid { fill: color-mix(in srgb, var(--accent) 45%, var(--bar)); }
.differential .hi { fill: var(--accent); }
.differential .base { stroke: var(--fg); stroke-width: 1.5; }
.js .differential:not(.settled) .bar { transform: scaleY(.5); fill: var(--bar); }
.differential figcaption { margin-top: var(--space-1); color: var(--muted); font-size: var(--step--1); }

/* Approach: a real sequence, so it is numbered */
.steps { list-style: none; padding: 0; margin: var(--space-3) 0 0; display: grid; gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); counter-reset: step; }
.steps li { counter-increment: step; padding-top: var(--space-2); border-top: 2px solid var(--fg); }
.steps li::before { content: counter(step); display: block; font-weight: 700; font-size: var(--step-1);
  font-variant-numeric: tabular-nums; color: var(--accent); margin-bottom: var(--space-1); }
.steps li:last-child { border-top-color: var(--accent-tx); }
.steps li:last-child::before { color: var(--accent-tx); }

/* Technology */
.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--space-2); margin: var(--space-3) 0; }
.module { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: var(--space-3); }
.module p { margin: 0; color: var(--muted); }
.module h3 { color: var(--accent); }
.module-tx { background: var(--tx-soft); border-color: transparent; }
.module-tx h3 { color: var(--accent-tx); }
.module-tx p { color: var(--fg); }

.diagram { margin: var(--space-4) 0 var(--space-2); }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram .narrow { display: none; }
@media (max-width: 40rem) { .diagram .wide { display: none; } .diagram .narrow { display: block; } }
.diagram .box { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.diagram .core { fill: var(--accent-soft); stroke: none; }
.diagram .dx { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.diagram .tx { fill: var(--accent-tx); stroke: none; }
.diagram text { fill: var(--fg); font: 600 15px var(--font-sans); }
.diagram .sub { fill: var(--muted); font-weight: 400; font-size: 13px; }
.diagram .t-core { fill: var(--accent); font-size: 17px; font-weight: 700; }
.diagram .t-dx { fill: var(--accent); font-size: 17px; font-weight: 700; }
.diagram .t-tx { fill: var(--bg); font-size: 17px; font-weight: 700; }
.diagram .t-tx-sub { fill: var(--bg); font-weight: 400; font-size: 13px; }
.diagram .wire { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.diagram .wire-tx { stroke: var(--accent-tx); stroke-width: 2; }
.diagram .head { fill: var(--muted); }
.diagram .head-tx { fill: var(--accent-tx); }
.js .diagram .wire { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s var(--ease-out); }
.js .diagram .w2 { transition-delay: .15s; } .js .diagram .w3 { transition-delay: .45s; } .js .diagram .w4 { transition-delay: .75s; }
.js .diagram.visible .wire { stroke-dashoffset: 0; }
.js .diagram .head { opacity: 0; transition: opacity .3s ease .9s; }
.js .diagram.visible .head { opacity: 1; }

/* Industrialisation timeline: a progress line that fills to where we are now */
.timeline { --now: 2; list-style: none; padding: 0; margin: var(--space-4) 0 0; position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 0; right: 0; top: .45rem; height: 2px; background: var(--line); }
.timeline::after { background: var(--accent); right: calc(100% - (var(--now) - .5) * 25%); transform-origin: left; }
.timeline li { position: relative; padding-top: var(--space-3); }
.timeline li::before { content: ""; position: absolute; top: 0; left: 0; width: 1rem; height: 1rem; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 0 0 2px var(--line); z-index: 1; }
.timeline [data-state="done"]::before { background: var(--accent); box-shadow: none; }
.timeline [data-state="now"]::before { background: var(--bg); box-shadow: inset 0 0 0 4px var(--accent), 0 0 0 5px var(--accent-soft); }
.timeline .state { display: block; color: var(--muted); font-size: var(--step--1); margin-bottom: .25rem; }
.timeline [data-state="now"] .state { color: var(--accent); font-weight: 600; }
.timeline p { color: var(--muted); }
.js .timeline::after { transform: scaleX(0); transition: transform 1.2s var(--ease-out) .2s; }
.js .timeline.visible::after { transform: none; }
@media (max-width: 48rem) {
  .timeline { grid-template-columns: 1fr; gap: var(--space-2); padding-left: var(--space-3); }
  .timeline::before, .timeline::after { left: .45rem; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .timeline::after { bottom: calc(100% - (var(--now) - .5) * 25%); transform-origin: top; }
  .js .timeline::after { transform: scaleY(0); }
  .timeline li { padding-top: 0; }
  .timeline li::before { left: calc(-1 * var(--space-3)); top: .2rem; }
}

/* Figures */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-3); margin: var(--space-3) 0 0; }
.figures div { border-top: 2px solid var(--fg); padding-top: var(--space-2); }
.figures dt { font-size: var(--step-3); font-weight: 700; line-height: 1; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; color: var(--accent); margin-bottom: var(--space-1); }
.figures dd { margin: 0; color: var(--muted); max-width: 22ch; }

/* Closing */
.closing { background: var(--accent); color: var(--bg); }
.closing h2 { font-size: var(--step-3); letter-spacing: -.035em; max-width: 14ch; }
.closing p { color: color-mix(in srgb, var(--bg) 82%, var(--accent)); }
.closing a { color: var(--bg); }
.closing .button { background: var(--bg); color: var(--accent); }
.closing .button:hover { background: color-mix(in srgb, var(--bg) 88%, var(--accent)); }
.site-footer { padding-block: var(--space-3); color: var(--muted); font-size: var(--step--1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .js .differential:not(.settled) .bar { transform: scaleY(var(--h)); }
  .js .diagram .wire { stroke-dashoffset: 0; } .js .diagram .head { opacity: 1; }
  .js .timeline::after { transform: none; }
}
