/* ─ shared.css — Sapiens First ────────────────────────────────────────────
   Single source of truth for design tokens, layout, nav, footer, animations.
   Page-specific rules live in each page's <style> block.
──────────────────────────────────────────────────────────────────────────── */

/* ─── TOKENS ────────────────────────────── */
:root {
  --bg: #faf5ee;
  --surface: rgba(20,18,14,0.05);
  --border: rgba(20,18,14,0.22);
  --text: #141210;
  --text-dim: #141210;
  --accent: #CD551D;
  --blue: #2C56B3;
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Special Elite', serif;

  /* ─── TYPE SCALE ────────────────────────── */
  --sz-label:   13px;   /* meta, buttons, nav labels, small UI  */
  --sz-body:    21px;   /* card text, demand text, body copy     */
  --sz-lead:    28px;   /* body-large, hero body, demand titles  */
  --sz-subhead: 40px;   /* form headings, share headings         */
  /* display sizes use clamp() inline — see .hero-headline, .page-title */
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9999; mix-blend-mode: overlay;
}

main { flex: 1; }

.container {
  max-width: 1020px;
  margin: 0 auto; padding: 0 64px;
  position: relative; z-index: 2;
}

/* ─── NAV ───────────────────────────────── */
.site-nav {
  position: fixed; top: 32px; left: 40px; right: 40px;
  z-index: 100; display: flex; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.nav-wordmark {
  text-decoration: none; display: flex; align-items: center;
  pointer-events: auto; opacity: 0; animation: nav-fade 0.6s ease forwards 0.5s;
}
.nav-wordmark:hover { opacity: 0.72; }
.nav-logo { width: 24px; height: 24px; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 56px; }
.nav-link {
  font-family: var(--font-mono); font-size: 18px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  -webkit-text-stroke: 0.6px var(--accent);
  color: var(--accent); text-decoration: none;
  pointer-events: auto; opacity: 0; animation: nav-fade 0.6s ease forwards 0.5s;
  transition: opacity .2s;
  position: relative;
}
/* ─── NAV UNDERLINE (active page) ──────── */
.nav-underline {
  position: absolute;
  bottom: -6px; left: -2px;
  width: calc(100% + 4px); height: 8px;
  pointer-events: none; overflow: visible;
}

@media (max-width: 768px) { .nav-underline { display: none; } }

.nav-donate {
  border: 1.5px solid var(--accent);
  padding: 7px calc(14px - 0.16em) 3px 14px;
  margin-left: calc(-14px - 1.5px);
  transition: opacity .2s;
}
.nav-donate:hover { opacity: 1; }
.nav-link.active { text-decoration: none; }
@keyframes nav-fade { from { opacity: 0; } to { opacity: 1; } }

/* hide mobile-only links on desktop */
.nav-mobile-only { display: none; }

/* ─── HAMBURGER ─────────────────────────── */
.nav-burger {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; background: none; border: none;
  cursor: pointer; pointer-events: auto; padding: 4px;
  position: relative; z-index: 99;
  opacity: 0; animation: nav-fade 0.6s ease forwards 0.5s;
}
.nav-burger span {
  display: block; width: 22px; height: 2px;
  background: var(--accent);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── EMBER FIELD ───────────────────────── */
.ember-field { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.ember {
  position: absolute; border-radius: 50%; opacity: 0;
  animation: ember-flicker var(--ed, 3s) ease-in-out var(--ey, 0s) infinite;
  box-shadow: 0 0 var(--eg, 3px) var(--ec, #f97316);
}
@keyframes ember-flicker {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  45%, 55% { opacity: var(--ep, 0.75); transform: scale(1.3); }
}

/* ─── PAGE HERO (join / about / donate / guide) ── */
.page-hero {
  display: flex; flex-direction: column; justify-content: center;
  padding: 160px 0;
  position: relative; overflow: hidden;
  background-color: #000;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.title-accent { color: var(--accent); }
.page-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(64px, 9vw, 110px);
  line-height: 0.9; letter-spacing: -0.04em;
  text-transform: uppercase; color: #fff; text-align: center;
  opacity: 0;
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.45s;
}

/* ─── DIVIDER ───────────────────────────── */
.divider { height: 1px; background: var(--border); position: relative; z-index: 2; }

/* ─── SECTIONS ──────────────────────────── */
.section { padding: 110px 0; position: relative; }
.section-label {
  font-family: var(--font-mono);
  font-size: 24px; letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 800;
  -webkit-text-stroke: 0.35px currentColor;
  margin-bottom: 26px;
  text-align: center;
}
.section-label .title { color: var(--accent); }
.body-large {
  font-size: var(--sz-lead); line-height: 1.72;
  font-weight: 400; color: var(--text); margin-bottom: 22px;
  text-align: left; max-width: 80%; margin-left: auto; margin-right: auto;
}
.body-large strong { font-weight: 638; }

/* ─── PILLAR CARDS (3-col left-to-right) ── */
.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 52px;
}
.pillar {
  display: flex; flex-direction: column;
  padding: 26px 28px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 42%, transparent);
  transition: transform 0.25s ease; cursor: default;
}
.pillar:hover { transform: translateY(-3px); }
.pillar-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--sz-body); letter-spacing: 0.04em;
  text-transform: uppercase; margin-bottom: 10px;
  text-align: center;
}
.pillar-text { font-size: var(--sz-body); line-height: 1.75; color: var(--text); font-weight: 500; }

