:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --paper-soft: #ebe8df;
  --ink: #171615;
  --muted: #6f6c65;
  --line: rgba(23, 22, 21, 0.18);
  --line-strong: rgba(23, 22, 21, 0.36);
  --white: #fffdf8;
  --red: #b11f24;
  --green: #4d5f4a;
  --shadow: 0 24px 70px rgba(24, 22, 18, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Helvetica Neue", Arial, "PingFang TC", "Noto Sans TC", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

body:has(dialog[open]) {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  color: var(--white);
  mix-blend-mode: difference;
}

.brand,
.nav a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.brand {
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
  align-items: center;
}

.nav a {
  position: relative;
  color: rgba(255, 255, 255, 0.88);
}

.nav a::after {
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 1px;
  background: currentColor;
  content: "";
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: left;
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav a:hover::after,
.nav a:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

.hero {
  position: relative;
  min-height: min(860px, 88svh);
  overflow: hidden;
  background: #111;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.2) 45%, rgba(0, 0, 0, 0.08)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0) 34%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: min(860px, 88svh);
  width: min(100%, 1660px);
  flex-direction: column;
  justify-content: flex-end;
  padding: 120px clamp(20px, 6vw, 96px) clamp(42px, 7vw, 98px);
  color: var(--white);
}

.kicker,
.tools,
.section-label {
  margin: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: uppercase;
}

.kicker,
.tools {
  color: rgba(255, 253, 248, 0.78);
}

.hero h1,
.section h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif TC", "Songti TC", serif;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.08;
}

.hero h1 {
  max-width: 980px;
  margin-top: 18px;
  font-size: clamp(48px, 8vw, 136px);
}

.lead {
  max-width: 660px;
  margin: 24px 0 0;
  color: rgba(255, 253, 248, 0.88);
  font-family: Georgia, "Times New Roman", "Noto Serif TC", "Songti TC", serif;
  font-size: clamp(20px, 2.3vw, 34px);
  line-height: 1.55;
}

.tools {
  margin-top: 30px;
}

.section {
  width: min(100%, 1660px);
  margin: 0 auto;
  padding: clamp(74px, 9vw, 148px) clamp(20px, 6vw, 96px);
}

.section-label {
  color: var(--red);
}

.note-section {
  border-bottom: 1px solid var(--line);
}

.note-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.55fr);
  gap: clamp(44px, 7vw, 120px);
  align-items: start;
  margin-top: 22px;
}

.section h2 {
  max-width: 900px;
  font-size: clamp(36px, 5vw, 86px);
}

.essay {
  max-width: 920px;
  margin-top: clamp(26px, 4vw, 52px);
  color: #2b2925;
  font-size: clamp(17px, 1.55vw, 22px);
  line-height: 2.05;
}

.essay p {
  margin: 0 0 1.35em;
}

.session-facts {
  position: sticky;
  top: 94px;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
}

.session-facts dl {
  margin: 0;
}

.session-facts div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.session-facts dt {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  text-transform: uppercase;
}

.session-facts dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.gallery-section {
  padding-bottom: clamp(40px, 6vw, 92px);
}

.gallery-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: clamp(32px, 6vw, 84px);
}

.gallery-head h2 {
  margin-top: 14px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
  border-bottom: 1px solid var(--line);
}

.filter-button {
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 12px 10px 14px;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.is-active {
  border-color: var(--red);
  color: var(--ink);
}

.gallery-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-auto-rows: minmax(84px, auto);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(18px, 2.2vw, 34px);
}

.gallery-chapter {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(96px, 0.18fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 60px);
  align-items: end;
  padding-top: clamp(28px, 4vw, 64px);
  border-top: 1px solid var(--line);
}

.chapter-number {
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 6vw, 80px);
  line-height: 1;
}

.chapter-copy h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif TC", "Songti TC", serif;
  font-size: clamp(30px, 4vw, 58px);
  font-weight: 400;
  line-height: 1.1;
}

.chapter-copy p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.4vw, 18px);
}

.photo-card {
  grid-column: span 4;
  margin: 0;
}

.photo-card.is-wide {
  grid-column: span 7;
}

