:root {
  --bg: #efeae2;
  --paper: #fbf7f2;
  --ink: #1c1916;
  --muted: #6d655c;
  --line: #e0d5c8;
  --accent: #8d2f2a;
  --pad: clamp(1rem, 3vw, 1.75rem);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Han Sans SC", sans-serif;
  font-weight: 400;
  line-height: 1.6;
}
main { flex: 1 0 auto; }
button, input, textarea, select { font-family: inherit; }
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, .brand {
  font-weight: 700;
  line-height: 1.2;
}
.wrap { width: min(1040px, calc(100% - 2 * var(--pad))); margin-inline: auto; }
.reading { max-width: 42rem; }
.hero {
  position: relative;
  height: min(78svh, 820px);
  min-height: 420px;
  background: #221c18;
  color: #fff;
}
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 14, 11, .78), rgba(18, 14, 11, .08) 52%, rgba(18, 14, 11, .35));
}
.hero-bar, .hero-copy { position: absolute; left: 0; right: 0; z-index: 1; padding: var(--pad); }
.hero-bar { top: 0; }
.hero-copy { bottom: 0; width: min(1040px, 100%); }
.brand { color: #fff; text-decoration: none; font-size: 1.15rem; }
.hero h1 { margin: 0; font-size: clamp(2.5rem, 7vw, 5.2rem); }
.hero-copy p { max-width: 36rem; margin: 0.75rem 0 0; font-size: 1.05rem; }
.home { padding: 1.5rem 0 2.5rem; }
.friends {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  background: #221c18;
  color: #fff;
  padding: 0.75rem var(--pad);
}
.friends-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.2rem;
  min-width: 0;
}
.friends .kicker { margin: 0; color: rgba(255, 255, 255, 0.62); }
.friends nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1.2rem; }
.friends a { color: #fff; text-decoration: none; }
.friends a:hover { color: #f3d4d2; }
.copyrights {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem 1rem;
  margin-left: auto;
  min-width: 0;
}
.copyright {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: right;
}
button.copyright {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
}
button.copyright:hover { color: #fff; }
dialog.copyright-pop {
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  max-width: none;
  overflow: visible;
}
dialog.copyright-pop img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; display: block; cursor: pointer; }
dialog.copyright-pop [data-close] {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  border: 0;
  background: #fff;
  color: #221c18;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
dialog.copyright-pop::backdrop { background: rgba(28, 25, 22, 0.82); }
.sections { display: grid; gap: 0.9rem; }
.panel {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 1.3rem 1.3rem 1.15rem;
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: none;
}
.panel:hover { border-color: #c8b39d; }
.num, .kicker { color: var(--accent); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.04em; }
.panel h2 { margin: 0.7rem 0 0.45rem; font-size: clamp(1.45rem, 2vw, 2rem); }
.panel p { margin: 0; color: var(--muted); }
.go { margin-top: auto; padding-top: 1.4rem; }
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem var(--pad);
  background: #221c18;
}
.bar.is-sticky {
  position: sticky;
  top: 0;
  z-index: 6;
}
.gallery-switch { display: flex; gap: 0.35rem; }
.gallery-switch button {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 500;
  padding: 0.28rem 0.85rem;
  cursor: pointer;
}
.gallery-switch button[aria-pressed="true"] {
  background: #fff;
  color: #221c18;
  border-color: #fff;
}
.bar .brand, .back { color: #fff; text-decoration: none; }
.back { font-size: 0.95rem; }
.page { padding: 1.5rem 0 2.5rem; }
.page h1 { margin: 0.3rem 0 0; font-size: clamp(2rem, 5vw, 3.2rem); }
.byline { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.45rem 0 0; color: #a39b93; font-size: 0.88rem; font-weight: 400; }
.lead { margin: 0.85rem 0 0; color: var(--muted); font-size: 1.05rem; }
.timeline { margin-top: 1.5rem; }
.event {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
}
.event time { color: var(--accent); }
.event h2, .card h2, .record h2 { margin: 0 0 0.4rem; font-size: 1.45rem; }
.event p, .card p { margin: 0; white-space: pre-wrap; }
.event p { font-size: 1.05rem; line-height: 1.7; }
.event-photos { display: grid; gap: 0.6rem; margin-top: 0.75rem; }
.event-photos img { width: 100%; height: auto; display: block; }
.cards, .stories { display: grid; gap: 0.9rem; margin-top: 0.8rem; }
.column { margin-top: 2rem; }
.column h2 { margin: 0 0 0.2rem; font-size: 1.55rem; }
.story {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.story .cover { width: 100%; aspect-ratio: 2.35 / 1; object-fit: cover; display: block; background: #ddd; }
.story.is-video .cover { aspect-ratio: 16 / 9; }
.story .pad { padding: 1rem 1rem 1.1rem; }
.story h3 { margin: 0.35rem 0; font-size: 1.25rem; }
.story p { margin: 0; color: var(--muted); }
.story .byline { margin-top: 0.15rem; color: #a39b93; }
.hero-inline { width: 100%; aspect-ratio: 2.35 / 1; object-fit: cover; margin: 0.5rem 0 1rem; display: block; }
.player { width: 100%; max-height: 78vh; margin: 0.4rem 0 1rem; display: block; background: #111; }
.essay + .player { margin-top: 1.5rem; }
.essay { margin-top: 2.6rem; font-size: 1.05rem; line-height: 1.8; }
.essay img { max-width: 100%; height: auto; margin: 1rem 0; }
.essay h2, .essay h3, .essay h4 { margin: 1.4rem 0 0.5rem; line-height: 1.3; }
.essay h2 { font-size: 1.35rem; }
.essay h3 { font-size: 1.2rem; }
.essay h4 { font-size: 1.08rem; }
.essay blockquote { margin: 1rem 0; padding: 0.2rem 0 0.2rem 0.9rem; border-left: 3px solid var(--line); color: var(--muted); }
.essay p { margin: 0.8rem 0; }
.essay ul, .essay ol { margin: 0.8rem 0; padding-left: 1.3rem; }
.essay code { font-family: Consolas, "Source Han Sans SC", monospace; background: #f3eee7; padding: 0.05rem 0.28rem; }
.essay table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.essay th, .essay td { border: 1px solid var(--line); padding: 0.45rem 0.6rem; vertical-align: top; }
.essay th { background: #f6f1ea; }
.card, .record { background: var(--paper); border: 1px solid var(--line); padding: 1.2rem; }
.tag {
  display: inline-block;
  margin-bottom: 0.7rem;
  color: var(--accent);
  font-size: 0.82rem;
}
.tag.pin { margin-right: 0.45rem; }
.sheets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem 1rem;
  margin-top: 1.2rem;
}
.sheet { color: inherit; text-decoration: none; }
.sheet img, .sheet-blank {
  width: 100%;
  height: auto;
  aspect-ratio: 595 / 842;
  object-fit: cover;
  display: block;
  background: #fff;
  border: 6px solid #fff;
  outline: 1px solid rgba(28, 25, 22, 0.12);
  box-shadow: 0 10px 22px rgba(28, 25, 22, 0.16), 0 2px 4px rgba(28, 25, 22, 0.08);
}
.sheet:hover img, .sheet:hover .sheet-blank {
  box-shadow: 0 16px 28px rgba(28, 25, 22, 0.22), 0 2px 4px rgba(28, 25, 22, 0.1);
  transform: translateY(-3px);
}
.sheet img, .sheet-blank { transition: box-shadow 0.15s ease, transform 0.15s ease; }
.sheet-title { display: block; margin-top: 0.55rem; font-size: 0.92rem; font-weight: 700; text-align: center; }
.page.shelf { max-width: 52rem; }
@media (min-width: 760px) {
  .sheets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.text-link { color: var(--accent); }
.photos { display: grid; gap: 0.75rem; }
.photos img { width: 100%; height: auto; display: block; background: #e7e0d6; }
.records { margin-top: 0.5rem; }
.page.board {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  align-self: stretch;
  padding: 0.7rem 1rem 2rem;
}
.page.board h1 { font-size: 1.45rem; }
.page.board .lead { margin: 0.2rem 0 0.75rem; font-size: 0.9rem; }
.page.board .record {
  padding: 0.55rem 0.65rem 0.6rem;
  margin: 0 0 0.7rem;
}
.page.board .record + .record { margin-top: 0; }
.record-line { margin: 0; font-size: 0.82rem; line-height: 1.35; }
.record-line span { color: var(--muted); margin-right: 0.35rem; }
.record-text { margin: 0.28rem 0 0; font-size: 0.92rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; text-indent: 0; }
.record-copy [data-more],
.record-copy [data-less] {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.gallery-group { margin-top: 0; }
.gallery-title { margin: 0; font-size: 0.98rem; display: flex; flex-direction: column; gap: 0.12rem; }
.gallery-title .name-latin { font-style: italic; font-weight: 400; }
.gallery-shot {
  display: block;
  width: 100%;
  margin-top: 0.45rem;
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
}
.gallery-shot img {
  width: auto;
  height: auto;
  max-width: 288px;
  max-height: 288px;
  display: block;
  background: #e7e0d6;
}
[data-gallery-panel="painting"] .gallery-card {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
[data-gallery-panel="painting"] .gallery-shot img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
}
.photo-mark {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 1.7rem;
  margin: 0.35rem 0 0;
}
.photo-tag {
  position: relative;
  padding: 0.02rem 0.28rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  cursor: default;
}
.photo-tag.is-red { background: #c23b33; color: #fff; }
.photo-tag.is-yellow { background: #e2b43a; color: #1c1916; }
.photo-tag.is-green { background: #2f8f4e; color: #fff; }
.photo-note {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.35rem);
  z-index: 4;
  width: max-content;
  max-width: 16rem;
  padding: 0.4rem 0.55rem;
  background: #221c18;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
}
.photo-tag:hover .photo-note,
.photo-tag:focus .photo-note { display: block; }
.gallery-protect,
.gallery-protect img,
dialog.lightbox img.is-protected {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.gallery-protect img { pointer-events: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.thumbs button { border: 0; padding: 0; background: none; cursor: zoom-in; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; display: block; background: #e7e0d6; }
dialog.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: none;
  overflow: visible;
}
dialog.lightbox img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; display: block; }
dialog.lightbox [data-close],
dialog.lightbox [data-prev],
dialog.lightbox [data-next] {
  position: fixed;
  border: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  z-index: 2;
}
dialog.lightbox [data-close] { top: 0.8rem; right: 0.8rem; padding: 0.35rem 0.7rem; }
dialog.lightbox [data-prev],
dialog.lightbox [data-next] { top: 50%; transform: translateY(-50%); padding: 0.7rem 0.85rem; }
dialog.lightbox [data-prev] { left: 0.8rem; }
dialog.lightbox [data-next] { right: 0.8rem; }
dialog.lightbox::backdrop { background: rgba(28, 25, 22, 0.82); }
.hint { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.88rem; }
.upload-progress { margin-top: 0.8rem; }
.picked-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.7rem; }
.picked { margin: 0; width: 96px; }
.picked img { width: 96px; height: 96px; object-fit: cover; display: block; background: #e7e0d6; border: 1px solid var(--line); }
.picked button {
  width: 100%;
  margin-top: 0.3rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.2rem 0;
  cursor: pointer;
}
.picked button:disabled { color: var(--muted); cursor: default; }
.upload-track { height: 8px; background: var(--line); }
.upload-track span { display: block; height: 100%; width: 0; background: var(--ink); }
.submit-slot { display: inline-block; }
dialog.wait {
  border: 1px solid var(--line);
  padding: 1.2rem 1.3rem 1.1rem;
  background: #fff;
  color: var(--ink);
  max-width: 16rem;
}
dialog.wait p { margin: 0 0 0.9rem; }
dialog.wait button {
  border: 0;
  background: var(--ink);
  color: #fff;
  font: inherit;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}
dialog.wait::backdrop { background: rgba(28, 25, 22, 0.35); }
.survey label, .note { display: block; }
.note { color: var(--muted); }
.survey input, .survey textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  color: inherit;
}
.survey textarea { min-height: 8rem; resize: vertical; }
.primary {
  margin-top: 1.2rem;
  padding: 0.75rem 1.15rem;
  border: 0;
  background: var(--ink);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.flash { padding: 0.7rem 0.8rem; background: #fff; border: 1px solid var(--line); }
.flash.error { border-color: var(--accent); color: var(--accent); }
.empty { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 760px) {
  .sections, .cards, .stories { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero { height: 72svh; min-height: 340px; }
  .event { grid-template-columns: 1fr; gap: 0.2rem; }
  .panel { min-height: 0; }
}
@media (min-width: 1100px) {
  .sections { gap: 1rem; }
}
