/* ==========================================================================
   Tokenwised — styles
   1. Fonts & tokens   2. Base   3. Components   4. Header   5. Hero / lab
   6. Sections         7. Footer  8. Motion & preference overrides
   ========================================================================== */

/* 1. Fonts & tokens ------------------------------------------------------ */
@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-latin-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("../assets/fonts/martian-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
/* If the local fonts ever fail, Arial Bold is scaled to the width of condensed
   Archivo, so headings keep their line breaks. */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold");
  font-weight: 100 900;
  size-adjust: 76%;
}

:root {
  /* Brand palette */
  --bg: #141212;
  --surface: #211d1d;
  --text: #f5f2ec;
  --muted: #bdb6b2;
  --accent: #ff784f;

  /* Auxiliary tones */
  --surface-2: #2a2524;
  --stone-700: #3a3433;
  --stone-500: #6b625e;
  --line: rgba(245, 242, 236, .16);
  --line-strong: #80776f;   /* 3:1+ against --bg, for control boundaries */

  /* Type */
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Archivo", "Archivo Fallback", "Arial Narrow", Arial, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --gutter: clamp(16px, 2.8vw, 40px);
  --page-max: 1800px;
  --header-h: 64px;
  --notch: 4px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* 2. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--bg); }
.contact ::selection { background: var(--bg); color: var(--text); }
button { font: inherit; color: inherit; }

:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.contact :focus-visible { outline-color: var(--bg); }
main:focus-visible { outline: none; }

html:not(.js) [data-needs-js] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px; left: 8px;
  padding: 12px 18px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.5;
  letter-spacing: .06em;
  color: var(--accent);
}

.display {
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 760;
  font-size: clamp(2.75rem, 8.2vw, 8.25rem);
  line-height: .94;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.display--md { font-size: clamp(2.5rem, 5.6vw, 5.5rem); }

/* 3. Components ---------------------------------------------------------- */
/* Buttons borrow the logotype's single-pixel corner notch. The shape lives on
   ::before so that clip-path never eats the focus ring. */
.btn {
  --btn-bg: var(--accent);
  --btn-fg: var(--bg);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 52px;
  padding: 10px 24px;
  border: 1px solid transparent; /* visible in forced-colors mode */
  background: none;
  color: var(--btn-fg);
  font-family: var(--font);
  font-stretch: 88%;
  font-weight: 650;
  font-size: 1.0625rem;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1px;
  background: var(--btn-bg);
  transition: background-color .18s linear;
  clip-path: polygon(
    var(--notch) 0, calc(100% - var(--notch)) 0,
    calc(100% - var(--notch)) var(--notch), 100% var(--notch),
    100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)),
    calc(100% - var(--notch)) 100%, var(--notch) 100%,
    var(--notch) calc(100% - var(--notch)), 0 calc(100% - var(--notch)),
    0 var(--notch), var(--notch) var(--notch));
}
.btn:active { transform: translateY(1px); }
.btn--small { min-height: 44px; padding: 8px 18px; font-size: 1rem; }


.btn--ghost { --btn-bg: var(--surface); --btn-fg: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--ghost::before { display: none; }

.btn--dark { --btn-bg: var(--bg); --btn-fg: var(--text); }
.btn--dark-ghost { --btn-fg: var(--bg); box-shadow: inset 0 0 0 2px var(--bg); }
.btn--dark-ghost::before { display: none; }

.px-arrow { width: 1.05em; height: .79em; fill: currentColor; flex: none; }

.tag {
  display: inline-block;
  padding: 7px 10px 6px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: .6875rem;
  line-height: 1.4;
  letter-spacing: .02em;
  color: var(--text);
}

/* 4. Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 12px clamp(16px, 3vw, 40px);
  min-height: var(--header-h);
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.site-header__logo { display: flex; align-items: center; flex: none; min-height: 44px; margin-right: auto; }
/* The official PNG carries transparent padding; a negative margin lines the
   glyphs up with the grid without touching the asset. */
.site-header__logo img { width: clamp(132px, 13vw, 176px); margin-left: calc(clamp(132px, 13vw, 176px) * -.0234); }

.site-nav ul { display: flex; gap: clamp(4px, 1.6vw, 22px); }
.site-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 8px;
  font-stretch: 92%;
  font-weight: 550;
  font-size: 1rem;
  text-decoration: none;
  color: var(--text);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px; bottom: 8px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .22s var(--ease);
}

.nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: none;
  font-weight: 600;
  font-size: .9375rem;
  font-stretch: 92%;
  cursor: pointer;
}
.nav-toggle[aria-expanded="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

@media (max-width: 760px) {
  :root { --header-h: 60px; }
  .site-header__inner { flex-wrap: wrap; gap: 8px; }
  html.js .site-header__inner { flex-wrap: nowrap; }
  .site-header__logo img { width: clamp(104px, 31vw, 118px); margin-left: -2.6px; }
  .site-header__cta { padding-inline: 12px; }

  /* Without JS the links simply sit on their own row */
  html:not(.js) .site-nav { order: 3; width: 100%; }
  html:not(.js) .site-nav ul { flex-wrap: wrap; }

  html.js .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  html.js .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    padding: 8px var(--gutter) 20px;
    background: var(--bg);
    border-block: 1px solid var(--line-strong);
  }
  html.js .site-nav.is-open { display: block; }
  html.js .site-nav ul { display: block; }
  html.js .site-nav li + li { border-top: 1px solid var(--line); }
  html.js .site-nav a {
    min-height: 60px;
    padding-inline: 0;
    font-family: var(--font-display);
    font-stretch: 72%;
    font-weight: 700;
    font-size: 2rem;
  }
  html.js .site-nav a::after { display: none; }
}

/* 5. Hero / lab ---------------------------------------------------------- */
.hero { border-bottom: 1px solid var(--line); }

.hero__head {
  max-width: var(--page-max);
  margin-inline: auto;
  padding: clamp(14px, 2vw, 26px) var(--gutter) clamp(10px, 1.3vw, 18px);
}

/* The H1 runs edge to edge: size is derived from the available width, and the
   two spans can wrap if a fallback font is wider. */
.hero__title {
  --fit: 8.26;
  margin-top: clamp(4px, .6vw, 10px);
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 780;
  font-size: calc((min(100vw, var(--page-max)) - 2 * var(--gutter)) / var(--fit));
  line-height: .9;
  letter-spacing: -.018em;
}
.hero__title span { display: inline-block; }
@media (max-width: 380px) {
  .hero__head .eyebrow { font-size: .6875rem; letter-spacing: .02em; }
}
.hero__title-accent { color: var(--accent); }

.lab {
  /* The stage width also respects the viewport height, so the whole desk
     stays on screen on short laptops. */
  --stage-w: clamp(400px, calc((100svh - var(--header-h) - min(12.2vw, 220px) - 136px) * 4 / 3), min(47vw, 846px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--stage-w)) minmax(0, 1fr);
  max-width: var(--page-max);
  margin-inline: auto;
  border-top: 1px solid var(--line);
}

