/* ============================================================================
   PORTFOLIO — "Maison Noir-sur-Blanc"
   Minimalist luxe: warm ink on bone paper. No color but the photography.
   To shift the warmth, change --bg / --text below. There is no accent hue by
   design — the ink IS the accent.
   ============================================================================ */

:root {
  --bg:          #F6F4F0;   /* bone paper — NEVER pure white on the page body */
  --surface:     #FFFFFF;   /* true white — only for lifted cards & photo mats */
  --text:        #16140F;   /* warm off-black ink */
  --muted:       #7A7468;   /* secondary text & all small labels */
  --line:        rgba(22,20,15,0.12);   /* hairline */
  --line-strong: rgba(22,20,15,0.28);   /* frame around mounted plates */
  --accent:      #16140F;   /* the accent is ink */
  --accent-soft: rgba(22,20,15,0.05);   /* faint ink wash */

  /* Legacy var names kept so any stray reference stays safe */
  --panel: var(--surface);

  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "Inter", -apple-system, sans-serif;   /* mono retired → Inter */

  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 60px);
  --section: clamp(120px, 18vh, 200px);
  --radius: 2px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: auto;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: rgba(22,20,15,0.10); color: var(--text); }

/* Shared small uppercase label */
.label, .hero__eyebrow, .section__label, .cert__year, .cert__index, .cert__view,
.project__cat, .project__tag, .marquee, .hero__scroll, .footer, .nav__links a,
.contact__social, .lightbox__cert .issuer, .lightbox__cert .year, .lightbox__cert .note {
  font-family: var(--font-body);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---- Backgrounds: bone warmth + pressed-paper grain (no neon) ---- */
.bg-canvas { display: none; }   /* JS re-enables it as the living-ink overlay */
body.ink-on .bg-canvas {
  display: block; position: fixed; inset: 0; z-index: 6;
  width: 100vw; height: 100vh;
  pointer-events: none;   /* no blend mode: plain alpha ink is far cheaper to composite */
}
.bg-aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 45% at 50% 0%, rgba(22,20,15,0.025), transparent 70%);
}
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: multiply;
}

/* Custom cursor retired */
.cursor-dot, .cursor-ring { display: none; }

