/* ============================================================
   Phanguard — Calm editorial styles
   Light, high-contrast, single reading column. One serif
   (Newsreader) for headings, one sans (Inter) for everything
   else. No mono UI, no decorative grid, no noise/ticker.
   ============================================================ */

:root {
  /* Paper palette — high contrast, warm */
  --paper:      #faf9f6;
  --paper-2:    #f1efe8;
  --ink:        #1a1a1a;
  --ink-soft:   #56544e; /* ~7:1 on paper — safe for small text */
  --ink-muted:  #6f6d66; /* ~4.6:1 — large/secondary text only  */
  --rule:       #e4e1d9;
  --rule-strong:#d4d0c5;
  --accent:     #1b3a5b; /* deep slate blue, used sparingly     */

  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --measure: 68ch;   /* comfortable reading width */
  --wrap:    1080px; /* page frame width          */
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* keep anchor targets clear of the sticky header */
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink-soft);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Links ---- */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ---- Accessibility: focus + skip link ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 100;
  transition: top .15s ease;
}
.skip-link:focus {
  top: 12px;
  color: var(--paper);
}

/* ---- Layout primitives ---- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.measure { max-width: var(--measure); }

.section {
  padding: 88px 0;
  border-top: 1px solid var(--rule);
}
.section:first-of-type { border-top: none; }

.eyebrow {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 18px;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5.5vw, 3.9rem); font-weight: 600; line-height: 1.08; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 20px; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

p { max-width: var(--measure); }
.lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.section-intro { margin-bottom: 48px; }
.section-intro p { color: var(--ink-soft); }

strong { color: var(--ink); font-weight: 600; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 500;
  line-height: 1;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

/* ============================================================
   Header / nav
   ============================================================ */
.notice {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: .85rem;
  text-align: center;
  padding: 9px 16px;
}
.notice a { color: var(--ink); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 246, 0.88);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  font-size: .92rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--paper-2);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px;
  height: 38px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: 96px 0 80px; }
.hero h1 { max-width: 16ch; }
.hero .lead {
  margin-top: 28px;
  max-width: 56ch;
}
.trust-line {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: .9rem;
  color: var(--ink-muted);
}
.trust-line span { white-space: nowrap; }

/* ============================================================
   Generic content blocks
   ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.quote {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  line-height: 1.32;
  color: var(--ink);
  max-width: 22ch;
}

/* Quiet facts list (replaces inflated stat counters) */
.facts {
  margin-top: 8px;
  border-top: 1px solid var(--rule);
}
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.facts dt { color: var(--ink-muted); font-size: .95rem; }
.facts dd { color: var(--ink); font-weight: 500; text-align: right; }

/* Research / FAQ items */
.item {
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}
.item:first-child { border-top: none; }
.item__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.status {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
  border-radius: 100px;
  padding: 4px 11px;
}
.keywords {
  margin-top: 14px;
  font-size: .88rem;
  color: var(--ink-muted);
}

/* Program steps */
.steps { list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 20px;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
}
.steps li:first-child { border-top: none; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ink-muted);
}
.steps h4 { margin-bottom: 6px; }
.steps p { color: var(--ink-soft); }

/* Cards (apply / get involved) */
.card {
  display: flex;
  flex-direction: column;
  padding: 30px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: .98rem; flex: 1; }
.card .btn { margin-top: 24px; align-self: flex-start; }

/* Donate */
.fund-list { list-style: none; margin-top: 20px; }
.fund-list li {
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}
.callout {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 28px;
}
.callout dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.callout dl div:last-child { border-bottom: none; }
.callout dt { color: var(--ink-muted); font-size: .92rem; }
.callout dd { color: var(--ink); font-weight: 500; text-align: right; }

/* ============================================================
   Team page
   ============================================================ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
}
.member { display: flex; flex-direction: column; }
.member__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 22px;
}
.member__name { font-size: 1.3rem; margin-bottom: 4px; }
.member__role {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
}
.member__bio { color: var(--ink-soft); font-size: .98rem; }
.member__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  font-size: .9rem;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 64px 0 48px;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.site-footer .brand { display: inline-block; margin-bottom: 14px; }
.footer-desc { color: var(--ink-soft); font-size: .95rem; max-width: 34ch; }
.footer-col h5 {
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: .95rem; color: var(--ink-soft); text-decoration: none; }
.footer-col a:hover { color: var(--accent); text-decoration: underline; }
.footer-legal {
  grid-column: 1 / -1;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: .85rem;
  color: var(--ink-muted);
}

/* ============================================================
   Motion — visible by default; only hidden once JS confirms it
   can reveal them, and never for reduced-motion users.
   ============================================================ */
html.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
html.js .reveal-d1 { transition-delay: .08s; }
html.js .reveal-d2 { transition-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .grid-2, .grid-3, .team-grid { grid-template-columns: 1fr; gap: 36px; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: 1 / -1; }

  .nav-toggle { display: flex; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 8px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 12px; }
}

@media (max-width: 520px) {
  .section { padding: 64px 0; }
  .hero { padding: 64px 0 56px; }
  .site-footer__inner { grid-template-columns: 1fr; }
}