.lab__input {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(16px, 1.8vw, 28px) clamp(16px, 1.8vw, 28px) clamp(16px, 1.8vw, 28px) var(--gutter);
}
.hero__lede {
  font-size: clamp(1.125rem, 1.45vw, 1.375rem);
  line-height: 1.3;
  font-weight: 450;
  color: var(--text);
  max-width: 26em;
}
.choices-label {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.5;
  color: var(--muted);
}
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  background: var(--line-strong);
}
.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: clamp(76px, 7.6vw, 104px);
  padding: 11px 12px 10px;
  border: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-stretch: 80%;
  font-weight: 650;
  font-size: clamp(1.125rem, 1.5vw, 1.4375rem);
  line-height: 1.04;
  text-align: left;
  cursor: pointer;
  transition: background-color .16s linear, color .16s linear;
}
.choice:focus-visible { z-index: 1; outline-offset: -5px; outline-color: var(--text); }
.choice[aria-pressed="true"]:focus-visible { outline-color: var(--bg); }
.choice__mark {
  width: 11px; height: 11px;
  box-shadow: inset 0 0 0 2px var(--muted);
  transition: background-color .16s linear;
}
.choice[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.choice[aria-pressed="true"] .choice__mark { background: var(--bg); box-shadow: none; }

.lab__talk { align-self: flex-start; margin-top: auto; }

.lab__stage {
  display: flex;
  flex-direction: column;
  border-inline: 1px solid var(--line);
}

.stage {
  --cols: 32;
  --rows: 24;
  position: relative;
  container-type: inline-size;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #1a1717;
  background-image:
    linear-gradient(to right, rgba(245, 242, 236, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245, 242, 236, .035) 1px, transparent 1px);
  background-size: calc(100% / var(--cols)) calc(100% / var(--rows));
}
.stage__modules, .stage__labels { position: absolute; inset: 0; }
.stage__labels { z-index: 3; }

/* A module is one grid cell, positioned and stretched only through transform:
   the layout tables in main.js just change --x --y --w --h. */
.m {
  --x: 0; --y: 0; --w: 1; --h: 1;
  position: absolute;
  top: 0; left: 0;
  display: block;
  width: calc(100% / var(--cols));
  height: calc(100% / var(--rows));
  background: var(--m-c, var(--stone-700));
  transform-origin: 0 0;
  transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%)) scale(var(--w), var(--h));
  transition:
    transform var(--dur, .85s) var(--ease) var(--delay, 0ms),
    background-color .45s linear var(--delay, 0ms),
    opacity .3s linear var(--delay, 0ms);
}
.m[data-c="o"] { --m-c: var(--accent); }
.m[data-c="c"] { --m-c: var(--text); }
.m[data-c="s"] { --m-c: var(--muted); }
.m[data-c="m"] { --m-c: var(--stone-500); }
.m[data-c="g"] { --m-c: var(--stone-700); }
.m[data-c="d"] { --m-c: var(--surface-2); }
.m[data-c="k"] { --m-c: var(--bg); }
.m.is-off { opacity: 0; }
.m:first-child { z-index: 2; }   /* the orange "idea" always sits on top */
.lab[data-state="idle"] .m:first-child { animation: idea-wait 1.5s steps(1) .9s 3; }
.stage.no-anim .m { transition: none; }
@keyframes idea-wait { 50% { opacity: .3; } }

.stage-label {
  position: absolute;
  left: calc(var(--lx) / 32 * 100%);
  top: calc(var(--ly) / 24 * 100%);
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: clamp(10px, 2.15cqw, 14px);
  line-height: 1.2;
  letter-spacing: -.01em;
  white-space: nowrap;
  color: var(--text);
  opacity: 0;
  transition: opacity .32s linear;
}
.stage__labels.is-on .stage-label { opacity: 1; }
.stage-label--dark { color: var(--bg); }
.stage-label--muted { color: var(--muted); }
.stage-label--accent { color: var(--accent); }
.stage-label--big {
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 760;
  font-size: clamp(18px, 5cqw, 40px);
  letter-spacing: 0;
  line-height: 1;
}
.stage-label--center { transform: translate(-50%, -50%); text-align: center; }
.stage-label--end { transform: translate(-100%, -50%); }

.stage__flash {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7%;
  display: flex;
  width: fit-content;
  margin-inline: auto;
  align-items: center;
  gap: .4em;
  padding: .32em .6em;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 720;
  font-size: clamp(20px, 5.4cqw, 44px);
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  z-index: 4;
  transition: opacity .2s linear;
}
.stage__flash.is-on { opacity: 1; }
.stage__flash .px-arrow { color: var(--accent); }

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 8px 8px 8px 14px;
  background: var(--surface);
}
.stage-bar__note {
  font-family: var(--font-mono);
  font-size: .6875rem;
  line-height: 1.35;
  color: var(--muted);
}
.stage-bar__action { flex: none; }
.stage-bar__action[hidden] { display: none; }

/* All panels share one grid cell: the tallest sets the height, so changing
   intention never moves the page. */
