:root {
  --parchment: #f6f0e2;
  --parchment-deep: #e1d5bf;
  --ink: #11273b;
  --ink-soft: #23374a;
  --gold: #b7893c;
  --gold-soft: #d4b179;
  --red: #9d3f2e;
  --green: #3f6d63;
  --ash: #6a6257;
  --white: #fffdf8;
  --shadow: 0 18px 60px rgba(17, 39, 59, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: min(1180px, calc(100vw - 3rem));
  --content: min(860px, calc(100vw - 3rem));
  --serif: "Baskerville Old Face", "Palatino Linotype", "Book Antiqua", "Iowan Old Style", serif;
  --sans: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(183, 137, 60, 0.12), transparent 28%),
    linear-gradient(180deg, #fbf7ee 0%, var(--parchment) 48%, #f2ead8 100%);
  line-height: 1.65;
}

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

a {
  color: inherit;
}

main {
  overflow: clip;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.content {
  width: var(--content);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(20px);
  background: rgba(246, 240, 226, 0.82);
  border-bottom: 1px solid rgba(17, 39, 59, 0.08);
}

.site-header__inner {
  width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}

.brand__mark {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(183, 137, 60, 0.95), rgba(157, 63, 46, 0.95));
  color: var(--white);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(157, 63, 46, 0.25);
}

.brand__text {
  display: grid;
  gap: 0.1rem;
}

.brand__title {
  font-family: var(--serif);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.brand__subtitle {
  color: var(--ash);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  text-decoration: none;
  padding: 0.72rem 0.95rem;
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.is-active {
  background: rgba(17, 39, 59, 0.08);
  color: var(--ink);
  transform: translateY(-1px);
}

.hero {
  position: relative;
  padding: 6rem 0 4.5rem;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(17, 39, 59, 0.96), rgba(35, 55, 74, 0.86)),
    url("../img/all-saints-antiphonary.jpg") center/cover no-repeat;
  z-index: -2;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(17, 39, 59, 0.3), rgba(17, 39, 59, 0.82)),
    radial-gradient(circle at 75% 28%, rgba(183, 137, 60, 0.24), transparent 24%);
  z-index: -1;
}

.hero__grid,
.page-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.85fr);
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(246, 240, 226, 0.12);
  border: 1px solid rgba(246, 240, 226, 0.14);
  color: var(--parchment);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
}

.eyebrow--light {
  background: rgba(17, 39, 59, 0.06);
  border-color: rgba(17, 39, 59, 0.08);
  color: var(--ink);
}

.hero h1,
.page-hero h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  line-height: 1.05;
  margin: 0;
}

.hero h1 {
  margin-top: 1.2rem;
  color: var(--white);
  font-size: clamp(3rem, 6vw, 5.8rem);
  letter-spacing: -0.04em;
}

.hero__lead,
.page-hero__lead {
  margin-top: 1.3rem;
  font-size: clamp(1.05rem, 1.9vw, 1.25rem);
  color: rgba(246, 240, 226, 0.88);
  max-width: 50rem;
}

.hero__actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.1rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button--primary {
  color: var(--ink);
  background: linear-gradient(135deg, #d8bb86, var(--gold));
  box-shadow: 0 12px 28px rgba(183, 137, 60, 0.28);
}

.button--secondary {
  color: var(--white);
  background: rgba(246, 240, 226, 0.06);
  border-color: rgba(246, 240, 226, 0.16);
}

.button--light {
  color: var(--ink);
  background: rgba(17, 39, 59, 0.06);
  border-color: rgba(17, 39, 59, 0.08);
}

.hero-card,
.manuscript-card,
.panel,
.timeline-card,
.figure-card,
.source-card,
.quote-card,
.stat-card,
.feature-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 1.3rem;
  background: rgba(246, 240, 226, 0.08);
  border: 1px solid rgba(246, 240, 226, 0.14);
}

.hero-card__art {
  border-radius: calc(var(--radius-lg) - 6px);
  overflow: hidden;
  min-height: 25rem;
  position: relative;
  background:
    linear-gradient(180deg, rgba(17, 39, 59, 0.18), rgba(17, 39, 59, 0.72)),
    url("../img/halo-constellation.svg") center/cover no-repeat;
}

.hero-card__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  opacity: 0.38;
}

.hero-card__caption {
  margin-top: 1rem;
  color: rgba(246, 240, 226, 0.82);
  font-size: 0.92rem;
}

.hero-card__caption strong {
  display: block;
  color: var(--white);
  font-family: var(--serif);
  font-size: 1.1rem;
}

.page-hero {
  padding: 5rem 0 3rem;
  position: relative;
}

