:root {
  --bg: #070708;
  --ink: #f4efe6;
  --muted: rgba(244, 239, 230, 0.62);
  --gold: #c4a35a;
  --ease: cubic-bezier(0.77, 0, 0.175, 1);
  --dur: 1.05s;
  --gap: 1.05rem;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
}
html, body.studio {
  height: 100dvh;
  overflow: hidden;
}
.studio { position: relative; }

.studio-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: calc(1.15rem + var(--safe-t)) 1.4rem 0 calc(1.4rem + var(--safe-l));
  pointer-events: none;
}
.wordmark {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wordmark span {
  font-weight: 400;
  letter-spacing: 0.22em;
  font-size: 0.72em;
  opacity: 0.72;
}

.social-rail {
  position: fixed;
  right: calc(1.05rem + var(--safe-r));
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.rail-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 230, 0.28);
  background: rgba(7, 7, 8, 0.45);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  transition: border-color 220ms var(--ease), color 220ms var(--ease), background 220ms var(--ease);
}
.rail-btn svg { width: 18px; height: 18px; display: block; }
.rail-btn:hover,
.rail-btn:focus-visible {
  color: var(--gold);
  border-color: var(--gold);
  outline: none;
}

.stage {
  position: relative;
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: calc(5.2rem + var(--safe-t)) 5.6rem calc(3.2rem + var(--safe-b));
  overflow: hidden;
}

.carousel {
  position: relative;
  width: min(1280px, calc(100vw - 7.5rem));
  flex: 1 1 auto;
  min-height: 240px;
  max-height: min(72vh, 740px);
  z-index: 5;
}

.card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24%;
  height: 68%;
  border: 1px solid rgba(196, 163, 90, 0.22);
  background: #101012;
  padding: 0;
  margin: 0;
  color: inherit;
  cursor: zoom-in;
  overflow: hidden;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  opacity: 0;
  pointer-events: none;
  will-change: left, width, height, opacity, filter;
  transition:
    left var(--dur) var(--ease),
    width var(--dur) var(--ease),
    height var(--dur) var(--ease),
    opacity var(--dur) var(--ease),
    filter var(--dur) var(--ease);
}
.card.is-left {
  left: 16%;
  width: 28%;
  height: 76%;
  opacity: 0.9;
  z-index: 2;
  pointer-events: auto;
  filter: brightness(0.72);
}
.card.is-right {
  left: 84%;
  width: 28%;
  height: 76%;
  opacity: 0.9;
  z-index: 2;
  pointer-events: auto;
  filter: brightness(0.72);
}
.card.is-left,
.card.is-right {
  cursor: pointer;
}
.card.is-center {
  left: 50%;
  width: 50%;
  height: 100%;
  opacity: 1;
  z-index: 4;
  pointer-events: auto;
  filter: none;
  cursor: zoom-in;
}
.card.is-off-left {
  left: -10%;
  width: 22%;
  height: 60%;
  opacity: 0;
  z-index: 1;
  filter: brightness(0.5);
}
.card.is-off-right {
  left: 110%;
  width: 22%;
  height: 60%;
  opacity: 0;
  z-index: 1;
  filter: brightness(0.5);
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.copy {
  position: relative;
  z-index: 20;
  margin-top: 1.05rem;
  margin-bottom: 0;
  text-align: center;
  max-width: min(36rem, 90vw);
  --title-size: clamp(1.8rem, 3.6vw, 2.8rem);
  flex: 0 0 auto;
}
.copy[hidden] { display: none; }
.copy .kicker {
  margin: 0 0 0.3rem;
}
#work-title {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-style: italic;
  font-size: var(--title-size);
  line-height: 1.15;
  min-height: 1.15em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  transition: opacity 320ms ease;
}
#work-title.is-fade { opacity: 0; }
.index {
  margin: 1.1rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.index[hidden] { display: none; }
.kicker {
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.nav-row {
  position: absolute;
  left: calc(1.4rem + var(--safe-l));
  right: calc(5.2rem + var(--safe-r));
  bottom: calc(1.55rem + var(--safe-b));
  z-index: 25;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.nav-row .slide-nav { pointer-events: auto; }
.slide-nav,
.lite-nav {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.4rem 0;
}
.slide-nav:hover,
.lite-nav:hover { color: var(--gold); }
.nav-row .slide-nav {
  position: relative;
}
/* Invisible hit pad so the arrow above stays clickable without moving Prev/Next */
.nav-row .slide-nav::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: calc(1.15rem + 0.4rem);
}
.nav-arrow {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  margin: 0 0 0.4rem;
  color: inherit;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
}
.nav-row .slide-nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.28rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 280ms var(--ease);
}
.nav-row .slide-nav:hover::after,
.nav-row .slide-nav:focus-visible::after {
  transform: scaleX(1);
}

.empty-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--muted);
}

