:root {
  --bg: #0a0a0d;
  --bg-soft: #121217;
  --bg-elev: #17171d;
  --text: #f4f0e9;
  --muted: #a09a90;
  --gold: #e8c17a;
  --gold-soft: rgba(232, 193, 122, 0.16);
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --radius: 14px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html[data-theme="light"] {
  --bg: #f6f2ea;
  --bg-soft: #efe9de;
  --bg-elev: #fffdf8;
  --text: #191712;
  --muted: #6d665c;
  --gold: #a8791f;
  --gold-soft: rgba(168, 121, 31, 0.13);
  --line: rgba(20, 16, 10, 0.12);
  --shadow: 0 24px 60px rgba(60, 45, 20, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.lb-open { overflow: hidden; }

[hidden] { display: none !important; }

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

button { font-family: inherit; color: inherit; }

/* ---------- header ---------- */

.site-head {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 52px);
  background: linear-gradient(to bottom, rgba(8, 8, 11, 0.72), rgba(8, 8, 11, 0));
  transition: background 0.35s ease, backdrop-filter 0.35s ease, border-color 0.35s;
  border-bottom: 1px solid transparent;
}

.site-head.solid {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

html[data-theme="light"] .site-head { background: linear-gradient(to bottom, rgba(246, 242, 234, 0.8), rgba(246, 242, 234, 0)); }
html[data-theme="light"] .site-head.solid { background: color-mix(in srgb, var(--bg) 85%, transparent); }

.brand {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: #fff;
}
html[data-theme="light"] .brand { color: var(--text); }
.site-head.solid .brand { color: var(--text); }
.brand span { color: var(--gold); font-style: italic; }

.head-actions { display: flex; align-items: center; gap: 14px; }

.ghost-link {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s;
}
.site-head.solid .ghost-link { color: var(--muted); }
.ghost-link:hover { color: var(--gold); }
html[data-theme="light"] .ghost-link { color: var(--muted); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.icon-btn:active { transform: scale(0.94); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: -6%;
  background-image: url("images/jazz-noir/large/0Q6A4319.jpg");
  background-size: cover;
  background-position: center 35%;
  filter: blur(5px) saturate(0.7) brightness(0.9);
  transform: scale(1.08);
  animation: heroDrift 26s ease-in-out infinite alternate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 20% 20%, rgba(8, 8, 11, 0.2), rgba(8, 8, 11, 0.92) 72%),
    linear-gradient(to top, var(--bg) 2%, rgba(8, 8, 11, 0.45) 45%, rgba(8, 8, 11, 0.35));
}

html[data-theme="light"] .hero::after {
  background:
    radial-gradient(120% 90% at 20% 20%, rgba(246, 242, 234, 0.3), rgba(246, 242, 234, 0.95) 74%),
    linear-gradient(to top, var(--bg) 2%, rgba(246, 242, 234, 0.5) 45%, rgba(246, 242, 234, 0.35));
}

@keyframes heroDrift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1160px;
  margin: 0 auto;
  padding: 120px clamp(22px, 5vw, 64px) 96px;
  width: 100%;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 12vw, 152px);
  line-height: 0.86;
  letter-spacing: -0.01em;
  color: #fff;
  text-wrap: balance;
}
html[data-theme="light"] .hero h1 { color: var(--text); }

.hero h1 em {
  display: inline-block;
  font-size: 0.52em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  padding-left: 0.12em;
}

.lede {
  max-width: 44ch;
  margin: 30px 0 0;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}
html[data-theme="light"] .lede { color: var(--muted); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.62);
}
html[data-theme="light"] .hero-meta { color: var(--muted); }
.hero-meta strong { color: var(--text); font-weight: 500; }
html[data-theme="light"] .hero-meta strong { color: var(--text); }
.hero-meta a { color: var(--gold); border-bottom: 1px solid transparent; }
.hero-meta a:hover { border-bottom-color: currentColor; }
.hero-meta .dot { opacity: 0.5; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.15s;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
html[data-theme="light"] .btn { color: var(--text); }
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #14100a;
  font-weight: 500;
}
.btn.primary:hover { background: #f2d69d; border-color: #f2d69d; color: #14100a; }

.btn.small { padding: 9px 18px; font-size: 11px; }

.scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  animation: hint 2.6s ease-in-out infinite;
}
html[data-theme="light"] .scroll-hint { color: var(--muted); }
@keyframes hint { 0%, 100% { opacity: 0.35; transform: translate(-50%, 0); } 50% { opacity: 0.85; transform: translate(-50%, -5px); } }

/* ---------- collection ---------- */

.collection {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) clamp(18px, 4vw, 52px) 60px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 52px);
  letter-spacing: 0.01em;
}

.search-wrap { position: relative; }
.search-wrap::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -7px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}
.search-wrap::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 50%;
  width: 6px;
  height: 1.5px;
  margin-top: 3px;
  background: var(--muted);
  transform: rotate(45deg);
  transform-origin: left center;
  pointer-events: none;
}
#search {
  width: min(300px, 70vw);
  padding: 11px 16px 11px 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
