@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --paper: #f5f3ee;
  --card: #fbfaf6;
  --ink: #16150f;
  --muted: #5d5a52;
  --faint: #8b877d;
  --line: #d9d5ca;
  --accent: #c8431b;
  --max: 1080px;
  --sans: "Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
:target { scroll-margin-top: 16px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: #fff; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: 28px; padding-right: 28px; }
.mono { font-family: var(--mono); }
.label { font: 400 13px/1.4 var(--mono); color: var(--accent); letter-spacing: .02em; margin: 0 0 18px; }

/* Header */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.wordmark { text-decoration: none; display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.wordmark b { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.wordmark span { font: 400 12.5px var(--mono); color: var(--faint); }
.top nav { display: flex; gap: 26px; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
.top nav .nav-project { color: var(--ink); font-weight: 500; padding-left: 22px; border-left: 1px solid var(--line); }
.top nav .nav-project span { color: var(--accent); font: 400 11px var(--mono); border: 1px solid currentColor; border-radius: 3px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; }

/* Type */
h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.06; letter-spacing: -.03em; }
h2 { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.15; }
h3 { font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
.lede { font-size: clamp(18px, 1.9vw, 20px); color: var(--muted); max-width: 54ch; }

section { padding: 96px 0; border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: 280px 1fr; gap: 40px; margin-bottom: 48px; }
.section-head p { margin: 10px 0 0; color: var(--muted); max-width: 56ch; }
.section-head .label { margin: 8px 0 0; color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px;
  background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 500; font-size: 16px;
  border-radius: 3px; transition: background .15s ease;
}
.btn:hover { background: var(--accent); color: #fff; }
.text-link { font-weight: 500; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.foot a { color: var(--muted); }

@media (max-width: 820px) {
  .section-head { grid-template-columns: 1fr; gap: 0; }
  section { padding: 72px 0; }
}
@media (max-width: 640px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .top nav a:not(.nav-project) { display: none; }
  .top nav .nav-project { padding-left: 0; border-left: 0; }
  .wordmark span { display: none; }
}

/* ---------- Motion ----------
   Opt-in: the inline <head> script sets html.m (no reduced-motion preference, IntersectionObserver
   available); html.seen means this page was already shown in this tab, so the hero intro is skipped.
   motion.js adds .go when the page starts and .in when an element reaches the reading line.
   Hidden states sit on :not(.go) / :not(.in); the revealed state is always the static design.
   Curves: --out for things arriving, --draw for lines being drawn. Durations .5s / .8s / 1.1s. Stagger 100ms. */
:root { --out: cubic-bezier(.16, 1, .3, 1); --draw: cubic-bezier(.65, 0, .35, 1); --rise: 8px; }

@media screen and (prefers-reduced-motion: no-preference) {

  /* 1. Typeset: the hero headline is set line by line behind a baseline mask, then the CTA arrives */
  .m:not(.go):not(.seen) .hero h1 { visibility: hidden; }
  .m .hero h1 .w { display: inline-block; vertical-align: top; overflow: hidden; padding: 0 .08em .14em; margin: 0 -.08em -.14em; }
  .m .hero h1 .w > span { display: inline-block; transform: translateY(110%); }
  .go .hero h1 .w > span { transform: none; animation: m-rise 1.1s var(--out) calc(var(--l, 0) * 100ms + 100ms) backwards; }
  .m:not(.go):not(.seen) .hero .hero-cta { opacity: 0; transform: translateY(var(--rise)); }
  .go .hero .hero-cta { transition: opacity .8s var(--out) .5s, transform .8s var(--out) .5s; }

  /* 2. Plate: a paper cover lifts off the portrait top to bottom, then the caption fades in */
  .m .portrait picture { position: relative; }
  .m:not(.seen) .portrait picture::after { content: ""; position: absolute; top: -1px; right: -1px; bottom: -1px; left: -1px; background: var(--paper); transform-origin: 50% 100%; }
  .go .portrait picture::after { transform: scaleY(0); transition: transform .8s var(--draw) .35s; }
  .m:not(.go):not(.seen) .portrait figcaption { opacity: 0; }
  .go .portrait figcaption { transition: opacity .8s var(--out) .6s; }

  /* 3. Ruled and marked: ink rules draw left to right, then each icon's accent stroke is marked */
  .m :is(.services, .steps li, .ai-grid, .caps, .why) { position: relative; border-top-color: transparent; }
  .m :is(.services, .steps li, .ai-grid, .caps, .why)::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; border-top: 1px solid var(--ink); transform-origin: 0 50%; }
  .m :is(.services, .steps li, .ai-grid, .caps, .why):not(.in)::before { transform: scaleX(0); }
  .m :is(.services, .steps li, .ai-grid, .caps, .why).in::before { transition: transform .8s var(--draw); }
  .m :is(.service, .steps li, .ai-grid > div, .caps > .cap):not(.in) .ico .a:not(.fill) { stroke-dasharray: var(--len) 100; stroke-dashoffset: var(--len); }
  .m :is(.service, .steps li, .ai-grid > div, .caps > .cap).in .ico .a:not(.fill) { animation: m-stroke .5s var(--draw) .4s backwards; }
  .m .ico .fill { transform-box: fill-box; transform-origin: center; }
  .m :is(.service, .steps li, .ai-grid > div, .caps > .cap):not(.in) .ico .fill { transform: scale(0); }
  .m :is(.service, .steps li, .ai-grid > div, .caps > .cap).in .ico .fill { transition: transform .5s var(--out) .5s; }

  /* 4. Filed: bug report rows fill in as they reach the reading line; after the DB check row
        a caret holds for a moment, then the query result appears, then the notes */
  .m .bug dt:not(.in), .m .bug dt:not(.in) + dd { opacity: 0; transform: translateY(var(--rise)); }
  .m .bug dt.in, .m .bug dt.in + dd { transition: opacity .8s var(--out) .15s, transform .8s var(--out) .15s; }
  .m .bug:not(.done) .sql-result { color: transparent; }
  .m .bug.run:not(.done) .sql-result::before { content: ""; border-left: 1.5px solid var(--accent); margin-right: -1.5px; }
  .m .bug.done .sql-result { transition: color .5s var(--out); }
  .m .bug:not(.done) .note { opacity: 0; }
  .m .bug.done .note { transition: opacity .8s var(--out) .5s; }

  /* 5. Traced: the JOffers diagram is drawn in reading order and ends on the strong match.
        --b (1s) is set by motion.js when the diagram is already in view at load, so it waits for the headline. */
  .m .flowchart > :is(g, text) { --d: calc(var(--b, 0s) + .2s + var(--t, 0) * 100ms); }
  .m .flowchart > text:nth-of-type(2) { --d: calc(var(--b, 0s) + 1s); }
  .m .flowchart > :is(text:nth-of-type(3), .pick) { --d: calc(var(--b, 0s) + 1.3s); }
  .m .flowchart .src { --d: calc(var(--b, 0s) + .4s + var(--t) * 100ms); }
  .m .flowchart .node { --d: calc(var(--b, 0s) + .8s); }
  .m .flowchart .exit { --d: calc(var(--b, 0s) + 1.1s); }
  .m .flowchart .head { --d: calc(var(--b, 0s) + 1.4s); }
  .m .flowchart .tick { --d: calc(var(--b, 0s) + 2s); }
  .m .flowchart:not(.in) > :is(g, text) { opacity: 0; }
  .m .flowchart.in > :is(g, text) { transition: opacity .8s var(--out) var(--d); }
  .m .flowchart:not(.in) :is(.flow, .node, .tick) { stroke-dasharray: 1 2; stroke-dashoffset: 1.01; }
  .m .flowchart.in :is(.flow, .node, .tick) { animation: m-draw .8s var(--draw) var(--d) backwards; }
  .m .flowchart.in :is(.exit, .head, .tick) { animation-duration: .5s; }
  .m .flowchart:not(.in) .node { fill-opacity: 0; }
  .m .flowchart.in .node { transition: fill-opacity .8s var(--out) var(--d); }
  .m .flowchart .spark { transform-box: fill-box; transform-origin: center; }
  .m .flowchart:not(.in) .spark { transform: scale(0); }
  .m .flowchart.in .spark { transition: transform .5s var(--out) calc(var(--b, 0s) + 1s); }
  .m .flowchart:not(.in) .card.strong { stroke: var(--ink); }
  .m .flowchart.in .card.strong { transition: stroke .5s var(--out) calc(var(--b, 0s) + 1.9s); }
  .m .flowchart:not(.in) :is(.ok, .cap.ink) { opacity: 0; }
  .m .flowchart.in :is(.ok, .cap.ink) { transition: opacity .5s var(--out) calc(var(--b, 0s) + 1.9s); }
}

@keyframes m-rise { from { transform: translateY(110%); } }
@keyframes m-stroke { from { stroke-dasharray: var(--len) 100; stroke-dashoffset: var(--len); } to { stroke-dasharray: var(--len) 100; stroke-dashoffset: 0; } }
@keyframes m-draw { from { stroke-dasharray: 1 2; stroke-dashoffset: 1.01; } to { stroke-dasharray: 1 2; stroke-dashoffset: 0; } }