.lab__output {
  display: grid;
  padding: clamp(16px, 1.8vw, 28px) var(--gutter) clamp(16px, 1.8vw, 28px) clamp(16px, 1.8vw, 28px);
}
.panel {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  visibility: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .32s linear, transform .4s var(--ease), visibility 0s linear .32s;
}
.panel.is-active {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity .32s linear, transform .4s var(--ease), visibility 0s;
}
.panel__label {
  font-family: var(--font-mono);
  font-size: .6875rem;
  line-height: 1.5;
  letter-spacing: .04em;
  color: var(--accent);
}
.panel__title {
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 740;
  font-size: clamp(2.125rem, 3.45vw, 3.75rem);
  line-height: .96;
  letter-spacing: -.008em;
  text-wrap: balance;
}
.panel__text { font-size: 1.0625rem; line-height: 1.4; color: var(--muted); }
.panel .btn { margin-top: auto; }

.panel--idle { justify-content: flex-end; overflow: hidden; }
.signature {
  font-family: var(--font-display);
  font-stretch: 62%;
  font-weight: 800;
  font-size: clamp(4rem, 7.1vw, 7.75rem);
  line-height: .86;
  letter-spacing: -.005em;
  color: var(--stone-700);
}
.signature span { display: block; white-space: nowrap; }

@media (max-width: 1099px) {
  .lab { --stage-w: clamp(380px, calc((100svh - var(--header-h) - 12.2vw - 136px) * 4 / 3), 43vw); }
  .choice { padding-inline: 9px; }
}

@media (max-width: 959px) {
  .lab {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas: "input input" "stage output";
  }
  .lab__input {
    grid-area: input;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 16px 24px;
    padding-inline: var(--gutter);
    border-bottom: 1px solid var(--line);
  }
  .hero__lede { max-width: 30em; }
  .lab__talk { margin-top: 0; grid-column: 2; grid-row: 1; }
  .choices-wrap { grid-column: 1 / -1; }
  .choices { grid-template-columns: repeat(4, 1fr); }
  .lab__stage { grid-area: stage; border-left: 0; }
  .lab__output { grid-area: output; }
  .signature { font-size: clamp(3.6rem, 11vw, 6rem); }
  .panel__title { font-size: clamp(1.875rem, 4.2vw, 2.75rem); }
}

@media (max-width: 760px) {
  .hero__head { padding-top: 14px; }
  .hero__title { --fit: 5.02; line-height: .88; letter-spacing: -.012em; }
  .hero__title span { display: block; }
  .lab { display: block; }
  .lab__input { display: flex; gap: 16px; }
  .lab__talk { align-self: stretch; }
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice { min-height: 74px; }
  .lab__stage { border-inline: 0; }
  .lab__output { padding: 20px var(--gutter) 28px; }
  .panel__title { font-size: clamp(2.25rem, 10.5vw, 3rem); }
  .panel .btn { align-self: stretch; margin-top: 4px; }
  .signature { font-size: clamp(4.4rem, 24vw, 8rem); }
}

/* 6. Sections ------------------------------------------------------------ */
.section { padding-block: clamp(64px, 9vw, 150px); }

.section-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px clamp(16px, 2vw, 32px);
}
.section-head .eyebrow { grid-column: 1 / -1; }
.section-head .display { grid-column: 1 / span 10; }
.section-head__intro {
  grid-column: 7 / span 5;
  margin-top: clamp(10px, 1.6vw, 28px);
  font-size: clamp(1.125rem, 1.5vw, 1.375rem);
  line-height: 1.36;
  color: var(--muted);
}

