/* ============================================================
   WHAT IS YOUR EVIDENCE — shared stylesheet
   Palette + type derived from the "Thou Shalt Read the Bible"
   book cover: parchment, oxblood, gold, crimson.
   Signature: forensic "evidence citation" system.
   ============================================================ */

:root {
  --parchment:    #EFE7D6;
  --parchment-2:  #E7DCC6;
  --parchment-3:  #DED0B5;
  --oxblood:      #491417;
  --oxblood-2:    #611B1F;
  --crimson:      #A81E22;
  --gold:         #D69C29;
  --gold-soft:    #E8C36B;
  --ink:          #26201C;
  --stone:        #6E665A;
  --line:         rgba(73, 20, 23, 0.16);
  --line-soft:    rgba(38, 32, 28, 0.12);

  --display: "Archivo", "Arial Narrow", sans-serif;
  --serif:   "Newsreader", Georgia, "Times New Roman", serif;
  --mono:    "Spline Sans Mono", ui-monospace, "SFMono-Regular", monospace;

  --wrap: 1140px;
  --gutter: clamp(1.15rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle paper texture via layered gradients */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(214,156,41,0.10), transparent 55%),
    radial-gradient(100% 80% at -10% 110%, rgba(73,20,23,0.06), transparent 50%);
}

img { max-width: 100%; display: block; }
a { color: var(--crimson); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--crimson);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 1.1rem;
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  background: var(--crimson);
  display: inline-block;
}

h1, h2, h3 { font-family: var(--display); line-height: 0.98; margin: 0; color: var(--oxblood); }
h1 { font-weight: 800; letter-spacing: -0.02em; }
h2 { font-weight: 800; letter-spacing: -0.015em; }
h3 { font-weight: 700; letter-spacing: -0.01em; }

.serif-lead {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.5;
  color: var(--ink);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--parchment) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.85rem;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--oxblood);
  font-size: 1.06rem;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .q {
  color: var(--crimson); font-size: 1.25em; line-height: 0; margin-right: 0.05em;
  display: inline-block; transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.brand:hover .q { transform: rotate(-12deg) scale(1.15); }
.brand .dot { color: var(--gold); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0.55rem 0.85rem;
  border-radius: 3px;
  transition: color 0.2s ease, background 0.2s ease;
  isolation: isolate;
}
/* subtle pill that fades in behind the tab */
.nav-links a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: var(--parchment-3);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: -1;
}
.nav-links a:hover::before { opacity: 1; transform: scale(1); }
/* animated underline drawn from the left */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.28rem;
  height: 2px;
  background: var(--crimson);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s cubic-bezier(0.65,0,0.35,1);
}
.nav-links a:hover { color: var(--oxblood); text-decoration: none; }
.nav-links a:hover::after { transform: scaleX(1); }

/* active tab: crimson, persistent underline, gold marker */
.nav-links a.active { color: var(--crimson); font-weight: 600; }
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left center;
  background: var(--crimson);
  animation: tab-underline 0.4s cubic-bezier(0.65,0,0.35,1);
}
.nav-links a.active::before {
  content: "";
  opacity: 1;
  transform: scale(1);
  background: color-mix(in srgb, var(--gold) 22%, transparent);
}
@keyframes tab-underline {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  color: var(--oxblood);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.85rem 1.35rem;
  border-radius: 3px;
  border: 1.5px solid var(--oxblood);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s;
  line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--oxblood); color: var(--parchment); }
.btn-primary:hover { background: var(--oxblood-2); box-shadow: 0 6px 18px rgba(73,20,23,0.22); }
.btn-gold { background: var(--gold); color: var(--oxblood); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-soft); box-shadow: 0 6px 18px rgba(214,156,41,0.3); }
.btn-ghost { background: transparent; color: var(--oxblood); }
.btn-ghost:hover { background: var(--parchment-3); }
.btn-sm { padding: 0.6rem 1rem; font-size: 0.72rem; }

/* ---------- Sections ---------- */
section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-dark {
  background: var(--oxblood);
  color: var(--parchment);
}
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--parchment); }
.section-dark .eyebrow { color: var(--gold); }
.section-dark .eyebrow::before { background: var(--gold); }
.section-dark a { color: var(--gold-soft); }

