/* ============================================================
   Hearth & Code — Shared Stylesheet
   All pages link to this file. Page-specific styles live in
   inline <style> blocks within each page.
   ============================================================ */

/* ── Variables ───────────────────────────────────────────── */
:root {
  --bg:         #1C1714;
  --bg-raised:  #2A2320;
  --wood:       #4A3528;
  --wood-light: #5C4332;
  --wood-dark:  #2E2118;
  --amber:      #E8923C;
  --gold:       #F4B860;
  --forge:      #C25A2A;
  --teal:       #5E7E78;
  --cream:      #F2E7D5;
  --ash:        #B8A892;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* ── Base body ───────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Vignette ────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse 90% 80% at 30% 50%,
    transparent 35%,
    rgba(18, 12, 8, 0.55) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Full-page ambient firelight glow ────────────────────── */
#page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

#page-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 60% 75% at 8% 100%,
      rgba(232, 146, 60, 0.17) 0%,
      rgba(194, 90, 42, 0.07) 30%,
      transparent 62%
    ),
    radial-gradient(
      ellipse 85% 55% at 8% 90%,
      rgba(244, 184, 96, 0.08) 0%,
      transparent 58%
    );
  animation: hearthBreathe 8s ease-in-out infinite;
  will-change: opacity, transform;
}

#page-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 45% 60% at 9% 100%,
    rgba(244, 200, 110, 0.14) 0%,
    rgba(232, 146, 60, 0.04) 38%,
    transparent 58%
  );
  animation: hearthFlare 13s ease-in-out infinite;
  will-change: opacity;
}

@keyframes hearthBreathe {
  0%, 100% { opacity: 0.80; transform: translateX(0); }
  25%       { opacity: 1.10; transform: translateX(-5px); }
  55%       { opacity: 0.85; transform: translateX(4px); }
  80%       { opacity: 1.05; transform: translateX(-2px); }
}

@keyframes hearthFlare {
  0%, 65%, 100% { opacity: 0; }
  75%            { opacity: 0.90; }
  88%            { opacity: 0.12; }
}

/* ── Static glow variant (utility/content pages) ─────────── */
body.glow-static #page-glow::before {
  animation: none;
  background:
    radial-gradient(
      ellipse 50% 60% at 8% 100%,
      rgba(232, 146, 60, 0.10) 0%,
      rgba(194, 90, 42, 0.04) 35%,
      transparent 60%
    );
  opacity: 0.10;
  transform: none;
}

body.glow-static #page-glow::after {
  animation: none;
  opacity: 0;
}

body.glow-static #hearth-embers {
  display: none;
}

/* ── Ember bar ───────────────────────────────────────────── */
#hearth-embers {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 30%;
  height: 3px;
  background: linear-gradient(90deg,
    rgba(194, 90, 42, 0.65) 0%,
    rgba(232, 146, 60, 0.35) 30%,
    rgba(244, 184, 96, 0.15) 55%,
    transparent 75%);
  pointer-events: none;
  z-index: 1;
  animation: embersGlow 5s ease-in-out infinite alternate;
  will-change: opacity;
}

@keyframes embersGlow {
  from { opacity: 0.65; }
  to   { opacity: 1.00; }
}

/* ── Layout ──────────────────────────────────────────────── */
.wrap {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Wood panel texture (CSS — no image assets) ──────────── */
.wood-panel {
  --grain-a: rgba(0, 0, 0, 0.045);
  --grain-b: rgba(255, 220, 170, 0.025);
  background:
    repeating-linear-gradient(
      93deg,
      transparent 0px,
      transparent 3px,
      var(--grain-a) 3px,
      var(--grain-a) 4px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 11px,
      var(--grain-b) 11px,
      var(--grain-b) 12px
    ),
    linear-gradient(175deg, #3d2e24 0%, var(--wood) 38%, #35261c 72%, var(--wood-dark) 100%);
  border: 2px solid var(--wood-light);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 180, 0.1),
    inset 0 -3px 8px rgba(0, 0, 0, 0.35),
    0 6px 28px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(232, 146, 60, 0.04);
}

.wood-panel__rim {
  padding: 3px;
  border-radius: 10px;
  background: linear-gradient(145deg, #6b5040, #3a2a20);
  box-shadow: inset 0 1px 0 rgba(255, 220, 180, 0.06);
}

/* ── Navigation ──────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 0;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--cream);
  text-decoration: none;
}
.wordmark .amp { color: var(--amber); font-style: italic; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 24px;
}
.nav-links a {
  color: var(--ash);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--cream); }
.nav-links a[aria-current="page"] { color: var(--cream); }

/* ── Eyebrow label ───────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 28px;
}
.eyebrow::before,
.eyebrow::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--forge);
  opacity: 0.55;
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  width: 48px;
  height: 1px;
  background: var(--wood);
  margin: 72px auto;
  opacity: 0.8;
}

/* ── Section intro ───────────────────────────────────────── */
.section-intro {
  text-align: center;
  max-width: 520px;
  margin: 0 auto 36px;
}
.section-intro h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 10px;
}
.section-intro p {
  font-size: 0.9rem;
  color: var(--ash);
  line-height: 1.7;
}

/* ── Founder note ────────────────────────────────────────── */
.founder-note {
  max-width: 540px;
  margin: 0 auto 88px;
  padding: 22px 24px;
  border-left: 2px solid var(--forge);
  background: rgba(42, 35, 32, 0.45);
  border-radius: 0 6px 6px 0;
}
.founder-note p {
  font-size: 0.9rem;
  color: var(--ash);
  line-height: 1.75;
}
.founder-note a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 146, 60, 0.35);
}
.founder-note a:hover { color: var(--gold); border-color: var(--gold); }
.founder-note .sig {
  display: block;
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--cream);
  font-style: italic;
}