/* Expertise: an editorial index, not a card grid */
.skills { margin-top: clamp(40px, 6vw, 96px); border-bottom: 1px solid var(--line-strong); }
.skill {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px clamp(16px, 2vw, 32px);
  padding-block: clamp(20px, 2.6vw, 40px);
  border-top: 1px solid var(--line-strong);
  transition: background-color .2s linear;
}
.skill__num {
  grid-column: 1 / span 1;
  padding-top: .5em;
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--accent);
}
.skill__title {
  grid-column: 2 / span 5;
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 700;
  font-size: clamp(2.25rem, 4.4vw, 4.5rem);
  line-height: .98;
  letter-spacing: -.008em;
  text-wrap: balance;
  transition: transform .3s var(--ease);
}
.skill__body { grid-column: 7 / span 6; display: grid; gap: 14px; align-content: start; padding-top: .35em; }
.skill__body > p:first-child { max-width: 34em; font-size: clamp(1.0625rem, 1.3vw, 1.25rem); line-height: 1.36; }
.skill__apps { color: var(--muted); font-size: 1rem; line-height: 1.4; }
.skill__apps span {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: .6875rem;
  line-height: 1.5;
  letter-spacing: .02em;
  color: var(--muted);
}
.skills__note {
  position: relative;
  max-width: 44rem;
  margin: clamp(24px, 3vw, 44px) 0 0 auto;
  padding-left: 28px;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-stretch: 88%;
  font-weight: 600;
  line-height: 1.2;
}
.skills__note::before {
  content: "";
  position: absolute;
  left: 0; top: .28em;
  width: 14px; height: 14px;
  background: var(--accent);
}

/* Work */
.work { padding-top: 0; }
.projects {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 80px) clamp(16px, 2vw, 32px);
  margin-top: clamp(40px, 6vw, 96px);
}
.project { display: flex; flex-direction: column; min-width: 0; }
.project--gg { grid-column: 1 / -1; }
.project--sim { grid-column: 1 / span 7; }
.project--slime { grid-column: 9 / -1; margin-top: clamp(0px, 10vw, 180px); }

.cover {
  position: relative;
  overflow: hidden;
  background: var(--surface);
}
.cover img { width: 100%; }
.cover__cat {
  position: absolute;
  top: clamp(12px, 1.6vw, 24px);
  left: clamp(12px, 1.8vw, 28px);
  right: clamp(12px, 1.8vw, 28px);
  font-family: var(--font-mono);
  font-size: .6875rem;
  line-height: 1.5;
  color: var(--text);
}
.cover__name {
  position: absolute;
  left: clamp(12px, 1.8vw, 28px);
  right: clamp(12px, 1.8vw, 28px);
  bottom: clamp(2px, .5vw, 8px);
  font-family: var(--font-display);
  font-stretch: 66%;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.008em;
  color: var(--text);
}
.project--sim .cover__cat, .project--sim .cover__name { color: var(--bg); }
.project--slime .cover__name { color: var(--bg); } /* sits on the lava */
.project--gg .cover__name { font-size: clamp(4.5rem, 15vw, 16rem); }
.project--sim .cover__name { font-size: clamp(3.5rem, 8.6vw, 9rem); }
.project--slime .cover__name { font-size: clamp(3.25rem, 5.6vw, 6rem); }

.project__info {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding-top: clamp(14px, 1.5vw, 22px);
}
.project__desc { font-size: clamp(1.125rem, 1.45vw, 1.3125rem); line-height: 1.32; max-width: 34em; }
.project__role { color: var(--muted); max-width: 36em; }
.project__link {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  min-height: 44px;
  font-stretch: 88%;
  font-weight: 650;
  font-size: clamp(1.0625rem, 1.2vw, 1.1875rem);
  line-height: 1.15;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .22em;
}
.px-arrow--out { width: .72em; height: .72em; transition: transform .22s var(--ease); }
.project--gg .project__info {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
}
.project--gg .project__desc { grid-column: 1 / span 6; }
.project--gg .project__role { grid-column: 7 / span 4; }
.project--gg .project__link { grid-column: 7 / span 4; }
.project--gg .tag { grid-column: 11 / -1; justify-self: end; align-self: start; }

.work-close {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
  margin-top: clamp(56px, 7vw, 120px);
  padding-top: clamp(20px, 2vw, 32px);
  border-top: 1px solid var(--line-strong);
}
.work-close__q {
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 700;
  font-size: clamp(2.25rem, 4.4vw, 4.5rem);
  line-height: 1;
  letter-spacing: -.008em;
}
.link-big {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  min-height: 44px;
  font-stretch: 88%;
  font-weight: 650;
  font-size: clamp(1.125rem, 1.7vw, 1.5rem);
  line-height: 1.15;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .22em;
}
.link-big .px-arrow { transition: transform .22s var(--ease); }

