/* ==========================================================================
   Deepak Jatav — portfolio
   Direction: a printed analyst's report. Paper, ink, hairlines, one typeface
   doing the shouting. Colour is reserved for data.
   ========================================================================== */

:root {
  --paper: #fcfcfb;
  --plane: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #898781;
  --rule: #e1e0d9;
  --rule-2: #c3c2b7;

  /* data colours (validated categorical slots, fixed order) */
  --s1: #2a78d6;
  --s1-ink: #1c5cab;
  --s1-wash: #cde2fb;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;

  /* status (reserved, always with icon + label) */
  --good: #0ca30c;
  --good-text: #006300;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: clamp(20px, 4vw, 48px);

  --f-display: 'Archivo', 'Arial Narrow', 'Segoe UI', sans-serif;
  --f-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--s1-ink); outline-offset: 3px; }

.wrap { width: min(1240px, 100%); margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--paper); transition: top 0.15s; }
.skip:focus { top: 12px; }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.8em 1.15em; border: 1px solid var(--ink); border-radius: 2px;
  font-weight: 600; font-size: 15px; line-height: 1; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--paper); color: var(--ink); }

.link-arrow {
  display: inline-flex; align-items: baseline; gap: 0.4em;
  font-weight: 600; font-size: 15px; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: color 0.15s;
}
.link-arrow span { display: inline-block; transition: transform 0.2s var(--ease); }
.link-arrow:hover { color: var(--s1-ink); }
.link-arrow:hover span { transform: translate(2px, 0); }
.link-arrow small { font-weight: 400; font-size: 13px; color: var(--ink-3); }

.note { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.top.is-stuck { border-bottom-color: var(--rule); }
.top-row { display: flex; align-items: center; gap: 28px; height: 64px; }
.top-name { font: 700 19px/1 var(--f-display); font-stretch: 88%; letter-spacing: -0.01em; text-decoration: none; }
.top-nav { display: flex; gap: 22px; margin-left: auto; }
.top-nav a { position: relative; padding: 6px 0; font-size: 14.5px; color: var(--ink-2); text-decoration: none; transition: color 0.15s; }
.top-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.25s var(--ease); }
.top-nav a:hover, .top-nav a.is-on { color: var(--ink); }
.top-nav a.is-on::after { transform: scaleX(1); }
.top-cta { padding: 0.62em 0.95em; font-size: 14px; }
.top-menu { display: none; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(36px, 6vw, 84px); padding-bottom: clamp(48px, 7vw, 96px); }
.hero-kicker { font-size: 14.5px; color: var(--ink-2); }
.hero-kicker span[aria-hidden] { margin: 0 0.5em; color: var(--rule-2); }
.clock { font-family: var(--f-mono); font-size: 13.5px; }

.hero-title {
  margin: clamp(16px, 2.4vw, 30px) 0 clamp(28px, 4vw, 56px);
  font: 800 clamp(38px, 10vw, 128px)/0.94 var(--f-display);
  font-stretch: 78%; letter-spacing: -0.02em;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.07em; }
.hero-title .line > span { display: inline-block; }
.hero-title em {
  font-style: normal;
  background: linear-gradient(var(--s1), var(--s1)) left 93% / 0% 0.085em no-repeat;
}
.js .hero-title .line > span { transform: translateY(108%); }
.ready .hero-title .line > span { transform: none; transition: transform 0.85s var(--ease); }
.ready .hero-title .line:nth-child(2) > span { transition-delay: 0.09s; }
.ready .hero-title .line:nth-child(3) > span { transition-delay: 0.18s; }
.ready .hero-title em { background-size: 100% 0.085em; transition: background-size 0.7s var(--ease) 0.95s; }

.js .hero-kicker, .js .hero-grid { opacity: 0; }
.ready .hero-kicker, .ready .hero-grid { opacity: 1; transition: opacity 0.6s ease 0.35s; }

/* facts: the heavy rule is drawn first, then each figure rises in turn */
.js .facts { border-top-color: transparent; background: linear-gradient(var(--ink), var(--ink)) left top / 0% 2px no-repeat; background-origin: border-box; }
.ready .facts { background-size: 100% 2px; transition: background-size 0.9s var(--ease) 0.45s; }
.js .facts > div { opacity: 0; transform: translateY(12px); }
.ready .facts > div { opacity: 1; transform: none; transition: opacity 0.5s ease, transform 0.6s var(--ease); transition-delay: calc(0.7s + var(--k, 0) * 0.08s); }
.facts > div:nth-child(2) { --k: 1; }
.facts > div:nth-child(3) { --k: 2; }
.facts > div:nth-child(4) { --k: 3; }
.facts > div:nth-child(5) { --k: 4; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.hero-lede { font-size: clamp(18px, 1.55vw, 22px); line-height: 1.5; max-width: 30em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 26px; margin-top: 30px; }

figcaption { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
figcaption b { margin-right: 0.5em; font: 500 12px var(--f-mono); color: var(--ink); }

.map { display: block; width: 100%; height: auto; border: 1px solid var(--rule); background: var(--paper); }
.map-grid path { fill: none; stroke: var(--rule); stroke-width: 1; }
.map-ticks text { font: 400 9px var(--f-mono); fill: var(--ink-3); }
.map-sea { font: 400 10px var(--f-body); letter-spacing: 0.32em; fill: var(--ink-3); text-anchor: middle; }
.map-lanes path { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; stroke-dasharray: 1; }
.map-lanes path.land { stroke: var(--ink-3); }
.js .map-lanes path { stroke-dashoffset: 1; }
.ready .map-lanes path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.5s var(--ease) 0.5s; }
.ready .map-lanes path.land { transition-delay: 1.5s; transition-duration: 0.8s; }
.map-dots circle { fill: var(--s1); stroke: var(--paper); stroke-width: 2; }
.map-nodes circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; }
.map-nodes circle.origin { fill: var(--ink); }
.map-nodes text { font: 500 11.5px var(--f-body); fill: var(--ink); }
/* each city appears as its lane reaches it */
.js .map-nodes circle { transform: scale(0); }
.js .map-nodes text { opacity: 0; }
.ready .map-nodes circle { transform: none; transition: transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) var(--d, 0.5s); }
.ready .map-nodes text { opacity: 1; transition: opacity 0.45s ease var(--d, 0.5s); }
.map-nodes > g:nth-child(1) { --d: 0.45s; }
.map-nodes > g:nth-child(2) { --d: 1.75s; }
.map-nodes > g:nth-child(3) { --d: 1.85s; }
.map-nodes > g:nth-child(4) { --d: 2.3s; }
.map-nodes > g:nth-child(5) { --d: 1.95s; }
.map-pings circle { fill: none; stroke: var(--s1); stroke-width: 1.5; }

.facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: clamp(40px, 6vw, 80px); border-top: 2px solid var(--ink); }
.facts > div { padding: 18px 18px 0 0; }
.facts > div + div { padding-left: 18px; border-left: 1px solid var(--rule); }
.facts dt { font: 700 clamp(34px, 4.4vw, 58px)/1 var(--f-display); font-stretch: 82%; letter-spacing: -0.02em; }
.facts dd { margin-top: 8px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }

/* ---------- Section frame: margin column + content ---------- */
.section { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(24px, 4.5vw, 72px); padding-top: clamp(56px, 8vw, 112px); padding-bottom: clamp(56px, 8vw, 112px); }
.side { position: sticky; top: 92px; align-self: start; }
.side-no { font: 500 13px var(--f-mono); color: var(--ink-3); }
.side-title { margin-top: 6px; font: 700 clamp(26px, 2.6vw, 34px)/1.05 var(--f-display); font-stretch: 84%; letter-spacing: -0.01em; }
.side-note { margin-top: 12px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.band { background: var(--plane); border-block: 1px solid var(--rule); }

.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Case studies ---------- */
.case { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 56px); align-items: start; padding-bottom: clamp(48px, 6vw, 80px); }
.case + .case { padding-top: clamp(48px, 6vw, 80px); border-top: 1px solid var(--rule); }
.case-flip .case-fig { order: -1; }
.case-tag { display: inline-block; margin-bottom: 10px; padding: 2px 7px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; }
.case h3 { font: 700 clamp(26px, 3vw, 40px)/1.05 var(--f-display); font-stretch: 84%; letter-spacing: -0.015em; }
.pso { margin-top: 22px; display: grid; gap: 16px; }
.pso dt { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.pso dd { margin-top: 2px; font-size: 16px; line-height: 1.55; }
.case-stack { margin: 20px 0 14px; padding-top: 12px; border-top: 1px solid var(--rule); font: 400 13px/1.5 var(--f-mono); color: var(--ink-2); }

/* figure: reconciliation table */
.recon { border: 1px solid var(--rule-2); background: var(--paper); font-size: 13px; }
.recon-head, .recon-row { display: grid; grid-template-columns: 1.1fr 0.9fr 1fr 1fr 1.3fr; gap: 10px; align-items: center; padding: 10px 14px; }
.recon-head { font-size: 12px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--ink); }
.recon-row + .recon-row { border-top: 1px solid var(--rule); }
.recon-row > span:first-child, .recon .num { font-family: var(--f-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.recon .num { position: relative; text-align: right; }
.recon .st { position: relative; min-height: 1.5em; }
.recon .st i { position: absolute; left: 0; top: 0; font-style: normal; font-weight: 600; white-space: nowrap; }
.recon .ok { color: var(--good-text); }
.recon .ok::before { content: "\2713\00a0"; }
.recon .diff { color: var(--crit); }
.recon .diff::before { content: "!\00a0"; }
.recon .was, .recon .now { font-weight: 400; }
.recon .was { color: var(--crit); }
.recon .now { position: absolute; right: 0; top: 0; }
.recon .ok, .recon .diff, .recon .was, .recon .now { animation: rc-ok 8s var(--ease) infinite; animation-delay: calc(var(--i, 2) * 0.5s); }
.recon .is-diff .ok, .recon .now { animation-name: rc-late; }
.recon .diff, .recon .was { animation-name: rc-diff; }
@keyframes rc-ok { 0%, 6% { opacity: 0; } 10%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rc-late { 0%, 52% { opacity: 0; } 56%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rc-diff { 0%, 6% { opacity: 0; } 10%, 50% { opacity: 1; } 54%, 100% { opacity: 0; } }

/* figure: pipeline diagram */
.pipe { display: block; width: 100%; height: auto; border: 1px solid var(--rule); background: var(--paper); }
.pipe-lines path { fill: none; stroke: var(--rule-2); stroke-width: 1.2; }
.pipe-pk circle { fill: var(--s1); }
.pipe-box rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.pipe-box text, .pipe-core text { font: 500 11.5px var(--f-body); fill: var(--ink); text-anchor: middle; }
.pipe-core rect { fill: var(--ink); }
.pipe-core text { fill: var(--paper); font-weight: 600; font-size: 13px; }
.pipe-core text.sub { font: 400 10px var(--f-mono); fill: var(--rule-2); }

/* also built */
.more { padding-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--rule); }
.more-title { font: 700 22px/1.1 var(--f-display); font-stretch: 84%; }
.more-list { margin-top: 8px; }
.more-list li { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr) auto; gap: 8px 28px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.more-list h4 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.more-list p { font-size: 15.5px; line-height: 1.55; }
.more-list .more-stack { font: 400 13px/1.5 var(--f-mono); color: var(--ink-2); }

/* ---------- Dashboards ---------- */
.dash { position: relative; background: var(--paper); border: 1px solid var(--rule-2); border-radius: 4px; }
.dash-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--rule); }
.tabs { display: flex; gap: 22px; overflow-x: auto; }
.tabs button { padding: 16px 0 13px; border-bottom: 2px solid transparent; font-size: 15px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: color 0.15s, border-color 0.15s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.sample { flex: none; margin-bottom: 14px; padding: 2px 8px; border: 1px solid var(--rule-2); border-radius: 2px; font-size: 12px; color: var(--ink-2); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.seg { display: inline-flex; flex-wrap: wrap; align-items: center; }
.seg-label { margin-right: 10px; font-size: 13px; color: var(--ink-2); }
.seg button { margin-left: -1px; padding: 6px 11px; border: 1px solid var(--rule-2); background: var(--paper); font-size: 13.5px; color: var(--ink-2); transition: background 0.15s, color 0.15s, border-color 0.15s; }
.seg button:first-of-type { margin-left: 0; border-radius: 2px 0 0 2px; }
.seg button:last-of-type { border-radius: 0 2px 2px 0; }
.seg button:hover { color: var(--ink); background: var(--plane); }
.seg button[aria-pressed="true"] { position: relative; z-index: 1; background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 600; }
.tick { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.tick input { width: 15px; height: 15px; margin: 0; accent-color: var(--ink); }

.dash-view { padding: 20px; min-height: 420px; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: 4px; }
.tile { padding: 14px 16px 16px; }
.tile + .tile { border-left: 1px solid var(--rule); }
.tile-label { font-size: 13px; color: var(--ink-2); }
.tile-value { margin-top: 4px; font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }
.tile.is-hero .tile-value { font-size: clamp(34px, 3.6vw, 48px); }
.tile-delta { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.tile-delta b { font-weight: 600; }
.tile-delta .is-good { color: var(--good-text); }
.tile-delta .is-bad { color: var(--crit); }

.charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 36px; margin-top: 26px; }
.chart h4 { font-size: 15.5px; font-weight: 600; }
.chart-sub { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.legend i.line { width: 14px; height: 2px; border-radius: 0; }

/* ranked bars (HTML) */
.bars { margin-top: 14px; display: grid; gap: 2px; }
.bar-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 62px; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 2px; outline-offset: 0; cursor: default; }
.bar-row:hover, .bar-row:focus-visible { background: var(--plane); }
.bar-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { display: flex; gap: 2px; height: 18px; }
.bar-seg { height: 100%; min-width: 0; transform-origin: left center; animation: grow-x 0.55s var(--ease) backwards; }
.bar-seg:last-child { border-radius: 0 4px 4px 0; }
.bar-val { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
@keyframes grow-x { from { transform: scaleX(0); } }

/* line chart (SVG) */
.line-svg { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.line-svg text { font: 400 12px var(--f-body); fill: var(--ink-3); }
.line-svg .grid { stroke: var(--rule); stroke-width: 1; }
.line-svg .base { stroke: var(--rule-2); stroke-width: 1; }
.line-svg .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-svg .series.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.9s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.line-svg .wash { opacity: 0.1; }
.line-svg .dot { stroke: var(--paper); stroke-width: 2; }
.line-svg .end-label { font-size: 12.5px; font-weight: 500; fill: var(--ink); }
.line-svg .cross { stroke: var(--ink-3); stroke-width: 1; visibility: hidden; }
.line-svg .hover-dot { stroke: var(--paper); stroke-width: 2; visibility: hidden; }

/* tooltip */
.tip { position: absolute; z-index: 5; min-width: 150px; padding: 8px 10px; pointer-events: none; background: #fff; border: 1px solid var(--rule-2); border-radius: 4px; box-shadow: 0 1px 3px rgba(11, 11, 11, 0.1); font-size: 13px; line-height: 1.45; }
.tip-title { margin-bottom: 4px; font-weight: 600; }
.tip-row { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 6px; color: var(--ink-2); }
.tip-row i { width: 12px; height: 2px; }
.tip-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-row span { text-align: right; }
.tip-total { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--rule); }

/* data tables */
.dtable-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable caption { caption-side: top; padding-bottom: 8px; text-align: left; font-size: 15.5px; font-weight: 600; }
.dtable th { padding: 8px 10px; border-bottom: 1px solid var(--ink); font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-align: left; white-space: nowrap; }
.dtable td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.dtable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable tbody tr:hover { background: var(--plane); }
.cover { display: grid; grid-template-columns: minmax(60px, 1fr) 56px; align-items: center; gap: 10px; }
.cover-track { height: 8px; border-radius: 8px; overflow: hidden; }
.cover-track i { display: block; height: 100%; border-radius: 8px; transform-origin: left center; animation: grow-x 0.55s var(--ease) backwards; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; white-space: nowrap; }
.status svg { width: 14px; height: 14px; flex: none; }

/* collections */
.coll { margin-top: 14px; display: grid; gap: 2px; }
.coll-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 160px; align-items: center; gap: 12px; padding: 6px 4px; border-radius: 2px; outline-offset: 0; }
.coll-row:hover, .coll-row:focus-visible { background: var(--plane); }
.coll-name { font-size: 13.5px; }
.coll-track { position: relative; height: 14px; border-radius: 0 4px 4px 0; background: var(--s1-wash); transform-origin: left center; animation: grow-x 0.55s var(--ease) backwards; }
.coll-fill { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: var(--s1); }
.coll-val { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.coll-val b { color: var(--ink); font-weight: 600; }

.ageing { display: flex; gap: 2px; height: 28px; margin-top: 14px; }
.ageing div { display: flex; align-items: center; min-width: 0; padding: 0 8px; border-radius: 4px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.ageing div.no-label { padding: 0; font-size: 0; }

/* ---------- Order to cash ---------- */
.flow-steps { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); --p: 0; }
.flow-steps::before, .flow-steps::after { content: ""; position: absolute; left: calc(100% / 12); right: calc(100% / 12); top: 18px; height: 1px; background: var(--rule-2); }
.flow-steps::after { height: 2px; top: 17.5px; background: var(--ink); transform-origin: left; transform: scaleX(var(--p)); transition: transform 0.45s var(--ease); }
.flow-steps button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 0 4px; text-align: center; }
.flow-steps i { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--rule-2); border-radius: 50%; background: var(--paper); font: 500 13px var(--f-mono); font-style: normal; color: var(--ink-2); transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease); }
.flow-steps span { font-size: 13.5px; line-height: 1.3; color: var(--ink-2); transition: color 0.2s; }
.flow-steps button:hover i { border-color: var(--ink); color: var(--ink); }
.flow-steps button.is-done i { border-color: var(--ink); color: var(--ink); }
.flow-steps button[aria-selected="true"] i { background: var(--ink); border-color: var(--ink); color: var(--paper); transform: scale(1.12); }
.flow-steps button[aria-selected="true"] span { color: var(--ink); font-weight: 600; }

.flow-panels { display: grid; margin-top: clamp(28px, 4vw, 48px); padding-top: clamp(22px, 3vw, 34px); border-top: 2px solid var(--ink); }
.flow-panel { grid-area: 1 / 1; max-width: 46em; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity 0.25s ease, transform 0.25s var(--ease), visibility 0s 0.25s; }
.flow-panel.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0.08s, 0.08s, 0s; }
.flow-panel h3 { font: 700 clamp(26px, 3vw, 40px)/1.05 var(--f-display); font-stretch: 84%; letter-spacing: -0.015em; }
.flow-panel p { margin-top: 12px; font-size: clamp(16px, 1.3vw, 18px); }
.flow-panel .flow-data { padding-top: 12px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--ink-2); }
.flow-data b { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); }

