/* ============================================================
   THE FOUNDRY SOCIETY — styles.css
   Iron, ember, bone, pine. A man forged under heat.
   Warm, grounded, honest. Not clinical. Not corporate.
   ============================================================ */

:root {
  /* Forge palette */
  --iron:        #1E1B19;   /* near-black, warm charcoal — primary dark */
  --iron-soft:   #2A2622;
  --iron-line:   #3A352F;
  --ember:       #C0551F;   /* forge glow — accent + CTA */
  --ember-deep:  #993F13;
  --ember-tint:  #F6E7DC;   /* soft ember wash for callouts */
  --pine:        #2C3A33;   /* grounding green — hope, depth */
  --pine-soft:   #3A4B42;
  --bone:        #F5F0E8;   /* warm paper — primary background */
  --bone-dim:    #ECE5D8;
  --sand:        #DECFB8;
  --steel:       #6F6A62;   /* muted warm gray — secondary text */
  --steel-light: #B8B1A6;
  --ink:         #211E1B;   /* body text on light */
  --red:         #8A1F1F;   /* caution only */

  --serif:   "Fraunces", Georgia, "Times New Roman", serif;
  --sans:    "Inter", system-ui, -apple-system, sans-serif;

  --measure:   64ch;
  --container: 1120px;
  --narrow:    760px;
  --radius:    6px;
  --radius-lg: 14px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.075rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bone);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

img { max-width: 100%; height: auto; display: block; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  color: var(--iron);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  font-optical-sizing: auto;
}

h1 { font-size: clamp(2.6rem, 6.2vw, 4.4rem); font-weight: 600; }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h3 { font-size: 1.4rem; font-weight: 600; }

p { margin: 0 0 1.15em; max-width: var(--measure); }

a { color: var(--ember-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ember); }

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

.lead {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  line-height: 1.5;
  color: var(--steel);
  font-weight: 400;
  max-width: 40ch;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--ember);
  display: inline-block;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
.container.narrow { max-width: var(--narrow); }

section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }

.section-bone-dim { background: var(--bone-dim); }
.section-iron  { background: var(--iron); color: #E7E1D6; }
.section-pine  { background: var(--pine); color: #E2E8E2; }

.section-iron h1, .section-iron h2, .section-iron h3,
.section-pine h1, .section-pine h2, .section-pine h3 { color: #fff; }
.section-iron p, .section-pine p { color: #CFC8BC; }
.section-iron .lead, .section-pine .lead { color: #C9C2B6; }
.section-iron a, .section-pine a { color: #E9A06B; }
.section-iron a:hover, .section-pine a:hover { color: #F3B989; }

/* ---------- Skip + focus ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--iron); color: #fff;
  padding: 0.75rem 1.25rem; z-index: 1000;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 240, 232, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--bone-dim);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 76px;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--iron);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0.55rem;
}
.wordmark .spark {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 10px rgba(192,85,31,0.7);
  flex: none;
}

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 0.5rem; color: var(--iron);
}
.nav-toggle svg { display: block; }

.site-nav ul {
  list-style: none; display: flex; align-items: center;
  gap: 2rem; margin: 0; padding: 0;
}
.site-nav a {
  font-size: 0.96rem; font-weight: 500; color: var(--ink);
  text-decoration: none;
}
.site-nav a:hover { color: var(--ember-deep); }
.site-nav a[aria-current="page"] { color: var(--ember-deep); }

.nav-cta {
  background: var(--ember); color: #fff !important;
  padding: 0.62rem 1.25rem; border-radius: var(--radius);
  box-shadow: 0 1px 0 var(--ember-deep);
}
.nav-cta:hover { background: var(--ember-deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 1.02rem;
  text-decoration: none; padding: 0.95rem 1.8rem;
  border-radius: var(--radius); border: 2px solid transparent;
  cursor: pointer; transition: transform .12s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ember); color: #fff; box-shadow: 0 2px 0 var(--ember-deep); }
.btn-primary:hover { background: var(--ember-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--iron); border-color: var(--iron); }
.btn-ghost:hover { background: var(--iron); color: #fff; }
.section-iron .btn-ghost, .section-pine .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.6); }
.section-iron .btn-ghost:hover, .section-pine .btn-ghost:hover { background: #fff; color: var(--iron); }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(4.5rem, 11vw, 8rem);
  overflow: hidden;
  border-bottom: 1px solid var(--bone-dim);
}
.hero::before {
  /* forge glow — subtle warmth, no imagery needed */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 80% at 85% 10%, rgba(192,85,31,0.13), transparent 60%),
    radial-gradient(50% 60% at 10% 100%, rgba(44,58,51,0.10), transparent 70%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 { max-width: 16ch; margin-bottom: 0.35em; }
.hero .lead { margin-bottom: 2.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.hero-note { font-size: 0.95rem; color: var(--steel); }

/* Inner page hero (smaller) */
.hero.compact { padding-block: clamp(3.5rem, 8vw, 5.5rem); }
.hero.compact h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); max-width: 20ch; }

/* ---------- Honest statement ---------- */
.statement-band { background: var(--iron); color: #EDE7DC; }
.statement-band .container { max-width: var(--narrow); }
.statement-band p {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.4; color: #F2ECE1; max-width: 30ch; margin: 0 auto;
  text-align: center; font-weight: 400;
}
.statement-band .container { text-align: center; }
.statement-band em { color: var(--ember); font-style: normal; }

/* ---------- "If this sounds familiar" ---------- */
.familiar-grid {
  display: grid; gap: 1px;
  background: var(--bone-dim);
  border: 1px solid var(--bone-dim);
  border-radius: var(--radius-lg); overflow: hidden;
  grid-template-columns: 1fr;
  margin-top: 2rem;
}
.familiar-grid li {
  list-style: none; background: var(--bone);
  padding: 1.5rem 1.6rem; font-size: 1.1rem; line-height: 1.5;
  color: var(--iron);
}
.familiar-grid li span { color: var(--ember); font-weight: 600; }

/* ---------- Cards / value props ---------- */
.cards { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.card {
  background: var(--bone);
  border: 1px solid var(--bone-dim);
  border-radius: var(--radius-lg);
  padding: 2rem 1.9rem;
}
.section-bone-dim .card { background: #fff; border-color: #E3DACA; }
.card .num {
  font-family: var(--serif); font-size: 1.1rem; font-weight: 600;
  color: var(--ember); display: block; margin-bottom: 0.75rem;
}
.card h3 { margin-top: 0; }
.card p { font-size: 1.02rem; color: var(--steel); margin-bottom: 1rem; }
.card a { font-weight: 600; font-size: 0.96rem; }

/* ---------- Prose ---------- */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.8rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2rem; color: var(--iron); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.55rem; max-width: var(--measure); }

/* ---------- The path / steps ---------- */
.path { list-style: none; padding: 0; margin: 2rem 0 0; max-width: var(--measure); }
.path li {
  position: relative; padding: 0 0 2rem 3.25rem;
  border-left: 2px solid var(--sand); margin-left: 0.9rem;
}
.path li:last-child { border-left-color: transparent; padding-bottom: 0; }
.path li::before {
  content: ""; position: absolute; left: -0.6rem; top: 0.1rem;
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: var(--ember); box-shadow: 0 0 0 5px var(--bone);
}
.section-bone-dim .path li::before { box-shadow: 0 0 0 5px var(--bone-dim); }
.path h3 { margin: -0.2rem 0 0.4rem; }
.path p { margin-bottom: 0; color: var(--steel); }

/* ---------- Accountability ladder ---------- */
.ladder { list-style: none; counter-reset: step; padding: 0; margin: 1.5rem 0; max-width: var(--measure); }
.ladder li {
  counter-increment: step; position: relative;
  padding: 1.1rem 1.2rem 1.1rem 3.6rem;
  border: 1px solid var(--bone-dim); border-radius: var(--radius);
  margin-bottom: 0.75rem; background: var(--bone);
}
.ladder li::before {
  content: counter(step); position: absolute; left: 1rem; top: 1.05rem;
  width: 1.85rem; height: 1.85rem; background: var(--iron); color: #fff;
  border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 0.95rem;
}

/* ---------- Callout ---------- */
.callout { background: var(--bone-dim); border-radius: var(--radius); padding: 1.5rem 1.6rem; max-width: var(--measure); margin: 1.5rem 0; }
.callout.caution { background: var(--ember-tint); border-left: 4px solid var(--ember-deep); }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Two-column ---------- */
.col-2 { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }

/* ---------- Founder ---------- */
.founder { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
.founder-photo {
  background: var(--iron); border-radius: var(--radius-lg);
  aspect-ratio: 4/5; display: grid; place-items: center;
  color: var(--steel-light); font-size: 0.85rem; text-align: center; padding: 1rem;
}
.founder blockquote {
  margin: 0; font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  line-height: 1.4; color: var(--iron); font-weight: 400;
}
.founder cite { font-style: normal; display: block; margin-top: 1.25rem; font-family: var(--sans); }
.founder cite strong { display: block; font-size: 1rem; }
.founder cite span { color: var(--steel); font-size: 0.92rem; }

/* ---------- Forms ---------- */
.form { max-width: 40rem; }
.form .field { margin-bottom: 1.3rem; }
.form label { display: block; font-weight: 600; font-size: 0.96rem; margin-bottom: 0.45rem; color: var(--iron); }
.form input, .form textarea {
  width: 100%; font-family: var(--sans); font-size: 1.02rem;
  padding: 0.8rem 0.9rem; border: 1.5px solid #C9BFAE; border-radius: var(--radius);
  background: #fff; color: var(--ink);
}
.form input:focus, .form textarea:focus { border-color: var(--ember); outline: 3px solid rgba(192,85,31,0.25); outline-offset: 0; }
.form textarea { resize: vertical; }

/* ---------- Crisis band ---------- */
.crisis-band { background: var(--ember-tint); border-radius: var(--radius); padding: 1.25rem 1.5rem; max-width: var(--measure); margin-top: 1.75rem; }
.crisis-band strong { color: var(--ember-deep); }

/* ---------- Footer ---------- */
.site-footer { background: var(--iron); color: #B8B1A6; padding-block: 3.5rem 1.75rem; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
.site-footer .wordmark { color: #fff; font-size: 1.25rem; margin-bottom: 0.75rem; }
.site-footer p { color: #9C958A; font-size: 0.98rem; max-width: 30ch; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.65rem; }
.site-footer a { color: #C2BBB0; text-decoration: none; font-size: 0.98rem; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid var(--iron-line); margin-top: 3rem; padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: space-between;
  font-size: 0.86rem; color: #837C72;
}
.footer-bottom a { color: #837C72; font-size: 0.86rem; text-decoration: underline; }
.footer-bottom a:hover { color: #B8B1A6; }
.footer-bottom .crisis { color: #C9C2B6; }
.footer-bottom .crisis strong { color: var(--ember); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.center-col { margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ============================================================
   Breakpoints — mobile-first; 768 / 1024
   ============================================================ */
@media (max-width: 767px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 76px; left: 0; right: 0;
    background: var(--bone); border-bottom: 1px solid var(--bone-dim);
    box-shadow: 0 10px 30px rgba(30,27,25,0.12);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 1.5rem 1.25rem; }
  .site-nav li { border-bottom: 1px solid var(--bone-dim); }
  .site-nav li:last-child { border-bottom: 0; }
  .site-nav a { display: block; padding: 0.95rem 0; }
  .nav-cta { text-align: center; margin-top: 0.85rem; }
}

@media (min-width: 768px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .familiar-grid { grid-template-columns: 1fr 1fr; }
  .col-2 { grid-template-columns: 1fr 1fr; }
  .founder { grid-template-columns: 0.8fr 1.2fr; gap: 3rem; }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1.2fr; gap: 3.5rem; }
}
@media (min-width: 1024px) {
  .familiar-grid { grid-template-columns: 1fr 1fr; }
}
