:root {
  --paper: #f7f3ea;
  --card: #fffdf8;
  --text: #25211c;
  --muted: #6f665c;
  --accent: #7b4b36;
  --accent-dark: #5c2f22;
  --line: #ddd2c3;
  --shadow: 0 14px 34px rgba(77, 54, 34, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 234, 0.94);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.site-header-inner,
.site-footer-inner,
.site-main {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-logo:hover { text-decoration: none; }

.site-logo-mark {
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--accent);
}

.site-nav,
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
}

.site-nav a,
.footer-nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-main {
  padding: 44px 0 64px;
}

.hero {
  padding: 68px 0 54px;
  border-bottom: 1px solid var(--line);
}

.hero-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
}

.hero-title,
.page-title-block h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1.05;
  font-weight: 500;
}

.hero-subtitle,
.page-title-block p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.12rem;
}

.page-title-block {
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}

.section {
  margin-top: 44px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
}

.section-head .section-title { margin-bottom: 0; }
.section-note { color: var(--muted); }
.section-link { font-size: 0.95rem; }

.search-box {
  max-width: 760px;
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.search-box.large { max-width: 860px; margin-top: 0; }

.search-box input,
.filter-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  outline: none;
}

.search-box input:focus,
.filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123, 75, 54, 0.12);
}

button,
.search-box button,
.chip {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fffdf8;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
}

button:hover,
.search-box button:hover { background: var(--accent-dark); }

.card-grid,
.author-grid,
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.poem-card,
.nav-card,
.author-card,
.year-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.poem-card:hover,
.nav-card:hover,
.author-card:hover,
.year-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.poem-card-author,
.poem-card-year,
.card-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.poem-card-title,
.nav-card-title,
.author-card-title,
.year-card-title {
  display: block;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
  line-height: 1.25;
  margin: 6px 0 8px;
}

.poem-card-description,
.nav-card-text,
.author-card-description,
.year-card-description {
  color: var(--muted);
  margin: 10px 0 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  color: var(--accent);
  background: rgba(123, 75, 54, 0.08);
  border: 1px solid rgba(123, 75, 54, 0.16);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.84rem;
}

.nav-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.nav-cards.compact { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.filter-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.filter-panel label,
.filter-label {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: transparent;
  color: var(--accent);
  padding: 7px 12px;
}

.chip.active,
.chip:hover {
  background: var(--accent);
  color: #fffdf8;
}

.poem-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 0 10px;
}

.poem-header {
  text-align: center;
  margin: 28px auto 42px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.poem-author {
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.poem-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 6vw, 4.2rem);
  line-height: 1.08;
  font-weight: 500;
  color: var(--text);
}

.poem-year {
  color: var(--accent);
  margin-top: 14px;
}

.poem-text {
  max-width: 720px;
  margin: 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.18rem, 2vw, 1.36rem);
  line-height: 1.86;
}

.poem-text p {
  margin: 0 0 1.65em;
}

.poem-meta,
.poem-nav {
  max-width: 720px;
  margin: 34px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.96rem;
}

.poem-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.prose {
  font-size: 1.08rem;
}

.prose.narrow {
  max-width: 760px;
}

.prose h2,
.prose h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.big-link { font-size: 1.2rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 48px;
  color: var(--muted);
}

.site-footer-inner {
  display: grid;
  gap: 14px;
}

.footer-title {
  color: var(--text);
  font-weight: 700;
}

.footer-email { margin: 0; }

.cookie-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  max-width: 860px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: none;
  z-index: 50;
}

.cookie-banner.is-visible { display: block; }
.cookie-banner p { margin: 0 0 12px; color: var(--muted); }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions .secondary { background: transparent; color: var(--accent); }

.loading-message,
.error-message,
.empty-message {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  color: var(--muted);
}

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

@media (max-width: 760px) {
  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
    min-height: 0;
  }

  .site-nav { gap: 10px 14px; }
  .hero { padding: 44px 0 36px; }
  .search-box { flex-direction: column; }
  .nav-cards { grid-template-columns: 1fr; }
  .poem-header { text-align: left; }
  .poem-text { font-size: 1.13rem; line-height: 1.78; }
}

/* v1.1 public-facing refinements */
.hero-home {
  position: relative;
  padding-bottom: 62px;
}

.hero-home::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 28px;
  width: min(360px, 42vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  display: grid;
  gap: 8px;
  min-height: 210px;
  align-content: start;
  background: linear-gradient(180deg, #fffdf8, #fbf6eb);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.feature-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.feature-number {
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.feature-title {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1.1;
}

.feature-text {
  color: var(--muted);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  gap: 26px;
  align-items: start;
}

.card-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-aside {
  position: sticky;
  top: 98px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  box-shadow: var(--shadow);
  color: var(--muted);
}

.home-aside h2 {
  margin-top: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 1.8rem;
}

.text-link {
  display: inline-flex;
  margin-top: 8px;
  font-weight: 600;
}

.letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 24px;
}

.letter-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--accent);
}

.letter-nav a:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.period-list,
.author-directory {
  display: grid;
  gap: 34px;
}

.period-group,
.author-letter-group {
  scroll-margin-top: 100px;
}

.period-group h2,
.author-letter-group h2 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  color: var(--text);
}

.compact-years {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.compact-filter {
  margin-bottom: 22px;
}

.page-help {
  max-width: 760px;
  color: var(--muted);
  font-size: 0.96rem;
  margin-top: 10px;
}

.chip-cloud.is-collapsed {
  max-height: 92px;
  overflow: hidden;
  position: relative;
}

.chip-toggle {
  justify-self: start;
  width: fit-content;
  background: transparent;
  color: var(--accent);
  padding: 7px 12px;
  font-size: 0.92rem;
}

.poem-quick-nav {
  max-width: 720px;
  margin: 0 auto 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.poem-quick-nav a,
.poem-nav a {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 13px;
}

.poem-quick-nav a:hover,
.poem-nav a:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.tag-list.inline {
  display: inline-flex;
  vertical-align: middle;
  margin-top: 0;
}

.prose p {
  color: var(--text);
}

.prose h2 {
  margin-top: 2.2rem;
}

@media (max-width: 900px) {
  .home-feature-grid,
  .home-layout,
  .card-grid.two-col {
    grid-template-columns: 1fr;
  }

  .home-aside {
    position: static;
  }
}

@media (max-width: 760px) {
  .feature-card { min-height: 0; }
  .poem-quick-nav { justify-content: flex-start; }
}
