/* ============================================================
   MESSIANA — messiana.org
   Art direction matched to the app:
   - Dark mode (default aesthetic): midnight navy, cream, antique gold
   - Light mode: warm ivory, deep slate teal, sage
   Type: Boska (high-contrast display serif) + Work Sans (body)
   ============================================================ */

:root,
[data-theme='light'] {
  --color-bg: #faf7f2;
  --color-surface: #fffef9;
  --color-surface-2: #fdfbf7;
  --color-surface-offset: #f4f8f4;
  --color-surface-offset-2: #eef3ee;
  --color-surface-dynamic: #e8eee8;
  --color-divider: #e5e9e4;
  --color-border: #d5dfd3;

  --color-text: #2c302e;
  --color-text-muted: #5f6b66;
  --color-text-faint: #8f9c95;
  --color-text-inverse: #faf7f2;

  --color-primary: #205456;
  --color-primary-hover: #173e41;
  --color-primary-active: #103031;
  --color-primary-highlight: #dce9e6;

  --color-sage: #7e9d84;
  --color-gold: #a8842c;
  --color-gold-soft: #d4a843;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px rgba(44, 48, 46, 0.06);
  --shadow-md: 0 4px 12px rgba(44, 48, 46, 0.08);
  --shadow-lg: 0 12px 32px rgba(44, 48, 46, 0.14);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  --font-display: 'Boska', 'Didot', Georgia, serif;
  --font-body: 'Work Sans', 'Helvetica Neue', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #0c1220;
  --color-surface: #111a2c;
  --color-surface-2: #131c2e;
  --color-surface-offset: #0f1626;
  --color-surface-offset-2: #151e30;
  --color-surface-dynamic: #1a2438;
  --color-divider: #1b2436;
  --color-border: #2a3752;

  --color-text: #f5f5f0;
  --color-text-muted: #a9b0b8;
  --color-text-faint: #6b7484;
  --color-text-inverse: #15171c;

  --color-primary: #d4a843;
  --color-primary-hover: #e2b75a;
  --color-primary-active: #c29a38;
  --color-primary-highlight: #3a3216;

  --color-sage: #8bae8e;
  --color-gold: #d4a843;
  --color-gold-soft: #e5c268;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* ---------- Base ---------- */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
  scroll-padding-top: var(--space-16, 4rem);
}

:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-hero: clamp(2.5rem, 1rem + 4vw, 5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  line-height: 1.15;
  font-family: var(--font-display);
  font-weight: 400;
}

p,
li,
figcaption {
  text-wrap: pretty;
  max-width: 72ch;
}

::selection {
  background: color-mix(in oklab, var(--color-gold) 35%, transparent);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

a,
button,
[role='button'],
[role='link'] {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
}

.site-header__inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
}

.brand__mark {
  color: var(--color-gold);
  flex-shrink: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.site-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--color-text);
}

.site-nav a[aria-current='page'] {
  color: var(--color-gold);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

/* ---------- Layout primitives ---------- */

.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--content-narrow);
}

.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

.section--offset {
  background: var(--color-surface-offset);
}

.eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-gold);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

h1.section-title {
  font-size: var(--text-2xl);
}

.section-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-6);
}

.section-lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 62ch;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(var(--space-12), 7vw, var(--space-20));
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(var(--space-8), 4vw, var(--space-16));
  align-items: center;
}

.hero h1 {
  font-size: var(--text-hero);
  line-height: 1.05;
  margin-bottom: var(--space-6);
}

.hero h1 em {
  font-style: italic;
  color: var(--color-gold);
}

.hero__lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.hero__note {
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.hero__image {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 3 / 4;
  max-width: 520px;
  justify-self: center;
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
}

.btn--ghost {
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--ghost:hover {
  border-color: var(--color-text-muted);
}

/* ---------- Strongholds strip ---------- */

.strongholds {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.strongholds span {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
}

/* ---------- Feature grid ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}

.feature-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.feature-card p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.feature-card .glyph {
  color: var(--color-gold);
  margin-bottom: var(--space-5);
}

/* ---------- Steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  counter-reset: step;
}

.step {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-5);
}

.step::before {
  counter-increment: step;
  content: '0' counter(step);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-gold);
}

.step h3 {
  font-size: var(--text-lg);
  margin-block: var(--space-3);
}

.step p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---------- Split / pull quote ---------- */

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(var(--space-8), 4vw, var(--space-16));
  align-items: center;
}

.split__image {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.split__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

blockquote {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.3;
  max-width: 30ch;
}

blockquote em {
  color: var(--color-gold);
}

blockquote cite {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--color-text-muted);
  margin-top: var(--space-4);
}

/* ---------- Mission ---------- */

.mission {
  background: var(--color-surface-offset);
}

.mission .split__image {
  aspect-ratio: 3 / 4;
  max-height: 560px;
}

.mission p + p {
  margin-top: var(--space-4);
}

.mission .fine {
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ---------- Closing CTA ---------- */

.cta {
  text-align: center;
}

.cta h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-5);
}

.cta p {
  color: var(--color-text-muted);
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-10);
  margin-top: var(--space-12);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
}

.site-footer a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--color-text);
}

.site-footer .legal {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ---------- Legal pages ---------- */

.legal-body h2 {
  font-size: var(--text-lg);
  margin-top: var(--space-10);
  margin-bottom: var(--space-3);
}

.legal-body p,
.legal-body li {
  color: var(--color-text-muted);
}

.legal-body p + p {
  margin-top: var(--space-4);
}

.legal-body ul,
.legal-body ol {
  padding-left: var(--space-6);
  display: grid;
  gap: var(--space-2);
}

.legal-body a {
  color: var(--color-primary);
}

.legal-meta {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  margin-top: var(--space-4);
}

/* ---------- Support page ---------- */

.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: grid;
  gap: var(--space-3);
  max-width: 640px;
}

.contact-card a {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-gold);
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
}

.contact-card .label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--color-text-muted);
}

.faq {
  display: grid;
  gap: var(--space-4);
}

.faq details {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}

.faq summary {
  font-weight: 600;
  font-size: var(--text-base);
  cursor: pointer;
  list-style-position: outside;
}

.faq summary:hover {
  color: var(--color-gold);
}

.faq details p {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero__grid,
  .split {
    grid-template-columns: 1fr;
  }

  .split--reverse .split__image {
    order: -1;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .site-nav a:not(.site-nav__cta) {
    display: none;
  }
}