/* ---------- Calculators ---------- */
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.calc { padding: clamp(18px, 2.2vw, 28px); border: 1px solid var(--rule-2); border-radius: 4px; background: var(--paper); }
.calc h3 { font: 700 clamp(24px, 2.4vw, 32px)/1.05 var(--f-display); font-stretch: 84%; letter-spacing: -0.01em; }
.calc-intro { margin: 8px 0 18px; font-size: 15px; color: var(--ink-2); }

.calc-stage { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 10px 14px 10px 4px; border: 1px solid var(--rule); border-radius: 4px; }
.isobox { display: block; width: 100%; height: auto; }
.isobox polygon { stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.isobox .f-top { fill: #fff; }
.isobox .f-left { fill: var(--plane); }
.isobox .f-right { fill: var(--rule); }
.isobox .tape { fill: none; stroke: var(--ink); stroke-width: 1; }
.isobox text { font: 500 11px var(--f-mono); fill: var(--ink-2); text-anchor: middle; }

.readout-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.readout-row + .readout-row { margin-top: 12px; }
.readout-row b { min-width: 62px; text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.meter { height: 10px; border-radius: 0 4px 4px 0; background: var(--plane); overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; border-radius: 0 4px 4px 0; background: var(--ink-3); transform-origin: left center; transform: scaleX(0.3); transition: transform 0.3s var(--ease); }
.meter i.on { background: var(--s1); }
.formula { margin-top: 14px; font: 400 12.5px/1.5 var(--f-mono); color: var(--ink-2); }

.inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin: 18px 0; }
.slider { display: block; }
.slider > span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; font-size: 13.5px; color: var(--ink-2); }
.slider b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.cur { font-style: normal; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; --p: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--ink) var(--p), var(--rule-2) var(--p)); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--rule-2); }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -7px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); transition: transform 0.12s, background 0.12s; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
input[type="range"]:hover::-webkit-slider-thumb, input[type="range"]:active::-webkit-slider-thumb { background: var(--ink); transform: scale(1.1); }

