/* =========================================================
   Callie Wei — Portfolio
   Clean, minimal. White background, all-sans type system.
   Smooth, quiet motion.
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-soft: #fafaf8;
  --ink: #111111;
  --ink-soft: #3a3a3a;
  --muted: #8a8a8a;
  --rule: #ececec;
  --accent: #1a1a1a;

  /* Clean sans-only system. --serif kept as a token so existing
     classes keep working, but it now points to a display sans. */
  --serif: "Inter Tight", "Inter", "Helvetica Neue", Arial, sans-serif;
  --sans:  "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, Menlo, monospace;

  --max: 1440px;
  --gutter: clamp(20px, 4vw, 56px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 600ms;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}
a:hover { opacity: 0.6; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* -------------------- Typography -------------------- */

.display {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.035em;
  font-size: clamp(48px, 9vw, 160px);
}

.display--md {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-size: clamp(36px, 5.5vw, 84px);
}

/* Kept for backwards compat; no longer italicises (clean look). */
.italic { font-style: normal; color: var(--muted); }

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 500;
}

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

p.lede {
  font-family: var(--sans);
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 44ch;
  font-weight: 400;
  letter-spacing: -0.005em;
}

p { color: var(--ink-soft); }

/* -------------------- Nav -------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(1.2) blur(12px);
  -webkit-backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--rule); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__brand {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body.is-home .nav__brand { visibility: hidden; }
.nav__brand em {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}

.nav__links {
  display: flex;
  gap: 28px;
  font-size: 13px;
  letter-spacing: 0.01em;
  align-items: center;
}
.nav__links > a,
.nav__group > a {
  position: relative;
  padding: 4px 0;
  color: var(--ink-soft);
  cursor: pointer;
}
.nav__links > a::after,
.nav__group > a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav__links > a:hover,
.nav__group > a:hover { color: var(--ink); opacity: 1; }
.nav__links > a:hover::after,
.nav__group:hover > a::after,
.nav__group.is-open > a::after,
.nav__links > a.is-active::after,
.nav__group > a.is-active::after { transform: scaleX(1); }

/* -------------------- Nav dropdown (Work) -------------------- */

.nav__group {
  position: relative;
}
/* Invisible bridge so mouse can cross from trigger to menu */
.nav__group::before {
  content: "";
  position: absolute;
  top: 100%;
  left: -24px;
  right: -24px;
  height: 22px;
  pointer-events: none;
}
.nav__group:hover::before,
.nav__group:focus-within::before,
.nav__group.is-open::before { pointer-events: auto; }

.nav__dropdown {
  position: absolute;
  top: calc(100% + 22px);
  left: -24px;
  min-width: 280px;
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 320ms var(--ease),
    transform 320ms var(--ease),
    visibility 320ms;
  z-index: 60;
  box-shadow: 0 20px 48px -28px rgba(0,0,0,0.18);
}
.nav__group:hover > .nav__dropdown,
.nav__group:focus-within > .nav__dropdown,
.nav__group.is-open > .nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__dropdown a {
  display: block;
  padding: 14px 24px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  transition: color 260ms var(--ease);
  white-space: nowrap;
  letter-spacing: 0;
}
.nav__dropdown a:last-child { border-bottom: 0; }
.nav__dropdown a:hover,
.nav__dropdown a:focus { color: var(--ink); opacity: 1; }

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

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: clamp(80px, 14vh, 160px) 0 clamp(60px, 10vh, 120px);
  border-bottom: 1px solid var(--rule);
}
.hero > .container { width: 100%; }
.hero__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 48px;
  gap: 24px;
  flex-wrap: wrap;
}
.hero__title { margin: 0; }
.hero__sub {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 80px);
  align-items: end;
}
@media (max-width: 720px) {
  .hero__sub { grid-template-columns: 1fr; }
}

.hero__cta {
  margin-top: 48px;
  display: flex;
  justify-content: flex-start;
}

.hero__subtitle {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
  margin: 24px 0 0;
  max-width: 22ch;
}

/* -------------------- Section heading -------------------- */

.section {
  padding: clamp(80px, 12vh, 140px) 0;
  border-bottom: 1px solid var(--rule);
}
.section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 56px;
  gap: 24px;
  flex-wrap: wrap;
}
.section__title {
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}

/* -------------------- Filters -------------------- */

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* -------------------- Work grid -------------------- */

.work {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(24px, 3vw, 48px) clamp(20px, 2.5vw, 40px);
}
.card {
  position: relative;
  display: block;
  cursor: pointer;
}
/* Alternating editorial layout */
.card--lg   { grid-column: span 12; }
.card--md   { grid-column: span 7;  }
.card--sm   { grid-column: span 5;  }
.card--half { grid-column: span 6;  }
.card--third{ grid-column: span 4;  }
.card--offset { margin-top: clamp(60px, 10vh, 140px); }
@media (max-width: 900px) {
  .card--lg, .card--md, .card--sm,
  .card--half, .card--third { grid-column: span 12; }
  .card--offset { margin-top: 0; }
}

.card__media {
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
  aspect-ratio: 4 / 5;
}
.card--lg .card__media  { aspect-ratio: 16 / 9; }
.card--md .card__media  { aspect-ratio: 4 / 5; }
.card--sm .card__media  { aspect-ratio: 3 / 4; }
.card--half .card__media{ aspect-ratio: 5 / 6; }
.card--third .card__media{ aspect-ratio: 3 / 4; }