/* ---- Loader ---- */
.loader {
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-content: center; gap: 22px; justify-items: center;
  background: var(--bg); transition: opacity .7s var(--ease), visibility .7s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__text {
  display: flex; font-family: var(--font-display); font-weight: 300;
  font-size: clamp(1.5rem, 4.5vw, 2.4rem); letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--text); padding-left: 0.26em; /* optically re-center */
}
.loader__l { display: inline-block; animation: loaderStamp .6s var(--ease) both; animation-delay: calc(90ms + var(--i) * 55ms); }
@keyframes loaderStamp {
  from { opacity: 0; transform: translateY(0.35em) scale(1.55); filter: blur(7px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.loader__bar { width: 200px; height: 1px; background: var(--line); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 0; background: var(--text); }

/* ---- Nav ---- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px var(--gutter);
  transition: background .4s var(--ease), padding .4s var(--ease), border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(246,244,240,0.85); backdrop-filter: blur(12px);
  padding-top: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.nav__logo { font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; letter-spacing: 0.02em; color: var(--text); }
.nav__links { display: flex; align-items: center; gap: clamp(24px, 3vw, 40px); }
.nav__links a { font-size: 0.7rem; color: var(--muted); position: relative; transition: color .3s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; width: 0; height: 1px;
  background: var(--text); transition: width .4s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.nav__cta { color: var(--text) !important; padding-bottom: 1px; }
.nav__cta::after { width: 100%; }                 /* permanent underline */
.nav__cta:hover { background: var(--accent-soft); }
.nav__burger { display: none; background: none; border: 0; flex-direction: column; gap: 6px; cursor: pointer; }
.nav__burger span { width: 24px; height: 1px; background: var(--text); transition: .3s; }

/* ---- Buttons (ink-invert) ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 30px; border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 500; font-size: 0.7rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
}
.btn--primary { background: var(--text); color: var(--bg); border: 1px solid var(--text); }
.btn--primary:hover { background: transparent; color: var(--text); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--text); background: var(--accent-soft); }

/* ---- Hero (asymmetric, lower-left) ---- */
.hero {
  position: relative; z-index: 1; min-height: 100vh;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  padding: 0 var(--gutter) 14vh; max-width: var(--maxw); margin: 0 auto;
}
.hero__inner { max-width: 100%; }
.hero__eyebrow { font-size: 0.7rem; color: var(--muted); margin-bottom: 30px; }
.hero__name {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(3.4rem, 13vw, 11rem); line-height: 0.88; letter-spacing: -0.03em;
  color: var(--text);
}
.hero__role {
  margin-top: 26px; font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  display: flex; align-items: baseline; gap: 10px; min-height: 1.5em; flex-wrap: wrap;
}
.hero__role-prefix { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--muted); }
.hero__role-typed { font-family: var(--font-body); font-weight: 500; color: var(--text); }
.hero__caret {
  display: inline-block; width: 1px; height: 1.05em; background: var(--text);
  transform: translateY(0.14em); animation: caretfade 1.4s var(--ease) infinite;
}
@keyframes caretfade { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.hero__tagline { margin-top: 28px; max-width: 52ch; color: var(--muted); font-size: 1.05rem; }
.hero__actions { margin-top: 42px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; bottom: 34px; right: var(--gutter);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 0.62rem; letter-spacing: 0.3em; color: var(--muted);
}
.hero__scroll-line { width: 1px; height: 44px; background: var(--line); }

/* ---- Marquee (quiet running index) ---- */
.marquee { position: relative; z-index: 1; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 28px 0; }
.marquee__track { display: flex; width: max-content; animation: marquee 55s linear infinite; }
.marquee__item { display: flex; align-items: center; gap: 38px; white-space: nowrap; font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 1.4rem; letter-spacing: 0; text-transform: none; color: var(--text); padding-right: 38px; }
.marquee__item span { color: var(--muted); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---- Sections (shared) ---- */
.section { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: var(--section) var(--gutter); }
.section__label {
  display: flex; align-items: center; gap: 16px;
  font-size: 0.7rem; color: var(--muted); margin-bottom: 40px;
}
.section__label span { color: var(--text); font-variant-numeric: tabular-nums; }
.section__label::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
  transform: scaleX(0); transform-origin: left; transition: transform 1s var(--ease);
}
.section.is-in .section__label::after { transform: scaleX(1); }
.section__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.4rem, 6vw, 5rem); line-height: 0.96; letter-spacing: -0.02em; margin-bottom: 16px; }
.section__title em { font-style: italic; color: var(--text); }
.section__sub { color: var(--muted); max-width: 60ch; margin-bottom: 64px; }
.section__sub code { font-family: var(--font-body); font-size: 0.85em; color: var(--text); background: var(--accent-soft); padding: 2px 7px; border-radius: var(--radius); }

/* ---- About ---- */
.about__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.about__copy p:first-child { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 2.4vw, 1.6rem); line-height: 1.45; color: var(--text); margin-bottom: 28px; max-width: 60ch; }
.about__copy p { font-size: 1.05rem; color: var(--muted); margin-bottom: 22px; max-width: 60ch; }
.about__stats { display: flex; flex-direction: column; }
.stat { padding: 26px 0; border-top: 1px solid var(--line); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.stat:last-child { border-bottom: 1px solid var(--line); }
.stat__value { font-family: var(--font-display); font-weight: 400; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.stat__label { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; margin-top: 10px; }

/* ---- Certificate cards (mounted documents) ---- */
.certs__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.cert {
  position: relative; padding: 36px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line-strong);
  transition: opacity .9s var(--ease), transform .9s var(--ease), border-color .5s var(--ease);
}
.cert:hover { border-color: var(--text); }
.cert__index { display: inline-block; font-size: 0.66rem; color: var(--muted); margin-bottom: 26px; }
.cert__year { position: absolute; top: 36px; right: 36px; font-size: 0.66rem; color: var(--muted); }
.cert__title { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; line-height: 1.15; margin-bottom: 8px; transition: transform .5s var(--ease); }
.cert:hover .cert__title { transform: translateX(2px); }
.cert__issuer { color: var(--text); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 16px; }
.cert__blurb { color: var(--muted); font-size: 0.95rem; line-height: 1.6; }
.cert__view { margin-top: 22px; font-size: 0.62rem; color: var(--muted); display: flex; align-items: center; gap: 8px; transition: color .3s, gap .3s var(--ease); }
.cert:hover .cert__view { color: var(--text); gap: 14px; }

/* ---- Work cards ---- */
.work__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 24px; }
.project {
  position: relative; padding: 36px; border-radius: var(--radius); min-height: 240px;
  background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  display: flex; flex-direction: column;
  transition: opacity .9s var(--ease), transform .9s var(--ease), border-color .5s var(--ease);
}
.project:hover { border-color: var(--text); }
.project__cat { font-size: 0.66rem; color: var(--muted); margin-bottom: auto; }
.project__title { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; line-height: 1.1; margin: 30px 0 10px; }
.project__blurb { color: var(--muted); font-size: 0.95rem; }
.project__tags { display: flex; flex-wrap: wrap; margin-top: 18px; }
.project__tag { font-size: 0.62rem; color: var(--muted); }
.project__tag:not(:first-child)::before { content: "/"; margin: 0 8px; opacity: 0.5; }
.project__arrow { position: absolute; top: 36px; right: 36px; color: var(--muted); transition: transform .4s var(--ease), color .4s; }
.project:hover .project__arrow { transform: translate(3px, -3px); color: var(--text); }

