/* ============ Brace America ============ */
:root {
  --navy: #0a1f44;
  --navy-deep: #071633;
  --red: #b22234;
  --gold: #d9a441;
  --gold-bright: #f0c16b;
  --cream: #faf6ee;
  --parchment: #f3ead7;
  --ink: #22303f;
  --muted: #5b6b7d;
  --white: #ffffff;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --old-serif: "IM Fell English", Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container.narrow { max-width: 820px; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 2rem;
  background: rgba(7, 22, 51, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--red);
}
.brand {
  display: flex; align-items: baseline; gap: 0.5rem;
  text-decoration: none; color: var(--white);
  font-family: var(--serif); font-size: 1.35rem; font-weight: 700;
}
.brand-mark { color: var(--gold); font-size: 1.1rem; }
.brand-name em { color: var(--gold-bright); font-style: italic; }
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a {
  color: rgba(255, 255, 255, 0.85); text-decoration: none;
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.03em;
  text-transform: uppercase; padding-bottom: 4px;
  border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover { color: var(--gold-bright); border-color: var(--gold); }
.nav-toggle {
  display: none; background: none; border: none; color: var(--white);
  font-size: 1.5rem; cursor: pointer;
}

/* ---------- Hero ---------- */
.hero, .page-hero {
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 50% -20%, #16335f 0%, var(--navy) 45%, var(--navy-deep) 100%);
  color: var(--white); text-align: center;
  padding: 6.5rem 1.5rem 5.5rem;
}
.hero-stars {
  position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 12% 22%, #fff 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 28% 64%, rgba(255,255,255,.8) 60%, transparent 61%),
    radial-gradient(2px 2px at 44% 18%, rgba(240,193,107,.9) 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 63% 42%, rgba(255,255,255,.7) 60%, transparent 61%),
    radial-gradient(2px 2px at 78% 70%, #fff 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 88% 28%, rgba(240,193,107,.8) 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 8% 80%, rgba(255,255,255,.6) 60%, transparent 61%),
    radial-gradient(2px 2px at 55% 84%, rgba(255,255,255,.75) 60%, transparent 61%);
}
.hero-inner { position: relative; max-width: 820px; margin: 0 auto; }
.hero-kicker {
  color: var(--gold-bright); font-weight: 600; letter-spacing: 0.35em;
  text-transform: uppercase; font-size: 0.85rem; margin-bottom: 1.25rem;
}
.hero-title {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.12;
  margin-bottom: 1.25rem;
}
.hero-sub {
  font-size: 1.2rem; font-weight: 300; color: rgba(255, 255, 255, 0.88);
  max-width: 640px; margin: 0 auto 2.25rem;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-stripes {
  position: absolute; bottom: 0; left: 0; right: 0; height: 14px;
  background: repeating-linear-gradient(
    to bottom,
    var(--red) 0 7px, var(--white) 7px 14px);
  opacity: 0.9;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 0.85rem 1.9rem; border-radius: 4px;
  font-weight: 700; text-decoration: none; letter-spacing: 0.04em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--navy-deep); box-shadow: 0 4px 18px rgba(217, 164, 65, 0.35);
}
.btn-gold:hover { box-shadow: 0 6px 24px rgba(217, 164, 65, 0.5); }
.btn-ghost {
  border: 2px solid rgba(255, 255, 255, 0.6); color: var(--white);
}
.btn-ghost:hover { border-color: var(--gold-bright); color: var(--gold-bright); }

/* ---------- Preamble ---------- */
.preamble {
  background: var(--parchment);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.7), transparent 70%);
  padding: 5rem 0; text-align: center;
  border-bottom: 4px double #c9b98f;
}
.section-eyebrow {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  color: var(--red); font-size: 1.4rem; margin-bottom: 2rem;
}
.preamble-text {
  font-family: var(--old-serif); font-size: clamp(1.25rem, 2.6vw, 1.65rem);
  line-height: 1.9; color: #3a2f1b; text-align: left;
}
.drop-cap {
  float: left; font-family: var(--serif); font-weight: 900;
  font-size: 4.4rem; line-height: 0.8; padding: 0.35rem 0.6rem 0 0;
  color: var(--red);
}
.preamble-attribution {
  margin-top: 2rem; font-style: italic; color: #7a6a48; font-size: 0.95rem;
}

/* ---------- Sections ---------- */
.section-title {
  font-family: var(--serif); font-weight: 700; text-align: center;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin-bottom: 2.5rem;
}
.why, .study, .resources { padding: 5rem 0; }
.why { background: var(--cream); }
.study { background: var(--parchment); }
.resources { background: var(--cream); }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--white); border-radius: 10px; padding: 1.9rem 1.6rem;
  box-shadow: 0 2px 14px rgba(10, 31, 68, 0.08);
  border-top: 4px solid var(--red);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(10, 31, 68, 0.14); }
.card-icon { font-size: 2rem; margin-bottom: 0.8rem; }
.card h3 { font-family: var(--serif); margin-bottom: 0.6rem; color: var(--navy); }
.card p { color: var(--muted); font-size: 0.98rem; }
.link-card { text-decoration: none; display: block; }
.link-card:hover h3 { color: var(--red); }

.pull-quote {
  margin: 3.5rem auto 0; max-width: 720px; text-align: center;
  font-family: var(--serif); font-style: italic; font-size: 1.45rem;
  color: var(--navy); line-height: 1.6;
}
.pull-quote cite {
  display: block; margin-top: 0.9rem; font-family: var(--sans);
  font-style: normal; font-size: 0.9rem; color: var(--muted); letter-spacing: 0.08em;
}

