/* FIRM Christian Ministries
   Cool-modernity continuous scroll + old letterhead brand (navy/maroon + logo).
   Themes: Light / Dark / Auto (prefers-color-scheme). */

:root {
  /* Brand constants (never flip) */
  --navy: #003a70;
  --maroon: #7f001b;
  --maroon-hover: #5f0014;
  --heading: #1e3a5f;
  --brand-blue: #2e5a88;
  --accent: #7f001b;
  --accent-hover: #5f0014;

  --nav-h: 3.25rem;
  --sticky-offset: var(--nav-h);
  --max: 72rem;
  --max-copy: 42rem;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ——— Light theme tokens ——— */
:root,
[data-theme="light"] {
  --ink: #1e3a5f;
  --ink-soft: #2e5a88;
  --near-black: #003a70;
  --bg-page: #f2f2f2;
  --bg-dark: #003a70;
  --bg-dark-elevated: #1e3a5f;
  --bg-light: #f2f2f2;
  --bg-white: #ffffff;
  --text-on-dark: #ffffff;
  --text-on-light: #1e3a5f;
  --muted-on-dark: rgba(255, 255, 255, 0.78);
  --muted-on-light: #666666;
  --label: #2e5a88;
  --hairline-dark: rgba(255, 255, 255, 0.14);
  --hairline-light: #d9dee5;
  --nav-bg: rgba(0, 58, 112, 0.92);
  --nav-fg: #ffffff;
  --nav-muted: rgba(255, 255, 255, 0.78);
  --nav-menu-bg: rgba(0, 58, 112, 0.98);
  --hero-mid: #1e3a5f;
  --hero-base: #003a70;
  --card-bg: #1e3a5f;
  --footer-bg: #1e3a5f;
  --theme-btn-bg: rgba(255, 255, 255, 0.12);
  --theme-btn-active: #7f001b;
  --logo-on-nav: dark; /* white wordmark */
}

/* ——— Dark theme tokens ——— */
[data-theme="dark"] {
  --ink: #e8eef6;
  --ink-soft: #a8bdd4;
  --near-black: #001a33;
  --bg-page: #001528;
  --bg-dark: #003a70;
  --bg-dark-elevated: #00264d;
  --bg-light: #0a1f38;
  --bg-white: #0f2744;
  --text-on-dark: #ffffff;
  --text-on-light: #e8eef6;
  --muted-on-dark: rgba(255, 255, 255, 0.78);
  --muted-on-light: rgba(232, 238, 246, 0.72);
  --label: #8fb0d4;
  --hairline-dark: rgba(255, 255, 255, 0.14);
  --hairline-light: rgba(255, 255, 255, 0.12);
  --nav-bg: rgba(0, 26, 51, 0.94);
  --nav-fg: #ffffff;
  --nav-muted: rgba(255, 255, 255, 0.78);
  --nav-menu-bg: rgba(0, 26, 51, 0.98);
  --hero-mid: #0a2a4d;
  --hero-base: #001a33;
  --card-bg: #0a2748;
  --footer-bg: #001528;
  --theme-btn-bg: rgba(255, 255, 255, 0.1);
  --theme-btn-active: #7f001b;
  --logo-on-nav: dark;
}

/* Auto → follow system */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --ink: #e8eef6;
    --ink-soft: #a8bdd4;
    --near-black: #001a33;
    --bg-page: #001528;
    --bg-dark: #003a70;
    --bg-dark-elevated: #00264d;
    --bg-light: #0a1f38;
    --bg-white: #0f2744;
    --text-on-dark: #ffffff;
    --text-on-light: #e8eef6;
    --muted-on-dark: rgba(255, 255, 255, 0.78);
    --muted-on-light: rgba(232, 238, 246, 0.72);
    --label: #8fb0d4;
    --hairline-dark: rgba(255, 255, 255, 0.14);
    --hairline-light: rgba(255, 255, 255, 0.12);
    --nav-bg: rgba(0, 26, 51, 0.94);
    --nav-fg: #ffffff;
    --nav-muted: rgba(255, 255, 255, 0.78);
    --nav-menu-bg: rgba(0, 26, 51, 0.98);
    --hero-mid: #0a2a4d;
    --hero-base: #001a33;
    --card-bg: #0a2748;
    --footer-bg: #001528;
    --theme-btn-bg: rgba(255, 255, 255, 0.1);
    --theme-btn-active: #7f001b;
  }
}