/* ---------- Evidence citation (signature) ---------- */
.citation {
  border-left: 3px solid var(--crimson);
  padding: 0.15rem 0 0.15rem 1.25rem;
  margin: 1.75rem 0;
}
.citation .ref {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--crimson);
  margin-bottom: 0.5rem;
}
.citation blockquote,
.citation p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
}
.section-dark .citation { border-color: var(--gold); }
.section-dark .citation .ref { color: var(--gold); }
.section-dark .citation p, .section-dark .citation blockquote { color: var(--parchment); }

/* exhibit tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
}
.tag .num { color: var(--crimson); }

/* ---------- Endorsements / Expert testimony ---------- */
.foreword-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.4rem;
  align-items: center;
  background: var(--parchment-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 2.5rem;
}
.foreword-strip img {
  width: 74px; height: 74px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--gold);
}
.foreword-strip .fw-label {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--crimson);
}
.foreword-strip .fw-name {
  font-family: var(--display); font-weight: 700; color: var(--oxblood);
  font-size: 1.3rem; line-height: 1.1; margin-top: 0.2rem;
}
.foreword-strip .fw-role {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.05em; color: var(--stone);
  margin-top: 0.35rem;
}

.testimony-wall { columns: 3; column-gap: 1.5rem; margin-top: 0.5rem; }
.tcard {
  break-inside: avoid;
  background: var(--parchment-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem 1.5rem 1.35rem;
  margin: 0 0 1.5rem;
}
.tcard .mark {
  font-family: var(--display); font-weight: 800; font-size: 2.4rem;
  color: var(--gold); line-height: 0.5; display: block; margin-bottom: 0.4rem;
}
.tcard blockquote {
  margin: 0; font-family: var(--serif); font-style: italic;
  font-size: 1.02rem; line-height: 1.55; color: var(--ink);
}
.tcard .who {
  display: flex; align-items: center; gap: 0.85rem;
  margin-top: 1.15rem; padding-top: 1.1rem; border-top: 1px solid var(--line);
}
.tcard .avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  object-fit: cover; border: 2px solid var(--oxblood);
}
.tcard .avatar-mono {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--oxblood); color: var(--parchment);
  font-family: var(--display); font-weight: 800; font-size: 1.1rem; letter-spacing: 0.02em;
}
.tcard .name {
  display: block; font-family: var(--display); font-weight: 700;
  color: var(--oxblood); font-size: 1.02rem; line-height: 1.12;
}
.tcard .role {
  display: block; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--stone);
  margin-top: 0.3rem; line-height: 1.35;
}

@media (max-width: 900px) { .testimony-wall { columns: 2; } }
@media (max-width: 600px) {
  .testimony-wall { columns: 1; }
  .foreword-strip { grid-template-columns: 1fr; text-align: left; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--oxblood);
  color: var(--parchment);
  padding-block: 3.5rem 2rem;
}
.site-footer a { color: var(--parchment); }
.site-footer a:hover { color: var(--gold-soft); }
.footer-verse {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: var(--gold-soft);
  max-width: 30ch;
  margin: 0 0 2.5rem;
  line-height: 1.4;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(239,231,214,0.16);
}
.footer-col h4 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
  font-weight: 600;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.55rem; }
.footer-col li a { font-size: 0.95rem; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(239,231,214,0.7);
  flex-wrap: wrap;
}

/* ---------- Utility ---------- */
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.stack > * + * { margin-top: 1.15rem; }
.cluster { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }
.muted { color: var(--stone); }
.mono { font-family: var(--mono); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
/* staggered reveal when --i is set */
.reveal[style*="--i"] { transition-delay: calc(var(--i, 0) * 90ms); }

/* rise-in on page load (above-the-fold hero) */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
.rise {
  opacity: 0;
  animation: rise-in 0.8s cubic-bezier(0.22,0.61,0.36,1) forwards;
  animation-delay: calc(var(--i, 0) * 110ms + 80ms);
}

/* gentle hover lift for cards */
.lift { transition: transform 0.3s cubic-bezier(0.34,1.3,0.64,1), box-shadow 0.3s ease; }
.lift:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(73,20,23,0.15); }

