/* ============================================================
   Mattia Marinangeli — Warm Editorial Grotesque
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-padding-top: 86px; }
/* smooth anchor navigation — disabled when the user prefers reduced motion */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body { margin: 0; }

:root {
  --grotesk: "Helvetica Neue", "Helvetica", "Arial", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --display-weight: 400;
  --display-tracking: -0.012em;
  --scale: 1;
  --maxw: 1320px;
  --gut: clamp(20px, 5vw, 88px);
}

/* ---- Theme tokens ---- */
.site {
  --paper: #f3efe6;
  --paper-2: #ece5d8;
  --ink: #1b1712;
  --ink-2: #6a6155;
  --line: rgba(27, 23, 18, 0.16);
  --line-soft: rgba(27, 23, 18, 0.09);
  --accent: #a85d34;
  --on-accent: #f7f2ea;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--grotesk);
  min-height: 100vh;
  overflow-x: hidden;
}
.site[data-theme="sabbia"] {
  --paper: #e9e0cf;
  --paper-2: #e0d5bf;
  --ink: #211a10;
  --ink-2: #6f6450;
  --line: rgba(33, 26, 16, 0.18);
  --line-soft: rgba(33, 26, 16, 0.10);
}
.site[data-theme="notte"] {
  --paper: #15130f;
  --paper-2: #1d1a14;
  --ink: #efe8da;
  --ink-2: #9d9484;
  --line: rgba(239, 232, 218, 0.16);
  --line-soft: rgba(239, 232, 218, 0.08);
  --on-accent: #15130f;
}

/* ---- Type primitives ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0;
}
.accent { color: var(--accent); }

h1, h2, h3 { font-weight: 600; margin: 0; letter-spacing: -0.025em; line-height: 0.98; }

.display {
  font-family: var(--display);
  font-size: calc(clamp(46px, 9vw, 132px) * var(--scale));
  font-weight: var(--display-weight);
  line-height: 1.06;
  letter-spacing: var(--display-tracking);
}
.section-title {
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: calc(clamp(32px, 5vw, 64px) * var(--scale));
  letter-spacing: var(--display-tracking);
  line-height: 1.06;
  text-wrap: balance;
}
.lead {
  font-size: calc(clamp(18px, 2.05vw, 27px) * var(--scale));
  line-height: 1.42;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-wrap: pretty;
  margin: 0;
}
.body {
  font-size: calc(clamp(16px, 1.15vw, 18.5px) * var(--scale));
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
  margin: 0;
}

/* ---- Section rhythm ---- */
section { position: relative; }
.sec-pad { padding-top: clamp(72px, 11vw, 168px); padding-bottom: clamp(72px, 11vw, 168px); }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: clamp(36px, 5vw, 68px); }
.sec-head .num { font-family: var(--mono); font-size: 12.5px; color: var(--accent); letter-spacing: 0.1em; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.rule-soft { border: 0; border-top: 1px solid var(--line-soft); margin: 0; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gut);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-name { font-weight: 600; font-size: 16px; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.nav-name span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav-links a {
  font-size: 14px; color: var(--ink-2); text-decoration: none; letter-spacing: -0.01em;
  position: relative; transition: color .25s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0; background: var(--ink);
  transition: width .3s cubic-bezier(.2,.7,0,1);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-hideable { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }

.lang {
  display: inline-flex; align-items: center; border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden; font-family: var(--mono); font-size: 11.5px;
}
.lang button {
  border: 0; background: transparent; color: var(--ink-2); padding: 6px 11px; cursor: pointer;
  letter-spacing: 0.06em; transition: color .2s ease, background .2s ease; font-family: inherit;
}
.lang button.on { background: var(--ink); color: var(--paper); }

/* ---- Hamburger button + mobile menu (hidden on desktop) ---- */
.nav-burger { display: none; }
.mobile-menu { display: none; }

@media (max-width: 760px) {
  .nav-hideable { display: none; }

  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; padding: 0; margin: -8px -8px -8px 0;
    border: 0; background: transparent; cursor: pointer; color: var(--ink);
    position: relative; z-index: 70;
  }
  .nav-burger span {
    display: block; width: 22px; height: 1.6px; margin-left: auto; background: currentColor;
    border-radius: 2px;
    transition: transform .35s cubic-bezier(.2,.7,0,1), opacity .2s ease, width .3s ease;
  }
  .nav-burger.is-open span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); width: 24px; }
  .nav-burger.is-open span:nth-child(2) { opacity: 0; }
  .nav-burger.is-open span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); width: 24px; }

  body.menu-open { overflow: hidden; }

  .mobile-menu { display: block; position: fixed; inset: 0; z-index: 55; pointer-events: none; }
  .mobile-menu.is-open { pointer-events: auto; }

  .mobile-menu-scrim {
    position: absolute; inset: 0;
    background: color-mix(in srgb, var(--ink) 42%, transparent);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; transition: opacity .35s ease;
  }
  .mobile-menu.is-open .mobile-menu-scrim { opacity: 1; }

  .mobile-menu-panel {
    position: absolute; top: 0; right: 0; height: 100dvh; width: min(82vw, 320px);
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 92px var(--gut) 40px;
    background: var(--paper); border-left: 1px solid var(--line-soft);
    box-shadow: -30px 0 80px rgba(0, 0, 0, 0.22);
    transform: translateX(100%); transition: transform .42s cubic-bezier(.2,.7,0,1);
    overflow-y: auto;
  }
  .mobile-menu.is-open .mobile-menu-panel { transform: translateX(0); }

  .mobile-menu-links { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin-bottom: 28px; }
  .mobile-menu-links a {
    font-family: var(--display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking);
    font-size: 30px; line-height: 1.1; color: var(--ink); text-decoration: none;
    width: 100%; padding: 14px 0; border-bottom: 1px solid var(--line-soft);
    transition: color .2s ease, padding-left .25s cubic-bezier(.2,.7,0,1);
  }
  .mobile-menu-links a:hover, .mobile-menu-links a:focus-visible { color: var(--accent); padding-left: 8px; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(48px, 8vw, 110px); padding-bottom: clamp(40px, 6vw, 80px); position: relative; isolation: isolate; }