.photo-card.is-feature {
  grid-column: span 8;
}

.photo-card.is-tall {
  grid-column: span 4;
}

.photo-card.is-offset {
  padding-top: clamp(24px, 5vw, 82px);
}

.photo-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  box-shadow: var(--shadow);
  cursor: zoom-in;
  overflow: hidden;
}

.photo-button img {
  width: 100%;
  height: auto;
  background: var(--paper-soft);
  transition: filter 220ms ease, transform 360ms ease;
}

.photo-button:hover img,
.photo-button:focus-visible img {
  filter: brightness(0.94);
  transform: scale(1.018);
}

.photo-card figcaption {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: baseline;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.photo-card .photo-number {
  color: var(--ink);
  font-weight: 800;
}

.photo-card[hidden] {
  display: none;
}

.contact-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contact-head {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(260px, 0.55fr);
  gap: clamp(24px, 6vw, 90px);
  align-items: end;
  margin-top: 14px;
  margin-bottom: clamp(28px, 5vw, 72px);
}

.contact-head p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.3vw, 18px);
}

.contact-sheet {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 8px;
}

.contact-thumb {
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid rgba(23, 22, 21, 0.08);
  border-radius: 1px;
  background: var(--paper-soft);
  cursor: pointer;
  overflow: hidden;
}

.contact-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 180ms ease;
}

.contact-thumb:hover img,
.contact-thumb:focus-visible img {
  opacity: 0.72;
}

.links-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 0.78fr);
  gap: clamp(34px, 8vw, 120px);
  align-items: start;
}

.links-section h2 {
  margin-top: 14px;
}

.link-list {
  border-top: 1px solid var(--line-strong);
}

.link-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: baseline;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.link-list a::after {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--red);
  content: "↗";
  font-size: 18px;
}

.link-list span {
  grid-column: 1;
  min-width: 0;
  font-size: clamp(18px, 2vw, 27px);
  font-family: Georgia, "Times New Roman", "Noto Serif TC", "Songti TC", serif;
}

.link-list small {
  display: block;
  grid-column: 1;
  min-width: 0;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(20px, 6vw, 96px) 42px;
  color: var(--muted);
  font-size: 12px;
}

