/* Design system. Amber (--signal) is reserved for measured outcomes only. */

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* tokens */
:root {

  --ink: #090d11;
  --surface: #0f151b;
  --surface-2: #141d25;
  --line: #1e2831;
  --line-strong: #2b3843;
  --bone: #e9eef2;
  --pewter: #b9c3cc;
  --ash: #8593a0;

  --accent: #2fd8ce;
  --accent-deep: #14a79e;
  --accent-soft: #7dede6;

  --signal: #ffa94d;
  --signal-deep: #c2691a;

  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-base: clamp(1rem, 0.97rem + 0.16vw, 1.0625rem);
  --t-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --t-xl: clamp(1.4rem, 1.2rem + 0.9vw, 2rem);
  --t-2xl: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
  --t-3xl: clamp(2.6rem, 1.6rem + 4.4vw, 5.5rem);
  --t-metric: clamp(2.4rem, 1.6rem + 3.4vw, 4.25rem);

  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s6: 1.5rem;
  --s8: 2rem;
  --s10: 2.5rem;
  --s12: 3rem;
  --s16: 4rem;
  --s20: 5rem;
  --s24: 6rem;
  --s32: 8rem;

  --r-pill: 999px;
  --r-sharp: 3px;
  --r-card: 6px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-mz: cubic-bezier(0.6, 0.04, 0.1, 1);
  --dur-fast: 160ms;
  --dur: 260ms;
  --dur-slow: 420ms;

  --wrap: 78rem;
  --rail: 4.5rem;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --ink: #f7f8f7;
  --surface: #ffffff;
  --surface-2: #f0f2f3;
  --line: #dde3e8;
  --line-strong: #c3ccd4;
  --bone: #0b1116;
  --pewter: #2f3b45;
  --ash: #56646f;

  /* 4.5:1 on every light surface; #0b7d76 measured 4.44 on surface-2 */
  --accent: #0a7770;
  --accent-deep: #075e59;
  --accent-soft: #075e59;

  --signal: #a4520b;
  --signal-deep: #7c3d06;

  color-scheme: light;
}

/* Dark is the default, deliberately: the MZ mark, the OG card and the whole
   palette are built for it. Light is a first-class mode, one click away, and
   remembered - but it is opt-in rather than inherited from the OS. */

/* reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* .btn sets its own display; without !important that beats the UA [hidden]
   rule at equal specificity and the element stays visible. */
[hidden] {
  display: none !important;
}

ul,
ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sharp);
}

::selection {
  background: var(--accent);
  color: var(--ink);
}

/* type */
.display {
  font-size: var(--t-3xl);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h2 {
  font-size: var(--t-2xl);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h3 {
  font-size: var(--t-xl);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
}

.lede {
  font-size: var(--t-lg);
  line-height: 1.5;
  color: var(--pewter);
  text-wrap: pretty;
}

.muted {
  color: var(--ash);
}

/* layout */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.section {
  padding-block: clamp(var(--s16), 10vw, var(--s32));
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: var(--s4);
  margin-bottom: var(--s12);
}

.section-head__no {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--accent);
  padding-top: 0.5em;
  letter-spacing: 0.1em;
}

.section-head__body > .eyebrow {
  display: block;
  margin-bottom: var(--s3);
}

.section-head__body > p {
  max-width: 54ch;
  margin-top: var(--s4);
  color: var(--ash);
}

.skip {
  position: absolute;
  left: var(--s4);
  top: -100%;
  z-index: 100;
  padding: var(--s3) var(--s4);
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  border-radius: var(--r-sharp);
  transition: top var(--dur) var(--ease-out);
}
.skip:focus {
  top: var(--s4);
}

/* visually hidden but screen-reader and keyboard reachable; used on the
   native file input inside .btn--file so its own intrinsic width never
   forces the parent label or grid track to grow. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.btn--file:has(.vh:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sharp);
}

/* header */
.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out);
}

@supports (backdrop-filter: blur(8px)) {
  .hdr {
    backdrop-filter: blur(10px);
  }
}
.hdr[data-stuck="true"] {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--ink) 94%, transparent);
}

