/* ============================================================
   Vivienne Xu — portfolio · Version 3
   Phase 1: design-system foundation.
   Monochrome. White base, selective grey bands. Editorial.
   ------------------------------------------------------------
   1. Tokens      2. Reset/base   3. Typography   4. Layout
   5. Components  6. Nav          7. Home         8. About
   9. Projects   10. Detail/modal 11. Speaking   12. Publications
  13. Footer     14. Motion/responsive
   ============================================================ */

/* ---------- 0. FONTS ---------- */
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 500; font-display: swap; src: url("assets/fonts/playfair-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/playfair-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/playfair-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/inter-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/inter-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/inter-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/inter-700-normal.woff2") format("woff2"); }

/* ---------- 1. TOKENS ---------- */
:root {
  /* surface + ink (white-base model) */
  --bg:          #ffffff;
  --bg-alt:      #f7f7f7;
  --silver:      #c9ccd1;   /* darker silver-grey for carousel backdrop */
  --ink:         #171717;
  --ink-strong:  #0a0a0a;
  --ink-2:       #5c5c5c;   /* secondary text — AA on white */
  --ink-3:       #737373;   /* muted meta */
  --line:        #e5e5e5;
  --line-2:      #d4d4d4;
  --surface:     #ffffff;   /* interactive card surface */

  /* type families (unchanged) */
  --serif: "Playfair Display", "Didot", "Bodoni MT", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* modular type scale (fluid) — bold editorial */
  --fs-hero:    clamp(40px, 7vw, 86px);   /* hero statement */
  --fs-display: clamp(44px, 6.2vw, 76px);
  --fs-h1:      clamp(38px, 5.4vw, 68px); /* page titles — large */
  --fs-h2:      clamp(28px, 3.6vw, 40px);
  --fs-h3:      clamp(22px, 2.6vw, 29px);
  --fs-lead:    clamp(18px, 1.6vw, 21px);
  --fs-body:    clamp(16px, 1.05vw, 17px);
  --fs-sm:      14px;
  --fs-xs:      12.5px;

  /* spacing scale (8px base) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --space-section: clamp(56px, 8vw, 104px);

  /* layout */
  --maxw: 1280px;
  --maxw-content: 1120px;
  --measure: 68ch;              /* comfortable reading width */
  --gutter: clamp(20px, 5vw, 64px);

  /* radii — restrained */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  /* shadows — very subtle, used sparingly */
  --shadow-sm: 0 1px 2px rgba(23,23,23,.04), 0 2px 10px rgba(23,23,23,.05);
  --shadow-md: 0 6px 24px rgba(23,23,23,.09);

  /* motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --dur-fast: 200ms;
  --dur:      300ms;
  --dur-slow: 460ms;
}

/* ---------- 2. RESET / BASE ---------- */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: var(--fs-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
::selection { background: var(--ink); color: var(--bg); }

/* visible focus for keyboard users */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

/* ---------- 3. TYPOGRAPHY ---------- */
h1,h2,h3,h4 { margin: 0; font-weight: 500; line-height: 1.1; letter-spacing: -.015em; color: var(--ink-strong); }
h1 { font-family: var(--serif); font-size: var(--fs-h1); }
h2 { font-family: var(--serif); font-size: var(--fs-h2); }
h3 { font-family: var(--sans); font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.01em; }
p  { margin: 0; }

/* editorial eyebrow label (replaces scattered uppercase tags) */
.eyebrow {
  font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}

/* page title — serif, large, confident, no decorative dot */
.ptitle { font-family: var(--serif); font-weight: 600; font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -.025em; margin-bottom: var(--s5); max-width: 16ch; }

/* ---------- 4. LAYOUT ---------- */
.wrap { width: 100%; max-width: var(--maxw-content); margin-inline: auto; padding-inline: var(--gutter); }
section { padding-block: var(--space-section); }
.section--alt { background: var(--bg-alt); }
.measure { max-width: var(--measure); }

/* page router */
/* continuous single-page scroll — all sections stacked & visible */
.page { display: block; scroll-margin-top: clamp(64px, 8vw, 86px); }
/* section page-breaker: hairline divider at the top of each section after home */
#about > section > .wrap,
#projects > section > .wrap,
#speaking > section > .wrap { border-top: 1px solid var(--line); padding-top: var(--space-section); }
#about > section,
#projects > section,
#speaking > section { padding-top: 0; }

/* ---------- 5. COMPONENTS ---------- */
/* text link with arrow — the single link-forward interaction */
.link-arrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
  transition: gap var(--dur) var(--ease);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ghost button / pill — one treatment */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink); background: var(--surface);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.btn:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn svg { width: 16px; height: 16px; }
.btn--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--solid:hover { background: var(--ink-strong); color: var(--bg); }

/* ---------- 6. NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__home {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink-strong);
  letter-spacing: -.02em; transition: opacity var(--dur) var(--ease);
}
.nav__home:hover { opacity: .62; }
.nav__links { display: flex; gap: clamp(16px, 2.2vw, 30px); align-items: center; }
.nav__links a {
  position: relative; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-3);
  padding: 4px 0; transition: color var(--dur) var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 100%; height: 1.5px;
  background: var(--ink); transform: scaleX(0); transform-origin: right;
  transition: transform var(--dur-fast) var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--ink); }
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav__toggle { display: none; }

/* ---------- 7. HOME ---------- */
.hero { padding-top: clamp(24px, 3.4vw, 48px); padding-bottom: clamp(20px, 2.6vw, 34px); }
/* top row: small portrait + name/typed beside it */
.hero__top { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); }
.hero__id { display: flex; flex-direction: column; }
/* everything else drops below, full width from the left */
.hero__below { margin-top: clamp(18px, 2.4vw, 32px); }

