/* ==========================================================================
   The Fractured Founder — Stylesheet
   Warm Dusk design system. Editorial. Restrained. Quiet.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Warm Dusk palette (per master brief) */
  --graphite: #232120;       /* primary dark */
  --charcoal: #1B1A19;       /* darker bands */
  --ivory: #F5F0E8;          /* primary light */
  --stone: #D8D1C8;          /* softer light */
  --clay: #A78B7A;           /* support warmth */
  --amber: #C79A5D;          /* accent / buttons */
  --gold: #B89153;           /* hairline rules */

  /* Tints */
  --ivory-soft: #EDE6DB;     /* slightly deeper ivory for cards */
  --graphite-soft: #2A2725;  /* card bg in dark sections */
  --line-dark: rgba(184, 145, 83, 0.18);
  --line-light: rgba(35, 33, 32, 0.08);

  /* Typography */
  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Spacing scale */
  --gap-xs: 8px;
  --gap-sm: 16px;
  --gap-md: 24px;
  --gap-lg: 32px;
  --gap-xl: 48px;
  --gap-2xl: 64px;
  --gap-3xl: 96px;
  --gap-4xl: 120px;

  /* Layout */
  --max-width: 1200px;
  --reading-width: 780px;
  --hero-text-width: 820px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 20px;
  line-height: 1.6;
  color: var(--graphite);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* Custom selection — warm, not blue */
::selection { background: var(--amber); color: var(--graphite); }
::-moz-selection { background: var(--amber); color: var(--graphite); }

/* ---------- Typography ---------- */
.display-serif {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 1.0;
  letter-spacing: -0.01em;
}
h1, .h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.005em;
}
h2, .h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
}
h3, .h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.25;
}

.body-lg { font-size: clamp(18px, 1.6vw, 24px); line-height: 1.55; }
.body { font-size: clamp(17px, 1.3vw, 20px); line-height: 1.65; }
.body-sm { font-size: 16px; line-height: 1.6; }

.eyebrow {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay);
}

.italic-pull {
  font-style: italic;
  color: var(--gold);
}

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 32px; }
.reading { max-width: var(--reading-width); margin: 0 auto; }
.section { padding: var(--gap-3xl) 0; }
.section-tight { padding: var(--gap-2xl) 0; }
.center { text-align: center; }

/* Section themes */
.bg-graphite { background: var(--graphite); color: var(--ivory); }
.bg-charcoal { background: var(--charcoal); color: var(--ivory); }
.bg-ivory { background: var(--ivory); color: var(--graphite); }
.bg-ivory-soft { background: var(--ivory-soft); color: var(--graphite); }

.bg-graphite .eyebrow,
.bg-charcoal .eyebrow { color: var(--amber); }

/* Hairline rule — the "soft seam" brand element */
.hairline {
  width: 64px; height: 1px;
  background: var(--gold);
  margin: var(--gap-md) auto;
  position: relative;
}
.hairline::after {
  content: '';
  position: absolute;
  left: 38%; top: 0;
  width: 6px; height: 1px;
  background: var(--ivory);
  transform: translateY(-1px);
}
.bg-ivory .hairline::after,
.bg-ivory-soft .hairline::after { background: var(--ivory); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: 80px;
  background: var(--graphite);
  color: var(--ivory);
  border-bottom: 1px solid var(--line-dark);
  backdrop-filter: blur(8px);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.005em;
  color: var(--ivory);
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1;
}
.wordmark-line {
  width: 24px; height: 1px;
  background: var(--gold);
  position: relative;
  opacity: 0.85;
}
.wordmark-line::after {
  /* the subtle fracture in the seam */
  content: '';
  position: absolute;
  left: 10px; top: -1px;
  width: 4px; height: 3px;
  background: var(--graphite);
}

.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
  list-style: none;
}
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--stone);
  letter-spacing: 0.01em;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--ivory); }
.nav-links a.active {
  position: relative;
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 1px;
  background: var(--gold);
}

.nav-toggle {
  display: none;
  width: 28px; height: 20px;
  position: relative;
  color: var(--ivory);
}
.nav-toggle span {
  position: absolute; left: 0; right: 0;
  height: 1px; background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 4px; }
