/* ==========================================================================
   Edwin & Steph — Art Deco wedding gallery
   ========================================================================== */

:root {
  --font-display: "Poiret One", "Josefin Sans", sans-serif;
  --font-script: "Monsieur La Doulaise", cursive;
  --font-caps: "Josefin Sans", "Futura", sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;

  --ink: #0e221e;
  --ink-2: #14302a;
  --ink-3: #1c3e37;
  --sea: #9ebdb2;
  --sea-deep: #527f70;
  --gold: #c8a75e;
  --gold-2: #e6d3a0;
  --gold-line: rgba(200, 167, 94, .55);
  --gold-faint: rgba(200, 167, 94, .22);
  --ivory: #f4eee1;
  --paper: #fbf8f0;
  --text: #22322d;
  --muted: #6b7a73;

  --step: polygon(0 10px, 10px 10px, 10px 0, calc(100% - 10px) 0, calc(100% - 10px) 10px, 100% 10px,
                  100% calc(100% - 10px), calc(100% - 10px) calc(100% - 10px), calc(100% - 10px) 100%,
                  10px 100%, 10px calc(100% - 10px), 0 calc(100% - 10px));
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
html.lb-open { overflow: hidden; }
body {
  margin: 0;
  color: var(--text);
  background: var(--ivory);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

.kicker, .eyebrow {
  margin: 0;
  font-family: var(--font-caps);
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .48em;
  text-transform: uppercase;
  color: var(--sea-deep);
}

/* ---------- Sticky top bar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(14, 34, 30, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gold-faint);
  color: var(--gold-2);
  transform: translateY(-100%);
  transition: transform .5s var(--ease);
}
.topbar.show { transform: none; }
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-faint) 20%, var(--gold-faint) 80%, transparent);
}
.monogram {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: .14em;
  text-decoration: none;
  white-space: nowrap;
}
.monogram i { font-style: normal; font-size: .5em; vertical-align: middle; color: var(--gold); }
.topbar-links { display: flex; gap: clamp(14px, 3vw, 34px); }
.topbar-links a {
  position: relative;
  font-family: var(--font-caps);
  font-size: .68rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(230, 211, 160, .7);
  padding: 6px 0;
  transition: color .3s;
  white-space: nowrap;
}
.topbar-links a span { color: var(--gold); margin-right: .3em; }
.topbar-links a::after {
  content: "";
  position: absolute;
  left: 50%; right: 50%; bottom: 0;
  height: 1px;
  background: var(--gold);
  transition: left .35s var(--ease), right .35s var(--ease);
}
.topbar-links a:hover, .topbar-links a.active { color: var(--gold-2); }
.topbar-links a:hover::after, .topbar-links a.active::after { left: 0; right: .28em; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: max(100svh, 700px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 110px 24px 120px;
  background: var(--ink);
  color: var(--gold-2);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(82, 127, 112, .28), transparent 60%),
    linear-gradient(90deg, rgba(200,167,94,.18) 1px, transparent 1px) 46px 0 / calc(100% - 92px) 100% no-repeat,
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(200,167,94,.18) 1px) 46px 0 / calc(100% - 92px) 100% no-repeat;
}

.hero-frame {
  position: absolute;
  inset: 22px;
  border: 1px solid var(--gold-faint);
  pointer-events: none;
}
.hero-frame::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(200, 167, 94, .12);
}
.corner {
  position: absolute;
  width: 64px;
  height: 64px;
  color: var(--gold);
  opacity: .8;
}
.corner.tl { top: -1px; left: -1px; }
.corner.tr { top: -1px; right: -1px; transform: scaleX(-1); }
.corner.bl { bottom: -1px; left: -1px; transform: scaleY(-1); }
.corner.br { bottom: -1px; right: -1px; transform: scale(-1); }

/* The arched window */
.portal {
  position: relative;
  container-type: inline-size;
  width: clamp(260px, min(78vw, (100svh - 370px) / 1.4), 450px);
  aspect-ratio: 5 / 7;
  margin-top: 10px;
}
.portal-window {
  position: absolute;
  top: 6%;
  left: 6%;
  right: 6%;
  bottom: 0;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  background: var(--ink-2);
}
.portal-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.6s ease, transform 8s var(--ease);
}
.portal-img.loaded { opacity: 1; transform: scale(1); }
.portal-window.no-photo .portal-img { display: none; }
.portal-pattern {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(14,34,30,.97) 0%, rgba(14,34,30,.8) 30%, rgba(14,34,30,.2) 62%, rgba(14,34,30,0) 80%);
}
.portal-window.no-photo .portal-pattern {
  background:
    radial-gradient(circle at 50% 36%, rgba(200,167,94,.18) 0 8%, transparent 8.3%),
    radial-gradient(circle at 50% 36%, transparent 0 15%, rgba(200,167,94,.22) 15.2% 15.5%, transparent 15.7% 23%, rgba(200,167,94,.16) 23.2% 23.5%, transparent 23.7%),
    repeating-conic-gradient(from 0deg at 50% 36%, rgba(200,167,94,.12) 0deg 1deg, transparent 1deg 10deg),
    linear-gradient(to bottom, var(--ink-3), var(--ink));
}
.portal-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6%;
  text-align: center;
}
.portal-text .eyebrow {
  font-size: max(9px, 2.4cqw);
  color: var(--gold);
  margin-bottom: 6cqw;
  margin-right: -.48em;
}
.hero h1 {
  margin: 0;
  font-weight: 400;
  line-height: 1;
}
.hero h1 .name {
  display: block;
  font-family: var(--font-script);
  font-size: 20cqw;
  line-height: .8;
  color: #f4e8c6;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}
.hero h1 .amp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3cqw;
  margin: -1cqw 0 1cqw;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 8cqw;
  color: var(--gold);
}
.hero h1 .amp i {
  width: 14cqw;
  height: 1px;
  background: var(--gold-line);
  position: relative;
}
.hero h1 .amp i::after {
  content: "";
  position: absolute;
  top: -2.5px;
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}
.hero h1 .amp i:first-child::after { left: 0; }
.hero h1 .amp i:last-child::after { right: 0; }

