/* ============================================
   NEW SEASON CHURCH — Design System
   System fonts for fast, native feel
   ============================================ */

/* ---------- Tokens ---------- */
:root {
  /* Color */
  --bg: #0a0908;
  --bg-elev: #131211;
  --bg-elev-2: #1c1a18;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3efe6;
  --text-dim: #a8a098;
  --text-muted: #6b6560;
  --ember: #c44a45;      /* primary accent — deep red, matched to logo */
  --ember-soft: #a52a2a;
  --gold: #e8b87a;        /* secondary warm accent */
  --cool: #7ea8c4;        /* cool accent for contrast pops */

  /* Theme-aware compound colors */
  --overlay-strong: rgba(10, 9, 8, 0.55);
  --overlay-soft: rgba(10, 9, 8, 0.3);
  --hero-grad: linear-gradient(180deg, rgba(10, 9, 8, 0) 0%, rgba(10, 9, 8, 0.4) 50%, rgba(10, 9, 8, 0.85) 100%);
  --invert-svg: 0; /* 0 = no invert (dark mode), 1 = invert SVGs designed for dark bg */
  --logo-bg: transparent;

  /* Type — SF Pro with platform-appropriate fallbacks
     iOS/macOS: SF Pro · Windows: Segoe UI · Android: Roboto · Linux: Helvetica */
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  /* Layout */
  --container: 1320px;
  --container-wide: 1480px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Light Theme ---------- */
[data-theme="light"] {
  --bg: #faf7f2;            /* warm off-white, not stark */
  --bg-elev: #ffffff;
  --bg-elev-2: #f0ebe2;
  --line: rgba(40, 30, 25, 0.10);
  --line-strong: rgba(40, 30, 25, 0.20);
  --text: #1a1410;          /* deep warm black for body */
  --text-dim: #5a514a;
  --text-muted: #8a8178;
  --ember: #a52a2a;         /* shift to the deeper variant — better contrast on light bg */
  --ember-soft: #c44a45;
  --gold: #b8853a;
  --cool: #4a7a9a;

  --overlay-strong: rgba(255, 255, 255, 0.55);
  --overlay-soft: rgba(255, 255, 255, 0.3);
  --hero-grad: linear-gradient(180deg, rgba(250, 247, 242, 0) 0%, rgba(250, 247, 242, 0.4) 50%, rgba(250, 247, 242, 0.85) 100%);
  --header-scrolled: rgba(250, 247, 242, 0.92);
  --page-hero-grad: linear-gradient(to bottom, rgba(250, 247, 242, 0.85), rgba(250, 247, 242, 0.5));
}

/* Light theme — visual element adjustments that variables alone can't handle */
[data-theme="light"] .hero-grain {
  opacity: 0.18;
}

/* Light theme loader — keep dark since the matrix code rain needs contrast */
[data-theme="light"] .loader {
  background: #0a0908; /* always dark, matrix rain needs it */
}
[data-theme="light"] .loader-center-title { color: #f3efe6; }
[data-theme="light"] .loader-center-tagline,
[data-theme="light"] .loader-skip { color: rgba(243, 239, 230, 0.5); }

/* Photo slot tints (welcome grid) — switch to light versions */
[data-theme="light"] .photo-slot.tint-ember::before {
  background: linear-gradient(135deg, rgba(196, 74, 69, 0.12), rgba(250, 247, 242, 0.4));
}
[data-theme="light"] .photo-slot.tint-gold::before {
  background: linear-gradient(135deg, rgba(184, 133, 58, 0.12), rgba(250, 247, 242, 0.4));
}
[data-theme="light"] .photo-slot.tint-cool::before {
  background: linear-gradient(135deg, rgba(74, 122, 154, 0.12), rgba(250, 247, 242, 0.4));
}

/* Mosaic cells — change badge bg */
[data-theme="light"] .mosaic-cell.is-badge {
  background: var(--bg-elev-2);
}
[data-theme="light"] .mosaic-cell.is-text {
  background: var(--bg-elev);
}

/* Hero slide text needs to stay readable when images load — add stronger gradient */
[data-theme="light"] .hero-slide::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 60%, rgba(0, 0, 0, 0.7) 100%);
}
[data-theme="light"] .hero-slide-inner { color: #fff; }
[data-theme="light"] .hero-slide-meta .eyebrow,
[data-theme="light"] .hero-slide-meta .tag,
[data-theme="light"] .hero-slide-title,
[data-theme="light"] .hero-slide-sub {
  color: #fff;
}
[data-theme="light"] .hero-slide-title em { color: var(--ember-soft); }

/* Connect-cta dark gradient → soft light version */
[data-theme="light"] .connect-cta {
  background:
    radial-gradient(circle at 80% 20%, rgba(196, 74, 69, 0.08), transparent 50%),
    linear-gradient(135deg, var(--bg-elev), var(--bg-elev-2) 100%);
}

/* Give-quote: dark cinema background → soft tinted in light */
[data-theme="light"] .give-quote {
  background:
    radial-gradient(circle at 80% 20%, rgba(196, 74, 69, 0.10), transparent 50%),
    linear-gradient(135deg, #fff5ee 0%, var(--bg-elev) 70%);
}

/* Smooth transitions when switching themes */
body, .site-header, .site-footer, .ministry, .sermon-item, .other-way,
.give-form-card, .give-aside-card, .featured-video-frame, .photo-slot,
.btn, .mosaic-cell, .nav-dropdown, .mobile-menu, .watch-player,
.connect-cta, .place-card, .belief-card, .team-member, .value-card {
  transition: background-color 0.4s var(--ease-out),
              border-color 0.4s var(--ease-out),
              color 0.4s var(--ease-out);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Mobile tap highlights — remove the default blue/gray overlay on iOS/Android */
* { -webkit-tap-highlight-color: transparent; }
input, textarea, select, button { -webkit-tap-highlight-color: transparent; }

/* Prevent iOS zoom on input focus by ensuring min font-size of 16px */
input, textarea, select { font-size: 16px; }

/* Selection */
::selection { background: var(--ember); color: var(--bg); }

/* Scrollbar (subtle) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-elev-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #2a2724; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section-tight { padding-block: clamp(3rem, 6vw, 4.5rem); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--ember);
  display: inline-block;
}

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: normal;
  letter-spacing: -0.025em;
  line-height: 0.95;
  font-variation-settings: "opsz" 144;
}
.display-xl {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 9vw, 8rem);
  letter-spacing: -0.035em;
  line-height: 0.92;
  font-variation-settings: "opsz" 144;
}
.display-lg {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 5rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
  font-variation-settings: "opsz" 144;
}
.display-md {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variation-settings: "opsz" 96;
}
.italic { font-style: italic; }
.ember { color: var(--ember); }
.gold { color: var(--gold); }
.dim { color: var(--text-dim); }

p { color: var(--text-dim); }
.lead { font-size: 1.15rem; line-height: 1.65; color: var(--text); max-width: 56ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  transition: transform 0.4s var(--ease-out), background 0.3s, color 0.3s, border-color 0.3s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--ember);
  color: var(--bg);
}
.btn-primary:hover { background: #ff8d56; }
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--ember); color: var(--ember); }
.btn .arrow {
  width: 16px; height: 16px;
  transition: transform 0.4s var(--ease-out);
}
.btn:hover .arrow { transform: translate(2px, -2px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.1rem 0;
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
  background: var(--page-hero-grad, linear-gradient(to bottom, rgba(10, 9, 8, 0.85), rgba(10, 9, 8, 0.5)));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  background: var(--header-scrolled, rgba(10, 9, 8, 0.92));
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 96;
  line-height: 1.05;
}
.brand-mark {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-text .brand-line-1 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 32;
}
.brand-text .brand-line-2 {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 1px;
}
@media (max-width: 480px) {
  .brand-text .brand-line-2 { display: none; }
}
.nav-links {
  display: flex;
  list-style: none;
  margin: 0; padding: 0;
  gap: 0.15rem;
  align-items: center;
}
.nav-links > li {
  position: relative;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.92rem;
  color: var(--text-dim);
  border-radius: 999px;
  transition: color 0.25s, background 0.25s;
  position: relative;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

/* Animated nav icons */
.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: currentColor;
  overflow: visible;
}
.nav-icon path,
.nav-icon circle,
.nav-icon line,
.nav-icon polyline,
.nav-icon rect {
  transition: transform 0.5s var(--ease-out), opacity 0.4s var(--ease-out), stroke-dashoffset 0.6s var(--ease-out);
  transform-origin: center;
}

/* Home: house icon, roof lifts */
.nav-links a:hover .ni-home .roof { transform: translateY(-1px); }

/* About: open book, pages flutter */
.nav-links a:hover .ni-about .page-l { transform: rotate(-6deg); }
.nav-links a:hover .ni-about .page-r { transform: rotate(6deg); }

/* Ministries: group dot, side dots pulse out */
.nav-links a:hover .ni-min .dot-l { transform: translateX(-1.5px); }
.nav-links a:hover .ni-min .dot-r { transform: translateX(1.5px); }
.nav-links a:hover .ni-min .dot-c { transform: translateY(-0.5px) scale(1.1); }

/* Watch: play triangle nudges forward */
.nav-links a:hover .ni-watch .play { transform: translateX(1.5px); }
.nav-links a:hover .ni-watch .ring { transform: scale(1.05); }

/* Connect: arrow shoots out */
.nav-links a:hover .ni-connect .arrow-head { transform: translate(2px, -2px); }
.nav-links a:hover .ni-connect .arrow-tail { stroke-dasharray: 14; stroke-dashoffset: 0; }
.ni-connect .arrow-tail { stroke-dasharray: 14; stroke-dashoffset: 14; }
.nav-links a .ni-connect .arrow-tail { stroke-dashoffset: 14; }

/* Give: heart beats */
.nav-links a:hover .ni-give .give-heart {
  animation: heartbeat 0.9s var(--ease-out) infinite;
  fill: rgba(196, 74, 69, 0.15);
  stroke: var(--ember);
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.12); }
  40% { transform: scale(1); }
  60% { transform: scale(1.08); }
  75% { transform: scale(1); }
}