.card__media img,
.card__media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease), filter var(--dur) var(--ease);
  filter: saturate(1);
}
.card:hover .card__media img,
.card:hover .card__media svg {
  transform: scale(1.035);
}

.card__caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 18px;
  gap: 16px;
}
.card__title {
  font-family: var(--sans);
  font-size: clamp(16px, 1.2vw, 19px);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}
.card__title em {
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
  font-size: 0.9em;
  margin-left: 6px;
}
.card__meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Grid fade-out when filtering */
.card.is-hidden { display: none; }

/* -------------------- Project detail page -------------------- */

.project-hero {
  padding: clamp(60px, 10vh, 120px) 0 clamp(40px, 6vh, 64px);
}
.project-hero__meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.project-hero__meta .field .eyebrow { display: block; margin-bottom: 8px; }
.project-hero__meta .field p { margin: 0; color: var(--ink); font-size: 14px; }
@media (max-width: 720px) {
  .project-hero__meta { grid-template-columns: 1fr 1fr; }
}

/* Minimal hero variant — compact 4-column meta with top rule */
.project-hero.is-minimal {
  padding: clamp(40px, 6vh, 80px) 0 clamp(20px, 3vh, 32px);
}
.project-hero.is-minimal .project-hero__meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 0;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.project-hero.is-minimal .project-hero__meta .field { display: block; }
.project-hero.is-minimal .project-hero__meta .field .eyebrow {
  display: block;
  margin-bottom: 8px;
}
.project-hero.is-minimal .project-hero__meta .field p {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}
.project-hero.is-minimal .project-hero__meta .field + .field::before { content: none; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
@media (max-width: 720px) {
  .project-hero.is-minimal .project-hero__meta { grid-template-columns: 1fr 1fr; }
}
/* Tighter space from minimal hero to first image */
.project-hero.is-minimal + section .project-gallery {
  padding-top: clamp(12px, 1.5vh, 20px);
}

/* =========================================================
   V2 — Left margin (title + meta in a narrow side column)
   ========================================================= */
.project-side {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: clamp(32px, 4vw, 72px);
  align-items: start;
  padding: clamp(16px, 2vh, 28px) 0 clamp(60px, 8vh, 100px);
}
.project-side__col {
  position: sticky;
  top: clamp(80px, 10vh, 104px);
  padding-top: clamp(16px, 2.5vh, 32px);
}
.project-side__title {
  font-family: "Instrument Serif", "Times New Roman", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 2.1vw, 30px);
  line-height: 1.08;
  letter-spacing: -0.005em;
  margin: 0 0 clamp(36px, 4.5vh, 56px);
  color: var(--ink);
}
.project-side__title--bold {
  font-weight: 700;
}
.project-side__meta .field {
  display: block;
  margin-bottom: 14px;
  line-height: 1.25;
}
.project-side__meta .field:last-child { margin-bottom: 0; }
.project-side__meta .eyebrow {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
}
.project-side__meta .field p {
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
  color: var(--ink);
}
/* Quiet italic note under the sidebar meta (e.g. "Season 2 work coming soon")
   — matches the divider treatment used for .filter below. */
/* Shared wrapper so the note + CTA hairlines align to one consistent width
   — whichever child is wider sets the column width, and both fill it. */
.project-side__notes {
  width: fit-content;
  max-width: 100%;
}
.project-side__note {
  position: relative;
  margin: 24px 0 0;
  padding-top: 24px;
  width: fit-content;
  max-width: 100%;
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--muted);
}
/* When wrapped with another note/CTA/filter, fill the shared wrapper width
   so all hairlines align to the same edge. */
.project-side__notes .project-side__note,
.project-side__notes .project-side__cta,
.project-side__notes .filter { width: 100%; }
.project-side__notes .filter::before { width: 100%; }
.project-side__note::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--rule);
}
/* Mailto CTA in the project sidebar — Instrument Serif italic accent.
   Sits below "Season 2 work coming soon!" with its own hairline divider. */
.project-side__cta {
  position: relative;
  display: block;
  margin-top: 24px;
  padding-top: 24px;
  width: fit-content;
  max-width: 100%;
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  transition: color 200ms ease;
}
.project-side__cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--rule);
}
.project-side__cta:hover,
.project-side__cta:focus-visible { color: var(--ink); }
.project-side__cta-spark {
  display: inline-block;
  margin-right: 6px;
  vertical-align: -0.02em;
  font-size: 1.05em;
  color: var(--ink);
  /* Sparkle stays upright instead of slanting with the italic body */
  font-style: normal;
}

/* Minimal sidebar filter (Future Egypt, etc.) — matches the clean sans
   used for the meta field values ("Concept / Illustration", etc.) */
.filter {
  position: relative;
  margin-top: 24px;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
/* Short divider line between the meta block and the filter */
.filter::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 140px;
  height: 1px;
  background: var(--rule);
}
.filter__head {
  margin-bottom: 6px;
}
.filter__btn {
  background: none;
  border: 0;
  padding: 2px 0;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms ease, opacity 160ms ease;
  text-align: left;
}
.filter__btn:hover { color: var(--ink); }
.filter__btn.is-on {
  color: var(--ink);
  font-weight: 500;
}
/* Figures fade in/out smoothly when the filter changes */
.project-side__gallery figure {
  transition: opacity 260ms ease;
}
.project-side__gallery figure.is-hidden {
  /* !important needed to beat the masonry `> figure { display: block }`
     rule, which has higher specificity than this one. */
  display: none !important;
}