.portal-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.portal-lines path, .portal-lines line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}
.portal-lines .thin { stroke-width: .8; opacity: .6; }
.portal-lines .faint { opacity: .45; }
.portal-lines .rays line { opacity: .7; }
.portal-lines .keystone { fill: var(--ink); stroke-width: 1.2; }
.portal-lines .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.4s var(--ease) .2s forwards;
}
.portal-lines .rays line { animation: fadeIn 1.4s ease 1.4s both; }
.portal-lines .keystone { animation: fadeIn 1s ease 1.6s both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { from { opacity: 0; } }

.portal-text > * { animation: rise 1.4s var(--ease) both; }
.portal-text .eyebrow { animation-delay: .9s; }
.portal-text h1 { animation-delay: 1.1s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}

.hero-date {
  margin-top: 30px;
  text-align: center;
  animation: rise 1.4s var(--ease) 1.5s both;
}
.hero-date .date-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0;
  font-family: var(--font-caps);
  font-weight: 300;
  font-size: .95rem;
  letter-spacing: .42em;
  color: var(--gold-2);
}
.hero-date .date-line span { margin-right: -.42em; }
.hero-date .date-line i {
  width: clamp(30px, 8vw, 80px);
  height: 1px;
  background: var(--gold-line);
}
.hero-date .venue {
  margin: 8px 0 0;
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(230, 211, 160, .65);
}

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--font-caps);
  font-size: .62rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: rgba(230, 211, 160, .7);
  animation: fadeIn 1s ease 2.2s both;
}
.scroll-cue span { margin-right: -.38em; }
.scroll-cue i {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--gold), transparent);
  animation: drip 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes drip {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- Ornaments ---------- */
.fan {
  display: block;
  width: 84px;
  height: 44px;
  margin: 0 auto 18px;
  color: var(--gold);
}


/* ---------- Chapters ---------- */
.chapter { padding: 80px clamp(14px, 4vw, 40px) 110px; }
.chapter--dark {
  position: relative;
  isolation: isolate;
  background: var(--ink);
  color: var(--gold-2);
  padding-top: 70px;
}

.chapter-head {
  max-width: 720px;
  margin: 0 auto 56px;
  text-align: center;
}
.medallion {
  position: relative;
  width: 70px;
  height: 70px;
  margin: 0 auto 30px;
  display: grid;
  place-items: center;
}
.medallion::before, .medallion::after {
  content: "";
  position: absolute;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}
.medallion::before { inset: 10px; }
.medallion::after { inset: 16px; opacity: .45; }
.medallion span {
  position: relative;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold);
  line-height: 1;
  padding-top: 2px;
}
.chapter-head h2 {
  margin: 12px 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  letter-spacing: .1em;
  margin-right: -.1em;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--ink);
}
.chapter--dark .kicker { color: var(--sea); }
.chapter--dark .chapter-head h2 { color: #f4e8c6; }

.rule {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  color: var(--gold);
}
.rule i {
  width: min(120px, 22vw);
  height: 1px;
  margin-bottom: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line));
}
.rule i:last-child { background: linear-gradient(90deg, var(--gold-line), transparent); }
.rule svg { width: 48px; height: 25px; }