/* Dropdown caret */
.nav-caret {
  width: 10px;
  height: 10px;
  margin-left: -0.1rem;
  transition: transform 0.35s var(--ease-out);
  opacity: 0.7;
}
.nav-links li:hover > a .nav-caret,
.nav-links li:focus-within > a .nav-caret,
.nav-links li.is-open > a .nav-caret {
  transform: rotate(180deg);
  opacity: 1;
}

/* Dropdown panel */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(20, 19, 17, 0.95);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem;
  min-width: 280px;
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out), visibility 0.3s;
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.6);
  z-index: 110;
}
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(20, 19, 17, 0.95);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.nav-dropdown::after {
  /* invisible hover bridge so cursor can cross the gap */
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
.nav-links li:hover > .nav-dropdown,
.nav-links li:focus-within > .nav-dropdown,
.nav-links li.is-open > .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-dim);
  white-space: nowrap;
  background: transparent;
  transition: background 0.2s, color 0.2s;
}
.nav-dropdown a:hover {
  background: rgba(196, 74, 69, 0.08);
  color: var(--text);
}
.nav-dropdown .dd-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  min-width: 22px;
}
.nav-dropdown .dd-label {
  flex: 1;
}
.nav-dropdown .dd-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.7;
}
.nav-dropdown a:hover .dd-meta {
  color: var(--ember);
  opacity: 1;
}
.nav-dropdown .dd-divider {
  height: 1px;
  background: var(--line);
  margin: 0.4rem 0.5rem;
  pointer-events: none;
}
.nav-dropdown .dd-footer {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ember);
}
.nav-dropdown .dd-footer:hover {
  background: rgba(196, 74, 69, 0.08);
}
.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Theme toggle button */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease-out);
  color: var(--text);
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--ember);
  color: var(--ember);
  transform: rotate(15deg);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out);
}
/* In dark mode, show moon (default) — sun is hidden */
.theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(180deg) scale(0.5);
}
.theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}
/* In light mode, show sun — moon is hidden */
[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}
[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-180deg) scale(0.5);
}

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  width: 18px; height: 1.5px;
  background: var(--text);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--text);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-cta .btn-text { display: none; }
}

