/* ============================================================
   Xixi Yang — Nocturne   |   warm-dark gallery
   Display: Bodoni Moda  ·  Text: Hanken Grotesk
   ============================================================ */

:root {
  --bg:        #14110e;
  --bg-2:      #1c1813;
  --ink:       #ece4d6;
  --ink-soft:  #c7bdac;
  --muted:     #8b8072;
  --line:      rgba(236, 228, 214, .12);
  --line-2:    rgba(236, 228, 214, .22);
  --accent:    #c56a43;   /* burnt sienna ember */
  --gold:      #c2a36b;

  --serif: "Bodoni Moda", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  --max: 1340px;
  --pad: clamp(1.25rem, 5vw, 5rem);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: .01em;
  overflow-x: hidden;
  /* warm vignette so the paintings sit in a dim room */
  background-image:
    radial-gradient(120% 80% at 50% -10%, #20191200 0%, #00000060 100%),
    radial-gradient(90% 60% at 50% 50%, #1d1812 0%, #100d0a 100%);
  background-attachment: fixed;
}

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

::selection { background: var(--accent); color: #160f0b; }

a { color: inherit; text-decoration: none; }

/* ---------- film grain ---------- */
.grain {
  position: fixed; inset: 0; z-index: 9; pointer-events: none;
  opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- reveal-on-scroll (hidden only when JS is active) ---------- */
.js .reveal,
.js .section__head,
.js .tile,
.js .about__aside,
.js .about__body,
.js .section--contact > * {
  opacity: 0; transform: translateY(18px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: calc(var(--d, 0) * 85ms);
  will-change: opacity, transform;
}
.js .reveal.is-visible,
.js .is-visible { opacity: 1 !important; transform: none !important; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15rem var(--pad);
  font-size: .76rem; letter-spacing: .22em; text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: background .5s var(--ease), border-color .5s var(--ease), padding .5s var(--ease);
}
.nav--scrolled {
  background: rgba(16, 13, 10, .72);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom-color: var(--line);
  padding-top: .9rem; padding-bottom: .9rem;
}
.nav__name { font-weight: 600; letter-spacing: .26em; }
.nav__links { display: flex; gap: clamp(1rem, 3vw, 2.4rem); }
.nav__links a { color: var(--ink-soft); position: relative; transition: color .35s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 1px; width: 0;
  background: var(--accent); transition: width .35s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 7rem var(--pad) 4rem;
  position: relative;
}
.hero__inner { max-width: 1100px; width: 100%; }

.hero__eyebrow {
  font-size: .74rem; letter-spacing: .34em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.6rem;
}
.hero__name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3.4rem, 13vw, 9.5rem);
  line-height: .92; letter-spacing: -.01em;
  display: flex; gap: .28em; justify-content: center; flex-wrap: wrap;
}
.hero__name span { display: inline-block; }
.hero__role {
  margin-top: 1.5rem;
  font-size: clamp(.82rem, 1.7vw, 1rem);
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft);
}

.cover {
  margin: clamp(2.6rem, 6vw, 4.4rem) auto clamp(2rem, 4vw, 3rem);
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: clamp(.7rem, 1.6vw, 1.4rem);
  max-width: 1080px;
}
.cover__item {
  flex: 1 1 180px; max-width: 250px; position: relative;
  overflow: hidden; border-radius: 2px;
  box-shadow: 0 18px 50px -22px #000, 0 0 0 1px var(--line);
}
.cover__item img {
  width: 100%; aspect-ratio: 1182 / 1300; object-fit: cover;
  filter: saturate(1.02) contrast(1.02);
  transition: transform 1.2s var(--ease), filter .6s var(--ease);
}
.cover__item::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, #0000 55%, #14110e88);
  opacity: .5; transition: opacity .6s;
}
.cover__item:hover img { transform: scale(1.05); filter: saturate(1.12) contrast(1.05); }
.cover__item:hover::after { opacity: .15; }

.hero__quote {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.25rem, 3.4vw, 2.1rem);
  color: var(--ink); letter-spacing: .01em; margin-top: .4rem;
}

.scroll-cue {
  position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
  width: 1px; height: 56px; overflow: hidden;
}
.scroll-cue span {
  position: absolute; inset: 0; background: var(--line-2); display: block;
}
.scroll-cue span::after {
  content: ""; position: absolute; left: 0; top: -60%; width: 100%; height: 60%;
  background: var(--accent); animation: cue 2.4s var(--ease) infinite;
}
@keyframes cue { 0% { top: -60%; } 60%, 100% { top: 100%; } }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: clamp(4.5rem, 11vw, 9rem) var(--pad); max-width: var(--max); margin: 0 auto; }
.section--new { border-top: 1px solid var(--line); }