.footer p {
  margin: 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #070706;
  color: var(--white);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.lightbox[open] {
  display: grid;
  grid-template-columns: minmax(54px, 0.12fr) minmax(0, 1fr) minmax(54px, 0.12fr);
  align-items: center;
}

.lightbox-frame {
  display: grid;
  height: 100dvh;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  margin: 0;
  padding: clamp(58px, 8vh, 86px) clamp(8px, 2vw, 28px) clamp(22px, 4vh, 44px);
}

.lightbox-image-wrap {
  display: grid;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  touch-action: none;
}

.lightbox-frame img {
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 148px);
  object-fit: contain;
  cursor: zoom-in;
  transform: translate3d(var(--pan-x, 0px), var(--pan-y, 0px), 0) scale(var(--zoom, 1));
  transform-origin: center;
  transition: transform 160ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox.is-zoomed .lightbox-frame img {
  cursor: grab;
}

.lightbox.is-dragging .lightbox-frame img {
  cursor: grabbing;
  transition: none;
}

.lightbox-frame figcaption {
  display: flex;
  width: min(100%, 980px);
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  margin-top: 18px;
  color: rgba(255, 253, 248, 0.68);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.lightbox-frame figcaption span:first-child {
  color: var(--white);
  font-weight: 800;
}

.lightbox-close,
.lightbox-nav,
.zoom-button,
.zoom-meter {
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  line-height: 1;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 3;
  width: 48px;
  height: 48px;
  font-size: 38px;
}

.lightbox-tools {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(255, 253, 248, 0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(26, 24, 20, 0.78), rgba(10, 10, 9, 0.68));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.zoom-button,
.zoom-meter {
  display: grid;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.zoom-button {
  width: 38px;
  color: rgba(255, 253, 248, 0.78);
  font-family: var(--serif);
  font-size: 22px;
}

.zoom-meter {
  min-width: 72px;
  padding: 0 15px;
  border: 1px solid rgba(255, 253, 248, 0.14);
  background: rgba(255, 253, 248, 0.1);
  color: rgba(255, 253, 248, 0.86);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.zoom-button:hover,
.zoom-button:focus-visible,
.zoom-meter:hover,
.zoom-meter:focus-visible {
  background: rgba(255, 253, 248, 0.18);
  border-color: rgba(255, 253, 248, 0.28);
  color: var(--white);
}

.lightbox-nav {
  z-index: 2;
  width: 100%;
  min-height: 100dvh;
  color: rgba(255, 253, 248, 0.78);
  font-size: clamp(34px, 5vw, 72px);
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible,
.lightbox-close:hover,
.lightbox-close:focus-visible {
  color: var(--white);
}

@media (max-width: 1100px) {
  .gallery-head,
  .note-layout,
  .contact-head,
  .links-section {
    grid-template-columns: 1fr;
  }

  .gallery-head {
    display: grid;
    align-items: start;
  }

  .filter-group {
    justify-content: flex-start;
  }

  .session-facts {
    position: static;
  }

  .gallery-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .photo-card,
  .photo-card.is-tall {
    grid-column: span 4;
  }

  .photo-card.is-wide,
  .photo-card.is-feature {
    grid-column: span 8;
  }

  .contact-sheet {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    padding: 16px 18px;
  }

  .nav {
    gap: 14px;
  }

  .brand,
  .nav a {
    font-size: 11px;
  }

  .hero {
    min-height: 86svh;
  }

  .hero-image {
    object-position: 68% 50%;
  }

  .hero-shade {
    background:
      linear-gradient(0deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.18) 62%, rgba(0, 0, 0, 0.04)),
      linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.02));
  }

  .hero-copy {
    min-height: 86svh;
    padding: 112px 20px 42px;
  }

  .lead {
    max-width: 16em;
  }

  .section {
    padding: 68px 20px;
  }

  .essay {
    font-size: 16px;
    line-height: 1.9;
  }

  .session-facts div {
    grid-template-columns: 78px 1fr;
  }

  .filter-group {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .filter-button {
    flex: 0 0 auto;
    min-height: 42px;
  }

  .gallery-grid {
    display: block;
  }

  .gallery-chapter {
    display: block;
    margin: 56px 0 22px;
    padding-top: 32px;
  }

  .chapter-copy h3 {
    margin-top: 10px;
  }

  .photo-card,
  .photo-card.is-wide,
  .photo-card.is-feature,
  .photo-card.is-tall,
  .photo-card.is-offset {
    padding-top: 0;
    margin: 0 0 34px;
  }

  .photo-button {
    box-shadow: 0 18px 45px rgba(24, 22, 18, 0.14);
  }

  .photo-card figcaption {
    grid-template-columns: 1fr;
    gap: 3px;
    font-size: 11px;
  }

  .contact-sheet {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .link-list a {
    grid-template-columns: minmax(0, 1fr) 24px;
    padding: 20px 0;
  }

  .footer {
    display: block;
    padding: 28px 20px 36px;
  }

  .footer p + p {
    margin-top: 6px;
  }

  .lightbox[open] {
    grid-template-columns: 1fr;
  }

  .lightbox-nav {
    position: fixed;
    top: 64px;
    bottom: 96px;
    width: 50vw;
    min-height: 0;
    color: transparent;
  }

  .lightbox-prev {
    left: 0;
  }

  .lightbox-next {
    right: 0;
  }

  .lightbox-frame {
    padding: 66px 12px 28px;
  }

  .lightbox-tools {
    top: 18px;
    left: 18px;
    transform: none;
  }

  .zoom-button {
    width: 36px;
    height: 36px;
  }

  .zoom-meter {
    min-width: 66px;
    height: 36px;
    padding: 0 12px;
  }

  .lightbox-frame img {
    max-height: calc(100dvh - 156px);
  }
}

@media (max-width: 420px) {
  .nav a[href="#note"] {
    display: none;
  }

  .hero h1 {
    font-size: 44px;
  }

  .contact-sheet {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