@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --ink: #1e3a5f;
    --ink-soft: #2e5a88;
    --near-black: #003a70;
    --bg-page: #f2f2f2;
    --bg-dark: #003a70;
    --bg-dark-elevated: #1e3a5f;
    --bg-light: #f2f2f2;
    --bg-white: #ffffff;
    --text-on-dark: #ffffff;
    --text-on-light: #1e3a5f;
    --muted-on-dark: rgba(255, 255, 255, 0.78);
    --muted-on-light: #666666;
    --label: #2e5a88;
    --hairline-dark: rgba(255, 255, 255, 0.14);
    --hairline-light: #d9dee5;
    --nav-bg: rgba(0, 58, 112, 0.92);
    --nav-fg: #ffffff;
    --nav-muted: rgba(255, 255, 255, 0.78);
    --nav-menu-bg: rgba(0, 58, 112, 0.98);
    --hero-mid: #1e3a5f;
    --hero-base: #003a70;
    --card-bg: #1e3a5f;
    --footer-bg: #1e3a5f;
    --theme-btn-bg: rgba(255, 255, 255, 0.12);
    --theme-btn-active: #7f001b;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  color: var(--text-on-light);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ——— Nav ——— */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1.25rem;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline-dark);
  color: var(--nav-fg);
  overflow: hidden; /* never let wordmark spill into hero */
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  position: relative;
  flex-shrink: 0;
  /* Guard against img max-width:100% + shrink-to-fit blow-up on iOS */
  max-width: min(46vw, 11rem);
  max-height: 2.5rem;
  height: 2.25rem;
  overflow: hidden;
}

.nav__logo-img {
  height: 36px; /* sensible mobile wordmark */
  width: auto;
  max-height: 36px;
  /* Explicit px — avoid max-width:100% circular sizing with shrink-to-fit parent (iOS) */
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
  display: none;
}

/* Nav is always dark chrome → white (dark) logo by default */
.nav__logo-img--dark {
  display: block;
}

.nav__logo-img--light {
  display: none;
}

@media (min-width: 768px) {
  .nav__logo {
    height: 2.5rem;
    max-height: 2.5rem;
    max-width: 14rem;
  }

  .nav__logo-img {
    height: 40px;
    max-height: 40px;
  }
}

.nav__links {
  display: none;
  gap: 1.5rem;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.nav__links a {
  color: var(--nav-muted);
  transition: color 0.2s var(--ease);
}

.nav__links a:hover {
  color: var(--nav-fg);
}

.nav__cta {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

.nav__cta > a {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--nav-muted);
  transition: color 0.2s var(--ease);
}

.nav__cta > a:hover {
  color: var(--nav-fg);
}

.nav__cta .nav__give {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.95rem;
  border-radius: 980px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 500;
}

.nav__cta .nav__give:hover {
  background: var(--accent-hover);
  color: #fff !important;
}

.nav__mobile-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-left: auto;
}

.nav__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 1.75rem;
  height: 1.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

.nav__toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.nav.is-open .nav__toggle span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.nav.is-open .nav__toggle span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.nav.is-open {
  overflow: visible; /* allow dropdown below bar */
}

.nav.is-open .nav__links {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--nav-menu-bg);
  padding: 1.5rem 1.25rem 2rem;
  gap: 1.25rem;
  font-size: 1rem;
  border-bottom: 1px solid var(--hairline-dark);
  z-index: 101;
}