.ziggurat {
  height: 80px;
  margin-top: -80px;
  position: relative;
  z-index: 1;
  pointer-events: none;
}
.ziggurat svg { display: block; width: 100%; height: 100%; }
.ziggurat .fill { fill: var(--ink); }
.ziggurat .edge { fill: none; stroke: var(--gold); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* ---------- Gallery ---------- */
.gallery {
  --gap: clamp(12px, 1.8vw, 22px);
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}
.gcol {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.gcol:nth-child(even) { padding-top: calc(var(--gap) * 2.2); }

.card { margin: 0; }
.card-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(82, 127, 112, .25);
  background: var(--paper);
  box-shadow: 0 14px 34px -18px rgba(14, 34, 30, .35);
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.card-btn::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(230, 211, 160, 0);
  pointer-events: none;
  transition: inset .5s var(--ease), border-color .5s var(--ease);
}
.card-btn:hover, .card-btn:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 24px 40px -20px rgba(14, 34, 30, .5);
}
.card-btn:hover::after, .card-btn:focus-visible::after {
  inset: 18px;
  border-color: rgba(230, 211, 160, .85);
}
.card-media {
  position: relative;
  display: block;
  overflow: hidden;
  background:
    linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%) -150% 0 / 200% 100% no-repeat,
    rgba(82, 127, 112, .12);
  animation: shimmer 1.8s linear infinite;
}
.card-media.loaded { animation: none; background: none; }
@keyframes shimmer { to { background-position: 250% 0, 0 0; } }
.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .7s ease, transform 1.4s var(--ease);
}
.card-media.loaded img { opacity: 1; }
.card-btn:hover .card-media img { transform: scale(1.035); }

/* Arched frames, sprinkled through the photographer collection */
.card--arch .card-btn,
.card--arch .card-media { border-radius: 999px 999px 0 0; }
.card--arch .card-btn::after { border-radius: 999px 999px 0 0; }

.card-num {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 8px);
  padding: 6px 12px 4px 14px;
  font-family: var(--font-caps);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .3em;
  white-space: nowrap;
  color: var(--gold-2);
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease, transform .5s var(--ease);
}
.card-btn:hover .card-num, .card-btn:focus-visible .card-num { opacity: 1; transform: translate(-50%, 0); }

.card-cap {
  margin: 10px 4px 0;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.35;
  text-align: center;
  color: var(--muted);
}