.project-side__gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 3vw, 56px);
}
.project-side__gallery--two {
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2vw, 32px) clamp(16px, 2vw, 32px);
  /* When a pair has mismatched aspect ratios, vertically center the shorter
     image in the row instead of top-aligning it — prevents the "floating high"
     look when a wide/short image sits next to a tall one. */
  align-items: center;
}
/* Full-width video still sits above the 2-column image grid */
.project-side__gallery--two .video-figure {
  grid-column: 1 / -1;
}

/* Masonry variant — CSS columns pack images tightly with no awkward gaps
   when aspect ratios vary (unlike grid, which centers short items in tall
   rows). Images flow top-to-bottom inside each column. */
.project-side__gallery--masonry {
  display: block;
  column-count: 2;
  column-gap: clamp(28px, 3vw, 56px);
}
.project-side__gallery.project-side__gallery--masonry > figure {
  break-inside: avoid;
  margin: 0 0 clamp(28px, 3vw, 56px);
  width: 100%;
  /* `display: block` + an explicit width is what lets column layout measure
     each figure correctly on WebKit browsers. */
  display: block;
}
.project-side__gallery--masonry > figure > img {
  width: 100%;
  height: auto;
  display: block;
}
/* Keep the video poster at full width across both columns */
.project-side__gallery--masonry .video-figure {
  column-span: all;
  margin-bottom: clamp(24px, 3vw, 56px);
}
@media (max-width: 720px) {
  .project-side__gallery--masonry { column-count: 1; }
}
@media (max-width: 720px) {
  .project-side__gallery--two {
    grid-template-columns: 1fr;
    gap: clamp(20px, 3vw, 40px);
  }
}
.project-side__gallery figure { margin: 0; }
.project-side__gallery img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: opacity .18s ease;
}
.project-side__gallery img:hover { opacity: 0.88; }
.project-side__gallery figcaption {
  display: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  letter-spacing: 0.04em;
}
@media (max-width: 900px) {
  .project-side {
    grid-template-columns: 1fr;
    gap: clamp(24px, 3vh, 40px);
  }
  .project-side__col { position: static; }
}

/* =========================================================
   Video embed (responsive 16:9 iframe)
   ========================================================= */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* =========================================================
   Video poster (link-out, when YouTube embed is disabled)
   ========================================================= */
.video-poster {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
}
.video-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s var(--ease, ease), opacity .3s ease;
}
.video-poster:hover img {
  transform: scale(1.02);
  opacity: 0.85;
}
.video-poster__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #fff;
  transition: transform .3s var(--ease, ease), opacity .3s ease;
  opacity: 0.9;
}
.video-poster__play svg {
  width: clamp(56px, 7vw, 84px);
  height: clamp(56px, 7vw, 84px);
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.35));
}
.video-poster:hover .video-poster__play {
  transform: scale(1.06);
  opacity: 1;
}
.video-figure figcaption {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  letter-spacing: 0.04em;
}
.video-figure figcaption a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.video-figure figcaption a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* =========================================================
   Coming soon — minimal editorial placeholder
   ========================================================= */
.coming-soon {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  min-height: clamp(320px, 50vh, 560px);
  padding: clamp(16px, 3vw, 32px) 0;
  border-top: 1px solid var(--rule);
}
.coming-soon__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 clamp(24px, 4vw, 40px) 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.coming-soon__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.5;
  animation: csPulse 1.8s ease-in-out infinite;
}
@keyframes csPulse {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.25); }
}
.coming-soon__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 9vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
}
.coming-soon__title em {
  font-style: italic;
}
.coming-soon__note {
  margin-top: clamp(28px, 4vw, 44px);
  max-width: 44ch;
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.coming-soon__rule {
  margin-top: clamp(32px, 5vw, 56px);
  width: 56px;
  height: 1px;
  background: var(--ink);
  opacity: 0.25;
}

/* =========================================================
   V3 — Inline strip (one-line bibliographic entry)
   ========================================================= */
.meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: clamp(20px, 3vw, 48px);
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--rule);
  margin-top: clamp(16px, 2vh, 28px);
}
.meta-strip .field {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}
.meta-strip .field .eyebrow {
  font-size: 10px;
  margin: 0;
}
.meta-strip .field p {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}
.meta-strip .field--project p {
  font-family: "Instrument Serif", "Times New Roman", Georgia, serif;
  font-style: italic;
  font-size: 18px;
  line-height: 1;
}
.meta-strip + section .project-gallery {
  padding-top: clamp(20px, 2.5vh, 32px);
}
section:has(> .container > .meta-strip) + section .project-gallery {
  padding-top: clamp(20px, 2.5vh, 32px);
}

/* Small top-left project title, used above the first artwork */
.project-title-top {
  padding: clamp(56px, 7vh, 96px) 0 0;
}
.project-title-top h1 {
  font-family: var(--sans);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 500;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--ink);
}
.project-title-top + section .project-gallery--top {
  padding-top: clamp(16px, 2vh, 24px) !important;
}

/* Gallery at the very top of the page — small breathing room from nav */
.project-gallery--top {
  padding-top: clamp(24px, 3vh, 40px) !important;
  padding-bottom: 0 !important;
}

