/* ==========================================================================
   Tristan Machado — portfolio
   Design system: "Field notes". Space Grotesk headings, Archivo body,
   Caveat for handwritten notes. Monochrome ink + brand violet, with sticky-note
   pastels for the fun bits. Light and dark themes share semantic tokens.
   ========================================================================== */

:root {
  --paper: #f7f4ee;
  --surface: #ffffff;
  --surface-2: #fbf9f5;
  --ink: #17141f;
  --ink-2: #4b4559;
  --ink-3: #6a6479;
  --line: #e4ded4;
  --line-strong: #cfc7ba;

  --primary: #5b3fe0;
  --primary-hover: #4a30c8;
  --on-primary: #ffffff;
  --primary-soft: #ece7ff;
  --focus: #5b3fe0;

  --sun: #ffe173;
  --mint: #bdf0d8;
  --lavender: #ddd4f7;
  --peach: #ffd6c6;
  --sticky-ink: #1d1a24;
  --mark: rgba(255, 214, 64, 0.55);

  --tint: #efe9df;
  --header-bg: rgba(247, 244, 238, 0.82);

  --font-head: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;

  --radius-s: 10px;
  --radius: 18px;
  --radius-l: 28px;
  --shadow-1: 0 1px 2px rgba(23, 20, 31, 0.06), 0 6px 18px rgba(23, 20, 31, 0.06);
  --shadow-2: 0 18px 40px rgba(23, 20, 31, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.26s;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;

  color-scheme: light;
}

:root[data-theme='dark'] {
  --paper: #121018;
  --surface: #1b1824;
  --surface-2: #211d2c;
  --ink: #f3f0fa;
  --ink-2: #c8c1d9;
  --ink-3: #a59eb8;
  --line: #2e2a3b;
  --line-strong: #433d55;
  --primary: #a898ff;
  --primary-hover: #c0b4ff;
  --on-primary: #160f33;
  --primary-soft: #2a2447;
  --focus: #c0b4ff;
  --mark: rgba(255, 214, 64, 0.35);
  --tint: #18151f;
  --header-bg: rgba(18, 16, 24, 0.8);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 18px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #121018;
    --surface: #1b1824;
    --surface-2: #211d2c;
    --ink: #f3f0fa;
    --ink-2: #c8c1d9;
    --ink-3: #a59eb8;
    --line: #2e2a3b;
    --line-strong: #433d55;
    --primary: #a898ff;
    --primary-hover: #c0b4ff;
    --on-primary: #160f33;
    --primary-soft: #2a2447;
    --focus: #c0b4ff;
    --mark: rgba(255, 214, 64, 0.35);
    --tint: #18151f;
    --header-bg: rgba(18, 16, 24, 0.8);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.25);
    --shadow-2: 0 18px 40px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 0.5em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; }
button { font: inherit; color: inherit; }
ul, ol { padding-left: 1.2em; }
::selection { background: var(--sun); color: var(--sticky-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: top var(--dur) var(--ease); }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 820px; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ type helpers */

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5em;
  margin: 0 0 0.9rem;
  font: 600 0.8rem/1 var(--font-head);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
}
.eyebrow--light { color: rgba(255, 255, 255, 0.82); }
.section__title { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 22ch; }
.scribble {
  position: relative; white-space: nowrap;
  background: linear-gradient(transparent 58%, var(--mark) 58%, var(--mark) 92%, transparent 92%);
  padding-inline: 0.06em;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 46px; padding: 0.7em 1.2em;
  border: 2px solid transparent; border-radius: 999px;
  font: 600 1rem/1 var(--font-head); text-decoration: none; cursor: pointer;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  touch-action: manipulation;
}
.btn .icon { transition: transform var(--dur) var(--ease); }
.btn:hover .icon:last-child { transform: translateX(3px); }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--large { min-height: 54px; padding-inline: 1.5em; font-size: 1.05rem; }
.btn--small { min-height: 40px; padding: 0.55em 1em; font-size: 0.92rem; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 1.5px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }

/* ------------------------------------------------------------------ header */

.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; background: var(--primary); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.05rem/1 var(--font-head); letter-spacing: -0.01em; margin-right: auto; }
.brand__mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px;
  background: var(--sun); color: var(--sticky-ink); font: 700 1.25rem/1 var(--font-hand);
  transform: rotate(-6deg); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(4deg) scale(1.05); }