/* ---------- Tablet & mobile responsive refinements ---------- */

/* Tablet — hide "Plan a Visit" CTA text, keep just the icon */
@media (max-width: 820px) {
  .nav-cta .btn-primary span { display: none; }
  .nav-cta .btn-primary {
    padding: 0.6rem 0.9rem;
    min-width: 40px;
    justify-content: center;
  }
  .nav-cta { gap: 0.5rem; }
  .theme-toggle { width: 38px; height: 38px; }
}

/* Mobile — hide the CTA button entirely, just keep theme toggle + hamburger */
@media (max-width: 520px) {
  .nav-cta .btn-primary { display: none; }
  .brand-text .brand-line-2 { display: none; } /* single-line brand on small screens */
  .brand-text .brand-line-1 { font-size: 0.95rem; }
  .brand-mark { width: 36px; height: 36px; }
  .site-header { padding: 0.7rem 0; }
}

/* Tighter gutters on mobile */
@media (max-width: 520px) {
  :root { --gutter: 1rem; }
}

/* Body text comfortable size on mobile */
@media (max-width: 520px) {
  body { font-size: 16px; }
  .lead { font-size: 1.05rem; }
}

/* Mobile menu — make tap targets bigger, restore comfortable type */
@media (max-width: 520px) {
  .mobile-menu { padding: 5.5rem 1.25rem 2rem; }
  .mobile-menu a { font-size: 1.8rem; padding: 0.7rem 0; }
  .mobile-menu .mm-sub a { font-size: 1rem; padding: 0.75rem 0; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  padding: 6rem var(--gutter) 3rem;
  transform: translateY(-100%);
  transition: transform 0.5s var(--ease-out), visibility 0s linear 0.5s;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
  visibility: hidden;
}
.mobile-menu.open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.5s var(--ease-out), visibility 0s linear 0s;
}
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 300;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  font-variation-settings: "opsz" 96;
}
.mobile-menu .mm-section {
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
}
.mobile-menu .mm-section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.4rem 0 0.8rem;
  border-bottom: 1px solid var(--line);
}
.mobile-menu .mm-sub {
  display: flex;
  flex-direction: column;
}
.mobile-menu .mm-sub a {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.9rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-menu .mm-sub .mm-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(5rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(196, 74, 69, 0.15), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(126, 168, 196, 0.08), transparent 60%);
}
.hero-grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