/* Minimal hero placed BELOW the gallery (used as footer meta strip) */
.project-hero.is-minimal--below {
  padding: clamp(28px, 4vh, 48px) 0 clamp(40px, 6vh, 72px);
}
.project-hero.is-minimal--below .project-hero__meta {
  padding-top: 18px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(24px, 3vw, 56px) clamp(20px, 2.5vw, 40px);
  padding: clamp(40px, 6vh, 80px) 0 clamp(80px, 12vh, 140px);
}
.project-gallery figure { margin: 0; }
.project-gallery figcaption {
  display: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  letter-spacing: 0.04em;
}
.pg--full  { grid-column: span 12; }
.pg--wide  { grid-column: 2 / span 10; }
.pg--half-l{ grid-column: span 6; }
.pg--half-r{ grid-column: span 6; }
.pg--third { grid-column: span 4; }
.pg--inset { grid-column: 3 / span 8; }
@media (max-width: 900px) {
  .pg--full, .pg--wide, .pg--half-l, .pg--half-r,
  .pg--third, .pg--inset { grid-column: span 12; }
}
.project-gallery img { width: 100%; height: auto; cursor: zoom-in; transition: opacity .18s ease; }
.project-gallery img:hover { opacity: 0.88; }

/* =========================================================
   Edge nav — hover-to-reveal arrow + next/prev project name
   ========================================================= */
.edge-nav {
  position: fixed;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 40;
  color: var(--ink);
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.edge-nav--prev {
  left: clamp(18px, 2vw, 32px);
  transform: translate(-10px, -50%);
}
.edge-nav--next {
  right: clamp(18px, 2vw, 32px);
  transform: translate(10px, -50%);
  flex-direction: row-reverse;
}
.edge-nav.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}
.edge-nav:hover { opacity: 1; }
.edge-nav__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--ink);
  line-height: 0;
}
.edge-nav__arrow svg {
  width: 12px;
  height: 14px;
  display: block;
}
.edge-nav__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Uppercase mono has no descenders — nudge so caps sit on the same
     optical center as the chevron */
  transform: translateY(1px);
}
@media (hover: none), (max-width: 900px) {
  .edge-nav { display: none; }
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(12, 12, 12, 0.94);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(20px, 4vw, 60px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  cursor: zoom-out;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  transform-origin: center center;
  will-change: transform;
}
.lightbox.is-zooming img {
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
.lightbox__close {
  position: absolute;
  top: 20px; right: 24px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  color: #fff; font-size: 28px; line-height: 1;
  cursor: pointer;
  font-family: var(--mono);
}
.lightbox__close:hover { opacity: 0.7; }
body.lightbox-open { overflow: hidden; }

.lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: zoom-out;
}
.lightbox__stage img { cursor: default; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity .18s ease, transform .18s ease;
  padding: 0;
  z-index: 2;
}
.lightbox__nav svg {
  width: 22px;
  height: 34px;
  display: block;
  filter: drop-shadow(0 1px 6px rgba(0,0,0,0.45));
}
.lightbox__nav:hover { opacity: 1; }
.lightbox__nav--prev {
  left: clamp(8px, 2vw, 28px);
}
.lightbox__nav--next {
  right: clamp(8px, 2vw, 28px);
}
.lightbox__nav--prev:hover { transform: translate(-2px, -50%); }
.lightbox__nav--next:hover { transform: translate(2px, -50%); }

.lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
  user-select: none;
}

@media (max-width: 560px) {
  .lightbox__nav { width: 44px; height: 44px; }
  .lightbox__nav svg { width: 18px; height: 28px; }
  .lightbox__counter { bottom: 14px; font-size: 10px; }
}

.prose {
  grid-column: 3 / span 6;
  font-family: var(--serif);
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.45;
  color: var(--ink);
}
@media (max-width: 900px) { .prose { grid-column: span 12; } }

/* Project footer — prev / next */