.hero__contactline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s5); margin-top: var(--s3); }
.hero__loc { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-3); }
.hero__loc svg { width: 26px; height: 26px; color: var(--ink); flex: 0 0 auto; }

/* name — quiet, confident lead-in above the big statement */
.hero__name { font-family: var(--sans); font-weight: 600; font-size: clamp(18px, 2vw, 24px); letter-spacing: -.01em; color: var(--ink-3); margin-bottom: var(--s2); }

/* playful typed line — Playfair italic, the dominant personality line */
.hero__play { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: clamp(32px, 5vw, 58px); color: var(--ink-strong); line-height: 1.04; letter-spacing: -.02em; }
.hero__play .typed { font-style: italic; }
.caret { display: inline-block; width: 2px; height: .86em; translate: 0 .1em; background: var(--ink); margin-left: 4px; border-radius: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* the positioning statement */
.hero__statement { font-family: var(--serif); font-weight: 500; font-size: clamp(18px, 2vw, 25px); line-height: 1.3; letter-spacing: -.01em; color: var(--ink); max-width: none; }
.hero__sub { margin-top: var(--s2); }
.hero__sub .lead-2 { color: var(--ink-3); font-size: var(--fs-lead); font-style: italic; font-family: var(--serif); }

/* portrait — small, round, left of name/typed */
.hero__portrait { position: relative; flex: 0 0 auto; }
.hero__portrait img { width: clamp(110px, 11vw, 136px); height: auto; aspect-ratio: 1/1; object-fit: cover; border-radius: 50%; box-shadow: var(--shadow-md); position: relative; z-index: 1; }
.hero__portrait::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 1px solid var(--line-2); }

/* contact — editorial text links, not pills */
.contact-row { display: flex; flex-wrap: wrap; gap: var(--s5); }
.contact-row a { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); padding-bottom: 2px; border-bottom: 1.5px solid var(--ink); transition: opacity var(--dur) var(--ease); }
.contact-row a:hover { opacity: .55; }
.contact-row svg { width: 16px; height: 16px; }

