@import url('./tokens.css');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-page);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  overflow-x: hidden;
  transition: background 400ms var(--ease-out), color 400ms var(--ease-out);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
img { max-width: 100%; display: block; }

/* ----- Dark mode ------------------------------------------------ */
body[data-theme="dark"] {
  --bg-page: var(--color-near-black);
  --bg-card: var(--color-dark-surface);
  --bg-card-elevated: var(--color-dark-surface);
  --fg-primary: var(--color-ivory);
  --fg-secondary: var(--color-warm-silver);
  --fg-tertiary: var(--color-stone-gray);
  --color-border-cream: #2a2a28;
  --color-border-warm: #30302e;
  --color-ring-warm: #3a3a37;
  --color-ring-deep: #4a4a46;
  --color-warm-sand: #26261f;
}
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4 { color: var(--color-ivory); }
body[data-theme="dark"] p { color: var(--fg-secondary); }

/* ----- Layout primitives --------------------------------------- */
.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.container-wide { max-width: 1520px; margin: 0 auto; padding: 0 32px; }
.section { padding: 120px 0; }
.section-tight { padding: 80px 0; }
.section-dark {
  background: var(--color-near-black);
  color: var(--color-warm-silver);
}
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--color-ivory); }
.section-dark p { color: var(--color-warm-silver); }

body[data-theme="dark"] .section-dark { background: #0a0a0a; }

.overline {
  font-family: var(--font-sans);
  font-size: 10px; letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  font-weight: 500;
}

.rule {
  height: 1px; width: 48px; background: var(--fg-primary);
  opacity: 0.6;
}

/* ----- Nav ----------------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg-page) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms var(--ease-out), background 300ms var(--ease-out);
}
.nav.scrolled { border-bottom-color: var(--color-border-cream); }
.nav-inner {
  max-width: 1520px; margin: 0 auto; padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.nav-mark {
  font-family: var(--font-serif); font-weight: 500;
  font-size: 20px; letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 10px;
}
.nav-mark .zh {
  font-size: 15px; color: var(--fg-tertiary);
  font-family: var(--font-serif);
}
.nav-links {
  display: flex; gap: 36px; align-items: center;
}
.nav-link {
  font-size: 14px; color: var(--fg-secondary);
  transition: color 150ms var(--ease-out);
  position: relative;
  font-weight: 400;
  letter-spacing: 0.1px;
}
.nav-link:hover { color: var(--fg-primary); }
.nav-link.active { color: var(--fg-primary); }
.nav-link.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: var(--color-terracotta);
}

/* Works dropdown */
.nav-dd { position: relative; }
.nav-link-dd {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
}
.nav-caret {
  transition: transform 200ms var(--ease-out);
  opacity: 0.7;
  margin-top: 1px;
}
.nav-caret.open { transform: rotate(180deg); }
.nav-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 188px;
  background: var(--bg-card);
  border: 1px solid var(--color-border-warm);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.10), 0 0 0 1px var(--color-ring-subtle);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 180ms;
  z-index: 60;
}
.nav-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-menu::before {
  content: '';
  position: absolute;
  top: -5px; left: 50%;
  width: 10px; height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--bg-card);
  border-left: 1px solid var(--color-border-warm);
  border-top: 1px solid var(--color-border-warm);
}
.nav-menu-item {
  display: flex; align-items: baseline; gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  transition: background 140ms var(--ease-out);
  cursor: pointer;
}
.nav-menu-item:hover { background: var(--color-warm-sand); }
.nav-menu-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-tertiary);
  letter-spacing: 0.08em;
  min-width: 16px;
}
.nav-menu-label {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--fg-primary);
  font-style: italic;
}

/* Anchor offset so fixed nav doesn't cover medium headers */
.medium-anchor { scroll-margin-top: 88px; }
#works { scroll-margin-top: 72px; }
.nav-right { display: flex; align-items: center; gap: 20px; }

