:root {
  --bg: #ffffff;
  --paper: #fbfaf7;
  --paper-deep: #f4efe6;
  --ink: #191514;
  --muted: #635b54;
  --muted-strong: #3b3430;
  --oxblood: #4b0b16;
  --oxblood-2: #671523;
  --gold: #a88442;
  --gold-soft: #d7c196;
  --line: #e6ded4;
  --line-strong: #cdbd9f;
  --shadow: 0 24px 60px rgba(25, 21, 20, 0.09);
  --header-h: 76px;
  --content: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    url("assets/royal-pattern.svg") repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 248, 244, 0.82));
  background-size: 220px 220px, auto;
  opacity: 0.38;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(75, 11, 22, 0.04) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(75, 11, 22, 0.035) 0 1px, transparent 1px 100%);
  background-size: 96px 96px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.56) 42%, transparent 100%);
  pointer-events: none;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

.sr-only {
  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 {
  position: absolute;
  top: -84px;
  left: 12px;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: var(--oxblood);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: top 180ms ease;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: var(--header-h);
  padding: 0 48px;
  border-bottom: 1px solid rgba(25, 21, 20, 0.18);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  transition: box-shadow 180ms ease, background-color 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 34px rgba(25, 21, 20, 0.07);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  text-decoration: none;
}

.brand-seal {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  background: #fff;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 0 0 5px rgba(168, 132, 66, 0.08);
}

.brand-name {
  color: var(--oxblood);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

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

.primary-nav a {
  position: relative;
  padding: 0.4rem 0;
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--gold);
  transition: transform 180ms ease;
}

.primary-nav a:hover::after,
.primary-nav a.is-active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

.nav-toggle-line {
  width: 20px;
  height: 1px;
  background: currentColor;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--oxblood);
  color: #fff;
  box-shadow: 0 14px 32px rgba(75, 11, 22, 0.18);
}

.button-primary:hover {
  background: var(--oxblood-2);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.76);
  color: var(--oxblood);
}

.button:focus-visible,
.brand-link:focus-visible,
.primary-nav a:focus-visible,
.nav-toggle:focus-visible {
  outline: 3px solid rgba(168, 132, 66, 0.82);
  outline-offset: 3px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 5rem;
  align-items: center;
  width: min(var(--content), calc(100% - 72px));
  min-height: 690px;
  margin: 0 auto;
  padding: 5.4rem 0 4.6rem;
  border-bottom: 1px solid rgba(25, 21, 20, 0.16);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 2rem auto auto -7rem;
  width: 330px;
  height: 520px;
  background:
    repeating-radial-gradient(ellipse at center, rgba(75, 11, 22, 0.09) 0 1px, transparent 1px 9px);
  opacity: 0.34;
  transform: rotate(8deg);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 690px;
}

.hero h1 {
  margin: 0;
  color: var(--oxblood);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 6.6rem;
  font-weight: 700;
  line-height: 0.88;
}

.hero-lede {
  max-width: 610px;
  margin: 2.2rem 0 0;
  padding-top: 1.3rem;
  border-top: 3px solid var(--gold);
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.72rem;
  font-weight: 600;
  line-height: 1.25;
}

.hero-text {
  max-width: 660px;
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.charter-card {
  position: relative;
  z-index: 1;
  min-height: 430px;
  padding: 2.1rem 2rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(251, 250, 247, 0.96)),
    url("assets/royal-pattern.svg") repeat;
  background-size: auto, 160px 160px;
  box-shadow: var(--shadow);
  text-align: center;
}

.charter-card::before,
.charter-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.charter-card::before {
  inset: 12px;
  border: 1px solid rgba(168, 132, 66, 0.36);
  border-radius: 6px;
}

.charter-card::after {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(168, 132, 66, 0.18), transparent 26%, transparent 74%, rgba(168, 132, 66, 0.18)),
    linear-gradient(180deg, rgba(168, 132, 66, 0.16), transparent 22%, transparent 78%, rgba(168, 132, 66, 0.16));
  opacity: 0.2;
}

.charter-seal {
  position: relative;
  z-index: 1;
  width: 172px;
  height: 172px;
  margin: 0 auto 1.2rem;
}

