:root {
  --bg: #F6F1E7;
  --surface: #FFFDF8;
  --surface-alt: #EDE4D3;
  --ink: #162032;
  --ink-muted: #525B6B;
  --gold: #9E7232;
  --gold-soft: rgba(158, 114, 50, 0.14);
  --border: rgba(22, 32, 50, 0.12);
  --shadow: 0 18px 42px rgba(22, 32, 50, 0.08);
  --radius: 16px;
}

html[data-theme="dark"] {
  --bg: #111622;
  --surface: #182032;
  --surface-alt: #202A40;
  --ink: #F2ECE1;
  --ink-muted: #B6B1A6;
  --gold: #D3A45B;
  --gold-soft: rgba(211, 164, 91, 0.18);
  --border: rgba(242, 236, 225, 0.14);
  --shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, .brand strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
}

.sr-only, .skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  z-index: 1000;
  clip: auto;
  border-radius: 8px;
}

.container {
  width: min(1240px, 100% - 32px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-seal {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  border: 1px solid var(--gold);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 1.42rem;
  font-weight: 700;
}

.brand-text small {
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.18s ease;
}

.main-nav a:hover {
  color: var(--gold);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.theme-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

.hero {
  padding: clamp(32px, 5vw, 68px) 0 48px;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold);
}

.hero-copy h1 {
  font-size: clamp(2.25rem, 4.4vw, 3.65rem);
  font-weight: 700;
}

.hero-copy h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
}

.hero-lead {
  margin: 18px 0 26px;
  font-size: 1.04rem;
  color: var(--ink-muted);
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--gold);
  border-color: var(--gold);
  color: #111622;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--gold);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.hero-stats dt {
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.hero-stats dd {
  margin: 4px 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
}

.hero-frame {
  margin: 0;
  padding: 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-frame img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  max-height: 440px;
}

.hero-frame figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 6px 4px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
}

.gallery-section, .poems-section, .essays-section {
  padding: 58px 0;
}

.poems-section {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
}

.section-note {
  margin: 0;
  color: var(--ink-muted);
  max-width: 46ch;
  font-size: 0.94rem;
}

.search-box {
  flex: 1 1 310px;
  max-width: 440px;
}

.search-box input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.chip-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.76rem;
}

.filter-chip.is-active .chip-count {
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
}

.result-status {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.archive-card {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(22, 32, 50, 0.04);
  display: flex;
  flex-direction: column;
}

.card-trigger {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-alt);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card-trigger:hover .card-media img {
  transform: scale(1.04);
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-weight: 600;
  font-size: 0.96rem;
  line-height: 1.38;
}

.load-more-wrap {
  margin-top: 28px;
  text-align: center;
}

.poem-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.poem-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poem-tab {
  text-align: left;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.poem-tab.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.poem-tab strong {
  font-size: 0.95rem;
}

.poem-tab span {
  font-size: 0.8rem;
  opacity: 0.78;
}

.poem-stage {
  padding: clamp(22px, 3.5vw, 38px);
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.poem-stage h3 {
  font-size: 1.9rem;
  margin-bottom: 4px;
}

.poem-poet {
  margin: 0 0 18px;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.92rem;
}

.poem-verses {
  white-space: pre-line;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.28rem;
  line-height: 1.65;
  margin: 0;
}

.essays-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.essay-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.essay-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-weight: 700;
}

.essay-card h3 {
  font-size: 1.5rem;
}

.essay-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.93rem;
  flex: 1;
}

.essay-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.essay-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.btn-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--gold);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.site-footer {
  padding: 34px 0 42px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-inner a {
  color: var(--gold);
  text-decoration: none;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Native <dialog> Modals */
.museum-dialog {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  margin: auto;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(16, 22, 34, 0.78);
  backdrop-filter: blur(6px);
}

.dialog-shell {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 28px);
}

.dialog-head, .dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.dialog-foot {
  border-bottom: 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.dialog-head h3 {
  font-size: 1.45rem;
  margin-top: 4px;
}

.dialog-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.lightbox-stage {
  padding: 18px;
  background: var(--bg);
  display: grid;
  place-items: center;
  overflow: auto;
}

.lightbox-stage img {
  max-height: 62dvh;
  width: auto;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
}

.lightbox-meta {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.dialog-nav {
  display: flex;
  gap: 10px;
}

.essay-body {
  padding: 22px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 1rem;
  line-height: 1.75;
}

.essay-body p {
  margin: 0 0 14px;
}

@media (max-width: 860px) {
  .hero-grid, .poem-shell {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
