/* ============================================================
 * THE FORGE · Design Foundation
 * Cream/light mode is the default. Dark mode is opt-in via
 * body:not(.mode-bone) { ... }
 * ============================================================ */

:root {
  --fg: #0C0A08;
  --fg-muted: #5C544A;
  --fg-soft: #8A8277;
  --border: #E5DFD1;
  --border-strong: #C7BDA8;
  --surface: #F5F1E8;         /* bone */
  --ink: #FAF7EE;             /* paper */
  --elevated: #EFEADB;
  --gold: #D4B254;
  --gold-deep: #A88838;
  --gold-soft: #E8C96E;
  --ember: #D9542B;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Legacy aliases for Astro pages still referencing old var names */
  --forge-gold: var(--gold);
  --forge-dark: #0C0A08;
  --forge-text: var(--fg);
  --forge-muted: var(--fg-muted);
  --forge-warm-white: var(--ink);
  --forge-border: var(--border-strong);
  --forge-border-light: var(--border);
}

body:not(.mode-bone) {
  --fg: #F5F1E8;
  --fg-muted: #A39A8C;
  --fg-soft: #6E665A;
  --border: #2E2620;
  --border-strong: #4A3E32;
  --surface: #1A1611;
  --ink: #0C0A08;
  --elevated: #24201A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* Scroll progress bar (top of viewport) */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--gold);
  z-index: 300;
  transition: width 120ms linear;
  pointer-events: none;
}

/* ----- Container primitives ----- */
.fm-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}
.fm-wrap-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 40px;
}
@media (max-width: 720px) {
  .fm-wrap, .fm-wrap-narrow { padding: 0 20px; }
}

/* ----- Section padding ----- */
.fm-section {
  padding: 96px 0;
}
.fm-section-alt {
  padding: 96px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.fm-section-dark {
  padding: 96px 0;
  background: #0C0A08;
  color: #F5F1E8;
}
@media (max-width: 720px) {
  .fm-section, .fm-section-alt, .fm-section-dark { padding: 64px 0; }
}

/* ----- Typography primitives ----- */
.fm-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 700;
  margin-bottom: 20px;
}
.fm-label.fm-label-gold { color: var(--gold); }

.fm-h1 {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: clamp(52px, 8vw, 128px);
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--fg);
  text-wrap: balance;
  margin: 0;
}
.fm-h1 em { font-style: italic; font-weight: 500; color: var(--gold); }

.fm-h2 {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: clamp(34px, 5vw, 60px);
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--fg);
  text-wrap: balance;
  margin: 0;
}
.fm-h2 em { font-style: italic; font-weight: 500; color: var(--gold); }

.fm-lede {
  font-family: 'Archivo', sans-serif;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 760px;
}
.fm-lede strong { color: var(--fg); font-weight: 700; }
.fm-lede em { color: var(--gold); font-style: italic; font-weight: 500; }

/* ----- CTAs ----- */
.fm-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--gold);
  color: #0C0A08;
  padding: 18px 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 800;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--gold-deep);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
  white-space: nowrap;
}
.fm-cta:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--gold-deep); }
.fm-cta-arrow { display: inline-block; transition: transform 180ms var(--ease); }
.fm-cta:hover .fm-cta-arrow { transform: translateX(3px); }

.fm-cta-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border-strong);
  text-decoration: none;
  transition: all 180ms var(--ease);
}
.fm-cta-ghost:hover { border-color: var(--gold); color: var(--gold); }

.fm-cta-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: all 180ms var(--ease);
}
.fm-cta-text:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* ----- Proof strip ----- */
.fm-proof {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.fm-proof-item {
  padding: 28px 20px;
  border-right: 1px solid var(--border);
}
.fm-proof-item:last-child { border-right: none; }
.fm-proof-num {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 56px;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--gold);
}
.fm-proof-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 700;
  margin-top: 10px;
  line-height: 1.5;
}

/* ----- Guarantee chip ----- */
.fm-guarantee {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--gold);
  background: rgba(212, 178, 84, 0.06);
  color: var(--fg);
  font-family: 'Archivo', sans-serif;
  font-size: 14px;
  line-height: 1.45;
  max-width: 420px;
}
.fm-guarantee svg { width: 20px; height: 20px; color: var(--gold); flex-shrink: 0; }
.fm-guarantee strong { color: var(--fg); font-weight: 700; }