.chapter--dark .card-btn {
  background: var(--ink-2);
  border-color: rgba(200, 167, 94, .3);
  box-shadow: 0 18px 36px -20px rgba(0, 0, 0, .8);
}
.chapter--dark .card-media { background-color: rgba(200, 167, 94, .06); }
.chapter--dark .card-num { background: var(--gold); color: var(--ink); }
.chapter--dark .card-cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  text-align: left;
  color: rgba(230, 211, 160, .75);
}
.card-cap .who {
  font-family: var(--font-caps);
  font-style: normal;
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.card-cap .when {
  flex-shrink: 0;
  font-family: var(--font-caps);
  font-style: normal;
  font-size: .62rem;
  letter-spacing: .14em;
  color: rgba(158, 189, 178, .8);
}
.card-cap .text { display: block; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity .9s ease, transform 1s var(--ease);
  transition-delay: calc(var(--col, 0) * 90ms);
}

/* Filter chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 900px;
  margin: -24px auto 46px;
}
.chip {
  padding: 10px 16px 8px 18px;
  border: 1px solid var(--gold-line);
  background: transparent;
  color: var(--gold-2);
  font-family: var(--font-caps);
  font-size: .66rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  transition: background .3s, color .3s;
}
.chip b { font-weight: 400; opacity: .6; margin-left: .5em; }
.chip:hover { background: rgba(200, 167, 94, .12); }
.chip[aria-pressed="true"] { background: var(--gold); color: var(--ink); }

/* Empty state */
.empty {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 36px;
}
.ghosts {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(10px, 2.5vw, 24px);
}
.ghost {
  position: relative;
  width: clamp(70px, 16vw, 160px);
  aspect-ratio: 3 / 4;
  border: 1px solid var(--gold-line);
  background:
    repeating-conic-gradient(from 0deg at 50% 100%, rgba(200,167,94,.12) 0 1deg, transparent 1deg 9deg);
}
.ghost::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--gold-faint);
  border-radius: inherit;
}
.ghost:nth-child(2) { width: clamp(96px, 22vw, 220px); border-radius: 999px 999px 0 0; }
.ghost:nth-child(1), .ghost:nth-child(3) { aspect-ratio: 4 / 5; }
.empty-copy { text-align: center; max-width: 30em; }
.empty-copy h3 {
  margin: 0 0 6px;
  font-family: var(--font-caps);
  font-weight: 400;
  font-size: .9rem;
  letter-spacing: .4em;
  margin-right: -.4em;
  text-transform: uppercase;
}
.empty-copy p { margin: 0; font-style: italic; color: var(--muted); }
.chapter--dark .empty-copy p { color: rgba(230, 211, 160, .6); }

/* Link tiles (Add your photos / Linktree), a standalone row under the gallery */
.link-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 340px));
  justify-content: center;
  gap: clamp(14px, 2.5vw, 28px);
  max-width: 1240px;
  margin: clamp(56px, 8vw, 96px) auto 0;
}
.tile {
  position: relative;
  container-type: inline-size;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 10px;
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(200, 167, 94, .1), rgba(200, 167, 94, .02));
  color: var(--gold-2);
  text-decoration: none;
  transition: transform .5s var(--ease), background .5s var(--ease);
}
.tile::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid var(--gold-faint);
  border-radius: inherit;
  pointer-events: none;
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-4px);
  background: linear-gradient(180deg, rgba(200, 167, 94, .2), rgba(200, 167, 94, .06));
}
.tile-inner {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 16px 22px;
  text-align: center;
}
.tile-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.2;
  color: var(--gold);
}
.tile-icon--fan { width: 72px; height: 38px; }
.tile-kicker {
  font-family: var(--font-caps);
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .3em;
  margin-right: -.3em;
  text-transform: uppercase;
  color: var(--sea);
}
.tile-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 11cqw, 1.9rem);
  line-height: 1.1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f4e8c6;
}
.tile-sub {
  font-style: italic;
  font-size: 1rem;
  line-height: 1.3;
  color: rgba(230, 211, 160, .7);
  overflow-wrap: anywhere;
}
.tile-cta {
  margin-top: 6px;
  padding: 9px 14px 7px 18px;
  border: 1px solid var(--gold-line);
  font-family: var(--font-caps);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  transition: background .4s, color .4s;
}
.tile-cta i { font-style: normal; letter-spacing: 0; }
.tile:hover .tile-cta, .tile:focus-visible .tile-cta { background: var(--gold); color: var(--ink); }
@media (max-width: 600px) {
  .link-tiles { grid-template-columns: minmax(0, 340px); }
  .tile { min-height: 260px; }
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  padding: 70px 24px 80px;
  text-align: center;
  background: var(--ink);
  color: var(--gold-2);
  border-top: 1px solid var(--gold-faint);
}
.footer::before {
  content: "";
  position: absolute;
  top: 6px; left: 0; right: 0;
  height: 1px;
  background: var(--gold-faint);
}
.footer .fan { width: 110px; height: 57px; }
.footer-names {
  margin: 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(3.4rem, 8vw, 4.6rem);
  line-height: 1.1;
  color: #f4e8c6;
}
.footer-names span { font-family: var(--font-serif); font-style: italic; font-size: .45em; color: var(--gold); vertical-align: middle; }
.footer-date {
  margin: 16px 0 0;
  font-family: var(--font-caps);
  font-weight: 300;
  font-size: .8rem;
  letter-spacing: .4em;
  margin-right: -.4em;
  color: var(--gold);
}
.footer-love { margin: 20px 0 0; font-style: italic; color: rgba(230, 211, 160, .6); }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(9, 22, 19, .98);
  color: var(--gold-2);
}
.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: fadeIn .35s ease;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .7); }