.nav.is-open .nav__links a {
  color: var(--nav-fg);
}

/* Theme switch (desktop in CTA; mobile icon cycles) */
.theme-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0.35rem;
}

.theme-switch__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.theme-switch__group {
  display: inline-flex;
  border-radius: 980px;
  background: var(--theme-btn-bg);
  padding: 2px;
  gap: 1px;
}

.theme-switch__btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--nav-muted);
  font-family: inherit;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border-radius: 980px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.theme-switch__btn[aria-pressed="true"] {
  background: var(--theme-btn-active);
  color: #fff;
}

.theme-switch__btn:hover {
  color: var(--nav-fg);
}

.theme-switch__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--nav-fg);
  cursor: pointer;
  border-radius: 50%;
}

.theme-switch__icon:hover {
  background: var(--theme-btn-bg);
}

@media (min-width: 768px) {
  .nav {
    padding: 0 2.75rem;
  }

  .nav__links {
    display: flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .nav__cta {
    display: flex;
  }

  .nav__mobile-tools {
    display: none;
  }
}

/* ——— Sections ——— */
.section {
  scroll-margin-top: var(--sticky-offset);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 2.5rem) 1.25rem 3.5rem;
  position: relative;
}

.section__inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
}

.section__inner--narrow {
  max-width: 36rem;
  text-align: center;
}

.section__inner--split {
  display: grid;
  gap: 4rem;
  align-items: center;
}

@media (min-width: 900px) {
  .section {
    padding: calc(var(--nav-h) + 5.5rem) 2.75rem 6.5rem;
  }

  .section__inner--split {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 6rem;
  }
}

.section--dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}

.section--light {
  background: var(--bg-light);
  color: var(--text-on-light);
}

.section--elevated {
  background: var(--bg-dark-elevated);
  color: var(--text-on-dark);
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
  margin-bottom: 1rem;
}

.section__title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin-bottom: 1.75rem;
}

.section__lead {
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.015em;
  max-width: var(--max-copy);
  margin-bottom: 3rem;
}

.section--dark .section__lead,
.section--elevated .section__lead {
  color: var(--muted-on-dark);
}

.section--light .section__lead {
  color: var(--muted-on-light);
}

.section__inner--narrow .section__lead {
  margin-left: auto;
  margin-right: auto;
}

/* ——— Hero ——— */
.hero {
  text-align: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-dark);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 40%, var(--hero-mid) 0%, var(--hero-base) 70%),
    var(--hero-base);
  z-index: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  mix-blend-mode: soft-light;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 52rem;
}