/* ---- Gallery (tipped-in plates, the only color) ---- */
.gallery__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); grid-auto-rows: 220px; gap: 24px; }
.photo { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface); padding: 3px; cursor: pointer; transition: opacity 1.1s var(--ease), clip-path 1.1s var(--ease), border-color .5s var(--ease); }
.photo:nth-child(3n+1) { grid-row: span 2; }
.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 1px; transition: transform .9s var(--ease); }
.photo:hover { border-color: var(--text); }
.photo:hover img { transform: scale(1.04); }
.photo__placeholder {
  position: absolute; inset: 3px; display: grid; place-content: center; text-align: center;
  background: #EFECE6; border-radius: 1px;
  font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}
.photo::after { content: ""; position: absolute; inset: 3px; background: rgba(22,20,15,0.06); opacity: 0; transition: opacity .5s; pointer-events: none; border-radius: 1px; }
.photo:hover::after { opacity: 1; }

/* ---- Contact ---- */
.contact { padding-top: var(--section); padding-bottom: var(--section); }
.contact__headline { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.8rem, 10vw, 8rem); line-height: 0.92; letter-spacing: -0.02em; margin-bottom: 44px; }
.contact__headline em { font-style: italic; color: var(--text); }
.contact__email { display: inline-block; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 4vw, 2rem); color: var(--text); padding-bottom: 6px; border-bottom: 1px solid var(--text); transition: padding-bottom .3s var(--ease); }
.contact__email:hover { padding-bottom: 9px; }
.contact__socials { margin-top: 48px; display: flex; gap: clamp(20px, 4vw, 44px); flex-wrap: wrap; }
.contact__social { position: relative; font-size: 0.7rem; color: var(--muted); transition: color .3s; }
.contact__social::after { content: ""; position: absolute; left: 0; bottom: -5px; width: 0; height: 1px; background: var(--text); transition: width .4s var(--ease); }
.contact__social:hover { color: var(--text); }
.contact__social:hover::after { width: 100%; }

/* ---- Footer ---- */
.footer { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 40px var(--gutter); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.66rem; }
.footer > span:not(:first-child), .footer a { letter-spacing: 0.22em; text-transform: uppercase; }
.footer span:first-child { font-family: var(--font-display); font-weight: 400; font-size: 1rem; letter-spacing: 0.02em; text-transform: none; color: var(--text); }
.footer a { position: relative; color: var(--muted); transition: color .3s; }
.footer a::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px; background: var(--text); transition: width .4s var(--ease); }
.footer a:hover { color: var(--text); }
.footer a:hover::after { width: 100%; }

