/* =========================================================================
   Bible Steps — landing page (Bible Steps Landing v2 spec)
   Nav → scroll-race hero (380vh) → features "Stage" (500vh) → footer.
   Pinned stages are 100svh with position: sticky; the root uses
   overflow-x: clip (not hidden), or sticky stops working. When a phone's
   browser toolbar shrinks, the screen grows past the stage, so each section
   carries a background that continues its stage (ground, or the tint).
   ========================================================================= */
:root {
  --ink: #131316;
  --muted: #6E6E73;
  --faint: #A1A1A6;
  --accent: #C9A35B;          /* gold */
  --strike: #E5484D;
  --sticker: #FFCB45;
  --sand: #FCEFD3;
  --ground: #FECB7F;          /* the map art's foreground sand, along its bottom edge */
  --track: #5E5648;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.home { margin: 0; background: #fff; color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
.home a { color: inherit; }
.home-root { overflow-x: clip; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ------------------------------------------------------------------ Nav */
.snav { flex: none; width: 100%; max-width: 1160px; margin: 0 auto; padding: clamp(14px, 3vh, 28px) 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; animation: fadeIn .8s ease both; }
.snav__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.snav__brand img { width: 30px; height: auto; transform: rotate(-24deg); opacity: .85; }
.snav__brand span { font-size: 19px; font-weight: 800; letter-spacing: -.4px; }
.pill { display: inline-flex; align-items: center; padding: 10px 18px; border-radius: 999px; font-size: 15px; font-weight: 700;
  white-space: nowrap; text-decoration: none; box-shadow: inset 0 0 0 1.5px var(--ink); transition: background .2s, color .2s; }
.pill:hover { background: var(--ink); color: #fff; }

/* ---------------------------------------------------------- Race hero */
.race { position: relative; height: 380vh; background: var(--ground); }   /* shows below the stage, under the map */
.race__stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; background: #fff; }
.race__head { flex: none; text-align: center; padding: 0 20px; }
.race__count { font-size: clamp(64px, min(16vh, 22vw), 184px); font-weight: 800; line-height: .9; letter-spacing: -.06em;
  font-variant-numeric: tabular-nums; }
.race__label { margin: clamp(10px, 1.8vh, 18px) 0 0; font-size: 13px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: var(--faint); }
.race__title { margin: clamp(10px, 2.4vh, 24px) 0 0; font-size: clamp(28px, min(5.4vh, 7.2vw), 56px); font-weight: 800; line-height: 1.05; letter-spacing: -.045em; }
.race__title .accent { color: var(--accent); }
.swap { position: relative; display: inline-block; }
.swap s { text-decoration: none; position: relative; }
.swap s::after { content: ''; position: absolute; left: -4%; right: -4%; top: 52%; height: .09em; border-radius: .05em; background: var(--strike);
  transform: rotate(-4deg) scaleX(0); transform-origin: left center; animation: strike .7s 1.4s cubic-bezier(.6, 0, .3, 1) forwards; }
.swap .hand { position: absolute; left: 50%; bottom: 72%; font-family: 'Caveat', cursive; font-weight: 700; font-size: .62em;
  letter-spacing: 0; color: var(--accent); white-space: nowrap; transform: translateX(-50%) rotate(-7deg);
  clip-path: inset(-40% 100% -40% -20%); animation: write .55s 2s steps(14, end) forwards; }
@keyframes strike { to { transform: rotate(-4deg) scaleX(1); } }
@keyframes write { to { clip-path: inset(-40% -20% -40% -20%); } }   /* Caveat's d overhangs its box */

.badge { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; margin-top: clamp(12px, 2.4vh, 24px);
  padding: 8px 20px 9px; min-height: 50px; border-radius: 16px; background: var(--ink); color: #fff !important; text-decoration: none; line-height: 1.05;
  transition: transform .2s, background .2s; }
.badge:hover { background: #000; transform: translateY(-1px); }
.badge small { font-size: 10.5px; font-weight: 600; opacity: .9; }
.badge b { font-size: 21px; font-weight: 800; letter-spacing: -.03em; }

.rise { opacity: 0; transform: translateY(36px); animation: rise .9s cubic-bezier(.16, 1, .3, 1) forwards; }
.rise--1 { animation-delay: .1s; } .rise--2 { animation-delay: .3s; } .rise--3 { animation-delay: .5s; } .rise--4 { animation-delay: .7s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }

/* Race map: the wilderness tile pans with the racers. It sits on its own layer, one tile wider
   than the map, and JS slides it with a transform (repainting background-position each frame
   is slow on phones). */
.race__map { position: relative; flex: 1 1 auto; min-height: 160px; margin-top: clamp(10px, 2vh, 22px); overflow: hidden; background: var(--sand); }
.race__ground { position: absolute; top: 0; bottom: 0; left: 0; width: 200%; will-change: transform;
  background: url('/assets/steps/wilderness.webp') repeat-x 0 100% / auto 100%; }
.race__map::before { content: ''; position: absolute; inset: 0 0 auto; height: 36%; background: linear-gradient(#fff, rgba(255, 255, 255, 0)); z-index: 1; pointer-events: none; }
.race__tag { position: absolute; z-index: 6; top: 6px; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; }
.race__tag b { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; }
.race__tag b::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--strike); animation: pulse 1.6s ease-in-out infinite; }
.race__hint { display: block; margin-top: 6px; font-size: 14px; font-weight: 700; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

.race__track { position: absolute; z-index: 6; left: 0; right: 0; bottom: clamp(8px, 1.6vh, 16px); max-width: 1160px; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--track);
  text-shadow: 0 0 3px #FCEFD3, 0 0 7px #FCEFD3, 0 0 12px #FCEFD3; }   /* stays legible over the map's bushes */
.race__bar { position: relative; flex: 1; height: 4px; border-radius: 2px; background: rgba(94, 86, 72, .22); }
.race__fill { position: absolute; inset: 0 auto 0 0; width: 3%; border-radius: 2px; background: var(--accent); }
.race__dot { position: absolute; top: 50%; left: 3%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2.5px var(--ink); }

/* Racers: back to front in depth lanes */
.racer { position: absolute; left: 0; bottom: var(--lane); z-index: var(--z); will-change: transform; --h: calc(clamp(84px, min(20vh, 28vw), 180px) * var(--scale)); }
.racer__body { position: relative; transform: translateX(-50%); }
.racer__sway { transform-origin: 50% 100%; animation: sway var(--sway, 2.1s) ease-in-out infinite alternate; }
.racer__img { display: block; height: calc(var(--h) * var(--art, 1)); width: auto; max-width: none; animation: bounce var(--beat, .6s) ease-in-out infinite; animation-play-state: paused; }
.racer__shadow { position: absolute; left: 18%; right: 18%; bottom: -4px; height: 12px; border-radius: 50%; background: rgba(94, 86, 72, .22); z-index: -1;
  animation: shadow var(--beat, .6s) ease-in-out infinite; animation-play-state: paused; }
.race__map.is-running .racer__img, .race__map.is-running .racer__shadow { animation-play-state: running; }
@keyframes sway { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(1.5deg); } }
@keyframes shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.82); opacity: .6; } }

.bubble { position: absolute; left: var(--head, 50%); bottom: calc(100% - var(--h) * .06); transform: translateX(-50%); z-index: 2;
  display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px 4px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 2.5px var(--ink);
  font-size: clamp(13px, 1.9vh, 18px); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bubble::after { content: ''; position: absolute; left: 50%; top: 100%; width: 10px; height: 10px; margin: -6px 0 0 -5px; background: inherit;
  border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg); }
.bubble--you { background: var(--accent); }
.bubble--you em { font-style: normal; font-size: .62em; letter-spacing: .14em; }
.crown { position: absolute; right: -10px; top: -17px; width: 26px; height: 20px; transform: rotate(14deg); }
.crown.is-new { animation: crownIn .4s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes crownIn { from { transform: rotate(14deg) translateY(8px) scale(0); } }

/* ------------------------------------------------------ Features stage */
.stage { position: relative; height: 500vh; background: #FFF6DC; }   /* the tint (set in JS) lives here, so it also fills below the pin */
.stage__pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage__step { position: absolute; z-index: 3; top: clamp(18px, 4vh, 40px); left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .26em; }
.stage__titles { position: absolute; z-index: 3; top: calc(clamp(18px, 4vh, 40px) + 24px); left: 16px; right: 16px; height: 1.25em; overflow: hidden;
  font-size: clamp(22px, 4.6vw, 64px); text-align: center; }
.stage__titles h2 { position: absolute; inset: 0; margin: 0; font-size: 1em; font-weight: 800; line-height: 1.15; letter-spacing: -.045em; white-space: nowrap; will-change: transform, opacity; }
.stage__word { position: absolute; z-index: 1; top: 56%; left: 0; margin: 0; transform: translateY(-50%); font-size: clamp(160px, 28vw, 460px); font-weight: 800; line-height: 1;
  letter-spacing: -.04em; white-space: nowrap; color: transparent; -webkit-text-stroke: 2px rgba(19, 19, 22, .12); pointer-events: none; user-select: none; will-change: transform, opacity; }
.stage__word--greek { font-family: 'Noto Serif', Georgia, serif; font-weight: 400; letter-spacing: 0; }
.stage__bars { position: absolute; z-index: 4; left: 32px; bottom: clamp(18px, 4vh, 40px); display: flex; gap: 6px; }
.stage__bars button { position: relative; width: 30px; height: 4px; padding: 0; border: 0; border-radius: 2px; background: rgba(19, 19, 22, .14); cursor: pointer; overflow: hidden; }
.stage__bars button::before { content: ''; position: absolute; inset: -12px 0; }   /* bigger tap target */
.stage__bars i { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); }

/* Feature phone: a 430x932 design stage scaled to the component's width */
.fphone { position: absolute; z-index: 2; left: 50%; bottom: clamp(16px, 4vh, 48px); width: min(360px, 84vw, calc((100svh - 210px) * .594));
  aspect-ratio: 430 / 932; transform: translateX(-50%); }
.fphone__stage { position: absolute; left: 0; top: 0; width: 430px; height: 932px; transform-origin: 0 0; transform: scale(var(--s, .8)); }
.fphone__bezel { position: absolute; left: 42.6px; top: 167.2px; width: 343px; height: 724px; border-radius: 56px; background: var(--ink);
  box-shadow: 0 30px 60px -18px rgba(19, 19, 22, .38), 0 12px 24px -12px rgba(19, 19, 22, .3); }
.fphone__screen { position: absolute; left: 50.6px; top: 175.2px; width: 327px; height: 708px; border-radius: 48px; overflow: hidden; background: #1C1C1E; }
.fscreen { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; }
.fscreen.is-active { opacity: 1; }
.fscreen__plate { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fscreen--heroes::after { content: ''; position: absolute; left: 6%; right: 6%; bottom: -12%; height: 42%;
  background: radial-gradient(closest-side, rgba(255, 176, 92, .13), rgba(255, 176, 92, 0)); }
.fscreen--read.is-active .fscreen__clouds { animation: clouds 16s ease-in-out infinite alternate; }
@keyframes clouds { to { transform: scale(1.08); } }

/* Pop-out pieces, in the 430x932 design units of the stage. A set fades with its screen;
   .is-on plays the pieces (delays in --d, set from data-delay x 1.3) and is removed to reset. */
.fpieces { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s ease; }
.fpieces.is-active { opacity: 1; }
.fpieces:not(.is-on) * { transition: none !important; }
.piece { position: absolute; opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--r, 0deg)) scale(var(--s0, .9)); }
.fpieces.is-on .piece { opacity: 1; transform: rotate(var(--r, 0deg));      /* drift: glide in toward the resting spot */
  transition: transform 1150ms cubic-bezier(.16, 1, .3, 1) var(--d, 0ms), opacity .4s ease var(--d, 0ms); }
.pop { opacity: 0; transform: scale(.2); transform-box: fill-box; transform-origin: center; }
.fpieces.is-on .pop { opacity: 1; transform: none; transition: transform .55s cubic-bezier(.3, 1.45, .5, 1) var(--d, 0ms), opacity .2s ease var(--d, 0ms); }
.reveal { clip-path: inset(0 0 100% 0); }
.fpieces.is-on .reveal { clip-path: inset(-10% -10% -10% -10%); transition: clip-path 1.2s cubic-bezier(.4, 0, .2, 1) var(--d, 0ms); }
.lift { opacity: 0; transform: translateY(12px); }
.fpieces.is-on .lift { opacity: 1; transform: none; transition: transform .7s cubic-bezier(.16, 1, .3, 1) var(--d, 0ms), opacity .5s ease var(--d, 0ms); }
.rise-in { opacity: 0; transform: translateY(70px) rotate(var(--r, 0deg)); }
.fpieces.is-on .rise-in { opacity: 1; transform: rotate(var(--r, 0deg)); transition: transform 1150ms cubic-bezier(.16, 1, .3, 1) var(--d, 0ms), opacity .45s ease var(--d, 0ms); }
.drop { opacity: 0; transform: translateY(-34px) rotate(var(--r, 0deg)) scale(.6); }
.fpieces.is-on .drop { opacity: 1; transform: rotate(var(--r, 0deg)); transition: transform .6s cubic-bezier(.3, 1.6, .5, 1) var(--d, 0ms), opacity .25s ease var(--d, 0ms); }
.float { animation: float 3.6s ease-in-out infinite alternate; animation-delay: var(--fd, 0s); }
@keyframes float { from { transform: translateY(-3px); } to { transform: translateY(4px); } }

/* 1 · hero cards */
.hcard { border-radius: 14px; background: #252527; box-shadow: inset 0 0 0 3.2px #fff, 0 10px 18px -8px rgba(0, 0, 0, .6); }
.hcard--picked { box-shadow: inset 0 0 0 3.6px #F4C04D, 0 10px 18px -8px rgba(0, 0, 0, .6); }
.hcard img { position: absolute; left: 7%; top: 8%; width: 86%; height: 63%; object-fit: contain; animation: hop 3.4s ease-in-out infinite; animation-delay: var(--hop, 0s); }
.hcard span { position: absolute; left: 0; right: 0; bottom: 8.5%; text-align: center; color: #fff; font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.hcard__check { position: absolute; right: -10px; top: -10px; width: 27px; height: 27px; }
@keyframes hop { 0%, 72%, 100% { transform: none; } 79% { transform: translateY(-10px) rotate(-2deg); } 86% { transform: scaleY(.95); } 91% { transform: none; } }

/* 2 · reading */
.fverse { position: absolute; left: 50.6px; top: 390px; width: 327px; margin: 0; text-align: center; white-space: nowrap; color: #fff;
  font-family: Georgia, 'Times New Roman', serif; font-size: 23.8px; line-height: 32.2px; text-shadow: 0 1px 10px rgba(16, 26, 46, .45); }
.fref { position: absolute; left: 50.6px; top: 631.5px; width: 327px; margin: 0; text-align: center; color: #EBACB9; font-size: 13.6px; font-weight: 700; letter-spacing: .02em; }
.fpacers { position: absolute; height: auto; filter: drop-shadow(0 12px 16px rgba(19, 19, 22, .3)); }
.tag { display: inline-block; padding: 4px 9px 5px; border-radius: 7px; background: #fff; color: var(--ink); font-size: 10.5px; font-weight: 800; letter-spacing: .14em;
  box-shadow: 0 0 0 2.2px var(--ink), 2px 3px 0 2.2px var(--ink); }
.tag--gold { background: var(--sticker); }

/* 3 · race */
.frun img { display: block; width: 100%; height: auto; animation: bounce var(--beat, .56s) ease-in-out infinite; }
.fbubble { position: absolute; height: 39.8px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #fff;
  box-shadow: inset 0 0 0 2.6px var(--ink); font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; transform-origin: 50% 120%; }
.fbubble::after { content: ''; position: absolute; left: 50%; top: 100%; width: 11px; height: 11px; margin: -6.5px 0 0 -5.5px; background: #fff;
  border-right: 2.6px solid var(--ink); border-bottom: 2.6px solid var(--ink); transform: rotate(45deg); }
.fcrown { position: absolute; height: auto; --r: 14deg; }

/* 4 · word study */
.wcard { padding: 10px 13px 12px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 2.4px var(--ink), 4px 5px 0 2.4px var(--ink); }
.wcard__top { display: flex; justify-content: space-between; font-size: 8px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.wcard__heb { display: block; margin-top: 1px; text-align: right; font-family: 'Noto Serif Hebrew', 'Times New Roman', serif; font-size: 40px; font-weight: 600; line-height: 1.2; }
.wcard__say { display: block; font-size: 9.5px; font-weight: 600; color: var(--muted); }
.wcard strong { display: block; margin-top: 2px; font-size: 13px; font-weight: 800; }
.gk { display: inline-flex; flex-direction: column; align-items: center; padding: 6px 12px 7px; border-radius: 12px; background: #fff;
  box-shadow: 0 0 0 2.4px var(--ink), 3px 4px 0 2.4px var(--ink); }
.gk span { font-family: 'Noto Serif', Georgia, serif; font-size: 30px; font-weight: 600; line-height: 1.15; }
.gk small { font-size: 8.5px; font-weight: 700; color: var(--muted); }
.gk--gold { background: var(--sticker); }
.gk--gold small { color: #6B5520; }

/* 5 · goals */
.fdial { position: absolute; height: auto; overflow: visible; }
.fdial__ticks line { stroke: #CFCFCA; stroke-width: 1.3; stroke-linecap: round; }
.fdial__arc { stroke-dasharray: var(--len) 1000; stroke-dashoffset: var(--len); }
.fpieces.is-on .fdial__arc { stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s cubic-bezier(.4, 0, .2, 1) var(--d, 0ms); }
.fdial__knob { opacity: 0; }
.fpieces.is-on .fdial__knob { opacity: 1; transition: opacity .35s ease var(--d, 0ms); }
.fdial__num { font-family: var(--font); font-size: 37px; font-weight: 800; letter-spacing: -1.2px; fill: var(--ink); }
.fdial__unit { font-family: var(--font); font-size: 7.6px; font-weight: 700; letter-spacing: 1.8px; fill: var(--muted); }
.streak { width: 128px; padding: 8px 11px 10px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 12px 22px -10px rgba(0, 0, 0, .5); }
.streak__top { display: flex; align-items: center; gap: 7px; }
.streak__top span { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.04em; color: var(--sticker); font-variant-numeric: tabular-nums; }
.streak__top b { font-size: 9px; font-weight: 800; line-height: 1.15; letter-spacing: .12em; text-transform: uppercase; }
.streak__dots { display: flex; gap: 5px; margin-top: 7px; }
.streak__dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--sticker); }
.streak__dots .streak__open { background: none; box-shadow: inset 0 0 0 2px var(--sticker); }

/* ---------------------------------------------------------------- Footer */
.sfoot { max-width: 1160px; margin: 0 auto; padding: 24px 32px 110px; border-top: 1px solid #E5E5EA; display: flex; flex-wrap: wrap; gap: 10px 24px;
  align-items: center; justify-content: space-between; font-size: 13px; color: var(--faint); }
.sfoot nav { display: flex; gap: 18px; }
.sfoot a { text-decoration: none; }
.sfoot a:hover { color: var(--ink); }

/* ---------------------------------------------------------- Small screens */
@media (max-width: 440px) {
  .snav { padding-left: 16px; padding-right: 16px; }
  .snav__brand { gap: 8px; white-space: nowrap; }
  .pill { padding: 8px 13px; font-size: 13.5px; }
  .race__track { padding: 0 16px; }
  .stage__bars { left: 16px; }
}

/* ------------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rise, .snav, .swap .hand, .swap s::after { animation-duration: .01s !important; animation-delay: 0s !important; }
  .racer__sway, .racer__img, .racer__shadow, .race__tag b::before, .float, .hcard img, .frun img, .fscreen__clouds { animation: none !important; }
  .crown.is-new { animation: none; }
  /* the phone's pop-outs are skipped: pieces sit at rest and the screens only crossfade */
  .fpieces .piece, .fpieces .pop, .fpieces .lift, .fpieces .rise-in, .fpieces .drop { opacity: 1 !important; transform: rotate(var(--r, 0deg)) !important; transition: none !important; }
  .fpieces .pop { transform: none !important; }
  .fpieces .reveal { clip-path: none !important; }
  .fdial__arc { stroke-dashoffset: 0 !important; }
  .fdial__knob { opacity: 1 !important; }
}