.site-nav__list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav__list a:not(.btn) {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: 999px; text-decoration: none; font: 500 0.98rem/1 var(--font-head); color: var(--ink-2);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.site-nav__list a:not(.btn):hover { color: var(--ink); background: var(--primary-soft); }
.site-nav__list a[aria-current='page'] { color: var(--ink); }
.site-nav__list a[aria-current='page']::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 8px; height: 3px; border-radius: 3px; background: var(--primary); }
.site-nav__cta { margin-left: 8px; }
.site-header__actions { display: flex; gap: 8px; }
.theme-toggle .theme-toggle__sun { display: none; }
:root[data-theme='dark'] .theme-toggle .theme-toggle__sun { display: block; }
:root[data-theme='dark'] .theme-toggle .theme-toggle__moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .theme-toggle__sun { display: block; }
  :root:not([data-theme='light']) .theme-toggle .theme-toggle__moon { display: none; }
}
.menu-toggle { display: none; }
.menu-toggle .menu-toggle__close { display: none; }
.menu-toggle[aria-expanded='true'] .menu-toggle__open { display: none; }
.menu-toggle[aria-expanded='true'] .menu-toggle__close { display: block; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-grid; }
  .site-nav { position: absolute; inset: calc(var(--header-h) + env(safe-area-inset-top, 0px)) 0 auto 0; }
  .site-nav__list {
    flex-direction: column; align-items: stretch; gap: 2px;
    margin: 0 var(--gutter); padding: 12px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow-2);
    opacity: 0; transform: translateY(-8px); visibility: hidden;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur);
  }
  .site-nav.is-open .site-nav__list { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
  .site-nav__list a:not(.btn) { min-height: 52px; font-size: 1.1rem; }
  .site-nav__list a[aria-current='page']::after { left: auto; right: 16px; top: 50%; bottom: auto; width: 8px; height: 8px; border-radius: 50%; transform: translateY(-50%); }
  .site-nav__cta { margin: 8px 0 0; }
  .site-nav__cta .btn { width: 100%; min-height: 50px; }
}

