:root {
  --bg: #f7f7f4; --bg-2: #efefea; --fg: #14161b; --muted: #5b6070; --line: #dcdcd4;
  --accent: #2f5bea; --accent-2: #00a39a; --card: #ffffffb3;
  --accent-2-ink: #007a73; /* teal for text: --accent-2 is 2.9:1 on --bg in light mode, this is 4.9:1 */
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --gutter: clamp(20px, 5vw, 64px);
  /* the left/right content edge of every band: sections are 1240px centred, so the nav, hero text and
     footer line up with them instead of hugging the viewport (resolved where used: 100% = band width) */
  --edge: calc(max(0px, (100% - 1240px) / 2) + var(--gutter));
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0d12; --bg-2: #11141b; --fg: #e9eaee; --muted: #9298a8; --line: #232733;
          --accent: #7c9cff; --accent-2: #3fd6c6; --accent-2-ink: #3fd6c6; --card: #141823b3; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 17px/1.6 var(--sans);
       -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; z-index: 10; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
       padding: 16px var(--edge); backdrop-filter: blur(12px) saturate(140%);
       background: color-mix(in oklab, var(--bg) 72%, transparent); border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 20px/1 var(--display); letter-spacing: -0.02em; }
.mark { width: 26px; height: 26px; fill: none; stroke: var(--fg); stroke-width: 2.6; stroke-linecap: round; }
.mark circle { fill: var(--accent); stroke: none; }
.nav nav { display: flex; gap: clamp(14px, 3vw, 32px); align-items: center; font-size: 15px; }
.nav nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav nav a:hover { color: var(--fg); }
.nav .nav-cta { display: inline-flex; align-items: center; min-height: 44px; color: var(--fg); border: 1px solid var(--line); padding: 0 16px; border-radius: 999px; }

/* hero */
.hero { position: relative; min-height: min(88vh, 820px); display: grid; align-items: center; overflow: hidden;
        border-bottom: 1px solid var(--line); }
#field { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
               background: radial-gradient(120% 90% at 15% 40%, var(--bg) 30%, transparent 75%); }
.hero-inner { position: relative; z-index: 1; width: 100%; padding: clamp(48px, 9vh, 120px) var(--edge); }
.eyebrow { margin: 0 0 22px; text-wrap: balance; font: 500 13px/1 var(--mono);
           letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 0; font: 650 clamp(42px, 7.2vw, 92px)/0.98 var(--display); letter-spacing: -0.045em; }
h1 em { font-style: normal; color: var(--accent); }
.lede { max-width: 620px; margin: 26px 0 34px; font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 22px; border-radius: 999px;
       text-decoration: none; font-weight: 550; font-size: 16px; transition: transform .15s, background .2s, border-color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--fg); color: var(--bg); }
