:root {
  --navy: #071a2d;
  --navy-2: #0d2942;
  --river: #dce6e9;
  --white: #fff;
  --paper: #f4f3ef;
  --ink: #102536;
  --muted: #60717c;
  --red: #b43a33;
  --gold: #c99b52;
  --serif: "Noto Serif TC", "I.Ming", "PMingLiU", serif;
  --sans: "Microsoft JhengHei UI", "Microsoft JhengHei", sans-serif;
  --gutter: clamp(22px, 5vw, 86px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); overflow-x: hidden; }
body.lightbox-open { overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
img { display: block; width: 100%; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 100; background: rgba(255,255,255,.14); }
.progress span { display: block; width: 0; height: 100%; background: var(--gold); }

.site-header { position: fixed; inset: 3px 0 auto; z-index: 90; display: flex; align-items: center; justify-content: space-between; padding: 24px var(--gutter); color: #fff; transition: background .35s, padding .35s, color .35s; }
.site-header.scrolled { padding-top: 16px; padding-bottom: 16px; color: var(--ink); background: rgba(244,243,239,.92); backdrop-filter: blur(16px); box-shadow: 0 1px 0 rgba(7,26,45,.1); }
.brand { font-size: 13px; letter-spacing: .13em; font-weight: 700; }
.brand span { font-weight: 400; opacity: .78; }
.site-nav { display: flex; gap: clamp(20px, 3vw, 48px); font-size: 12px; letter-spacing: .25em; }
.site-nav a { position: relative; padding: 6px 0; }
.site-nav a::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .3s; }
.site-nav a:hover::after, .site-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.menu-toggle { display: none; border: 0; background: transparent; color: inherit; padding: 8px; }

.hero { position: relative; min-height: 100svh; color: #fff; background: var(--navy); overflow: hidden; }
.hero > img { position: absolute; inset: 0; height: 100%; object-fit: cover; object-position: center 45%; animation: heroIn 1.6s cubic-bezier(.2,.7,.2,1) both; }
.hero-shade { position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(1,12,23,.84)); pointer-events: none; }
.hero-copy { position: absolute; left: var(--gutter); bottom: clamp(92px, 13vh, 150px); max-width: 900px; }
.hero-copy time { display: block; margin-bottom: 14px; font-size: 13px; letter-spacing: .2em; }
.hero h1 { margin: 0; font: 500 clamp(48px, 8vw, 122px)/1.04 var(--serif); letter-spacing: .03em; text-shadow: 0 2px 28px rgba(0,0,0,.28); }
.hero-copy p { margin: 20px 0 0; font-size: clamp(14px, 1.5vw, 20px); letter-spacing: .18em; }
.scroll-cue { position: absolute; right: var(--gutter); bottom: 38px; display: flex; align-items: center; gap: 15px; font-size: 11px; letter-spacing: .2em; }
.scroll-cue svg { width: 18px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.2; animation: bob 1.8s ease-in-out infinite; }

.prologue { display: grid; grid-template-columns: 1.45fr .75fr; min-height: 85vh; background: var(--paper); }
.prologue-photo { min-height: 72vh; }
.prologue-photo .photo-button, .prologue-photo img { height: 100%; }
.prologue-photo img { object-fit: cover; }
.prologue-copy { display: flex; flex-direction: column; justify-content: center; padding: 10vw var(--gutter); }
.prologue-copy p { margin: 0; font: 500 clamp(30px, 4.4vw, 70px)/1.45 var(--serif); }
.prologue-copy span { display: block; margin-top: 42px; color: var(--muted); font-size: 13px; line-height: 2; letter-spacing: .1em; }

.chapter { position: relative; display: grid; grid-template-columns: minmax(290px, .72fr) minmax(0, 1.7fr); padding: clamp(90px, 12vw, 180px) var(--gutter); gap: clamp(45px, 7vw, 110px); overflow: hidden; }
.chapter-dark { color: #fff; background: var(--navy); }
.chapter-light { background: var(--paper); }
.chapter-river { color: var(--navy); background: linear-gradient(180deg, #dfe9ec, #cddce0); }
.chapter-copy { position: relative; z-index: 2; align-self: center; }
.chapter-mark { display: flex; align-items: center; gap: 16px; color: var(--gold); margin-bottom: 28px; }
.chapter-mark span { font: 500 30px/1 var(--serif); }
.chapter-mark i { display: block; width: 72px; height: 1px; background: currentColor; }
.chapter h2 { margin: 0 0 34px; font: 500 clamp(35px, 4.4vw, 72px)/1.28 var(--serif); letter-spacing: .02em; }
.chapter h2 small { display: block; margin-bottom: 8px; font: 600 14px/1 var(--sans); letter-spacing: .35em; color: var(--gold); }
.chapter-copy > p { margin: 0 0 22px; font-size: clamp(15px, 1.35vw, 19px); line-height: 2.05; letter-spacing: .04em; }

.photo-button { display: block; width: 100%; padding: 0; border: 0; background: #cdd6d8; cursor: zoom-in; overflow: hidden; }
.photo-button img { height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1), filter .5s; }
.photo-button:hover img { transform: scale(1.025); filter: brightness(1.03); }
.photo-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.feature-landscape { align-self: center; }
.feature-landscape .photo-button { aspect-ratio: 4 / 3; box-shadow: 24px 30px 0 rgba(201,155,82,.11); }

.filmstrip { grid-column: 1 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 27vw); gap: 12px; margin: 28px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 20px; overflow-x: auto; scrollbar-color: var(--gold) transparent; scroll-snap-type: x proximity; }
.filmstrip .photo-button { aspect-ratio: 4 / 3; scroll-snap-align: start; }
.filmstrip .portrait { aspect-ratio: 3 / 4; }

.thanks-note { grid-column: 1 / -1; max-width: 780px; margin: 40px auto 0; padding-left: 34px; border-left: 2px solid var(--gold); }
.thanks-note p { margin: 0 0 8px; font: 500 clamp(21px, 2.2vw, 32px)/1.6 var(--serif); }
.thanks-note span { display: block; opacity: .72; font-size: 13px; line-height: 2; letter-spacing: .06em; }

.portrait-pair { display: grid; grid-template-columns: 1fr .82fr; align-items: start; gap: 16px; }
.portrait-pair .photo-button { aspect-ratio: 3 / 4; }
.portrait-pair .offset { margin-top: 22%; }
.mosaic { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 40px; }
.mosaic .photo-button { aspect-ratio: 3 / 4; }
.mosaic .photo-button:nth-child(2), .mosaic .photo-button:nth-child(5) { transform: translateY(28px); }

.chapter-river { grid-template-columns: .7fr 1.5fr; }
.cinema { align-self: center; }
.cinema .photo-button { aspect-ratio: 1.48 / 1; }
.boat-sequence { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px; margin-top: 18px; }
.boat-sequence .photo-button { grid-column: span 4; aspect-ratio: 4 / 3; }
.boat-sequence .photo-button:nth-child(4), .boat-sequence .photo-button:nth-child(5) { grid-column: span 6; }
.boat-sequence .portrait { aspect-ratio: 3 / 4; }

.complete { grid-template-columns: 1.3fr .8fr; }
.complete-photo .photo-button { aspect-ratio: 4 / 3; }
.closing-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; }
.closing-grid .photo-button { aspect-ratio: 4 / 3; }
.closing-grid .wide { grid-column: 1 / -1; aspect-ratio: 2 / 1; }

.all-gallery { padding: clamp(90px, 11vw, 160px) 0; color: #fff; background: var(--navy); }
.gallery-heading { padding: 0 var(--gutter) 48px; display: grid; grid-template-columns: .5fr 1fr .5fr; align-items: end; gap: 30px; }
.gallery-heading > span { color: var(--gold); font-size: 10px; letter-spacing: .28em; text-transform: uppercase; }
.gallery-heading h2 { margin: 0; font: 500 clamp(34px, 5vw, 72px)/1.2 var(--serif); }
.gallery-heading p { margin: 0; opacity: .65; font-size: 12px; letter-spacing: .1em; }
.gallery-rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(230px, 30vw, 470px); gap: 12px; padding: 0 var(--gutter) 28px; overflow-x: auto; scrollbar-color: var(--gold) transparent; scroll-snap-type: x mandatory; }
.gallery-rail .photo-button { aspect-ratio: 4 / 3; scroll-snap-align: center; }
.gallery-rail .photo-button:nth-child(5n+2) { aspect-ratio: 3 / 4; }

.finale { position: relative; min-height: 80vh; display: flex; align-items: center; padding: 120px var(--gutter); color: #fff; background: var(--navy-2); overflow: hidden; }
.finale::before { content: ""; position: absolute; width: 45vw; height: 45vw; right: -12vw; top: -14vw; border: 1px solid rgba(201,155,82,.18); border-radius: 50%; box-shadow: 0 0 0 5vw rgba(201,155,82,.03), 0 0 0 10vw rgba(201,155,82,.025); }
.wave-lines { position: absolute; right: -8%; bottom: -12%; width: 62%; height: 68%; opacity: .15; background: repeating-radial-gradient(ellipse at 100% 100%, transparent 0 14px, var(--gold) 15px 16px, transparent 17px 28px); transform: rotate(-7deg); }
.finale-copy { position: relative; max-width: 950px; }
.finale-copy > p { max-width: 660px; margin: 0 0 65px; color: rgba(255,255,255,.68); font-size: 15px; line-height: 2.1; letter-spacing: .05em; }
.finale h2 { margin: 0 0 38px; font: 500 clamp(42px, 6.8vw, 100px)/1.28 var(--serif); }
.finale-copy > span { display: inline-block; padding-top: 20px; border-top: 3px solid var(--gold); color: var(--gold); font-size: 13px; letter-spacing: .16em; }
.back-top { position: absolute; right: var(--gutter); bottom: 58px; display: flex; gap: 12px; align-items: center; font-size: 11px; letter-spacing: .18em; }
.back-top svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px var(--gutter); color: rgba(255,255,255,.6); background: #03111f; font-size: 10px; letter-spacing: .12em; }

.lightbox { width: 100vw; max-width: none; height: 100vh; max-height: none; padding: 0; border: 0; color: #fff; background: rgba(2,12,22,.96); }
.lightbox::backdrop { background: rgba(2,12,22,.96); }
.lightbox[open] { display: grid; grid-template-columns: 76px 1fr 76px; align-items: center; }
.lightbox figure { margin: 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 52px 0 28px; }
.lightbox figure img { width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 110px); object-fit: contain; }
.lightbox figcaption { width: 100%; display: flex; justify-content: space-between; gap: 20px; padding-top: 14px; color: rgba(255,255,255,.62); font-size: 11px; letter-spacing: .1em; }
.lightbox-close, .lightbox-nav { border: 0; color: #fff; background: transparent; cursor: pointer; }
.lightbox-close { position: absolute; top: 17px; right: 24px; z-index: 2; font: 300 36px/1 var(--sans); }
.lightbox-nav { width: 100%; height: 100%; display: grid; place-items: center; }
.lightbox-nav svg { width: 30px; fill: none; stroke: currentColor; stroke-width: 1.2; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.visible { opacity: 1; transform: none; }

@keyframes heroIn { from { opacity: 0; transform: scale(1.035); } to { opacity: 1; transform: scale(1); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

@media (max-width: 900px) {
  .site-header { padding-top: 18px; padding-bottom: 18px; }
  .brand { max-width: 230px; line-height: 1.5; }
  .menu-toggle { display: grid; gap: 5px; }
  .menu-toggle > span:not(.sr-only) { display: block; width: 24px; height: 1px; background: currentColor; transition: transform .3s, opacity .3s; }
  .menu-toggle[aria-expanded="true"] > span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] > span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] > span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .site-nav { position: absolute; inset: 100% 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; padding: 12px var(--gutter) 24px; color: var(--ink); background: rgba(244,243,239,.97); transform: translateY(-130%); opacity: 0; pointer-events: none; transition: .3s; }
  .site-nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .site-nav a { padding: 15px 0; border-bottom: 1px solid rgba(7,26,45,.1); }
  .hero > img { object-position: 52% center; }
  .prologue { grid-template-columns: 1fr; }
  .prologue-photo { min-height: 58vh; }
  .prologue-copy { min-height: 58vh; }
  .chapter, .chapter-river, .complete { grid-template-columns: 1fr; }
  .feature-landscape, .cinema { grid-row: 2; }
  .filmstrip, .mosaic, .boat-sequence, .closing-grid, .thanks-note { grid-column: 1; }
  .mosaic { grid-template-columns: repeat(3, 1fr); }
  .boat-sequence .photo-button, .boat-sequence .photo-button:nth-child(4), .boat-sequence .photo-button:nth-child(5) { grid-column: span 6; }
  .complete-photo { grid-row: 2; }
  .gallery-heading { grid-template-columns: 1fr; }
  .gallery-heading > span { order: 2; }
}

@media (max-width: 600px) {
  .hero { min-height: 92svh; }
  .hero > img { object-position: 51% center; }
  .hero-copy { bottom: 86px; }
  .hero h1 { font-size: clamp(47px, 15vw, 72px); max-width: 6em; }
  .hero-copy p { max-width: 18em; line-height: 1.8; }
  .scroll-cue { right: 20px; bottom: 25px; }
  .scroll-cue span { display: none; }
  .chapter { padding-top: 92px; padding-bottom: 92px; gap: 48px; }
  .chapter h2 { font-size: 40px; }
  .chapter-copy > p { font-size: 15px; line-height: 2; }
  .filmstrip { grid-auto-columns: 68vw; }
  .portrait-pair { gap: 8px; }
  .mosaic { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .mosaic .photo-button:nth-child(2), .mosaic .photo-button:nth-child(5) { transform: none; }
  .boat-sequence { gap: 7px; }
  .boat-sequence .photo-button, .boat-sequence .photo-button:nth-child(4), .boat-sequence .photo-button:nth-child(5) { grid-column: 1 / -1; }
  .closing-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .closing-grid .wide { aspect-ratio: 4 / 3; }
  .gallery-rail { grid-auto-columns: 78vw; }
  .finale { min-height: 85vh; padding-top: 100px; padding-bottom: 130px; }
  .finale-copy > p { margin-bottom: 45px; }
  footer { flex-direction: column; }
  .lightbox[open] { grid-template-columns: 45px 1fr 45px; }
  .lightbox figure { padding-top: 66px; }
  .lightbox figcaption { flex-direction: column; gap: 5px; }
}

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