.charter-title {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.charter-copy {
  position: relative;
  z-index: 1;
  max-width: 25ch;
  margin: 1rem auto 0;
  color: var(--muted-strong);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.18rem;
  font-style: italic;
  line-height: 1.45;
}

.charter-meta {
  position: relative;
  z-index: 1;
  margin: 1.35rem 0 0;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.section {
  width: min(var(--content), calc(100% - 72px));
  margin: 0 auto;
}

.section-rule {
  border-bottom: 1px solid rgba(25, 21, 20, 0.16);
}

.section-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding: 2.25rem 0;
}

.section-grid-large {
  grid-template-columns: 82px minmax(0, 1fr) minmax(230px, 0.78fr) minmax(160px, 230px);
}

.governance-grid,
.lineage-grid {
  grid-template-columns: 82px minmax(260px, 0.46fr) minmax(0, 1fr);
}

.section-index {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  color: var(--gold);
}

.section-index span,
.section-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--gold-soft);
  border-radius: 50%;
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.section-index svg,
.continuity-principles svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.section-copy h2,
.continuity-heading h2,
.contact-copy h2 {
  margin: 0;
  color: var(--oxblood);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.section-copy p,
.continuity-heading p,
.contact-copy p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.72;
}

.evidence-list {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line-strong);
  list-style: none;
}

.evidence-list li {
  position: relative;
  padding-left: 2.1rem;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.evidence-list li::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0.52rem;
  width: 6px;
  height: 6px;
  border-top: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
  transform: rotate(45deg);
}

.line-asset {
  width: 100%;
  max-width: 230px;
  height: auto;
  justify-self: end;
  opacity: 0.82;
}

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

.step-card {
  position: relative;
  min-height: 140px;
  padding: 0.4rem 1.5rem 0.4rem 1.3rem;
  border-left: 1px solid var(--line-strong);
}

.step-card:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 1.2rem;
  top: 50%;
  width: 34px;
  height: 1px;
  background: var(--gold);
}

.step-number {
  margin: 0 0 0.35rem;
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1;
}

.step-card h3 {
  margin: 0;
  color: var(--oxblood);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.38rem;
  font-weight: 700;
  text-transform: uppercase;
}