.page-hero--ink {
  background:
    linear-gradient(180deg, rgba(17, 39, 59, 0.97), rgba(17, 39, 59, 0.88)),
    url("../img/manuscript-wave.svg") center/cover no-repeat;
  color: var(--white);
}

.page-hero--parchment {
  background:
    linear-gradient(180deg, rgba(246, 240, 226, 0.94), rgba(232, 220, 196, 0.86)),
    url("../img/manuscript-wave.svg") center/cover no-repeat;
}

.page-hero h1 {
  margin-top: 1rem;
  font-size: clamp(2.7rem, 5vw, 4.9rem);
  letter-spacing: -0.04em;
}

.page-hero--ink .page-hero__lead {
  color: rgba(246, 240, 226, 0.9);
}

.page-hero__meta {
  display: grid;
  gap: 0.8rem;
  padding: 1.3rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.page-hero--parchment .page-hero__meta {
  background: rgba(17, 39, 59, 0.04);
  border-color: rgba(17, 39, 59, 0.08);
}

.section {
  padding: 4.75rem 0;
}

.section--tight {
  padding-top: 2rem;
}

.section--ink {
  background:
    radial-gradient(circle at top left, rgba(183, 137, 60, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(17, 39, 59, 0.98), rgba(17, 39, 59, 0.92));
  color: var(--white);
}

.section--highlight {
  background:
    linear-gradient(180deg, rgba(225, 213, 191, 0.44), rgba(246, 240, 226, 0.76)),
    url("../img/manuscript-wave.svg") center/cover no-repeat;
}

.section-intro {
  max-width: 52rem;
  margin-bottom: 2rem;
}

.section-intro h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.03em;
  margin-top: 0.7rem;
}

.section-intro p {
  font-size: 1.05rem;
  color: inherit;
  opacity: 0.88;
}

.card-grid {
  display: grid;
  gap: 1.25rem;
}

.card-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.feature-card,
.stat-card,
.panel,
.timeline-card,
.figure-card,
.source-card,
.quote-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 39, 59, 0.08);
  padding: 1.4rem;
}

.section--ink .feature-card,
.section--ink .timeline-card,
.section--ink .quote-card {
  background: rgba(246, 240, 226, 0.08);
  border-color: rgba(246, 240, 226, 0.12);
}

.feature-card h3,
.panel h3,
.timeline-card h3,
.figure-card h3,
.source-card h3,
.quote-card h3 {
  font-size: 1.45rem;
}

.feature-card p,
.panel p,
.timeline-card p,
.figure-card p,
.source-card p,
.quote-card p,
.stat-card p,
li {
  color: rgba(17, 39, 59, 0.84);
}

.section--ink .feature-card p,
.section--ink .timeline-card p,
.section--ink .quote-card p,
.section--ink li {
  color: rgba(246, 240, 226, 0.84);
}

.feature-card__number,
.timeline-card__date,
.stat-card__label,
.figure-card__tag,
.source-card__type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(183, 137, 60, 0.14);
  color: var(--red);
  font-weight: 700;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.stat-card {
  background: rgba(246, 240, 226, 0.08);
  border: 1px solid rgba(246, 240, 226, 0.12);
}

.section--highlight .stat-card {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(17, 39, 59, 0.08);
}

.stat-card strong {
  font-family: var(--serif);
  display: block;
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 0.3rem;
}

.manuscript-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.manuscript-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(17, 39, 59, 0.08);
}

.manuscript-card img {
  width: 100%;
  height: 100%;
  min-height: 26rem;
  object-fit: cover;
}

.manuscript-card__body {
  padding: 1.35rem;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(183, 137, 60, 0), rgba(183, 137, 60, 0.75), rgba(183, 137, 60, 0));
}

.timeline-card {
  margin-left: 2.6rem;
  position: relative;
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: -1.95rem;
  top: 1.25rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--parchment);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.pillar {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(246, 240, 226, 0.08);
  border: 1px solid rgba(246, 240, 226, 0.12);
}

.pillar strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.4rem;
  margin-bottom: 0.45rem;
}

.figure-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
}