/* ---- Lightbox (light invert) ---- */
/* visibility flips instantly on OPEN (so the modal is focusable at once) and is
   delayed on CLOSE (so the opacity fade-out still plays) — canonical a11y modal. */
.lightbox { position: fixed; inset: 0; z-index: 9000; display: grid; place-content: center; padding: 30px; background: rgba(246,244,240,0.92); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility 0s linear .4s; }
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .4s var(--ease), visibility 0s; }
.lightbox__close { position: absolute; top: 26px; right: 30px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 1rem; cursor: pointer; transition: .3s; }
.lightbox__close:hover { border-color: var(--text); background: var(--accent-soft); }
.lightbox__content { max-width: 620px; transform: scale(.96); transition: transform .4s var(--ease); }
.lightbox.is-open .lightbox__content { transform: scale(1); }
.lightbox__cert { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 50px; text-align: center; }
.lightbox__cert .index { display: inline-block; font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; }
.lightbox__cert h3 { font-family: var(--font-display); font-weight: 400; font-size: 2rem; line-height: 1.1; margin-bottom: 12px; }
.lightbox__cert .issuer { color: var(--text); font-size: 0.66rem; margin-bottom: 6px; }
.lightbox__cert .year { font-size: 0.66rem; color: var(--muted); margin-bottom: 22px; }
.lightbox__cert .blurb { color: var(--muted); max-width: 420px; margin: 0 auto; text-transform: none; letter-spacing: 0; }
.lightbox__cert .note { margin-top: 26px; font-size: 0.6rem; color: var(--muted); opacity: 0.7; }
.lightbox img { border-radius: var(--radius); max-height: 80vh; background: var(--surface); padding: 6px; }

/* ---- Hero positioning line (cool, declarative) ---- */
.hero__positioning { margin-top: 14px; max-width: 56ch; color: var(--muted); font-size: 0.92rem; line-height: 1.6; }

/* ---- Thesis through-line ---- */
.thesis { max-width: var(--maxw); margin: 0 auto; padding: clamp(70px, 11vh, 130px) var(--gutter); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.thesis__line { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: clamp(1.5rem, 3.4vw, 2.5rem); line-height: 1.32; letter-spacing: -0.01em; color: var(--text); max-width: 20em; margin: 0 auto; }

/* ---- Section CTA (quiet text link, never a button) ---- */
.section-cta-wrap { margin-top: 56px; text-align: right; }
.section-cta { position: relative; display: inline-block; font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); transition: color .3s; }
.section-cta::after { content: ""; position: absolute; left: 0; bottom: -5px; width: 0; height: 1px; background: var(--text); transition: width .4s var(--ease); }
.section-cta:hover { color: var(--text); }
.section-cta:hover::after { width: 100%; }

/* ---- Project: status meta + case-study affordance ---- */
.project.is-case { cursor: pointer; }
.project.is-case:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }
.project__hint { margin-top: 18px; font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); transition: color .3s; }
.project.is-case:hover .project__hint { color: var(--text); }

/* ---- Proof / testimonials (editorial colophon) ---- */
.proof__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(40px, 6vw, 80px); }
.testimonial { display: flex; flex-direction: column; gap: 22px; }
.testimonial__quote { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.4; color: var(--text); }
.testimonial__by { position: relative; padding-top: 22px; font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text); }
.testimonial__by::before { content: ""; position: absolute; top: 0; left: 0; width: 40px; height: 1px; background: var(--line-strong); }
.testimonial__by span { color: var(--muted); }