/* ----- Tier grid (value ladder) ----- */
.fm-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  border: 1px solid var(--border-strong);
  margin-top: 48px;
}
.fm-tier {
  padding: 36px 28px;
  border-right: 1px solid var(--border-strong);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: background 200ms ease;
}
.fm-tier:last-child { border-right: none; }
.fm-tier:hover { background: var(--elevated); }

.fm-tier-featured {
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--gold);
  transform: translateY(-6px);
  z-index: 1;
}
.fm-tier-ribbon {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  background: var(--gold);
  color: #0C0A08;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 800;
  padding: 8px 12px;
  transform: translateY(-100%);
}
.fm-tier-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
}
.fm-tier-name {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--fg);
  text-transform: none;
  margin: 0;
}
.fm-tier-name em { font-style: italic; font-weight: 500; color: var(--gold); }
.fm-tier-price {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 48px;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--gold);
}
.fm-tier-price-unit {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  font-weight: 700;
  margin-top: 6px;
  text-transform: uppercase;
}
.fm-tier-price-free {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 48px;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--gold);
}
.fm-tier-identity {
  font-family: 'Archivo', sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.45;
  color: var(--fg);
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.fm-tier-body {
  font-family: 'Archivo', sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--fg-muted);
}
.fm-tier-payback {
  font-family: 'Archivo', sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg);
  background: rgba(212, 178, 84, 0.06);
  border-left: 2px solid var(--gold);
  padding: 12px 16px;
}
.fm-tier-payback strong { color: var(--fg); font-weight: 800; }
.fm-tier-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border-strong);
  text-decoration: none;
  transition: all 180ms var(--ease);
}
.fm-tier-cta:hover { border-color: var(--gold); color: var(--gold); }
.fm-tier-cta-primary {
  background: var(--gold);
  color: #0C0A08;
  border-color: var(--gold);
  box-shadow: 4px 4px 0 var(--gold-deep);
}
.fm-tier-cta-primary:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--gold-deep);
  color: #0C0A08;
  border-color: var(--gold);
}

/* ----- FAQ ----- */
.fm-faq {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-strong);
}
.fm-faq-item {
  border-bottom: 1px solid var(--border-strong);
}
.fm-faq-q {
  width: 100%;
  background: transparent;
  border: none;
  padding: 24px 0;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.fm-faq-sign {
  width: 14px; height: 14px;
  flex-shrink: 0;
  position: relative;
}
.fm-faq-sign::before,
.fm-faq-sign::after {
  content: '';
  position: absolute;
  background: var(--gold);
  transition: transform 200ms ease;
}
.fm-faq-sign::before { left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%); }
.fm-faq-sign::after  { left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); }
.fm-faq-item.open .fm-faq-sign::after { transform: translateX(-50%) scaleY(0); }
.fm-faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms var(--ease);
  overflow: hidden;
}
.fm-faq-a-inner {
  min-height: 0;
  overflow: hidden;
  font-family: 'Archivo', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-muted);
  padding: 0;
}
.fm-faq-a-inner > * { margin: 0 0 16px; }
.fm-faq-a-inner > *:last-child { margin-bottom: 0; }
.fm-faq-item.open .fm-faq-a { grid-template-rows: 1fr; }
.fm-faq-item.open .fm-faq-a-inner { padding-bottom: 24px; }

/* ----- Reveal on scroll helper ----- */
.fm-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.fm-reveal.in { opacity: 1; transform: none; }

/* ----- Cohort bar (site-wide, above header) ----- */
.cohort-bar {
  background: var(--gold);
  color: #0C0A08;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.cohort-bar a {
  color: #0C0A08;
  text-decoration: none;
  border-bottom: 1px solid #0C0A08;
  padding-bottom: 1px;
}
.cohort-bar a:hover { opacity: 0.75; }
.cohort-bar-sep {
  width: 3px; height: 3px;
  background: #0C0A08;
  border-radius: 50%;
  opacity: 0.5;
}
@media (max-width: 560px) {
  .cohort-bar {
    gap: 10px;
    padding: 8px 14px;
    font-size: 10px;
    letter-spacing: 0.14em;
  }
  .cohort-bar-sep { display: none; }
}

/* ----- Utilities ----- */
.strike {
  position: relative;
  display: inline-block;
  color: var(--fg-muted);
  font-weight: 500;
}
.strike::after {
  content: '';
  position: absolute;
  left: -4%; right: -4%;
  top: 52%;
  height: 5px;
  background: var(--ember);
  transform: rotate(-3deg);
}

/* ----- Print ----- */
@media print {
  .cohort-bar, .scroll-progress, header.site-header, footer.site-footer { display: none; }
}
