/* Ji Eun & Andrei, April 19, 2024
   The ground is the green of the velvet ring box from the first frames; sage comes from the bridesmaids and the arch.
   Everything else stays out of the way of Aventi's photographs. */
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader.woff2) format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader-italic.woff2) format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  --velvet: #12241a;
  --velvet-2: #1a3124;
  --ivory: #f2eee5;
  --stone: #c9c2b4;
  --sage: #b7c0a4;
  --line: rgba(242, 238, 229, .16);
  --pad: clamp(14px, 3.4vw, 48px);
  --row: clamp(150px, 19vw, 290px);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { background: var(--velvet); color: var(--ivory); -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
html.lb-open { overflow: hidden; }
body { margin: 0; background: var(--velvet); font: 400 1.0625rem/1.6 var(--serif); font-optical-sizing: auto; }
a { color: inherit; }
img { display: block; }
h1, h2, p, ol { margin: 0; }
ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 99; background: var(--ivory); color: var(--velvet); padding: 8px 12px; }
.skip:focus { top: 12px; }
#gallery:focus { outline: none; }

/* ---------- cover ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 520px; overflow: hidden; background: #6d5a45; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, var(--velvet) 0%, rgba(18, 36, 26, .78) 18%, rgba(18, 36, 26, .18) 46%, rgba(18, 36, 26, 0) 62%); }
.hero-text { position: absolute; z-index: 2; left: var(--pad); right: var(--pad); bottom: clamp(28px, 6vh, 64px); }
.hero h1 { font-weight: 250; font-size: clamp(3.6rem, 10.5vw, 10.5rem); line-height: .9; letter-spacing: -.012em; font-variation-settings: "opsz" 72; }
.hero h1 span { display: block; }
.hero h1 span + span { padding-left: .62em; }
.date { margin-top: clamp(16px, 2.4vw, 28px); font-size: clamp(1.15rem, 1.6vw, 1.45rem); }
.credit { margin-top: 2px; color: var(--stone); font-style: italic; }
.hero h1 span, .date, .credit { animation: arrive 1.4s var(--ease) both; }
.hero h1 span + span { animation-delay: .18s; }
.date { animation-delay: .5s; }
.credit { animation-delay: .62s; }
@keyframes arrive { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- chapter bar ---------- */
.chapters { position: sticky; top: 0; z-index: 10; background: rgba(18, 36, 26, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); }
.chapters ol { display: flex; gap: clamp(18px, 2.6vw, 36px); overflow-x: auto; padding: 14px var(--pad) 12px; scrollbar-width: none; }
.chapters ol::-webkit-scrollbar { display: none; }
.chapters a { flex: none; white-space: nowrap; text-decoration: none; color: var(--stone); padding: 4px 0 3px; border-bottom: 1px solid transparent;
  transition: color .3s var(--ease), border-color .3s var(--ease); }
.chapters a:hover { color: var(--ivory); }
.chapters a[aria-current="true"] { color: var(--ivory); border-color: var(--sage); }
.cn { font-size: .72em; margin-left: .35em; color: var(--sage); font-variant-numeric: tabular-nums; vertical-align: .35em; }

/* ---------- chapters + justified rows ---------- */
.chapter { padding: clamp(56px, 7vw, 104px) var(--pad) 0; }
.ch-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; margin-bottom: clamp(18px, 2.4vw, 30px); }
.ch-head h2 { font-weight: 300; font-size: clamp(2.3rem, 5vw, 4.6rem); line-height: .95; letter-spacing: -.008em; font-variation-settings: "opsz" 72; }
.ch-count { color: var(--stone); font-style: italic; }
/* each tile grows in proportion to its aspect ratio, so every full row comes out the same height */
.rows { display: flex; flex-wrap: wrap; gap: 6px; }
.rows::after { content: ""; flex: 999 1 0; }
.t { position: relative; flex: var(--r) 1 calc(var(--r) * var(--row)); background: var(--c); overflow: hidden; }
.t img { width: 100%; height: auto; transition: opacity .7s var(--ease), transform 1.2s var(--ease); }
.js .t img:not(.in) { opacity: 0; }
.t:hover img { transform: scale(1.025); }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin-top: clamp(72px, 9vw, 130px);
  padding: 22px var(--pad) max(26px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--stone); font-size: .92rem; }

/* ---------- viewer ---------- */
.lb { position: fixed; inset: 0; z-index: 50; background: #0b1710; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.lb[hidden] { display: none; }
.lb-stage { position: relative; min-height: 0; touch-action: pan-y; }
.lb-stage img { position: absolute; top: clamp(10px, 3vh, 36px); bottom: 0; left: clamp(10px, 6vw, 96px); right: clamp(10px, 6vw, 96px);
  width: calc(100% - 2 * clamp(10px, 6vw, 96px)); height: calc(100% - clamp(10px, 3vh, 36px)); object-fit: contain;
  transition: opacity .35s var(--ease); }
.lb-stage img.fading { opacity: 0; }
.lb-nav { position: absolute; top: 0; bottom: 64px; width: clamp(56px, 7vw, 110px); display: grid; place-items: center; color: var(--ivory); opacity: .7; transition: opacity .25s; }
.lb-nav:hover, .lb-nav:focus-visible { opacity: 1; }
.lb-nav svg { width: 18px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.lb-prev { left: 0; }
.lb-next { right: 0; }
.lb-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 16px; padding: 16px var(--pad) max(18px, env(safe-area-inset-bottom)); }
.lb-ch { font-style: italic; color: var(--stone); }
.lb-count { font-variant-numeric: tabular-nums; color: var(--stone); }
.lb-close { justify-self: end; padding: 6px 2px; border-bottom: 1px solid var(--sage); }

@media (max-width: 700px) {
  :root { --row: 40vw; }
  .rows { gap: 4px; }
  .hero h1 span + span { padding-left: .4em; }
  .hero-img { object-position: 60% 30%; }
  .lb-nav { display: none; }
  .lb-stage img { top: 8px; left: 0; right: 0; width: 100%; height: calc(100% - 8px); }
  .lb-bar { grid-template-columns: 1fr auto; }
  .lb-count { grid-column: 1; grid-row: 2; }
  .lb-close { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1 span, .date, .credit { animation: none; }
  * { transition: none !important; }
}