.verdict { margin-top: 18px; padding-top: 14px; border-top: 2px solid var(--ink); }
.verdict-label { display: block; font-size: 13px; color: var(--ink-2); }
.verdict-num { display: block; margin-top: 2px; font-size: clamp(34px, 3.8vw, 48px); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.verdict p { margin-top: 6px; font-size: 15px; }
.verdict.is-bad .verdict-num { color: var(--crit); }
.verdict-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.split { display: flex; gap: 2px; height: 28px; margin-top: 18px; }
.split i { display: block; height: 100%; min-width: 0; border-radius: 4px; flex: 0 0 20%; transition: flex-basis 0.3s var(--ease); }
.split i[data-k="vat"], .split-legend i[data-k="vat"] { background: var(--s1); }
.split i[data-k="comm"], .split-legend i[data-k="comm"] { background: var(--s2); }
.split i[data-k="ship"], .split-legend i[data-k="ship"] { background: var(--s3); }
.split i[data-k="cost"], .split-legend i[data-k="cost"] { background: var(--s4); }
.split i[data-k="profit"], .split-legend i[data-k="profit"] { background: var(--s5); }
.split-legend { display: grid; grid-template-columns: repeat(5, auto); justify-content: space-between; gap: 10px 14px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.split-legend li { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; }
.split-legend i { width: 10px; height: 10px; border-radius: 2px; }
.split-legend b { grid-column: 2; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ---------- Experience ---------- */
.xp { border-top: 2px solid var(--ink); }
.xp > li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-top: 1px solid var(--rule); }
.xp > li:first-child { border-top: 0; }
.xp-when { padding-top: 3px; font: 400 13px/1.5 var(--f-mono); color: var(--ink-2); }
.xp h3 { font-size: 20px; font-weight: 600; line-height: 1.25; }
.xp-where { margin-top: 2px; font-size: 14.5px; color: var(--ink-2); }
.xp-what ul { margin-top: 12px; display: grid; gap: 7px; max-width: 46em; }
.xp-what ul li { position: relative; padding-left: 18px; font-size: 16px; line-height: 1.55; }
.xp-what ul li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 1px; background: var(--ink); }

.kit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; margin-top: clamp(40px, 5vw, 64px); padding-top: 28px; border-top: 2px solid var(--ink); }
.kit h3 { font-size: 14px; font-weight: 600; }
.kit p { margin-top: 6px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

/* ---------- Contact ---------- */
.end { background: var(--ink); color: var(--paper); padding: clamp(64px, 9vw, 128px) 0 26px; }
.end ::selection { background: var(--paper); color: var(--ink); }
.end :focus-visible { outline-color: #9ec5f4; }
.end-kicker { font: 400 13px var(--f-mono); color: var(--ink-3); }
.end-kicker span { margin: 0 0.4em; }
.end-title { margin-top: 14px; max-width: 15em; font: 800 clamp(34px, 6vw, 84px)/0.98 var(--f-display); font-stretch: 80%; letter-spacing: -0.02em; }
.mail { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: clamp(32px, 4vw, 56px); text-align: left; }
.mail-text { padding-bottom: 4px; font-size: clamp(16px, 4.6vw, 38px); font-weight: 500; letter-spacing: -0.01em; word-break: break-all; background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat; transition: color 0.15s; }
.mail:hover .mail-text { color: #9ec5f4; }
.mail-hint { padding: 4px 9px; border: 1px solid var(--ink-2); border-radius: 2px; font-size: 13px; color: var(--rule-2); transition: border-color 0.15s, color 0.15s; }
.mail:hover .mail-hint { border-color: var(--paper); color: var(--paper); }
.end-links { display: flex; flex-wrap: wrap; gap: 12px 30px; margin-top: 34px; }
.end-links a { padding-bottom: 2px; font-size: 16px; font-weight: 500; text-decoration: none; background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat; transition: background-size 0.25s var(--ease); }
.end-links a:hover { background-size: 100% 1px; }
.end-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: clamp(56px, 8vw, 112px); padding-top: 18px; border-top: 1px solid var(--ink-2); font-size: 13px; color: var(--ink-3); }
.end-foot a { color: var(--rule-2); text-decoration: none; }
.end-foot a:hover { color: var(--paper); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; padding: 10px 16px; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 500; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity 0.2s, transform 0.2s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .section { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .side { position: static; max-width: 36em; }
  .calc-grid { grid-template-columns: minmax(0, 1fr); }
  .charts { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .top-row { gap: 12px; height: 58px; }
  .top-cta { margin-left: auto; }
  .top-menu { display: inline-block; padding: 8px 12px; border: 1px solid var(--rule-2); border-radius: 2px; font-size: 14px; font-weight: 500; }
  .top-nav { position: absolute; left: 0; right: 0; top: 100%; display: none; flex-direction: column; gap: 0; margin: 0; padding: 6px var(--gutter) 14px; background: var(--paper); border-bottom: 1px solid var(--rule-2); }
  .top.is-open .top-nav { display: flex; }
  .top-nav a { padding: 12px 0; font-size: 17px; color: var(--ink); border-bottom: 1px solid var(--rule); }
  .top-nav a::after { display: none; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div { padding: 16px 12px 16px 0; border-bottom: 1px solid var(--rule); }
  .facts > div + div { padding-left: 0; border-left: 0; }
  .facts > div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--rule); }
  .case { grid-template-columns: minmax(0, 1fr); }
  .case-flip .case-fig { order: 0; }
  .more-list li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile:nth-child(odd) { border-left: 0; }
  .tile:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .xp > li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .kit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tick { margin-left: 0; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .inputs { grid-template-columns: minmax(0, 1fr); }
  .calc-stage { grid-template-columns: minmax(0, 1fr); padding: 10px 12px 14px; }
  .isobox { max-width: 260px; margin: 0 auto; }
  .split-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: start; }
  .verdict-num { font-size: clamp(26px, 8vw, 36px); }
  .flow-steps span { display: none; }
  .flow-steps button[aria-selected="true"] span { display: block; position: absolute; top: 46px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
  .flow-steps li:first-child button[aria-selected="true"] span { left: 0; transform: none; }
  .flow-steps li:last-child button[aria-selected="true"] span { left: auto; right: 0; transform: none; }
  .flow-panels { margin-top: 56px; }
  .recon { font-size: 12px; }
  .recon-head, .recon-row { grid-template-columns: 1.1fr 0.9fr 1.3fr; padding: 9px 10px; }
  .recon-head > :nth-child(2), .recon-row > :nth-child(2), .recon-head > :nth-child(3), .recon-row > :nth-child(3) { display: none; }
  .dash-top { padding: 0 14px; }
  .filters { padding: 12px 14px; }
  .dash-view { padding: 14px; }
  .sample { display: none; }
  .bar-row { grid-template-columns: 84px minmax(0, 1fr) 54px; gap: 8px; }
  .coll-row { grid-template-columns: 78px minmax(0, 1fr); }
  .coll-val { grid-column: 2; }
  .kit { grid-template-columns: minmax(0, 1fr); }
  .tile-value { font-size: 24px; }
  .tile.is-hero .tile-value { font-size: 30px; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
  .map-dots, .pipe-pk, .map-pings { display: none; }
  .recon .diff, .recon .was { display: none; }
  .recon-row::before, .career .now-ring { display: none; }
}

/* very narrow phones: keep the top bar on one line */
.top-name { white-space: nowrap; }
@media (max-width: 380px) {
  .top-cta span { display: none; }
  .top-cta { padding-inline: 0.8em; }
}

/* ==========================================================================
   Layout refinements
   ========================================================================== */

/* case study: title, then problem / build / result side by side, then the figure */
.case { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto auto auto auto 1fr; column-gap: clamp(20px, 2.6vw, 36px); row-gap: 0; }
.case-text { display: contents; }
.case-tag { grid-column: 1 / -1; grid-row: 1; justify-self: start; }
.case h3 { grid-column: 1 / 11; grid-row: 2; }
.pso { grid-column: 1 / -1; grid-row: 3; grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 3fr); gap: clamp(20px, 2.6vw, 36px); margin-top: 26px; }
.pso > div { padding-top: 12px; border-top: 1px solid var(--ink); }
.case-nums { grid-column: 1 / -1; grid-row: 4; margin-top: 30px; }
.case-fig { grid-column: 1 / 9; grid-row: 5 / span 2; order: 0; margin-top: 36px; }
.case-stack { grid-column: 9 / -1; grid-row: 5; margin: 36px 0 14px; }
.case-text > .link-arrow { grid-column: 9 / -1; grid-row: 6; justify-self: start; align-self: start; }

/* the portal's own figures, under its case study */
.case-nums dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule-2); }
.case-nums dl > div { padding: 14px 16px 0 0; }
.case-nums dl > div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.case-nums dt { font: 700 clamp(30px, 3.2vw, 44px)/1 var(--f-display); font-stretch: 82%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.case-nums dd { margin-top: 6px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.case-src { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }
.facts dt { font-variant-numeric: tabular-nums; }
@media (min-width: 861px) and (max-width: 1100px) { .facts dt { font-size: 3.9vw; } }
.case-flip .case-fig { grid-column: 5 / -1; order: 0; }
.case-flip .case-stack, .case-flip .case-text > .link-arrow { grid-column: 1 / 5; }

/* reconciliation figure: stack the alternating states in one grid cell */
.recon-head .num { font-family: var(--f-body); font-size: 12px; }
.recon .st, .recon .num.two { display: grid; }
.recon .st i, .recon .num.two b { grid-area: 1 / 1; position: static; }
.recon .num.two { justify-items: end; }

/* dashboard tiles and bars */
.tiles { grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr)); }
.tile-value { white-space: nowrap; }
.tile.is-hero .tile-value { font-size: clamp(30px, 3vw, 40px); }
.bar-row { grid-template-columns: 96px minmax(0, 1fr); }
.bar-line { display: flex; align-items: center; gap: 8px; }
.bar-track { flex: 0 0 auto; }
.bar-val { flex: none; }

/* calculators */
.calc-stage { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 6px 16px 16px; }
.isobox { max-width: 270px; margin: 0 auto; }
.isobox text { font-size: 12.5px; }
.split-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.split-legend li { white-space: nowrap; }
.verdict-two .verdict-num { font-size: clamp(26px, 2.7vw, 36px); white-space: nowrap; }

@media (max-width: 860px) {
  .case { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .case-tag, .case h3, .pso, .case-nums, .case-fig, .case-stack, .case-text > .link-arrow,
  .case-flip .case-fig, .case-flip .case-stack, .case-flip .case-text > .link-arrow { grid-column: 1 / -1; grid-row: auto; }
  .pso { grid-template-columns: minmax(0, 1fr); }
  .case-fig { margin-top: 24px; }
  .case-stack { margin-top: 20px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .bar-row { grid-template-columns: 84px minmax(0, 1fr); }
  .tile.is-hero .tile-value { font-size: 28px; }
  .case-nums dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-nums dl > div { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--rule); }
  .case-nums dl > div + div { padding-left: 0; border-left: 0; }
  .case-nums dl > div:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--rule); }
}
.isobox { max-width: 300px; }
.split-legend { display: grid; grid-template-columns: repeat(3, max-content); gap: 8px 28px; }
.clock { white-space: nowrap; }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.dtable-wrap { margin-top: 10px; }
.dtable { min-width: 460px; }
.dtable td:first-child { white-space: nowrap; }

/* collections: name and figures on one line, the bar full width beneath */
.coll { gap: 4px; }
.coll-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 7px 4px; }
.coll-row > div { grid-column: 1 / -1; grid-row: 2; }
.coll-val { grid-column: 2; grid-row: 1; }
.coll-track { height: 12px; }
@media (max-width: 600px) {
  .coll-row { grid-template-columns: minmax(0, 1fr) auto; }
  .coll-val { grid-column: 2; }
}

