/* ============================================================
   Rhema - Design System
   ============================================================ */

:root {
  /* ---- Locked palette (5 tokens only) ---- */
  --black: #0B0F0B;            /* deep dark forest / near black */
  --black-2: #10140F;           /* slight lift for cards on dark */
  --ink: #181A1B;               /* charcoal - text on cream */
  --ink-2: #101214;             /* deepest charcoal */
  --cream: #EFE7D6;             /* warm cream - light sections, button fill */
  --cream-deep: #EAE3D2;         /* slightly deeper cream - hover, accents */
  --white: #FFFFFF;             /* hero h1, key contrast type */
  --white-soft: #F8F6EF;        /* near-white */
  --grey-soft: #C9C9C0;         /* body text on dark */
  --grey-softer: #B8B8B0;       /* secondary text on dark */

  /* Derived alpha lines (all from the palette colours above) */
  --line-light: rgba(255, 255, 255, 0.14);
  --line-light-soft: rgba(255, 255, 255, 0.08);
  --line-dark: rgba(16, 18, 20, 0.18);
  --line-dark-soft: rgba(16, 18, 20, 0.08);
  --muted-light: rgba(255, 255, 255, 0.72);
  --muted-soft: rgba(255, 255, 255, 0.5);
  --muted-dark: rgba(16, 18, 20, 0.7);
  --muted-dark-soft: rgba(16, 18, 20, 0.5);

  /* Layout */
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-y: clamp(88px, 12vw, 160px);
  --radius: 14px;
  --radius-lg: 22px;
  --pill: 999px;

  /* Type */
  --font:
    "Neue Haas Grotesk Text Pro",
    "Inter",
    "Helvetica Neue",
    Helvetica,
    Arial,
    sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
button { font-family: inherit; }

/* ============================================================
   Layout primitives
   ============================================================ */

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

.section {
  padding: var(--section-y) 0;
  position: relative;
}

.section-dark { background: var(--black); color: var(--white); }
.section-cream { background: var(--cream); color: var(--ink); }

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3 {
  margin: 0;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2.25rem, 4.6vw, 4.25rem);
  letter-spacing: -0.025em;
  line-height: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey-soft);
}
.eyebrow-dark { color: var(--muted-dark); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 640px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-head-wide { max-width: 760px; }

.section-lede {
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.55;
  color: var(--grey-soft);
  max-width: 56ch;
  margin-top: 6px;
}
.section-lede-dark { color: var(--ink); }

.text-link {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--white);
}

/* ============================================================
   Fade-in on scroll
   ============================================================ */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 800ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js [data-reveal].in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js [data-reveal],
  .js [data-reveal].in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   Header / Nav
   ============================================================ */

.site-header {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1140px, calc(100% - 24px));
  padding: 8px 8px 8px 18px;
  background: rgba(12, 14, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--pill);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 900;
}

.nav-pills {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-pills a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  border-radius: var(--pill);
  transition: background 200ms ease, color 200ms ease;
}

.nav-pills a:hover,
.nav-pills a:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.nav-pills .nav-cta {
  background: var(--cream);
  color: var(--ink);
  margin-left: 6px;
  padding: 0 18px;
}
.nav-pills .nav-cta:hover {
  background: var(--cream-deep);
  color: var(--ink);
}

@media (max-width: 720px) {
  .nav-pills { display: none; }
  .site-header { padding: 8px 18px; }
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 28px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--pill);
  border: 1px solid transparent;
  transition:
    background 200ms ease,
    color 200ms ease,
    border-color 200ms ease,
    transform 150ms ease;
  cursor: pointer;
  white-space: nowrap;
}

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

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.42);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--white);
}

/* Outlined button on cream sections (charcoal outline, charcoal text) */
.section-cream .btn-ghost {
  color: var(--ink);
  border-color: rgba(16, 18, 20, 0.4);
}
.section-cream .btn-ghost:hover {
  background: rgba(16, 18, 20, 0.06);
  border-color: var(--ink);
}

.btn:active { transform: translateY(1px); }

/* ============================================================
   1. HERO
   ============================================================ */

.hero-dive {
  position: relative;
  background: var(--black);
}

.js .hero-dive {
  height: 200svh;
}