/* soft accent glow — adds warmth/colour behind the opening */
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: clamp(-40px, -3vw, -10px); left: -6%; width: min(70%, 760px); height: 118%;
  background: radial-gradient(60% 60% at 35% 40%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 72%);
  filter: blur(18px);
}
.hero-avail {
  display: inline-flex; align-items: center; gap: 9px; margin-bottom: clamp(28px, 5vw, 52px);
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; color: var(--ink-2);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 50%, transparent); }
.dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--accent); opacity: .8; animation: pulse 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
@keyframes pulse { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(2.4); opacity: 0; } }

.hero-grid { display: grid; grid-template-columns: 1fr; gap: clamp(28px, 4vw, 56px); align-items: end; }

.hero h1 .ln { display: block; }

/* Highlight line — animated accent treatment */
.hero h1 .ln.alt {
  display: inline-block;
  position: relative;
  isolation: isolate;
  color: var(--accent);
  padding-right: 0.04em;
}
/* highlighter mark that draws in behind the word */
.hero h1 .ln.alt::before {
  content: "";
  position: absolute;
  left: -0.05em; right: -0.05em;
  bottom: 0.08em; height: 0.30em;
  z-index: -1; border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  transform: scaleX(0); transform-origin: left center;
  animation: heroMark 0.9s cubic-bezier(.2,.7,0,1) 0.45s both;
}
/* gradient sheen + soft glow (only where text-clip is supported) */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 .ln.alt {
    background-image: linear-gradient(
      100deg,
      var(--accent) 0%,
      color-mix(in srgb, var(--accent) 48%, #ffffff) 48%,
      var(--accent) 74%);
    background-size: 220% 100%;
    background-position: 0% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 5px 26px color-mix(in srgb, var(--accent) 26%, transparent));
    animation: heroSheen 7s ease-in-out infinite;
  }
}
@keyframes heroSheen {
  0% { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}
@keyframes heroMark { 
  0% { transform: scaleX(0); } 
  70% { transform: scaleX(1.04); } 
  100% { transform: scaleX(1); } 
}
.hero-lower {
  display: grid; grid-template-columns: 1fr; gap: clamp(24px, 3vw, 44px);
  margin-top: clamp(36px, 5vw, 64px); align-items: start;
}
@media (min-width: 860px) { .hero-lower { grid-template-columns: 1.1fr 1fr; } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px;
  font-size: 15px; letter-spacing: -0.01em; text-decoration: none; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--ink); transition: all .35s cubic-bezier(.2,.7,0,1);
}
.btn .arr { transition: transform .35s cubic-bezier(.2,.7,0,1); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 30%, transparent); transform: translateY(-2px); }
.btn-solid:hover .arr { transform: translate(3px, -3px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); box-shadow: 0 10px 24px color-mix(in srgb, var(--ink) 12%, transparent); }
.btn-ghost:hover .arr { transform: translate(3px, -3px); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .1s; }