.hdr__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.brand svg {
  width: 2rem;
  height: 2rem;
}
.brand__txt {
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand__txt span {
  color: var(--ash);
  font-weight: 400;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s6);
}
/* Nav fill wipes up behind the text. --ink is the page bg in both themes, so
   color:var(--ink) self-inverts. Technique: kevinpowell.co */
.nav a {
  position: relative;
  z-index: 0;
  font-size: var(--t-sm);
  color: var(--ash);
  padding: 0.15em 0.4em;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav a::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: var(--r-sharp);
  background: var(--accent);
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform var(--dur-fast) var(--ease-mz);
}
.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
}
.nav a:hover::after,
.nav a:focus-visible::after {
  transform: scaleY(1);
}
/* forced-colors drops backgrounds, so keep the real ring */
.nav a:focus-visible {
  outline-offset: 2px;
}
@media (forced-colors: active) {
  .nav a::after {
    display: none;
  }
}

/* base first, override after: reversing breaks the mobile nav */
.nav__links {
  display: flex;
  gap: var(--s6);
}
@media (max-width: 54rem) {
  .nav__links {
    display: none;
  }
  .brand__txt span {
    display: none;
  }
}

/* theme toggle */
.tgl {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ash);
  transition: color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.tgl:hover {
  color: var(--bone);
  border-color: var(--line-strong);
}
/* 44px minimum touch target below tablet width */
@media (max-width: 50rem) {
  .tgl {
    width: 2.75rem;
    height: 2.75rem;
  }
}
.tgl svg {
  width: 1rem;
  height: 1rem;
}
#tgl-rays {
  transition: opacity var(--dur) var(--ease-out);
}


/* shared primitives */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s8);
}
.actions--tight {
  margin-top: var(--s4);
}

/* underlined so it never relies on colour alone (axe: link-in-text-block) */
.lnk {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}
.lnk:hover {
  color: var(--accent-soft);
}

.meta-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.meta-links a {
  color: var(--ash);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.meta-links a:hover,
.meta-links a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}
.meta-links--spaced {
  margin-top: var(--s6);
}

.code {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--pewter);
}

.note {
  margin-top: var(--s6);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sharp);
  font-size: var(--t-sm);
  line-height: 1.6;
  color: var(--ash);
}
.note + .note {
  margin-top: var(--s4);
}
.note--signal {
  border-left-color: var(--signal);
}
.note__h {
  display: block;
  color: var(--pewter);
  font-weight: 600;
  margin-bottom: var(--s3);
}

.arrow-dim {
  color: var(--ash);
}
.prose-narrow {
  max-width: 52ch;
}
.prose-narrow--spaced {
  margin-top: var(--s6);
}

/* reading progress; --read is 0..1 from JS */
.prog {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 3px;
  background: color-mix(in srgb, var(--line) 60%, transparent);
  pointer-events: none;
}
.prog__bar {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--signal));
  transform: scaleX(var(--read, 0));
  transform-origin: left;
}

/* testimonials; <mark> carries --signal because those are the measured claims */
.quote blockquote p {
  color: var(--pewter);
  font-size: var(--t-base);
  line-height: 1.65;
  text-wrap: pretty;
}
.quote mark {
  background: none;
  color: var(--signal);
  font-weight: 600;
}
.quote figcaption {
  margin-top: var(--s4);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.quote__who {
  font-weight: 600;
  color: var(--bone);
  font-size: var(--t-sm);
}
.quote__meta {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ash);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.quote--lead {
  border-top: 2px solid var(--signal);
  padding-top: var(--s6);
  margin-bottom: var(--s12);
}
.quote--lead blockquote p {
  font-size: var(--t-lg);
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--bone);
  max-width: 52ch;
}

/* Reviews scroll horizontally. A real scroll region, not hijacked wheel
   travel: native scrollbar, snap points, arrow keys and swipe for free. */
.scroller {
  position: relative;
  margin-inline: calc(clamp(1.25rem, 4vw, 2.5rem) * -1);
}
.scroller__rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(20rem, 24rem);
  gap: var(--s6);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: clamp(1.25rem, 4vw, 2.5rem);
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
  padding-bottom: var(--s4);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.scroller__rail::-webkit-scrollbar {
  height: 6px;
}
.scroller__rail::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-pill);
}
.scroller__rail::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
.scroller__rail:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
@media (max-width: 46rem) {
  .scroller__rail {
    grid-auto-columns: minmax(17rem, 85%);
  }
}