/* Hamburger — hidden on desktop */
.nav-burger {
  display: none;
  width: 30px; height: 24px;
  position: relative;
  flex-direction: column; justify-content: space-between;
  padding: 4px 0;
}
.nav-burger span {
  display: block; height: 1.5px; width: 100%;
  background: var(--fg-primary);
  transition: transform 280ms var(--ease-out), opacity 200ms var(--ease-out);
  transform-origin: center;
}
.nav-burger.open span { background: #faf9f5; }
.nav-burger.open span:nth-child(1) { transform: translateY(7.25px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7.25px) rotate(-45deg); }

/* Mobile menu panel */
.nav-mobile {
  position: fixed; inset: 0;
  background: #14110f;
  z-index: 49;
  opacity: 0; visibility: hidden;
  transition: opacity 320ms var(--ease-out), visibility 320ms;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: 140px 36px 40px;
  overflow-y: auto;
}
.nav-mobile.open { opacity: 1; visibility: visible; }
.nav-mobile-inner { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.nav-mobile-link {
  font-family: var(--font-serif);
  font-size: 40px; line-height: 1.25;
  color: #faf9f5;
  letter-spacing: -0.02em;
  cursor: pointer;
}
.nav-mobile-group { display: flex; flex-direction: column; }
.nav-mobile-sub {
  display: flex; flex-direction: column; gap: 10px;
  margin: 10px 0 18px;
  padding-left: 4px;
}
.nav-mobile-sublink {
  font-family: var(--font-sans);
  font-size: 15px; letter-spacing: 0.04em;
  color: rgba(250, 249, 245, 0.7);
  display: flex; align-items: baseline; gap: 12px;
  cursor: pointer;
}
.nav-mobile-sublink .nav-menu-num { color: var(--color-terracotta); }

.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--color-border-warm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-secondary);
  transition: all 200ms var(--ease-out);
}
.theme-toggle:hover { color: var(--fg-primary); border-color: var(--color-ring-deep); }

/* ----- Hero ---------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
/* Full-screen crossfading painting slideshow */
.hero-bg { position: absolute; inset: 0; z-index: 0; background: #100f0e; }
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 18%;
  opacity: 0; transform: scale(1.0);
  transition: opacity 1700ms ease-in-out, transform 7000ms ease-out;
  will-change: opacity, transform;
}
.hero-slide.on { opacity: 1; transform: scale(1.035); }
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(8,8,7,0.80) 0%, rgba(8,8,7,0.46) 48%, rgba(8,8,7,0.30) 100%),
    linear-gradient(0deg, rgba(8,8,7,0.64) 0%, rgba(8,8,7,0.10) 42%),
    rgba(12,11,10,0.28);
}
.hero-content {
  position: relative; z-index: 2;
  width: 100%; max-width: 1520px;
  margin: 0 auto;
  padding: 130px 48px 90px;
}
.hero-kicker {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 28px;
}
.hero-kicker .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-terracotta);
}
.hero-kicker span {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.02em;
}
.hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(72px, 11vw, 168px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: #faf9f5;
  text-shadow: 0 2px 30px rgba(0,0,0,0.35);
  margin: 0;
}
.hero-title .ln {
  display: block; overflow: hidden;
}
.hero-title .ln > span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  animation: rise 1100ms var(--ease-out) forwards;
}
.hero-title .ln:nth-child(1) > span { animation-delay: 120ms; }
.hero-title .ln:nth-child(2) > span { animation-delay: 260ms; }
.hero-title .zh {
  font-family: var(--font-serif);
  font-size: 0.22em;
  color: var(--color-terracotta);
  vertical-align: top;
  margin-left: 0.3em;
  letter-spacing: 0.15em;
  opacity: 0;
  animation: fadeIn 1400ms var(--ease-out) 800ms forwards;
  font-weight: 400;
}
.hero-sub {
  margin-top: 40px;
  max-width: 480px;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255,255,255,0.84);
  text-shadow: 0 1px 16px rgba(0,0,0,0.35);
  opacity: 0;
  animation: fadeIn 1000ms var(--ease-out) 900ms forwards;
}
.hero-meta {
  margin-top: 56px;
  display: flex; gap: 40px;
  font-size: 13px;
  color: var(--fg-tertiary);
  letter-spacing: 0.04em;
  opacity: 0;
  animation: fadeIn 1000ms var(--ease-out) 1100ms forwards;
}
.hero-meta .k { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 6px; color: rgba(255,255,255,0.55); }
.hero-meta .v { font-family: var(--font-serif); font-size: 16px; color: #ffffff; font-style: italic; }

.hero-credit {
  position: absolute; right: 48px; bottom: 40px; z-index: 2;
  text-align: right;
  display: flex; flex-direction: column; gap: 4px;
  opacity: 0;
  animation: fadeIn 1000ms var(--ease-out) 1600ms forwards;
}
.hero-credit-idx {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.18em;
  color: rgba(255,255,255,0.6);
}
.hero-credit-title {
  font-family: var(--font-serif); font-style: italic;
  font-size: 15px; color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
  animation: fadeUp 700ms var(--ease-out);
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.hero-scroll-hint {
  position: absolute;
  left: 48px; bottom: 40px;
  display: flex; align-items: center; gap: 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: rgba(255,255,255,0.75);
  opacity: 0;
  animation: fadeIn 1000ms var(--ease-out) 1800ms forwards;
}
.hero-scroll-hint .line {
  width: 40px; height: 1px; background: currentColor; position: relative;
  overflow: hidden;
}
.hero-scroll-hint .line::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.9);
  transform: translateX(-100%);
  animation: slideRight 2.4s ease-in-out infinite;
}