/* Approach: steps climb, echoing the stepped cut of the logotype */
.approach { padding-bottom: 0; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  margin-top: clamp(32px, 4vw, 64px);
}
.step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(18px, 2vw, 32px) clamp(16px, 2vw, 32px) clamp(28px, 3vw, 48px);
  background: var(--surface);
  border-top: 4px solid var(--accent);
}
.step:nth-child(1) { min-height: clamp(250px, 22vw, 360px); }
.step:nth-child(2) { min-height: clamp(320px, 28vw, 460px); background: var(--surface-2); }
.step:nth-child(3) { min-height: clamp(390px, 34vw, 560px); background: var(--stone-700); }
.step__num { font-family: var(--font-mono); font-size: .8125rem; color: var(--accent); }
.step:nth-child(3) .step__num { color: var(--text); }
.step__title {
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 720;
  font-size: clamp(2.25rem, 4vw, 4.25rem);
  line-height: 1;
  letter-spacing: -.008em;
}
.step p { max-width: 26em; }

/* The name */
.tokens { border-top: 1px solid var(--line); }
.tokens__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 48px) clamp(16px, 2vw, 32px);
}
.tokens__text { grid-column: 1 / span 7; display: grid; gap: 16px; justify-items: start; }
.tokens__body { max-width: 38em; font-size: clamp(1.0625rem, 1.3vw, 1.25rem); line-height: 1.42; color: var(--muted); }
.tokens__close { font-size: clamp(1.125rem, 1.5vw, 1.375rem); font-weight: 600; font-stretch: 90%; line-height: 1.3; }
.tokens .token-fig:nth-of-type(1) { grid-column: 8 / span 5; grid-row: 1; align-self: start; }
.tokens .token-fig:nth-of-type(2) { grid-column: 8 / span 5; grid-row: 1; align-self: end; }
.token-fig figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: .6875rem;
  line-height: 1.5;
  color: var(--muted);
}
.segments { display: flex; flex-wrap: wrap; gap: 3px; }
.segments span {
  padding: 9px 7px;
  background: var(--surface);
  box-shadow: inset 0 -3px 0 var(--stone-500);
  font-family: var(--font-mono);
  font-size: .8125rem;
  line-height: 1.2;
  white-space: pre;
}
.segments span:nth-child(3n+2) { box-shadow: inset 0 -3px 0 var(--accent); }
.units { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; max-width: 440px; }
.units span {
  display: flex;
  align-items: flex-end;
  aspect-ratio: 5 / 4;
  padding: 7px;
  background: var(--surface-2);
  border: 1px solid var(--stone-500);
  font-family: var(--font-mono);
  font-size: clamp(.5625rem, .78vw, .6875rem);
  line-height: 1.2;
}

/* Contact: the page's one full-colour moment, entered through a stepped edge */
.contact {
  position: relative;
  margin-top: clamp(24px, 4vw, 64px);
  padding-top: calc(clamp(24px, 3.6vw, 56px) + clamp(28px, 4vw, 64px));
  padding-bottom: clamp(40px, 5vw, 80px);
  background: var(--accent);
  color: var(--bg);
  --s: clamp(12px, 1.8vw, 28px);
  clip-path: polygon(
    0 calc(var(--s) * 2), 25% calc(var(--s) * 2), 25% var(--s), 62.5% var(--s), 62.5% 0, 100% 0,
    100% 100%, 0 100%);
}
.contact .eyebrow { color: var(--bg); }
.contact__title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-stretch: 66%;
  font-weight: 800;
  font-size: clamp(3.75rem, 14.2vw, 16.5rem);
  line-height: .86;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.contact__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28px clamp(16px, 2vw, 32px);
  margin-top: clamp(28px, 4vw, 64px);
}
.contact__copy { grid-column: 1 / span 5; display: grid; gap: 14px; align-content: start; }
.contact__lede { font-size: clamp(1.1875rem, 1.7vw, 1.5rem); font-weight: 500; line-height: 1.3; }
.contact__help { font-size: 1.0625rem; line-height: 1.42; font-weight: 450; }
.contact__action { grid-column: 7 / -1; min-width: 0; }
.contact__email {
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 720;
  font-size: clamp(2rem, 5.1vw, 5.6rem);
  line-height: 1;
  letter-spacing: -.008em;
  user-select: all;
  -webkit-user-select: all;
}
.contact__buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.contact__status { min-height: 1.5em; margin-top: 10px; font-weight: 600; }