/* ---- Lightbox: verify link + case study ---- */
.lightbox__verify { display: inline-block; margin-top: 4px; font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text); border-bottom: 1px solid var(--text); padding-bottom: 2px; transition: opacity .3s; }
.lightbox__verify:hover { opacity: 0.55; }
.lightbox__case { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(34px, 5vw, 50px); text-align: left; }
.lightbox__case .index { display: inline-block; font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.lightbox__case h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; margin-bottom: 16px; }
.lightbox__case .case__snapshot { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 1.2rem; line-height: 1.4; color: var(--text); margin-bottom: 24px; }
.case__row { display: grid; grid-template-columns: 110px 1fr; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.case__label { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.case__row p { color: var(--text); font-size: 0.98rem; line-height: 1.55; }
@media (max-width: 520px) { .case__row { grid-template-columns: 1fr; gap: 4px; } }

/* ---- Reveal system (IntersectionObserver adds .is-visible) ---- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.cert, .project, .stat { opacity: 0; transform: translateY(16px); }
.cert.is-visible, .project.is-visible, .stat.is-visible { opacity: 1; transform: none; }
.photo { opacity: 0; clip-path: inset(8% 8% 8% 8%); }
.photo.is-visible { opacity: 1; clip-path: inset(0%); }

/* ---- Mobile ---- */
@media (max-width: 760px) {
  .nav__links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center;
    background: rgba(246,244,240,0.97); backdrop-filter: blur(20px); gap: 28px; font-size: 1rem;
    transform: translateX(100%); transition: transform .5s var(--ease);
  }
  .nav__links.is-open { transform: translateX(0); }
  .nav__links a { color: var(--text); }
  .nav__burger { display: flex; z-index: 101; }
  .nav__burger.is-open span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav__burger.is-open span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .about__grid { grid-template-columns: 1fr; }
}

/* ---- Skip link (keyboard a11y) ---- */
.skip-link { position: fixed; top: -120px; left: 16px; z-index: 10001; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: var(--radius); font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; transition: top .25s var(--ease); }
.skip-link:focus { top: 16px; outline: none; }

/* ---- Keyboard focus visibility ---- */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; border-radius: 1px; }

/* ---- Active nav (scroll-spy marks the current section) ---- */
.nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after { width: 100%; }

/* ---- Scroll progress hairline ---- */
.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--text); z-index: 200; }

/* ---- Résumé button (triggers print → save as PDF) ---- */
.contact__resume { margin-top: 44px; display: inline-block; background: none; border: 0; padding: 0; cursor: pointer; position: relative; font-family: var(--font-body); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); transition: color .3s; }
.contact__resume::after { content: ""; position: absolute; left: 0; bottom: -5px; width: 0; height: 1px; background: var(--text); transition: width .4s var(--ease); }
.contact__resume:hover { color: var(--text); }
.contact__resume:hover::after { width: 100%; }

/* ---- Gallery lightbox navigation ---- */
.lightbox__photo { position: relative; display: grid; place-items: center; }
.lightbox__nav { position: fixed; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: rgba(246,244,240,0.65); color: var(--text); font-family: var(--font-display); font-size: 1.7rem; line-height: 0; cursor: pointer; display: grid; place-content: center; transition: border-color .3s, background .3s; }
.lightbox__nav--prev { left: 24px; }
.lightbox__nav--next { right: 24px; }
.lightbox__nav:hover { border-color: var(--text); background: var(--surface); }
.lightbox__counter { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }

/* ============================================================================
   IMMERSION LAYER — living-ink effects (paired with js/effects.js)
   ============================================================================ */

/* Ink cursor: a drop of ink replaces the pointer on fine-pointer devices */
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body.ink-cursor, body.ink-cursor * { cursor: none !important; }
}
.cursor-ink {
  position: fixed; top: 0; left: 0; width: 10px; height: 10px;
  border-radius: 50%; background: var(--text);
  z-index: 10002; pointer-events: none;
  opacity: 0; transition: opacity .3s, background .3s, box-shadow .3s;
  will-change: transform;
}
.cursor-ink.is-hot { background: rgba(22,20,15,0.12); box-shadow: inset 0 0 0 1.5px var(--text); }

/* Living hero name (letters swell under the cursor) */
.hn-w { display: inline-block; white-space: nowrap; }
.hn-l { display: inline-block; will-change: font-weight, transform; }