@keyframes rise {
  to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeIn { to { opacity: 1; } }
@keyframes heroImg {
  to { opacity: 1; transform: scale(1); }
}
@keyframes blurDrift {
  0%, 100% { transform: scale(1.15) translate(0, 0); }
  50% { transform: scale(1.2) translate(-2%, 1%); }
}
@keyframes slideRight {
  0% { transform: translateX(-100%); }
  60% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ----- Marquee (medium strip) --------------------------------- */
.medium-strip {
  padding: 28px 0;
  border-top: 1px solid var(--color-border-cream);
  border-bottom: 1px solid var(--color-border-cream);
  overflow: hidden;
  white-space: nowrap;
}
.medium-strip-inner {
  display: inline-flex;
  gap: 64px;
  animation: marquee 38s linear infinite;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  color: var(--fg-secondary);
}
.medium-strip-inner span { display: inline-flex; align-items: center; gap: 64px; }
.medium-strip-inner .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--color-terracotta);
  display: inline-block;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ----- Works archive ----------------------------------------- */
.works-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  padding: 120px 0 60px;
  align-items: end;
}
.works-intro h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(44px, 6vw, 84px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  margin: 0;
}
.works-intro .count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-tertiary);
  letter-spacing: 0.1em;
}

.medium-header {
  padding: 80px 0 40px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: baseline;
  border-top: 1px solid var(--color-border-warm);
}
.medium-header .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-tertiary);
  letter-spacing: 0.15em;
}
.medium-header h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--fg-primary);
}
.medium-header .note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--fg-secondary);
  max-width: 420px;
  line-height: 1.5;
  margin-top: 12px;
}

.work-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mg-y, 28px) var(--mg-x, 28px);
  padding: 20px 0 40px;
}
.work {
  flex: 0 0 auto;
  position: relative;
  cursor: pointer;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}
.work:focus-visible { outline: 2px solid var(--color-terracotta); outline-offset: 4px; }
.work.in { opacity: 1; transform: translateY(0); }
.work-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--color-warm-sand);
  border-radius: 2px;
  height: var(--row, 300px);
}
.work img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1200ms var(--ease-out), filter 600ms var(--ease-out);
  display: block;
}
.work:hover img {
  transform: scale(1.035);
  filter: brightness(0.86);
}
.work-expand {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(20,20,19,0.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: #fff;
  opacity: 0; transform: scale(0.8);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
  pointer-events: none;
}
.work:hover .work-expand { opacity: 1; transform: scale(1); }
.work-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 20px 24px;
  color: #fff;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 300ms var(--ease-out), transform 500ms var(--ease-out);
  pointer-events: none;
}
.work:hover .work-caption { opacity: 1; transform: translateY(0); }
.work-caption .t {
  font-family: var(--font-serif); font-style: italic;
  font-size: 20px; line-height: 1.2; margin-bottom: 4px;
}
.work-caption .m {
  font-size: 12px; opacity: 0.85; letter-spacing: 0.04em;
}