.js .hero-dive .hero {
  position: sticky;
  top: 0;
  height: 100svh;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: clamp(120px, 16vh, 160px);
  overflow: hidden;
  isolation: isolate;
  background: var(--black);
}

.hero-bg,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-bg {
  z-index: -2;
  object-fit: cover;
  object-position: center 60%;
  filter: saturate(0.88) brightness(0.7) contrast(1.04);
  transform-origin: center center;
  will-change: transform, filter;
}

.hero-shade {
  z-index: -1;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(0, 0, 0, 0.15) 30%,
      rgba(0, 0, 0, 0.55) 70%,
      rgba(0, 0, 0, 0.92) 100%
    );
}

.hero-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(40px, 6vh, 72px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  will-change: opacity, transform;
}

.hero h1 {
  font-size: clamp(5.5rem, 17vw, 14rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.85;
  text-transform: uppercase;
  margin: -4px 0 4px;
}

.hero-sub {
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--white);
  max-width: 18ch;
}

.hero-lede {
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.55;
  color: var(--grey-soft);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.hero-strip {
  position: relative;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 22px var(--gutter) 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  will-change: opacity, transform;
}

.hero-strip span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white-soft);
}

@media (max-width: 720px) {
  .hero-strip { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 160px; }

  /* Optimize hero for mobile: disable cinematic effect for smooth scroll */
  .js .hero-dive {
    height: auto;
  }

  .js .hero-dive .hero {
    position: relative;
    height: auto;
    min-height: 100svh;
  }

  .hero-bg {
    filter: saturate(0.88) brightness(0.7) contrast(1.04) !important;
    transform: none !important;
    will-change: auto;
  }

  .hero-inner,
  .hero-strip {
    transform: none !important;
    opacity: 1 !important;
    will-change: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .hero-dive {
    height: auto;
  }

  .js .hero-dive .hero {
    position: relative;
    height: auto;
  }

  .hero-bg,
  .hero-inner,
  .hero-strip {
    transform: none !important;
    opacity: 1 !important;
    filter: saturate(0.88) brightness(0.7) contrast(1.04) !important;
  }
}

/* ============================================================
   2. WHAT IS RHEMA
   ============================================================ */

.about-layout {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 520px;
}

.about-text h2 {
  margin-top: 4px;
  max-width: 10ch;
}

.about-body {
  display: flex;
  flex-direction: column;
  gap: 1.1em;
  font-size: clamp(1.05rem, 1.3vw, 1.18rem);
  line-height: 1.6;
  color: var(--ink-2);
  margin-top: 6px;
}

.about-image {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--ink-2);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.02);
}

@media (max-width: 820px) {
  .about-layout { grid-template-columns: 1fr; gap: 32px; }
  .about-image { aspect-ratio: 5 / 4; }
}

/* ============================================================
   3. THE WEEKLY RUN
   ============================================================ */

.run-layout {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: stretch;
}

.run-feature {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ink-2);
  min-height: 480px;
}

.run-feature img,
.run-feature video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  filter: saturate(0.92) brightness(0.88) contrast(1.03);
  display: block;
}

.run-feature-caption {
  position: absolute;
  inset: auto 24px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: rgba(11, 15, 11, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--pill);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.run-feature-eyebrow {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--grey-softer);
}

.run-feature-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--white);
}

.run-details {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.run-details li {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: baseline;
  gap: 24px;
  padding: 26px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.run-details-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--grey-softer);
}

.run-details-value {
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  line-height: 1.3;
  color: var(--white);
  font-weight: 500;
  letter-spacing: -0.005em;
}

@media (max-width: 920px) {
  .run-layout { grid-template-columns: 1fr; gap: 28px; }
  .run-feature { min-height: 360px; }
  .run-details li {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 18px 0;
  }
}

/* ============================================================
   4. WHAT TO EXPECT
   ============================================================ */

.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(28px, 5vw, 80px);
  border-top: 1px solid rgba(20, 24, 26, 0.18);
}

.step-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(20, 24, 26, 0.18);
}

.step-num {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  font-weight: 700;
  color: var(--muted-dark);
}

.step-text {
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
}

@media (max-width: 720px) {
  .step-list { grid-template-columns: 1fr; }
}

/* ============================================================
   5. MORE THAN RUNNING
   ============================================================ */

.more-layout {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.more-image {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--ink-2);
  position: sticky;
  top: 96px;
}