/* ── Props / values grid ─────────────────────────────────── */
.props {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 88px;
}

.prop {
  padding: 28px 24px;
  background: var(--bg-raised);
  border: 1px solid var(--wood);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.prop::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  opacity: 0.35;
}

.prop-mark {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--forge);
  opacity: 0.85;
  margin-bottom: 12px;
}
.prop h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 8px;
}
.prop p {
  font-size: 0.875rem;
  color: var(--ash);
  line-height: 1.65;
}

/* ── BIP link buttons ────────────────────────────────────── */
.bip-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.bip-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--wood);
  border-radius: 4px;
  background: var(--bg-raised);
  color: var(--ash);
  text-decoration: none;
  font-size: 0.875rem;
  transition: border-color 0.2s, color 0.2s;
}
.bip-link:hover { border-color: var(--amber); color: var(--cream); }

/* ── Notice / callout box ────────────────────────────────── */
.notice-box {
  padding: 16px 20px;
  border-left: 2px solid var(--forge);
  background: rgba(42, 35, 32, 0.5);
  border-radius: 0 4px 4px 0;
  margin: 20px 0 14px;
}
.notice-box p {
  font-size: 0.875rem;
  margin-bottom: 0;
  color: var(--ash);
  line-height: 1.75;
}
.notice-box a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 146, 60, 0.35);
}
.notice-box a:hover { color: var(--gold); border-color: var(--gold); }

/* ── Table of contents ───────────────────────────────────── */
.toc {
  margin: 28px 0 0;
  padding: 20px 22px;
  background: rgba(42, 35, 32, 0.35);
  border: 1px solid var(--wood);
  border-radius: 6px;
  display: inline-block;
}
.toc-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forge);
  display: block;
  margin-bottom: 10px;
}
.toc ol {
  margin: 0 0 0 18px;
}
.toc li {
  font-size: 0.85rem;
  color: var(--ash);
  margin-bottom: 4px;
}
.toc a {
  color: var(--ash);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s;
}
.toc a:hover { color: var(--cream); }

/* ── Page header (about, mission, council, etc.) ─────────── */
.page-header {
  padding: 72px 0 56px;
  border-bottom: 1px solid rgba(74, 53, 40, 0.5);
  margin-bottom: 0;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--cream);
  margin-bottom: 20px;
}
.page-header .page-lead {
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  color: var(--ash);
  line-height: 1.75;
  max-width: 580px;
}
.page-header .meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
  opacity: 0.65;
  margin-bottom: 8px;
  display: block;
}

/* ── Content article (about, mission pages) ──────────────── */
article.content {
  padding: 56px 0 96px;
}

.content-section {
  margin-bottom: 60px;
}

.section-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--forge);
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.9;
}

.content-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(74, 53, 40, 0.65);
}

.content-section p {
  font-size: 0.9375rem;
  color: var(--ash);
  line-height: 1.8;
  margin-bottom: 18px;
  max-width: 680px;
}
.content-section p:last-child { margin-bottom: 0; }

.content-section strong {
  color: var(--cream);
  font-weight: 500;
}

.content-section a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 146, 60, 0.3);
}
.content-section a:hover { color: var(--gold); border-color: var(--gold); }

/* ── Pull quote ──────────────────────────────────────────── */
.pull-quote {
  margin: 48px 0;
  padding: 28px 32px;
  border-left: 3px solid var(--amber);
  background: rgba(42, 35, 32, 0.4);
  border-radius: 0 6px 6px 0;
}
.pull-quote p {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 500;
  font-style: italic;
  color: var(--cream);
  line-height: 1.55;
  max-width: 620px;
  margin-bottom: 0 !important;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  padding: 28px 0 64px;
  border-top: 1px solid var(--wood);
  text-align: center;
}
footer p {
  font-size: 0.78rem;
  color: var(--ash);
  opacity: 0.55;
}
footer a { color: inherit; }

/* ── Accessibility ───────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .props { grid-template-columns: 1fr; }
  .founder-note { margin-left: 0; margin-right: 0; padding: 18px 16px; }
  .page-header { padding: 52px 0 40px; }
  article.content { padding: 40px 0 72px; }
  .toc { display: block; }
  .pull-quote { padding: 20px 20px; margin: 36px 0; }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #page-glow::before { animation: none; opacity: 0.85; transform: none; }
  #page-glow::after  { animation: none; opacity: 0; }
  #hearth-embers     { animation: none; opacity: 0.75; }
}