.proj-nav {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: clamp(40px, 6vh, 80px) 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.proj-nav a {
  display: block;
  padding: 8px 0;
}
.proj-nav .eyebrow { display: block; margin-bottom: 8px; }
.proj-nav__title {
  font-family: "Instrument Serif", "Times New Roman", Georgia, serif;
  font-style: italic;
  font-size: clamp(24px, 2.6vw, 40px);
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 4px;
}
.proj-nav__next { text-align: right; }

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

/* Editorial intro treatment — small mono eyebrow, split serif headline,
   roman first line in ink / italic second line in muted gray. */
.about-copy .about-hero__eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(20px, 2.5vh, 32px);
}
.about-copy .about-hero__h {
  margin: 0;
  font-family: "Instrument Serif", "Times New Roman", Georgia, serif;
  font-weight: 400;
  font-size: clamp(32px, 3.6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.about-copy .about-hero__h-lead {
  display: block;
  font-style: normal;
}
.about-copy .about-hero__h-tail {
  display: block;
  font-style: italic;
  color: var(--muted);
}
.about-copy .about-hero__p {
  margin-top: clamp(24px, 3vh, 36px);
  font-family: var(--sans);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.65;
  color: var(--ink);
}
.about-copy .about-hero__meta {
  margin-top: 2px;
  /* Match the description paragraph's typography */
  font-family: var(--sans);
  font-size: clamp(13px, 0.9vw, 15px);
  letter-spacing: 0;
  line-height: 1.6;
  text-transform: none;
  color: var(--muted);
}
.about-copy .about-hero__meta a {
  color: var(--muted);
  text-decoration: none;
  transition: color 200ms ease;
}
.about-copy .about-hero__meta a:hover,
.about-copy .about-hero__meta a:focus-visible {
  color: var(--ink);
}
.about-copy .about-hero__meta-sep {
  display: inline-block;
  padding: 0 8px;
  color: var(--muted);
  opacity: 0.7;
}
.about-copy .about-hero__meta-icon {
  display: inline-block;
  width: 12px;
  height: 9px;
  margin-right: 8px;
  vertical-align: -1px;
  color: var(--ink);
}
.about-copy .about-hero__meta-note {
  color: var(--muted);
}
.about-copy .about-hero__meta-spark {
  display: inline-block;
  margin-right: 6px;
  vertical-align: -0.02em;
  /* A hair bigger than the 11px row so the sparkle reads without dominating */
  font-size: 1.15em;
  letter-spacing: 0;
  color: var(--ink);
}
/* Keep each chunk (email, link) together; only break at separators. */
.about-copy .about-hero__meta a { white-space: nowrap; }
@media (max-width: 560px) {
  .about-copy .about-hero__meta {
    font-size: 10.5px;
    letter-spacing: 0.14em;
    line-height: 1.9;
  }
  .about-copy .about-hero__meta-sep { padding: 0 6px; }
}
@media (max-width: 720px) {
  .about-copy .about-hero__h { font-size: clamp(28px, 7vw, 40px); }
}

.about-grid {
  display: grid;
  grid-template-columns: 4fr 9fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 1200px) {
  .about-grid { transform: translateX(-80px); }
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; transform: none; }
}

.portrait {
  aspect-ratio: 1 / 1;
  background: transparent;
  overflow: hidden;
  max-width: 280px;
  margin-left: auto;
}
.portrait img, .portrait svg { width: 100%; height: 100%; object-fit: contain; display: block; }
/* About section: keep desktop's generous top padding, but on mobile pull
   everything up so the portrait sits close to the heading instead of
   leaving a huge gap of empty space at the top. Centered on mobile. */
.about-section { padding-top: 120px; }
@media (max-width: 900px) {
  .about-section { padding-top: 48px; }
  .about-grid { gap: 24px; }
  .portrait {
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (max-width: 560px) {
  .about-section { padding-top: 32px; }
  .about-grid { gap: 20px; }
  .portrait { max-width: 180px; }
}

.about-copy p {
  font-family: var(--serif);
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.5;
  color: var(--ink);
}
.about-copy p + p { margin-top: 1em; }

.cv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px 40px;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  padding-top: 28px;
  margin-top: 36px;
}
.cv .eyebrow { padding-top: 0; }
.cv ul { list-style: none; margin: 0; padding: 0; }
.cv li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink);
  gap: 20px;
}
.cv li:last-child { border-bottom: 0; }
.cv li span.year { color: var(--muted); font-family: var(--mono); font-size: 12px; white-space: nowrap; flex-shrink: 0; }

/* CV collapses to a single column on mobile: each category label stacks
   above its list as a section header instead of sitting beside it. */
@media (max-width: 720px) {
  .cv {
    grid-template-columns: 1fr;
    gap: 0;
    align-items: start;
    padding-top: 20px;
    margin-top: 28px;
  }
  .cv .eyebrow {
    padding-top: 28px;
    margin-top: 4px;
  }
  .cv > .eyebrow:first-of-type {
    padding-top: 0;
    margin-top: 0;
  }
  .cv ul { margin-top: 10px; }
  .cv li {
    padding: 10px 0;
    font-size: 13.5px;
    gap: 12px;
  }
  .cv li span.year { font-size: 11px; }
}

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

.contact {
  padding: clamp(80px, 14vh, 160px) 0;
}
.contact__head { max-width: 18ch; }
.contact__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 5vw, 80px);
  margin-top: clamp(56px, 8vh, 96px);
  align-items: start;
}
@media (max-width: 900px) { .contact__grid { grid-template-columns: 1fr; } }

.contact__links { display: grid; gap: 28px; }
.contact__links .field { border-top: 1px solid var(--rule); padding-top: 10px; }
.contact__links .field a { font-family: var(--serif); font-size: clamp(22px, 2vw, 30px); }