.nav-toggle span:nth-child(2) { top: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 12px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--amber);
  color: var(--graphite);
}
.btn-primary:hover { background: #d4a76b; }

.btn-secondary {
  background: transparent;
  color: var(--ivory);
  border-color: rgba(245, 240, 232, 0.3);
}
.bg-ivory .btn-secondary,
.bg-ivory-soft .btn-secondary {
  color: var(--graphite);
  border-color: rgba(35, 33, 32, 0.2);
}
.btn-secondary:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.btn-ghost {
  font-size: 14px;
  font-weight: 500;
  color: var(--clay);
  padding: 8px 0;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-ghost:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
  transform: none;
}

.btn-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--gap-xl);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  background: var(--graphite);
  color: var(--ivory);
  overflow: hidden;
  padding: var(--gap-4xl) 0;
}

/* Warm dusk glow — subtle candle in dark room */
.hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 1100px; height: 1100px;
  background: radial-gradient(
    circle at center,
    rgba(199, 154, 93, 0.18) 0%,
    rgba(199, 154, 93, 0.08) 25%,
    rgba(199, 154, 93, 0.03) 45%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}
/* Subtle grain overlay */
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.92 0 0 0 0 0.86 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.5;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--hero-text-width);
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 1.0;
  letter-spacing: -0.01em;
  margin-bottom: var(--gap-xl);
}
.hero-subhead {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.55;
  color: var(--stone);
  max-width: 640px;
  margin: 0 auto var(--gap-md);
}
.hero-tag {
  font-size: 16px;
  color: rgba(245, 240, 232, 0.6);
  font-style: italic;
  margin-bottom: var(--gap-sm);
}
.hero-pull {
  font-style: italic;
  color: var(--gold);
  font-size: 17px;
  letter-spacing: 0.005em;
  margin-top: var(--gap-md);
}

/* Initial fade-in on load */
.fade-in > * {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 1.1s var(--ease) forwards;
}
.fade-in > *:nth-child(1) { animation-delay: 0.1s; }
.fade-in > *:nth-child(2) { animation-delay: 0.35s; }
.fade-in > *:nth-child(3) { animation-delay: 0.55s; }
.fade-in > *:nth-child(4) { animation-delay: 0.75s; }
.fade-in > *:nth-child(5) { animation-delay: 0.95s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .fade-in > * { opacity: 1; transform: none; animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Reflections (cards) ---------- */
.reflections {
  display: grid;
  gap: 20px;
  max-width: 880px;
  margin: var(--gap-2xl) auto 0;
}
.reflection-card {
  background: var(--ivory);
  border: 1px solid var(--line-light);
  border-radius: 20px;
  padding: 32px 36px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.bg-graphite .reflection-card,
.bg-charcoal .reflection-card {
  background: var(--graphite-soft);
  border: 1px solid var(--line-dark);
}
.reflection-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.reflection-text {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.45;
  letter-spacing: 0.005em;
  color: var(--graphite);
  margin-bottom: 20px;
}
.bg-graphite .reflection-text,
.bg-charcoal .reflection-text { color: var(--ivory); }

.reflection-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line-light);
  padding-top: 16px;
}
.bg-graphite .reflection-meta,
.bg-charcoal .reflection-meta { border-top-color: var(--line-dark); }

.reflection-attr {
  font-style: italic;
  font-size: 14px;
  color: var(--clay);
  letter-spacing: 0.02em;
}
.reflection-actions {
  display: flex;
  gap: 24px;
}
.reflection-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--clay);
  letter-spacing: 0.02em;
  padding: 4px 0;
  transition: color 0.2s var(--ease);
}
.reflection-action:hover { color: var(--gold); }
.reflection-action svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* Editorial reflections (no actions, used on home) */
.reflections-editorial .reflection-card {
  padding: 28px 36px;
}
.reflections-editorial .reflection-meta {
  border: none;
  padding-top: 0;
  justify-content: flex-start;
}

/* ---------- Manifesto long-form ---------- */
.manifesto-section {
  margin: var(--gap-2xl) 0;
}
.manifesto-section h2 {
  margin-bottom: var(--gap-md);
}
.manifesto-section p {
  margin-bottom: var(--gap-md);
  font-size: 19px;
  line-height: 1.7;
}
.manifesto-section p:last-child { margin-bottom: 0; }

.pull-block {
  border-left: 2px solid var(--gold);
  padding: 4px 0 4px 24px;
  margin: var(--gap-lg) 0;
  font-style: italic;
  color: var(--gold);
  font-size: 19px;
  line-height: 1.5;
}

