/* ==========================================================================
   Commandment Keepers Historical Society — stylesheet
   ========================================================================== */

:root {
  --navy: #12213d;
  --navy-deep: #0a1730;
  --navy-soft: #1c3157;
  --gold: #b9902f;
  --gold-light: #d9b866;
  --cream: #faf7f0;
  --cream-dark: #f1eadb;
  --paper: #ffffff;
  --ink: #201d17;
  --ink-soft: #55524a;
  --ink-faint: #837e70;
  --border: #e5ddc8;
  --border-dark: #2a3e63;

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --max-width: 1120px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(10, 23, 48, 0.08);
  --shadow-sm: 0 4px 14px rgba(10, 23, 48, 0.06);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; margin: 0 0 0.5em; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; }
button { font-family: inherit; }

.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;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: var(--navy-deep);
  padding: 0.75em 1.25em;
  font-weight: 600;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.85em 1.75em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--gold);
  color: var(--navy-deep);
}
.btn-primary:hover { background: var(--gold-light); box-shadow: var(--shadow-sm); }
.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.5);
  color: var(--paper);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-outline {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
  margin-top: 0.5em;
}
.btn-outline:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(185, 144, 47, 0.12);
  border: 1px solid rgba(185, 144, 47, 0.35);
  padding: 0.3em 0.8em;
  border-radius: 999px;
  margin-top: 0.75em;
}

/* ---- Layout helpers ---- */
.section { padding: 6rem 1.5rem; }
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-inner-narrow { max-width: 760px; }
.section-dark { background: var(--navy-deep); color: rgba(255,255,255,0.9); }
.section-cream { background: var(--cream); }

.section-eyebrow {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--gold);
  margin: 0 0 0.75em;
}
.section-eyebrow-light { color: var(--gold-light); }

.section h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  color: var(--navy-deep);
  max-width: 24ch;
}
.light-heading { color: var(--paper); }

.section-intro {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 62ch;
  margin-bottom: 3rem;
}
.section-intro-light { color: rgba(255,255,255,0.75); }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 240, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--navy-deep);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy-deep);
  color: var(--gold-light);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.brand-sub { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }

.primary-nav {
  display: flex;
  gap: 1.75rem;
}
.primary-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy);
  position: relative;
  padding: 0.3em 0;
}
.primary-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.2s ease;
}
.primary-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--navy-deep);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero ---- */
.hero {
  background:
    radial-gradient(circle at 15% 20%, rgba(185,144,47,0.18), transparent 45%),
    linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 55%, var(--navy-soft) 100%);
  color: var(--paper);
  padding: 5.5rem 1.5rem 4rem;
}
.hero-inner {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}
.eyebrow {
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--gold-light);
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.hero-lede {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.8);
  max-width: 62ch;
  margin: 0 auto 2.25rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-chain {
  max-width: var(--max-width);
  margin: 3.5rem auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.hero-chain span { white-space: nowrap; }
.chain-arrow { color: var(--gold); font-weight: 700; }
.chain-final { color: var(--gold-light); font-weight: 700; }

/* ---- Mission strip ---- */
.mission-strip {
  background: var(--cream-dark);
  padding: 2.25rem 1.5rem;
  text-align: center;
}
.mission-strip p {
  max-width: 720px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--navy-deep);
}

/* ---- Story block / quotes ---- */
.story-block {
  max-width: 760px;
  font-size: 1.06rem;
  color: var(--ink-soft);
  margin-bottom: 3.5rem;
}
.pull-quote {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  font-style: italic;
  color: var(--navy-deep);
  border-left: 4px solid var(--gold);
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
}
.pull-quote-charge {
  font-size: 1.2rem;
}

/* ---- Timeline ---- */
.timeline-list {
  list-style: none;
  position: relative;
  max-width: 820px;
}
.timeline-list::before {
  content: '';
  position: absolute;
  left: 96px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1.5rem;
  position: relative;
  padding-bottom: 2.75rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-year {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--gold);
  font-size: 1rem;
  text-align: right;
  padding-top: 0.15rem;
  position: relative;
}
.timeline-year::after {
  content: '';
  position: absolute;
  right: -24px;
  top: 0.4em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--navy-deep);
  border: 3px solid var(--gold);
}
.timeline-content h3 {
  font-size: 1.2rem;
  color: var(--navy-deep);
  margin-bottom: 0.4em;
}
.timeline-content p {
  color: var(--ink-soft);
  margin: 0;
}