.work-meta {
  margin-top: 16px;
  display: flex; justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.work-meta .t {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--fg-primary);
  font-weight: 500;
}
.work-meta .y {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-tertiary);
}
.work-meta .m {
  font-size: 12px;
  color: var(--fg-secondary);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* Column spans */
.c-6 { grid-column: span 6; }
.c-7 { grid-column: span 7; }
.c-5 { grid-column: span 5; }
.c-4 { grid-column: span 4; }
.c-8 { grid-column: span 8; }
.c-12 { grid-column: span 12; }

/* Full-bleed break sections */
.bleed {
  position: relative;
  margin: 120px calc(-1 * max(32px, (100vw - 1520px) / 2));
  height: 80vh;
  max-height: 720px;
  overflow: hidden;
}
.bleed img {
  width: 100%; height: 100%; object-fit: cover;
}
.bleed-caption {
  position: absolute;
  left: 48px; bottom: 40px;
  max-width: 440px;
  color: #fff;
}
.bleed-caption .overline { color: rgba(255,255,255,0.7); }
.bleed-caption h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: 36px;
  line-height: 1.15;
  color: #fff;
  margin: 8px 0 0;
}

/* Aspect ratios kept for lightbox / fallback; row gallery uses fixed height */
.ar-portrait, .ar-tall, .ar-square, .ar-landscape { aspect-ratio: auto; }