.intent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 18px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bg);
  font-weight: 500;
}
.intent[hidden] { display: none; }
.intent strong { font-weight: 750; }
.link-btn {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

/* 7. Footer -------------------------------------------------------------- */
.site-footer { padding-block: clamp(28px, 3vw, 48px); background: var(--bg); }
.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px clamp(16px, 2vw, 32px);
  align-items: end;
  font-size: .9375rem;
  color: var(--muted);
}
.site-footer__logo { grid-column: 1 / span 3; display: flex; align-items: center; justify-self: start; width: min(100%, 200px); min-height: 44px; align-self: center; }
.site-footer__logo img { width: 100%; transform: translateX(-2.34%); }
.site-footer__meta { grid-column: 7 / span 3; }
.site-footer__end { grid-column: 10 / -1; justify-self: end; text-align: right; }
.site-footer__end a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  text-underline-offset: .2em;
}

@media (max-width: 860px) {
  .section-head .display { grid-column: 1 / -1; }
  .section-head__intro { grid-column: 1 / -1; }
  .skill__num { grid-column: 1 / -1; padding-top: 0; }
  .skill__title, .skill__body { grid-column: 1 / -1; }
  .skills__note { margin-left: 0; }
  .project--gg, .project--sim, .project--slime { grid-column: 1 / -1; margin-top: 0; }
  .project--gg .cover img { aspect-ratio: 4 / 3; object-fit: cover; object-position: 100% 50%; }
  .project--gg .project__info { display: grid; grid-template-columns: minmax(0, 1fr); }
  .project--gg .project__desc, .project--gg .project__role, .project--gg .project__link, .project--gg .tag { grid-column: 1; justify-self: start; }
  .steps { grid-template-columns: minmax(0, 1fr); margin-inline: calc(var(--gutter) * -1); }
  .step, .step:nth-child(n) { min-height: 0; }
  .step:nth-child(2) { margin-left: 8%; }
  .step:nth-child(3) { margin-left: 16%; }
  .tokens__text { grid-column: 1 / -1; }
  .tokens .token-fig:nth-of-type(n) { grid-column: 1 / -1; grid-row: auto; }
  .units span { font-size: .6875rem; }
  .contact__copy, .contact__action { grid-column: 1 / -1; }
  .contact__email { font-size: clamp(2rem, 11vw, 4.5rem); }
  .site-footer__logo, .site-footer__meta { grid-column: 1 / -1; }
  .site-footer__end { grid-column: 1 / -1; justify-self: start; text-align: left; }
}

/* 8. Motion & preference overrides --------------------------------------- */
@media (hover: hover) {
  .btn--primary:hover { --btn-bg: var(--text); }
  .btn--ghost:hover { background: var(--text); color: var(--bg); box-shadow: none; }
  .btn--dark:hover { --btn-bg: var(--surface-2); }
  .btn--dark-ghost:hover { background: var(--bg); color: var(--text); }
  .choice:not([aria-pressed="true"]):hover { background: var(--surface-2); }
  .choice:not([aria-pressed="true"]):hover .choice__mark { box-shadow: inset 0 0 0 2px var(--accent); }
  .site-nav a:hover::after { transform: scaleX(1); }
  .skill:hover .skill__title { transform: translateX(10px); }
  .link-big:hover .px-arrow { transform: translateX(6px); }
  .project__link:hover .px-arrow--out { transform: translate(3px, -3px); }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}
@media (forced-colors: active) {
  .m { forced-color-adjust: none; }
  .choice[aria-pressed="true"] { outline: 3px solid Highlight; outline-offset: -3px; }
}
@media print {
  .site-header { position: static; }
  .stage-bar, .choices-wrap { display: none; }
}