/* ------------------------------------------------------------------ reveal motion */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ hero */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(32px, 5vw, 72px);
  align-items: center; padding-block: clamp(40px, 7vw, 96px) clamp(40px, 6vw, 72px);
}
.hero__hello { display: inline-flex; align-items: center; gap: 0.6em; margin-bottom: 1.2rem; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font: 500 0.95rem/1 var(--font-head); color: var(--ink-2); }
.hero__hello .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.hero__title { font-size: clamp(2.6rem, 6.4vw, 5.2rem); line-height: 1.02; letter-spacing: -0.035em; margin-bottom: 0.4em; }
.rotator { display: inline-block; position: relative; color: var(--primary); }
.rotator__word { display: inline-block; background: linear-gradient(transparent 62%, var(--mark) 62%, var(--mark) 94%, transparent 94%); transition: opacity 0.28s var(--ease), transform 0.28s var(--ease); }
.rotator.is-leaving .rotator__word { opacity: 0; transform: translateY(-0.25em); }
.rotator.is-entering .rotator__word { opacity: 0; transform: translateY(0.3em); }
.hero__lede { font-size: clamp(1.08rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 58ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 1.6rem 1.4rem; }
.hero__status { display: inline-flex; align-items: center; gap: 10px; font-size: 0.95rem; color: var(--ink-3); }
.pulse { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #1fa971; }
.pulse::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #1fa971; opacity: 0; animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(0.6); opacity: 0.8; } 100% { transform: scale(1.6); opacity: 0; } }

.hero__art { position: relative; justify-self: center; width: min(100%, 440px); padding: 28px 24px 40px; }
.hero__portrait {
  position: relative; aspect-ratio: 4 / 5; border-radius: 999px 999px var(--radius-l) var(--radius-l); overflow: hidden;
  background: var(--lavender); box-shadow: var(--shadow-2);
}
.hero__portrait::before { content: ''; position: absolute; inset: -30% -30% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: var(--sun); opacity: 0.55; }
.hero__portrait img { position: relative; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.note {
  position: absolute; margin: 0; padding: 10px 14px 12px; max-width: 200px;
  font: 700 1.3rem/1.05 var(--font-hand); color: var(--sticky-ink);
  border-radius: 4px 4px 14px 4px; box-shadow: 0 10px 22px rgba(23, 20, 31, 0.16);
  transform: translate3d(var(--px, 0), var(--py, 0), 0) rotate(var(--r, 0deg));
  transition: transform 0.4s var(--ease);
}
.note--sun { background: var(--sun); top: 6%; left: -2%; }
.note--mint { background: var(--mint); top: 46%; right: -2%; max-width: 170px; }
.note--lavender { background: var(--lavender); bottom: 4%; left: 0; }

/* ------------------------------------------------------------------ stats */

.stats { padding-block: 8px clamp(40px, 6vw, 72px); }
.stats__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.stat { padding: 22px 22px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stat__value { margin: 0 0 6px; font: 700 clamp(2.2rem, 4vw, 3rem)/1 var(--font-head); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat:nth-child(1) .stat__value { color: var(--primary); }
.stat__label { margin: 0; color: var(--ink-2); font-size: 0.98rem; line-height: 1.4; }

/* ------------------------------------------------------------------ marquee */

.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); padding-block: 16px; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: 14px; width: max-content; margin: 0; padding: 0; list-style: none; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track li { flex: none; padding: 8px 16px; border-radius: 999px; border: 1.5px dashed var(--line-strong); font: 500 1rem/1.2 var(--font-head); color: var(--ink-2); white-space: nowrap; }
@keyframes marquee { to { transform: translateX(calc(-50% - 7px)); } }

/* ------------------------------------------------------------------ sections */

.section { padding-block: clamp(56px, 8vw, 112px); }
.section--tight { padding-block: clamp(24px, 4vw, 48px) clamp(56px, 8vw, 96px); }
.section--tint { background: var(--tint); }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: clamp(28px, 4vw, 44px); }
.section__head .section__title { margin-bottom: 0; }

/* ------------------------------------------------------------------ cards */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.project-card { overflow: hidden; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.project-card.is-in:hover, .project-card.is-in:focus-within { transform: translateY(-6px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.project-card__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.project-card__link:focus-visible { outline-offset: -4px; border-radius: var(--radius-l); }
.project-card__body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 24px; flex: 1; }
.project-card__kicker { margin: 0; font: 600 0.82rem/1 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.project-card__title { margin: 0; font-size: clamp(1.4rem, 2.2vw, 1.75rem); }
.project-card__summary { margin: 0; color: var(--ink-2); }
.project-card__cta { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; font: 600 1rem/1 var(--font-head); color: var(--primary); }
.project-card__cta .icon { transition: transform var(--dur) var(--ease); }
.project-card:hover .project-card__cta .icon { transform: translateX(4px); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li { padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.85rem; line-height: 1.2; color: var(--ink-2); }

.cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; display: grid; place-items: center; }
.cover img { transition: transform 0.5s var(--ease); }
.project-card:hover .cover img { transform: scale(1.03); }
.cover--violet { background: radial-gradient(120% 100% at 0% 0%, #8f74ff 0%, #5b3fe0 55%, #3b25a8 100%); }
.cover--blue { background: radial-gradient(120% 100% at 100% 0%, #e7f1ff 0%, #cfe2ff 100%); }
.cover--night { background: radial-gradient(90% 90% at 30% 20%, #3a2f12 0%, #121522 55%, #0a0d15 100%); }
.cover--sand { background: #f8f1ea; }
.cover--ink { background: #111; }
.cover--amex { background: #056ed0; }
.cover--screen img { width: 86%; border-radius: 12px; box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35); transform: perspective(1200px) rotateX(8deg) rotateY(-10deg) translateY(4%); transform-origin: 50% 100%; }
.project-card:hover .cover--screen img { transform: perspective(1200px) rotateX(4deg) rotateY(-4deg) translateY(2%); }
.cover--artifact { padding: 7%; }
.cover--artifact img { width: 100%; border-radius: 10px; background: #fff; padding: 10px; box-shadow: 0 16px 36px rgba(11, 95, 217, 0.22); }
.cover--full img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cover--phones { display: flex; align-items: flex-end; justify-content: center; gap: 0; padding-top: 7%; }
.mini-phone { width: 34%; aspect-ratio: 780 / 1688; border-radius: 20px; border: 5px solid #05060a; overflow: hidden; background: #05060a; box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45); }
.mini-phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cover--phones .mini-phone--0 { transform: translateY(18%) rotate(-6deg); margin-right: -4%; z-index: 1; }
.cover--phones .mini-phone--1 { transform: translateY(26%) rotate(5deg); }
.project-card:hover .cover--phones .mini-phone--0 { transform: translateY(14%) rotate(-8deg); }
.project-card:hover .cover--phones .mini-phone--1 { transform: translateY(22%) rotate(7deg); }
.mini-phone { transition: transform 0.5s var(--ease); }
.cover--essay { background: linear-gradient(135deg, #2b1f6b 0%, #5b3fe0 50%, #ff7a59 120%); color: #fff; align-content: center; gap: 10px; text-align: center; }
.cover--essay .icon { width: 44px; height: 44px; margin-inline: auto; }
.cover--essay p { margin: 0; font: 700 1.6rem/1 var(--font-head); }

/* Bento on home */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.bento__item { grid-column: span 2; }
.bento__item--0, .bento__item--1 { grid-column: span 3; }

/* Work grid + filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line-strong);
  background: var(--surface); font: 500 0.98rem/1 var(--font-head); color: var(--ink-2); cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.work-grid .project-card[hidden] { display: none; }

/* ------------------------------------------------------------------ process */

.process { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.process__step { position: relative; padding: 26px 24px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.process__step.is-in:hover { transform: translateY(-4px); box-shadow: var(--shadow-1); }
.process__no { position: absolute; right: 16px; top: 4px; font: 700 4.2rem/1 var(--font-head); color: transparent; -webkit-text-stroke: 1.5px var(--line-strong); }
.process__step h3 { font-size: 1.3rem; margin-top: 18px; }
.process__step p { margin: 0; color: var(--ink-2); font-size: 1rem; }
.process__step::before { content: ''; position: absolute; left: 24px; top: 24px; width: 28px; height: 6px; border-radius: 6px; background: var(--primary); }

/* ------------------------------------------------------------------ AI banner */

.ai-banner {
  position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: clamp(28px, 5vw, 56px); border-radius: var(--radius-l); overflow: hidden; text-decoration: none; color: #fff;
  background: radial-gradient(80% 140% at 100% 0%, rgba(255, 122, 89, 0.55), transparent 60%), linear-gradient(135deg, #1d1446 0%, #3e2ab0 55%, #5b3fe0 100%);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ai-banner.is-in:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.ai-banner > div { max-width: 60ch; }
.ai-banner__title { font-size: clamp(2rem, 4.5vw, 3.4rem); margin-bottom: 0.3em; }
.ai-banner p { color: rgba(255, 255, 255, 0.86); margin: 0; }
.ai-banner__cta { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; background: #fff; color: #1d1446; font: 600 1rem/1 var(--font-head); }

/* ------------------------------------------------------------------ sticky notes */

.stickies { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 26px; list-style: none; margin: 0; padding: 0; }
.sticky {
  position: relative; padding: 26px 22px 20px; color: var(--sticky-ink);
  border-radius: 3px 3px 18px 3px; box-shadow: 0 14px 28px rgba(23, 20, 31, 0.12);
  transform: rotate(var(--r, 0deg)); transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), opacity 0.6s var(--ease);
}
.js .sticky.reveal { transform: translateY(18px) rotate(var(--r, 0deg)); }
.js .sticky.reveal.is-in { transform: rotate(var(--r, 0deg)); }
.js .sticky.reveal.is-in:hover, .sticky:hover { transform: rotate(0deg) scale(1.03); box-shadow: 0 20px 36px rgba(23, 20, 31, 0.18); }
.sticky::before { content: ''; position: absolute; top: -10px; left: 50%; width: 76px; height: 22px; transform: translateX(-50%) rotate(-2deg); background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(0, 0, 0, 0.05); }
.sticky--sun { background: var(--sun); }
.sticky--mint { background: var(--mint); }
.sticky--lavender { background: var(--lavender); }
.sticky--peach { background: var(--peach); }
.sticky blockquote { margin: 0; }
.sticky blockquote p { margin: 0 0 14px; font: 700 1.55rem/1.15 var(--font-hand); }
.sticky__by { margin: 0; font: 600 0.95rem/1.3 var(--font-head); }
.sticky__by span { display: block; font-weight: 500; opacity: 0.75; }
.sticky h3 { font-size: 1.15rem; margin-bottom: 0.4em; }
.sticky p { margin: 0; }

/* ------------------------------------------------------------------ about teaser + footer */

.about-teaser__card { padding: clamp(28px, 5vw, 56px); border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); background-image: radial-gradient(circle at 100% 100%, var(--primary-soft) 0, transparent 45%); }
.about-teaser__card p { max-width: 65ch; color: var(--ink-2); font-size: 1.1rem; }

.site-footer { border-top: 1px solid var(--line); padding-block: clamp(56px, 8vw, 96px) calc(28px + env(safe-area-inset-bottom, 0px)); }
.footer-cta__title { font-size: clamp(2.2rem, 6vw, 4.4rem); max-width: 16ch; letter-spacing: -0.035em; }
.footer-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.site-footer__bottom { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: center; margin-top: clamp(48px, 7vw, 80px); padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.95rem; }
.site-footer__bottom p { margin: 0; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.site-footer__links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; color: var(--ink-2); }
.site-footer__links a:hover { color: var(--ink); text-decoration: underline; }
.site-footer__note { grid-column: 1 / -1; font-family: var(--font-hand); font-size: 1.25rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 600 0.98rem/1 var(--font-head);
  box-shadow: var(--shadow-2); opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ page heroes */

.page-hero { padding-block: clamp(48px, 8vw, 104px) clamp(24px, 4vw, 40px); }
.page-hero__title { font-size: clamp(2.6rem, 6.4vw, 5rem); line-height: 1.02; letter-spacing: -0.035em; max-width: 18ch; }
.page-hero__lede { font-size: clamp(1.08rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 62ch; }

.about-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.about-hero__photo { position: relative; justify-self: center; width: min(100%, 380px); }
.about-hero__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; border-radius: var(--radius-l); box-shadow: var(--shadow-2); }
.about-hero__photo .note { position: absolute; top: auto; bottom: -18px; right: -12px; left: auto; }
.about-story .prose { max-width: 70ch; }
.about-story .prose p { font-size: 1.15rem; }

.timeline { position: relative; list-style: none; margin: 32px 0 0; padding: 0 0 0 28px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line-strong); }
.timeline__item { position: relative; padding-bottom: 28px; }
.timeline__item::before { content: ''; position: absolute; left: -28px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 3px solid var(--primary); }
.timeline__dates { margin: 0 0 6px; font: 600 0.85rem/1.2 var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.timeline__role { font-size: 1.35rem; margin-bottom: 0.4em; }
.timeline__role span { color: var(--ink-3); font-weight: 500; }
.timeline__item ul { margin: 0; color: var(--ink-2); }
.timeline__item li { margin-bottom: 4px; }
.edu { margin-top: 12px; padding: 20px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.edu p:last-child { margin: 0; }

.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.skills__group { padding: 24px; }
.skills__group h3 { font-size: 1.2rem; }
.off-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; list-style: none; margin: 0; padding: 0; }

.resume { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.resume__side { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.resume__side .card { padding: 22px; }
.resume__side p { margin: 0; color: var(--ink-2); }
.resume__h { font-size: 1.1rem; letter-spacing: 0; margin-bottom: 0.7em; }
.timeline--compact { margin-top: 8px; }

.not-found { min-height: 50vh; }

/* ------------------------------------------------------------------ case studies */

.cs-hero { padding-block: clamp(32px, 5vw, 64px) clamp(32px, 5vw, 56px); }
.back-link { display: flex; width: fit-content; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 18px; font: 600 0.98rem/1 var(--font-head); text-decoration: none; color: var(--ink-2); }
.back-link:hover { color: var(--ink); }
.back-link .icon { transition: transform var(--dur) var(--ease); }
.back-link:hover .icon { transform: translateX(-3px); }
.cs-hero__title { font-size: clamp(2.8rem, 7.5vw, 6rem); line-height: 0.98; letter-spacing: -0.04em; max-width: 14ch; }
.cs-hero__lede { font-size: clamp(1.12rem, 1.8vw, 1.35rem); color: var(--ink-2); max-width: 56ch; }
.cs-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 32px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-meta > div { padding: 18px 18px 18px 0; }
.cs-meta > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.cs-meta dt { margin-bottom: 6px; font: 600 0.78rem/1 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.cs-meta dd { margin: 0; font-weight: 500; line-height: 1.4; }
.cs-hero__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.cs-hero__media { margin: clamp(32px, 5vw, 56px) 0 0; }
.cs-hero__media img { width: 100%; border-radius: var(--radius-l); box-shadow: var(--shadow-2); }
.cs-hero__media figcaption { margin-top: 12px; color: var(--ink-3); font-size: 0.95rem; }
.cs-hero__phones {
  display: flex; justify-content: center; align-items: flex-end; gap: 0; margin-top: clamp(32px, 5vw, 56px);
  padding: clamp(24px, 5vw, 56px) 16px 0; border-radius: var(--radius-l); overflow: hidden;
  background: radial-gradient(70% 90% at 50% 0%, #3d3113 0%, #141826 55%, #0a0d15 100%);
}
.cs-hero__phones .mini-phone { width: min(30%, 260px); border-width: 7px; border-radius: 34px; }
.cs-hero__phones .mini-phone--hero-0 { order: 2; z-index: 2; transform: translateY(8%); }
.cs-hero__phones .mini-phone--hero-1 { order: 1; transform: translateY(22%) rotate(-5deg); margin-right: -3%; }
.cs-hero__phones .mini-phone--hero-2 { order: 3; transform: translateY(22%) rotate(5deg); margin-left: -3%; }

.cs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: start; padding-bottom: clamp(40px, 6vw, 80px); }
.cs-toc { position: sticky; top: calc(var(--header-h) + 24px); font-size: 0.95rem; }
.cs-toc__title { font: 600 0.78rem/1 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.cs-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.cs-toc a { display: block; padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-3); text-decoration: none; line-height: 1.3; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.cs-toc a:hover { color: var(--ink); }
.cs-toc a.is-active { color: var(--ink); border-left-color: var(--primary); font-weight: 600; }
.cs-section { padding-top: clamp(32px, 5vw, 56px); }
.cs-section:first-child { padding-top: 0; }
.cs-section__no { margin: 0 0 6px; font: 700 1.6rem/1 var(--font-hand); color: var(--primary); }
.cs-section > h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }

.next-project { padding-bottom: clamp(24px, 4vw, 48px); }
.project-card--wide .project-card__link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.project-card--wide .cover { aspect-ratio: auto; min-height: 260px; height: 100%; }

/* ------------------------------------------------------------------ prose */

.prose { min-width: 0; }
.prose p, .prose li { max-width: 72ch; }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); }
.prose a:not(.btn) { color: var(--primary); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:not(.btn):hover { text-decoration-thickness: 3px; }
.prose h3 { font-size: 1.35rem; margin-top: 1.6em; }
.prose h4 { font-size: 1.05rem; margin-top: 1.4em; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.prose ul, .prose ol { margin: 0 0 1.2em; color: var(--ink-2); }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--primary); }
.prose mark { background: var(--mark); color: inherit; padding: 0 0.15em; border-radius: 3px; }
.prose code { font-size: 0.92em; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.prose blockquote { margin: 1.6em 0; padding: 18px 22px; border-left: 4px solid var(--primary); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.prose blockquote p { margin: 0; color: var(--ink); font-size: 1.12rem; }

.figure { margin: 1.8em 0; }
.figure .zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius); }
.figure img { width: 100%; max-height: min(82vh, 900px); object-fit: contain; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.figure .zoom:hover img { box-shadow: var(--shadow-1); }
.figure figcaption, .phone figcaption { margin-top: 10px; font-size: 0.95rem; color: var(--ink-3); max-width: 70ch; }
.gallery { display: grid; gap: 16px; margin: 1.8em 0; }
.gallery .figure { margin: 0; }
.gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.phones { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin: 2em 0; padding: clamp(20px, 3vw, 32px); border-radius: var(--radius-l); background: radial-gradient(80% 90% at 50% 0%, #2c2412 0%, #121522 60%, #0a0d15 100%); }
.phone { margin: 0; flex: 0 1 calc((100% - 72px) / 4); min-width: 150px; }
.phone__frame { aspect-ratio: 780 / 1688; border-radius: 28px; border: 6px solid #05060a; overflow: hidden; background: #05060a; box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5); }
.phone__frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phones .phone figcaption { color: #cfc8dc; }
.phones .phone figcaption strong { color: #ffd76a; }

.table-wrap { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; min-width: 560px; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font: 600 0.82rem/1.2 var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); }
tbody th { font-weight: 600; color: var(--ink); }
td { color: var(--ink-2); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

/* Markdown containers */
.md-callout { margin: 1.8em 0; padding: 20px 22px; border-radius: var(--radius); background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); }
.md-callout p { color: var(--ink); margin: 0; }
.md-callout p + p { margin-top: 0.8em; }
.md-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 1.8em 0; }
.md-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.md-card { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.md-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); }
.md-card h3 { margin-top: 0; font-size: 1.2rem; }
.md-card p:last-child, .md-card ul:last-child { margin-bottom: 0; }
.md-card.accent-violet { border-top: 6px solid var(--primary); }
.md-card.accent-sun { border-top: 6px solid #f2c94c; }
.md-card.accent-mint { border-top: 6px solid #34c38f; }
.md-card.accent-peach { border-top: 6px solid #ff8a65; }
.md-label { display: inline-block; margin-bottom: 10px; padding: 4px 10px; border-radius: 999px; font: 600 0.78rem/1.2 var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }

.md-stickies { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 26px; margin: 2em 0; padding: 8px 4px; }
.md-stickies blockquote { position: relative; margin: 0; padding: 22px 20px 18px; border: 0; border-radius: 3px 3px 18px 3px; color: var(--sticky-ink); box-shadow: 0 14px 28px rgba(23, 20, 31, 0.12); transform: rotate(-1.5deg); transition: transform 0.35s var(--ease); }
.md-stickies blockquote:nth-child(4n + 1) { background: var(--sun); }
.md-stickies blockquote:nth-child(4n + 2) { background: var(--mint); transform: rotate(1.4deg); }
.md-stickies blockquote:nth-child(4n + 3) { background: var(--lavender); transform: rotate(-0.8deg); }
.md-stickies blockquote:nth-child(4n + 4) { background: var(--peach); transform: rotate(2deg); }
.md-stickies blockquote:hover { transform: rotate(0) scale(1.03); }
.md-stickies blockquote p { color: var(--sticky-ink); font: 700 1.45rem/1.15 var(--font-hand); }

.md-numbered { counter-reset: num; margin: 1.8em 0; display: grid; gap: 16px; }
.md-numbered > ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.md-numbered > ol > li { counter-increment: num; position: relative; max-width: none; padding: 22px 22px 22px 92px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.md-numbered > ol > li::before { content: counter(num, decimal-leading-zero) '.'; position: absolute; left: 22px; top: 18px; font: 700 2.2rem/1 var(--font-head); color: var(--primary); }

.md-steps > ol { list-style: none; padding: 0; margin: 1.8em 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; counter-reset: s; }
.md-steps > ol > li { counter-increment: s; position: relative; max-width: none; padding: 54px 18px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 0.98rem; }
.md-steps > ol > li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 18px; top: 16px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font: 700 0.85rem/1 var(--font-head); }

.toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 1.8em 0; padding: 0; list-style: none; }
.toggle-card { padding: 18px 18px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.toggle-card__row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.switch { position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--line-strong); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform var(--dur) var(--ease); }
.toggle-card--on .switch { background: #1fa971; }
.toggle-card--on .switch::after { transform: translateX(20px); }
.toggle-card__title { margin: 0; font: 600 1.05rem/1.2 var(--font-head); color: var(--ink); }
.toggle-card__tag { margin-left: auto; font: 600 0.75rem/1 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; }
.toggle-card--on .toggle-card__tag { background: rgba(31, 169, 113, 0.14); color: #137a52; }
.toggle-card--off .toggle-card__tag { background: rgba(214, 69, 65, 0.12); color: #b23a36; }
:root[data-theme='dark'] .toggle-card--on .toggle-card__tag { color: #6fe0b0; }
:root[data-theme='dark'] .toggle-card--off .toggle-card__tag { color: #ff9b97; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .toggle-card--on .toggle-card__tag { color: #6fe0b0; }
  :root:not([data-theme='light']) .toggle-card--off .toggle-card__tag { color: #ff9b97; }
}
.toggle-card p { margin: 0; font-size: 0.98rem; }

.link-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.2em 0 2em; }

.md-diagram { margin: 2em 0; padding: clamp(18px, 3vw, 28px); border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
.ecosystem { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; min-width: 560px; }
.ecosystem__col { display: grid; gap: 10px; }
.ecosystem__node { padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface-2); font: 600 0.95rem/1.25 var(--font-head); }
.ecosystem__node span { display: block; font: 400 0.85rem/1.35 var(--font-body); color: var(--ink-3); margin-top: 2px; }
.ecosystem__hub { display: grid; place-items: center; width: 168px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #4a3a12, #121522 70%); color: #ffd76a; text-align: center; font: 700 1.1rem/1.15 var(--font-head); box-shadow: 0 0 0 10px color-mix(in srgb, #f2c94c 18%, transparent); padding: 18px; }
.ecosystem__hub small { display: block; margin-top: 6px; font: 500 0.8rem/1.3 var(--font-body); color: #e9e2c8; }
.ecosystem__arrow { color: var(--ink-3); font: 700 1.4rem/1 var(--font-head); text-align: center; }

/* ------------------------------------------------------------------ essay */

.essay__hero { padding-block: clamp(56px, 9vw, 120px) clamp(24px, 4vw, 40px); text-align: left; }
.essay__title { font-size: clamp(3rem, 9vw, 6.4rem); line-height: 0.95; letter-spacing: -0.045em; }
.essay__byline { font: 700 1.6rem/1 var(--font-hand); color: var(--primary); }
.essay__body { padding-bottom: clamp(40px, 6vw, 80px); }
.essay__body h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-top: 1.8em; }
.essay__body .question { font: 600 1.25rem/1.4 var(--font-head); color: var(--ink); margin: 0 0 1em; padding-left: 16px; border-left: 4px solid var(--sun); max-width: 60ch; }
.essay__body p { font-size: 1.15rem; line-height: 1.75; }
.pull { margin: 2em 0; font: 600 clamp(1.5rem, 3vw, 2.1rem)/1.25 var(--font-head); letter-spacing: -0.02em; color: var(--ink); max-width: 28ch; }
.pull::before { content: '“'; display: block; font: 700 4rem/0.6 var(--font-head); color: var(--primary); margin-bottom: 8px; }

/* ------------------------------------------------------------------ lightbox */

.lightbox { width: min(96vw, 1400px); max-height: 92vh; padding: 0; border: 0; border-radius: var(--radius); background: transparent; overflow: visible; }
.lightbox::backdrop { background: rgba(10, 8, 16, 0.82); backdrop-filter: blur(4px); }
.lightbox img { max-height: 88vh; width: auto; margin-inline: auto; border-radius: var(--radius); background: #fff; }
.lightbox__close { position: absolute; top: -14px; right: -6px; z-index: 1; }
.lightbox[open] { animation: lb-in 0.24s var(--ease); }
@keyframes lb-in { from { opacity: 0; transform: scale(0.97); } }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento__item, .bento__item--0, .bento__item--1 { grid-column: span 1; }
  .bento__item--0 { grid-column: 1 / -1; }
  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-layout { grid-template-columns: minmax(0, 1fr); }
  .cs-toc { display: none; }
  .off-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .hero, .about-hero { grid-template-columns: minmax(0, 1fr); }
  .hero__art { order: -1; width: min(82%, 340px); padding: 18px 16px 28px; }
  .note { font-size: 1.1rem; padding: 8px 12px 10px; }
  .note--mint { right: -2%; }
  .stats__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-meta > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .cs-meta > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .resume { grid-template-columns: minmax(0, 1fr); }
  .resume__side { position: static; }
  .project-card--wide .project-card__link { grid-template-columns: minmax(0, 1fr); }
  .project-card--wide .cover { aspect-ratio: 16 / 10; min-height: 0; }
  .site-footer__bottom { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento__item { grid-column: 1 / -1; }
  .process { grid-template-columns: minmax(0, 1fr); }
  .off-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery--2, .gallery--3 { grid-template-columns: minmax(0, 1fr); }
  .phones { gap: 16px; padding: 16px; }
  .phone { flex-basis: calc((100% - 16px) / 2); min-width: 0; }
  .md-cards.two { grid-template-columns: minmax(0, 1fr); }
  .phone__frame { border-width: 4px; border-radius: 20px; }
  .cs-hero__phones .mini-phone { width: 40%; border-width: 5px; border-radius: 24px; }
  .cs-hero__phones .mini-phone--hero-2 { display: none; }
  .cs-meta { grid-template-columns: minmax(0, 1fr); }
  .cs-meta > div, .cs-meta > div + div { padding: 14px 0; border-left: 0; }
  .cs-meta > div + div { border-top: 1px solid var(--line); }
  .md-numbered > ol > li { padding: 64px 18px 18px; }
  .btn--large { width: 100%; }
  .footer-cta__actions .btn { width: 100%; }
  .footer-cta__actions .btn span { overflow-wrap: anywhere; }
  .ecosystem { min-width: 520px; }
}

@media (hover: none) {
  .project-card.is-in:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .sticky.reveal { transform: rotate(var(--r, 0deg)); }
  .marquee__track { flex-wrap: wrap; width: auto; justify-content: center; }
  .marquee__track li[aria-hidden='true'] { display: none; }
  .note { transform: rotate(var(--r, 0deg)); }
}

@media print {
  .site-header, .site-footer, .progress, .cs-toc, .marquee { display: none; }
  .reveal { opacity: 1; transform: none; }
}