/* home index — three horizontal cards; shorter images, bigger titles */
.hindex { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 1.8vw, 24px); margin-top: clamp(16px, 2vw, 28px); }
.hidx { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.hidx:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--line-2); }
.hidx__media { aspect-ratio: 20/7; overflow: hidden; background: var(--bg-alt); }
.hidx__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease); }
.hidx:hover .hidx__media img { transform: scale(1.03); }
.hidx__foot { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); }
.hidx__title { font-family: var(--serif); font-weight: 600; font-size: clamp(20px, 1.9vw, 26px); letter-spacing: -.01em; color: var(--ink-strong); }
.hidx__arrow { color: var(--ink); font-size: 20px; transition: transform var(--dur) var(--ease); }
.hidx:hover .hidx__arrow { transform: translateX(4px); }

/* credentials — full-bleed grey band, logos rolling (marquee) */
.banner { background: var(--bg-alt); margin-top: clamp(16px, 2vw, 26px); padding-block: clamp(20px, 2.4vw, 30px); overflow: hidden; }
.marquee { display: flex; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.marquee__track { display: flex; align-items: center; gap: clamp(32px, 4.5vw, 64px); padding-right: clamp(32px, 4.5vw, 64px); animation: scroll 34s linear infinite; }
.banner:hover .marquee__track { animation-play-state: paused; }
.marquee__track img { height: clamp(37px, 3.9vw, 52px); width: auto; object-fit: contain; opacity: .9; flex: 0 0 auto; }
.marquee__track img.badge { height: clamp(58px, 6.4vw, 82px); }
.marquee__track img.insead-banner { height: clamp(48px, 5.1vw, 66px); }
.marquee__track img[alt="McKinsey & Company"] { height: clamp(30px, 3.4vw, 45px); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- 8. ABOUT ---------- */
.about__intro { max-width: none; }
.about__intro p { font-size: var(--fs-lead); color: var(--ink-2); line-height: 1.55; }
.about__intro p + p { margin-top: var(--s4); }
.about__intro p strong { color: var(--ink); font-weight: 600; }
.about-block h3 { font-size: var(--fs-h3); margin-bottom: var(--s4); }

/* professional journey (illustrated panel) + certificates side by side */
.jc-row { display: grid; grid-template-columns: 2.1fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; margin-top: var(--s6); }
.journey img { display: block; width: 100%; height: auto; }

/* certificates — single-column list in the right-hand column */
.certs-block { }
.certs { display: grid; grid-template-columns: 1fr; gap: 0; }
/* pre-drop: hide logos until the drop-in plays (base stays visible if JS/clock stalls) */
.certs--pending .cert__logo { opacity: 0; }
.cert { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: var(--s4); padding: var(--s4) 0; border-top: 1px solid var(--line); }
.cert:last-child { border-bottom: 1px solid var(--line); }
.cert__logo { height: 40px; display: flex; align-items: center; justify-content: center; }
.cert__logo img { max-height: 40px; width: auto; }
.cert__logo img.badge { max-height: 46px; }
.cert__logo img.sm-logo { max-height: 28px; }
.cert__name { font-size: var(--fs-sm); font-weight: 500; line-height: 1.4; color: var(--ink-2); }

/* education + language — one horizontal bar, labels inline with their logos/flags */
.edu-lang-row { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(28px,4vw,64px); margin-top: var(--s7); padding-top: var(--s6); border-top: 1px solid var(--line); }
.edu-block, .lang-block { display: flex; align-items: center; gap: clamp(20px,2.5vw,36px); }
.el-label { font-family: var(--serif); font-size: var(--fs-h3); margin: 0; flex: 0 0 auto; }
.edu-logos { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s5); }
.edu-logos img { height: 48px; width: auto; max-width: 120px; object-fit: contain; transition: transform var(--dur) var(--ease); }
.edu-logos img.insead { height: 40px; max-width: 150px; }
.edu-logos img:hover { transform: translateY(-2px); }
.flags { display: flex; gap: var(--s3); flex-wrap: nowrap; align-items: center; }
.flags img { width: 42px; height: 28px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); transition: transform var(--dur) var(--ease); }
.flags img:hover { transform: translateY(-2px); }
.el-div { flex: 0 0 auto; width: 1px; height: 34px; background: var(--line-2); }