/* Full-bleed carousel — breaks out of any container */
.hero-fullbleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  position: relative;
}
.hero-fullbleed + .container-wide,
.hero-fullbleed + .container {
  margin-top: clamp(1rem, 2vw, 1.6rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: stretch;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* Series art card (Hero left) */
.series-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  min-height: clamp(420px, 60vh, 620px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  isolation: isolate;
}
.series-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 30% 40%, rgba(196, 74, 69, 0.55), transparent 55%),
    radial-gradient(circle at 70% 75%, rgba(232, 184, 122, 0.35), transparent 50%),
    linear-gradient(135deg, #2a1810 0%, #0a0908 100%);
}
.series-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(0,0,0,0.04) 2px 4px);
  mix-blend-mode: multiply;
}
.series-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.series-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 0 rgba(196, 74, 69, 0.7);
  animation: pulse 2.2s var(--ease-out) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(196, 74, 69, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(196, 74, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 74, 69, 0); }
}
.series-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144;
}
.series-title em {
  font-style: italic;
  color: var(--gold);
}
.series-bottom { display: flex; flex-direction: column; gap: 1rem; }
.series-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 42ch;
}
.series-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* Next Sunday card (Hero right) */
.sunday-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow: hidden;
}
.sunday-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ember), transparent);
  opacity: 0.6;
}
.sunday-date {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
}
.sunday-date .day {
  font-size: clamp(4rem, 9vw, 6.5rem);
  line-height: 1;
  font-weight: 300;
  letter-spacing: -0.04em;
}
.sunday-date .month {
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 400;
  color: var(--text-dim);
}
.sunday-headline {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.sunday-headline em { font-style: italic; color: var(--ember); }
.times-list {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  border-top: 1px solid var(--line);
}
.time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.time-row:last-child { border-bottom: 0; }
.time-row .label { color: var(--text-dim); text-transform: uppercase; }
.time-row .value { color: var(--text); }

/* ---------- Intro Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0a0908;
  cursor: pointer;
  transition: opacity 0.9s var(--ease-out), visibility 0.9s var(--ease-out);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* The crown is the centerpiece — sized relative to viewport */
.loader-stage {
  position: relative;
  width: min(85vmin, 720px);
  height: min(85vmin, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Crown image: full size of stage, rotating slowly */
.loader-crown {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: crownRotate 36s linear infinite;
  pointer-events: none;
}
.loader-crown img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 30px rgba(196, 74, 69, 0.25));
}
@keyframes crownRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Counter — Bible book name shown INSIDE the crown's bowl */
.loader-counter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  z-index: 3;
  pointer-events: none;
  width: min(40vmin, 340px);
  text-align: center;
}
.loader-counter-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: rgba(168, 160, 152, 0.55);
}
.loader-counter-num .ember { color: #c44a45; }
.loader-counter-book {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 3.2vmin, 2.2rem);
  letter-spacing: 0.02em;
  color: #f3efe6;
  line-height: 1.05;
  min-height: 1.2em;
  /* Subtle reveal on swap — handled by JS via class toggle */
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.loader-counter-book.swapping {
  opacity: 0;
  transform: translateY(4px);
}

/* Tagline below crown */
.loader-tagline {
  position: absolute;
  bottom: clamp(2rem, 5vh, 3rem);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(168, 160, 152, 0.55);
  opacity: 0;
  animation: fadeIn 0.9s var(--ease-out) forwards;
  animation-delay: 1.2s;
  z-index: 3;
}
@keyframes fadeIn { to { opacity: 1; } }

/* Skip hint */
.loader-skip {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(168, 160, 152, 0.45);
  opacity: 0;
  animation: fadeIn 0.6s var(--ease-out) forwards;
  animation-delay: 2.0s;
  z-index: 3;
}

/* Prevent body scroll while loader is active */
body.loading { overflow: hidden; }

/* Mobile loader */
@media (max-width: 520px) {
  .loader-stage { width: 95vmin; height: 95vmin; }
  .loader-counter-book { font-size: 1.3rem; }
  .loader-skip { font-size: 0.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .loader-crown { animation: none !important; }
  .loader-counter-book,
  .loader-tagline,
  .loader-skip {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    opacity: 1 !important;
    transition: none !important;
  }
}

/* ---------- Hero Carousel (full-width series art rotator) ---------- */
.hero-carousel {
  position: relative;
  overflow: hidden;
  aspect-ratio: 21 / 9;
  min-height: 480px;
  background: transparent;
  isolation: isolate;
}
@media (max-width: 900px) {
  .hero-carousel { aspect-ratio: 4 / 5; min-height: 560px; }
}
@media (max-width: 500px) {
  .hero-carousel { aspect-ratio: 3 / 4; min-height: 600px; }
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 6vw, 5rem);
  background-size: cover;
  background-position: center;
}
.hero-slide.active { opacity: 1; z-index: 1; }
.hero-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,9,8,0) 0%, rgba(10,9,8,0.15) 45%, rgba(10,9,8,0.75) 100%);
  z-index: 0;
}
.hero-slide-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 880px;
}
.hero-slide-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.hero-slide-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144;
  margin: 0;
}
.hero-slide-title em { font-style: italic; color: var(--gold); }
.hero-slide-sub {
  color: var(--text);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  max-width: 56ch;
  margin: 0;
}
.hero-slide-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* Carousel controls */
.carousel-controls {
  position: absolute;
  bottom: clamp(1.5rem, 4vw, 2.5rem);
  right: clamp(1.5rem, 6vw, 5rem);
  z-index: 2;
  display: flex;
  gap: 0.5rem;
}
.carousel-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: var(--overlay-strong);
  color: var(--text);
  backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.carousel-btn:hover { background: var(--ember); border-color: var(--ember); color: var(--bg); }

