:root {
  --paper: #f4f2ed;
  --panel: #e9e6df;
  --ink: #1c1c1c;
  --muted: #625c53;
  --accent: #af4028;
  --line: #dcd9d0;
  --site-bar-height: 4rem;
  --serif: "Noto Serif SC", "Noto Serif CJK SC", "Songti SC", Georgia, serif;
}

@font-face {
  font-family: "Noto Serif SC";
  src: url("/fonts/heritage-serif.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

.homes {
  background: radial-gradient(var(--line) 1px, transparent 1px) 0 0 / 20px 20px;
  font-family: Inter, system-ui, sans-serif;
}

.homes ::selection { background: var(--accent); color: white; }
.homes h1, .homes h2, .homes h3, .site-brand { font-family: var(--serif); }
.homes a { text-decoration: none; }
.homes [id] { scroll-margin-top: calc(var(--site-bar-height) + 1rem); }
.homes .skip { z-index: 3; }

.container, .site-bar-inner { width: min(100% - 3rem, 77rem); margin-inline: auto; }

.site-bar {
  position: fixed;
  z-index: 2;
  inset: 0 0 auto;
  background: rgb(244 242 237 / .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel);
}

.site-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem 2rem;
  min-height: var(--site-bar-height);
}

.site-brand { font-weight: 700; font-size: 1.125rem; letter-spacing: -.025em; }

.site-bar nav, .section-label, .scroll-link, .record-subtitle, .gallery-subtitle,
.endnote-signature {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.site-bar nav { display: flex; gap: .35rem 2rem; color: var(--muted); }
.site-bar nav a { padding-block: .5rem; white-space: nowrap; }

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: calc(var(--site-bar-height) + 2.5rem) 1.5rem 3rem;
}

.hero-inner { width: min(100%, 56rem); }
.hero h1 { font-size: clamp(4rem, 11vw, 8rem); line-height: 1; letter-spacing: -.055em; }

.hero-tagline {
  margin-top: 1.5rem;
  font: italic 400 clamp(1.2rem, 3vw, 1.5rem)/1.6 var(--serif);
  color: var(--muted);
}

.hero-tagline::after {
  content: "";
  display: block;
  width: 6rem;
  height: 1px;
  margin: clamp(1.7rem, 4vw, 3rem) auto;
  background: var(--accent);
}

.hero-note {
  background: rgb(233 230 223 / .5);
  border-inline-start: 4px solid var(--accent);
  padding: clamp(1.25rem, 4vw, 2rem);
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.8;
}

.scroll-link {
  display: inline-block;
  padding: .75rem 0;
  margin-top: clamp(1.75rem, 5vw, 3.25rem);
  color: var(--muted);
}

.exhibition-section {
  padding-block: clamp(4.5rem, 9vw, 8rem);
  border-top: 1px solid var(--panel);
}

.section-heading { margin-bottom: clamp(2.5rem, 6vw, 5rem); }
.section-heading h2 { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.2; }
.section-label { margin-top: 1.25rem; letter-spacing: .29em; color: var(--muted); }
.section-intro { max-width: 42rem; margin-top: 2rem; line-height: 1.8; }

.visually-hidden, .gallery-menu input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.gallery-browser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: clamp(1.5rem, 5vw, 4rem);
  min-inline-size: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.gallery-menu { display: grid; gap: .5rem; }

.gallery-menu label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  padding: .9rem 1.5rem;
  background: white;
  border: 1px solid var(--panel);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 700;
}

.gallery-menu label span { opacity: 0; }
.gallery-menu label:hover, .gallery-menu input:focus-visible + label { border-color: var(--accent); }
.gallery-menu input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; }
.gallery-menu input:checked + label { background: var(--ink); color: white; }
.gallery-menu label:hover span, .gallery-menu input:checked + label span { opacity: 1; }

.gallery-panel {
  position: relative;
  isolation: isolate;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  min-width: 0;
  min-height: 37.5rem;
  padding: clamp(1.5rem, 6vw, 4rem);
  background: white;
  border: 1px solid var(--panel);
  box-shadow: 0 2px 5px rgb(28 28 28 / .06);
}

