/* Ayush Jha: page CSS on top of the taste kit. Brand kit "Lab paper and ember".
   The light :root block is start.mjs brand output, kept as printed; the dark theme re-tunes the same tokens. */
:root {
  --p-bg: #f1ece2; --p-surface: #e7e0d3; --p-ink: #1c1a17; --p-muted: #64615c;
  --p-accent: #c4471b; --p-accent-ink: #ffffff; --p-action: #c4471b; --p-action-ink: #ffffff;
  --p-inv-bg: #1c1a17; --p-inv-surface: #282623; --p-inv-ink: #f1ece2; --p-inv-muted: #98948d;
  --p-inv-accent: #c4471b; --p-inv-accent-ink: #ffffff; --p-inv-action: #c4471b; --p-inv-action-ink: #ffffff;
  --font-display: "Newsreader", Georgia, serif;
  --font-text: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --display-weight: 400;
  --display-tracking: -0.018em;
  --display-tracking-xl: -0.025em;
  --ly-scale: 1.06;

  /* data colours: teal marks data that passed, the heatmap ramp runs paper -> amber -> ember -> rust */
  --data: #2f6f6a;
  --hm-0: #e9e2d4; --hm-1: #f0c27a; --hm-2: #e58a3e; --hm-3: #c4471b; --hm-4: #7e2a10;
  --hm-line: rgb(28 26 23 / .07);

  /* modern-web-guidance dark-mode: the base stays "light dark"; the meta override maps back onto it */
  color-scheme: light dark;
  &:has(> head > meta[name="color-scheme"][content="dark"]) { color-scheme: dark; }
  &:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; }
}