.carousel-dots {
  position: absolute;
  top: clamp(1.5rem, 4vw, 2.5rem);
  right: clamp(1.5rem, 6vw, 5rem);
  z-index: 2;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.carousel-dot {
  width: 32px;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  border: 0;
  cursor: pointer;
  transition: background 0.3s;
  position: relative;
  overflow: hidden;
}
.carousel-dot.active { background: rgba(255,255,255,0.85); }
.carousel-dot.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ember);
  animation: dotFill 6s linear forwards;
}
@keyframes dotFill {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.carousel-counter {
  position: absolute;
  top: clamp(1.5rem, 4vw, 2.5rem);
  left: clamp(1.5rem, 6vw, 5rem);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--overlay-strong);
  backdrop-filter: blur(10px);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* Mobile carousel UI: scale down + reduce dot count visibility */
@media (max-width: 520px) {
  .carousel-counter {
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.68rem;
  }
  .carousel-dots {
    top: 1rem;
    right: 1rem;
    gap: 0.3rem;
  }
  .carousel-dot { width: 22px; height: 3px; }
  .carousel-controls {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    justify-content: center;
  }
  .carousel-btn { width: 40px; height: 40px; }
  .hero-slide {
    padding: 1.5rem 1.25rem 4.5rem; /* extra bottom space for controls */
  }
  .hero-slide-title { line-height: 0.95; }
  .hero-slide-sub { font-size: 0.95rem; }
  .hero-carousel { min-height: 520px; } /* slightly less than original 600px */
}

/* Empty state — shown when /images/series/ is empty */
.carousel-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 6vw, 5rem);
  background:
    radial-gradient(ellipse at 30% 30%, rgba(196, 74, 69, 0.18), transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(232, 184, 122, 0.10), transparent 60%),
    linear-gradient(135deg, var(--bg-elev), var(--bg) 60%);
}
.carousel-empty-inner {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 600px;
}
.carousel-empty[hidden] { display: none; }