.rail-item {
  scroll-snap-align: start;
  display: flex;
}
.rail-item .quote {
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  width: 100%;
  transition: border-color var(--dur) var(--ease-out);
}
.rail-item .quote:hover,
.rail-item .quote:focus-within {
  border-top-color: var(--accent);
}
.rail-item blockquote {
  flex: 1;
}
.rail-item figcaption {
  margin-top: 0;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}

.scroller__hint {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s2);
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ash);
}
.scroller__arrow svg {
  width: 1rem;
  height: 1rem;
}
@media (prefers-reduced-motion: no-preference) {
  .scroller__arrow {
    animation: nudge 2.4s var(--ease-out) infinite;
  }
}
@keyframes nudge {
  0%, 60%, 100% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(4px);
  }
}

/* rotating endorsement chip; min-width stops the line reflowing per word */
.chip-line {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ash);
  letter-spacing: 0.06em;
  margin-top: var(--s4);
}
.chip {
  display: inline-block;
  min-width: 15ch;
  color: var(--accent);
  font-weight: 600;
}

/* hover-to-reveal: pointer-only, shows the actual client site */
@media (hover: hover) and (pointer: fine) {
  .peek {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    width: 18rem;
    pointer-events: none;
    opacity: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-card);
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 24px 48px -12px rgb(0 0 0 / 0.5);
    transform: translate3d(calc(var(--px, 0px) + 1.25rem), calc(var(--py, 0px) - 50%), 0)
      scale(0.96);
    transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
  }
  .peek[data-on="true"] {
    opacity: 1;
    transform: translate3d(calc(var(--px, 0px) + 1.25rem), calc(var(--py, 0px) - 50%), 0) scale(1);
  }
  .peek img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top center;
  }
}

/* buttons */
.btn {
  position: relative;
  overflow: hidden; /* clips the ripple to the pill */
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) 1.15rem;
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  /* magnetic offset from JS; zero by default and on touch */
  transform: translate3d(var(--magx, 0px), var(--magy, 0px), 0);
  transition: transform var(--dur) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
/* JS drives transform per-frame while inside; a transition would lag it */
.btn[data-mag="true"] {
  transition: background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.btn:active {
  transform: translate3d(var(--magx, 0px), calc(var(--magy, 0px) + 1px), 0);
}
.btn--primary {
  background: var(--accent);
  color: #05201f;
}
:root[data-theme="light"] .btn--primary {
  color: #ffffff;
}
.btn--primary:hover {
  background: var(--accent-soft);
}
:root[data-theme="light"] .btn--primary:hover {
  background: var(--accent-deep);
}
.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--bone);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--file {
  cursor: pointer;
}
.btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

/* hero */
.hero {
  padding-block: clamp(var(--s16), 12vw, var(--s32)) var(--s16);
}
.hero__grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: var(--s4);
}
@media (max-width: 46rem) {
  .hero__grid,
  .section-head {
    grid-template-columns: 1fr;
  }
  .hero__rail {
    display: none;
  }
}

.hero__rail {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ash);
  writing-mode: vertical-rl;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding-top: var(--s2);
}

.hero .display {
  margin-block: var(--s6) var(--s6);
  max-width: 20ch;
}

.hero .display em {
  font-style: normal;
  color: var(--accent);
}

.hero__lede {
  max-width: 58ch;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
  margin-top: var(--s8);
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ash);
}
.hero__meta li {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.hero__meta li + li::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  margin-right: var(--s2);
}
.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .dot-live {
    animation: pulse 2.4s var(--ease-out) infinite;
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
  }
  50% {
    opacity: 0.75;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 0%, transparent);
  }
}

/* headline metrics */
.ledger {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  margin-top: var(--s16);
}
@media (max-width: 46rem) {
  .ledger {
    grid-template-columns: 1fr;
  }
}
.ledger__item {
  padding: var(--s8) var(--s6) var(--s8) 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 46.001rem) {
  .ledger__item + .ledger__item {
    padding-left: var(--s6);
    border-left: 1px solid var(--line);
  }
}