/* ==========================================================================
   Motion layer
   One vocabulary for the whole page: type rises out of a mask, rules are
   drawn left to right, numbers run up to their value. main.js adds `.motion`
   only when motion is allowed, so nothing is hidden if the script is missing
   or the visitor has asked for reduced motion.
   ========================================================================== */

/* reading progress: a hairline under the top bar */
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left center; }

/* the current section: one marker that slides between links */
.top-ind { position: absolute; left: 0; bottom: 0; width: 0; height: 1.5px; background: var(--ink); opacity: 0; pointer-events: none; transition: transform 0.45s var(--ease), width 0.45s var(--ease), opacity 0.2s; }
.top-ind.on { opacity: 1; }
.top-nav.has-ind a::after { display: none; }
@media (min-width: 861px) { .top-nav { position: relative; } }
@media (max-width: 860px) { .top-ind { display: none; } }

/* links and buttons */
.btn span[aria-hidden] { display: inline-block; transition: transform 0.2s var(--ease); }
.btn:hover span[aria-hidden] { transform: translateY(2px); }
.link-arrow:hover { animation: underline-wipe 0.6s var(--ease); }
@keyframes underline-wipe {
  0% { background-position: right bottom; background-size: 100% 1px; }
  45% { background-position: right bottom; background-size: 0% 1px; }
  46% { background-position: left bottom; background-size: 0% 1px; }
  100% { background-position: left bottom; background-size: 100% 1px; }
}

