:root {
  --page: #0f0e0c;
  --surface: #1a1815;
  --surface-raised: #211e19;
  --ink: #f5efe6;
  --muted: #a69d91;
  --quiet: #81796f;
  --gold: #c9a961;
  --gold-hover: #dfc47f;
  --line: rgba(245, 239, 230, 0.12);
  --line-strong: rgba(245, 239, 230, 0.22);
  --content: 46rem;
  --wide: 74rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 0.35rem;
  background: var(--ink);
  color: var(--page);
  font-weight: 700;
  transform: translateY(-180%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--gold-hover);
  outline-offset: 4px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.75rem;
  padding: 0.9rem var(--gutter);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.back-home {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}

.back-home:hover {
  color: var(--gold-hover);
}

.library-main,
.article-main {
  width: 100%;
}

.library-shell {
  width: min(100%, var(--wide));
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) var(--gutter) 6rem;
}

.library-hero {
  max-width: 54rem;
  margin-bottom: clamp(2.75rem, 6vw, 5rem);
}

.eyebrow,
.article-kicker,
.card-kicker {
  margin: 0 0 0.8rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.library-hero h1,
.article-hero h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.8rem, 7vw, 5.75rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.98;
}

.library-hero .lede {
  max-width: 42rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.22rem);
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(12rem, 0.38fr) auto;
  gap: 0.8rem;
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-group {
  display: grid;
  gap: 0.35rem;
}

.control-group label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.control-group input,
.control-group select,
.clear-button {
  min-height: 2.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.35rem;
  background: #13110f;
  color: var(--ink);
}

.control-group input,
.control-group select {
  width: 100%;
  padding: 0.68rem 0.8rem;
}

.control-group input::placeholder {
  color: #756e65;
}

.clear-button {
  align-self: end;
  padding: 0.68rem 1rem;
  color: var(--gold-hover);
  cursor: pointer;
}

.clear-button:hover {
  border-color: var(--gold);
}

.results-line {
  display: flex;
  gap: 1rem;
  min-height: 2.75rem;
  padding: 0.6rem 0 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.article-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: linear-gradient(150deg, var(--surface-raised), var(--surface));
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
  border-color: rgba(201, 169, 97, 0.6);
  transform: translateY(-3px);
}

.article-card a {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 1.5rem;
  text-decoration: none;
}

.article-card h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.5rem, 2.2vw, 1.9rem);
  font-weight: 500;
  line-height: 1.13;
  overflow-wrap: anywhere;
}

.article-card .excerpt {
  display: -webkit-box;
  margin: 0.9rem 0 1.25rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  color: var(--quiet);
  font-size: 0.76rem;
}

.card-read {
  color: var(--gold-hover);
  font-weight: 650;
}

.no-results {
  padding: 3rem 1.25rem;
  border: 1px dashed var(--line-strong);
  border-radius: 0.55rem;
  color: var(--muted);
  text-align: center;
}

.show-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 2rem;
}

.show-more-button {
  min-height: 2.9rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--gold);
  border-radius: 0.35rem;
  background: transparent;
  color: var(--gold-hover);
  cursor: pointer;
}

.show-more-button:hover {
  background: rgba(201, 169, 97, 0.08);
}

[hidden] {
  display: none !important;
}

.breadcrumb {
  width: min(100%, var(--wide));
  margin: 0 auto;
  padding: 1.2rem var(--gutter) 0;
  color: var(--quiet);
  font-size: 0.8rem;
}

.breadcrumb a {
  color: var(--muted);
  text-underline-offset: 0.2em;
}

.article-shell {
  width: min(100%, var(--wide));
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) var(--gutter) 6rem;
}

.article-hero {
  max-width: 62rem;
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
  border-bottom: 1px solid var(--line);
}

.article-hero h1 {
  max-width: 61rem;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.article-dek {
  max-width: 46rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-top: 1.4rem;
  color: var(--quiet);
  font-size: 0.8rem;
}

.article-layout {
  max-width: var(--content);
  margin-top: clamp(2.75rem, 6vw, 5rem);
}

.article-content {
  min-width: 0;
  color: #e8e0d7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.03rem, 1.5vw, 1.12rem);
  line-height: 1.82;
}

.article-content > :first-child {
  margin-top: 0;
}

.article-content p {
  margin: 0 0 1.3em;
}

.article-content h2,
.article-content h3 {
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  line-height: 1.15;
}

.article-content h2 {
  margin: 2.2em 0 0.55em;
  padding-top: 0.25em;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.article-content h3 {
  margin: 1.65em 0 0.45em;
  color: #ecdcae;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}

.article-content li + li {
  margin-top: 0.45em;
}

.article-content strong {
  color: var(--ink);
}

.article-summary {
  margin: 0 0 2rem;
  padding: 1.25rem 1.35rem;
  border-left: 3px solid var(--gold);
  background: rgba(201, 169, 97, 0.08);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.96rem;
}

.related {
  max-width: var(--content);
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.related h2 {
  margin: 0 0 1rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
}

.related-list {
  display: grid;
  gap: 0.7rem;
  padding: 0;
  list-style: none;
}

.related-list a {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  color: var(--muted);
  text-decoration: none;
}

.related-list a:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.site-footer {
  padding: 2.25rem var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 0.78rem;
  line-height: 1.7;
  text-align: center;
}

.site-footer strong {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-footer a {
  color: var(--muted);
  text-underline-offset: 0.2em;
}

@media (max-width: 900px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 680px) {
  .site-header {
    gap: 1rem;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .clear-button {
    width: 100%;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-card a {
    min-height: 0;
  }

  .article-shell {
    padding-top: 2.25rem;
  }

  .library-shell {
    padding-top: 2.75rem;
  }

  .library-hero {
    margin-bottom: 2.25rem;
  }

  .article-hero h1 {
    font-size: clamp(2.1rem, 10vw, 3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