.gallery-empty {
  padding: 3rem 0;
}
.gallery-empty[hidden] { display: none; }

/* ---------- Gallery Mosaic (Iglesia Tabernaculo ref #7 style) ---------- */
.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: clamp(0.8rem, 1.6vw, 1.4rem);
  position: relative;
}
.gallery-mosaic::before {
  content: '';
  grid-column: 1; grid-row: 1;
  aspect-ratio: 1;
}
@media (max-width: 800px) {
  .gallery-mosaic { grid-template-columns: repeat(2, 1fr); }
}

.mosaic-cell {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 1.4rem;
  min-height: 100%;
  transition: transform 0.6s var(--ease-out);
}
.mosaic-cell:hover { transform: translateY(-3px); }
.mosaic-cell.is-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10,9,8,0.78) 100%);
}
.mosaic-cell-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-transform: uppercase;
}

.mosaic-cell.is-text {
  background: var(--bg);
  border-color: transparent;
  align-items: center;
  justify-content: center;
}
.mosaic-cell.is-text .mosaic-text {
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  color: var(--text);
  text-align: center;
}
.mosaic-cell.is-text .mosaic-text em {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-variation-settings: "opsz" 96;
  font-size: 1.4em;
  display: block;
  color: var(--gold);
  letter-spacing: -0.02em;
  text-transform: none;
  margin-top: 0.3rem;
}
.mosaic-cell.is-badge {
  background: var(--bg);
  border-color: var(--line);
  align-items: center;
  justify-content: center;
}
.mosaic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  position: relative;
  z-index: 1;
  color: var(--ember);
}
.mosaic-badge span {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-inline: -8px;
  background: var(--bg);
}

/* Cell sizes for mosaic variety */
.mc-1x1 { grid-column: span 1; grid-row: span 1; }
.mc-2x1 { grid-column: span 2; grid-row: span 1; }
.mc-1x2 { grid-column: span 1; grid-row: span 2; }
.mc-2x2 { grid-column: span 2; grid-row: span 2; }

@media (max-width: 800px) {
  .mc-2x2 { grid-column: span 2; grid-row: span 1; }
  .mc-2x1 { grid-column: span 2; }
  .mc-1x2 { grid-column: span 1; grid-row: span 1; }
}

/* Force the grid to keep square-ish cells regardless of content */
.gallery-mosaic .mosaic-cell { aspect-ratio: 1; }
.gallery-mosaic .mc-2x1 { aspect-ratio: 2 / 1; }
.gallery-mosaic .mc-1x2 { aspect-ratio: 1 / 2; }
.gallery-mosaic .mc-2x2 { aspect-ratio: 1; }
.gallery-mosaic::before { display: none; }