/* section headings: the title rises out of its own line */
.motion .side-no, .motion .side-note { opacity: 0; transform: translateY(10px); transition: opacity 0.5s ease, transform 0.6s var(--ease); }
.motion .side-note { transition-delay: 0.18s; }
.motion .side-title { overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.motion .side-title > span { display: inline-block; transform: translateY(110%); transition: transform 0.8s var(--ease) 0.06s; }
.motion .side.in .side-no, .motion .side.in .side-note { opacity: 1; transform: none; }
.motion .side.in .side-title > span { transform: none; }

/* blocks of content rise in, staggered when several arrive together */
.motion .rise { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.7s var(--ease); transition-delay: var(--delay, 0s); }
.motion .rise.in { opacity: 1; transform: none; }

/* heavy rules are drawn, left to right */
.motion .draw-rule { border-top-color: transparent; background-image: linear-gradient(var(--ink), var(--ink)); background-repeat: no-repeat; background-origin: border-box; background-position: left top; background-size: 0% var(--rw, 2px); transition: background-size 1s var(--ease); }
.motion .draw-rule.in { background-size: 100% var(--rw, 2px); }
.motion .pso > div.draw-rule { --rw: 1px; }
.motion .pso > div.draw-rule:nth-child(2) { transition-delay: 0.12s; }
.motion .pso > div.draw-rule:nth-child(3) { transition-delay: 0.24s; }

/* Fig. 2: each row is checked in turn, and the short payment is checked again once it is settled */
.recon-row { position: relative; isolation: isolate; }
.recon-row::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--plane); opacity: 0; animation: rc-scan 8s var(--ease) infinite; animation-delay: calc(var(--i, 2) * 0.5s); }
.recon-row.is-diff::before { animation-name: rc-scan-twice; }
@keyframes rc-scan { 0%, 4% { opacity: 0; } 7% { opacity: 1; } 15%, 100% { opacity: 0; } }
@keyframes rc-scan-twice { 0%, 4% { opacity: 0; } 7% { opacity: 1; } 15%, 50% { opacity: 0; } 53% { opacity: 1; } 62%, 100% { opacity: 0; } }