.step-card p:last-child {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.continuity-band {
  margin: 0;
  background:
    linear-gradient(90deg, #3b0610, var(--oxblood), #5c0f1d),
    url("assets/royal-pattern.svg") repeat;
  color: #fff;
}

.continuity-inner {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 2.4rem;
  align-items: center;
  width: min(var(--content), calc(100% - 72px));
  margin: 0 auto;
  padding: 2.45rem 0;
}

.continuity-heading {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 1.1rem;
  align-items: start;
}

.continuity-heading .section-number {
  grid-row: span 2;
  border-color: rgba(215, 193, 150, 0.66);
}

.continuity-heading h2 {
  color: #fff7e8;
}

.continuity-heading p {
  color: rgba(255, 247, 232, 0.78);
}

.continuity-principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.continuity-principles article {
  min-height: 136px;
  padding: 0.4rem 1.25rem;
  border-left: 1px solid rgba(215, 193, 150, 0.46);
  color: var(--gold-soft);
  text-align: center;
}

.continuity-principles svg {
  margin: 0 auto 0.7rem;
}

.continuity-principles h3 {
  margin: 0;
  color: #fff3d9;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.15rem;
  text-transform: uppercase;
}

.continuity-principles p {
  margin: 0.25rem 0 0;
  color: rgba(255, 247, 232, 0.82);
  font-size: 0.84rem;
  line-height: 1.45;
}

.lineage-record {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-left: 1px solid var(--line-strong);
}

.lineage-record article {
  min-height: 150px;
  padding: 0.35rem 1rem 0.35rem 1.3rem;
  border-right: 1px solid var(--line);
}

.record-label {
  margin: 0 0 0.55rem;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.lineage-record h3,
.contact-card h3 {
  margin: 0;
  color: var(--oxblood);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.lineage-record p:last-child,
.contact-card p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.58;
}

.contact-section {
  padding: 3.2rem 0 3.6rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.58fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

.contact-copy {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 1.1rem;
}

.contact-copy .section-number {
  grid-row: span 2;
}

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

.contact-card {
  padding: 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(251, 250, 247, 0.9);
  box-shadow: 0 12px 30px rgba(25, 21, 20, 0.06);
}

.contact-card .button {
  width: 100%;
  margin-top: 1.1rem;
  text-transform: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--content), calc(100% - 72px));
  margin: 0 auto;
  padding: 1.3rem 0 2.2rem;
  border-top: 1px solid rgba(25, 21, 20, 0.16);
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer p {
  margin: 0;
}

.footer-brand {
  color: var(--oxblood);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
}

.js-enabled [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 680ms ease, transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.js-enabled [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 1120px) {
  .site-header {
    padding: 0 30px;
  }

  .primary-nav {
    gap: 1.4rem;
  }

  .hero,
  .section,
  .continuity-inner,
  .site-footer {
    width: min(var(--content), calc(100% - 48px));
  }

  .hero {
    gap: 3rem;
  }

  .hero h1 {
    font-size: 5.4rem;
  }

  .section-grid-large {
    grid-template-columns: 72px minmax(0, 1fr) minmax(240px, 0.84fr);
  }

  .line-asset {
    display: none;
  }

  .governance-grid,
  .lineage-grid {
    grid-template-columns: 72px minmax(230px, 0.45fr) minmax(0, 1fr);
  }

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

  .lineage-record article {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  :root {
    --header-h: 70px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .brand-name {
    font-size: 1.62rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: grid;
    justify-content: stretch;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    border-bottom: 1px solid transparent;
    background: #fff;
    box-shadow: 0 18px 28px rgba(25, 21, 20, 0.08);
    transition: max-height 220ms ease, border-color 220ms ease;
  }

  .site-header.is-open .primary-nav {
    max-height: 360px;
    border-color: rgba(25, 21, 20, 0.16);
  }

  .primary-nav a {
    display: block;
    padding: 1rem 30px;
    border-top: 1px solid var(--line);
  }

  .primary-nav a::after {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 4.2rem 0 3.4rem;
  }

  .hero h1 {
    font-size: 4.6rem;
  }

  .charter-card {
    max-width: 520px;
  }

  .section-grid,
  .section-grid-large,
  .governance-grid,
  .lineage-grid,
  .continuity-inner,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .section-index {
    justify-items: start;
    grid-template-columns: 34px auto;
    align-items: center;
  }

  .evidence-list {
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    padding-top: 1rem;
  }

  .steps,
  .continuity-principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step-card {
    border-top: 1px solid var(--line-strong);
    border-left: 0;
    padding: 1.2rem 1rem;
  }

  .step-card:not(:last-child)::after {
    display: none;
  }

  .continuity-heading,
  .contact-copy {
    grid-template-columns: 34px 1fr;
  }

  .contact-layout {
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 88px;
  }

  .site-header {
    padding: 0 18px;
  }

  .brand-link {
    gap: 0.7rem;
  }

  .brand-seal {
    width: 40px;
    height: 40px;
    font-size: 1.18rem;
  }

  .brand-name {
    font-size: 1.42rem;
  }

  .hero,
  .section,
  .continuity-inner,
  .site-footer {
    width: min(var(--content), calc(100% - 32px));
  }

  .hero {
    padding-top: 3rem;
  }

  .hero::before {
    display: none;
  }

  .hero h1 {
    font-size: 3.48rem;
    line-height: 0.94;
  }

  .hero-lede {
    font-size: 1.34rem;
  }

  .hero-actions,
  .contact-cards,
  .steps,
  .continuity-principles,
  .lineage-record {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .charter-card {
    min-height: auto;
    padding: 1.6rem 1.2rem;
  }

  .charter-seal {
    width: 138px;
    height: 138px;
  }

  .section-grid {
    padding: 1.8rem 0;
  }

  .section-copy h2,
  .continuity-heading h2,
  .contact-copy h2 {
    font-size: 1.86rem;
  }

  .continuity-principles article {
    min-height: auto;
    border-left: 0;
    border-top: 1px solid rgba(215, 193, 150, 0.42);
    padding: 1.1rem 0.5rem;
  }

  .lineage-record {
    border-left: 0;
  }

  .lineage-record article {
    padding: 1rem 0;
    border-right: 0;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .js-enabled [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
