:root {
  --bg: #0a0a16;
  --fg: #eef0f6;
  --fg-dim: rgba(238, 240, 246, 0.62);
  --accent: #8b93c9;
  --serif-he: 'Frank Ruhl Libre', serif;
  --serif-en: 'Cormorant Garamond', serif;
}

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

html, body {
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
}

body {
  font-family: var(--serif-en);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* film grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* intro */
.intro {
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background: radial-gradient(ellipse at center, #16162e 0%, #0a0a16 70%);
}

.intro-eyebrow {
  font-family: var(--serif-he);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.intro-title {
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.intro-sub {
  margin-top: 1.2rem;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-style: italic;
  color: var(--fg-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-cue {
  position: absolute;
  bottom: 3rem;
  width: 1px;
  height: 60px;
  background: rgba(238, 240, 246, 0.25);
  overflow: hidden;
}

.scroll-cue span {
  position: absolute;
  top: -60px;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: scrollcue 2.2s ease-in-out infinite;
}

@keyframes scrollcue {
  0% { top: -60px; }
  60% { top: 60px; }
  100% { top: 60px; }
}

/* scene sections */
main#scenes {
  position: relative;
}

/* Each scene is now two plain full-height sections in normal scroll order:
   a text card (punchy line, posuk, translation), then a dedicated video
   section. Splitting them means the video section's aspect ratio can stay
   close to the source footage instead of being squeezed short by a header
   sharing the same viewport, which was cropping a third of the frame off
   top/bottom. No pinning, no scroll distance to wait through — each
   section is fully readable/visible the instant you land on it, text
   still never composites onto video. */
.scene-group {
  position: relative;
}

.scene-text {
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 8vh 8vw;
}

.scene-text-inner {
  max-width: 760px;
  width: 100%;
}

.scene-video {
  height: 100svh;
  overflow: hidden;
  position: relative;
}

.scene-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.0001); /* establishes its own layer for the scrub zoom */
  background: #0d0d1a;
}

/* thin seam blends only, video otherwise stays fully clear — it's the hero */
.scene-video::before,
.scene-video::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 12vh;
  pointer-events: none;
  z-index: 1;
}

.scene-video::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(5,4,10,0.35) 0%, rgba(5,4,10,0) 100%);
}

.scene-video::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(5,4,10,0.35) 0%, rgba(5,4,10,0) 100%);
}

.scene-line {
  font-family: var(--serif-en);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  line-height: 1.15;
  margin-bottom: 1.3rem;
  max-width: 18ch;
  text-align: left;
}

.verse-he {
  font-family: var(--serif-he);
  direction: rtl;
  unicode-bidi: isolate;
  text-align: left;
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  color: var(--fg);
  line-height: 1.5;
  margin-bottom: 0.9rem;
  border-top: 1px solid rgba(139, 147, 201, 0.4);
  padding-top: 1.1rem;
  max-width: 32ch;
}

.verse-en {
  font-family: var(--serif-en);
  font-style: italic;
  text-align: left;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  color: var(--fg-dim);
  line-height: 1.45;
  margin-bottom: 0.6rem;
  max-width: 42ch;
}

.verse-ref {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  color: var(--accent);
}

/* next story */
.next-story {
  padding: 14vh 8vw;
  text-align: center;
  background: var(--bg);
}

.next-story-label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 1.1rem;
}

.next-story-link {
  display: inline-block;
  font-family: var(--serif-en);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.next-story-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* back link — absolute (not fixed) so it scrolls away with the intro
   instead of staying pinned over later sections' text/video */
.back-home {
  position: absolute;
  top: 2.2rem;
  left: 2.4rem;
  z-index: 10;
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-home:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .back-home { top: 1.4rem; left: 1.6rem; font-size: 0.78rem; }
  .scene-text { padding: 6vh 6vw; }
}