.principles {
  display: grid;
  gap: 28px;
  margin-top: var(--gap-lg);
}
.principle {
  padding-left: 24px;
  border-left: 1px solid var(--line-dark);
}
.principle strong {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 6px;
}
.principle p {
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--charcoal);
  color: var(--stone);
  padding: var(--gap-2xl) 0 var(--gap-xl);
  border-top: 1px solid var(--line-dark);
}
.footer-tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  color: var(--gold);
  text-align: center;
  margin-bottom: var(--gap-lg);
}
.footer-line {
  width: 40px; height: 1px;
  background: var(--gold);
  margin: 0 auto var(--gap-lg);
  opacity: 0.5;
}
.footer-nav {
  display: flex;
  gap: 32px;
  justify-content: center;
  list-style: none;
  margin-bottom: var(--gap-lg);
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--stone);
  transition: color 0.2s var(--ease);
}
.footer-nav a:hover { color: var(--gold); }
.footer-fine {
  font-size: 12px;
  text-align: center;
  color: rgba(216, 209, 200, 0.45);
  letter-spacing: 0.04em;
}

/* ---------- Modal (share form) ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(27, 26, 25, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
  padding: 24px;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--ivory);
  border-radius: 24px;
  max-width: 560px;
  width: 100%;
  padding: 48px 44px;
  position: relative;
  transform: translateY(12px);
  transition: transform 0.4s var(--ease);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.4);
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clay);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.modal-close:hover { color: var(--graphite); background: var(--ivory-soft); }
.modal-close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; }

.modal h2 {
  font-size: 32px;
  margin-bottom: 12px;
}
.modal-intro {
  font-size: 16px;
  color: var(--clay);
  line-height: 1.55;
  margin-bottom: var(--gap-lg);
}
.modal-form label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 10px;
}
.modal-form textarea {
  width: 100%;
  min-height: 160px;
  padding: 18px 20px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--graphite);
  background: var(--ivory-soft);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  resize: vertical;
  transition: border-color 0.2s var(--ease);
}
.modal-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.modal-form textarea::placeholder {
  color: var(--clay);
  font-style: italic;
}
.modal-fine {
  font-size: 13px;
  color: var(--clay);
  margin-top: 14px;
  line-height: 1.5;
}
.modal-actions {
  margin-top: var(--gap-lg);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}
.modal-success {
  text-align: center;
  padding: 16px 0 8px;
}
.modal-success h2 { font-style: italic; color: var(--gold); margin-bottom: 12px; }
.modal-success p { color: var(--clay); margin-bottom: 16px; }

/* hide honeypot field for spam prevention with Netlify Forms */
.honeypot { position: absolute; left: -9999px; }

/* ---------- Page intros ---------- */
.page-intro {
  background: var(--graphite);
  color: var(--ivory);
  padding: var(--gap-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-intro::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle at center, rgba(199, 154, 93, 0.12) 0%, transparent 60%);
  pointer-events: none;
}
.page-intro-inner { position: relative; max-width: 720px; margin: 0 auto; padding: 0 32px; }
.page-intro h1 { margin-bottom: var(--gap-md); }
.page-intro-sub {
  font-style: italic;
  font-size: 18px;
  color: var(--gold);
  margin-bottom: var(--gap-lg);
}
.page-intro-body {
  color: var(--stone);
  line-height: 1.6;
  margin-bottom: var(--gap-xl);
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  body { font-size: 18px; }

  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 80px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--graphite);
    border-bottom: 1px solid var(--line-dark);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease);
  }
  .nav-links.open { max-height: 320px; padding: 8px 0 24px; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 14px 32px;
    font-size: 17px;
  }
  .nav-links a.active::after { display: none; }

  .hero { min-height: auto; padding: var(--gap-3xl) 0; }
  .hero-inner { padding: 0 24px; }
  .hero h1 { font-size: clamp(40px, 11vw, 56px); }

  .container { padding: 0 24px; }
  .section { padding: var(--gap-2xl) 0; }
  .section-tight { padding: var(--gap-xl) 0; }

  .reflection-card { padding: 24px 26px; }
  .reflection-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .modal { padding: 36px 28px; }
  .modal h2 { font-size: 26px; }

  .footer-nav { gap: 22px; }
}

@media (max-width: 480px) {
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .reflection-actions { gap: 18px; }
}

/* ---------- Footer help link (duty of care — quiet, persistent, not nagging) ---------- */
.footer-help {
  font-size: 13px;
  text-align: center;
  color: rgba(216, 209, 200, 0.62);
  margin: 0 auto var(--gap-sm);
  max-width: 460px;
  line-height: 1.6;
  letter-spacing: 0.01em;
}
.footer-help a {
  color: var(--gold);
  border-bottom: 1px solid rgba(184, 145, 83, 0.35);
  padding-bottom: 1px;
  transition: color 0.2s var(--ease);
}
.footer-help a:hover { color: var(--amber); }
