:root {
  color-scheme: light;
  --paper: #faf6ef;
  --ink: #2d221e;
  --muted: #725f58;
  --wine: #862d36;
  --wine-hover: #6b2028;
  --line: #e4d7cb;
  --serif: "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--sans); }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--wine); outline-offset: 5px; }
.shell { max-width: 1536px; width: calc(100% - clamp(36px, 9vw, 144px)); margin-inline: auto; }

.site-header {
  min-height: 77px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.mark { color: var(--wine); font-size: 23px; line-height: 1; }
.header-link { color: var(--wine); font-size: 14px; }
.header-link span, .site-footer a span { margin-inline-start: 5px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.83fr) minmax(0, 1.35fr);
  align-items: center;
  gap: clamp(24px, 4.3vw, 68px);
  padding-block: clamp(30px, 5.2vw, 76px);
  border-bottom: 1px solid var(--line);
}
.hero-copy { padding-inline-start: clamp(0px, 2vw, 34px); }
.date {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 24px;
  color: var(--wine);
  font: 600 12px/1.4 var(--sans);
  letter-spacing: 0.24em;
}
.date span { width: 29px; height: 1px; background: var(--wine); }
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 700; }
h1 { font-size: clamp(48px, 6.15vw, 96px); letter-spacing: -0.04em; line-height: 1.14; }
.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 23px;
  background: var(--wine);
  color: #fff7ef;
  min-height: 48px;
  margin-top: 29px;
  padding: 0 21px;
  border-radius: 3px;
}
.primary-link:hover { background: var(--wine-hover); }
.primary-link span { font-size: 19px; }
.hero-photo {
  aspect-ratio: 1.38;
  min-height: 0;
  padding: 8px;
  background: #fffaf5;
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px #4b25130d;
}
.hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 47%; }

.album { padding-block: clamp(34px, 5vw, 63px) 40px; scroll-margin-top: 16px; }
.section-heading { display: flex; gap: 12px; align-items: end; justify-content: space-between; margin-bottom: 23px; }
.section-heading h2 { font-size: clamp(31px, 4vw, 48px); line-height: 1.12; letter-spacing: 0.03em; }
.section-heading p { color: var(--muted); margin: 9px 0 0; font-size: 14px; }
.section-heading .count { color: var(--wine); white-space: nowrap; font-variant-numeric: tabular-nums; }
.photo-grid {
  --gap: 15px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 8px;
  column-gap: var(--gap);
}
.photo-tile {
  display: block;
  grid-row-end: span var(--span, 30);
  width: 100%;
  min-height: 0;
  padding: 0;
  margin: 0 0 var(--gap);
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: #efe5da;
  cursor: zoom-in;
}
.photo-tile img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 200ms ease; }
@media (hover: hover) { .photo-tile:hover img { transform: scale(1.035); } }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-block: 24px 34px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer a { color: var(--wine); }

body:has(.viewer[open]) { overflow: hidden; }
.viewer {
  color-scheme: dark;
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  background: #211a18;
  color: #fff7ee;
}
.viewer::backdrop { background: #211a18; }
.viewer-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.viewer-header, .viewer-actions, .viewer-navigation { display: flex; align-items: center; gap: 10px; }
.viewer-header { justify-content: space-between; padding: 2px 0 8px; }
.viewer-count { margin-inline-start: 4px; font-variant-numeric: tabular-nums; color: #e3d4c6; }
.download, .icon-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 4px; }
.download { background: #f8eadd; color: #321e19; gap: 7px; padding-inline: 13px; font-size: 14px; }
.download:hover { background: #fff8f0; }
.icon-button {
  padding: 0;
  width: 44px;
  color: inherit;
  border: 1px solid #fff3e54d;
  background: transparent;
  font-size: 25px;
  cursor: pointer;
}
.icon-button:hover { background: #fff3e522; }
.icon-button:disabled { opacity: 0.35; cursor: default; }
.viewer :is(a, button):focus-visible { outline-color: #f8eadd; }
.viewer-stage { display: grid; place-items: center; min-width: 0; min-height: 0; }
.viewer-stage img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.viewer-navigation { justify-content: center; padding: 10px 0 0; }

@media (max-width: 1000px) {
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .site-header { min-height: 62px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 27px; padding-top: 31px; }
  .hero-copy { padding-inline-start: 0; }
  .date { margin-bottom: 14px; }
  h1 { font-size: clamp(51px, 11.8vw, 72px); }
  .primary-link { margin-top: 20px; }
  .hero-photo { padding: 5px; }
  .photo-grid { --gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .photo-tile img { transition: none; }
}