.gallery-browser:has(#gallery-signal:checked) #panel-signal,
.gallery-browser:has(#gallery-cave:checked) #panel-cave,
.gallery-browser:has(#gallery-egypt:checked) #panel-egypt,
.gallery-browser:has(#gallery-ukiyo:checked) #panel-ukiyo,
.gallery-browser:has(#gallery-ink:checked) #panel-ink,
.gallery-browser:has(#gallery-gothic:checked) #panel-gothic,
.gallery-browser:has(#gallery-impression:checked) #panel-impression { display: flex; }

.gallery-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--pattern);
  opacity: var(--pattern-opacity, .15);
  pointer-events: none;
}

.pattern-signal { --pattern: repeating-radial-gradient(circle, #1c1c1c 0 1px, transparent 1px 4px) 0 0 / 8px 8px; }
.pattern-cave {
  --pattern: linear-gradient(45deg, #8b7355 25%, transparent 25%) 0 0 / 30px 30px,
    linear-gradient(-45deg, #8b7355 25%, transparent 25%) 0 0 / 30px 30px;
}
.pattern-egypt { --pattern: repeating-linear-gradient(90deg, #1c1c1c 0 2px, transparent 2px 15px); --pattern-opacity: .1; }
.pattern-ukiyo { --pattern: radial-gradient(circle at 100% 50%, #af4028, transparent 50%), radial-gradient(circle at 0 50%, #2a4d69, transparent 50%); }
.pattern-ink { --pattern: linear-gradient(to bottom, #1c1c1c, transparent); }
.pattern-ink::before { filter: blur(8px); inset: 8px; }
.pattern-gothic { --pattern: conic-gradient(from 180deg at 50% 50%, #af4028, #1c1c1c, #af4028); --pattern-opacity: .1; }
.pattern-impression { --pattern: repeating-linear-gradient(45deg, #af4028 0 10px, transparent 10px 20px); --pattern-opacity: .08; }

.gallery-copy { max-width: 36rem; font-size: 1.125rem; line-height: 1.8; }
.gallery-copy h3 { font-size: clamp(1.8rem, 3.7vw, 2.25rem); line-height: 1.25; }
.gallery-subtitle { color: var(--accent); margin: .75rem 0 1.75rem; }

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: 1rem clamp(.85rem, 3vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

.action-filled { width: fit-content; background: var(--ink); color: white; }
.action-filled:hover, .action-filled:focus-visible { background: var(--accent); color: white; }

.image-archive, .record-tracks { margin-top: 1.5rem; color: var(--muted); }
.homes summary { cursor: pointer; font-size: .875rem; font-weight: 650; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; margin-top: 1rem; }
.image-grid a { display: grid; place-items: center; padding: .5rem; background: var(--panel); }

.music-section { background: rgb(233 230 223 / .25); }
.record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 8vw, 6rem); }
.record { display: flex; flex-direction: column; }
.record h3 { margin-block: 2.5rem 1rem; font-size: clamp(1.5rem, 3vw, 1.875rem); line-height: 1.35; }
.record p:not(.record-subtitle) { margin-bottom: 2.5rem; line-height: 1.8; }

.record-cover {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  color: #f4f2ed;
  background: linear-gradient(135deg, #a8a29a, #292524);
  box-shadow: 0 26px 44px -22px rgb(28 28 28 / .55);
}

.record-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgb(255 255 255 / .1), transparent 50%, rgb(0 0 0 / .2));
  pointer-events: none;
}

.record-nst .record-cover { background: linear-gradient(135deg, var(--accent), #080808); }
.cover-title { font: 700 clamp(1.6rem, 4.5vw, 2.75rem)/1 var(--serif); letter-spacing: .2em; color: rgb(244 242 237 / .45); }
.record-nst .cover-title { letter-spacing: .5em; }
.cover-action { position: absolute; background: white; color: var(--ink); padding: .75rem 1.5rem; font-weight: 700; opacity: 0; }
.record-cover:hover .cover-action, .record-cover:focus-visible .cover-action { opacity: 1; }

.record-subtitle { color: var(--accent); margin-bottom: 1.5rem; }
.record-nst .record-subtitle { color: var(--muted); }
.action-outline { margin-top: auto; border: 2px solid var(--ink); }
.action-outline:hover, .action-outline:focus-visible { background: var(--ink); color: white; }
.record-tracks ol { padding-inline-start: 1.5rem; font-size: .875rem; }
.record-tracks li { padding-block: .25rem; overflow-wrap: anywhere; }

.methods-section .container { max-width: 61rem; }
.methods-section .section-heading { text-align: center; }
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 4vw, 3rem);
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: method;
}

.method-grid li { padding: clamp(1.25rem, 3vw, 2rem); background: rgb(233 230 223 / .4); border: 1px solid var(--panel); counter-increment: method; }
.method-grid li::before { content: counter(method, decimal-leading-zero); display: block; font: 700 3rem/1 var(--serif); margin-bottom: 1.5rem; }
.method-grid li:first-child::before { color: var(--accent); }
.method-grid h3 { margin-bottom: 1rem; font-size: 1.125rem; }
.method-grid p { font-size: .9rem; line-height: 1.8; color: var(--muted); }

.endnote { padding: clamp(5rem, 11vw, 10rem) 1.5rem; text-align: center; color: var(--paper); background: var(--ink); }
.endnote-inner { max-width: 48rem; margin-inline: auto; }
.endnote h2 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.25; }
.endnote p { max-width: 38rem; margin: 3rem auto; font-size: 1.125rem; line-height: 1.85; font-style: italic; color: #b6afa7; }
.endnote-signature { display: grid; justify-items: center; gap: 1rem; padding-top: clamp(2rem, 6vw, 5rem); border-top: 1px solid #403c36; }
.endnote-signature span { color: #b6afa7; }
.endnote a:hover { color: white; text-decoration: underline; }

@supports not selector(:has(*)) {
  .gallery-browser { display: block; }
  .gallery-menu { display: none; }
  .gallery-panel { display: flex; min-height: auto; margin-bottom: 1rem; }
}

@media (max-width: 56rem) {
  .gallery-browser { grid-template-columns: 1fr; }
  .gallery-menu { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
  .gallery-panel { min-height: 24rem; }
}

@media (max-width: 40rem) {
  :root { --site-bar-height: 5.5rem; }
  .container, .site-bar-inner { width: calc(100% - 2rem); }
  .site-bar-inner { flex-direction: column; justify-content: center; align-items: flex-start; }
  .site-bar nav { width: 100%; justify-content: space-between; gap: .25rem; }
  .site-bar nav span { display: none; }
  .hero-note { text-align: left; }
  .record-grid, .method-grid { grid-template-columns: 1fr; }
  .method-grid { text-align: center; }
}