.metric {
  font-family: var(--mono);
  font-size: var(--t-metric);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 0.05em;
}
.metric__unit {
  font-size: 0.42em;
  letter-spacing: 0;
}

/* phrase outcomes: mono numeral tracking mangles words */
.metric--text {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  line-height: 1.1;
  display: block;
}
.metric__label {
  margin-top: var(--s3);
  font-size: var(--t-sm);
  color: var(--pewter);
  max-width: 24ch;
}
.metric__src {
  margin-top: var(--s2);
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ash);
}

/* case studies */
.cases {
  border-top: 1px solid var(--line);
}

.case {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--s4) var(--s8);
  padding-block: var(--s12);
  border-bottom: 1px solid var(--line);
  align-items: start;
}
@media (max-width: 62rem) {
  .case {
    grid-template-columns: var(--rail) minmax(0, 1fr);
  }
  .case__shot {
    grid-column: 1 / -1;
  }
}
@media (max-width: 46rem) {
  .case {
    grid-template-columns: 1fr;
    gap: var(--s4);
  }
}

.case__no {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--accent);
  letter-spacing: 0.1em;
  padding-top: 0.4em;
}
@media (max-width: 46rem) {
  .case__no {
    color: var(--ash);
  }
}

.case__body > .eyebrow {
  display: block;
  margin-bottom: var(--s2);
}
.case__title {
  display: block;
}
/* arrow must ride the last word, never orphan */
.case__title a {
  display: inline;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--dur) var(--ease-out);
}
.case__title a:hover,
.case__title a:focus-visible {
  background-size: 100% 1px;
}
.case__title svg {
  display: inline-block;
  vertical-align: baseline;
  width: 0.62em;
  height: 0.62em;
  margin-left: 0.28em;
  color: var(--ash);
  transition: transform var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.case__title a:hover svg {
  transform: translate(2px, -2px);
  color: var(--accent);
}

.case__desc {
  margin-top: var(--s3);
  color: var(--ash);
  max-width: 56ch;
}

.case__outcome {
  margin-top: var(--s6);
  padding-left: var(--s4);
  border-left: 2px solid var(--signal);
}
.case__outcome .metric {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
}
.case__outcome p {
  margin-top: var(--s2);
  font-size: var(--t-sm);
  color: var(--pewter);
  max-width: 42ch;
}

.case__role {
  margin-top: var(--s6);
  font-size: var(--t-sm);
  color: var(--ash);
}
.case__role b {
  color: var(--pewter);
  font-weight: 600;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s4);
}
.stack li {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ash);
}
.stack--spaced {
  margin-top: var(--s6);
}

.case__shot {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface);
}
.case__shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  filter: saturate(0.72) brightness(0.9) contrast(1.02);
  transform: scale(1.005);
  transition: filter var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
.case:hover .case__shot img,
.case__shot a:focus-visible img,
html.no-hover .case.is-active .case__shot img {
  filter: saturate(1) brightness(1) contrast(1);
  transform: scale(1.03);
}
:root[data-theme="light"] .case__shot img {
  filter: saturate(0.8) brightness(0.98);
}

/* labs */
.labs {
  display: grid;
  /* deliberately uneven tracks */
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
}
@media (max-width: 62rem) {
  .labs {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 40rem) {
  .labs {
    grid-template-columns: 1fr;
  }
}
.lab {
  background: var(--surface);
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  transition: background var(--dur) var(--ease-out);
}
.lab:hover {
  background: var(--surface-2);
}
.lab__ico {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
}
.lab h3 {
  font-size: var(--t-lg);
}
.lab p {
  font-size: var(--t-sm);
  color: var(--ash);
  flex: 1;
}
/* demo */
.demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s8);
  align-items: start;
}
@media (max-width: 62rem) {
  .demo {
    grid-template-columns: 1fr;
  }
}