/* stats strip */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: clamp(48px, 7vw, 96px); }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--paper); padding: clamp(22px, 3vw, 36px) 4px clamp(20px, 3vw, 32px); }
.stat .v { font-size: calc(clamp(34px, 4.6vw, 60px) * var(--scale)); font-weight: 600; letter-spacing: -0.04em; line-height: 1; transition: color .3s ease; }
.stat:hover .v { color: var(--accent); }
.stat .l { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); letter-spacing: 0.04em; margin-top: 12px; max-width: 22ch; }

/* ── Theme menu — header trigger + popover ──────────────────────────────────── */
.theme-menu { position: relative; display: inline-flex; }
.theme-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink-2); cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; white-space: nowrap;
  transition: color .2s ease, border-color .2s ease, transform .12s ease;
}
.theme-trigger:hover, .theme-trigger.is-open { color: var(--ink); border-color: var(--ink-2); }
.theme-trigger:active { transform: scale(.97); }
.theme-dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); transition: background .25s ease; }

.theme-pop {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 80;
  width: min(320px, calc(100vw - 32px)); padding: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px) scale(.98); transform-origin: top right;
  transition: opacity .22s cubic-bezier(.2,.7,0,1), transform .22s cubic-bezier(.2,.7,0,1), visibility .22s;
}
.theme-pop.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.theme-pop .ds-cell + .ds-cell { border-top: 1px solid var(--line-soft); }
@media (prefers-reduced-motion: reduce) {
  .theme-pop { transition: opacity .12s ease, visibility .12s; transform: none; }
}

/* mobile: controls live at the bottom of the slide-in menu */
.mobile-theme { width: 100%; margin-top: 8px; border-top: 1px solid var(--line-soft); }
.mobile-theme .ds-cell { padding-left: 0; padding-right: 0; }

/* control rows — shared by popover and mobile menu */
.ds-cell { background: transparent; padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.ds-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.ds-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-seg button { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.01em; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer; transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease; }
.ds-seg button:hover { border-color: var(--ink-2); color: var(--ink); }
.ds-seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ds-seg button:active { transform: scale(.95); transition-duration: .08s; }
.ds-swatches { display: flex; gap: 10px; }
.ds-swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); padding: 0; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.ds-swatch:hover { transform: scale(1.1); }
.ds-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
/* custom color picker — rainbow ring with current accent in the centre */
.ds-pick {
  position: relative; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); padding: 0; cursor: pointer; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: conic-gradient(from 90deg, #ff5f6d, #ffc371, #2ec5a0, #4f9be0, #a06cf0, #ff5f6d);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ds-pick:hover { transform: scale(1.1); }
.ds-pick.is-custom { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.ds-pick-dot { width: 15px; height: 15px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--paper); transition: background .2s ease; }
.ds-pick input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; cursor: pointer; }

/* ============================================================
   WORK LIST
   ============================================================ */