/* Service-times strip (replaces Sunday card on hero) */
.times-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elev);
}
@media (max-width: 700px) { .times-strip { grid-template-columns: repeat(2, 1fr); } }
.times-strip-cell {
  padding: 1.4rem 1.5rem;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.times-strip-cell:last-child { border-right: 0; }
@media (max-width: 700px) {
  .times-strip-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .times-strip-cell:nth-child(2n) { border-right: 0; }
  .times-strip-cell:nth-last-child(-n+2) { border-bottom: 0; }
}
.times-strip-cell .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.times-strip-cell .value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 96;
}

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
  padding-block: 1.6rem;
}
.marquee-track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  animation: marquee 50s linear infinite;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 144;
}
.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 3rem;
}
.marquee-track span::after {
  content: '✺';
  font-size: 0.65em;
  color: var(--ember);
  margin-left: 3rem;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Section heads ---------- */
.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
@media (max-width: 800px) {
  .section-head { grid-template-columns: 1fr; align-items: start; gap: 1.5rem; }
}
.section-head .head-left { display: flex; flex-direction: column; gap: 1.2rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; max-width: 50ch; }

/* ---------- Welcome / About preview (photo grid) ---------- */
.welcome {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
}
@media (max-width: 900px) {
  .welcome { grid-template-columns: 1fr; }
}
.welcome-text { display: flex; flex-direction: column; gap: 1.4rem; }
.welcome-text h2 { margin: 0; }
.welcome-text .lead { margin: 0; }
.welcome-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.welcome-meta dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.welcome-meta dd { margin: 0; font-size: 1rem; color: var(--text); }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 56px);
  gap: 0.6rem;
}
.photo-slot {
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background-size: cover;
  background-position: center;
}
.photo-slot:not([style*="background-image"])::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
}
.photo-slot:not([style*="background-image"])::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, transparent 48%, var(--line) 48%, var(--line) 52%, transparent 52%);
  opacity: 0.3;
}
.photo-slot span { position: relative; z-index: 1; }

.photo-slot.s1 { grid-column: 1 / 4; grid-row: 1 / 4; }
.photo-slot.s2 { grid-column: 4 / 7; grid-row: 1 / 3; }
.photo-slot.s3 { grid-column: 4 / 7; grid-row: 3 / 5; }
.photo-slot.s4 { grid-column: 1 / 3; grid-row: 4 / 7; }
.photo-slot.s5 { grid-column: 3 / 7; grid-row: 5 / 7; }

/* Mobile: simpler 2-column layout for photo grid */
@media (max-width: 600px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 130px);
    gap: 0.5rem;
  }
  .photo-slot.s1 { grid-column: 1 / 3; grid-row: 1 / 2; }
  .photo-slot.s2 { grid-column: 1 / 2; grid-row: 2 / 3; }
  .photo-slot.s3 { grid-column: 2 / 3; grid-row: 2 / 3; }
  .photo-slot.s4 { grid-column: 1 / 2; grid-row: 3 / 5; }
  .photo-slot.s5 { grid-column: 2 / 3; grid-row: 3 / 5; }
}