.drop {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: var(--s12) var(--s6);
  text-align: center;
  transition: border-color var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out);
}
.drop[data-over="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.drop svg {
  width: 2rem;
  height: 2rem;
  margin-inline: auto;
  color: var(--ash);
  margin-bottom: var(--s4);
}
.drop p {
  font-size: var(--t-sm);
  color: var(--ash);
  margin-bottom: var(--s4);
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: var(--s2);
  margin-top: var(--s4);
}
.thumbs:empty {
  display: none;
}
.thumb {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-sharp);
  overflow: hidden;
  aspect-ratio: 1;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 1.15rem;
  height: 1.15rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 80%, transparent);
  color: var(--bone);
  font-size: 0.7rem;
  line-height: 1;
}
.thumb button:hover {
  background: var(--signal);
  color: var(--ink);
}

.demo__out {
  font-family: var(--mono);
  font-size: var(--t-sm);
  color: var(--ash);
  margin-top: var(--s4);
  min-height: 1.5em;
}
.demo__out b {
  color: var(--signal);
}

/* arch diagram */
.arch {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: var(--s8) var(--s6);
  overflow-x: auto;
}
.arch svg {
  width: 100%;
  min-width: 34rem;
  height: auto;
}
/* only needed once the svg's min-width forces a scroll */
.arch__hint {
  display: none;
  margin-top: var(--s3);
  font-family: var(--mono);
  font-size: var(--t-xs);
}
@media (max-width: 62rem) {
  .arch__hint {
    display: block;
  }
}
.arch-box {
  fill: var(--surface-2);
  stroke: var(--line-strong);
  stroke-width: 1;
}
.arch-edge {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.arch-t {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--bone);
}
.arch-t--dim {
  fill: var(--ash);
  font-size: 9.5px;
}
.arch-t--accent {
  fill: var(--accent);
}

/* stack */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--s8) var(--s12);
}
.skills h3 {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: var(--s3);
  margin-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
}
.skills li {
  font-size: var(--t-sm);
  color: var(--pewter);
  padding-block: 0.2rem;
}

/* contact */
.contact__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s12);
  align-items: start;
}
@media (max-width: 62rem) {
  .contact__grid {
    grid-template-columns: 1fr;
  }
}
.contact__links {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.contact__links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding-block: var(--s4);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: var(--t-sm);
  color: var(--pewter);
  transition: color var(--dur-fast) var(--ease-out),
    padding-left var(--dur) var(--ease-out);
}
.contact__links a:hover {
  color: var(--accent);
  padding-left: var(--s2);
}
.contact__links svg {
  width: 0.9rem;
  height: 0.9rem;
  flex: none;
}

/* footer */
.ftr {
  border-top: 1px solid var(--line);
  padding-block: var(--s8);
}
.ftr__in {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ash);
}

/* parallax + pointer; all of it opt-in behind reduced-motion + fine pointer */

/* fixed grid parallaxes against content for free */
.field {
  position: fixed;
  inset: -20vh 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;

  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 72%);
  transform: translate3d(0, calc(var(--sy, 0) * -28px), 0);
  will-change: transform;
}
:root[data-theme="light"] .field {
  opacity: 0.7;
}

/* pointer light: halo lags, core chases. The gap is what sells it. */
.glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 60rem;
  height: 60rem;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--accent) 30%, transparent) 0%,
    color-mix(in srgb, var(--accent) 12%, transparent) 34%,
    transparent 68%
  );

  transform: translate3d(calc(var(--gx, 50vw) - 50%), calc(var(--gy, 50vh) - 50%), 0);
  transition: opacity 600ms var(--ease-out);
  will-change: transform;
}
.glow[data-on="true"] {
  opacity: 1;
}

.glow__core {
  position: fixed;
  top: 0;
  left: 0;
  width: 22rem;
  height: 22rem;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--accent) 26%, transparent) 0%,
    transparent 60%
  );
  mix-blend-mode: screen;
  transform: translate3d(calc(var(--cx, 50vw) - 50%), calc(var(--cy, 50vh) - 50%), 0);
  transition: opacity 400ms var(--ease-out);
  will-change: transform;
}
.glow__core[data-on="true"] {
  opacity: 1;
}
:root[data-theme="light"] .glow {
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--accent) 16%, transparent) 0%,
    color-mix(in srgb, var(--accent) 7%, transparent) 34%,
    transparent 68%
  );
}
/* screen blows out a light page; multiply keeps the tint */
:root[data-theme="light"] .glow__core {
  mix-blend-mode: multiply;
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--accent) 14%, transparent) 0%,
    transparent 60%
  );
}