.form { display: grid; gap: 20px; }
.form label { display: block; }
.form .eyebrow { display: block; margin-bottom: 8px; }
.form input,
.form textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  padding: 12px 0;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  transition: border-color var(--dur) var(--ease);
}
.form textarea { min-height: 140px; resize: vertical; }
.form input:focus,
.form textarea:focus { outline: 0; border-color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { background: transparent; color: var(--ink); }
.btn .arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

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

.foot {
  padding: clamp(60px, 10vh, 120px) 0 40px;
}
.foot__big {
  font-family: var(--serif);
  font-size: clamp(48px, 9vw, 160px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin: 0 0 48px;
}
.foot__big a {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  transition: opacity 320ms var(--ease);
}
.foot__big a:hover { opacity: 0.55; }
.foot__row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
  gap: 12px;
}
.foot__row a { color: var(--ink); }

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

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* -------------------- Home hero -------------------- */
body.is-home .hero > .container { transform: translateY(-10vh); }

/* -------------------- Photo — pannable canvas gallery -------------------- */
body.is-photo { overflow: hidden; }
body.is-photo .nav {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
}

.gallery {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.gallery.is-panning { cursor: grabbing; }
/* Kill tile hover/:hover/transition churn during an active pan — otherwise
   sweeping the cursor over 9 clone copies fires repaint work every frame. */
.gallery.is-panning .tile { pointer-events: none; }

.gallery__world {
  position: absolute;
  left: 0; top: 0;
  width: 2200px;
  height: 2000px;
  will-change: transform;
  transform: translateZ(0);          /* force dedicated compositor layer */
  backface-visibility: hidden;
}

.tile {
  position: absolute;
  pointer-events: auto;
  cursor: zoom-in;
  /* Isolate each tile's layout + paint so hover state changes don't invalidate
     the rest of the canvas. Huge win on the 3x3 clone grid. */
  contain: layout paint style;
}
.tile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f0efeb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  /* Only animate transform on hover — box-shadow transitions repaint every
     frame and stacked across hundreds of tiles that adds up. */
  transition: transform 160ms ease;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}
body[data-mode="diptych"] .tile img { height: 100%; }
/* Per-image crop overrides for portrait sources whose default centered crop
   doesn't read well at the small canvas-mode aspect (4:3). */
.tile img.thumb-pos-top { object-position: top !important; }
.tile:hover img {
  transform: translateY(-2px);
}
.tile__label {
  position: absolute;
  /* Anchor follows the cursor (set by JS via CSS vars). Falls back to tile-center
     on devices without a mouse so the label still reads. */
  left: var(--lb-x, 50%);
  top: var(--lb-y, 38%);
  transform: translate(-50%, -50%);
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(16px, 1.25vw, 22px);
  letter-spacing: 0.005em;
  text-transform: none;
  color: #f4f1ea;
  white-space: nowrap;
  opacity: 0;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 3;
  /* No fade on the label itself — it appears the instant it gets text */
  transition: none;
}
.tile:hover .tile__label { opacity: 1; }

/* Optional second line for tiles tied to an exhibition. Sits just below the
   main label, smaller. Reveal is driven by the typewriter (no auto-fade). */
.tile__sublabel {
  position: absolute;
  left: var(--lb-x, 50%);
  top: var(--lb-y, 38%);
  /* Push down ~1.6em from the main label's vertical center */
  transform: translate(-50%, calc(-50% + 1.6em));
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(12px, 0.95vw, 16px);
  letter-spacing: 0.01em;
  color: rgba(244, 241, 234, 0.88);
  white-space: nowrap;
  opacity: 0;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 3;
  transition: none;
}
.tile:hover .tile__sublabel { opacity: 1; }
.tile__sublabel.is-typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: currentColor;
  animation: tile-caret-blink 0.8s steps(1) infinite;
}
.tile__label.is-typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: currentColor;
  animation: tile-caret-blink 0.8s steps(1) infinite;
}
@keyframes tile-caret-blink {
  50% { opacity: 0; }
}

/* Gradual dim on hover + gradual undim on leave.
   Opacity is GPU-composited — this animates cheaply across all tiles. */
.gallery__world .tile {
  transition: opacity 320ms ease;
}
.gallery__world.is-hovering .tile {
  opacity: 0.14;
}
.gallery__world.is-hovering .tile:hover {
  opacity: 1;
}

.gallery__hint {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 400ms var(--ease);
}
.gallery__hint.is-gone { opacity: 0; }

/* Mode toggle (bottom-left) — left-aligned with .nav__brand above */
.gallery__modes {
  position: absolute;
  /* Matches .container's gutter, accounting for max-width centering on wide screens */
  left: calc(max((100vw - var(--max)) / 2, 0px) + var(--gutter));
  bottom: clamp(12px, 2.4vh, 22px);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
  -webkit-user-select: none;
  z-index: 5;
}
.gallery__modes button {
  background: none;
  border: 0;
  padding: 4px 2px;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: color 200ms var(--ease);
}
.gallery__modes button:hover { color: var(--ink); }
.gallery__modes button.is-on { color: var(--ink); }
.gallery__modes .sep { color: var(--rule); }

/* Gallery caption (bottom-right) — right-aligned with .nav__links above.
   Uses the same flex/padding shape as .gallery__modes so the visible text
   sits on the same baseline as CANVAS / LINEAR / DIPTYCH instead of dropping
   4px lower (which was caused by the buttons' inner padding on the left). */
.gallery__caption {
  position: absolute;
  right: calc(max((100vw - var(--max)) / 2, 0px) + var(--gutter));
  bottom: clamp(12px, 2.4vh, 22px);
  display: flex;
  align-items: center;
  padding: 4px 2px;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 5;
}

/* Linear & Diptych mode overrides */
body.is-photo[data-mode="linear"]  .tile img,
body.is-photo[data-mode="diptych"] .tile img {
  height: 100%;
  aspect-ratio: auto;
}
body.is-photo[data-mode="linear"]  .tile,
body.is-photo[data-mode="diptych"] .tile {
  height: 100%;
}
/* Linear: JS sets both width (from natural aspect ratio) and height
   (shared row height) inline on each tile, so the image just fills its
   container at its true proportions. */
body.is-photo[data-mode="linear"] .tile img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}
body.is-photo[data-mode="diptych"] .tile img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  /* Gallery framing: show full image (no crop), centered within the tile box */
  object-fit: contain;
  object-position: center;
  box-shadow: none;
  background: transparent;
}
/* Kill all hover affordances in diptych — behaves like a static gallery view */
body.is-photo[data-mode="diptych"] .tile { cursor: default; }
body.is-photo[data-mode="diptych"] .tile:hover img {
  transform: none;
  box-shadow: none;
}
body.is-photo[data-mode="diptych"] .gallery__world.is-hovering .tile {
  opacity: 1;           /* no dim on sibling tiles */
}

/* =========================================================
   SPLASH HOME PAGE  (body.is-splash)
   ========================================================= */
body.is-splash { overflow: hidden; }
body.is-splash .nav { border-bottom: 0 !important; background: transparent; }