/* floating book cover */
@keyframes book-float {
  0%, 100% { transform: rotate(-1.5deg) translateY(0); }
  50%      { transform: rotate(-1.5deg) translateY(-12px); }
}
.book-float { animation: book-float 6s ease-in-out infinite; will-change: transform; }

/* endorsement cards get a soft hover */
.tcard { transition: transform 0.3s cubic-bezier(0.34,1.3,0.64,1), box-shadow 0.3s ease, border-color 0.3s ease; }
.tcard:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(73,20,23,0.14); border-color: var(--gold); }

/* scroll progress bar (injected by JS) */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--crimson), var(--gold));
  z-index: 60; transition: width 0.08s linear;
  box-shadow: 0 0 8px rgba(214,156,41,0.5);
}

/* header condenses on scroll */
.site-header { transition: padding 0.3s ease, box-shadow 0.3s ease, background 0.3s ease; }
.site-header.scrolled { box-shadow: 0 6px 20px rgba(73,20,23,0.10); }
.site-header.scrolled .nav { padding-block: 0.55rem; }
.nav { transition: padding 0.3s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 0.45rem; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--parchment);
    border-bottom: 1px solid var(--line);
    padding: 0.4rem var(--gutter) 1rem;
    box-shadow: 0 14px 30px rgba(73,20,23,0.12);
    /* animated collapse */
    display: flex;
    overflow: hidden;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.38s cubic-bezier(0.4,0,0.2,1),
                opacity 0.28s ease,
                padding 0.38s ease,
                visibility 0s linear 0.38s;
  }
  .nav-links.open {
    max-height: 34rem;
    opacity: 1;
    visibility: visible;
    padding-top: 0.4rem;
    padding-bottom: 1rem;
    transition: max-height 0.42s cubic-bezier(0.4,0,0.2,1),
                opacity 0.3s ease 0.05s,
                padding 0.42s ease,
                visibility 0s;
  }
  .nav-links a {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid var(--line-soft);
    border-left: 3px solid transparent;
    border-radius: 0;
    /* per-item entrance */
    opacity: 0;
    transform: translateX(-10px);
    transition: color 0.2s ease, background 0.2s ease,
                border-color 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
  }
  .nav-links.open a { opacity: 1; transform: none; }
  .nav-links.open a:nth-child(1) { transition-delay: 0.05s; }
  .nav-links.open a:nth-child(2) { transition-delay: 0.09s; }
  .nav-links.open a:nth-child(3) { transition-delay: 0.13s; }
  .nav-links.open a:nth-child(4) { transition-delay: 0.17s; }
  .nav-links.open a:nth-child(5) { transition-delay: 0.21s; }
  .nav-links.open a:nth-child(6) { transition-delay: 0.25s; }
  .nav-links a::before, .nav-links a::after { display: none; }
  .nav-links a:hover { background: var(--parchment-3); border-left-color: var(--gold); }
  .nav-links a.active {
    border-left-color: var(--crimson);
    background: color-mix(in srgb, var(--gold) 14%, transparent);
  }
  /* hamburger -> X */
  .nav-toggle .bars { position: relative; width: 16px; height: 12px; display: inline-block; }
  .nav-toggle .bars span {
    position: absolute; left: 0; width: 100%; height: 2px; background: currentColor;
    transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
  }
  .nav-toggle .bars span:nth-child(1) { top: 0; }
  .nav-toggle .bars span:nth-child(2) { top: 5px; }
  .nav-toggle .bars span:nth-child(3) { top: 10px; }
  .nav-toggle[aria-expanded="true"] .bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .btn:hover { transform: none; }
  .brand:hover .q { transform: none; }
  .nav-links a::after { transition: none; }
  .nav-links a.active::after { animation: none; }
  .nav-links { transition: none; }
  .nav-links.open a, .nav-links a { transition: color 0.2s ease, background 0.2s ease; transform: none; opacity: 1; }
  .nav-toggle .bars span { transition: none; }
  .rise { animation: none; opacity: 1; }
  .book-float { animation: none; transform: rotate(-1.5deg); }
  .lift:hover, .tcard:hover { transform: none; }
}

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