/* content sits above the field/glow. .hdr is excluded: it is position:sticky
   and this rule would silently override it. */
main,
.ftr {
  position: relative;
  z-index: 1;
}

/* depth is per-layer below; transforming both would compound the offsets */
.hero__grid {
  will-change: transform;
}

.case__shot img {
  transform: scale(1.06) translate3d(0, calc(var(--p, 0) * 16px), 0)
    skewY(calc(var(--skew, 0) * 1deg));
}
.case:hover .case__shot img,
.case__shot a:focus-visible img,
html.no-hover .case.is-active .case__shot img {
  transform: scale(1.1) translate3d(0, calc(var(--p, 0) * 16px), 0)
    skewY(calc(var(--skew, 0) * 1deg));
}

/* tilt sheen + lab cursor wash: the look is device-independent, only the
   trigger differs (:hover below for fine pointers, .is-active for no-hover,
   set by initCenterStage's ScrollTrigger). */
.tilt {
  position: relative; /* containing block for the sheen */
}
.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    var(--sheen, 120deg),
    transparent 38%,
    color-mix(in srgb, var(--accent) 9%, transparent) 50%,
    transparent 62%
  );
  transition: opacity var(--dur) var(--ease-out);
}
html.no-hover .tilt.is-active::after {
  opacity: 1;
}

.lab {
  position: relative;
}
.lab::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(
    18rem circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--accent) 10%, transparent),
    transparent 42%
  );
  transition: opacity var(--dur) var(--ease-out);
}
.lab > * {
  position: relative;
}
html.no-hover .lab.is-active::before {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  /* 3D tilt, capped at 5deg */
  .tilt {
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg))
      translate3d(0, 0, 0);
    transform-style: preserve-3d;
    transition: transform 500ms var(--ease-out);
  }
  .tilt[data-tilting="true"] {
    transition: none;
  }
  .tilt:hover::after {
    opacity: 1;
  }

  .lab:hover::before,
  .lab:focus-within::before {
    opacity: 1;
  }
}

/* SplitText line mask; aria:"auto" keeps the headline one sentence for AT */
.line-mask {
  overflow: hidden;
  display: block;
  padding-bottom: 0.08em;
}

/* Left rail scrollspy. Hidden under 78rem: it needs margin that does not exist
   on a laptop, and the header nav already covers the same ground. */
.rail {
  position: fixed;
  left: max(1.25rem, calc((100vw - var(--wrap)) / 2 - 3.5rem));
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: none;
  flex-direction: column;
  gap: var(--s3);
}
@media (min-width: 78rem) {
  .rail {
    display: flex;
  }
}
.rail a {
  display: flex;
  align-items: center;
  gap: var(--s3);
  color: var(--ash);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.rail__dot {
  width: 18px;
  height: 1px;
  background: var(--line-strong);
  flex: none;
  transition: width var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out);
}
.rail__txt {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
}
.rail a:hover .rail__txt,
.rail a:focus-visible .rail__txt,
.rail a[aria-current="true"] .rail__txt {
  opacity: 1;
  transform: none;
}
.rail a:hover .rail__dot,
.rail a:focus-visible .rail__dot {
  width: 30px;
  background: var(--accent);
}
.rail a[aria-current="true"] {
  color: var(--accent);
}
.rail a[aria-current="true"] .rail__dot {
  width: 34px;
  background: var(--accent);
}

