@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/manrope-latin.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("assets/fonts/dm-mono-300-latin.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/dm-mono-400-latin.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/dm-mono-500-latin.woff2") format("woff2");
}

:root {
  --bg: #09090a;
  --bg-raised: #111113;
  --bg-card: #141416;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f4f2ec;
  --text-2: rgba(244, 242, 236, 0.7);
  --text-3: rgba(244, 242, 236, 0.5);

  --paper: #f2f0e9;
  --sand: #e3d5c1;
  --ink: #121213;
  --ink-2: #45433e;
  --ink-3: #6c6860;
  --line-ink: rgba(18, 18, 19, 0.14);

  --accent: #ff7a4d;
  --accent-soft: #ffc2a9;
  --accent-ink: #b8431d;
  --ok: #8fe08e;
  --cyan: #7fd6d9;

  /* Each project brings its own accent, used sparingly (status badge, small
     rules, link underlines, media frames, focus). Headings, buttons and the nav
     keep the portfolio's peach. --project-accent is for dark surfaces,
     --project-ink for light ones (both pass WCAG AA as text). */
  --project-accent: var(--accent-soft);
  --project-ink: var(--accent-ink);
  --project-line: rgba(255, 194, 169, 0.32);
  --project-surface: #0d0d0f;

  --shell: min(1320px, calc(100vw - 72px));
  --header-h: 76px;
  --font-sans: "Manrope", "Segoe UI", Arial, sans-serif;
  --font-mono: "DM Mono", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  /* Motion tokens: everything animates transform, opacity, filter or
     clip-path only, between 150 and 700 ms. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur: 420ms;
  --dur-slow: 650ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  scrollbar-color: var(--accent-soft) var(--bg);
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

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

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

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

code {
  font-family: var(--font-mono);
}

:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 4px;
  border-radius: 4px;
}

.section-light :focus-visible,
.section-sand :focus-visible {
  outline-color: var(--accent-ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--accent-soft);
  border-radius: 8px;
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.scroll-progress {
  position: fixed;
  z-index: 200;
  inset: 0 0 auto;
  height: 2px;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
}

.site-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(9, 9, 10, 0.94);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transition: opacity 240ms ease;
}

.site-header.is-scrolled::before {
  opacity: 1;
}

/* With the menu open the panel's own background shows through the bar. */
body.menu-open .site-header::before {
  opacity: 0;
}

.site-header-inner {
  width: var(--shell);
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  margin-inline: auto;
}

.brand {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--ink);
  background: var(--accent-soft);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  position: relative;
  padding: 8px 12px;
  color: var(--text-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    color 180ms ease,
    background 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.site-nav a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.language-switch {
  position: relative;
  isolation: isolate;
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.language-switch button {
  width: 36px;
  height: 28px;
  padding: 0;
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition:
    color 180ms ease,
    background 180ms ease;
}

.language-switch button:hover {
  color: var(--text);
}

.language-switch button[aria-pressed="true"] {
  color: var(--ink);
}

/* The light thumb slides under the selected language. */
.language-switch::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 3px;
  left: 3px;
  width: 36px;
  height: 28px;
  background: var(--text);
  border-radius: 999px;
  transition: transform 320ms var(--ease-out);
}

.language-switch:has([data-lang="en"][aria-pressed="true"])::before {
  transform: translateX(36px);
}

.header-cv {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--accent-soft);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.header-cv:hover,
.header-cv:focus-visible {
  background: #ffd5c3;
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  transition:
    transform 200ms var(--ease),
    background 200ms ease,
    border-color 200ms ease,
    color 200ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--ink);
  background: var(--accent-soft);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #ffd5c3;
}

.button-ghost {
  color: var(--text);
  border-color: var(--line-strong);
}

.button-ghost:hover,
.button-ghost:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.36);
}

.button-large {
  min-height: 58px;
  padding-inline: 28px;
}

.button [aria-hidden="true"] {
  transition: transform 200ms var(--ease);
}

.button:hover .arrow-down {
  transform: translateY(2px);
}

.button:hover .arrow-out {
  transform: translate(2px, -2px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding-bottom: 3px;
  border-bottom: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--accent-soft);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: calc(var(--header-h) + 36px);
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  /* Rasterised once on its own layer; nothing inside it repaints. */
  will-change: transform;
  background:
    radial-gradient(
      60% 60% at 80% 30%,
      rgba(255, 194, 169, 0.07),
      transparent 70%
    ),
    radial-gradient(
      50% 50% at 0% 100%,
      rgba(127, 214, 217, 0.05),
      transparent 70%
    );
}

/* The soft light that follows the pointer: a fixed-size layer moved with
   transform by script.js, so following the pointer never repaints. */
.hero-bg::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1040px;
  height: 1040px;
  margin: -520px 0 0 -520px;
  background: radial-gradient(
    circle closest-side,
    rgba(255, 122, 77, 0.13),
    transparent 100%
  );
  transform: translate3d(var(--gx, 72vw), var(--gy, 36vh), 0);
  transition: transform var(--dur-slow) var(--ease-out);
  will-change: transform;
}

.project-hero .hero-bg::after {
  display: none;
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(
    ellipse 70% 65% at 62% 38%,
    #000 10%,
    transparent 72%
  );
  mask-image: radial-gradient(
    ellipse 70% 65% at 62% 38%,
    #000 10%,
    transparent 72%
  );
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 40px 48px;
  align-items: center;
}

.hero-role {
  margin-bottom: 16px;
  color: var(--accent-soft);
}

.hero-name {
  margin: 0 0 30px;
  font-size: clamp(60px, 8vw, 128px);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.065em;
}