/* ─── NAV DROPDOWN ──────────────────────── */
.nav-dropdown { position: relative; pointer-events: auto; }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 18px); left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(10,8,6,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.13);
  min-width: 158px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}
.nav-dropdown-menu::before {
  content: '';
  position: absolute; top: -5px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 9px; height: 9px;
  background: rgba(10,8,6,0.97);
  border-top: 1px solid rgba(255,255,255,0.13);
  border-left: 1px solid rgba(255,255,255,0.13);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-item {
  display: block; padding: 14px 24px;
  font-family: var(--font-mono); font-size: 15px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.62); text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-dropdown-item:last-child { border-bottom: none; }
.nav-dropdown-item:hover { color: var(--accent); background: rgba(255,255,255,0.05); }
.nav-dropdown-item.active { color: var(--accent); }
.nav-chevron {
  font-size: 0.6em; opacity: 0.55;
  display: inline-block; margin-left: 4px;
  position: relative; top: -3px;
  transition: transform 0.2s ease;
}
.nav-dropdown:hover .nav-chevron { transform: rotate(180deg); }
@media (max-width: 768px) { .nav-dropdown-menu { display: none; } }

/* ─── LEARN MORE LINK ───────────────────── */
.learn-more {
  display: block; margin-top: 28px; text-align: right;
  width: fit-content; margin-left: auto;
  font-family: var(--font-mono); font-size: var(--sz-label);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid var(--accent); padding-bottom: 2px;
  opacity: 0.75; transition: opacity .2s;
}
.learn-more:hover { opacity: 1; }

/* ─── PROGRESS BAR ──────────────────────── */
.progress-bar {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 100%;
  background: var(--accent);
  transform-origin: left center; transform: scaleX(0);
  z-index: 10001; pointer-events: none;
}

/* ─── FOOTER ────────────────────────────── */
.footer { padding: 40px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-logo {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--sz-label); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text); text-decoration: none; flex-shrink: 0;
  transition: color .2s;
}
.footer-logo:hover { color: var(--accent); }
.footer-nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-meta { font-family: var(--font-mono); font-size: var(--sz-label); color: var(--text-dim); letter-spacing: 0.08em; flex-shrink: 0; }
.footer-link { font-family: var(--font-mono); font-size: var(--sz-label); letter-spacing: 0.08em; color: var(--text-dim); text-decoration: none; transition: color .2s; }
.footer-link:hover { color: var(--accent); }

/* ─── JOIN / DONATE SHARED ──────────────── */
.act-wrap {
  max-width: 580px; margin: 0 auto;
  padding: 80px 0 120px;
  display: flex; flex-direction: column; gap: 56px;
}
.act-subhead {
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--sz-subhead); letter-spacing: -0.02em;
  color: var(--text); margin-bottom: 24px; line-height: 0.95;
  text-transform: uppercase; text-align: center;
}
.act-body-lead { font-size: var(--sz-body); line-height: 1.65; color: var(--text); margin-bottom: 16px; }
.act-body-list {
  font-size: var(--sz-body); line-height: 1.65; color: var(--text);
  padding-left: 24px; display: flex; flex-direction: column; gap: 6px;
}
.act-body-list em { font-style: italic; }
.section-rule { height: 1px; background: var(--border); }
.share-heading {
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--sz-subhead); letter-spacing: -0.02em;
  text-transform: uppercase; margin-bottom: 8px; line-height: 1; text-align: center;
}
.share-sub { font-size: var(--sz-body); color: var(--text-dim); margin-bottom: 28px; line-height: 1.6; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.share-btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: var(--sz-label); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 13px 20px;
  text-decoration: none; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text); cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--surface) 100%, transparent); }