.lite {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: #070708;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: calc(3.4rem + var(--safe-t)) 0.8rem calc(1.2rem + var(--safe-b));
  opacity: 1;
  transition: opacity 420ms ease;
}
.lite.is-leaving { opacity: 0; }
.lite[hidden] { display: none; }
.lite-frame {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-height: 100%;
  opacity: 0;
  transition: opacity 320ms ease;
}
.lite.is-open .lite-frame { opacity: 1; }
.lite.is-open .lite-frame.is-fade { opacity: 0; }
.lite-frame img {
  max-width: min(92vw, 1100px);
  max-height: min(78vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid rgba(196, 163, 90, 0.22);
  background: #0b0b0c;
}
.lite-frame figcaption {
  margin-top: 0.85rem;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.2;
  min-height: 1.2em;
  text-align: center;
}
.lite-close,
.contact-close,
.about-close {
  position: absolute;
  top: calc(1rem + var(--safe-t));
  right: calc(1rem + var(--safe-r));
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.7rem;
  cursor: pointer;
}
.lite-close:hover,
.contact-close:hover,
.about-close:hover { color: var(--gold); }
.lite .lite-close,
.lite .lite-nav {
  opacity: 0;
  transition: opacity 320ms ease, color 180ms ease;
}
.lite.is-open .lite-close,
.lite.is-open .lite-nav { opacity: 1; }

.contact {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(7, 7, 8, 0.94);
  display: grid;
  place-items: center;
  padding: calc(1.5rem + var(--safe-t)) 1.25rem calc(1.5rem + var(--safe-b));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  animation: veilIn 280ms ease;
}
.contact[hidden] { display: none; }
.contact-card {
  width: min(560px, 100%);
  padding: 0.5rem 0 1rem;
}
.contact-eyebrow {
  margin: 0 0 0.55rem;
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.contact-card h2 {
  margin: 0 0 1.6rem;
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.05;
}
.contact-card label {
  display: block;
  margin: 0 0 0.95rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-card label span { letter-spacing: 0.04em; text-transform: none; }
.contact-card input,
.contact-card textarea {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(244, 239, 230, 0.22);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  padding: 0.55rem 0 0.65rem;
  border-radius: 0;
}
.contact-card input:focus,
.contact-card textarea:focus {
  outline: none;
  border-bottom-color: var(--gold);
}
.contact-card textarea { resize: vertical; min-height: 7rem; }
.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}
.send {
  margin-top: 0.6rem;
  min-height: 44px;
  padding: 0.75rem 1.6rem;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  cursor: pointer;
}
.send:hover { background: rgba(196, 163, 90, 0.12); }
.send:disabled { opacity: 0.55; cursor: wait; }
.contact-err { color: #d9776a; font-size: 0.9rem; }
.contact-ok { color: var(--gold); font-size: 0.95rem; }

.about {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(7, 7, 8, 0.985);
  display: grid;
  place-items: center;
  padding: calc(1.5rem + var(--safe-t)) 1.25rem calc(1.5rem + var(--safe-b));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transition: opacity 280ms ease;
}
.about.is-open {
  opacity: 1;
}
.about.is-leaving {
  opacity: 0;
}
.about[hidden] { display: none; }
.about-card {
  width: min(560px, 100%);
  padding: 0.5rem 0 1rem;
}
.about-eyebrow {
  margin: 0 0 0.55rem;
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.about-card h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.05;
}
.about-rule {
  width: 3.2rem;
  height: 1px;
  margin: 1.35rem 0 1.5rem;
  background: var(--gold);
  opacity: 0.7;
}
.about-copy {
  margin: 0;
}
.about-copy p {
  margin: 0 0 1.05rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
  max-width: 34em;
}
.about-copy p:last-child { margin-bottom: 0; }
.about-sign {
  margin: 1.7rem 0 0;
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

@keyframes veilIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 900px) {
  .stage {
    padding: calc(5.2rem + var(--safe-t)) 1.1rem calc(3.2rem + var(--safe-b));
  }
  .carousel {
    width: calc(100vw - 1.4rem);
    max-height: min(52vh, 500px);
  }
  .card.is-left { left: 10%; width: 38%; height: 76%; }
  .card.is-right { left: 90%; width: 38%; height: 76%; }
  .card.is-center { width: 72%; height: 94%; }
  .social-rail {
    top: calc(1rem + var(--safe-t));
    transform: none;
    flex-direction: row;
  }
  .studio-head {
    padding-right: calc(10.6rem + var(--safe-r));
  }
  .wordmark {
    font-size: 1.08rem;
    letter-spacing: 0.08em;
  }
  .nav-row { right: calc(1.1rem + var(--safe-r)); left: calc(1.1rem + var(--safe-l)); }
  .lite {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto auto;
    justify-items: center;
  }
  .lite-nav { order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .lite,
  .lite-frame,
  #work-title,
  .nav-row .slide-nav::after { transition: none !important; }
}