.work-list { border-top: 1px solid var(--line); }
.work-row {
  display: grid; grid-template-columns: 1fr; gap: 6px;
  padding: clamp(22px, 3vw, 34px) 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit; position: relative; cursor: pointer;
}
@media (min-width: 800px) {
  .work-row { grid-template-columns: 0.5fr 1.3fr 1.6fr auto; align-items: center; gap: 28px; }
}
.work-row .wr-client { font-size: calc(clamp(26px, 3.4vw, 44px) * var(--scale)); font-weight: 600; letter-spacing: -0.03em; transition: transform .4s cubic-bezier(.2,.7,0,1); }
.work-row .wr-year { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); letter-spacing: 0.06em; }
.work-row .wr-role { font-size: calc(clamp(15px, 1.2vw, 18px) * var(--scale)); color: var(--ink); }
.work-row .wr-arr { font-size: 22px; color: var(--ink-2); justify-self: start; transition: transform .35s cubic-bezier(.2,.7,0,1), color .35s ease; }
@media (min-width: 800px) { .work-row .wr-arr { justify-self: end; } }
.work-row:hover .wr-client { transform: translateX(10px); color: var(--accent); }
.work-row .wr-chip {
  display: inline-flex; align-items: center; vertical-align: middle;
  margin-left: 14px; padding: 4px 10px; border: 1px solid var(--line);
  border-radius: 999px; font-family: var(--mono); font-size: 11px; font-weight: 400;
  letter-spacing: 0.04em; color: var(--ink-2); text-transform: none; white-space: nowrap;
  transform: translateY(-0.18em); transition: border-color .3s ease, color .3s ease;
}
.work-row:hover .wr-chip { border-color: var(--accent); color: var(--accent); }
.work-row:hover .wr-arr { transform: translate(6px, -6px); color: var(--accent); }

/* floating UI preview — position/opacity driven by GSAP (see WorkRow) */
.wr-thumb {
  position: fixed; top: 0; left: 0; width: 300px; aspect-ratio: 4 / 3;
  pointer-events: none; z-index: 40; opacity: 0; will-change: transform, opacity;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
}
.wr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 799px) { .wr-thumb { display: none; } }
@media (prefers-reduced-motion: reduce) { .wr-thumb { display: none; } }

/* expandable result */
.work-row .wr-result { color: var(--ink-2); font-size: calc(clamp(14px, 1vw, 16px) * var(--scale)); line-height: 1.5; max-width: 56ch; }
.work-row .wr-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em; color: var(--accent);
  text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding-bottom: 2px; transition: border-color .25s ease, gap .25s ease;
}
.work-row .wr-link:hover { border-color: var(--accent); gap: 9px; }
.work-row .wr-actions { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 14px; }
.work-row .wr-video-btn { background: none; border: 0; cursor: pointer; padding: 0; padding-bottom: 2px; }
.work-row .wr-video-btn svg { transform: translateY(0.5px); }