/* ----- Lightbox ---------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 48px clamp(56px, 9vw, 120px);
  background: rgba(10,10,9,0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: lbFade 280ms var(--ease-out);
}
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.lb-stage {
  margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  animation: lbRise 380ms var(--ease-out);
}
@keyframes lbRise { from { opacity: 0; transform: translateY(14px) scale(0.99); } to { opacity: 1; transform: none; } }
.lb-img-wrap { max-width: 100%; min-height: 0; display: flex; }
.lb-img-wrap.lb-panels { gap: clamp(10px, 1.6vw, 28px); align-items: flex-start; justify-content: center; }
.lb-img-wrap.lb-panels img { max-height: 80vh; }
.lb-img-wrap.lb-stack { flex-direction: column; align-items: center; justify-content: center; max-height: 82vh; gap: 14px; padding: 0; overflow: visible; }
.lb-img-wrap.lb-stack img { max-width: min(100%, 1000px); width: auto; height: auto; object-fit: contain; }
.lb-img-wrap.lb-split { gap: clamp(12px, 1.6vw, 28px); align-items: center; justify-content: center; max-height: 82vh; }
.lb-img-wrap.lb-split .lb-split-main { display: flex; align-items: center; justify-content: center; min-width: 0; border: none; background: none; padding: 0; cursor: default; }
.lb-img-wrap.lb-split .lb-split-main img { max-height: 82vh; max-width: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 24px 80px rgba(0,0,0,0.5); animation: lbImg 360ms var(--ease-out); }
.lb-img-wrap.lb-split .lb-split-side { display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; min-width: 0; }
.lb-thumb { border: none; background: none; padding: 0; margin: 0; cursor: pointer; display: flex; min-width: 0; position: relative; border-radius: 2px; overflow: hidden; transition: transform 200ms var(--ease-out); }
.lb-thumb::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 0 rgba(255,255,255,0); transition: box-shadow 180ms var(--ease-out); pointer-events: none; }
.lb-thumb:hover { transform: translateY(-2px); }
.lb-thumb:hover::after { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.85); }
.lb-thumb:focus-visible::after { box-shadow: inset 0 0 0 2px var(--color-terracotta); }
.lb-img-wrap.lb-split .lb-split-side img { max-width: 100%; width: auto; height: auto; object-fit: contain; }
.lb-img-wrap.lb-split .lb-split-side.lb-split-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  align-content: center;
  max-height: 82vh;
  max-width: 42vw;
}
.lb-img-wrap.lb-split .lb-split-side.lb-split-grid .lb-thumb { width: 100%; }
.lb-img-wrap.lb-split .lb-split-side.lb-split-grid img {
  width: 100%; height: 100%; object-fit: cover;
  max-height: calc((82vh - 24px) / 3);
  border-radius: 2px;
}

/* Mobile: stack main above thumbnails */
@media (max-width: 760px) {
  .lb-img-wrap.lb-split { flex-direction: column; gap: 12px; max-height: 84vh; overflow: hidden; }
  .lb-img-wrap.lb-split .lb-split-main { flex: 1 1 auto; min-height: 0; width: 100%; }
  .lb-img-wrap.lb-split .lb-split-main img { max-height: 56vh; }
  .lb-img-wrap.lb-split .lb-split-side,
  .lb-img-wrap.lb-split .lb-split-side.lb-split-grid {
    display: flex; flex-direction: row; flex-wrap: nowrap;
    gap: 8px; max-width: 92vw; width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    align-content: initial; align-items: center;
  }
  .lb-img-wrap.lb-split .lb-split-side .lb-thumb { flex: 0 0 auto; height: 18vh; width: auto; }
  .lb-img-wrap.lb-split .lb-split-side.lb-split-grid .lb-thumb { width: auto; }
  .lb-img-wrap.lb-split .lb-split-side img,
  .lb-img-wrap.lb-split .lb-split-side.lb-split-grid img { height: 18vh; width: auto; max-height: 18vh; }
}
.lb-stage img {
  max-width: 100%; max-height: 76vh;
  width: auto; height: auto; object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: lbImg 420ms var(--ease-out);
}
@keyframes lbImg { from { opacity: 0; } to { opacity: 1; } }
.lb-meta { text-align: center; color: #faf9f5; }
.lb-title { font-family: var(--font-serif); font-style: italic; font-size: 22px; line-height: 1.2; }
.lb-sub { font-size: 13px; color: rgba(255,255,255,0.62); margin-top: 6px; letter-spacing: 0.03em; }
.lb-close {
  position: absolute; top: 24px; right: 28px;
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.06);
  transition: background 180ms var(--ease-out), color 180ms var(--ease-out);
}
.lb-close:hover { background: rgba(255,255,255,0.14); color: #fff; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.05);
  transition: background 180ms var(--ease-out), color 180ms var(--ease-out);
}
.lb-nav:hover { background: rgba(255,255,255,0.14); color: #fff; }
.lb-prev { left: clamp(12px, 3vw, 40px); }
.lb-next { right: clamp(12px, 3vw, 40px); }
.lb-count {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em;
  color: rgba(255,255,255,0.55);
}

/* ----- About --------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 96px;
  padding: 120px 0;
  align-items: start;
}
.about-portrait {
  position: sticky; top: 120px;
  aspect-ratio: 3/4;
  border-radius: 2px;
  overflow: hidden;
  background: var(--color-warm-sand);
}
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }
.about-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  margin: 16px 0 48px;
  color: var(--fg-primary);
}
.about-body {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.7;
  color: var(--fg-primary);
  max-width: 560px;
}
.about-body p { margin: 0 0 22px; color: var(--fg-primary); }
.about-body p:first-of-type::first-letter {
  font-family: var(--font-serif);
  font-size: 4.8em;
  line-height: 0.9;
  float: left;
  padding-right: 14px;
  padding-top: 6px;
  color: var(--color-terracotta);
  font-weight: 500;
}
.about-body .em { color: var(--color-terracotta); font-style: italic; }

/* ----- Exhibitions ------------------------------------------- */
.cv {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  padding: 120px 0;
  align-items: start;
}
.cv h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  margin: 16px 0 0;
  position: sticky; top: 120px;
}
.cv-list { display: flex; flex-direction: column; gap: 0; }
.cv-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--color-border-warm);
  align-items: baseline;
  transition: padding-left 300ms var(--ease-out);
}
.cv-item:hover { padding-left: 12px; }
.cv-item:last-child { border-bottom: 1px solid var(--color-border-warm); }
.cv-item .year {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-tertiary);
  letter-spacing: 0.08em;
}
.cv-item .title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  color: var(--fg-primary);
  line-height: 1.3;
}
.cv-item .venue {
  font-size: 14px;
  color: var(--fg-secondary);
  margin-top: 4px;
  font-style: normal;
}
.cv-item .tag {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}

.cv-section-label {
  padding: 40px 0 8px;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  font-weight: 500;
}
.cv-section-label:first-child { padding-top: 0; }

/* ----- Contact ----------------------------------------------- */
.contact {
  padding: 160px 0 140px;
  text-align: left;
  max-width: 900px;
  margin: 0 auto;
}
.contact .overline { margin-bottom: 20px; }
.contact h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(52px, 8vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 48px;
}
.contact h2 .em {
  font-style: italic;
  color: var(--color-terracotta);
}
.contact-lead {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.5;
  color: var(--fg-secondary);
  max-width: 600px;
  margin-bottom: 64px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  border-top: 1px solid var(--color-border-warm);
  padding-top: 48px;
}
.contact-item .k {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  margin-bottom: 10px;
}
.contact-item .v {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--fg-primary);
  line-height: 1.3;
}
.contact-item .v a { border-bottom: 1px solid var(--color-border-warm); padding-bottom: 2px; transition: border-color 200ms var(--ease-out); }
.contact-item .v a:hover { border-bottom-color: var(--color-terracotta); }