/* ---- Founder's Legacy ---- */
.legacy-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: start;
}
.legacy-copy p { color: rgba(255,255,255,0.8); font-size: 1.02rem; }
.legacy-copy strong { color: var(--gold-light); }

.legacy-facts {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 100px;
}
.fact-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.fact-num {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--gold-light);
  margin-bottom: 0.25rem;
}
.fact-label {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}

.legacy-titles {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
}
.legacy-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--paper);
  margin-bottom: 0.5em;
}
.legacy-title {
  font-size: 1rem;
  color: var(--gold-light);
  font-weight: 600;
  margin: 0.2em 0;
}

/* ---- Contributors ---- */
.contributor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.contributor-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.contributor-card h3 {
  font-size: 1.15rem;
  color: var(--navy-deep);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5em;
}
.contributor-card p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin: 0;
}
.contributor-card-compact { background: var(--cream); }
.tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--cream-dark);
  border-radius: 999px;
  padding: 0.25em 0.65em;
}

/* ---- Get Involved ---- */
.involve-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.involve-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.involve-icon {
  font-size: 1.6rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.involve-card h3 { color: var(--navy-deep); font-size: 1.2rem; }
.involve-card p { color: var(--ink-soft); font-size: 0.96rem; flex-grow: 1; }

.placeholder-form {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.placeholder-form-stacked { flex-direction: column; }
.placeholder-form input,
.placeholder-form textarea {
  flex: 1;
  padding: 0.75em 1em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--ink);
  resize: vertical;
}
.placeholder-form input:focus,
.placeholder-form textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  background: var(--paper);
}
.placeholder-form-stacked .btn { align-self: flex-start; }
.form-note {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: var(--navy);
  font-weight: 600;
}

/* ---- Connect ---- */
.connect-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.connect-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--cream);
}
.connect-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.connect-card h3 { color: var(--navy-deep); }
.connect-card p { color: var(--ink-soft); font-size: 0.95rem; }

/* ---- Footer ---- */
.site-footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.65);
  padding: 3rem 1.5rem;
  text-align: center;
}
.footer-brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--paper);
  font-weight: 700;
  margin-bottom: 0.3em;
}
.footer-tagline {
  color: var(--gold-light);
  font-size: 0.9rem;
  margin-bottom: 1.5em;
}
.footer-copy { font-size: 0.82rem; margin: 0; }

/* ---- Reveal animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .legacy-grid { grid-template-columns: 1fr; }
  .legacy-facts { position: static; grid-template-columns: repeat(2, 1fr); }
  .involve-grid { grid-template-columns: 1fr 1fr; }
}

/* Switch to the hamburger nav a bit earlier than the content-stacking
   breakpoint, since the five text nav links wrap awkwardly before the
   layout otherwise needs to go single-column (e.g. iPad portrait). */
@media (max-width: 880px) {
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    display: none;
    box-shadow: var(--shadow);
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: 0.85em 0; border-bottom: 1px solid var(--border); }
  .primary-nav a:last-child { border-bottom: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 760px) {
  .section { padding: 4rem 1.25rem; }
  .contributor-grid { grid-template-columns: 1fr; }
  .involve-grid { grid-template-columns: 1fr; }
  .connect-grid { grid-template-columns: 1fr; }
  .legacy-facts { grid-template-columns: 1fr 1fr; }

  .timeline-list::before { left: 62px; }
  .timeline-item { grid-template-columns: 62px 1fr; gap: 1rem; }
  .timeline-year { font-size: 0.85rem; }
  .timeline-year::after { right: -18px; width: 10px; height: 10px; }
}

@media (max-width: 480px) {
  .hero { padding: 4rem 1.25rem 3rem; }
  .legacy-facts { grid-template-columns: 1fr; }
  .placeholder-form { flex-direction: column; }
}
