:root {
  --navy: #06152f;
  --navy-soft: #0b2348;
  --oxblood: #76151c;
  --gold: #c69a32;
  --gold-light: #e2c46f;
  --gold-text: #76510d;
  --parchment: #f4e7c8;
  --ivory: #fbf8f0;
  --charcoal: #17130f;
  --muted: #5d5548;
  --max-width: 1320px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --shadow: 0 24px 70px rgb(6 21 47 / 22%);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--charcoal);
  background: var(--ivory);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid #f4c95d;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  color: var(--navy);
  background: var(--gold-light);
  border: 2px solid var(--navy);
  border-radius: 4px;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.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;
}

.section-inner,
.header-inner,
.footer-inner {
  width: min(calc(100% - 48px), var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 20;
  min-height: 78px;
  color: var(--ivory);
  background: linear-gradient(90deg, rgb(118 21 28 / 75%), transparent 9%, transparent 91%, rgb(118 21 28 / 75%)), var(--navy);
  border-top: 1px solid var(--gold);
  border-bottom: 3px double var(--gold);
  box-shadow: 0 8px 26px rgb(6 21 47 / 24%);
}

.header-inner {
  min-height: 78px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(28px, 4vw, 72px);
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
}

.brand { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.brand img { width: 50px; height: 50px; object-fit: contain; }

.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(20px, 2.4vw, 38px);
}

.nav-link {
  position: relative;
  padding: 27px 0 23px;
  color: var(--ivory);
  text-decoration: none;
  font-family: var(--serif);
  font-size: .98rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 180ms ease;
}

.nav-link:hover::after,
.nav-link[aria-current='page']::after { transform: scaleX(1); }
.nav-link[aria-current='page'] { color: var(--gold-light); }

.header-record {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 20px;
  color: var(--ivory);
  border: 1px solid var(--gold);
  border-radius: 4px;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  transition: color 180ms ease, background 180ms ease;
}

.header-record:hover { color: var(--navy); background: var(--gold-light); }
.nav-toggle { display: none; }

.ceremonial-hero {
  position: relative;
  min-height: calc(100svh - 78px);
  padding-top: clamp(24px, 3vw, 44px);
  display: grid;
  grid-template-rows: 1fr auto;
  isolation: isolate;
  overflow: hidden;
  background: var(--parchment);
}

.hero-stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('/assets/ceremonial-stage.webp') center top / cover no-repeat;
}

.hero-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 75%, rgb(251 248 240 / 80%));
  pointer-events: none;
}

.hero-content {
  width: min(calc(100% - 80px), 1160px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.title-banner {
  position: relative;
  width: min(100%, 1100px);
  padding: 15px clamp(28px, 5vw, 70px);
  background: linear-gradient(180deg, #fff8e7, var(--parchment));
  border: 1px solid #b78a2d;
  border-radius: 50% 50% 8px 8px / 22% 22% 8px 8px;
  box-shadow: 0 9px 24px rgb(69 44 13 / 14%), inset 0 0 22px rgb(198 154 50 / 13%);
}

.title-banner::before,
.title-banner::after {
  content: '';
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--gold);
}

.title-banner::before { left: 16px; }
.title-banner::after { right: 16px; }

.title-banner h1 {
  margin: 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.9rem);
  line-height: 1.03;
  text-transform: uppercase;
  letter-spacing: .015em;
}

.hero-crest {
  width: clamp(280px, 38vw, 520px);
  margin-top: -4px;
  filter: drop-shadow(0 15px 16px rgb(6 21 47 / 22%));
}

.hero-motto {
  margin: -20px 0 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(.85rem, 1.4vw, 1.12rem);
  font-weight: 700;
  letter-spacing: .09em;
}

.hero-statement {
  max-width: 800px;
  margin: 14px 0 18px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.45vw, 1.2rem);
  line-height: 1.45;
}

.hero-actions,
.record-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 11px 24px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.button:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgb(6 21 47 / 20%); }
.button-primary { color: var(--ivory); background: var(--navy); }
.button-primary:hover { color: var(--navy); background: var(--gold-light); }
.button-secondary { color: var(--navy); background: rgb(251 248 240 / 76%); }
.button-secondary:hover { background: var(--ivory); }
.button-outline-light { color: var(--ivory); background: transparent; }
.button-outline-light:hover { color: var(--navy); background: var(--gold-light); }