/* ---------- 9. PROJECTS — 4-column compact grid ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: clamp(16px, 1.8vw, 24px); }
.proj-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); display: flex; flex-direction: column;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.proj-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-3px); border-color: var(--line-2); }
.proj-card__art { aspect-ratio: 20/9; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); }
.proj-card__art img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease); }
.proj-card:hover .proj-card__art img { transform: scale(1.03); }
.proj-card__body { padding: var(--s4); display: flex; flex-direction: column; flex: 1; }
.proj-card__tag { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.proj-card__tag.fun { color: var(--ink); }
.proj-card__title { font-family: var(--serif); font-size: clamp(14px, 1.1vw, 16px); line-height: 1.2; margin: var(--s2) 0 var(--s2); }
.proj-card__desc { font-size: var(--fs-sm); color: var(--ink-2); flex: 1; line-height: 1.46; }
.proj-card__foot { margin-top: var(--s4); display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
/* explore — solid pill that clearly reads as clickable, pops on hover */
.explore-btn { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--bg); background: var(--ink); padding: 8px 16px; border-radius: 999px; transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.explore-btn::after { content: "\2197"; font-size: 1.05em; transition: transform var(--dur) var(--ease); }
.explore-btn:hover { background: var(--ink-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.proj-card:hover .explore-btn { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.proj-card:hover .explore-btn::after { transform: translate(3px, -3px); }
.confidential-tag { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 500; }
.confidential-tag svg { width: 14px; height: 14px; }

/* interactive (experiment) cards — signal clickability + one-time SVG border-trace on scroll-in */
.proj-card--interactive { cursor: pointer; }
.trace-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 4; overflow: visible; opacity: 0;
}
.trace-svg__rect {
  fill: none; stroke: #333333; stroke-width: 3.5;
  stroke-linecap: round; stroke-linejoin: round;
}
/* the draw + fade are driven by the Web Animations API (app.js); reduced-motion simply never triggers it */

/* ---------- 10. PROJECT DETAIL / MODAL ---------- */
.detail__tags { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.chip { font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); }
.detail__title { font-family: var(--serif); font-size: clamp(22px, 2.7vw, 32px); line-height: 1.12; }
.detail__intro { font-size: var(--fs-body); color: var(--ink-2); line-height: 1.5; margin-top: var(--s4); max-width: var(--measure); }
.detail__how { margin-top: var(--s5); }
.detail__how .how-why { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.6; margin-bottom: var(--s5); padding-left: var(--s4); border-left: 2px solid var(--ink); max-width: var(--measure); }
.detail__how .how-lead { font-size: var(--fs-sm); margin-bottom: var(--s4); }
.steps { display: grid; gap: 0; }
.step { padding: var(--s3) 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2); }
.step:last-child { border-bottom: 1px solid var(--line); }
.step b { color: var(--ink); font-weight: 600; }

/* carousel — crossfade (images dissolve) + slow Ken Burns zoom on the active image */
.shots { position: relative; }
.shots__frame { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--silver); box-shadow: var(--shadow-sm); aspect-ratio: 4/3; }
.shots__viewport { position: absolute; inset: 0; }
.shots__slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--silver); opacity: 0; transition: opacity 900ms ease-in-out; will-change: opacity; }
.shots__slide img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.02); will-change: transform; }
.shots__slide.is-active { opacity: 1; z-index: 1; }
/* while a slide is the active one, its image slowly magnifies so the carousel feels alive */
.shots__slide.is-active img { animation: shotsZoom 7s ease-out forwards; }
@keyframes shotsZoom { from { transform: scale(1.02); } to { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  .shots__slide { transition: none; }
  .shots__slide img { transform: none; }
  .shots__slide.is-active img { animation: none; }
}

/* reveal variant (AI Creative Director only) — circular clip-path reveal from centre, no crossfade/zoom */
.shots--reveal .shots__slide { opacity: 1; transition: none; visibility: hidden; }
.shots--reveal .shots__slide img { transform: none; animation: none; }
.shots--reveal .shots__slide.is-active { visibility: visible; z-index: 1; }
.shots--reveal .shots__slide.is-revealing { visibility: visible; z-index: 2; }  /* incoming, clipped by JS, sits on top */
.shots__btn { position: absolute; top: 50%; translate: 0 -50%; z-index: 3; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.94); box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.shots__btn:hover { background: var(--ink); color: #fff; }
.shots__btn svg { width: 16px; height: 16px; }
.shots__btn.prev { left: 12px; } .shots__btn.next { right: 12px; }
.shots__count { position: absolute; right: 12px; bottom: 11px; z-index: 3; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: #fff; background: rgba(10,10,10,.6); padding: 4px 9px; border-radius: 999px; backdrop-filter: blur(4px); }
.shots__dots { display: flex; gap: 7px; justify-content: center; margin-top: var(--s4); }
.shots__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); transition: background var(--dur) var(--ease), width var(--dur) var(--ease); }
.shots__dot.is-active { background: var(--ink); width: 22px; border-radius: 4px; }

/* modal shell */
body.modal-lock { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 200; display: none; }
.modal.is-open { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10,10,10,.5); backdrop-filter: blur(3px); animation: modalFade var(--dur) var(--ease); }
.modal__dialog { position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: min(720px, calc(100vw - 40px)); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: clamp(28px, 4vw, 52px); animation: modalPop var(--dur-slow) var(--ease); }
.modal__close { position: sticky; top: 0; float: right; margin: -8px -8px 0 0; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); z-index: 5; }
.modal__close:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.modal__close svg { width: 18px; height: 18px; }
.detail--stack { display: block; }
.detail--stack .detail__title { margin: var(--s1) 0 var(--s5); }
.detail--stack .detail__media { margin-bottom: var(--s6); }
/* shrink the carousel ~25% so the modest-resolution source renders denser/sharper */
.shots__frame { max-width: 460px; margin-inline: auto; }
.detail--stack .detail__tags { margin-bottom: var(--s5); }
.detail--stack .detail__intro { margin-top: 0; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { 0% { opacity: 0; transform: translateY(14px) scale(.99); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- 11. SPEAKING — gallery left, copy right; fixed 2-col grid ---------- */
.speaking__grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px,5vw,64px); align-items: start; }
.speaking__copy { max-width: 46ch; }
.speaking__copy p { font-size: var(--fs-lead); color: var(--ink-2); line-height: 1.55; }
.speaking__copy p + p { margin-top: var(--s6); }
.speaking__pub { font-family: var(--serif); font-style: italic; color: var(--ink); margin-top: var(--s7); }
/* gallery — two equal-height columns; the panel shot flex-grows to fill */
.speak-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); align-items: stretch; }
.speak-col { display: flex; flex-direction: column; gap: var(--s3); }
.speak-gallery img { width: 100%; border-radius: var(--radius); display: block; object-fit: cover; }
.speak-gallery img:not(.grow) { height: auto; }
.speak-gallery img.grow { flex: 1 1 auto; min-height: 120px; object-position: center; }
.speak-gallery img.crop-top { object-position: center bottom; }  /* speak_3 — crops its top */