.splash {
  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* =========================================================
   Home page aura + grain — soft atmospheric glow behind the
   title, full-bleed to the edges including under the nav
   ========================================================= */
body.is-home { position: relative; }

/* Make the nav transparent on the home page so the aura bleeds through */
body.is-home .nav {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Home page: give the dropdown the same white surface as the rest of the
   page, plus a matching grain overlay, so it reads as a seamless extension
   of the page (and masks the giant "Callie Wei" hero behind it on mobile)
   instead of letting the hero text bleed through. The grain is painted by
   a pseudo-element so we can match the multiply-blend look of body::after. */
body.is-home .nav__dropdown {
  background: var(--bg);
  border-color: #c9c7c2;
  isolation: isolate; /* contain the multiply blend below */
  overflow: hidden;   /* clip the grain to the dropdown's rounded edges */
}
body.is-home .nav__dropdown::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0   0 0 0 0 0   0 0 0 0 0   0 0 0 0.95 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 280px 280px;
  background-repeat: repeat;
  z-index: 1;
}
body.is-home .nav__dropdown a {
  border-bottom-color: #c9c7c2;
  position: relative;
  z-index: 2; /* keep links above the grain layer */
}

/* Film grain — stronger, film-scan feel */
body.is-home::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0   0 0 0 0 0   0 0 0 0 0   0 0 0 0.95 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 280px 280px;
  background-repeat: repeat;
}

/* Lift nav and splash content above the aura layers */
body.is-home .nav { position: sticky; z-index: 50; }
body.is-home main.splash { position: relative; z-index: 2; }

.splash__grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px);
  grid-template-rows: 1fr;
  align-items: end;
  gap: clamp(40px, 6vw, 120px);
  width: 100%;
  padding-top: clamp(24px, 4vh, 48px);
  position: relative;
  z-index: 2;
  padding-bottom: clamp(60px, 9vh, 120px);
  padding-left: clamp(28px, 3vw, 56px);
  /* Right edge aligns with the nav container's right edge (Contact link) */
  padding-right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}

/* Top-left LA clock, horizontally aligned with the Callie Wei title */
.splash__clock {
  position: fixed;
  top: clamp(18px, 2.6vh, 30px);
  left: calc(clamp(28px, 3vw, 56px) + clamp(40px, 6vw, 120px));
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 60;
}

.splash__left {
  align-self: end;
  padding-bottom: clamp(4px, 1vh, 12px);
  padding-left: clamp(40px, 6vw, 120px);
}

.splash__title {
  margin: 0;
  font-family: "Instrument Serif", "Times New Roman", Georgia, serif;
  font-style: normal;
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.14em;  /* tuned in from the original -0.1em */
  color: var(--ink);
}
.splash__title-l1,
.splash__title-l2 {
  display: block;
  font-size: clamp(80px, 11vw, 170px);
}
.splash__title-l1 { font-style: normal; }
.splash__title-l2 { font-style: italic; padding-left: 0; }

.splash__sub {
  margin: clamp(28px, 4vh, 48px) 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}

.splash__cta {
  display: inline-block;
  margin-top: clamp(36px, 5vh, 60px);
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  letter-spacing: 0.01em;
}
/* Per-letter ripple on hover — same treatment as the splash index */
.splash__cta .ch {
  display: inline-block;
  opacity: 1;
  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease;
  transition-delay: calc(var(--i, 0) * 18ms);
  will-change: transform, opacity;
}
.splash__cta:hover .ch {
  animation: chRipple 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 18ms);
}

/* Index panel, lower-right */
.splash__index {
  align-self: end;
  /* Match the darker divider used between list items */
  border-left: 1px solid #c9c6c0;
  padding-left: clamp(20px, 2vw, 32px);
  padding-bottom: clamp(8px, 1vh, 16px);
}
.splash__index-head {
  display: block;
  font-size: 10px;
  margin-bottom: 16px;
  color: var(--muted);
}
.splash__index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.splash__index-list li {
  /* Darker than --rule so dividers read against the grainy off-white bg */
  border-top: 1px solid #c9c6c0;
}
.splash__index-list li:last-child { border-bottom: 1px solid #c9c6c0; }
.splash__index-list a {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: baseline;
  gap: 12px;
  padding: 12px 28px 12px 0;
  color: var(--ink);
  transition: opacity 320ms ease;
}

/* Spotlight: dim siblings when hovering any row */
.splash__index-list:hover a { opacity: 0.32; }
.splash__index-list:hover a:hover { opacity: 1; }

/* Arrow that slides in on hover */
.splash__index-list a::after {
  content: "\2192"; /* → */
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translate(-8px, -50%);
  opacity: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease;
  pointer-events: none;
}
.splash__index-list a:hover::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.splash__index-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  transition: color 260ms ease;
}
.splash__index-list a:hover .splash__index-num { color: var(--ink); }
.splash__index-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.splash__index-title {
  font-family: "Instrument Serif", "Times New Roman", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.1;
  color: var(--ink);
}
/* Each .word groups its inline-block letter spans into one unbreakable
   unit, so the browser only wraps at real word boundaries (never mid-word). */