.lb-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px clamp(14px, 3vw, 30px);
  font-family: var(--font-caps);
  font-size: .64rem;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.lb-label { color: rgba(230, 211, 160, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-counter { font-weight: 600; color: var(--gold); letter-spacing: .24em; }
.lb-close {
  justify-self: end;
  width: 42px;
  height: 42px;
  border: 1px solid var(--gold-faint);
  background: transparent;
  color: var(--gold-2);
  font-size: .9rem;
  cursor: pointer;
  transition: background .3s, border-color .3s;
}
.lb-close:hover { background: rgba(200, 167, 94, .12); border-color: var(--gold-line); }

.lb-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 10px 90px;
  touch-action: pan-y;
}
.lb-frame {
  position: relative;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--gold-line);
}
.lb-frame::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(200, 167, 94, .14);
  pointer-events: none;
}
.lb-img {
  display: block;
  max-width: calc(100vw - 220px);
  max-height: calc(100dvh - 210px);
  object-fit: contain;
  transition: opacity .35s ease;
}
.lb-img.swapping { opacity: 0; }

.lb-nav {
  position: absolute;
  top: 50%;
  width: 50px;
  height: 50px;
  margin-top: -25px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--gold-2);
}
.lb-nav::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--gold-line);
  transform: rotate(45deg);
  transition: background .3s, border-color .3s;
}
.lb-nav:hover::before { background: rgba(200, 167, 94, .14); border-color: var(--gold); }
.lb-nav span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
}
.lb-prev { left: clamp(12px, 3vw, 28px); }
.lb-next { right: clamp(12px, 3vw, 28px); }
.lb-prev span { transform: translate(-30%, -50%) rotate(-45deg); }
.lb-next span { transform: translate(-70%, -50%) rotate(135deg); }
.lightbox.single .lb-nav { display: none; }

.lb-bottom {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 20px 22px;
  text-align: center;
  min-height: 92px;
}
.lb-bottom p { margin: 0; }
.lb-caption { font-style: italic; font-size: 1.2rem; color: #f4e8c6; }
.lb-caption:empty { display: none; }
.lb-meta {
  font-family: var(--font-caps);
  font-size: .62rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--sea);
}
.lb-meta:empty { display: none; }
.lb-download {
  margin-top: 8px;
  font-family: var(--font-caps);
  font-size: .6rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(230, 211, 160, .7);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-faint);
  padding-bottom: 2px;
  transition: color .3s, border-color .3s;
}
.lb-download:hover { color: var(--gold-2); border-color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .topbar-links a { letter-spacing: .16em; font-size: .6rem; }
  .topbar-links a span { display: none; }
  .hero { padding: 90px 18px 120px; }
  .hero::after { background: radial-gradient(ellipse at 50% 45%, rgba(82, 127, 112, .28), transparent 60%); }
  .hero-frame { inset: 12px; }
  .corner { width: 44px; height: 44px; }
  .hero-date .date-line { font-size: .8rem; letter-spacing: .32em; gap: 10px; }
  .chapter { padding-bottom: 80px; }
  .chapter-head { margin-bottom: 40px; }
  .lb-stage { padding: 6px 10px; }
  .lb-img { max-width: calc(100vw - 44px); max-height: calc(100dvh - 220px); }
  .lb-nav { top: auto; bottom: -62px; margin-top: 0; }
  .lb-prev { left: 14px; }
  .lb-next { right: 14px; }
  .lb-bottom { padding-left: 76px; padding-right: 76px; }
}
@media (max-width: 420px) {
  .monogram { font-size: 1.1rem; }
  .topbar-links { gap: 12px; }
  .topbar-links a { font-size: .55rem; letter-spacing: .1em; }
}
@media (max-height: 620px) and (min-width: 721px) {
  .scroll-cue { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