.filter-button {
  border: 1px solid rgba(17, 39, 59, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.72rem 0.95rem;
  cursor: pointer;
  font: inherit;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.filter-button.is-active,
.filter-button:hover,
.filter-button:focus-visible {
  transform: translateY(-1px);
  background: rgba(183, 137, 60, 0.16);
  border-color: rgba(183, 137, 60, 0.36);
}

.figure-card {
  display: grid;
  gap: 0.7rem;
}

.figure-card.is-hidden {
  display: none;
}

.figure-card ul,
.panel ul,
.source-card ul {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
}

.media-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.image-stack {
  display: grid;
  gap: 1rem;
}

.image-stack figure,
.wide-image figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(17, 39, 59, 0.08);
  box-shadow: var(--shadow);
  background: var(--white);
}

.image-stack img,
.wide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-stack figcaption,
.wide-image figcaption {
  padding: 0.9rem 1.1rem 1.1rem;
  font-size: 0.92rem;
  color: var(--ash);
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.quote-card blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.35;
}

.quote-card cite {
  display: block;
  margin-top: 1rem;
  color: var(--ash);
  font-style: normal;
}

.source-list {
  display: grid;
  gap: 1rem;
}

.source-card a {
  color: var(--red);
  font-weight: 600;
}

.note {
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--gold);
  background: rgba(183, 137, 60, 0.1);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.site-footer {
  padding: 2rem 0 3rem;
  color: rgba(246, 240, 226, 0.8);
  background: var(--ink);
}

.site-footer__inner {
  width: var(--container);
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
}

.site-footer h2 {
  font-size: 1.4rem;
}

.site-footer p {
  margin: 0.4rem 0 0;
  max-width: 42rem;
}

.site-footer__meta {
  text-align: right;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 30;
  background: var(--white);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border-radius: 999px;
}

@media (max-width: 980px) {
  .hero__grid,
  .page-hero__grid,
  .manuscript-layout,
  .media-band,
  .card-grid--three,
  .card-grid--two,
  .pillars,
  .stat-row,
  .quote-grid {
    grid-template-columns: 1fr;
  }

  .hero-card__art {
    min-height: 18rem;
  }

  .site-header__inner,
  .site-footer__inner {
    align-items: flex-start;
  }

  .site-footer__meta {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .site-header__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 4.5rem;
  }

  .hero h1,
  .page-hero h1,
  .section-intro h2 {
    max-width: 15ch;
  }
}

@media (max-width: 1024px) {
  html,
  body {
    overflow-x: hidden;
  }

  .container,
  .content,
  .site-header__inner,
  .site-footer__inner {
    width: min(100% - 2rem, 1180px);
  }

  .brand__title,
  .brand__subtitle,
  .nav a,
  .button,
  .hero h1,
  .page-hero h1,
  h2,
  h3,
  p,
  li {
    overflow-wrap: anywhere;
  }

  .nav a,
  .button,
  .filter-button {
    min-height: 44px;
  }

  .hero,
  .page-hero,
  .section {
    padding-block: clamp(3rem, 8vw, 4.75rem);
  }

  .hero-card__art,
  .manuscript-card img {
    min-height: clamp(16rem, 42vw, 24rem);
  }
}

@media (max-width: 768px) {
  .site-header__inner {
    gap: 0.75rem;
  }

  .nav {
    gap: 0.35rem;
  }

  .nav a {
    padding: 0.68rem 0.8rem;
  }

  .hero {
    padding-top: 3.8rem;
  }

  .hero h1,
  .page-hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.6rem);
    max-width: 100%;
  }

  .hero__actions,
  .figure-toolbar {
    gap: 0.7rem;
  }
}

@media (max-width: 480px) {
  .container,
  .content,
  .site-header__inner,
  .site-footer__inner {
    width: min(100% - 1.25rem, 1180px);
  }

  .brand {
    align-items: flex-start;
  }

  .brand__subtitle {
    letter-spacing: 0.08em;
  }

  .hero-card,
  .panel,
  .timeline-card,
  .figure-card,
  .source-card,
  .quote-card,
  .stat-card,
  .feature-card,
  .page-hero__meta {
    padding: 1.1rem;
    border-radius: var(--radius-md);
  }

  .timeline-card {
    margin-left: 1.8rem;
  }

  .timeline-card::before {
    left: -1.55rem;
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  html,
  body,
  main {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    text-size-adjust: 100%;
  }

  .site-header__inner {
    gap: 0.65rem;
    padding-block: 0.75rem;
  }

  .nav {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .nav a,
  .button,
  .filter-button {
    width: 100%;
    min-height: 48px;
    text-align: center;
  }

  .hero,
  .page-hero {
    padding-block: 3rem 2.2rem;
  }

  .hero__grid,
  .page-hero__grid {
    gap: 1.15rem;
  }

  .hero h1,
  .page-hero h1,
  .section-intro h2 {
    max-width: 100%;
    font-size: clamp(2.15rem, 12vw, 3.05rem);
    line-height: 1.04;
  }

  .hero__lead,
  .page-hero__lead {
    font-size: 1rem;
  }

  .hero__actions,
  .figure-toolbar {
    display: grid;
    gap: 0.7rem;
  }

  .hero-card__art,
  .manuscript-card img,
  .figure-card img {
    width: 100%;
    max-height: 56vh;
    object-fit: cover;
    object-position: center;
  }

  .section,
  .content-section {
    content-visibility: auto;
    contain-intrinsic-size: 1px 760px;
  }
}