/* Word-mask headline reveals */
.wm {
  display: inline-block; overflow: hidden; vertical-align: bottom;
  padding: 0.08em 0 0.14em; margin: -0.08em 0 -0.14em;   /* room for ascenders/descenders */
}
.wm--em .wl { font-style: italic; }
.wl { display: inline-block; transform: translateY(115%); transition: transform 1.1s var(--ease); }
.section.is-in .wl { transform: none; }

/* Thesis line inks itself in as you scroll through it */
.thesis__line.is-fill {
  color: transparent;
  -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(90deg, var(--text) var(--fill, 0%), rgba(22,20,15,0.16) var(--fill, 0%));
}

/* Magnetic elements spring back on release */
.mag {
  will-change: transform;
  transition: transform .5s cubic-bezier(0.22, 1.4, 0.36, 1),
              background .4s var(--ease), color .3s,
              border-color .4s var(--ease), padding-bottom .3s var(--ease);
}

/* Card tilt: fast transform while the pointer rides the card */
.tilting { transition: transform .16s ease-out, border-color .5s var(--ease), opacity .9s var(--ease) !important; }

/* Ink-wash highlight trailing the cursor across card surfaces */
.cert::before, .project::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 0;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(22,20,15,0.055), transparent 65%);
  opacity: 0; transition: opacity .5s var(--ease); pointer-events: none;
}
.cert:hover::before, .project:hover::before { opacity: 1; }

/* Generative ink plates in empty gallery slots */
.photo__placeholder { display: block; padding: 0; }
.plate { position: absolute; inset: 0; width: 100%; height: 100%; }
.plate__label {
  position: absolute; left: 0; right: 0; bottom: 14px; text-align: center;
  font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}

/* Scroll cue: the hairline quietly pours downward */
.hero__scroll-line { position: relative; overflow: hidden; }
.hero__scroll-line::after {
  content: ""; position: absolute; left: 0; top: -100%; width: 100%; height: 100%;
  background: var(--text); animation: scrollPour 2.4s var(--ease) infinite;
}
@keyframes scrollPour { 0% { top: -100%; } 55%, 100% { top: 100%; } }

/* ---- Print: a clean one-page résumé ---- */
@media print {
  .nav, .loader, .bg-canvas, .bg-aurora, .bg-grid, .hero__scroll, .marquee,
  .section-cta-wrap, .lightbox, .cursor-dot, .cursor-ring, .nav__burger, .skip-link,
  .scroll-progress, .contact__resume { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  .reveal, .cert, .project, .stat, .photo, .thesis__line { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .wl { transform: none !important; }
  .wm { overflow: visible !important; }
  .cursor-ink { display: none !important; }
  .hn-l { font-weight: inherit !important; transform: none !important; }
  .thesis__line.is-fill { color: var(--text) !important; background: none !important; -webkit-background-clip: initial !important; background-clip: initial !important; }
  .hero { min-height: auto; padding: 24px var(--gutter); }
  .section, .thesis { padding-top: 32px !important; padding-bottom: 32px !important; page-break-inside: avoid; }
  .cert, .project { border: 1px solid #ccc !important; page-break-inside: avoid; background: #fff !important; }
  .section__title em, .contact__headline em, .thesis__line, .testimonial__quote,
  .cert__issuer, .hero__name, .stat__value { color: #000 !important; }
  .section__label span, .cert__index, .cert__year, .project__cat, .stat__label { color: #333 !important; }
  a { color: #000 !important; }
  .contact__email { border-color: #000 !important; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .marquee__track, .hero__caret, .loader__l, .hero__scroll-line::after { animation: none !important; }
  .reveal, .cert, .project, .stat, .photo { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
  .section__label::after { transform: scaleX(1) !important; }
  .photo img { transition: none !important; }
  .wl { transform: none !important; transition: none !important; }
  .cursor-ink, body.ink-on .bg-canvas { display: none !important; }
  .mag, .tilting { transition: none !important; }
}