.more-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.03) brightness(0.95);
}

@media (max-width: 920px) {
  .more-layout { grid-template-columns: 1fr; gap: 32px; }
  .more-image { aspect-ratio: 5 / 4; position: static; }
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-list li {
  display: grid;
  grid-template-columns: 60px 1.2fr 2fr;
  align-items: baseline;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line-light);
  transition:
    padding-left 250ms ease,
    background 250ms ease;
}

.menu-list li:last-child {
  border-bottom: 1px solid var(--line-light);
}

.menu-list li:hover {
  padding-left: 12px;
}

.menu-num {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--grey-softer);
}

.menu-name {
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--white);
}

.menu-desc {
  font-size: 0.98rem;
  color: var(--grey-soft);
  line-height: 1.5;
  max-width: 46ch;
}

@media (max-width: 920px) {
  .menu-list li {
    grid-template-columns: 50px 1fr;
    gap: 8px 18px;
    padding: 24px 0;
  }
  .menu-desc { grid-column: 2; margin-top: 4px; }
}

/* ============================================================
   6. COMMUNITY MOMENTS
   ============================================================ */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: clamp(160px, 19vw, 230px);
  gap: 14px;
}

.photo {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  position: relative;
  background: var(--ink-2);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1);
  filter: saturate(0.95);
}

.photo:hover img { transform: scale(1.04); }

/* Community-table is photo-1 - editorial hero of the gallery */
.photo-1 { grid-column: span 4; grid-row: span 2; }
.photo-2 { grid-column: span 2; grid-row: span 1; }
.photo-3 { grid-column: span 2; grid-row: span 1; }
.photo-4 { grid-column: span 3; grid-row: span 1; }
.photo-5 { grid-column: span 3; grid-row: span 1; }

@media (max-width: 720px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 170px;
    gap: 10px;
  }
  .photo-1 { grid-column: span 2; grid-row: span 2; }
  .photo-2,
  .photo-3 { grid-column: span 1; grid-row: span 1; }
  .photo-4,
  .photo-5 { grid-column: span 2; grid-row: span 1; }
}

/* ============================================================
   7. FAQ
   ============================================================ */

.faq-layout {
  display: grid;
  grid-template-columns: 4fr 7fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.faq-layout .section-head { margin-bottom: 0; padding-top: 8px; }

.faq {
  display: grid;
  gap: 0;
}

.faq details {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding: 22px 0;
}

.faq details:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--white);
  transition: color 200ms ease;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 250ms ease;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-bottom: 0;
  margin-top: 4px;
}

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

.faq details p {
  margin-top: 14px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--grey-soft);
  max-width: 60ch;
}

@media (max-width: 820px) {
  .faq-layout { grid-template-columns: 1fr; gap: 32px; }
}

/* ============================================================
   8. FINAL CTA
   ============================================================ */

.cta {
  position: relative;
  min-height: 78svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--black);
}

.cta-bg,
.cta-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cta-bg {
  z-index: -2;
  object-fit: cover;
  filter: saturate(0.85) brightness(0.6) contrast(1.05);
}

.cta-shade {
  z-index: -1;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.45) 50%,
      rgba(0, 0, 0, 0.85) 100%
    );
}

.cta-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.cta h2 {
  font-size: clamp(2.5rem, 5.5vw, 5rem);
  letter-spacing: -0.025em;
  max-width: 16ch;
  line-height: 1;
}

.cta-lede {
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.55;
  color: var(--grey-soft);
  max-width: 52ch;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 480px) {
  .cta-actions { width: 100%; }
  .cta-actions .btn { flex: 1 1 120px; min-width: 0; }
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  background: var(--black);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 36px 0 48px;
}

.footer-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer-tagline {
  font-size: 0.78rem;
  color: var(--grey-soft);
  letter-spacing: 0.04em;
}

.footer-meta {
  font-size: 0.72rem;
  color: var(--grey-softer);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================
   Mobile fine-tune
   ============================================================ */

@media (max-width: 480px) {
  :root {
    --section-y: clamp(64px, 14vw, 100px);
  }
  .site-header {
    top: 12px;
    width: calc(100% - 16px);
  }
  .hero { padding-top: 100px; }
  .hero h1 { letter-spacing: -0.035em; }
}