/* Career timeline. The spine is a real SVG path so DrawSVG can draw it. */
.tl {
  display: grid;
  gap: 0;
  position: relative;
}
.tl__spine {
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  overflow: visible;
}
.tl__spine line {
  stroke: var(--accent);
  stroke-width: 2;
}
.tl__row {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: var(--s6);
  padding-bottom: var(--s12);
  position: relative;
}
.tl__row:last-child {
  padding-bottom: 0;
}
.tl__node {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--ink);
  margin-top: 0.35rem;
  position: relative;
  z-index: 1;
}
.tl__row[data-now="true"] .tl__node {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.tl__when {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.tl__role {
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: var(--s1);
}
.tl__org {
  color: var(--ash);
  font-size: var(--t-sm);
}
.tl__row ul {
  margin-top: var(--s3);
  display: grid;
  gap: var(--s2);
  max-width: 62ch;
}
.tl__row li {
  color: var(--pewter);
  font-size: var(--t-sm);
  padding-left: var(--s4);
  position: relative;
}
.tl__row li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 1px;
  background: var(--line-strong);
}
.tl__row li b {
  color: var(--signal);
  font-weight: 600;
}

/* Draggable card deck. Cards stack with a slight offset; drag throws the top
   one away and the next rises. Keyboard users get the buttons instead. */
.deck {
  position: relative;
  height: 22rem;
  touch-action: pan-y;
}
.deck__card {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
  cursor: grab;
  will-change: transform;
}
.deck__card:active {
  cursor: grabbing;
}
.deck__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: saturate(0.8);
}
.deck__meta {
  padding: var(--s4) var(--s6);
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
}
.deck__name {
  font-weight: 600;
  letter-spacing: -0.02em;
}
.deck__tag {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ash);
}
.deck__hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  margin-top: var(--s4);
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ash);
}
.deck__ctrl {
  display: flex;
  gap: var(--s2);
}
.deck__ctrl button {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  color: var(--ash);
  transition: color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.deck__ctrl button:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.deck__ctrl svg {
  width: 0.9rem;
  height: 0.9rem;
}
/* 44px minimum touch target below tablet width */
@media (max-width: 50rem) {
  .deck__ctrl button {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* Cursor trail. Dots lag progressively; index 0 is closest to the pointer. */
.trail {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 41;
  pointer-events: none;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: translate3d(calc(var(--tx, 0px) - 50%), calc(var(--ty, 0px) - 50%), 0)
    scale(var(--ts, 1));
  transition: opacity 400ms var(--ease-out);
  will-change: transform;
}
.trail[data-on="true"] {
  opacity: var(--to, 0.5);
}

/* click ripple: one ring, 600ms */
.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent) 40%, transparent) 0%,
    transparent 70%
  );
  animation: ripple 600ms var(--ease-out) forwards;
}
@keyframes ripple {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* hero layers drift at different rates; 8-34px, small on purpose */
.hero__rail {
  transform: translate3d(0, calc(var(--sy, 0) * 34px), 0);
}
.hero .eyebrow {
  display: block;
  transform: translate3d(0, calc(var(--sy, 0) * 30px), 0);
}
.hero .display {
  transform: translate3d(0, calc(var(--sy, 0) * 8px), 0);
}
.hero__lede {
  transform: translate3d(0, calc(var(--sy, 0) * 18px), 0);
}
.hero .actions {
  transform: translate3d(0, calc(var(--sy, 0) * 26px), 0);
}
.hero__meta {
  transform: translate3d(0, calc(var(--sy, 0) * 32px), 0);
}

.ledger {
  transform: translate3d(0, calc(var(--sy, 0) * -10px), 0);
}

@media (prefers-reduced-motion: reduce) {
  .field,
  .glow,
  .glow__core,
  .trail,
  .peek,
  .ripple,
  .tilt::after {
    display: none;
  }
  .tilt {
    transform: none;
  }
  .line-mask {
    overflow: visible;
  }
  .hero__grid,
  .hero__rail,
  .hero .eyebrow,
  .hero .display,
  .hero__lede,
  .hero .actions,
  .hero__meta,
  .ledger,
  .btn,
  .case:hover .case__shot img {
    transform: none;
  }
  .case__shot img {
    transform: scale(1.02);
  }
  /* .prog stays: it is information, not motion */
}

/* motion */
/* content is visible without JS */
.reveal {
  opacity: 1;
}
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--dur-slow) var(--ease-out),
      transform var(--dur-slow) var(--ease-out);
  }
  html.js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* print */
@media print {
  .hdr,
  .tgl,
  .actions,
  #demo,
  .skip {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  .section {
    padding-block: 1.5rem;
    break-inside: avoid;
  }
  .case {
    break-inside: avoid;
  }
  .metric {
    color: #000;
  }
  a::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #555;
  }
}