/* Fig. 3: the pipes are laid before anything flows through them */
.motion .pipe .pipe-lines path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.motion .pipe .pipe-pk, .motion .pipe .pipe-core { opacity: 0; }
.motion .case-fig.in .pipe-lines path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s var(--ease) 0.2s; }
.motion .case-fig.in .pipe-core { opacity: 1; transition: opacity 0.4s ease 0.85s; }
.motion .case-fig.in .pipe-lines path:nth-child(n + 5) { transition-duration: 0.6s; transition-delay: 1s; }
.motion .case-fig.in .pipe-pk { opacity: 1; transition: opacity 0.4s ease 1.4s; }

/* dashboards: figures keep their width while they count */
.tile-value { font-variant-numeric: tabular-nums; }

/* order to cash: while the stages play on their own, a ring shows the time left on the current one */
@property --t { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.flow-steps i { position: relative; }
.flow.is-auto .flow-steps button[aria-selected="true"] i::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(var(--ink) var(--t), var(--rule-2) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  animation: flow-timer 4.2s linear forwards;
}
@keyframes flow-timer { from { --t: 0%; } to { --t: 100%; } }
.flow-panel.is-on > * { animation: rise-in 0.5s var(--ease) both; }
.flow-panel.is-on > :nth-child(2) { animation-delay: 0.07s; }
.flow-panel.is-on > :nth-child(3) { animation-delay: 0.14s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }

/* Fig. 4: career as a step chart */
.career { margin-bottom: clamp(32px, 4vw, 48px); }
.career-host { min-height: 220px; }
.career svg { display: block; width: 100%; height: auto; overflow: visible; }
.career .grid { stroke: var(--rule); stroke-width: 1; }
.career .tick { font: 400 11px var(--f-mono); fill: var(--ink-3); }
.career .step { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.career .wash { fill: var(--s1); opacity: 0.08; }
.career .role { font: 500 12.5px var(--f-body); fill: var(--ink); }
.career .when { font: 400 11px var(--f-mono); fill: var(--ink-2); }
.career .now-dot { fill: var(--s1); stroke: var(--paper); stroke-width: 2; }
.career .now-ring { fill: none; stroke: var(--s1); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ping 2.6s var(--ease) infinite; }
.career .now-label { font: 500 11px var(--f-mono); fill: var(--s1-ink); }
.career .is-drawing .step { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s linear forwards; }
.career .is-drawing .wash { opacity: 0; animation: wash-in 0.7s ease 1.5s forwards; }
.career .is-drawing .lab { opacity: 0; animation: lab-in 0.45s var(--ease) forwards; animation-delay: var(--at, 0s); }
.career .is-paused, .career .is-paused * { animation-play-state: paused !important; }
@keyframes wash-in { to { opacity: 0.08; } }
@keyframes lab-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 70%, 100% { transform: scale(3.2); opacity: 0; } }

/* contact: the closing line rises word by word */
.motion .end-title .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.motion .end-title .w > span { display: inline-block; transform: translateY(110%); transition: transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 35ms); }
.motion .end-title.in .w > span { transform: none; }

/* ==========================================================================
   Channels band and tools grid
   Marketplace names are set as type (no brand logos); tool logos are open
   Simple Icons drawn as masks, so they print in ink and take their brand
   colour only on hover.
   ========================================================================== */
.channels { padding-bottom: clamp(8px, 2vw, 24px); }
.ch-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(24px, 4.5vw, 72px); align-items: baseline; padding: 18px 0; border-top: 1px solid var(--rule); }
.ch-row:last-child { border-bottom: 1px solid var(--rule); }
.ch-label { font: 500 13px var(--f-mono); color: var(--ink-3); }
/* channel logos: a slow strip running right to left, grey until pointed at.
   Two identical tracks move together, so the loop has no seam. */