/* ---------- Amendments teaser (home) ---------- */
.amendment-teaser {
  background: linear-gradient(180deg, var(--navy-deep), var(--navy));
  color: var(--white); padding: 5rem 0;
}
.section-title.light { color: var(--gold-bright); }
.teaser-lead {
  text-align: center; max-width: 680px; margin: -1.2rem auto 2.5rem;
  color: rgba(255, 255, 255, 0.85); font-size: 1.1rem; font-weight: 300;
}
.teaser-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.7rem;
}
.teaser-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.15rem; padding: 0.7rem 0.3rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(240, 193, 107, 0.25); border-radius: 8px;
  color: var(--white); text-decoration: none; text-align: center;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.teaser-chip:hover { background: rgba(217, 164, 65, 0.18); border-color: var(--gold); transform: translateY(-2px); }
.teaser-chip .num {
  font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--gold-bright);
}
.teaser-chip .label { font-size: 0.66rem; line-height: 1.25; color: rgba(255,255,255,.75); }
.teaser-cta { text-align: center; margin-top: 2.5rem; }

/* ---------- Study guide ---------- */
.study-steps { max-width: 720px; margin: 0 auto; padding-left: 1.4rem; }
.study-steps li {
  font-size: 1.08rem; margin-bottom: 1.1rem; padding-left: 0.5rem;
  color: #4a3d24;
}
.study-steps li::marker { color: var(--red); font-weight: 700; font-size: 1.15rem; }

/* ---------- Amendments page ---------- */
.toc {
  background: var(--navy-deep); padding: 1.4rem 0;
  border-bottom: 3px solid var(--red);
}
#tocGrid {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
}
.toc-chip {
  display: inline-block; min-width: 44px; text-align: center;
  padding: 0.35rem 0.65rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.07); color: var(--gold-bright);
  text-decoration: none; font-weight: 700; font-size: 0.9rem;
  border: 1px solid rgba(240, 193, 107, 0.3);
  transition: background 0.15s, color 0.15s;
}
.toc-chip:hover { background: var(--gold); color: var(--navy-deep); }

.amendments-main { padding: 4rem 0 5rem; }
.era-title {
  font-family: var(--serif); font-size: 1.9rem; color: var(--navy);
  margin: 3.5rem 0 0.4rem; padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--red);
}
.era-title:first-child { margin-top: 0; }
.era-title span { color: var(--red); font-size: 1.1rem; font-weight: 500; }
.era-note { color: var(--muted); font-style: italic; margin-bottom: 2rem; }

.amendment {
  display: grid; grid-template-columns: 84px 1fr; gap: 1.4rem;
  background: var(--white); border-radius: 10px;
  padding: 1.9rem 1.8rem; margin-bottom: 1.4rem;
  box-shadow: 0 2px 12px rgba(10, 31, 68, 0.07);
  border-left: 5px solid var(--navy);
  scroll-margin-top: 90px;
}
.amendment:target { border-left-color: var(--gold); animation: flash 1.2s ease; }
@keyframes flash {
  0% { box-shadow: 0 0 0 4px rgba(217, 164, 65, 0.55); }
  100% { box-shadow: 0 2px 12px rgba(10, 31, 68, 0.07); }
}
.amendment-num {
  font-family: var(--serif); font-weight: 900; font-size: 2.6rem;
  color: var(--red); text-align: center; line-height: 1;
  border-right: 1px solid #eadfca; padding-right: 1rem;
}
.amendment-body h3 {
  font-family: var(--serif); color: var(--navy);
  font-size: 1.3rem; margin-bottom: 0.8rem;
}
.amendment-body h3 em { font-weight: 500; color: var(--muted); font-size: 1rem; }
.official-text {
  font-family: var(--old-serif); font-style: italic;
  background: var(--parchment); border-radius: 6px;
  padding: 1rem 1.2rem; color: #3a2f1b; font-size: 1.02rem; line-height: 1.75;
  margin-bottom: 0.9rem;
}
.plain-english { color: var(--muted); font-size: 1rem; }
.plain-english strong { color: var(--navy); }

.amendment-cta {
  text-align: center; margin-top: 4.5rem; padding: 2.5rem 1.5rem;
  background: linear-gradient(180deg, var(--navy), var(--navy-deep));
  border-radius: 12px; color: var(--white);
}
.amendment-cta h2 { font-family: var(--serif); color: var(--gold-bright); margin-bottom: 0.7rem; }
.amendment-cta p { color: rgba(255,255,255,.85); margin-bottom: 1.6rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: rgba(255, 255, 255, 0.8); }
.footer-stripes {
  height: 10px;
  background: repeating-linear-gradient(to bottom, var(--red) 0 5px, var(--white) 5px 10px);
  opacity: 0.85;
}
.footer-inner { text-align: center; padding: 2.6rem 1.5rem 3rem; }
.footer-brand {
  font-family: var(--serif); font-weight: 700; font-size: 1.2rem;
  color: var(--gold-bright); margin-bottom: 0.6rem;
}
.footer-links { margin: 1.1rem 0; }
.footer-links a { color: rgba(255,255,255,.75); text-decoration: none; }
.footer-links a:hover { color: var(--gold-bright); }
.footer-quote { font-style: italic; font-size: 0.9rem; color: rgba(255,255,255,.5); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--navy-deep);
    border-bottom: 3px solid var(--red); padding: 0.5rem 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { text-align: center; }
  .nav-links a { display: block; padding: 0.8rem 0; border-bottom: none; }
  .amendment { grid-template-columns: 1fr; }
  .amendment-num {
    border-right: none; border-bottom: 1px solid #eadfca;
    padding: 0 0 0.6rem; text-align: left;
  }
}