/* collage — editorial "photos laid on a desk" interaction */
.collage img {
  position: relative;
  cursor: zoom-in;
  transform: rotate(var(--rest-rot, 0deg));
  transition: transform 420ms var(--ease), box-shadow 420ms var(--ease);
  will-change: transform;
}
.collage img:hover {
  z-index: 5;
  transform: rotate(0deg) scale(1.05);           /* straighten + gently enlarge, as if picked up */
  box-shadow: 0 18px 40px -12px rgba(10,10,10,.45);
}
.collage img:focus-visible {
  z-index: 5; outline: 2px solid var(--ink); outline-offset: 3px;
}
/* pre-assembly: hide photos until the scroll-triggered entrance runs (base stays visible if it never fires) */
.collage--pending img { opacity: 0; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 300; display: none; }
.lightbox.is-open { display: block; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(10,10,10,.82); backdrop-filter: blur(4px); animation: modalFade var(--dur) var(--ease); }
.lightbox__dialog { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: clamp(8px,2vw,24px); padding: clamp(16px,4vw,56px); }
.lightbox__fig { margin: 0; max-width: min(1100px, 92vw); max-height: 88vh; display: flex; }
.lightbox__img { max-width: 100%; max-height: 88vh; width: auto; height: auto; object-fit: contain; border-radius: var(--radius); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); animation: modalPop var(--dur-slow) var(--ease); }
.lightbox__close { position: absolute; top: clamp(14px,3vw,28px); right: clamp(14px,3vw,28px); width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); z-index: 2; }
.lightbox__close:hover { background: var(--ink); color: #fff; }
.lightbox__close svg { width: 20px; height: 20px; }
.lightbox__nav { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(255,255,255,.14); transition: background var(--dur) var(--ease); z-index: 2; }
.lightbox__nav:hover { background: rgba(255,255,255,.28); }
.lightbox__nav svg { width: 22px; height: 22px; }
@media (max-width: 560px) {
  .lightbox__nav { position: absolute; bottom: clamp(16px,5vw,28px); }
  .lightbox__nav.prev { left: 24px; } .lightbox__nav.next { right: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox__img, .lightbox__backdrop { animation: none; }
}

/* ---------- 13. FOOTER ---------- */
.foot { border-top: 1px solid var(--line); padding-block: var(--s7); margin-top: var(--space-section); }
.foot__row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s4); }
.foot__fine { color: var(--ink-3); font-size: var(--fs-sm); }
.foot__links { display: flex; gap: var(--s5); }
.foot__links a { color: var(--ink-3); font-size: var(--fs-sm); transition: color var(--dur) var(--ease); }
.foot__links a:hover { color: var(--ink); }