/* video lightbox */
.video-modal {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 64px); background: color-mix(in srgb, #000 72%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  cursor: pointer; animation: vm-in .25s ease;
}
@keyframes vm-in { from { opacity: 0; } to { opacity: 1; } }
.video-shell { position: relative; width: min(1000px, 100%); cursor: default; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.5); background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-close {
  position: absolute; top: -44px; right: 0; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; cursor: pointer;
  font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .2s ease, border-color .2s ease;
}
.video-close:hover { background: rgba(255,255,255,.15); border-color: #fff; }

/* compact mobile variant — tighter rows, arrow pinned top-right */
@media (max-width: 799px) {
  .work-row { gap: 3px; padding: 16px 0; padding-right: 30px; }
  .work-row .wr-year { font-size: 11px; letter-spacing: 0.08em; }
  .work-row .wr-client { font-size: calc(clamp(20px, 5.6vw, 25px) * var(--scale)); line-height: 1.12; }
  .work-row .wr-chip { margin-left: 10px; padding: 3px 8px; font-size: 10px; }
  .work-row .wr-role { font-size: calc(13.5px * var(--scale)); line-height: 1.4; color: var(--ink-2); }
  .work-row .wr-arr {
    position: absolute; top: 16px; right: 0;
    font-size: 16px; justify-self: auto;
  }
  .work-row .wr-arr svg { width: 18px; height: 18px; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 5vw, 72px); }
@media (min-width: 900px) { .about-grid { grid-template-columns: 0.85fr 1.15fr; align-items: start; } }
.about-portrait { width: 100%; aspect-ratio: 3/2; position: sticky; top: 92px; object-fit: cover; border-radius: 6px; display: block; }
.about-body p { margin: 0 0 22px; }
.about-body p:last-child { margin-bottom: 0; }
.about-body p:first-of-type { font-size: calc(clamp(16px, 1.15vw, 18.5px) * var(--scale)); color: var(--ink); line-height: 1.6; letter-spacing: 0; }

/* ============================================================
   EXPERIENCE
   ============================================================ */
.exp-row {
  display: grid; grid-template-columns: 1fr; gap: 6px; padding: clamp(20px, 2.6vw, 30px) 0;
  border-bottom: 1px solid var(--line-soft);
}
@media (min-width: 760px) { .exp-row { grid-template-columns: 0.7fr 1fr 1.6fr; gap: 28px; align-items: baseline; } }
.exp-row:first-child { border-top: 1px solid var(--line); }
.exp-period { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); letter-spacing: 0.04em; }
.exp-co { font-size: calc(clamp(18px, 1.6vw, 23px) * var(--scale)); font-weight: 600; letter-spacing: -0.02em; }
.exp-co .place { display: block; font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--ink-2); letter-spacing: 0.06em; margin-top: 5px; }
.exp-desc { color: var(--ink-2); font-size: calc(clamp(14px, 1vw, 16.5px) * var(--scale)); line-height: 1.5; }

/* ============================================================
   TEACHING (cards)
   ============================================================ */
.teach-photo { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; object-position: center 32%; border-radius: 6px; display: block; margin-bottom: clamp(28px, 3.4vw, 48px); }
/* seminar gallery — grows with however many photos are added in content.js */
.teach-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(10px, 1.4vw, 18px); margin-bottom: clamp(28px, 3.4vw, 48px); }
.teach-shot { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; transition: filter .55s ease, transform .6s cubic-bezier(.2,.7,0,1); }
.teach-shot:hover { filter: brightness(1.05) saturate(1.06); transform: translateY(-2px); }
.teach-grid { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 820px) { .teach-grid { grid-template-columns: repeat(3, 1fr); } }
.teach-card { background: var(--paper); padding: clamp(24px, 3vw, 38px); display: flex; flex-direction: column; gap: 14px; min-height: 240px; transition: background .3s ease, transform .4s cubic-bezier(.2,.7,0,1); }
.teach-card:hover { background: var(--paper-2); transform: translateY(-3px); }
.teach-card .tc-years { font-family: var(--mono); font-size: 11.5px; color: var(--accent); letter-spacing: 0.06em; }
.teach-card .tc-org { font-size: calc(clamp(20px, 1.9vw, 27px) * var(--scale)); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; }
.teach-card .tc-place { font-family: var(--mono); font-size: 11px; color: var(--ink-2); letter-spacing: 0.06em; }
.teach-card .tc-desc { color: var(--ink-2); font-size: calc(14.5px * var(--scale)); line-height: 1.55; margin-top: auto; }

/* ============================================================
   PLUGINS
   ============================================================ */
