/*
 * styles.css — apex landing for Red Letter (red-letter.saml.coffee)
 *
 * Design language: dark oxblood / scarlet / gold / cream on Georgia serif.
 * Hero and closing are FIXED dark red in both themes (authority + gravity).
 * Body surfaces, bands, cards flip with prefers-color-scheme.
 * Zero inline styles on the page — CSP stays `style-src 'self'`.
 * Zero JS in this file.
 *
 * Token naming mirrors service-professor-masters-www for maintainability;
 * values differ (scarlet/crimson replaces warm oxblood).
 */

/* ═══ LIGHT THEME (default) ═══ */
:root {
  --bg: #f5f1ea;
  --surface: #fff;
  --surface-2: #faf7f1;
  --ink: #2a1a1a;
  --ink-soft: #5b4040;
  --line: #e4d4d0;

  /* Scarlet accent for links / interactive text (theme-switched) */
  --accent: #9b2335;
  --accent-soft: #b83042;

  /* Brand = primary-button background (FIXED both themes; white text) */
  --brand: #8b1a1a;
  --brand-soft: #a52020;
  --deep: #6b1010;          /* hero/closing gradient anchor — fixed */

  --gold: #b0852f;
  --gold-soft: #c79a52;
  --gold-ink: #856017;

  --cream: #f3e6c8;
  --cream-hover: #efe0ba;

  --maga-red: #c0392b;
  --apostasy-blue: #2c6fad;

  --shadow: 0 1px 3px rgba(40,20,20,.09), 0 6px 20px rgba(40,20,20,.07);
  --shadow-lg: 0 10px 40px rgba(40,20,20,.16);
  --maxw: 1080px;

  --topbar-bg: rgba(245,241,234,.92);
  --ghost-hover: #fce8e8;
  --outline-color: #9b2335;
}

/* ═══ DARK THEME ═══ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1212;
    --surface: #241818;
    --surface-2: #2c1e1e;
    --ink: #f0e0e0;
    --ink-soft: #c0a0a0;
    --line: #3a2424;
    --accent: #e07080;
    --accent-soft: #f08090;
    --gold: #c8a050;
    --gold-soft: #d8b56a;
    --gold-ink: #c8a050;
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.32);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.52);
    --topbar-bg: rgba(26,18,18,.92);
    --ghost-hover: #3a2020;
    --outline-color: #e07080;
    /* --brand / --brand-soft / --deep / --cream fixed */
  }
}

/* ── reset ── */
*, *::before, *::after { box-sizing: border-box }
html { scroll-behavior: smooth }
html, body { margin: 0 }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; line-height: 1.2; margin: 0 }
a { color: var(--accent) }
img, svg { max-width: 100% }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px }

/* skip link */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand); color: #fff;
  padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 200;
}
.skip:focus { left: 0 }

/* keyboard focus */
a:focus-visible, .btn:focus-visible, input:focus-visible, button:focus-visible {
  outline: 2px solid #f5d0d0;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #2a1010;
  border-radius: 6px;
}