.ch-row:has(.ch-marquee) { align-items: center; }
.ch-marquee { display: flex; min-width: 0; overflow: hidden; padding: 6px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.ch-track { display: flex; flex: none; align-items: center; gap: clamp(40px, 5vw, 72px); padding-right: clamp(40px, 5vw, 72px); animation: ch-scroll 36s linear infinite; }
.ch-marquee:hover .ch-track { animation-play-state: paused; }
.ch-track img { display: block; width: auto; max-width: none; filter: grayscale(1); opacity: 0.68; transition: filter 0.3s, opacity 0.3s, transform 0.3s var(--ease); }
.ch-track img.lg-pale { filter: grayscale(1) brightness(0.42); } /* light-green logo would otherwise grey out to near-invisible */
.ch-track li:hover img { filter: none; opacity: 1; transform: scale(1.06); }
@keyframes ch-scroll { to { transform: translateX(-100%); } }
@media (max-width: 600px) {
  .ch-track img { transform: scale(0.85); }
  .ch-track li:hover img { transform: scale(0.9); }
}
@media (prefers-reduced-motion: reduce) {
  .ch-marquee { -webkit-mask-image: none; mask-image: none; }
  .ch-track { flex-wrap: wrap; flex: 1 1 auto; row-gap: 20px; padding-right: 0; animation: none !important; }
  .ch-track[aria-hidden="true"] { display: none; }
}
.ch-markets { display: flex; flex-wrap: wrap; gap: 10px 30px; font-size: 15.5px; }
.ch-markets li { display: inline-flex; align-items: center; gap: 9px; }
.ch-markets img { display: block; width: 24px; height: 18px; object-fit: cover; box-shadow: 0 0 0 1px var(--rule); }
.ch-base { color: var(--ink-2); }

.tools { margin-top: clamp(40px, 5vw, 64px); }
.tools-title { font: 700 22px/1.1 var(--f-display); font-stretch: 84%; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); margin-top: 14px; border-top: 2px solid var(--ink); }
.tl { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 10px; border-bottom: 1px solid var(--rule); font-size: 15px; font-weight: 500; line-height: 1.25; transition: background-color 0.2s; }
.tl:hover { background: var(--plane); }
.tl-ic { flex: none; width: 20px; height: 20px; background-color: var(--ink); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; transition: background-color 0.25s var(--ease), transform 0.25s var(--ease); }
.tl:hover .tl-ic { background-color: var(--brand, var(--ink)); transform: scale(1.12); }
.ic-googlebigquery { -webkit-mask-image: url(../logos/googlebigquery.svg); mask-image: url(../logos/googlebigquery.svg); --brand: #669df6; }
.ic-python { -webkit-mask-image: url(../logos/python.svg); mask-image: url(../logos/python.svg); --brand: #3776ab; }
.ic-pandas { -webkit-mask-image: url(../logos/pandas.svg); mask-image: url(../logos/pandas.svg); --brand: #150458; }
.ic-numpy { -webkit-mask-image: url(../logos/numpy.svg); mask-image: url(../logos/numpy.svg); --brand: #013243; }
.ic-googlesheets { -webkit-mask-image: url(../logos/googlesheets.svg); mask-image: url(../logos/googlesheets.svg); --brand: #34a853; }
.ic-googleappsscript { -webkit-mask-image: url(../logos/googleappsscript.svg); mask-image: url(../logos/googleappsscript.svg); --brand: #4285f4; }
.ic-git { -webkit-mask-image: url(../logos/git.svg); mask-image: url(../logos/git.svg); --brand: #f03c2e; }
.ic-github { -webkit-mask-image: url(../logos/github.svg); mask-image: url(../logos/github.svg); --brand: #181717; }
.ic-flask { -webkit-mask-image: url(../logos/flask.svg); mask-image: url(../logos/flask.svg); --brand: #3babc3; }
.ic-nextdotjs { -webkit-mask-image: url(../logos/nextdotjs.svg); mask-image: url(../logos/nextdotjs.svg); --brand: #000000; }
.ic-linux { -webkit-mask-image: url(../logos/linux.svg); mask-image: url(../logos/linux.svg); --brand: #c99a00; }
.ic-apache { -webkit-mask-image: url(../logos/apache.svg); mask-image: url(../logos/apache.svg); --brand: #d22128; }
.ic-jira { -webkit-mask-image: url(../logos/jira.svg); mask-image: url(../logos/jira.svg); --brand: #0052cc; }
.ic-zendesk { -webkit-mask-image: url(../logos/zendesk.svg); mask-image: url(../logos/zendesk.svg); --brand: #03363d; }

@media (max-width: 1080px) {
  .ch-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@media (max-width: 600px) {
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl { min-height: 48px; gap: 8px; padding: 10px 6px; font-size: 14px; }
  .tl-ic { width: 18px; height: 18px; }
}

/* ==========================================================================
   Calculator pages (/volumetric-weight-calculator/, /marketplace-profit-calculator/)
   ========================================================================== */
.tool-hero { padding-top: clamp(32px, 5vw, 64px); padding-bottom: clamp(24px, 3vw, 36px); }
.tool-crumbs { font-size: 14.5px; color: var(--ink-2); }
.tool-crumbs a { color: inherit; text-decoration: none; }
.tool-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.tool-crumbs span { margin: 0 0.5em; color: var(--rule-2); }
.tool-title { margin-top: 12px; font: 800 clamp(40px, 7.4vw, 92px)/0.95 var(--f-display); font-stretch: 78%; letter-spacing: -0.02em; }
.tool-lede { margin-top: 18px; max-width: 40em; font-size: clamp(17px, 1.45vw, 20px); line-height: 1.5; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px); align-items: start; padding-bottom: clamp(48px, 6vw, 88px); }
.tool-notes h2, .tool-h2 { font: 700 clamp(24px, 2.4vw, 32px)/1.1 var(--f-display); font-stretch: 84%; letter-spacing: -0.01em; }
.tool-notes h3 { margin-top: 28px; font-size: 16px; font-weight: 600; }
.tool-notes p { margin-top: 10px; font-size: 16px; line-height: 1.6; }
.formula-big { margin-top: 14px !important; padding: 14px 16px; border: 1px solid var(--rule-2); border-radius: 4px; background: var(--paper); font: 500 14.5px/1.5 var(--f-mono) !important; }
.tool-steps { margin-top: 14px; display: grid; gap: 8px; }
.tool-steps li { position: relative; padding-left: 18px; font-size: 16px; line-height: 1.55; }
.tool-steps li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 1px; background: var(--ink); }
.tool-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 15px; }
.tool-table th, .tool-table td { padding: 8px 12px 8px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.tool-table th { font-size: 13px; font-weight: 600; color: var(--ink-2); border-bottom-color: var(--ink); }
.tool-table td:first-child { font-family: var(--f-mono); white-space: nowrap; }
.num { width: 78px; padding: 3px 6px; border: 1px solid var(--rule-2); border-radius: 2px; background: #fff; color: var(--ink); font: 600 14px var(--f-body); font-variant-numeric: tabular-nums; text-align: right; }
.num:hover { border-color: var(--ink-3); }
.num:focus { outline: 2px solid var(--s1-ink); outline-offset: 1px; border-color: var(--ink); }
.tool-faq { padding-bottom: clamp(48px, 6vw, 88px); }
.faq { margin-top: 14px; border-top: 2px solid var(--ink); }
.faq > div { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 6px 32px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.faq dt { font-size: 17px; font-weight: 600; line-height: 1.35; }
.faq dd { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.tool-author { padding-bottom: clamp(48px, 6vw, 80px); }
.tool-author-in { padding-top: 22px; border-top: 2px solid var(--ink); max-width: 52em; }
.tool-author-k { font: 500 13px var(--f-mono); color: var(--ink-3); }
.tool-author-t { margin-top: 8px; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; }
.tool-author-t a { font-weight: 600; }
.tool-author-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 18px; }
.tool-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-top: 18px; padding-bottom: 26px; background: linear-gradient(var(--rule), var(--rule)) var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat; font-size: 13px; color: var(--ink-3); }
.tool-foot a { color: var(--ink-2); text-decoration: none; }
.tool-foot a:hover { color: var(--ink); }
.calc-open { margin-top: 16px; }
@media (max-width: 860px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .faq > div { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .progress { display: none; }
  .motion .rise, .motion .side-no, .motion .side-note { opacity: 1 !important; transform: none !important; }
  .motion .side-title > span, .motion .end-title .w > span { transform: none !important; }
  .motion .draw-rule { background-size: 100% var(--rw, 2px) !important; }
}
