:root {
  --bg: #08070a;
  --fg: #f2ede4;
  --fg-dim: rgba(242, 237, 228, 0.62);
  --gold: #c9a45c;
  --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(--gold);
  color: #08070a;
}

/* 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, #14121a 0%, #08070a 70%);
}

.intro-eyebrow {
  font-family: var(--serif-he);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--gold);
  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(242, 237, 228, 0.25);
  overflow: hidden;
}

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

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

/* day sections */
main#days {
  position: relative;
}

/* Each day is now two plain full-height sections in normal scroll order:
   a text card (day number, 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. */
.day-group {
  position: relative;
}

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

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

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

.day-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: #0c0a0e;
}

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

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

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

.day-index {
  font-family: var(--serif-en);
  font-style: italic;
  color: var(--gold);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  letter-spacing: 0.28em;
  margin-bottom: 1rem;
  text-align: left;
}

.day-index::before {
  content: "DAY ";
  font-style: normal;
  opacity: 0.55;
}

.day-index .num {
  letter-spacing: 0.06em;
}

.day-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(201, 164, 92, 0.35);
  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(--gold);
}

/* 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(--gold);
  border-color: var(--gold);
}

/* 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(--gold);
}

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

/* fixed counter */
.day-counter {
  position: fixed;
  bottom: 2.2rem;
  right: 2.4rem;
  z-index: 10;
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  display: flex;
  gap: 0.3rem;
  pointer-events: none;
}

.day-counter #counter-current {
  color: var(--gold);
}

.counter-sep { opacity: 0.4; }

@media (max-width: 640px) {
  .day-text { padding: 6vh 6vw; }
  .day-counter { display: none; }
}