/* ── top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--topbar-bg);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex; align-items: center; gap: 12px; min-height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; color: var(--ink); min-width: 0;
  margin-right: auto;
}
.brand .seal {
  width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #a52020, #6b1010);
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--gold); flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.22);
}
.brand .seal svg { width: 26px; height: 26px; display: block }
.brand .wm {
  font-family: Georgia, serif; font-size: 18px; font-weight: 600;
  line-height: 1.1; color: var(--ink);
}
.brand .wm small {
  display: block; font-family: -apple-system, sans-serif; font-size: 11px;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600;
}
.topnav { display: flex; align-items: center; gap: 8px }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; font-family: inherit; font-weight: 600; font-size: 15px;
  padding: 11px 20px; border-radius: 10px; min-height: 44px; cursor: pointer;
  transition: background .15s, transform .05s, box-shadow .15s;
  border: 1.5px solid transparent;
}
.btn:active { transform: translateY(1px) }
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 2px 6px rgba(139,26,26,.28);
}
.btn-primary:hover { background: var(--brand-soft) }
.btn-ghost {
  background: transparent; color: var(--accent);
  border-color: var(--outline-color);
}
.btn-ghost:hover { background: var(--ghost-hover) }
.btn-outline {
  background: transparent; color: var(--cream);
  border-color: rgba(243,230,200,.5);
}
.btn-outline:hover { background: rgba(243,230,200,.12) }
.btn-cream {
  background: var(--cream); color: var(--deep);
  border-color: rgba(176,133,47,.5);
}
.btn-cream:hover { background: var(--cream-hover) }
.btn-submit {
  background: var(--brand); color: #fff; width: 100%;
  font-size: 16px; padding: 13px 24px; min-height: 48px;
  border: none; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-weight: 600;
  box-shadow: 0 2px 8px rgba(139,26,26,.3);
  transition: background .15s, transform .05s;
}
.btn-submit:hover { background: var(--brand-soft) }
.btn-submit:active { transform: translateY(1px) }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; transform: none }
.topbar .btn { padding: 9px 18px; font-size: 14.5px; min-height: 42px }

/* ── hero (fixed dark scarlet + cross-hatch texture, both themes) ── */
.hero {
  position: relative; overflow: hidden; color: #f4e4e4;
  background: linear-gradient(135deg, #8b1a1a 0%, #6b1010 55%, #4a0c0c 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .45;
  background-image:
    repeating-linear-gradient(90deg, rgba(10,3,3,.5) 0 12px, transparent 12px 44px),
    repeating-linear-gradient(0deg,  rgba(10,3,3,.5) 0 12px, transparent 12px 44px),
    repeating-linear-gradient(90deg, rgba(10,3,3,.6) 21px 32px, transparent 32px 44px),
    repeating-linear-gradient(0deg,  rgba(10,3,3,.6) 21px 32px, transparent 32px 44px),
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(200,160,80,.4) 38px 40px, transparent 40px 44px),
    repeating-linear-gradient(0deg,  transparent 0 38px, rgba(200,160,80,.4) 38px 40px, transparent 40px 44px);
}
.hero .wrap { position: relative; padding: 72px 20px 80px; max-width: 900px }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--cream); font-weight: 700;
  background: rgba(243,230,200,.1); border: 1px solid rgba(243,230,200,.28);
  padding: 6px 13px; border-radius: 30px; margin-bottom: 20px;
}
.hero h1 {
  color: #fff; font-size: clamp(28px, 6vw, 54px);
  letter-spacing: -.01em; margin-bottom: 20px; text-wrap: balance;
}
.hero .sub {
  font-size: clamp(15px, 2.4vw, 19px); color: #e8c8c8;
  max-width: 66ch; margin: 0 0 32px;
}
.hero .cta-row {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.hero .divider { color: #c08080; font-size: 13px; padding: 0 4px }

/* ── generic band ── */
section.band { padding: 68px 0 }
section.band.alt {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-head { max-width: 64ch; margin: 0 auto 48px; text-align: center }
.section-head h2 { font-size: clamp(24px, 4vw, 36px); margin-bottom: 12px }
.section-head p { font-size: 17px; color: var(--ink-soft); margin: 0 }
.kicker {
  display: inline-block; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold-ink); font-weight: 700; margin-bottom: 12px;
}

/* ── two-axis explainer ── */
.axes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  max-width: 860px; margin: 0 auto;
}
.axis {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.axis-mark { width: 48px; height: 48px; margin-bottom: 16px }
.axis-maga { border-top: 4px solid var(--maga-red) }
.axis-apostasy { border-top: 4px solid var(--apostasy-blue) }
.axis h3 { font-size: 20px; margin-bottom: 10px; color: var(--ink) }
.axis p { margin: 0; font-size: 15.5px; color: var(--ink-soft) }

/* ── capability cards ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s; position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold-soft));
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg) }
.card h3 { font-size: 17px; margin-bottom: 9px; color: var(--accent) }
.card p { margin: 0; font-size: 15px; color: var(--ink-soft) }

/* ── audience ── */
.audience { max-width: 760px; margin: 0 auto; text-align: center }
.audience .quote {
  font-family: Georgia, serif;
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.5; color: var(--ink); font-style: italic; margin: 0;
}
.audience .quote::before {
  content: "\201C"; color: var(--gold);
  font-size: 1.2em; line-height: 0; vertical-align: -.15em; margin-right: .06em;
}
.audience .quote::after {
  content: "\201D"; color: var(--gold);
  font-size: 1.2em; line-height: 0; vertical-align: -.35em; margin-left: .02em;
}

/* ── signup section (fixed dark, both themes) ── */
.signup-section {
  position: relative; overflow: hidden; color: #f4e4e4;
  background: linear-gradient(135deg, #6b1010, #4a0c0c);
}
.signup-section::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image:
    repeating-linear-gradient(90deg, rgba(10,3,3,.5) 0 12px, transparent 12px 44px),
    repeating-linear-gradient(0deg,  rgba(10,3,3,.5) 0 12px, transparent 12px 44px),
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(200,160,80,.35) 38px 40px, transparent 40px 44px),
    repeating-linear-gradient(0deg,  transparent 0 38px, rgba(200,160,80,.35) 38px 40px, transparent 40px 44px);
}
.signup-section .wrap { position: relative; padding: 72px 20px }
.signup-box {
  max-width: 520px; margin: 0 auto;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(243,230,200,.18);
  border-radius: 20px; padding: 40px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.signup-head { margin-bottom: 28px; text-align: center }
.kicker-light { color: var(--gold-soft) }
.signup-head h2 { color: #fff; font-size: clamp(24px, 4vw, 32px); margin-bottom: 10px }
.signup-head p { font-size: 16px; color: #e0c4c4; margin: 0 }

/* ── signup form ── */
.signup-form { display: flex; flex-direction: column; gap: 16px }
.field-row { display: flex; flex-direction: column; gap: 6px }
.field-row label {
  font-size: 13.5px; font-weight: 600; color: #e8d4d4;
  letter-spacing: .02em;
}
.field-row input {
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(243,230,200,.25);
  border-radius: 8px; padding: 11px 14px;
  font-size: 15px; color: #f4e4e4;
  font-family: inherit; width: 100%;
  transition: border-color .15s, background .15s;
}
.field-row input::placeholder { color: rgba(240,200,200,.5) }
.field-row input:focus {
  outline: none;
  border-color: rgba(243,230,200,.6);
  background: rgba(255,255,255,.14);
}
#turnstile-container { margin-top: 4px }
.form-actions { margin-top: 8px }
.form-msg {
  display: flex; align-items: flex-start; gap: 12px;
  border-radius: 10px; padding: 16px; font-size: 15px;
}
.form-msg span { font-size: 18px; flex-shrink: 0; margin-top: 1px }
.form-msg p { margin: 0 }
.form-msg-ok {
  background: rgba(60,160,80,.18);
  border: 1px solid rgba(60,200,80,.3);
  color: #b0f0c0;
}
.form-msg-err {
  background: rgba(200,60,60,.18);
  border: 1px solid rgba(240,80,80,.3);
  color: #f4c0c0;
}

/* ── footer (fixed dark, both themes) ── */
footer { background: #1a0e0e; color: #c4a8a8; padding: 32px 0 }
footer .wrap {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
}
footer .fbrand {
  display: flex; align-items: center; gap: 10px;
  font-family: Georgia, serif; color: #f3e0e0; font-size: 15px;
}
footer .fbrand .seal {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #a52020, #6b1010);
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
footer .fbrand .seal svg { width: 20px; height: 20px; display: block }
footer a { color: #e0b8b8 }
footer .flinks { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13.5px }
footer .copy {
  width: 100%; font-size: 12px; color: #9a7a7a;
  border-top: 1px solid #3a2020; padding-top: 16px; margin-top: 4px;
}

/* ── reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  .card:hover { transform: none }
  .btn:active { transform: none }
}

/* ── mobile ── */
@media (max-width: 640px) {
  .topbar .brand .wm small { display: none }
  .topnav .btn-ghost { display: none }  /* collapse secondary CTA on small screens */
  .hero .wrap { padding: 52px 20px 60px }
  section.band { padding: 48px 0 }
  .axes { grid-template-columns: 1fr }
  .signup-box { padding: 28px 20px }
  .hero .cta-row .btn { width: 100% }
  .hero .divider { display: none }
  footer .wrap { flex-direction: column; align-items: flex-start }
}
