:root {
  --paper: #f3efe7;
  --paper-2: #eae4d8;
  --ink: #191612;
  --ink-soft: rgba(25, 22, 18, 0.58);
  --ink-faint: rgba(25, 22, 18, 0.34);
  --gold: #a8783a;
  --night: #0c0b0a;
  --bone: #e9e4da;
  --bone-soft: rgba(233, 228, 218, 0.5);

  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  --edge: clamp(1.2rem, 4vw, 4rem);
  --spacing: 2400px; /* corridor plate depth spacing; mirrored in app.js */
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  /* clip, never hidden — overflow-x:hidden on html/body kills sticky/fixed children */
  overflow-x: clip;
  overscroll-behavior-x: none;
  -webkit-font-smoothing: antialiased;
}

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

.nojs {
  display: none;
}

/* ── Top bar ───────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem var(--edge);
  /* Light over the dark hero/about, ink over the paper gallery — toggled by JS
   * (app.js frame()) from which section sits under the bar. Cleaner than
   * mix-blend-difference, which cast odd mid-tones over the brown transition. */
  color: var(--bone);
  transition: color 0.35s ease, background 0.35s ease;
}

/* The bar is fixed with no background, so once the page scrolls the statement and
 * gallery text ran straight under it — light type over light type, both unreadable.
 * A soft scrim fixes it, but ONLY past the hero: over the hero the bar floats on
 * empty dark and should stay perfectly clean. It fades to nothing, so this reads
 * as the type dimming away under the bar rather than as a solid header. */
body.past-hero .topbar {
  background: linear-gradient(to bottom, rgba(12, 11, 10, 0.94) 45%, rgba(12, 11, 10, 0));
}
body.past-hero .topbar.on-paper {
  background: linear-gradient(to bottom, rgba(243, 239, 231, 0.94) 45%, rgba(243, 239, 231, 0));
}

.topbar.on-paper {
  color: var(--ink);
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-decoration: none;
  color: inherit;
}
.brand-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.brand-sub {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.8;
}

.topnav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.4rem);
}
.topnav a {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  opacity: 0.85;
}
.topnav a:hover {
  opacity: 1;
}

/* ── Ambient backlight (hero only) ─────────────────────────────────── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--night);
  transition: opacity 0.6s linear;
}
.ambient-layer {
  position: absolute;
  top: 0;
  left: 0;
  /* Rendered at ~22% and scaled up: blur applies in the element's own coordinate
   * space, so a small radius on a small layer reads as a big soft backlight for a
   * fraction of the pixels. A full-size blur(55px) here janked the flythrough to
   * ~150ms frames on every plate change — measured, then fixed (as in Corridor). */
  width: 22%;
  height: 22%;
  transform-origin: 0 0;
  transform: scale(4.6);
  filter: blur(14px);
  opacity: 0;
  transition: opacity 0.7s linear;
  will-change: opacity;
}
/* Once past the hero the backlight is dead weight — hidden by JS via this flag. */
.ambient.off {
  opacity: 0;
}

/* ── Hero corridor ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 1;
  /* height set by app.js from the hero count → scroll runway */
}
.hero-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  perspective: 760px;
  transform-style: preserve-3d;
  overflow: hidden;
}

.plate {
  position: absolute;
  top: 50%;
  --plate-w: min(58vh, 74vw, 620px);
  left: calc(50% + var(--side) * (50% - var(--plate-w) / 2 - 3%) * 0.62);
  width: var(--plate-w);
  aspect-ratio: 1 / 1; /* Claudia's posts are square */
  transform: translate3d(-50%, -50%, 0);
  opacity: 0;
  will-change: transform, opacity;
}
.plate-img {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #16130f;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.plate-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-intro {
  position: fixed;
  left: var(--edge);
  bottom: clamp(3rem, 12vh, 8rem);
  z-index: 3;
  color: var(--bone);
  pointer-events: none;
}
.hero-intro h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.hero-tag {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-soft);
}
.hero-scroll {
  display: inline-block;
  margin-top: 2.2rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.hero-caption {
  position: fixed;
  right: var(--edge);
  bottom: clamp(3rem, 12vh, 8rem);
  z-index: 3;
  text-align: right;
  color: var(--bone);
  opacity: 0;
  transition: opacity 0.4s;
}
.hero-caption.show {
  opacity: 1;
}
.hero-caption-title {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
}
.hero-caption-meta {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-soft);
}

.hero-rail {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: rgba(233, 228, 218, 0.12);
  z-index: 3;
}
.hero-rail-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gold);
}
/* The hero chrome belongs to the hero; JS hides it once the gallery arrives. */
.past-hero .hero-intro,
.past-hero .hero-caption,
.past-hero .hero-rail {
  opacity: 0;
  pointer-events: none;
}

/* ── Main (paper) ──────────────────────────────────────────────────── */
main {
  position: relative;
  z-index: 5;
  background: var(--paper);
  border-radius: 28px 28px 0 0;
  margin-top: -28px;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.4);
}

