/* ─────────────────────────────────────────────────────────────
   THE NIGHT TEMPLE — Sleep Sanctuary landing
   Palette ratio (non-negotiable): 70% Obsidian / 20% Bone / 8% Brass
   ───────────────────────────────────────────────────────────── */

:root {
  /* Obsidian family — backgrounds (70%) */
  --obsidian: #0F0A1A;          /* Primary bg — reads black, hums purple */
  --temple-midnight: #141024;    /* Cards, hero sections */
  --astral-void: #0A0712;        /* Deepest — favicon, max contrast */

  /* Bone family — text (20%) */
  --bone: #EDE6D6;               /* Off-white — never use pure white */
  --somnus-gray: #6E6874;        /* Secondary text, metadata */

  /* Accent — brass (under 10%, the tap magnet) */
  --brass: #B08D57;              /* Primary accent — CTAs, highlights */
  --bronze: #8A6A3D;             /* Dividers, fine linework */

  /* Royal & Ritual — used sparingly */
  --hierophant: #5B2A86;         /* Imperial accents */
  --amethyst: #6B3FA0;           /* Glow gradients */
  --ember: #7A2E3A;              /* Errors, ritual moments — under 2% */

  /* Aliases for legacy class hooks */
  --bg: var(--obsidian);
  --bg-soft: var(--temple-midnight);
  --ink: var(--bone);
  --ink-dim: var(--somnus-gray);
  --accent: var(--brass);
  --accent-strong: #C9A268;      /* hover state */
  --line: rgba(176, 141, 87, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --radius: 14px;

  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-meta: "Michroma", "Inter", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--obsidian);
  color: var(--bone);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse at top, rgba(91, 42, 134, 0.18), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(176, 141, 87, 0.06), transparent 50%),
    var(--obsidian);
  min-height: 100vh;
}

.shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 22px 64px;
}

/* ── Brand mark (Asclepian Stave) ─────────────────────────── */
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--brass);
}
.brand-mark svg { display: block; height: 56px; width: auto; }

/* ── Eyebrow / metadata (Michroma) ────────────────────────── */
.eyebrow {
  font-family: var(--font-meta);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 18px;
  font-weight: 400;
  text-align: center;
}

.meta-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-meta);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 28px;
  opacity: 0.75;
}
.meta-rule::before,
.meta-rule::after {
  content: "";
  flex: 0 1 60px;
  height: 1px;
  background: var(--line);
}

/* ── Display headlines (Cinzel) ───────────────────────────── */
h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 7vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 18px;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  color: var(--bone);
}
h1 em {
  font-style: normal;
  color: var(--brass);
}

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 4.5vw, 1.7rem);
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 14px;
  color: var(--bone);
}
h2 em {
  font-style: normal;
  color: var(--brass);
}

h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0;
  margin: 0 0 10px;
  color: var(--brass);
}

/* ── Body copy ────────────────────────────────────────────── */
.lede {
  font-size: 1.05rem;
  color: var(--bone);
  opacity: 0.85;
  margin: 0 0 24px;
  text-align: center;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}
.lede.small { font-size: 0.98rem; max-width: 44ch; }
.lede.left { text-align: left; max-width: none; margin-left: 0; margin-right: 0; }

.hero { margin-bottom: 36px; }
.hero-slim { margin-bottom: 28px; }

/* ── Form ─────────────────────────────────────────────────── */
.lead-form {
  background: var(--temple-midnight);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.field {
  display: block;
  margin-bottom: 14px;
}
.field span {
  display: block;
  font-family: var(--font-meta);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--somnus-gray);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  padding: 14px 14px;
  font-size: 1rem;
  background: var(--astral-void);
  color: var(--bone);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.field input:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-meta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, background 0.15s, border-color 0.15s;
  line-height: 1.15;
  text-align: center;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brass);
  color: var(--astral-void);
  width: 100%;
}
.btn-primary:hover { background: var(--accent-strong); }

.btn-ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--line);
}
.btn-ghost:hover { color: var(--bone); border-color: var(--brass); }

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(10, 7, 18, 0.3);
  border-top-color: var(--astral-void);
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn-spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-error {
  font-family: var(--font-meta);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d49ba6;
  margin: 12px 0 0;
  text-align: center;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 0;
}
.cta-row .btn { flex: 1 1 auto; }

/* ── Proof / bullets ──────────────────────────────────────── */
.proof { margin: 36px 0; }
.bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bullets li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--bone);
  opacity: 0.78;
}
.bullets li:last-child { border-bottom: none; }
.bullets li strong { color: var(--brass); font-weight: 600; }
.bullets.tight li { padding: 10px 0; }

/* ── Cards (thank-you, upsell) ────────────────────────────── */
.card {
  background: var(--temple-midnight);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  margin: 28px 0;
  box-shadow: var(--shadow);
}

.upsell em { color: var(--brass); font-style: normal; }

.assessment-card .assessment { margin-top: 6px; }

.q {
  border: none;
  padding: 0;
  margin: 0 0 22px;
}
.q legend {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--bone);
  margin-bottom: 12px;
  padding: 0;
  font-size: 1rem;
}
.q label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  color: var(--bone);
  opacity: 0.78;
  font-size: 0.97rem;
}
.q label:hover { border-color: rgba(176, 141, 87, 0.4); opacity: 1; }
.q input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--brass);
}
.q label:has(input:checked) {
  border-color: var(--brass);
  background: rgba(176, 141, 87, 0.08);
  opacity: 1;
}

.result {
  margin-top: 24px;
  padding: 22px;
  background: rgba(176, 141, 87, 0.06);
  border: 1px solid rgba(176, 141, 87, 0.28);
  border-radius: var(--radius);
}

blockquote {
  margin: 12px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--brass);
  background: rgba(176, 141, 87, 0.05);
  color: var(--bone);
  font-style: italic;
  border-radius: 6px;
}

code {
  background: rgba(237, 230, 214, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: var(--font-meta);
}

.foot {
  margin-top: 56px;
  text-align: center;
  color: var(--somnus-gray);
  font-family: var(--font-meta);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ── Tablet / desktop refinement ──────────────────────────── */
@media (min-width: 640px) {
  .shell { padding: 56px 24px 96px; }
  .lead-form { padding: 28px; }
  .cta-row .btn { flex: 0 1 auto; }
  .btn-primary { width: auto; min-width: 280px; }
}

/* ── Stripe Embedded Checkout modal ────────────────────────── */
.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 7, 18, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}
.checkout-modal[hidden] { display: none; }
.checkout-card {
  background: var(--bone);
  color: var(--obsidian);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  padding: 24px 20px 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  position: relative;
}
.checkout-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--somnus-gray);
  cursor: pointer;
  padding: 4px 10px;
}
.checkout-close:hover { color: var(--obsidian); }
#checkout { min-height: 320px; }
.btn[disabled], .btn.is-loading { opacity: 0.7; cursor: progress; }