#search:focus { border-color: var(--gold); }
#search::placeholder { color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 26px);
}

.card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  isolation: isolate;
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.5s;
  filter: saturate(0.92);
}
.card:hover .card-media img { transform: scale(1.055); filter: saturate(1.05); }

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 6, 9, 0.86) 0%, rgba(6, 6, 9, 0.18) 46%, transparent 78%);
}

.card-body {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  color: #fff;
}
.card-title {
  font-family: var(--serif);
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.05;
  text-transform: capitalize;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}
.card-count {
  flex: none;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.72);
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.empty { color: var(--muted); font-size: 14px; padding: 20px 0; }

/* ---------- ballet view ---------- */

#ballet { padding-top: 96px; }

.ballet-head {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) clamp(18px, 4vw, 52px) clamp(18px, 3vw, 32px);
}

.back {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.back:hover { color: var(--gold); }

.ballet-head h1 {
  margin: 16px 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 6.5vw, 76px);
  line-height: 0.98;
  text-transform: capitalize;
  text-wrap: balance;
}

.ballet-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.grid.photos {
  max-width: 1320px;
  margin: 0 auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0 clamp(18px, 4vw, 52px);
}

.photo {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-soft);
  cursor: zoom-in;
  padding: 0;
  border: 0;
  animation: rise 0.5s ease both;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.4s;
  opacity: 0;
}
.photo img.loaded { opacity: 1; }
.photo:hover img { transform: scale(1.06); }
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.ballet-nav {
  max-width: 1320px;
  margin: 0 auto;
  padding: 38px clamp(18px, 4vw, 52px) 70px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: 44px;
}
.ballet-nav a { display: flex; flex-direction: column; gap: 4px; max-width: 45%; }
.ballet-nav .dir { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.ballet-nav .name { font-family: var(--serif); font-size: 22px; color: var(--text); text-transform: capitalize; }
.ballet-nav a:hover .name { color: var(--gold); }
.ballet-nav .next { text-align: right; margin-left: auto; }

/* ---------- footer ---------- */

.site-foot {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px clamp(18px, 4vw, 52px) 70px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.site-foot a { color: var(--gold); }
.tiny { font-size: 11px; opacity: 0.7; max-width: 60ch; }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #07070a;
  color: #f4f0e9;
  touch-action: none;
  animation: lbIn 0.28s ease both;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(12px, 3vw, 28px);
  background: linear-gradient(to bottom, rgba(7, 7, 10, 0.92), rgba(7, 7, 10, 0));
  position: relative;
  z-index: 3;
}

.lb-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lb-title {
  font-family: var(--serif);
  font-size: clamp(17px, 2.4vw, 24px);
  line-height: 1.1;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-counter { font-size: 11px; letter-spacing: 0.16em; color: rgba(244, 240, 233, 0.55); }

.lb-actions { display: flex; gap: 6px; flex: none; }
.lb-actions .icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f0e9;
  width: 36px;
  height: 36px;
}
.lb-actions .icon-btn:hover { border-color: var(--gold); color: var(--gold); }

.lb-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
}
.lb-stage.dragging { cursor: grabbing; }

#lbImg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.25s;
}
#lbImg.instant { transition: none; }
#lbImg.swapping { opacity: 0; }

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 12, 16, 0.5);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 5px;
}
.lb-arrow:hover { border-color: var(--gold); color: var(--gold); background: rgba(12, 12, 16, 0.75); }
.lb-arrow.prev { left: clamp(8px, 2vw, 26px); }
.lb-arrow.next { right: clamp(8px, 2vw, 26px); }
.lb-arrow[disabled] { opacity: 0.25; cursor: default; }

.lb-bottom {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px clamp(16px, 3vw, 32px) max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(7, 7, 10, 0.94), rgba(7, 7, 10, 0));
  position: relative;
  z-index: 3;
}

.lb-bottom .play {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f4f0e9;
  flex: none;
}
.lb-bottom .play.playing { background: var(--gold); border-color: var(--gold); color: #14100a; }

.lb-progress {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.lb-bar { height: 100%; width: 0; background: var(--gold); }
.lb-bar.run { transition: width var(--dur, 4.5s) linear; width: 100%; }

.lb-zoom-label {
  flex: none;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(244, 240, 233, 0.55);
  min-width: 42px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.photos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid.photos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 0 10px; }
  .ghost-link { display: none; }
  .hero-inner { padding-top: 104px; }
  .card-body { padding: 12px 13px; }
  .card-count { display: none; }
  .lb-title { max-width: 52vw; }
  .lb-arrow { width: 42px; height: 42px; font-size: 24px; opacity: 0.9; }
  .lb-actions .icon-btn:nth-child(3), .lb-actions .icon-btn:nth-child(4) { display: none; }
  .ballet-head h1 { font-size: clamp(34px, 9vw, 54px); }
}

@media (max-width: 460px) {
  .grid.photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-meta { font-size: 12px; }
  .btn { padding: 12px 18px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