.btn.ghost { border: 1px solid var(--line); color: var(--fg); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.big { font-size: clamp(18px, 2.4vw, 24px); padding: 16px 30px; }
.readout { display: flex; gap: 28px; margin: 54px 0 0; font-family: var(--mono); }
.readout div { border-left: 2px solid var(--line); padding-left: 12px; }
.readout dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.readout dd { margin: 4px 0 0; font-size: 18px; font-variant-numeric: tabular-nums; min-width: 5ch; }

/* sections */
.section { padding: clamp(72px, 12vh, 140px) var(--gutter); max-width: 1240px; margin: 0 auto; }
.kicker { margin: 0 0 18px; font: 500 13px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.section-lede { max-width: 720px; margin: 0 0 48px; font: 500 clamp(22px, 2.6vw, 30px)/1.35 var(--display); letter-spacing: -0.02em; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } /* 4 cards: 2x2, never 3+1 */
@media (min-width: 1240px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.card { padding: 28px 26px 30px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); } /* not links: no hover state */
.card .num { font: 500 13px/1 var(--mono); color: var(--muted); }
.card h3 { margin: 18px 0 10px; font: 600 21px/1.25 var(--display); letter-spacing: -0.015em; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
/* selected work: one row per engagement, the measured result set like the hero's readout */
.work { list-style: none; margin: 0; padding: 0; }
.work li { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr; column-gap: clamp(24px, 5vw, 72px);
           padding: 30px 0 34px; border-top: 1px solid var(--line); }
.work li:last-child { border-bottom: 1px solid var(--line); }
.work .figure { grid-row: 1; margin: 0; font: 650 clamp(38px, 4.6vw, 60px)/1 var(--display); letter-spacing: -0.035em;
                font-variant-numeric: tabular-nums; white-space: nowrap; }
.work .from { color: var(--muted); }
.work .to-sep { margin: 0 0.18em; color: var(--accent-2-ink); font-weight: 400; }
.work .unit { margin-left: 0.18em; font-size: max(16px, 0.42em); font-weight: 500; letter-spacing: 0; color: var(--muted); }
.work .metric { grid-row: 2; margin: 12px 0 0; font: 500 15px/1.45 var(--mono); color: var(--muted); }
.work h3 { grid-column: 2; grid-row: 1; margin: 4px 0 8px; font: 600 21px/1.25 var(--display); letter-spacing: -0.015em; }
.work h3 + p { grid-column: 2; grid-row: 2; margin: 0; max-width: 62ch; color: var(--muted); }
@media (max-width: 760px) {
  .work li { grid-template-columns: 1fr; grid-template-rows: none; }
  .work .figure, .work .metric, .work h3, .work h3 + p { grid-column: 1; grid-row: auto; }
  .work h3 { margin-top: 22px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px; counter-reset: s; }
.steps li { counter-increment: s; border-top: 1px solid var(--line); padding-top: 22px; }
.steps li::before { content: "0" counter(s); font: 500 13px/1 var(--mono); color: var(--accent-2-ink); }
.steps h3 { margin: 14px 0 8px; font: 600 22px/1.25 var(--display); letter-spacing: -0.015em; }
.steps p { margin: 0; color: var(--muted); }
.about { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.about .section-lede { margin-bottom: 20px; }
.muted { color: var(--muted); margin: 0; max-width: 620px; }
/* the stack reads like the hero readout: a label, then plain text (no pills that look clickable) */
.stack { margin: 34px 0 0; }
.stack div { padding: 14px 0 16px; border-top: 1px solid var(--line); }
.stack div:last-child { border-bottom: 1px solid var(--line); }
.stack dt { font: 500 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stack dd { margin: 6px 0 0; font-size: 16px; }
/* generic terms; the tools behind each show in a tooltip on hover, keyboard focus or tap */
.terms { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: 4px; row-gap: 2px; }
.terms li { position: relative; }
.terms li:not(:last-child)::after { content: "·"; margin-left: 4px; color: var(--muted); }
.term { padding: 2px 0; border: 0; background: none; font: inherit; color: var(--fg); cursor: help;
        text-decoration: underline dotted color-mix(in oklab, var(--muted) 70%, transparent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.term:hover, li.open > .term { text-decoration-color: var(--accent-2-ink); }
.tip { position: absolute; z-index: 4; bottom: calc(100% + 8px); left: 0; width: max-content; max-width: min(300px, calc(100vw - 32px));
       transform: translateX(var(--shift, 0px)); padding: 9px 12px; border-radius: 8px; background: var(--fg); color: var(--bg);
       font: 400 14px/1.45 var(--sans); box-shadow: 0 6px 18px -6px rgb(0 0 0 / .35);
       display: none; } /* out of layout while hidden, or a tip near the right edge widens the page */
.tip::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
.terms li.below > .tip { bottom: auto; top: calc(100% + 8px); }
.terms li.below > .tip::after { top: auto; bottom: 100%; } /* bridge: the pointer can move onto the tip */
.terms li:hover > .tip, .term:focus-visible + .tip, .terms li.open > .tip { display: block; animation: tip-in .12s ease-out; }
.terms li.dismissed > .tip { display: none; }
@keyframes tip-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tip { animation: none !important; } }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } .stack { margin-top: 0; } }
.contact { text-align: center; }
.contact h1, .contact h2 { max-width: 860px; margin: 0 auto 18px; font: 650 clamp(30px, 4.6vw, 56px)/1.05 var(--display); letter-spacing: -0.035em; text-wrap: balance; }
.contact p { margin: 0 auto 36px; max-width: 560px; color: var(--muted); }
.contact .actions { justify-content: center; align-items: center; }
.contact .availability { margin-top: -12px; font-size: 15px; text-wrap: balance; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: var(--accent-2); vertical-align: 0.08em; }
/* the address as a code block: the block opens the mail client, the square button copies */
.mailcode { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--line); border-radius: 10px;
            background: var(--bg-2); overflow: hidden; }
.mailcode-link { display: flex; align-items: center; min-width: 0; padding: 18px 22px; text-decoration: none;
                 font: 500 clamp(17px, 2.2vw, 22px)/1.2 var(--mono); color: var(--fg); transition: background .2s; }
.mailcode-link:hover { background: color-mix(in oklab, var(--fg) 5%, transparent); }
.mailcode-link:focus-visible, .mailcode-copy:focus-visible { outline-offset: -3px; }
.mailcode-copy { display: grid; place-items: center; flex: none; width: 44px; height: 44px; align-self: center; margin: 0 9px 0 0;
                 padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--muted);
                 cursor: pointer; transition: color .2s, border-color .2s; }
.mailcode-copy[hidden] { display: none; }
.mailcode-copy:hover { color: var(--fg); border-color: var(--muted); }
.mailcode-copy svg { grid-area: 1 / 1; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mailcode-copy .i-done, .mailcode-copy.done .i-copy { visibility: hidden; }
.mailcode-copy.done .i-done { visibility: visible; }
.mailcode-copy.done { color: var(--accent-2-ink); }
.contact .copy-status { min-height: 1.6em; margin: 14px auto 0; font-size: 15px; color: var(--accent-2-ink); }
button.btn { font: inherit; font-weight: 550; cursor: pointer; background: none; }
.fullpage { min-height: 80vh; display: grid; align-content: center; justify-items: center; }

/* footer */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 28px var(--edge);
        border-top: 1px solid var(--line); font: 13px/1.5 var(--mono); color: var(--muted); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}
@media (max-width: 560px) {
  .nav nav a:not(.nav-cta):not([href$="#work"]) { display: none; } /* phones keep the proof and the contact */
  .nav nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .readout { gap: 18px; }
}
@media (max-width: 420px) { .btn { padding: 13px 18px; } } /* keeps the two hero buttons on one row at 375px */
@media (max-width: 759px) { .hero-inner { padding-bottom: 340px; } .hero::after { background: linear-gradient(180deg, var(--bg) 55%, transparent 80%); } }