/* ----- Footer ------------------------------------------------ */
.footer {
  border-top: 1px solid var(--color-border-warm);
  padding: 48px 0 48px;
  font-size: 13px;
  color: var(--fg-tertiary);
}
.footer-inner {
  display: flex; justify-content: space-between; gap: 24px;
  align-items: baseline;
}
.footer .mark {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--fg-primary);
}

/* ----- Tweaks panel ------------------------------------------ */
.tweaks {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--color-border-warm);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08), 0 0 0 1px var(--color-ring-subtle);
  font-family: var(--font-sans);
  font-size: 13px;
  min-width: 240px;
}
.tweaks-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.tweaks-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-primary);
}
.tweaks-close {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-tertiary);
  transition: all 150ms var(--ease-out);
}
.tweaks-close:hover { color: var(--fg-primary); background: var(--color-warm-sand); }
.tweak-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  gap: 16px;
}
.tweak-row + .tweak-row { border-top: 1px solid var(--color-border-cream); }
.tweak-row .label { color: var(--fg-secondary); font-size: 13px; }
.tweak-seg {
  display: inline-flex;
  background: var(--color-warm-sand);
  border-radius: 8px;
  padding: 2px;
  gap: 0;
}
.tweak-seg button {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--fg-secondary);
  font-weight: 500;
  transition: all 150ms var(--ease-out);
}
.tweak-seg button.on {
  background: var(--bg-card);
  color: var(--fg-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ----- Scroll reveal ---------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ----- Section intro (About / CV / Contact titles) ---------- */
.section-kicker {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.section-kicker .rule { width: 36px; height: 1px; background: var(--color-terracotta); }
.section-kicker .txt {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  font-weight: 500;
}

/* ----- Blur-moment feature (Marina-style) -------------------- */
.blur-feature {
  position: relative;
  height: 100vh;
  max-height: 820px;
  overflow: hidden;
  margin: 0 calc(-1 * max(32px, (100vw - 1520px) / 2));
}
.blur-feature-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}
.blur-feature-img.blurred {
  filter: grayscale(1) blur(40px);
  transform: scale(1.1);
  opacity: 0.85;
}
.blur-feature-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  padding: 0 clamp(32px, 8vw, 120px);
  color: #fff;
}
.blur-feature-content .overline { color: rgba(255,255,255,0.65); }
.blur-feature-content h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: #fff;
  max-width: 900px;
  margin: 20px 0 0;
}
.blur-feature-content .body {
  font-family: var(--font-serif);
  font-size: 18px;
  max-width: 520px;
  line-height: 1.55;
  color: rgba(255,255,255,0.82);
  margin-top: 28px;
}

/* ----- Parallax feature image -------------------------------- */
.work-img-wrap[data-parallax] img {
  will-change: transform;
}

/* ----- Responsive -------------------------------------------- */
@media (max-width: 960px) {
  .hero-content { padding: 120px 28px 84px; }
  .hero-credit { right: 28px; bottom: 30px; }
  .hero-scroll-hint { left: 28px; }
  .works-intro { grid-template-columns: 1fr; gap: 32px; }
  .medium-header { grid-template-columns: 1fr; gap: 12px; }
  .about { grid-template-columns: 1fr; gap: 48px; }
  .about-portrait { position: static; max-width: 420px; }
  .cv { grid-template-columns: 1fr; gap: 40px; }
  .cv h2 { position: static; }
  .contact-grid { grid-template-columns: 1fr; gap: 24px; }
  .work-grid { --row: 240px; }
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .bleed { margin: 80px -28px; height: 60vh; }
  .blur-feature { margin: 0 -28px; }
}
@media (max-width: 600px) {
  .work-grid {
    display: block;
    columns: 2;
    column-gap: var(--mg-x, 12px);
    --mg-x: 12px;
  }
  .work {
    flex: none !important;
    width: 100% !important;
    display: inline-block;
    margin: 0 0 12px;
    break-inside: avoid;
  }
  .work-img-wrap { height: auto !important; }
  .work img { height: auto; }
  .lightbox { padding: 40px 16px; }
  .lb-nav { width: 44px; height: 44px; }
}