.verification-register {
  position: relative;
  width: 100%;
  padding: 16px max(24px, calc((100vw - var(--max-width)) / 2));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  color: var(--navy);
  background: rgb(251 248 240 / 92%);
  border-top: 3px double var(--gold);
  border-bottom: 3px double var(--gold);
  box-shadow: 0 -7px 24px rgb(6 21 47 / 10%);
  font-family: var(--serif);
}

.verification-register p {
  margin: 0;
  padding: 2px 24px;
  text-align: center;
  font-size: clamp(.9rem, 1.35vw, 1.05rem);
}

.verification-register p + p { border-left: 1px solid var(--gold); }
.verification-register span { color: var(--muted); }

.charter-section,
.authority-section {
  color: var(--ivory);
  background: var(--navy);
}

.charter-layout {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(520px, 1.35fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  padding-block: clamp(80px, 9vw, 130px);
}

.charter-copy { position: relative; z-index: 2; }

.section-inscription {
  margin: 0 0 14px;
  color: var(--gold-text);
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .34em;
  text-transform: uppercase;
}

.charter-section .section-inscription,
.authority-section .section-inscription { color: var(--gold-light); }

h2 {
  margin: 0 0 22px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(2.25rem, 5vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -.025em;
}

.charter-section h2,
.authority-section h2 { color: var(--ivory); }
.charter-copy > p:not(.section-inscription) { color: #ddd6c7; max-width: 550px; }
.charter-visual { margin: 0; position: relative; }
.charter-visual img { border: 1px solid rgb(198 154 50 / 52%); box-shadow: var(--shadow); }
.charter-visual figcaption { margin-top: 12px; color: #cfc4ae; font-family: var(--serif); font-style: italic; }

.text-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  font-family: var(--serif);
  font-weight: 700;
}

.text-link-gold { color: var(--gold-light); }
.text-link:hover svg { transform: translateX(4px); }
.text-link svg { transition: transform 180ms ease; }

.foundation-section,
.seal-section,
.record-section,
.disclaimer { padding-block: clamp(82px, 10vw, 150px); }

.section-heading-row {
  display: grid;
  grid-template-columns: 1.25fr .7fr;
  align-items: end;
  gap: 60px;
  padding-bottom: 54px;
  border-bottom: 1px solid rgb(198 154 50 / 58%);
}

.section-heading-row h2 { max-width: 850px; margin-bottom: 0; }
.section-heading-row p { margin: 0 0 8px; color: var(--muted); }
.principle-list { margin: 0 0 38px; }

.principle-list article {
  display: grid;
  grid-template-columns: 70px minmax(220px, .6fr) 1fr;
  gap: 28px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid #d8c9a7;
}

.principle-list span { color: var(--gold-text); font-family: var(--serif); font-style: italic; }
.principle-list h3 { margin: 0; color: var(--navy); font-family: var(--serif); font-size: 1.45rem; }
.principle-list p { margin: 0; color: var(--muted); }

.authority-section { padding-block: clamp(90px, 10vw, 150px); }
.authority-layout { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(60px, 9vw, 140px); }
.authority-copy p { color: #ddd6c7; font-family: var(--serif); font-size: 1.12rem; }
.authority-copy .button { margin-top: 16px; }

.seal-layout { display: grid; grid-template-columns: minmax(300px, .8fr) 1fr; gap: clamp(50px, 8vw, 120px); align-items: center; }
.seal-layout > img { width: min(100%, 530px); justify-self: center; }
.seal-layout p { color: var(--muted); max-width: 680px; }
.seal-notice { color: var(--oxblood) !important; font-family: var(--serif); font-weight: 700; letter-spacing: .06em; }

.record-section { color: var(--ivory); background: linear-gradient(135deg, var(--oxblood), #4b0c12); }
.record-layout { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 60px; }
.record-section .section-inscription { color: var(--gold-light); }
.record-section h2 { color: var(--ivory); }
.record-section p { max-width: 700px; color: #f3e9dd; }
.record-section .button-secondary { color: var(--ivory); background: transparent; }
.record-section .button-secondary:hover { color: var(--navy); background: var(--ivory); }

.disclaimer { padding-block: 70px; background: var(--parchment); border-bottom: 1px solid var(--gold); }
.disclaimer .section-inner { max-width: 980px; text-align: center; }
.disclaimer h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
.disclaimer p { margin: 0; color: var(--muted); }

.page-hero {
  min-height: 540px;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--parchment) url('/assets/ceremonial-stage.webp') center / cover no-repeat;
}

.page-hero h1 { margin: 0; color: var(--navy); font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 5.4rem); line-height: 1; }
.page-hero p { max-width: 760px; margin: 24px auto 0; color: #3f392f; font-family: var(--serif); font-size: 1.16rem; }
.page-hero .page-record { color: var(--gold-text); font-family: var(--sans); font-size: .8rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }

.content-section { padding-block: clamp(78px, 9vw, 132px); }
.reading-width { max-width: 980px; }

.source-callout,
.record-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 54px;
  padding: 24px 28px;
  background: var(--parchment);
  border: 1px solid #d6bd82;
}

.source-callout p,
.record-toolbar p { margin: 0; color: var(--muted); }
.source-callout .button,
.record-toolbar .button { flex: 0 0 auto; }

.provision-list { border-top: 1px solid var(--gold); }
.provision {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 28px;
  padding: 34px 0;
  border-bottom: 1px solid #d8c9a7;
}
.provision > span { padding-top: 7px; color: var(--gold-text); font-family: var(--serif); font-size: 1.08rem; font-style: italic; }
.provision h2 { margin-bottom: 9px; font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.01em; }
.provision p { margin: 0; color: var(--muted); }
.centered-action { margin: 52px auto 0; width: fit-content; }

.principles-reading { background: linear-gradient(180deg, var(--ivory), #f3e8cf); }
.principle-panels { border-top: 1px solid var(--gold); }
.principle-panel {
  display: grid;
  grid-template-columns: 72px minmax(180px, .45fr) 1fr;
  align-items: baseline;
  gap: 30px;
  padding: 34px 0;
  border-bottom: 1px solid #d4c39c;
}
.principle-panel > span { color: var(--gold-text); font-family: var(--serif); font-style: italic; }
.principle-panel h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.5rem); }
.principle-panel p { margin: 0; color: var(--muted); }
.lawful-conduct-note { max-width: 830px; margin: 70px auto 0; padding: 36px; color: var(--ivory); background: var(--navy); border-top: 3px double var(--gold); text-align: center; }
.lawful-conduct-note h2 { color: var(--gold-light); font-size: 2rem; }
.lawful-conduct-note p { margin: 0; color: #ded6c6; }

.record-reading { background: #ebe3d3; }
.record-summary {
  display: grid;
  grid-template-columns: .75fr .75fr 1.5fr;
  margin-bottom: 28px;
  background: var(--ivory);
  border: 1px solid #d6bd82;
  box-shadow: 0 12px 38px rgb(6 21 47 / 10%);
}
.record-summary div { display: grid; gap: 8px; padding: 24px; }
.record-summary div + div { border-left: 1px solid #d6bd82; }
.record-summary span { color: #806329; font-size: .72rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.record-summary strong { color: var(--navy); font-family: var(--serif); font-size: 1.08rem; }
.record-viewer { width: 100%; height: min(80vh, 980px); min-height: 650px; background: white; border: 1px solid #a88a4c; box-shadow: var(--shadow); }
.record-fallback { padding: 60px 28px; text-align: center; }
.record-fallback h2 { font-size: 2rem; }

.crest-detail { display: grid; grid-template-columns: minmax(300px, .9fr) 1fr; align-items: center; gap: clamp(48px, 8vw, 120px); }
.crest-detail figure { margin: 0; text-align: center; }
.crest-detail figcaption { margin-top: 18px; color: #805e1e; font-family: var(--serif); font-weight: 700; letter-spacing: .08em; }
.crest-detail h2 { font-size: clamp(2.2rem, 5vw, 4rem); }
.crest-detail p { color: var(--muted); }

.contact-notice {
  max-width: 900px;
  padding: clamp(38px, 7vw, 80px);
  background: linear-gradient(180deg, #fffaf0, var(--parchment));
  border: 3px double var(--gold);
  box-shadow: var(--shadow);
  text-align: center;
}
.contact-notice h2 { font-size: clamp(2.2rem, 5vw, 4rem); }
.contact-notice > p:not(.section-inscription) { max-width: 720px; margin: 0 auto; color: var(--muted); }
.contact-actions { margin-top: 34px; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }

.site-footer { padding-block: 58px; color: #d8d1c3; background: #030d20; border-top: 3px double var(--gold); }
.footer-inner { display: grid; justify-items: center; gap: 14px; text-align: center; }
.footer-brand { color: var(--ivory); font-size: 1.2rem; }
.footer-brand img { width: 56px; }
.site-footer p { margin: 0; }
.site-footer > .footer-inner > p:nth-of-type(1) { color: var(--gold-light); font-family: var(--serif); letter-spacing: .08em; }
.copyright { max-width: 760px; font-size: .84rem; color: #948b7b; }

@media (max-width: 1040px) {
  .header-inner { grid-template-columns: auto auto 1fr; gap: 18px; }
  .brand { grid-column: 1; grid-row: 1; }
  .nav-toggle { grid-column: 2; grid-row: 1; }
  .header-record { grid-column: 3; grid-row: 1; justify-self: end; }
  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: wrap;
    gap: 0 22px;
    padding-bottom: 12px;
  }
  .js .nav-toggle {
    display: inline-grid;
    width: 44px;
    height: 44px;
    padding: 10px;
    place-content: center;
    gap: 5px;
    color: var(--ivory);
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: 4px;
  }
  .nav-toggle span[aria-hidden='true'] { width: 20px; height: 2px; background: currentColor; }
  .js .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: 14px 24px 22px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--navy);
    border-bottom: 2px solid var(--gold);
  }
  .js .site-nav[data-open] { display: flex; }
  .nav-link { padding: 14px 8px; text-align: center; border-bottom: 1px solid rgb(198 154 50 / 20%); }
  .nav-link::after { display: none; }
  .charter-layout { grid-template-columns: 1fr; }
  .charter-copy { max-width: 720px; }
  .crest-detail { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .section-inner, .header-inner, .footer-inner { width: min(calc(100% - 32px), var(--max-width)); }
  .site-header, .header-inner { min-height: 68px; }
  .brand { font-size: 1.8rem; }
  .brand img { width: 42px; height: 42px; }
  .header-record { display: none; }
  .header-inner { grid-template-columns: 1fr auto; }
  .ceremonial-hero { min-height: auto; padding-top: 26px; }
  .hero-stage { background-position: center top; }
  .hero-stage::before { content: ''; position: absolute; inset: 0; background: rgb(251 248 240 / 24%); }
  .hero-content { width: min(calc(100% - 32px), 620px); }
  .title-banner { padding: 10px 24px; }
  .title-banner h1 { font-size: clamp(1.45rem, 6.7vw, 2.25rem); }
  .hero-crest { width: min(60vw, 250px); margin-top: 2px; }
  .hero-motto { margin-top: -8px; font-size: .7rem; }
  .hero-statement { margin: 8px 0 10px; font-size: .88rem; line-height: 1.35; background: rgb(251 248 240 / 78%); padding: 6px; }
  .hero-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 16px; }
  .hero-actions .button { width: 100%; min-height: 44px; padding: 8px 10px; gap: 6px; font-size: .8rem; line-height: 1.2; }
  .verification-register { grid-template-columns: 1fr; padding: 6px 16px; }
  .verification-register p { padding: 5px 8px; font-size: .8rem; line-height: 1.35; }
  .verification-register p + p { border-left: 0; border-top: 1px solid rgb(198 154 50 / 52%); }
  .charter-layout { min-height: 0; padding-block: 76px; }
  h2 { font-size: clamp(2.2rem, 11vw, 3.5rem); }
  .charter-visual img { min-height: 280px; object-fit: cover; object-position: 60% center; }
  .section-heading-row, .authority-layout, .seal-layout, .record-layout { grid-template-columns: 1fr; gap: 30px; }
  .section-heading-row { padding-bottom: 32px; }
  .principle-list article { grid-template-columns: 42px 1fr; gap: 16px; }
  .principle-list article p { grid-column: 2; }
  .record-actions { justify-content: flex-start; }
  .record-actions .button { width: 100%; }
  .source-callout, .record-toolbar { align-items: stretch; flex-direction: column; }
  .source-callout .button, .record-toolbar .button { width: 100%; }
  .principle-panel { grid-template-columns: 42px 1fr; gap: 16px; }
  .principle-panel p { grid-column: 2; }
  .record-summary { grid-template-columns: 1fr; }
  .record-summary div + div { border-left: 0; border-top: 1px solid #d6bd82; }
  .record-viewer { min-height: 540px; }
  .contact-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