.hero-name span {
  display: block;
  padding-bottom: 0.04em;
  background: linear-gradient(180deg, #fffdf8 35%, rgba(244, 242, 236, 0.62));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hero-name span:last-child {
  background: linear-gradient(
    100deg,
    var(--accent-soft) 10%,
    var(--accent) 55%,
    #ff9d6e 90%
  );
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-lead {
  max-width: 37ch;
  margin-bottom: 16px;
  font-size: clamp(20px, 1.75vw, 26px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.025em;
}

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

.hero-sub {
  max-width: 58ch;
  margin-bottom: 30px;
  color: var(--text-2);
  font-size: 16px;
}

.hero-actions,
.contact-actions,
.project-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Abstract layer stack: interface → api → cms → data, with a trace that
   travels down until it lights up the root cause on the bottom layer. */

.hero-visual {
  /* The SVG's own animations re-lay out only inside this box. */
  contain: layout paint;
  --pulse-start: 1.3s;
  --pulse-cycle: 3.6s;
  margin-right: -2vw;
}

.stack {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  transform: perspective(1600px) rotateX(calc(var(--ty, 0) * 3deg))
    rotateY(calc(var(--tx, 0) * -4deg));
  transition: transform var(--dur-slow) var(--ease-out);
}

.stack * {
  vector-effect: non-scaling-stroke;
}

.stack .plane {
  fill: url(#plane-fill);
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1;
}

.stack .layer-1 .plane {
  fill: url(#plane-top);
  stroke: rgba(255, 194, 169, 0.7);
}

.stack .ui {
  fill: rgba(255, 194, 169, 0.05);
  stroke: rgba(255, 194, 169, 0.42);
  stroke-width: 1;
}

.stack .ui-hot {
  fill: rgba(255, 194, 169, 0.1);
  stroke: rgba(255, 194, 169, 0.85);
}

.stack .ui-solid {
  fill: rgba(255, 194, 169, 0.42);
  stroke: none;
}

.stack .edge {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1;
}

.stack .node {
  fill: var(--bg);
  stroke: rgba(127, 214, 217, 0.75);
  stroke-width: 1.2;
}

.stack .node-hot {
  fill: rgba(127, 214, 217, 0.55);
  stroke: var(--cyan);
}

.stack .code {
  fill: rgba(255, 255, 255, 0.13);
}

.stack .code-hot {
  fill: rgba(255, 194, 169, 0.55);
}

.stack .cell {
  fill: rgba(255, 255, 255, 0.055);
}

.stack .cell-hot {
  fill: rgba(255, 122, 77, 0.4);
  animation: cell-hot var(--pulse-cycle) ease-out infinite;
  animation-delay: calc(var(--pulse-start) + 2.08s);
}

.stack .beam {
  stroke: url(#beam-fill);
  stroke-width: 1.5;
  animation: fade-in 900ms var(--ease) 1s backwards;
}

.stack .beam-pulse {
  stroke: #ffe4d8;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 70 1200;
  stroke-dashoffset: 70;
  animation: beam-pulse var(--pulse-cycle) linear infinite;
  animation-delay: var(--pulse-start);
}

.stack .pierce {
  fill: var(--accent-soft);
  transform-box: fill-box;
  transform-origin: center;
  animation: pierce var(--pulse-cycle) linear infinite;
}

.stack .p1 { animation-delay: calc(var(--pulse-start) + 0.6s); }
.stack .p2 { animation-delay: calc(var(--pulse-start) + 1.1s); }
.stack .p3 { animation-delay: calc(var(--pulse-start) + 1.59s); }
.stack .p4 { animation-delay: calc(var(--pulse-start) + 2.08s); }

.stack .hit-glow {
  opacity: 0.45;
  animation: hit-glow var(--pulse-cycle) ease-out infinite;
  animation-delay: calc(var(--pulse-start) + 2.08s);
}

.stack .hit-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: hit-ring var(--pulse-cycle) ease-out infinite;
  animation-delay: calc(var(--pulse-start) + 2.08s);
}

.stack .hit-ring.r2 {
  animation-delay: calc(var(--pulse-start) + 2.32s);
}

.stack .leader {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1;
}

.stack .leader-hot {
  stroke: rgba(255, 122, 77, 0.6);
}

.stack .label {
  fill: var(--text-3);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stack .label-hot {
  fill: var(--accent-soft);
}

.stack .layer {
  animation: layer-in 1100ms var(--ease) backwards;
}

.stack .layer-4 { animation-delay: 0.2s; }
.stack .layer-3 { animation-delay: 0.34s; }
.stack .layer-2 { animation-delay: 0.48s; }
.stack .layer-1 { animation-delay: 0.62s; }

/* Layers only float vertically, so the pierce marks stay on the beam. */
.stack .layer-float {
  animation: float 7s ease-in-out infinite;
}

.stack .layer-3 .layer-float { animation-delay: -1.75s; }
.stack .layer-2 .layer-float { animation-delay: -3.5s; }
.stack .layer-1 .layer-float { animation-delay: -5.25s; }

@keyframes layer-in {
  from {
    opacity: 0;
    transform: translateY(-48px);
  }
}

@keyframes float {
  50% {
    transform: translateY(-7px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes beam-pulse {
  0% {
    stroke-dashoffset: 70;
  }
  72%,
  100% {
    stroke-dashoffset: -560;
  }
}

@keyframes pierce {
  0%,
  14%,
  100% {
    transform: scale(1);
    opacity: 0.75;
  }
  4% {
    transform: scale(2.3);
    opacity: 1;
  }
}

@keyframes hit-ring {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  45%,
  100% {
    transform: scale(3.4);
    opacity: 0;
  }
}

@keyframes hit-glow {
  0%,
  100% {
    opacity: 0.45;
  }
  8% {
    opacity: 1;
  }
}

@keyframes cell-hot {
  0%,
  100% {
    fill: rgba(255, 122, 77, 0.4);
  }
  8% {
    fill: rgba(255, 122, 77, 0.85);
  }
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 52px;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.hero-facts li {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 22px 24px 30px;
  border-left: 1px solid var(--line);
}

.hero-facts li:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-facts .mono {
  margin-bottom: 6px;
  color: var(--accent-soft);
  font-size: 10px;
}

.hero-facts strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.hero-facts small {
  color: var(--text-3);
  font-size: 13px;
}

/* backwards (not both): once finished, the animation releases transform so
   later transitions (like the stack tilt) keep working. */
.intro {
  animation: rise var(--dur-slow) var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 90ms + 80ms);
}

.intro-1 { --i: 1; }
.intro-2 { --i: 2; }
.intro-3 { --i: 3; }
.intro-4 { --i: 4; }
.intro-5 { --i: 5; }
.intro-6 { --i: 6; }
.intro-7 { --i: 7; }

/* Starts at 1% instead of 0: it looks the same, but the browser counts the
   text as painted on the first frame, so LCP is not pushed back by the
   intro delay. */
@keyframes rise {
  from {
    opacity: 0.01;
    transform: translateY(22px);
  }
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding: 140px 0;
}

.section-dark {
  color: var(--text);
  background: var(--bg);
}

.section-light {
  color: var(--ink);
  background: var(--paper);
}

.section-sand {
  /* The sand is darker than the paper, so the muted ink and the accent ink
     go a step darker here to keep 4.5:1 for small text. */
  --ink-3: #5f5b54;
  --accent-ink: #a33a17;
  color: var(--ink);
  background: var(--sand);
}

.split {
  display: grid;
  grid-template-columns: minmax(170px, 0.34fr) minmax(0, 1.66fr);
  gap: 32px 80px;
}

.section-index {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  align-self: start;
  display: flex;
  gap: 12px;
  margin: 10px 0 0;
  color: var(--text-3);
}

.section-light .section-index,
.section-sand .section-index {
  color: var(--ink-3);
}

.section-index span:first-child {
  color: var(--accent);
}

.section-light .section-index span:first-child,
.section-sand .section-index span:first-child {
  color: var(--accent-ink);
}

.section-title {
  max-width: 17ch;
  margin-bottom: 28px;
  font-size: clamp(40px, 5.2vw, 78px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.section-intro {
  max-width: 60ch;
  margin-bottom: 64px;
  color: var(--text-2);
  font-size: 18px;
}

.section-light .section-intro,
.section-sand .section-intro {
  color: var(--ink-2);
}

.eyebrow {
  margin-bottom: 18px;
  color: var(--accent-soft);
}

.section-light .eyebrow,
.section-sand .eyebrow {
  color: var(--accent-ink);
}

/* ---------- Experience ---------- */

.role {
  background: #fbfaf6;
  border: 1px solid var(--line-ink);
  border-radius: 24px;
  overflow: hidden;
}

.role-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px 40px;
  align-items: end;
  padding: 40px 40px 32px;
  border-bottom: 1px solid var(--line-ink);
}

.role-period {
  margin-bottom: 14px;
  color: var(--accent-ink);
}

.role-company {
  margin: 0 0 6px;
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.role-title {
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
}

.role-path {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.role-path li {
  position: relative;
  display: grid;
  gap: 2px;
  min-width: 130px;
  padding: 16px 16px 0 0;
  border-top: 2px solid var(--line-ink);
}

.role-path li::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  width: 10px;
  height: 10px;
  background: var(--paper);
  border: 2px solid var(--ink-3);
  border-radius: 50%;
}

.role-path li.is-current {
  border-top-color: var(--accent-ink);
}

.role-path li.is-current::before {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 4px rgba(184, 67, 29, 0.16);
}

.role-path span {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.role-path small {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.role-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 40px;
  padding: 36px 40px 40px;
}

.role-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.role-list li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-2);
  font-size: 16px;
}

.role-list li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 12px;
  height: 1px;
  background: var(--accent-ink);
}

.role-list strong {
  color: var(--ink);
  font-weight: 700;
}

.role-aside > .mono {
  margin-bottom: 14px;
  color: var(--ink-3);
  font-size: 10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 6px 11px;
  color: var(--ink-2);
  border: 1px solid var(--line-ink);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* ---------- Projects (home cards) ---------- */

.projects-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 24px;
  transition: border-color 200ms ease;
}

.project-card:hover {
  border-color: var(--line-strong);
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  background: #0d0d0f;
}

.project-media img,
.project-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  padding: 30px 32px 34px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.project-meta > .mono {
  color: var(--text-3);
}

.project-card h3 {
  margin: 0;
  font-size: clamp(30px, 2.8vw, 42px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.project-card h3 span {
  display: block;
  margin-top: 6px;
  color: var(--accent-soft);
  font-size: 0.6em;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.project-pitch {
  margin: 0;
  color: var(--text-2);
  font-size: 16px;
}

.project-role {
  margin: 0;
  padding-left: 14px;
  color: var(--text-3);
  border-left: 2px solid var(--accent);
  font-size: 14px;
  line-height: 1.55;
}

.tag-list.is-dark li {
  color: var(--text-2);
  border-color: var(--line-strong);
}

.project-actions {
  margin-top: auto;
  padding-top: 6px;
  gap: 18px;
}

/* Status badge: "close to release" / "coming soon" */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 13px;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  white-space: nowrap;
}

.badge::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--text-3);
  border-radius: 50%;
}

.badge-near {
  color: var(--accent-soft);
  border-color: rgba(255, 194, 169, 0.4);
}

.badge-near::before {
  background: var(--accent);
  animation: blink 1.6s ease-in-out 3;
}

.badge-live {
  color: var(--ok);
  border-color: rgba(143, 224, 142, 0.4);
}

.badge-live::before {
  background: var(--ok);
  animation: none;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

/* ---------- Project pages ---------- */

.project-hero {
  position: relative;
  padding: calc(var(--header-h) + 64px) 0 88px;
  overflow: hidden;
  isolation: isolate;
}

.back-link {
  margin-bottom: 40px;
  color: var(--text-2);
}

.project-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-bottom: 24px;
}

.project-hero-meta > .mono {
  margin: 0;
  color: var(--text-2);
}

.project-title {
  max-width: 15ch;
  margin: 0 0 28px;
  font-size: clamp(52px, 7.4vw, 112px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.project-title span {
  display: block;
  color: var(--accent-soft);
  font-size: 0.56em;
  line-height: 1;
  letter-spacing: -0.05em;
}

.project-lead {
  max-width: 62ch;
  margin-bottom: 30px;
  color: var(--text-2);
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.55;
}

.project-lead strong,
.project-lead em {
  color: var(--text);
  font-weight: 600;
}

.button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.72;
}

.button[aria-disabled="true"]:hover {
  transform: none;
}

.project-video {
  margin: 56px 0 0;
}

/* The poster is a responsive image under the video (the poster attribute
   can't take a srcset); the video covers it once it plays. */
.project-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45);
}

.project-video-poster,
.project-video video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

figcaption {
  margin-top: 12px;
  color: var(--text-3);
  font-size: 13px;
}

.section-light figcaption,
.section-sand figcaption {
  color: var(--ink-3);
}

.prose p {
  max-width: 64ch;
  color: var(--text-2);
  font-size: 17px;
}

.section-light .prose p,
.section-sand .prose p {
  color: var(--ink-2);
}

.prose strong {
  color: var(--text);
}

.section-light .prose strong,
.section-sand .prose strong {
  color: var(--ink);
}

.facts {
  margin: 48px 0 0;
  border-top: 1px solid var(--line-ink);
}

.facts > div {
  display: grid;
  grid-template-columns: minmax(130px, 0.3fr) minmax(0, 1fr);
  gap: 6px 32px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-ink);
}

.facts dt {
  padding-top: 3px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.shot {
  margin: 40px 0 0;
}

.shot img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.section-light .shot img,
.section-sand .shot img {
  border-color: var(--line-ink);
}

.stories {
  display: grid;
  gap: 20px;
  margin-top: 48px;
}

.story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 28px 36px;
  align-items: start;
  padding: 32px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.story:not(:has(.story-media)) {
  grid-template-columns: minmax(0, 1fr);
}

.story .mono {
  margin-bottom: 14px;
  color: var(--project-accent);
  font-size: 10px;
}

.story h3 {
  max-width: 30ch;
  margin: 0 0 14px;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.story p:not(.mono) {
  max-width: 62ch;
  margin-bottom: 12px;
  color: var(--text-2);
  font-size: 15px;
}

.story p:last-child {
  margin-bottom: 0;
}

.story-media {
  margin: 0;
}

.story-media {
  padding: 8px;
  background: var(--project-surface);
  border: 1px solid var(--project-line);
  border-radius: 16px;
}

.story-media img {
  width: 100%;
  border-radius: 10px;
}

.who-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 40px 0 28px;
}

.who-card {
  padding: 30px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.who-card h3 {
  margin: 0 0 18px;
  color: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.who-card .role-list li {
  color: var(--text-2);
  font-size: 15px;
}

.who-card .role-list li::before {
  background: var(--accent);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 20px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.gallery figure {
  margin: 0;
}

.gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line-ink);
  border-radius: 12px;
}

.gallery-note {
  margin: 28px 0 0;
  color: var(--ink-3);
  font-size: 14px;
}

.prose h3 {
  margin: 56px 0 14px;
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -0.035em;
}

.prose > h3:first-child {
  margin-top: 0;
}

.prose .role-list {
  max-width: 68ch;
  margin: 8px 0 32px;
}

.section-dark .role-list li {
  color: var(--text-2);
}

.section-dark .role-list li::before {
  background: var(--accent);
}

.section-dark .role-list strong {
  color: var(--text);
}

.prose p.credits {
  margin-top: 24px;
  color: var(--text-3);
  font-size: 14px;
}

.section-light .prose p.credits,
.section-sand .prose p.credits {
  color: var(--ink-3);
}

.section-next {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

.next-project {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.next-project p {
  margin: 0;
  color: var(--text-3);
}

/* ---------- Project accents ---------- */

/* Mara Vey: the game's sun gold, with its jade as the frame tint. */
.project-mara-vey,
.project-card.is-mara-vey {
  --project-accent: #f3c25a;
  --project-ink: #7a5300;
  --project-line: rgba(47, 214, 160, 0.3);
  --project-surface: #0b1410;
}

/* Picklet: the extension's own teal (assets/theme.css in its repo). */
.project-picklet,
.project-card.is-picklet {
  --project-accent: #57b9c0;
  --project-ink: #0a666f;
  --project-line: rgba(87, 185, 192, 0.34);
  --project-surface: #0b1416;
}

.badge-project {
  color: var(--project-accent);
  border-color: var(--project-line);
}

.badge-project::before {
  background: var(--project-accent);
}

.project-page .back-link {
  border-bottom-color: var(--project-accent);
}

.project-page .project-hero-meta {
  padding-left: 16px;
  border-left: 2px solid var(--project-accent);
}

.project-page .project-video-frame {
  border-color: var(--project-line);
}

.project-meta > .mono:not(.badge) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.project-meta > .mono:not(.badge)::before {
  content: "";
  width: 16px;
  height: 2px;
  background: var(--project-accent);
}

.project-card .project-media {
  border-bottom: 1px solid var(--project-line);
}

.section-light .role-list li::before {
  background: var(--project-ink);
}

.project-page .section-light .facts {
  border-top-color: var(--project-ink);
}

/* Who did what, on the sand section */

.section-sand .who-card {
  background: rgba(255, 255, 255, 0.4);
  border-color: var(--line-ink);
}

.section-sand .who-card h3 {
  color: var(--accent-ink);
}

.section-sand .who-card .role-list li {
  color: var(--ink-2);
}

.section-sand .who-card .role-list li::before {
  background: var(--accent-ink);
}

/* Gallery on a dark section, with a lightbox */

.section-dark .gallery img {
  border-color: var(--line);
}

.section-dark .gallery-note {
  color: var(--text-3);
}

.gallery-link {
  display: block;
  border-radius: 12px;
  cursor: zoom-in;
}

.gallery-link img {
  transition:
    border-color 200ms ease,
    transform 300ms var(--ease);
}

.gallery-link:hover img {
  border-color: var(--project-line);
  transform: translateY(-2px);
}

.gallery-link:focus-visible {
  outline: 2px solid var(--project-accent);
  outline-offset: 4px;
}

.lightbox {
  width: min(1200px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100svh - 32px);
  margin: auto;
  padding: 0;
  overflow: visible;
  color: var(--text);
  background: transparent;
  border: 0;
}

.lightbox::backdrop {
  background: rgba(5, 5, 6, 0.94);
}

.lightbox figure {
  margin: 0;
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100svh - 140px);
  object-fit: contain;
  background: var(--project-surface);
  border: 1px solid var(--project-line);
  border-radius: 14px;
}

.lightbox figcaption {
  min-height: 1.6em;
  margin-top: 12px;
  color: var(--text-2);
  font-size: 14px;
}

.lightbox-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.lightbox-bar button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.lightbox-bar button:hover,
.lightbox-bar button:focus-visible {
  border-color: var(--project-accent);
}

.lightbox-bar button:focus-visible {
  outline: 2px solid var(--project-accent);
  outline-offset: 2px;
}

/* ---------- Stack ---------- */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-ink);
}

.stack-group {
  padding: 28px 24px 32px;
  border-left: 1px solid var(--line-ink);
}

.stack-group:first-child {
  padding-left: 0;
  border-left: 0;
}

.stack-group h3 {
  margin: 0 0 20px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stack-group ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-group li {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 64px;
}

.principle {
  padding: 30px;
  background: #fbfaf6;
  border: 1px solid var(--line-ink);
  border-radius: 20px;
}

.principle .mono {
  margin-bottom: 36px;
  color: var(--accent-ink);
  font-size: 10px;
}

.principle h3 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.principle p:last-child {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
}

/* ---------- About ---------- */

.about-lead {
  max-width: 34ch;
  margin-bottom: 28px;
  font-size: clamp(22px, 2.3vw, 32px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.about-copy > p:not(.about-lead):not(.eyebrow) {
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 17px;
}

.education {
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(18, 18, 19, 0.2);
}

.education li {
  display: grid;
  grid-template-columns: minmax(130px, 0.32fr) minmax(0, 1fr) 110px;
  gap: 8px 32px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid rgba(18, 18, 19, 0.2);
}

.education .mono {
  color: #5f5245;
  font-size: 10px;
}

.education strong {
  font-size: 17px;
  letter-spacing: -0.015em;
}

.education strong small {
  display: block;
  margin-top: 2px;
  color: #5f5245;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

.education .edu-year {
  color: #5f5245;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
}

/* ---------- Contact ---------- */

.contact {
  padding: 160px 0;
  overflow: hidden;
  isolation: isolate;
}

.contact::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -10%;
  bottom: -40%;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(
    circle,
    rgba(255, 122, 77, 0.14),
    transparent 62%
  );
  pointer-events: none;
}

.contact-title {
  max-width: 18ch;
  margin-bottom: 28px;
  font-size: clamp(44px, 6.4vw, 100px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.contact-title span {
  color: var(--accent-soft);
}

.contact-copy {
  max-width: 58ch;
  margin-bottom: 14px;
  color: var(--text-2);
  font-size: 18px;
}

.contact-meta {
  margin-bottom: 40px;
  color: var(--text-3);
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  width: var(--shell);
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-inline: auto;
  color: var(--text-3);
  font-size: 13px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand p {
  margin: 0;
}

.footer .brand-mark {
  width: 28px;
  height: 28px;
  font-size: 9px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* 3px above and below make each link a 24px target. */
.footer-links a {
  padding-block: 3px;
  transition: color 180ms ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text);
}

/* ---------- Reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 600ms ease,
    transform 700ms var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .site-nav a {
    padding-inline: 9px;
  }
}

@media (max-width: 1080px) {
  :root {
    --shell: calc(100% - 48px);
  }

  .site-header-inner {
    grid-template-columns: 1fr auto;
  }

  /* Mobile menu: a full-screen panel behind the header bar. */
  .site-nav {
    position: fixed;
    z-index: -1;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: calc(var(--header-h) + 28px) 24px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    counter-reset: menu;
    background:
      radial-gradient(70% 45% at 85% 8%, rgba(255, 122, 77, 0.16), transparent 70%),
      radial-gradient(60% 40% at 0% 100%, rgba(255, 194, 169, 0.07), transparent 70%),
      var(--bg);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity var(--dur) var(--ease-out),
      visibility 0s linear var(--dur);
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--dur) var(--ease-out);
  }

  .site-nav > a {
    --i: 0;
    display: flex;
    align-items: baseline;
    gap: 18px;
    padding: 16px 0;
    color: var(--text);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: clamp(32px, 8.5vw, 48px);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1;
    text-transform: none;
    counter-increment: menu;
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 360ms var(--ease-out),
      transform 420ms var(--ease-out),
      color var(--dur-fast) ease;
  }

  .site-nav > a::before {
    content: counter(menu, decimal-leading-zero);
    min-width: 2.2em;
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
  }

  .site-nav > a:nth-of-type(2) { --i: 1; }
  .site-nav > a:nth-of-type(3) { --i: 2; }
  .site-nav > a:nth-of-type(4) { --i: 3; }
  .site-nav > a:nth-of-type(5) { --i: 4; }
  .site-nav > a:nth-of-type(6) { --i: 5; }

  .site-nav.is-open > a,
  .site-nav.is-open .nav-extra {
    opacity: 1;
    transform: none;
    transition-delay: calc(var(--i) * 50ms + 80ms);
  }

  .site-nav > a.is-active {
    color: var(--accent-soft);
    background: none;
  }

  .site-nav > a.is-active::before {
    color: var(--accent-soft);
  }

  .site-nav > a:hover,
  .site-nav > a:focus-visible {
    color: var(--accent-soft);
  }

  .nav-extra {
    --i: 6;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 22px;
    margin-top: auto;
    padding-top: 36px;
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 360ms var(--ease-out),
      transform 420ms var(--ease-out);
  }

  .nav-extra .language-switch {
    margin-right: auto;
  }

  .nav-extra > a {
    display: inline-flex;
    gap: 6px;
    padding: 10px 0;
    color: var(--text-2);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .nav-extra > a:hover,
  .nav-extra > a:focus-visible {
    color: var(--text);
  }

  .nav-indicator {
    display: none;
  }

  .menu-toggle {
    position: relative;
    display: grid;
    place-content: center;
    gap: 6px;
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    cursor: pointer;
    transition:
      transform var(--dur-fast) var(--ease-out),
      border-color var(--dur-fast) ease;
  }

  .menu-toggle:active {
    transform: scale(0.94);
  }

  .menu-toggle[aria-expanded="true"] {
    border-color: var(--accent-soft);
  }

  .menu-toggle > span:not(.sr-only) {
    display: block;
    width: 16px;
    height: 1px;
    background: currentColor;
    transition: transform 320ms var(--ease-out);
  }

  .menu-toggle[aria-expanded="true"] > span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] > span:nth-child(2) {
    transform: translateY(-3.5px) rotate(-45deg);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 32px;
  }

  .hero-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-facts li:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .hero-facts li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .split {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .section-index {
    position: static;
    margin: 0 0 28px;
  }

  .stack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stack-group:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .stack-group:nth-child(n + 3) {
    border-top: 1px solid var(--line-ink);
  }
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    width: min(100%, 560px);
    margin: 8px auto 0;
  }

  .role-head,
  .role-body {
    grid-template-columns: 1fr;
  }

  .principles {
    grid-template-columns: 1fr;
  }

  .projects-list,
  .story {
    grid-template-columns: 1fr;
  }

  .who-grid {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  :root {
    --shell: calc(100% - 32px);
    --header-h: 64px;
  }

  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .header-cv {
    display: none;
  }

  .site-nav {
    padding-inline: 16px;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 40px);
  }

  .hero-name {
    margin-bottom: 28px;
    font-size: clamp(50px, 16vw, 84px);
  }

  .hero-lead {
    font-size: 20px;
  }

  .hero-sub {
    font-size: 15px;
  }

  .hero-actions .button {
    flex: 1 1 auto;
  }

  /* Labels would shrink to ~6px here; the stack reads fine without them. */
  .stack .label,
  .stack .leader {
    display: none;
  }

  .hero-visual {
    width: 118%;
    margin: 16px -18% 0 0;
  }

  .hero-facts {
    margin-top: 56px;
  }

  .hero-facts li,
  .hero-facts li:nth-child(3) {
    padding: 18px 12px 22px 0;
  }

  .hero-facts li:nth-child(even) {
    padding-left: 14px;
  }

  .hero-facts strong {
    font-size: 15px;
  }

  .hero-facts small {
    font-size: 12px;
  }

  .section {
    padding: 96px 0;
  }

  .section-title {
    font-size: clamp(36px, 11vw, 52px);
  }

  .section-intro {
    margin-bottom: 44px;
    font-size: 16px;
  }

  .role {
    border-radius: 18px;
  }

  .role-head,
  .role-body {
    padding: 26px 22px;
  }

  .role-path {
    flex-direction: column;
    gap: 0;
  }

  .role-path li {
    min-width: 0;
    padding: 0 0 18px 22px;
    border-top: 0;
    border-left: 2px solid var(--line-ink);
  }

  .role-path li:last-child {
    padding-bottom: 0;
  }

  .role-path li::before {
    top: 2px;
    left: -6px;
  }

  .role-path li.is-current {
    border-left-color: var(--accent-ink);
  }

  .role-list li {
    font-size: 15px;
  }

  .project-body {
    padding: 26px 22px 28px;
  }

  .project-card h3 {
    font-size: clamp(30px, 9vw, 40px);
  }

  .project-hero {
    padding: calc(var(--header-h) + 40px) 0 56px;
  }

  .project-title {
    font-size: clamp(44px, 13vw, 68px);
  }

  .project-lead {
    font-size: 17px;
  }

  .project-hero .hero-actions .button {
    flex: 1 1 auto;
  }

  .story,
  .who-card {
    padding: 22px;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

  .stack-group,
  .stack-group:nth-child(3) {
    padding: 22px 0 24px;
    border-left: 0;
  }

  .stack-group + .stack-group {
    border-top: 1px solid var(--line-ink);
  }

  .stack-group ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
  }

  .stack-group li {
    font-size: 17px;
  }

  .principles {
    margin-top: 44px;
  }

  .principle {
    padding: 24px;
  }

  .principle .mono {
    margin-bottom: 20px;
  }

  .about-copy > p:not(.about-lead):not(.eyebrow) {
    font-size: 15px;
  }

  .education li {
    grid-template-columns: 1fr auto;
  }

  .education li > .mono {
    grid-column: 1 / -1;
  }

  .contact {
    padding: 110px 0;
  }

  .contact-title {
    font-size: clamp(40px, 12vw, 60px);
  }

  .contact-copy {
    font-size: 16px;
  }

  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 28px 0;
  }
}

/* ---------- Legal page ---------- */

.legal-page {
  min-height: 100svh;
}

.legal-header,
.legal-footer,
.legal-shell {
  width: min(100% - 64px, 1160px);
  margin-inline: auto;
}

.legal-header {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.legal-header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.legal-header-actions > a,
.legal-footer a {
  padding-block: 3px;
}

.legal-header-actions > a {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-header-actions > a:hover {
  color: var(--text);
}

.legal-shell {
  padding: clamp(88px, 12vw, 160px) 0;
}

.legal-shell > .eyebrow {
  margin-bottom: 24px;
}

.legal-shell h1 {
  max-width: 900px;
  margin-bottom: 46px;
  font-size: clamp(52px, 8vw, 112px);
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.legal-lead {
  max-width: 740px;
  margin-bottom: 100px;
  color: #d2d0cb;
  font-size: clamp(19px, 2.2vw, 26px);
  line-height: 1.45;
}

.legal-shell section {
  max-width: 740px;
  padding: 42px 0;
  border-top: 1px solid var(--line);
}

.legal-shell section h2 {
  margin-bottom: 14px;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.legal-shell section p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.75;
}

.legal-updated {
  margin: 54px 0 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.legal-footer {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--text-3);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.legal-footer p {
  margin: 0;
}

@media (max-width: 620px) {
  .legal-header,
  .legal-footer,
  .legal-shell {
    width: calc(100% - 32px);
  }

  .legal-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 0;
  }

  .legal-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .legal-shell h1 {
    font-size: clamp(46px, 14vw, 72px);
  }

  .legal-lead {
    margin-bottom: 72px;
  }

  .legal-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

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

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Rendering ---------- */

/* Lower sections of the project pages render only when they get close to the
   viewport. Nothing links into them, so anchors are unaffected. */
.project-page #detalles,
.project-page #galeria,
.project-page #estado {
  content-visibility: auto;
  contain-intrinsic-size: auto 1400px;
}

/* ---------- Motion ---------- */

/* script.js marks the hero when it scrolls out of view: the illustration's
   loops stop, so nothing animates where nobody can see it. */
.hero.is-offscreen .stack,
.hero.is-offscreen .stack * {
  animation-play-state: paused;
}

/* The pause button next to the illustration stops its loops. */
.hero.is-paused .stack,
.hero.is-paused .stack * {
  animation-play-state: paused;
}

/* The name comes up line by line from behind a mask on load. */
.hero-name .intro {
  animation-name: line-in;
  animation-duration: 700ms;
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateY(0.32em);
    clip-path: inset(0 0 100% 0);
  }
  to {
    opacity: 1;
    transform: none;
    clip-path: inset(-20% -5% -20% -5%);
  }
}


/* Project cards: the media eases in a little and the accent rule grows. */
.project-media img,
.project-media video {
  transition: transform var(--dur-slow) var(--ease-out);
}

.project-card:hover .project-media img,
.project-card:hover .project-media video,
.project-card:focus-within .project-media img,
.project-card:focus-within .project-media video {
  transform: scale(1.035);
}

/* A light veil instead of filter: brightness() on a playing video. */
.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.project-card:hover .project-media::after,
.project-card:focus-within .project-media::after {
  opacity: 1;
}

.project-meta > .mono:not(.badge)::before {
  transform-origin: right;
  transition: transform var(--dur) var(--ease-out);
}

.project-card:hover .project-meta > .mono:not(.badge)::before,
.project-card:focus-within .project-meta > .mono:not(.badge)::before {
  transform: scaleX(2);
}

/* Buttons: a small press. */
.button:active {
  transform: translateY(0) scale(0.98);
  transition-duration: var(--dur-fast);
}

/* Detail pages: the scroll progress line takes the project's accent. */
.project-page .scroll-progress span {
  background: var(--project-accent);
}

/* Scroll-driven reveals where the browser supports view timelines; elsewhere
   the IntersectionObserver in script.js adds .is-visible. */
@supports (animation-timeline: view()) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
    animation: reveal-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 200px;
  }
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Cross-document view transitions between the home page and the project
   pages: the card media and title morph into the project hero. Browsers
   without support just navigate. */
@view-transition {
  navigation: auto;
}

::view-transition-group(*) {
  animation-duration: 520ms;
  animation-timing-function: var(--ease-in-out);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 300ms;
}

.project-card.is-mara-vey .project-media,
.project-mara-vey .project-video-frame {
  view-transition-name: mv-media;
}

.project-card.is-mara-vey h3,
.project-mara-vey .project-title {
  view-transition-name: mv-title;
}

.project-card.is-picklet .project-media,
.project-picklet .project-video-frame {
  view-transition-name: pk-media;
}

.project-card.is-picklet h3,
.project-picklet .project-title {
  view-transition-name: pk-title;
}

::view-transition-old(mv-title),
::view-transition-new(mv-title),
::view-transition-old(pk-title),
::view-transition-new(pk-title) {
  height: 100%;
  object-fit: none;
  object-position: left top;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  .js .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ---------- Micro-interactions ---------- */

@media (min-width: 1081px) {
  .nav-extra {
    display: none;
  }

  .site-nav {
    position: relative;
    isolation: isolate;
  }
}

/* Desktop nav: one pill that slides to the section in view and follows the
   hovered link. script.js sets --pill-x and --pill-s. */

.nav-indicator {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 0;
  width: 100px;
  height: 32px;
  margin-top: -16px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  opacity: 0;
  transform-origin: left center;
  transform: translateX(var(--pill-x, 0)) scaleX(var(--pill-s, 1));
  transition:
    transform 340ms var(--ease-out),
    opacity var(--dur-fast) ease;
  pointer-events: none;
}

.nav-indicator.is-on {
  opacity: 1;
}

.js .site-nav a.is-active {
  background: none;
}

/* Buttons: a light sheen sweeps across on hover. */
.button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.button::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 70%
  );
  transform: translateX(-110%);
  pointer-events: none;
}

.button-ghost::after {
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
}

.button:hover::after,
.button:focus-visible::after {
  transform: translateX(110%);
  transition: transform 400ms var(--ease-out);
}

.button[aria-disabled="true"]::after {
  display: none;
}

/* Focus rings draw in instead of popping. */
.button:focus-visible,
.text-link:focus-visible,
.site-nav a:focus-visible,
.nav-extra a:focus-visible,
.language-switch button:focus-visible,
.header-cv:focus-visible,
.brand:focus-visible,
.menu-toggle:focus-visible,
.footer-links a:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  animation: ring-in 220ms var(--ease-out);
}

@keyframes ring-in {
  from {
    outline-color: transparent;
    outline-offset: 8px;
  }
}

/* Text links: a faint resting underline, and a full one that draws in from
   the left on hover. */
.text-link {
  position: relative;
  border-bottom-color: color-mix(in srgb, currentColor 35%, transparent);
}

.text-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms var(--ease-out);
}

.text-link:hover::after,
.text-link:focus-visible::after {
  transform: scaleX(1);
}

.project-page .back-link::after {
  background: var(--project-accent);
}

.text-link [aria-hidden="true"] {
  transition: transform var(--dur-fast) var(--ease-out);
}

.back-link:hover [aria-hidden="true"],
.back-link:focus-visible [aria-hidden="true"] {
  transform: translateX(-3px);
}

/* CV button: the arrow dips. */
.header-cv span[aria-hidden="true"] {
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-out);
}

.header-cv:hover span[aria-hidden="true"],
.header-cv:focus-visible span[aria-hidden="true"] {
  transform: translateY(2px);
}

/* Footer links nudge up a touch. */
.footer-links a {
  display: inline-block;
  transition:
    color var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  transform: translateY(-2px);
}

/* Lightbox: scale and fade in, the reverse on close. */
.lightbox[open] {
  animation: lightbox-in 280ms var(--ease-out);
}

.lightbox[open]::backdrop {
  animation: backdrop-in 280ms ease;
}

.lightbox.is-closing {
  animation: lightbox-out 200ms var(--ease-in-out) forwards;
}

.lightbox.is-closing::backdrop {
  animation: backdrop-in 200ms ease reverse forwards;
}

@keyframes lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

@keyframes lightbox-out {
  to {
    opacity: 0;
    transform: scale(0.97);
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav > a,
  .nav-extra {
    transform: none !important;
  }

  .button::after {
    display: none;
  }

  .site-nav,
  .site-nav.is-open {
    transition-duration: 200ms !important;
  }
}

/* The menu has its own language switch at the bottom; hide the header one
   while it is open so there is only one. */
body.menu-open .header-actions .language-switch {
  visibility: hidden;
}

.site-nav a,
.nav-extra a,
.menu-toggle,
.language-switch button {
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Motion controls ---------- */

/* Pause buttons for the looping hero illustration and the card videos
   (WCAG 2.2.2). script.js sets data-state and the hidden label. */
.hero-art {
  position: relative;
}

.motion-toggle {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--text-2);
  background: rgba(9, 9, 10, 0.62);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  transition:
    color var(--dur-fast) ease,
    border-color var(--dur-fast) ease;
}

.motion-toggle:hover,
.motion-toggle:focus-visible {
  color: var(--text);
  border-color: var(--accent-soft);
}

.motion-toggle:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}

/* Pause icon: two bars. */
.motion-toggle::before {
  content: "";
  width: 9px;
  height: 11px;
  border-right: 3px solid currentColor;
  border-left: 3px solid currentColor;
}

/* Play icon: a triangle. */
.motion-toggle[data-state="paused"]::before {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-width: 6px 0 6px 10px;
  border-style: solid;
  border-color: transparent transparent transparent currentColor;
}

.hero-art .motion-toggle {
  right: 0;
  bottom: 0;
}

.project-media .motion-toggle {
  right: 14px;
  bottom: 14px;
}

html:not(.js) .motion-toggle {
  display: none;
}

/* With reduced motion the illustration does not loop, so there is nothing
   to pause; the card videos keep their button so they can still be played. */
@media (prefers-reduced-motion: reduce) {
  .hero-art .motion-toggle {
    display: none;
  }
}