.splash__index-title .word,
.splash__cta .word {
  display: inline-block;
  white-space: nowrap;
}
.splash__index-title .ch {
  display: inline-block;
  opacity: 1;
  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease;
  transition-delay: calc(var(--i, 0) * 18ms);
  will-change: transform, opacity;
}
/* On hover: letters briefly fade + lift in a wave, left-to-right */
.splash__index-list a:hover .splash__index-title .ch {
  animation: chRipple 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 18ms);
}
@keyframes chRipple {
  0%   { transform: translateY(0);    opacity: 1;   }
  40%  { transform: translateY(-4px); opacity: 0.35; }
  100% { transform: translateY(0);    opacity: 1;   }
}
.splash__index-client {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Footer meta row */
.splash__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: clamp(16px, 2vh, 24px) clamp(28px, 3vw, 56px) clamp(20px, 3vh, 32px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.splash__foot a { color: inherit; }

@media (max-width: 900px) {
  body.is-splash { overflow: auto; }
  .splash__grid {
    grid-template-columns: 1fr;
    gap: clamp(40px, 6vh, 80px);
    align-items: start;
  }
  .splash__left { align-self: start; }
  .splash__index { border-left: 0; padding-left: 0; }
}

/* =========================================================
   Home title link (Callie Wei → X-Men)
   ========================================================= */
.splash__title-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
/* Film-grain dissolve on hover — displacement amount animated via JS;
   opacity fades in sync so the name feels like it's dissipating */
.splash__title {
  filter: url(#grainy-dissolve);
  transition: opacity 650ms var(--ease);
  will-change: opacity, filter;
}
.splash__title-link:hover .splash__title,
.splash__title-link:focus-visible .splash__title {
  opacity: 0.42;
}
.splash__title-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }

/* =========================================================
   RESPONSIVE — mobile-friendly polish
   ========================================================= */

/* Safety net: images never overflow their container */
img { max-width: 100%; height: auto; }

/* --- Nav: tighter at tablet width --- */
@media (max-width: 860px) {
  .nav__inner { height: 64px; }
  .nav__links { gap: 20px; font-size: 12px; }
}

/* --- Nav: stack brand + links on narrow viewports --- */
@media (max-width: 560px) {
  .nav__inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .nav__brand { font-size: 12px; }
  body.is-home .nav__brand { display: none; }  /* was only visibility: hidden — reclaim space on mobile */
  .nav__links {
    gap: 14px;
    font-size: 11px;
    letter-spacing: 0.04em;
    flex-wrap: wrap;
    justify-content: center;
  }
  /* Center-anchor dropdowns under their trigger so they don't overflow the viewport */
  .nav__dropdown {
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(-6px);
    min-width: min(280px, 90vw);
    max-width: 90vw;
  }
  .nav__group:hover > .nav__dropdown,
  .nav__group:focus-within > .nav__dropdown,
  .nav__group.is-open > .nav__dropdown {
    transform: translateX(-50%) translateY(0);
  }
  .nav__dropdown a { white-space: normal; }
}

/* --- Larger tap targets for dropdowns on touch --- */
@media (hover: none) {
  .nav__dropdown a { padding: 16px 22px; font-size: 14px; }
}

/* --- Splash: tune padding/sizes on tablet + mobile --- */
@media (max-width: 900px) {
  .splash { min-height: calc(100vh - 64px); }
  .splash__clock { left: var(--gutter); top: 18px; }
  .splash__grid {
    padding-top: clamp(72px, 12vh, 100px);
    padding-bottom: clamp(40px, 6vh, 80px);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
  .splash__left { padding-left: 0; padding-bottom: 0; }
  .splash__title-l1, .splash__title-l2 {
    font-size: clamp(64px, 14vw, 120px);
  }
  .splash__index { padding-bottom: 0; }
}

@media (max-width: 560px) {
  .splash__title-l1, .splash__title-l2 {
    font-size: clamp(52px, 18vw, 92px);
    letter-spacing: -0.02em;  /* slight tightening — keeps a hair of space between Wei's e and i */
  }
  .splash__sub { font-size: 10px; margin-top: 20px; }
  .splash__cta { font-size: 13px; margin-top: 24px; }
  .splash__index-head { font-size: 8px; margin-bottom: 10px; }
  .splash__index-title { font-size: 14px; line-height: 1.15; }
  .splash__index-num { font-size: 8px; }
  .splash__index-client { font-size: 8px; }
  .splash__index-list a {
    grid-template-columns: 28px 1fr;
    gap: 8px;
    padding: 10px 22px 10px 0;
  }
  .splash__clock { font-size: 9px; top: 12px; letter-spacing: 0.1em; }
}

/* --- Edge-hover project navs: never show on narrow / touch viewports --- */
@media (max-width: 900px), (hover: none) {
  .edge-nav { display: none !important; }
}

/* --- Project sidebar (V2): tighten padding + title on small --- */
@media (max-width: 720px) {
  .project-side {
    padding: clamp(16px, 3vh, 28px) 0 clamp(40px, 6vh, 80px);
  }
  .project-side__title {
    font-size: clamp(22px, 5.5vw, 28px);
    margin-bottom: 24px;
  }
  .project-side__meta .field { margin-bottom: 12px; }
  .project-side__meta .field p { font-size: 13px; }
}

/* --- Project navigation: stack prev/next on small --- */
@media (max-width: 560px) {
  .proj-nav {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }
  .proj-nav__title { font-size: 18px; line-height: 1.2; }
}

/* --- Hero sections on small screens --- */
@media (max-width: 560px) {
  .hero {
    min-height: auto;
    padding: clamp(56px, 10vh, 100px) 0 clamp(36px, 6vh, 72px);
  }
}

/* --- Lightbox close button: easier to hit on mobile --- */
@media (max-width: 560px) {
  .lightbox__close { top: 12px; right: 12px; width: 40px; height: 40px; }
}

/* --- Footer word-wrap safety --- */
.foot__row a { word-break: break-word; }