.section-head {
  padding: clamp(3.5rem, 9vw, 7rem) var(--edge) clamp(1.6rem, 4vw, 3rem);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: -0.01em;
}
.section-note {
  max-width: 32ch;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.section-note .count {
  color: var(--ink-faint);
}

/* ── Work grid ─────────────────────────────────────────────────────── */
.grid {
  padding: 0 var(--edge) clamp(3rem, 8vw, 6rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: clamp(0.8rem, 2vw, 1.5rem);
}
.card {
  position: relative;
  cursor: pointer;
  background: var(--paper-2);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.card.in {
  opacity: 1;
  transform: none;
}
.card-frame {
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
.card.portrait .card-frame {
  aspect-ratio: 3 / 4;
}
.card-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card:hover .card-frame img {
  transform: scale(1.04);
}
.card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.2rem 0.4rem;
}
.card-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
}
.card-date {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  white-space: nowrap;
}
.badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--gold);
  color: #fff;
  padding: 0.28em 0.6em;
  border-radius: 2px;
}

/* ── Studio ────────────────────────────────────────────────────────── */
.studio {
  background: var(--paper-2);
}
.studio-row {
  padding: 0 var(--edge) clamp(3rem, 8vw, 6rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
  gap: clamp(0.7rem, 1.6vw, 1.1rem);
}
.studio-row .card {
  background: transparent;
}
.studio-row .card-title {
  font-size: 0.8rem;
}

/* ── About ─────────────────────────────────────────────────────────── */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(4rem, 10vw, 8rem) var(--edge);
  background: var(--ink);
  color: var(--bone);
}
.about-portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 3px;
}
.statement-title {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: 1.5rem;
}
.statement-title .en {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-top: 0.6rem;
}
.statement-body p {
  font-size: 1.02rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  max-width: 46ch;
  color: rgba(233, 228, 218, 0.85);
}
.statement-body p.nl {
  font-style: italic;
  color: var(--bone-soft);
  font-size: 0.92rem;
}
.exhibition {
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  line-height: 1.8;
  color: var(--bone-soft);
}
.exhibition b {
  color: var(--bone);
  font-weight: 400;
}
.ig-link {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.2em;
}

/* ── Footer ────────────────────────────────────────────────────────── */
/* ── Touch targets ─────────────────────────────────────────────────
   Measured on iPhone 13: nav links were 13px tall, .ig-link 17, .brand 19,
   .contact-phone 22, .lightbox-close 26 wide. iOS wants ~44.
   The hit area is grown with an invisible pseudo-element rather than padding,
   because several of these carry an underline/border that padding would push
   away from the text. Type, layout and decoration are untouched — only the
   tappable box grows. Horizontal growth is kept modest so adjacent nav links
   don't overlap each other's targets. */
.topnav a,
.brand,
.ig-link,
.contact-phone,
.lightbox-ig,
.lightbox-close {
  position: relative;
}
.topnav a::after,
.brand::after,
.ig-link::after,
.contact-phone::after,
.lightbox-ig::after,
.lightbox-close::after {
  content: "";
  position: absolute;
  inset: -16px -9px;
}

/* ── Contact ───────────────────────────────────────────────────────── */
.contact {
  position: relative;
  z-index: 5;
  background: var(--night);
  color: var(--bone);
  text-align: center;
  padding: clamp(3.5rem, 9vw, 6rem) var(--edge) clamp(3rem, 7vw, 5rem);
  border-top: 1px solid rgba(233, 228, 218, 0.08);
}
.contact-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
}
.contact-name {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}
.contact-phone {
  display: inline-block;
  font-family: var(--sans);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  letter-spacing: 0.14em;
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid rgba(168, 120, 58, 0.55);
  padding-bottom: 3px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.contact-phone:hover {
  color: var(--gold);
  border-color: var(--gold);
}
.contact-place {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone-soft);
}

.footer {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem var(--edge);
  background: var(--ink);
  color: var(--bone-soft);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ── Lightbox ──────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 9, 8, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 5vw, 4rem);
}
.lightbox[hidden] {
  display: none;
}
.lightbox-figure {
  max-width: min(90vw, 900px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.lightbox-figure img {
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  margin: 0 auto;
}
.lightbox-cap {
  text-align: center;
  color: var(--bone);
}
.lightbox-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
}
.lightbox-meta {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-soft);
}
.lightbox-ig {
  display: inline-block;
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-decoration: none;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: none;
  border: none;
  color: var(--bone);
  cursor: pointer;
  font-size: 2.4rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-close:hover,
.lightbox-nav:hover {
  opacity: 1;
}
.lightbox-close {
  top: 1.4rem;
  right: 1.8rem;
  font-size: 2.8rem;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.4rem;
  padding: 1rem;
}
.lightbox-prev {
  left: 0.5rem;
}
.lightbox-next {
  right: 0.5rem;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .about {
    grid-template-columns: 1fr;
  }
  .about-portrait {
    max-width: 340px;
  }
  .topnav {
    gap: 1rem;
  }
  .brand-sub {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-scroll {
    animation: none;
  }
  /* The hero flythrough is scroll-linked (user-driven), so it stays active. */
}