/* ---------- 14. RESPONSIVE ---------- */
@media (max-width: 920px) {
  .jc-row { grid-template-columns: 1fr; }
  .speaking__grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  /* credentials: allow wrap on narrower screens so logos stay legible */
  .logo-row { flex-wrap: wrap; gap: clamp(20px, 4vw, 40px); }
}
@media (max-width: 680px) {
  .hindex { grid-template-columns: 1fr; }
  .edu-lang-row { flex-direction: column; align-items: flex-start; gap: var(--s5); }
}
@media (max-width: 560px) {
  .nav__links { display: none; }
  .nav__links.is-open {
    display: flex; flex-direction: column; align-items: flex-start; gap: var(--s4);
    position: absolute; top: 100%; left: 0; right: 0; background: var(--bg);
    border-bottom: 1px solid var(--line); padding: var(--s5) var(--gutter);
  }
  .nav__toggle { display: inline-flex; }
  .speak-gallery { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- robot cursor ---------- */
/* when active, hide the native arrow but keep real text carets + disabled cursors */
.has-robot-cursor,
.has-robot-cursor a,
.has-robot-cursor button,
.has-robot-cursor [role="button"],
.has-robot-cursor .proj-card,
.has-robot-cursor label { cursor: none; }
.has-robot-cursor input,
.has-robot-cursor textarea,
.has-robot-cursor select { cursor: auto; }         /* keep text caret / field affordance */
.robot-cursor {
  position: fixed; top: 0; left: 0; width: 46px; height: 46px; z-index: 9999;
  pointer-events: none; opacity: 0;
  transition: opacity .25s ease;
  will-change: transform;
  /* tone the near-white body down to silver so it reads on the white page; blue eyes stay blue */
  filter: brightness(.76) contrast(1.06) drop-shadow(0 3px 6px rgba(0,0,0,.28));
}
.robot-cursor.is-on { opacity: 1; }
.robot-cursor img { width: 100%; height: 100%; display: block; }