.plug-grid { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 720px) { .plug-grid { grid-template-columns: 1fr 1fr; } }
.plug-card { background: var(--paper); padding: clamp(26px, 3.4vw, 46px); display: flex; flex-direction: column; gap: 16px; transition: background .3s ease, transform .4s cubic-bezier(.2,.7,0,1); text-decoration: none; color: inherit; }
.plug-card:hover { background: var(--paper-2); transform: translateY(-3px); }
.plug-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.plug-name { font-size: calc(clamp(24px, 2.6vw, 38px) * var(--scale)); font-weight: 600; letter-spacing: -0.03em; transition: color .3s ease; }
.plug-card:hover .plug-name { color: var(--accent); }
.plug-users { font-family: var(--mono); font-size: 12.5px; color: var(--accent); letter-spacing: 0.04em; white-space: nowrap; }
.plug-arr { color: var(--ink-2); transition: transform .3s cubic-bezier(.2,.7,0,1), color .3s ease; }
.plug-card:hover .plug-arr { color: var(--accent); transform: translate(3px, -3px); }
.plug-desc { color: var(--ink-2); font-size: calc(clamp(14px, 1vw, 16.5px) * var(--scale)); line-height: 1.55; max-width: 44ch; }
.plug-foot { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--ink-2); transition: color .3s ease; }
.plug-card:hover .plug-foot { color: var(--accent); }
.plug-foot .arr { transition: transform .3s cubic-bezier(.2,.7,0,1); }
.plug-card:hover .plug-foot .arr { transform: translate(3px, -3px); }

/* ============================================================
   CLIENTS (marquee)
   ============================================================ */
.clients { padding-top: clamp(56px, 8vw, 120px); padding-bottom: clamp(56px, 8vw, 120px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.marquee { display: flex; gap: 0; width: max-content; animation: marq 38s linear infinite; }
.site[data-motion="off"] .marquee { animation: none; flex-wrap: wrap; width: auto; }
.marquee:hover { animation-play-state: paused; }
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marq-item { font-size: calc(clamp(30px, 4.4vw, 64px) * var(--scale)); font-weight: 600; letter-spacing: -0.03em; padding: 0 clamp(20px, 3vw, 44px); white-space: nowrap; color: var(--ink); }
.marq-item .sep { color: var(--accent); margin-left: clamp(20px, 3vw, 44px); }
.site[data-motion="off"] .marq-item { padding: 8px clamp(16px, 2vw, 30px); }

/* ============================================================
   PHOTOGRAPHY
   ============================================================ */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(10px, 1.4vw, 18px); margin-top: clamp(32px, 4vw, 56px); }
@media (min-width: 760px) { .photo-grid { grid-template-columns: repeat(12, 1fr); grid-auto-rows: clamp(120px, 13vw, 200px); } }
.photo-slot { width: 100%; height: 100%; min-height: 180px; object-fit: cover; border-radius: 6px; display: block; transition: filter .55s ease, transform .6s cubic-bezier(.2,.7,0,1); }
.photo-slot:hover { filter: brightness(1.05) saturate(1.06); }
@media (min-width: 760px) {
  .ph-a { grid-column: span 7; grid-row: span 2; }
  .ph-b { grid-column: span 5; grid-row: span 1; }
  .ph-c { grid-column: span 5; grid-row: span 1; }
  .ph-d { grid-column: span 4; grid-row: span 2; }
  .ph-e { grid-column: span 8; grid-row: span 2; }
  .photo-slot { min-height: 0; }
}

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact { background: var(--ink); color: var(--paper); }
.contact .eyebrow { color: color-mix(in srgb, var(--paper) 64%, transparent); }
.contact .accent { color: var(--accent); }
.contact-title { font-family: var(--display); font-size: calc(clamp(42px, 8vw, 120px) * var(--scale)); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.02; color: var(--paper); }
.contact-lead { color: color-mix(in srgb, var(--paper) 74%, transparent); }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 1px; background: color-mix(in srgb, var(--paper) 18%, transparent); border: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); margin-top: clamp(40px, 6vw, 80px); }
@media (min-width: 720px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
.contact-cell { background: var(--ink); padding: clamp(22px, 3vw, 36px); display: flex; flex-direction: column; gap: 8px; }
.contact-cell .cc-l { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: color-mix(in srgb, var(--paper) 55%, transparent); }
.contact-cell a, .contact-cell .cc-v { color: var(--paper); text-decoration: none; font-size: calc(clamp(18px, 1.8vw, 26px) * var(--scale)); letter-spacing: -0.02em; transition: color .25s ease; width: fit-content; }
.contact-cell a:hover { color: var(--accent); }
.contact-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 26px var(--gut); border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); }
.contact-foot, .contact-foot a { color: color-mix(in srgb, var(--paper) 62%, transparent); font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-decoration: none; }
.contact-foot a:hover { color: var(--paper); }

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
/* Reveal is opt-in & non-blocking: elements are visible by default.
   JS adds .will-reveal ONLY to below-the-fold elements (so above-the-fold
   content never depends on JS/animation), then .is-in on scroll. */