.hero__title {
  font-size: clamp(2.5rem, 9vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.02;
  margin-bottom: 1.15rem;
  color: var(--text-on-dark);
}

.hero__sub {
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  font-weight: 400;
  color: var(--muted-on-dark);
  line-height: 1.45;
  letter-spacing: -0.015em;
  margin: 0 auto 1.75rem;
  max-width: 34rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

@media (max-width: 380px) {
  .hero__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__cta .btn {
    width: 100%;
  }
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: 1.35rem;
  height: 2.1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 1rem;
  display: flex;
  justify-content: center;
  padding-top: 0.35rem;
}

.scroll-hint span {
  width: 3px;
  height: 6px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 2px;
  animation: scroll-pulse 1.8s var(--ease) infinite;
}

@keyframes scroll-pulse {
  0% { opacity: 1; transform: translateY(0); }
  60% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 0; transform: translateY(0); }
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.375rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s;
  font-family: inherit;
}

.btn:hover {
  opacity: 0.92;
}

.btn--light {
  background: #fff;
  color: #1e3a5f;
}

.btn--dark {
  background: var(--navy);
  color: #fff;
}

[data-theme="dark"] .btn--dark {
  background: var(--maroon);
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .btn--dark {
    background: var(--maroon);
  }
}

.btn--accent,
.btn--blue {
  /* .btn--blue kept as alias → brand maroon */
  background: var(--maroon);
  color: #fff;
}

.btn--accent:hover,
.btn--blue:hover {
  background: var(--maroon-hover);
  opacity: 1;
}

.btn--ghost {
  background: transparent;
  color: var(--text-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.btn--ghost-dark {
  background: transparent;
  color: var(--text-on-light);
  border: 1px solid var(--hairline-light);
}

/* ——— Pillars (Who) ——— */
.pillars {
  display: grid;
  gap: 1px;
  background: var(--hairline-light);
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--hairline-light);
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .pillars {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .pillars {
    grid-template-columns: repeat(4, 1fr);
  }
}

.pillar {
  padding: 2.25rem 1.75rem;
  background: var(--bg-white);
}

.pillar h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 0.65rem;
  color: var(--text-on-light);
}

.pillar p {
  font-size: 0.9375rem;
  color: var(--muted-on-light);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* ——— Cards (Gather) ——— */
.cards {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.card {
  padding: 2.25rem 1.75rem;
  background: var(--card-bg);
  border: 1px solid var(--hairline-dark);
  border-radius: 1.125rem;
  transition: border-color 0.25s var(--ease);
}

.card:hover {
  border-color: rgba(127, 0, 27, 0.55);
}

.card__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
  margin-bottom: 0.85rem;
}

.card h3 {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.card__meta {
  font-size: 0.9375rem;
  color: var(--muted-on-dark);
  margin-bottom: 1.15rem;
}

.card p:last-child {
  font-size: 0.9375rem;
  color: var(--muted-on-dark);
  line-height: 1.5;
}

/* ——— Serve ——— */
.checklist {
  margin: 0 0 2.5rem;
}

.checklist li {
  position: relative;
  padding: 1rem 0 1rem 1.5rem;
  font-size: 1.0625rem;
  color: var(--muted-on-light);
  border-bottom: 1px solid var(--hairline-light);
  letter-spacing: -0.01em;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.4rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--maroon);
}

.visual-block {
  aspect-ratio: 1;
  max-width: 24rem;
  margin: 0 auto;
  background: var(--navy);
  border-radius: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem;
}

.visual-block span {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-on-dark);
}

/* ——— Give ——— */
.give-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.give-note {
  font-size: 0.8125rem;
  color: var(--muted-on-dark);
  letter-spacing: -0.01em;
}

/* ——— Visit ——— */
.visit-grid {
  display: grid;
  gap: 3rem;
}

@media (min-width: 640px) {
  .visit-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3.5rem;
  }
}

.visit-block h3 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
  margin-bottom: 1rem;
}

.visit-block p {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--muted-on-dark);
  letter-spacing: -0.01em;
}

.visit-block a {
  color: var(--text-on-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.3);
}

.visit-block a:hover {
  text-decoration-color: rgba(255, 255, 255, 0.7);
}

.muted {
  font-size: 0.8125rem;
  opacity: 0.65;
}

/* ——— Footer ——— */
.footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  padding: 3rem 1.5rem;
  font-size: 0.75rem;
  letter-spacing: -0.01em;
  border-top: 1px solid var(--hairline-dark);
}

.footer__tag {
  margin-top: 0.5rem;
  letter-spacing: 0.06em;
  font-size: 0.625rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* ——— Scroll reveal ——— */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-up.is-visible:nth-child(2) { transition-delay: 0.06s; }
.fade-up.is-visible:nth-child(3) { transition-delay: 0.12s; }
.fade-up.is-visible:nth-child(4) { transition-delay: 0.18s; }
.fade-up.is-visible:nth-child(5) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .scroll-hint span { animation: none; }
}



/* Scripture verse */
.verse {
  margin: 0;
  padding: 0;
  border: 0;
  text-align: center;
}
.verse p {
  font-family: Cambria, Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.5;
  color: inherit;
  margin: 0;
}
.verse cite {
  display: block;
  margin-top: 0.85rem;
  font-style: normal;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  opacity: 0.75;
}