.share-btn svg { flex-shrink: 0; }
.share-btn.copy-btn.copied { border-color: #22c55e; color: #22c55e; }
.share-url-row { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 16px; }
.share-url {
  display: inline-block;
  font-family: var(--font-mono); font-size: var(--sz-label);
  letter-spacing: 0.04em; color: var(--text-dim);
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  user-select: all;
}

/* ─── ANIMATIONS ────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.15s; }
.reveal-d2 { transition-delay: 0.30s; }
.reveal-d3 { transition-delay: 0.45s; }

/* ─── RESPONSIVE ────────────────────────── */
@media (max-width: 900px) {
  .pillars { grid-template-columns: 1fr; }
  .pillar:hover { transform: translateY(0); }
}
@media (max-width: 768px) {
  .page-hero { padding: 120px 0 80px; }
  .section { padding: 80px 0; }
  .body-large { font-size: var(--sz-body); }
  .pillar-title, .pillar-text { font-size: 18px; }
  .act-subhead { font-size: 32px; }
  .act-body-lead, .act-body-list { font-size: 18px; }
  .share-heading { font-size: 28px; }
  .nav-burger { display: flex; }
  .nav-links {
    display: flex; position: fixed; inset: 0;
    background: rgba(0,0,0,0.96);
    flex-direction: column; align-items: center; justify-content: center;
    gap: 48px; z-index: 98; pointer-events: none;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  .nav-links.open { opacity: 1; visibility: visible; pointer-events: auto; }
  .nav-links .nav-link {
    font-size: 40px; color: #fff; -webkit-text-stroke: 0;
    opacity: 0; animation: none;
    transform: translateY(14px);
    transition: opacity 0.22s ease, transform 0.22s ease;
  }
  .nav-links.open .nav-link { opacity: 1; transform: translateY(0); }
  .nav-links.open .nav-link:nth-child(2) { transition-delay: 0.06s; }
  .nav-links.open .nav-link:nth-child(3) { transition-delay: 0.12s; }
  .nav-links.open .nav-link:nth-child(4) { transition-delay: 0.18s; }
  .nav-links.open .nav-link:nth-child(5) { transition-delay: 0.24s; }
  .nav-links.open .nav-link:nth-child(6) { transition-delay: 0.30s; }
  .nav-links.open .nav-link:nth-child(7) { transition-delay: 0.36s; }
  .nav-links .nav-link:hover { color: var(--accent); -webkit-text-stroke: 0.4px var(--accent); opacity: 1; }
  .nav-links .nav-link.active { color: var(--accent); }
  .nav-desktop-only { display: none !important; }
  .nav-mobile-only { display: block; }
  .nav-links .nav-dropdown { cursor: default; }
  .nav-links .nav-dropdown:hover { color: var(--text); opacity: 1; }
  .nav-links .nav-donate {
    border: 2px solid #fff; color: #fff; -webkit-text-stroke: 0;
    padding: 16px 40px 8px calc(40px + 0.16em); background: transparent;
  }
  .nav-links .nav-donate:hover { color: var(--accent); border-color: var(--accent); -webkit-text-stroke: 0; }
}
@media (max-width: 600px) {
  .container { padding: 0 20px; }
  .site-nav { left: 20px; right: 20px; top: 20px; }
  .page-title { font-size: clamp(72px, 18vw, 110px); }
  .page-title br { display: none; }
  .body-large { font-size: 18px; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .footer-nav { gap: 14px; }
  .act-wrap { padding: 52px 0 80px; }
  .act-subhead { font-size: 32px; }
  .share-heading { font-size: 26px; }
  .share-buttons { flex-direction: column; }
  .share-btn { justify-content: center; }
}
