/* —— Design tokens —— */
:root {
  --bg: #0c0c0c;
  --bg-elevated: #141414;
  --text: #e6e2da;
  --text-muted: #9c968a;
  --line: #2a2824;
  --accent: #c4a574;
  --font-serif: "Cormorant Garamond", "Times New Roman", serif;
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --max-prose: 38rem;
  --max-wide: 56rem;
  --header-h: 4.25rem;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: #dcc29a;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: var(--space-sm) var(--space-md);
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  left: var(--space-sm);
  top: var(--space-sm);
}

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

/* —— Header / nav (Riad-style numbered menu) —— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--header-h);
  padding: 0 var(--space-md);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__brand {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.site-header__brand a {
  color: var(--text);
  text-decoration: none;
}

.site-header__brand a:hover {
  color: var(--accent);
}

.nav-toggle {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}

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

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
}

.site-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
}

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

.nav-num {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-size: 0.75rem;
}

@media (max-width: 960px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
    transition: max-height 0.35s ease;
  }

  .site-nav.is-open {
    max-height: 28rem;
  }

  .site-nav ul {
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-sm);
  }
}

@media (min-width: 961px) {
  .nav-toggle {
    display: none;
  }
}

/* —— Hero —— */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--header-h) + var(--space-lg)) var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.hero__grid {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: var(--space-lg);
  align-items: center;
}

@media (max-width: 768px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

.hero__title {
  margin: 0 0 var(--space-md);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(3.5rem, 12vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

.hero__title-line {
  display: block;
}

.hero__lede {
  margin: 0;
  max-width: 28rem;
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
}

/* —— Horizontal journey (mixed scroll) —— */
.horizontal-section {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
}

.horizontal-section__track {
  display: flex;
  width: fit-content;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.horizontal-section__track::-webkit-scrollbar {
  display: none;
}

.horizontal-panel {
  flex: 0 0 100vw;
  width: 100vw;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + var(--space-lg)) var(--space-md) var(--space-xl);
}

.horizontal-panel__inner {
  max-width: 28rem;
  text-align: center;
}

.horizontal-panel__num {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.horizontal-panel__title {
  margin: 0 0 var(--space-md);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.horizontal-panel__text {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--text-muted);
}

.horizontal-section__hint {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 640px) {
  .horizontal-section__hint {
    display: none;
  }
}

/* —— Photo placeholders —— */
.photo-slot {
  margin: 0;
  position: relative;
}

.photo-slot__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--line);
}

.photo-slot--hero .photo-slot__img {
  width: 100%;
  max-height: min(85vh, 40rem);
  height: auto;
  object-fit: cover;
  object-position: center top;
}

.photo-slot__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 18rem;
  aspect-ratio: 3 / 4;
  background: linear-gradient(145deg, #1a1917 0%, #252320 45%, #1a1917 100%);
  border: 1px dashed var(--line);
  border-radius: 2px;
}

.photo-slot--hero .photo-slot__placeholder {
  min-height: 22rem;
}

.photo-slot__placeholder--wide {
  aspect-ratio: 4 / 3;
  min-height: 12rem;
}

.photo-slot__hint {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.photo-slot__caption {
  margin-top: var(--space-xs);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* —— Sections —— */
.section {
  padding: var(--space-xl) var(--space-md);
  border-bottom: 1px solid var(--line);
}

.section--gist,
.section--pro {
  background: var(--bg-elevated);
}

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

.section__inner--wide {
  max-width: var(--max-wide);
}

.section__heading {
  margin: 0 0 var(--space-lg);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section__num {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.prose p {
  margin: 0 0 var(--space-md);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose strong {
  font-weight: 600;
  color: var(--text);
}

.gist-layout {
  display: grid;
  grid-template-columns: minmax(0, 14rem) 1fr;
  gap: var(--space-lg);
  align-items: start;
  margin-bottom: var(--space-lg);
}

@media (max-width: 640px) {
  .gist-layout {
    grid-template-columns: 1fr;
  }
}

.beyond-grid {
  display: grid;
  grid-template-columns: minmax(0, 16rem) 1fr;
  gap: var(--space-lg);
  align-items: start;
}

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

.highlights {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  padding-top: var(--space-md);
}

.highlights li {
  position: relative;
  padding: var(--space-sm) 0 var(--space-sm) 1.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
  color: var(--text-muted);
}

.highlights li:last-child {
  border-bottom: none;
}

.highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15em;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 1px;
}

/* —— Stats table —— */
.table-wrap {
  margin-top: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.stats-table caption {
  text-align: left;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.stats-table caption a {
  color: inherit;
}

.stats-table th,
.stats-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.stats-table thead th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom-color: var(--accent);
}

.stats-table tbody th {
  font-weight: 600;
  color: var(--text);
}

.stats-table tbody tr:hover td,
.stats-table tbody tr:hover th[scope="row"] {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

/* —— Church & General Conference videos —— */
.section--church {
  background: var(--bg);
}

.church-intro__more {
  margin-bottom: 0;
  font-size: 0.98rem;
}

.talks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.talk-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.talk-card__title {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.talk-card__meta {
  margin: 0 0 var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 2px;
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.talk-card__read {
  margin: var(--space-sm) 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.talk-card__read a {
  color: var(--accent);
}

.talk-card__read a:hover {
  color: #dcc29a;
}

/* —— Footer links —— */
.section--footer {
  padding-bottom: calc(var(--space-xl) + var(--space-md));
}

.link-list {
  margin: 0 0 var(--space-lg);
  padding: 0;
  list-style: none;
}

.link-list li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--line);
}

.link-list a {
  font-size: 1.05rem;
  font-family: var(--font-serif);
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
}

.link-list a:hover {
  color: var(--accent);
}

.fine-print {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.fine-print a {
  color: var(--text-muted);
}

.fine-print a:hover {
  color: var(--accent);
}