/* the dark theme: warm ink, not black; the accent lifted so it holds 4.5:1 as a label ground */
@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) {
    --p-bg: #15130f; --p-surface: #211e19; --p-ink: #ece5d8; --p-muted: #a39d92;
    --p-accent: #ee7a45; --p-accent-ink: #15130f; --p-action: #ee7a45; --p-action-ink: #15130f;
    --p-inv-bg: #0c0b09; --p-inv-surface: #1a1814; --p-inv-ink: #ece5d8; --p-inv-muted: #a39d92;
    --p-inv-accent: #ee7a45; --p-inv-accent-ink: #15130f; --p-inv-action: #ee7a45; --p-inv-action-ink: #15130f;
    --data: #5fb3a8;
    --hm-0: #1f1c17; --hm-1: #5a3a1a; --hm-2: #9a4a1c; --hm-3: #d9612b; --hm-4: #f4a46e;
    --hm-line: rgb(236 229 216 / .06);
  }
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  --p-bg: #15130f; --p-surface: #211e19; --p-ink: #ece5d8; --p-muted: #a39d92;
  --p-accent: #ee7a45; --p-accent-ink: #15130f; --p-action: #ee7a45; --p-action-ink: #15130f;
  --p-inv-bg: #0c0b09; --p-inv-surface: #1a1814; --p-inv-ink: #ece5d8; --p-inv-muted: #a39d92;
  --p-inv-accent: #ee7a45; --p-inv-accent-ink: #15130f; --p-inv-action: #ee7a45; --p-inv-action-ink: #15130f;
  --data: #5fb3a8;
  --hm-0: #1f1c17; --hm-1: #5a3a1a; --hm-2: #9a4a1c; --hm-3: #d9612b; --hm-4: #f4a46e;
  --hm-line: rgb(236 229 216 / .06);
}
/* the inverse band keeps the light accent readable on its dark ground */
.ground-inverse { --data: #5fb3a8; }

/* browser surfaces carry the palette too */
::selection { background: color-mix(in oklab, var(--p-accent) 28%, transparent); }
:root { caret-color: var(--p-accent); accent-color: var(--p-accent); scrollbar-color: color-mix(in oklab, var(--p-ink) 32%, transparent) var(--p-bg); }
a { text-underline-offset: .18em; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Lenis (its own stylesheet, inlined) */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---------------------------------------------------------------- fluid sizing on every screen
   The kit sets each section to exactly one or two screens. On shorter laptops (1366x650, 1536x730) and tall
   phones the content can be taller than that, and a fixed height lets it run into the next section.
   So every section is at least its screens tall and grows with what it holds: nothing ever overlaps. */
main > section.section:not(.is-live), footer.closing { height: auto !important; min-height: calc(var(--h, 1) * 100svh); display: grid; align-content: center; }
/* section padding breathes with the screen height: 120/72 at 900 tall, tighter on short laptops */
@media (min-width: 640px) { :root { --padt: clamp(88px, 13.3svh, 120px); --padb: clamp(48px, 8svh, 72px); } }
/* phones: sections are as tall as what they hold, plus their padding: no dead screens */
@media (max-width: 639px) { main > section.section:not(.is-live), footer.closing { min-height: 100svh; } main #work .panel, main #next .panel { --p-h: 128px; } }
/* the hero keeps its one-screen frame where it fits, and grows on short or narrow screens */
@media (max-height: 760px), (max-width: 1023px) {
  .hero { height: auto !important; min-height: 100svh !important; }
  .hero--split .hero__media { min-height: max(420px, 62svh); }
}
@media (max-width: 1023px) { .hero--split .hero__media { min-height: 380px; } }
@media (max-width: 639px) { .hero--split .hero__media { min-height: 300px; } }
/* the headline scales with the smaller of width and height, so it never crowds a short screen */
.hero h1[data-kinetic-hero] { font-size: clamp(38px, min(5.3vw, 10.4svh), 84px); }
/* section headings and the statement follow the same rule */
#approach .mo-wh__text { font-size: clamp(28px, min(3.4vw + 12px, 6.6svh), 60px) !important; }
/* long words and addresses wrap instead of pushing the page sideways */
h1, h2, h3, p, li, dd { overflow-wrap: break-word; }
html, body { overflow-x: clip; }

/* ---------------------------------------------------------------- nav: the theme toggle takes the secondary look */
.theme-toggle { inline-size: var(--btn-h, 48px); block-size: var(--btn-h, 48px); display: inline-grid; place-items: center; border-radius: var(--r-btn);
  border: 1px solid var(--line-strong, color-mix(in oklab, var(--ink) 26%, transparent)); background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease); }
.theme-toggle:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.theme-toggle .tt--to-dark svg path { fill: currentColor; stroke: none; }
.tt { display: inline-grid; place-items: center; }
.tt--to-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .tt--to-light { display: inline-grid; }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .tt--to-dark { display: none; }
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .tt--to-light { display: inline-grid; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .tt--to-dark { display: none; }
.nav__actions { display: flex; align-items: center; gap: var(--s-3); }
/* the logo mark: ink follows the text, the output point is the accent */
.logo-mark { inline-size: 30px; block-size: 30px; flex: none; color: var(--ink); overflow: visible; }
.logo-mark__out { fill: var(--accent); transition: transform 320ms cubic-bezier(.22,1,.36,1); transform-box: fill-box; transform-origin: center; }
.nav__logo { display: inline-flex; align-items: center; gap: var(--s-2); }
@media (hover: hover) and (pointer: fine) { .nav__logo:hover .logo-mark__out { transform: scale(1.18); } }
@media (max-width: 639px) { .nav .logo-mark { inline-size: 26px; block-size: 26px; } }

/* ---------------------------------------------------------------- hero */
.hero h1 em { font-style: italic; color: var(--accent); position: relative; white-space: nowrap; }
/* kinetic hero (site.js heroType): letters arrive messy, a scan line cleans them, the second line rises behind it */
.hero h1[data-kinetic-hero] { position: relative; }
html.kt-wait .hero h1[data-kinetic-hero] { visibility: hidden; }
.kt-w { display: inline-block; white-space: nowrap; }
.kt-c { display: inline-block; transform-origin: 50% 70%; }
.kt-scan { position: absolute; top: -.08em; bottom: -.12em; left: 0; inline-size: 2px; background: var(--accent); pointer-events: none; }
.kt-scan::before { content: ""; position: absolute; right: 2px; top: 0; bottom: 0; inline-size: 9rem; background: linear-gradient(to right, transparent, color-mix(in oklab, var(--accent) 14%, transparent)); }
.kt-scan::after { content: ""; position: absolute; left: -3px; top: -4px; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--accent); }
/* kinetic type: an ink stroke draws under the word once the line is clean */
.hero h1 em::after { content: ""; position: absolute; left: -0.02em; right: 0.04em; bottom: -0.02em; height: 0.16em; background: currentColor; opacity: .85;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 16' preserveAspectRatio='none'%3E%3Cpath d='M3 11C60 5 140 3 297 6' fill='none' stroke='black' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 16' preserveAspectRatio='none'%3E%3Cpath d='M3 11C60 5 140 3 297 6' fill='none' stroke='black' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
  clip-path: inset(0 0 0 0); }
.hero h1.kt-on em::after { clip-path: inset(0 100% 0 0); }
.hero h1.kt-done em::after { animation: ink-draw 800ms cubic-bezier(.65,0,.35,1) both; }
@keyframes ink-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.nb-frame { background: var(--surface); border: 1px solid var(--line); }
.nb { position: absolute; inset: 0; display: flex; flex-direction: column; font-family: var(--font-mono); }
.nb__bar { display: flex; align-items: center; gap: var(--s-3); block-size: 48px; padding-inline: var(--s-5); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); flex: none; }
.nb__dots { display: flex; gap: 6px; } .nb__dots i { inline-size: 10px; block-size: 10px; border-radius: 50%; background: color-mix(in oklab, var(--ink) 18%, transparent); }
.nb__title { color: var(--ink); }
.nb__state { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s-2); }
.nb__live { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--data); position: relative; }
.nb__live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--data); opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .nb__live::after { animation: live-ring 2.4s linear infinite; } [data-hm-paused] .nb__live::after { animation-play-state: paused; } }
@keyframes live-ring { 0% { transform: scale(.6); opacity: .8; } 70%, 100% { transform: scale(1.6); opacity: 0; } }
.nb__sql { margin: 0; padding: var(--s-4) var(--s-5); font: 13px/1.7 var(--font-mono); color: var(--muted); border-bottom: 1px solid var(--line); white-space: pre; flex: none; overflow: hidden; }
.nb__sql .kw { color: var(--accent); }
.nb__chart { flex: 1; min-block-size: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: var(--s-2) var(--s-3); padding: var(--s-5) var(--s-5) var(--s-4) var(--s-4); }
.nb__y { display: grid; grid-template-rows: repeat(7, 1fr); align-items: center; font-size: 13px; color: var(--muted); }
.nb__plot { position: relative; border-radius: var(--r-sm); overflow: hidden; background: var(--hm-0); }
.nb__plot canvas { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; }
.nb__x { grid-column: 2; display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.nb__log { display: flex; gap: var(--s-6); padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.nb__peak { margin-left: auto; color: var(--ink); }
.nb__log { padding-right: 60px; } /* room for the pause disc at the frame's corner */
.nb-float [data-hm-peak] { font-variant-numeric: tabular-nums; }
.nb__pause { position: absolute; right: 12px; bottom: 12px; inline-size: 32px; block-size: 32px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); cursor: pointer; z-index: 2; }
.nb__pause svg { inline-size: 14px; block-size: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nb__pause .nb__i-play { fill: currentColor; stroke: none; display: none; }
[data-hm-paused] .nb__i-pause { display: none; } [data-hm-paused] .nb__i-play { display: block; }
[data-hm-still] .nb__pause { display: none; }
@media (max-width: 1023px) { .nb__sql { display: none; } }
@media (max-width: 639px) { .nb__log, .hero .ly-float.nb-float { display: none; } .nb__chart { padding: var(--s-3); } }

/* ---------------------------------------------------------------- services */
/* graph paper: the lab-notebook ground the diagram is drawn on */
.svc__visual { align-self: stretch; display: grid; place-items: center; border-radius: var(--r-lg); min-block-size: 480px; padding: var(--s-6);
  background: linear-gradient(var(--hm-line) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, var(--hm-line) 1px, transparent 1px) 0 0 / 32px 32px, var(--surface); }
.svc__visual .dg { zoom: 1.12; }
@media (max-width: 1023px) { .svc__visual .dg, .case-visual .dg { zoom: 1; } }
@media (max-width: 639px) {
  .svc .rows > li { grid-template-columns: minmax(0, 1fr); }
  .svc .rows__value { grid-column: 1; grid-row: 2; text-align: left; max-width: none; white-space: normal; color: var(--muted); font-size: var(--t-small); }
  /* the pipeline figures keep readable text on a phone and scroll sideways inside their frame */
  .mo-pc__visual { overflow-x: auto; overscroll-behavior-x: contain; }
  .mo-pc__visual > .pv { min-inline-size: 560px; }
}
.svc__visual .dg { inline-size: 100%; }
.svc .rows > li > p { color: var(--ink); }
/* each service row answers the pointer: a soft tint fills the whole row, the name eases right, the tools turn ember */
.svc .rows > li { position: relative; isolation: isolate; }
.svc .rows > li::before { content: ""; position: absolute; inset: calc(var(--s-2) * -1) calc(var(--s-4) * -1) var(--s-2); z-index: -1; border-radius: var(--r-md);
  background: color-mix(in oklab, var(--accent) 7%, transparent); opacity: 0; transform: scale(.98); transition: opacity 260ms cubic-bezier(.22,1,.36,1), transform 360ms cubic-bezier(.22,1,.36,1); }
.svc .rows > li:first-child::before { top: calc(var(--s-4) * -1); }
.svc .rows__name, .svc .rows > li > p { transition: transform 320ms cubic-bezier(.22,1,.36,1); }
.svc .rows__value { transition: color 200ms; }
@media (hover: hover) and (pointer: fine) {
  .svc .rows > li:hover::before { opacity: 1; transform: none; }
  .svc .rows > li:hover .rows__name, .svc .rows > li:hover > p { transform: translateX(6px); }
  .svc .rows > li:hover .rows__value { color: var(--accent); }
}
@media (max-width: 1023px) { .svc__visual { min-block-size: 360px; margin-top: var(--s-7); } }

/* ---------------------------------------------------------------- the pinned pipeline figures */
.pv { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 4 / 3; background: var(--surface); font-family: var(--font-mono); }
[data-moment="pinned-chapters"].is-live .mo-pc__visual > .pv { block-size: 100%; }
@media (min-width: 640px) { [data-moment="pinned-chapters"]:not(.is-live) .mo-pc__visual > .pv { max-block-size: 30svh; } }
[data-moment="pinned-chapters"] .mo-pc__visuals { border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.pv text { font-family: var(--font-mono); fill: var(--ink); font-size: 19px; }
.pv__card { fill: var(--bg); stroke: var(--line); }
.pv__head { fill: var(--muted) !important; font-size: 17px !important; }
.pv__rule { stroke: var(--line); stroke-width: 1.5; }
.pv__mark { fill: color-mix(in oklab, var(--accent) 12%, transparent); }
.pv__cell--bad { fill: var(--accent) !important; font-weight: 500; }
.pv__cell--fixed { fill: var(--data) !important; }
.pv__row--gone text { opacity: .4; }
.pv__strike { stroke: var(--accent); stroke-width: 2; }
.pv__chip { fill: var(--bg); stroke: var(--line); }
.pv__chiptext { font-size: 17px !important; }
.pv__note, .pv__legend, .pv__axis { fill: var(--muted) !important; font-size: 17px !important; }
.pv__title { font-size: 20px !important; }
.pv__test { fill: color-mix(in oklab, var(--data) 12%, var(--bg)); }
.pv__tick { fill: none; stroke: var(--data); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pv__testtext { font-size: 17px !important; }
.pv__node rect { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.pv__node text { font-size: 16px !important; }
.pv__node--end rect { fill: var(--accent); stroke: none; }
.pv__node--end text { fill: var(--accent-ink) !important; }
.pv__edge { fill: none; stroke: color-mix(in oklab, var(--ink) 30%, transparent); stroke-width: 1.6; }
.pv__edge--end { stroke: var(--accent); stroke-width: 2; }
.pv__line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.pv__fline { fill: none; stroke: var(--accent); stroke-width: 3; stroke-dasharray: 8 7; }
.pv__band { fill: color-mix(in oklab, var(--accent) 16%, transparent); }
.pv__dot { fill: var(--accent); }

/* ---------------------------------------------------------------- work (the dark band) */
#work .panel, #next .panel { --p-h: 236px; block-size: var(--p-h); flex: none; padding: 0; overflow: hidden; background: color-mix(in oklab, var(--ink) 5%, var(--bg)); }
.work-card { display: flex; flex-direction: column; gap: var(--s-3); }
.work-card > h3 { margin-top: var(--s-3); }
.work-card { color: var(--ink); text-decoration: none; }
.work-card > p { color: var(--ink); }
.work-card__stack { font-size: var(--t-small); color: var(--muted); margin-top: auto; }
.thumb { display: block; inline-size: 100%; block-size: 100%; }
.thumb__grid { stroke: var(--line); stroke-width: 1; }
.thumb__thr { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 5; }
.thumb__dot { fill: color-mix(in oklab, var(--ink) 45%, transparent); }
.thumb__hot, .thumb__hotbar { fill: var(--accent); }
.thumb__bar { fill: color-mix(in oklab, var(--ink) 28%, transparent); }
.thumb__bubble { fill: color-mix(in oklab, var(--ink) 9%, transparent); }
.thumb__code { fill: color-mix(in oklab, var(--ink) 5%, transparent); stroke: var(--line); }
.thumb__q { font: 15px var(--font-text); fill: var(--ink); }
.thumb__sql { font: 15px var(--font-mono); fill: var(--ink); }
.thumb__kw { fill: var(--accent); }
.nav__menu .panel { overflow: hidden; padding: 0; background: var(--surface) !important; }

/* ---------------------------------------------------------------- project graphs: each acts out its project.
   The resting styles are the finished frame (reduced motion, print, paused); motion only adds to it. */
.thumb__scan { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 5; opacity: .5; }
.thumb--fraud .fr-dot { transform: translateX(var(--x0)); }
.thumb--fraud .fr-dot--hot { transform: translate(var(--x0), calc(var(--lift) * -1)); }
.thumb--retail .rt-ghost { fill: color-mix(in oklab, var(--ink) 55%, transparent); opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
.thumb--ask .ask-bar { transform-box: fill-box; transform-origin: 50% 100%; }
@media (prefers-reduced-motion: no-preference) {
  /* fraud: payments stream right to left; risky ones turn ember and lift over the threshold at the scoring line */
  .thumb--live.thumb--fraud .fr-dot { animation: fr-move 4.2s linear var(--d) infinite; }
  .thumb--live.thumb--fraud .fr-dot--hot { animation: fr-hot 4.2s linear var(--d) infinite; }
  /* retail: three disagreeing source bars converge into one bar per week, in a wave */
  .thumb--live.thumb--retail .rt-ghost { animation: rt-ghost 3.8s cubic-bezier(.22,1,.36,1) calc(var(--i) * 70ms) infinite; }
  .thumb--live.thumb--retail .rt-bar { animation: rt-bar 3.8s cubic-bezier(.22,1,.36,1) calc(var(--i) * 70ms) infinite; transform-box: fill-box; transform-origin: 50% 100%; }
  /* ask: the question types, the SQL writes line by line, the answer chart grows */
  .thumb--live.thumb--ask .ask-type { animation: ask-type 4s steps(28, end) infinite; }
  .thumb--live.thumb--ask .ask-line { animation-duration: 4s; animation-timing-function: cubic-bezier(.22,1,.36,1); animation-iteration-count: infinite; }
  .thumb--live.thumb--ask .ask-line:nth-of-type(2) { animation-name: ask-line-1; } .thumb--live.thumb--ask .ask-line:nth-of-type(3) { animation-name: ask-line-2; } .thumb--live.thumb--ask .ask-line:nth-of-type(4) { animation-name: ask-line-3; }
  .thumb--live.thumb--ask .ask-bar { animation: ask-bar 4s cubic-bezier(.22,1,.36,1) calc(var(--n) * 90ms) infinite; }
}
@keyframes fr-move { from { transform: translateX(0); } to { transform: translateX(-380px); } }
@keyframes fr-hot {
  0% { transform: translateX(0); fill: color-mix(in oklab, var(--ink) 45%, transparent); }
  44% { transform: translateX(-167px); fill: color-mix(in oklab, var(--ink) 45%, transparent); }
  54% { transform: translate(-205px, calc(var(--lift) * -1)); fill: var(--accent); }
  100% { transform: translate(-380px, calc(var(--lift) * -1)); fill: var(--accent); }
}
@keyframes rt-ghost {
  0%, 8% { opacity: .55; transform: none; }
  42% { opacity: .55; transform: translateX(var(--dx)) scaleY(var(--s)); }
  52%, 100% { opacity: 0; transform: translateX(var(--dx)) scaleY(var(--s)); }
}
@keyframes rt-bar { 0%, 40% { opacity: 0; transform: scaleY(.92); } 54%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes ask-type { 0% { clip-path: inset(0 100% 0 0); } 24%, 92% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 0); opacity: 0; } }
@keyframes ask-line-1 { 0%, 28% { opacity: 0; transform: translateY(6px); } 36%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes ask-line-2 { 0%, 37% { opacity: 0; transform: translateY(6px); } 45%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes ask-line-3 { 0%, 46% { opacity: 0; transform: translateY(6px); } 54%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes ask-bar { 0%, 58% { transform: scaleY(0); } 72%, 92% { transform: none; } 100% { transform: none; opacity: 0; } }
[data-motion-paused] .thumb--live * { animation-play-state: paused !important; }

/* the one pause control for the project graphs (motion over 5 s needs a way to stop it) */
.work-head { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: var(--s-5); flex-wrap: wrap; }
.motion-toggle { display: inline-flex; align-items: center; gap: var(--s-2); min-block-size: 44px; padding: 0 var(--s-4); border-radius: var(--r-btn);
  border: 1px solid var(--line-strong, var(--line)); background: transparent; color: var(--ink); font: 500 var(--t-small)/1 var(--font-text); cursor: pointer; transition: background-color 150ms var(--ease); }
.motion-toggle:hover { background: color-mix(in oklab, var(--ink) 8%, transparent); }
.motion-toggle svg { inline-size: 14px; block-size: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.motion-toggle .mt-play { display: none; fill: currentColor; stroke: none; }
.motion-toggle[aria-pressed="true"] .mt-pause { display: none; } .motion-toggle[aria-pressed="true"] .mt-play { display: block; }
@media (prefers-reduced-motion: reduce) { .motion-toggle { display: none; } }

/* ---------------------------------------------------------------- the statement */
#approach h2 { margin-bottom: var(--s-7); }
#approach .mo-wh__text { font-family: var(--font-display); line-height: 1.12; letter-spacing: var(--display-tracking-xl); max-width: 22ch; text-wrap: pretty; }

/* ---------------------------------------------------------------- about */
.about__text > * + * { margin-top: var(--s-5); }
.about__text > p { font-size: var(--t-lead); line-height: 1.6; max-width: 46ch; }
.about__facts { display: grid; gap: 0; margin-top: var(--s-7) !important; }
.about__facts > div { display: grid; grid-template-columns: 9rem 1fr; gap: var(--s-5); padding-block: var(--s-3); border-bottom: 1px solid var(--line); }
.about__facts dt { color: var(--muted); font-size: var(--t-small); }
.about__facts dd { margin: 0; }
.about__tools { display: grid; gap: var(--s-5); padding: var(--s-6); border-radius: var(--r-lg); align-self: start; color: var(--ink);
  background: linear-gradient(var(--hm-line) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, var(--hm-line) 1px, transparent 1px) 0 0 / 32px 32px, var(--surface); border: 1px solid var(--line); }
.about__tools .tools li { background: var(--bg); color: var(--ink); border: 1px solid var(--line); flex-direction: column; justify-content: center; text-align: center; gap: var(--s-2); padding: var(--s-3) var(--s-2); min-block-size: 92px; }
.about__tools .tools img { inline-size: 32px; block-size: 32px; }
.about__tools .tools img.ic-wide { inline-size: 48px; }
.about__tools h3 { color: var(--ink) !important; }
/* dark theme: real logos keep their own colours on a small paper chip, so dark marks (pandas, Kafka, AWS) stay visible */
@media (prefers-color-scheme: dark) { :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .tools img { background: #f1ece2; border-radius: 8px; padding: 5px; box-sizing: content-box; } }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .tools img { background: #f1ece2; border-radius: 8px; padding: 5px; box-sizing: content-box; }
.about__tools h3 { font: 500 var(--t-small)/1.4 var(--font-text); color: var(--muted); margin-bottom: var(--s-3); }
.tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.tools li { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface); min-block-size: 60px; font-size: var(--t-small); }
.tools img { inline-size: 40px; block-size: 40px; object-fit: contain; flex: none; }
.tools img.ic-wide { inline-size: 56px; }
@media (max-width: 639px) { .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tools li { padding: var(--s-3); gap: var(--s-3); } }

/* ---------------------------------------------------------------- the close: the email address is the call to action */
.close--mail { display: grid; gap: var(--s-7); }
.close__head { display: flex; justify-content: space-between; align-items: end; gap: var(--s-5) var(--s-7); flex-wrap: wrap; }
.close__head h2 { margin: 0; }
.close__head p { color: var(--muted); max-width: 34ch; font-size: var(--t-lead); line-height: 1.5; }
/* the address runs the full row; the copy button sits at its right end */
.close__mail { position: relative; }
.close__mail-link { inline-size: 100%; padding-right: 120px; box-sizing: border-box; }
.close__mail .copy-button { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.close__mail-link { display: inline-flex; align-items: center; gap: .3em; color: var(--ink); text-decoration: none; min-inline-size: 0;
  font: var(--display-weight) clamp(26px, 4.4vw, 68px)/1.08 var(--font-display); letter-spacing: var(--display-tracking-xl); overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 420ms cubic-bezier(.22,1,.36,1), color 150ms; }
.close__mail-link .m-arrow { inline-size: .42em; block-size: .42em; color: var(--accent); flex: none; stroke-width: 1.4; }
@media (hover: hover) and (pointer: fine) { .close__mail-link:hover { background-size: 100% 1px; } }
.close__mail .copy-button { margin-left: auto; }
.copy-button { min-block-size: 44px; display: inline-flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-4); border-radius: var(--r-btn); border: 1px solid var(--line-strong, var(--line)); background: transparent; color: var(--ink); cursor: pointer; font: 500 var(--t-small)/1 var(--font-text); transition: background-color 150ms var(--ease); }
.copy-button:hover { background: color-mix(in oklab, var(--ink) 8%, transparent); }
.copy-button svg { inline-size: 16px; block-size: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.copy-button__done { display: none; }
.copy-button[data-copied] .copy-button__copy { display: none; }
.copy-button[data-copied] .copy-button__done { display: block; stroke: var(--data); }
.copy-button[data-copied] .copy-button__label { color: var(--data); }
.tip { position: absolute; right: 0; top: calc(100% + 6px); font-size: var(--t-small); color: var(--muted); opacity: 0; transition: opacity 150ms; }
.copy-button[data-copied] + .tip, .copy-button[data-failed] + .tip { opacity: 1; }
.visit { display: grid; gap: var(--s-3); }
.visit__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); }
.visit__head { font: 500 var(--t-body)/1.4 var(--font-text); margin: 0; }
.visit__sum { font: 13px/1.4 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.visit__cells { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.visit__cells li { display: grid; gap: 6px; font: 13px/1.2 var(--font-mono); color: var(--muted); min-inline-size: 0; }
.visit__cells i { display: block; block-size: 10px; border-radius: 3px; background: color-mix(in oklab, var(--accent) calc(var(--v, 0) * 100%), var(--surface)); }
.visit__cells span { overflow: hidden; white-space: nowrap; }
.visit__cells span[data-s] { color: var(--ink); }
.footer__name { font: var(--display-weight) 48px/1 var(--font-display) !important; letter-spacing: var(--display-tracking-xl); gap: var(--s-3); }
.footer__name .logo-mark { inline-size: .9em; block-size: .9em; }
@media (max-width: 639px) {
  .footer__name { font-size: 30px !important; }
  /* phone: the address and an icon-only copy button share one line */
  .close__mail { display: flex; align-items: center; flex-wrap: nowrap; gap: var(--s-3); }
  .close__mail-link { inline-size: auto; padding-right: 0; }
  .close__mail .copy-button { position: static; transform: none; }
  .visit__top { display: grid; gap: var(--s-1); }
  .close__mail-link { font-size: clamp(20px, 6.2vw, 26px); }
  .close__mail .copy-button { margin-left: auto; padding: 0; inline-size: 44px; justify-content: center; flex: none; }
  .close__mail .copy-button__label { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .footer__col li + li { margin-top: var(--s-3); }
  .visit { grid-template-columns: 1fr; }
  .visit__cells { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: var(--s-3); }
}

/* kinetic type: the name in the footer assembles letter by letter, once, when it comes into view */
[data-kinetic] { display: inline-flex; overflow: clip; padding-bottom: .08em; }
[data-kinetic] .k { display: inline-block; white-space: pre; }
@media (prefers-reduced-motion: no-preference) {
  [data-kinetic].k-ready .k { transform: translateY(105%); opacity: 0; }
  [data-kinetic].k-in .k { transform: none; opacity: 1; transition: transform 800ms cubic-bezier(.22,1,.36,1) calc(var(--i) * 45ms), opacity 400ms ease calc(var(--i) * 45ms); }
}

/* ---------------------------------------------------------------- case-study pages */
.case-facts { display: grid; gap: 0; margin-top: var(--s-7); }
.case-facts > div { display: grid; grid-template-columns: 5rem 1fr; gap: var(--s-4); padding-block: var(--s-3); border-bottom: 1px solid var(--line); font-size: var(--t-small); }
.case-facts dt { color: var(--muted); } .case-facts dd { margin: 0; }
.case-visual { display: grid; place-items: center; padding: var(--s-6);
  background: linear-gradient(var(--hm-line) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, var(--hm-line) 1px, transparent 1px) 0 0 / 32px 32px, var(--surface); }
.case-visual .dg { inline-size: 100%; zoom: 1.15; }
.code-win pre, .code-win code { font-family: var(--font-mono); }
.case-how { list-style: none; margin: 0; padding: 0; counter-reset: how; }
.case-how li { display: grid; grid-template-columns: 2.5rem 1fr; gap: var(--s-1) var(--s-4); padding-block: var(--s-4); border-bottom: 1px solid var(--line); counter-increment: how; }
.case-how li::before { content: counter(how, decimal-leading-zero); grid-row: span 2; font: 13px/1.9 var(--font-mono); color: var(--accent); }
.case-how b { font-weight: 500; } .case-how p { color: var(--ink); }
.code-win { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; align-self: start; }
.code-win .nb__bar { position: static; }
.code-win pre { margin: 0; padding: var(--s-6); font: 14px/1.75 var(--font-mono); white-space: pre; overflow-x: auto; color: var(--ink); }
.decision .panel { --p-h: 120px; block-size: var(--p-h); flex: none; display: grid; place-items: center start; padding: var(--s-5); background: color-mix(in oklab, var(--ink) 5%, var(--bg)) !important; background-image: none !important; }
.decision .panel::before, .decision .panel::after { content: none !important; }
.decision code { font: 14px/1.5 var(--font-mono); color: var(--accent); overflow-wrap: anywhere; }
.decision p { color: var(--ink); }
.case-next ul { list-style: none; margin: 0; padding: 0; }
.case-next li { padding-block: var(--s-4); border-bottom: 1px solid var(--line); font-size: var(--t-lead); }

/* ---------------------------------------------------------------- view transitions */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(*) { animation-duration: 520ms; animation-timing-function: cubic-bezier(.22,1,.36,1); }
}
/* the theme switch: the new theme opens as a circle from the toggle (site.js animates it) */
html.theming::view-transition-old(root), html.theming::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theming::view-transition-old(root) { z-index: 1; }
html.theming::view-transition-new(root) { z-index: 2; }