.reveal { opacity: 1; transform: none; }
.site[data-motion="on"] .reveal.will-reveal {
  opacity: 0; transform: translateY(26px); filter: blur(8px);
  will-change: opacity, transform, filter;
}
.site[data-motion="on"] .reveal.will-reveal.is-in,
.site[data-motion="on"] .reveal.is-in {
  opacity: 1; transform: none; filter: blur(0);
  transition:
    opacity .9s cubic-bezier(.2,.7,0,1),
    transform .9s cubic-bezier(.2,.7,0,1),
    filter .9s cubic-bezier(.2,.7,0,1);
  transition-delay: var(--rd, 0ms);
}
/* release the compositor hint once the element has settled */
.site[data-motion="on"] .reveal.is-in { will-change: auto; }
@media (prefers-reduced-motion: reduce) {
  .site[data-motion="on"] .reveal.will-reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
  .marquee { animation: none !important; }
  .dot::after { animation: none !important; }
  .hero h1 .ln.alt { animation: none !important; background-position: 0 0 !important; }
  .hero h1 .ln.alt::before { animation: none !important; transform: scaleX(1) !important; }
  .btn:hover { transform: none !important; box-shadow: none !important; }
}
/* failsafe: only added if the observer never fired — snap everything visible */
.reveal-failsafe .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }

/* image-slot: always-visible frame so empty slots read on any theme */
image-slot { border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2); }

/* ============================================================
   CASE STUDY PAGE  (case-study.html / case-study.jsx)
   ============================================================ */
.cs-site { min-height: 100vh; }

/* password gate */
.cs-gate { min-height: 100vh; display: grid; place-items: center; padding: var(--gut); }
.cs-gate-card { width: min(540px, 100%); display: flex; flex-direction: column; align-items: flex-start; }
.cs-field { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
.cs-field input {
  flex: 1 1 220px; min-width: 0; padding: 13px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  font-family: var(--grotesk); font-size: 15px; outline: none; transition: border-color .2s ease;
}
.cs-field input:focus { border-color: var(--ink-2); }
.cs-field.has-err input { border-color: #d9655f; }
.cs-field .btn { flex: 0 0 auto; }
.cs-field .btn:disabled { opacity: .5; cursor: not-allowed; }
.cs-err { color: #e0726c; font-family: var(--mono); font-size: 12.5px; margin-top: 12px; }
.cs-back { font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; color: var(--ink-2); text-decoration: none; transition: color .2s ease; }
.cs-back:hover { color: var(--ink); }
.cs-gate-card .cs-back { margin-top: 28px; }

/* case study layout */
.cs-nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gut);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.cs-head { padding-top: clamp(44px, 7vw, 96px); padding-bottom: clamp(8px, 2vw, 20px); }
.cs-title { font-size: calc(clamp(40px, 8vw, 112px) * var(--scale)); line-height: 1.02; margin-top: 14px; }
.cs-hero {
  width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
  margin-top: clamp(24px, 3.5vw, 48px);
}
.cs-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-body { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(32px, 5vw, 64px); }
.cs-intro { max-width: 56ch; }
.cs-section { margin-top: clamp(40px, 6vw, 80px); }
.cs-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(10px, 1.4vw, 18px); margin-top: 24px; }
.cs-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.cs-placeholder { margin-top: clamp(28px, 4vw, 56px); padding: clamp(28px, 4vw, 56px); border: 1px dashed var(--line); border-radius: 12px; }
.cs-foot { padding-bottom: clamp(56px, 8vw, 120px); }

/* "Read the case study" row link */
.wr-link.wr-case { font-weight: 500; }