/* Color tint variations on photo slots so the grid looks alive */
.photo-slot.tint-ember::before { background: linear-gradient(135deg, #2a1810, #0a0908); }
.photo-slot.tint-gold::before { background: linear-gradient(135deg, #1f1810, #0a0908); }
.photo-slot.tint-cool::before { background: linear-gradient(135deg, #0f1820, #0a0908); }

/* ---------- Ministries ---------- */
.ministries-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (max-width: 900px) { .ministries-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .ministries-grid { grid-template-columns: 1fr; } }

.ministry {
  position: relative;
  padding: 2rem 1.8rem 2rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  transition: background 0.5s var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 260px;
  overflow: hidden;
}
.ministry::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(196, 74, 69, 0.18), transparent 50%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
  pointer-events: none;
}
.ministry:hover::before { opacity: 1; }
.ministry:hover { background: var(--bg-elev); }
.ministry-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.18em;
}
.ministry-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: -0.025em;
  margin: 0;
  font-variation-settings: "opsz" 96;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.ministry-arrow {
  font-size: 1rem;
  color: var(--text-muted);
  transition: transform 0.4s var(--ease-out), color 0.3s;
}
.ministry:hover .ministry-arrow {
  transform: translate(4px, -4px);
  color: var(--ember);
}
.ministry-desc {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin: 0;
  flex: 1;
}
.ministry-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  gap: 1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
}

/* Edge handling */
.ministry:nth-child(3n) { border-right: 0; }
.ministry:nth-last-child(-n+3) { border-bottom: 0; }
@media (max-width: 900px) {
  .ministry { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .ministry:nth-child(3n) { border-right: 1px solid var(--line); }
  .ministry:nth-child(2n) { border-right: 0; }
  .ministry:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 580px) {
  .ministry { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .ministry:last-child { border-bottom: 0 !important; }
}

/* ---------- Sermons preview ---------- */
.sermons-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.sermon {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.4s var(--ease-out);
}
.sermon:hover { padding-inline: 1rem; }
.sermon-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.sermon-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sermon-title h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  margin: 0;
  letter-spacing: -0.015em;
}
.sermon-title .pastor {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sermon-duration {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.sermon-play {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.sermon-play:hover { background: var(--ember); color: var(--bg); border-color: var(--ember); }
@media (max-width: 700px) {
  .sermon { grid-template-columns: 50px 1fr auto; gap: 1rem; }
  .sermon-duration { display: none; }
}

/* ---------- Connect CTA (closing) ---------- */
.connect-cta {
  position: relative;
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 6vw, 5rem);
  background:
    radial-gradient(circle at 80% 20%, rgba(196, 74, 69, 0.25), transparent 50%),
    linear-gradient(135deg, #1a120c 0%, #0a0908 100%);
  border: 1px solid var(--line);
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}
.connect-cta h2 {
  margin: 0;
  max-width: 16ch;
}
.connect-cta p {
  margin: 0;
  max-width: 48ch;
}
.connect-cta-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: clamp(3rem, 5vw, 4.5rem) 0 calc(2rem + env(safe-area-inset-bottom));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1;
  font-variation-settings: "opsz" 144;
}
.footer-brand em { font-style: italic; color: var(--ember); }
.footer-blurb {
  margin-top: 1rem;
  max-width: 36ch;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin: 0 0 1.2rem;
  font-weight: 400;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a { color: var(--text-dim); font-size: 0.95rem; transition: color 0.25s; }
.footer-col a:hover { color: var(--ember); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-socials {
  display: flex;
  gap: 0.5rem;
}
.footer-socials a {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, color 0.3s;
}
.footer-socials a:hover { border-color: var(--ember); color: var(--ember); }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Hero load-in stagger */
.hero .series-card, .hero .sunday-card {
  opacity: 0;
  transform: translateY(20px);
  animation: heroIn 1s var(--ease-out) forwards;
}
.hero .series-card { animation-delay: 0.1s; }
.hero .sunday-card { animation-delay: 0.25s; }
@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Page-specific shared bits ---------- */
.page-hero {
  padding-top: clamp(8rem, 14vw, 11rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  position: relative;
}
.page-hero .eyebrow { margin-bottom: 1.4rem; }
.page-hero h1 { margin: 0; max-width: 18ch; }
.page-hero .lead { margin-top: 1.8rem; }

/* About page bits */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elev);
}
@media (max-width: 800px) { .values-grid { grid-template-columns: 1fr; } }
.value {
  padding: 2rem;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.value:last-child { border-right: 0; }
@media (max-width: 800px) {
  .value { border-right: 0; border-bottom: 1px solid var(--line); }
  .value:last-child { border-bottom: 0; }
}
.value-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ember);
  letter-spacing: 0.1em;
}
.value h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  margin: 0;
  letter-spacing: -0.015em;
}
.value p { margin: 0; font-size: 0.95rem; }

.team-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
@media (max-width: 900px) { .team-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .team-row { grid-template-columns: 1fr; } }
.team-member { display: flex; flex-direction: column; gap: 0.8rem; }
.team-photo {
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.team-info h4 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  margin: 0 0 0.2rem;
  letter-spacing: -0.015em;
}
.team-info .role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Watch Live page */
.watch-player {
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at center, rgba(196, 74, 69, 0.2), transparent 60%),
    linear-gradient(135deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.watch-player::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,0.015) 3px 4px);
}
.play-big {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--ember);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: transform 0.4s var(--ease-out);
}
.play-big:hover { transform: scale(1.08); }
.watch-status {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(10, 9, 8, 0.7);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px);
}

.sermons-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.tab {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  transition: all 0.25s;
  cursor: pointer;
}
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Connect page */
.connect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 3rem);
}
@media (max-width: 800px) { .connect-grid { grid-template-columns: 1fr; } }

.form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field input, .field textarea, .field select {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.25s, background 0.25s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--ember);
  background: var(--bg-elev-2);
}
.field textarea { resize: vertical; min-height: 120px; }

.info-cards { display: flex; flex-direction: column; gap: 1rem; }
.info-card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.info-card h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ember);
  margin: 0;
  font-weight: 400;
}
.info-card p { margin: 0; color: var(--text); }
.info-card .sub { color: var(--text-dim); font-size: 0.9rem; }

/* ---------- Utilities ---------- */
.divider {
  height: 1px;
  background: var(--line);
  margin-block: clamp(3rem, 5vw, 4rem);
}

.tag {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .marquee-track { animation: none; }
}