.section__head { max-width: 760px; margin-bottom: clamp(2.6rem, 6vw, 4.5rem); }
.section__index {
  font-size: .76rem; letter-spacing: .28em; color: var(--accent);
  margin-bottom: 1.1rem; font-variant-numeric: tabular-nums;
}
.section__title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.3rem, 6vw, 4.2rem); line-height: 1;
  letter-spacing: -.01em;
}
.section__years {
  font-size: .8rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--muted); margin-top: 1rem;
}
.section__lede {
  margin-top: 1.5rem; max-width: 56ch;
  font-size: clamp(1rem, 2.1vw, 1.18rem); color: var(--ink-soft);
  line-height: 1.7; font-weight: 300;
}

/* ---------- collection tabs ---------- */
.tabs {
  display: flex; flex-wrap: wrap; gap: clamp(1.4rem, 4vw, 2.8rem);
  margin-top: 1.9rem; border-bottom: 1px solid var(--line);
}
.tab {
  background: none; border: 0; cursor: pointer;
  font-family: var(--sans); color: var(--muted);
  font-size: clamp(.72rem, 1.4vw, .82rem); letter-spacing: .2em; text-transform: uppercase;
  padding: 0 0 1.05rem; position: relative; transition: color .35s var(--ease);
}
.tab::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 0;
  background: var(--accent); transition: width .4s var(--ease);
}
.tab:hover { color: var(--ink-soft); }
.tab.is-active { color: var(--ink); }
.tab.is-active::after { width: 100%; }

.tabpanel { animation: panelin .55s var(--ease) both; }
.tabpanel.is-hidden { display: none; }
.tabpanel .section__lede { margin-top: 0; margin-bottom: clamp(2.2rem, 5vw, 3.4rem); max-width: 60ch; }
@keyframes panelin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- loading / empty status ---------- */
.gallery__status {
  color: var(--muted); font-size: .9rem; letter-spacing: .12em;
  text-transform: uppercase; padding: 2.5rem 0; font-weight: 300;
}

/* ---------- masonry gallery ---------- */
.gallery { column-count: 3; column-gap: clamp(1rem, 2.4vw, 2.2rem); }
@media (max-width: 1000px) { .gallery { column-count: 2; } }
@media (max-width: 600px)  { .gallery { column-count: 1; } }

.tile {
  break-inside: avoid; margin-bottom: clamp(1.4rem, 3vw, 2.6rem);
  cursor: pointer; position: relative;
}
.tile__frame {
  position: relative; overflow: hidden; border-radius: 2px;
  background: var(--bg-2);
  box-shadow: 0 22px 60px -30px #000, 0 0 0 1px var(--line);
  transition: box-shadow .55s var(--ease), transform .55s var(--ease);
}
.tile__frame img {
  width: 100%;
  filter: saturate(1.0) brightness(.97);
  transition: transform 1.3s var(--ease), filter .6s var(--ease);
}
.tile__frame::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  background: linear-gradient(180deg, #0000 60%, #100d0a99);
  opacity: 0; transition: opacity .5s var(--ease);
}
.tile:hover .tile__frame { transform: translateY(-4px); box-shadow: 0 34px 80px -28px #000, 0 0 0 1px var(--line-2); }
.tile:hover .tile__frame img { transform: scale(1.035); filter: saturate(1.1) brightness(1.02); }
.tile:hover .tile__frame::after { opacity: 1; }

.tile__cap {
  display: flex; flex-direction: column; gap: .25rem;
  padding: .95rem .2rem .2rem;
}
.tile__title {
  font-family: var(--serif); font-size: 1.08rem; font-weight: 500;
  line-height: 1.2;
}
.tile__meta {
  font-size: .76rem; letter-spacing: .08em; color: var(--muted);
  text-transform: uppercase;
}

/* ---------- 2026 feature grid ---------- */
.new-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(1.4rem, 4vw, 3.4rem); align-items: start;
}
.tile--feature .tile__title { font-size: 1.3rem; }
.tile--feature:nth-child(2) { margin-top: clamp(2rem, 7vw, 6rem); }
@media (max-width: 760px) {
  .new-grid { grid-template-columns: 1fr; }
  .tile--feature:nth-child(2) { margin-top: 0; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.section--about { border-top: 1px solid var(--line); }
.about {
  display: grid; grid-template-columns: 0.78fr 1.22fr;
  gap: clamp(2rem, 6vw, 5.5rem); align-items: start;
}
.about__aside { position: sticky; top: 6.5rem; }
.about__portrait {
  margin-top: 1.8rem; border-radius: 2px; overflow: hidden;
  box-shadow: 0 26px 70px -32px #000, 0 0 0 1px var(--line);
  max-width: 340px;
}
.about__portrait img { width: 100%; filter: saturate(1.02) contrast(1.02); }

.about__body { max-width: 60ch; padding-top: .4rem; }
.about__lead {
  font-family: var(--serif); font-size: clamp(1.3rem, 2.7vw, 1.85rem);
  line-height: 1.45; font-weight: 400; color: var(--ink);
  margin-bottom: 1.8rem; letter-spacing: 0;
}
.about__body p {
  color: var(--ink-soft); font-weight: 300;
  font-size: clamp(1rem, 1.5vw, 1.08rem); line-height: 1.85;
  margin-bottom: 1.3rem;
}
.about__quote {
  margin-top: 2.6rem; padding-top: 2rem; border-top: 1px solid var(--line);
  font-family: var(--serif); font-style: italic; color: var(--gold);
  font-size: clamp(1.4rem, 3.2vw, 2.2rem); line-height: 1.4;
}
@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; }
  .about__aside { position: static; }
  .about__portrait { max-width: 240px; }
}

/* ============================================================
   CONTACT + FOOTER
   ============================================================ */
.section--contact {
  text-align: center; border-top: 1px solid var(--line);
  padding-top: clamp(5rem, 12vw, 9rem); padding-bottom: clamp(5rem, 12vw, 9rem);
}
.contact__label {
  font-size: .78rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.4rem;
}
.contact__mail {
  font-family: var(--serif); font-size: clamp(1.9rem, 6vw, 3.6rem);
  font-weight: 500; position: relative; display: inline-block;
  background: linear-gradient(currentColor, currentColor) left bottom / 0% 1px no-repeat;
  transition: background-size .5s var(--ease), color .5s;
  padding-bottom: .08em;
}
.contact__mail:hover { color: var(--gold); background-size: 100% 1px; }
.contact__note { margin-top: 1.6rem; color: var(--muted); font-size: .92rem; font-weight: 300; }

.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: 2rem var(--pad); border-top: 1px solid var(--line);
  font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 8, 6, .94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .45s var(--ease), visibility .45s;
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage {
  display: flex; flex-direction: column; align-items: center; gap: 1.1rem;
  max-width: 100%; max-height: 100%;
}
.lightbox__img {
  max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 2px;
  box-shadow: 0 40px 120px -30px #000, 0 0 0 1px rgba(236,228,214,.1);
  opacity: 0; transform: scale(.985); transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.lightbox.is-open .lightbox__img { opacity: 1; transform: none; }

/* top loading bar while the full-resolution image streams in */
.lightbox__bar {
  position: absolute; top: 0; left: 0; right: 0; height: 2px; overflow: hidden;
  opacity: 0; transition: opacity .35s var(--ease); pointer-events: none; z-index: 2;
}
.lightbox.is-loading .lightbox__bar { opacity: 1; }
.lightbox__bar::after {
  content: ""; position: absolute; top: 0; left: -34%; height: 100%; width: 34%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: lb-bar 1.1s ease-in-out infinite;
}
@keyframes lb-bar { 0% { left: -34%; } 100% { left: 100%; } }

.lightbox__cap { text-align: center; display: flex; flex-direction: column; gap: .35rem; }
.lightbox__title { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; }
.lightbox__meta { font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.lightbox__close, .lightbox__nav {
  position: absolute; background: none; border: 1px solid var(--line-2);
  color: var(--ink); cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .3s, border-color .3s, color .3s, transform .3s;
}
.lightbox__close {
  top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem);
  width: 46px; height: 46px; font-size: 1.6rem; line-height: 1;
}
.lightbox__nav {
  top: 50%; transform: translateY(-50%);
  width: 54px; height: 54px; font-size: 2rem; line-height: 1;
}
.lightbox__nav--prev { left: clamp(.8rem, 2.5vw, 2rem); }
.lightbox__nav--next { right: clamp(.8rem, 2.5vw, 2rem); }
.lightbox__close:hover, .lightbox__nav:hover { background: var(--accent); border-color: var(--accent); color: #160f0b; }
.lightbox__nav:hover { transform: translateY(-50%) scale(1.06); }

.lightbox__count {
  position: absolute; bottom: clamp(1rem, 3vw, 2rem); right: clamp(1.2rem, 3.5vw, 2.4rem);
  font-size: .78rem; letter-spacing: .2em; color: var(--muted); font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .lightbox__nav { width: 42px; height: 42px; font-size: 1.5rem; }
  .lightbox__img { max-height: 70vh; }
}

body.lb-lock { overflow: hidden; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .12s !important; }
  .scroll-cue { display: none; }
}
