/* Home v2. Loaded after style.css; reuses the brand tokens from :root there
   (--bg #14163A, --paper #1E2152, --chip #282A71, --line, --ink, --muted,
   --accent, --gold, --btn, --btn-ink, --serif, --display, --shadow).
   Mobile first; flat brand surfaces, gold accents, EB Garamond / Cormorant.
   Motion curve: cubic-bezier(.22,1,.36,1). No new fonts, no scripts. */

:root { --v2-ease: cubic-bezier(.22, 1, .36, 1); --v2-max: 1120px; }

/* Skip link */
.v2-skip {
  position: absolute; left: 8px; top: -56px; z-index: 50;
  background: var(--paper); color: var(--gold); border: 1px solid var(--gold);
  border-radius: 10px; padding: 10px 16px; text-decoration: none; font-weight: 600;
  transition: transform .3s var(--v2-ease);
}
.v2-skip:focus { top: calc(8px + env(safe-area-inset-top)); outline: 2px solid var(--ui); outline-offset: 2px; }

/* Override the player-grid main from style.css for the home page */
main.home-v2 {
  display: block; max-width: none; margin: 0; padding: 0;
  grid-template-columns: none; grid-template-areas: none;
}
.home-v2 .v2-wrap { max-width: var(--v2-max); margin: 0 auto; padding: 0 16px; }
.home-v2 .thanks { max-width: 680px; margin: 16px auto 0; }

/* Shared section rhythm */
.v2-sec { padding: 48px 0; }
.v2-sec + .v2-sec { padding-top: 0; }
.home-v2 h2 {
  margin: 4px 0 12px; font-family: var(--display); font-weight: 600;
  font-size: clamp(1.75rem, 5.5vw, 2.5rem); line-height: 1.12; letter-spacing: .01em;
  color: var(--gold); text-wrap: balance;
}
.v2-sec-lead { margin: 0 0 24px; max-width: 42rem; color: var(--muted); line-height: 1.6; text-wrap: pretty; }

/* Buttons */
.v2-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 20px; }
.v2-cta-center { justify-content: center; }
.v2-primary { font-size: 1.15rem; }
.v2-primary-sm { font-size: 1.02rem; padding: 10px 22px; }
.v2-ghost {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 600;
  color: var(--gold); background: transparent; border: 1px solid var(--gold); border-radius: 999px;
  padding: 11px 24px; font-size: 1.1rem; line-height: 1.2;
  transition: background .3s var(--v2-ease), transform .3s var(--v2-ease), border-color .3s var(--v2-ease);
}
.v2-ghost:hover { background: rgba(230, 207, 143, .12); transform: translateY(-1px); }
.v2-ghost:active { transform: scale(.98); }
.v2-ghost:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.v2-ghost-ic { flex: none; width: 0; height: 0; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.v2-textlink { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(83, 190, 140, .5); font-weight: 600; }
.v2-textlink:hover { color: var(--gold); text-decoration-color: var(--gold); }

/* 1. Hero */
.v2-hero { padding: 24px 0 40px; border-bottom: 1px solid var(--line); }
.v2-hero-in { display: grid; gap: 28px; align-items: center; }
.v2-hero-copy { text-align: center; }
.v2-h1 { margin: 6px 0 14px; font-weight: normal; line-height: 1.04; }
.v2-h1-main { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(2.4rem, 10vw, 4rem); color: var(--gold); letter-spacing: .01em; text-wrap: balance; }
.v2-h1-sub { display: block; margin-top: 4px; font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 5.5vw, 2.1rem); font-style: italic; color: var(--muted); }
.v2-lead { margin: 0 auto 22px; max-width: 34rem; font-size: 1.12rem; line-height: 1.6; color: var(--ink); text-wrap: pretty; }
.v2-hero-copy .v2-cta-row { justify-content: center; }

.v2-proof {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin: 6px 0 0;
  font-size: .95rem; color: var(--muted); font-variant-numeric: lining-nums tabular-nums;
}
.v2-proof span { display: inline-flex; align-items: center; }
.v2-proof span + span::before { content: "\00B7"; margin-right: 10px; color: var(--gold); opacity: .8; }

/* Stills with play badge (hero + feature) */
.v2-still { display: block; text-decoration: none; color: var(--muted); }
.v2-frame {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px;
  border: 1px solid var(--line); background: #0c1230; box-shadow: 0 16px 34px -18px var(--shadow);
}
.v2-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v2-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 60px; height: 60px; border-radius: 50%; background: rgba(83, 190, 140, .94);
  display: grid; place-items: center; box-shadow: 0 8px 22px -6px rgba(0, 0, 0, .6);
  transition: transform .3s var(--v2-ease), background .3s var(--v2-ease);
}
.v2-play::after { content: ""; margin-left: 5px; border-left: 20px solid var(--btn-ink); border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.v2-still:hover .v2-play { transform: translate(-50%, -50%) scale(1.06); background: var(--gold); }
.v2-still:hover .v2-frame { border-color: var(--gold); }
.v2-still:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 16px; }
.v2-still-hero .v2-frame { border-radius: 16px; }
.v2-still-cap, .v2-still-meta { display: block; margin-top: 8px; font-size: .9rem; color: var(--muted); text-align: center; }
.v2-still-title { display: block; margin-top: 10px; font-family: var(--display); font-weight: 600; font-size: 1.3rem; color: var(--gold); text-align: center; }
.v2-still-meta { margin-top: 2px; }

/* 2. Feature */
.v2-feature-grid { display: grid; gap: 24px; }

/* Scripture moment */
.v2-verse { padding: 40px 0; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.v2-verse-text { margin: 0 auto; max-width: 42rem; font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 6vw, 2.6rem); line-height: 1.22; color: var(--ink); text-wrap: balance; }
.v2-verse-ref { margin: 14px 0 0; font-size: .82rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-variant-numeric: lining-nums; }

/* 3. Books */
.v2-popular { margin: 0 0 28px; }
.v2-pop-label { margin: 0 0 10px; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.v2-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.v2-chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--chip); color: var(--ink); text-decoration: none;
  font-size: 1rem; transition: border-color .3s var(--v2-ease), transform .3s var(--v2-ease);
}
.v2-chip b { color: var(--gold); font-weight: 600; font-variant-numeric: lining-nums; }
.v2-chip:hover { border-color: var(--gold); transform: translateY(-1px); }
.v2-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.v2-testaments { display: grid; gap: 28px; }
.v2-test-title { margin: 0 0 12px; font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: .03em; color: var(--gold); }
.v2-book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.v2-book-grid a {
  display: block; padding: 10px 14px; border-radius: 10px; text-decoration: none; color: var(--ink);
  background: var(--chip); border: 1px solid var(--line); font-size: 1rem; line-height: 1.25;
  transition: border-color .3s var(--v2-ease), background .3s var(--v2-ease);
}
.v2-book-grid a:hover { border-color: var(--gold); background: var(--paper); }
.v2-book-grid a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Cards (devotion, download, support) */
.v2-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 24px;
  box-shadow: 0 16px 34px -24px var(--shadow);
}
.v2-card h2 { margin-top: 2px; }

/* 4. Devotion */
.v2-devo-card .eyebrow { color: var(--accent); }
.v2-devo-title { margin: 4px 0 6px; }
.v2-devo-title a { color: var(--gold); text-decoration: none; }
.v2-devo-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.v2-devo-passage { margin: 0 0 10px; font-size: .82rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-variant-numeric: lining-nums; }
.v2-devo-desc { margin: 0 0 20px; color: var(--muted); line-height: 1.6; max-width: 42rem; text-wrap: pretty; }
.v2-devo-card .v2-cta-row { margin: 0; }

/* 5. Download */
.v2-download-card { display: flex; flex-direction: column; gap: 16px; }
.v2-dl-ic { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--chip); border: 1px solid var(--line); color: var(--accent); }
.v2-download-card h2 { margin-bottom: 10px; }
.v2-download-card p { margin: 0 0 20px; color: var(--muted); line-height: 1.6; text-wrap: pretty; }
.v2-dl-body .v2-ghost { margin: 0; }

/* 6. Search */
.v2-search-form { display: flex; flex-wrap: wrap; gap: 10px; max-width: 42rem; }
.v2-search-form input[type=search] {
  flex: 1 1 220px; min-width: 0; font: inherit; font-size: 1.05rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 12px 20px;
}
.v2-search-form input[type=search]::placeholder { color: var(--muted); opacity: .8; }
.v2-search-form input[type=search]:focus-visible { outline: 2px solid var(--ui); outline-offset: 1px; border-color: var(--ui); }
.v2-search-go {
  background: var(--btn); color: var(--btn-ink); border: 1px solid var(--gold); border-radius: 999px;
  font-weight: 600; font-size: 1.05rem; padding: 12px 28px; min-height: 48px;
  transition: transform .3s var(--v2-ease), box-shadow .3s var(--v2-ease);
}
.v2-search-go:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .6); }
.v2-search-go:active { transform: scale(.98); }
.v2-search-go:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* 7. Covers */
.v2-covers-h { text-align: center; }
.v2-cover-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 20px; }
.v2-cover {
  position: relative; display: block; width: clamp(130px, 40vw, 220px); aspect-ratio: 2 / 3;
  border-radius: 10px; overflow: hidden; text-decoration: none; box-shadow: 0 14px 28px -12px var(--shadow);
  transition: transform .3s var(--v2-ease);
}
.v2-cover:hover { transform: translateY(-3px); }
.v2-cover:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.v2-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.v2-cover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(13, 15, 40, .8) 0, rgba(13, 15, 40, .4) 20%, rgba(13, 15, 40, 0) 40%, rgba(13, 15, 40, 0) 66%, rgba(13, 15, 40, .86) 100%); }
.v2-cover::after { content: ""; position: absolute; inset: 5px; z-index: 3; border: 1px solid rgba(230, 207, 143, .85); border-radius: 6px; pointer-events: none; }
.v2-cover b { position: absolute; z-index: 2; left: 0; right: 0; top: 14px; text-align: center; font-family: var(--display); font-weight: 600; font-size: 1.5rem; color: var(--gold); text-shadow: 0 1px 3px rgba(10, 12, 32, .95); }
.v2-cover small { position: absolute; z-index: 2; left: 0; right: 0; bottom: 14px; text-align: center; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px 4px rgba(10, 12, 32, .9); }
.v2-cover-tag { position: absolute; z-index: 4; left: 50%; bottom: 40%; transform: translateX(-50%); white-space: nowrap; padding: 3px 12px; border-radius: 999px; font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--btn-ink); background: rgba(230, 207, 143, .94); box-shadow: 0 2px 6px rgba(10, 12, 32, .5); }

/* 8. Support */
.v2-support-card { text-align: center; }
.v2-support-card p { margin: 0 0 20px; color: var(--muted); line-height: 1.6; max-width: 38rem; margin-inline: auto; text-wrap: pretty; }
.v2-support-card .eyebrow { color: var(--accent); }

/* Scroll reveals: pure CSS, only where supported, only when motion is welcome.
   Everything stays fully visible otherwise (no JS gate on content). */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .v2-reveal { animation: v2-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 42%; }
    @keyframes v2-rise { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }
  }
}

/* Tablet and up */
@media (min-width: 760px) {
  .v2-feature-grid { grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
  .v2-testaments { grid-template-columns: 1fr 1fr; gap: 40px; }
  .v2-download-card { flex-direction: row; align-items: flex-start; gap: 20px; }
}

/* Desktop: hero goes two column */
@media (min-width: 880px) {
  .v2-hero { padding: 40px 0 56px; }
  .v2-hero-in { grid-template-columns: 1fr 1fr; gap: 48px; }
  .v2-hero-copy { text-align: left; }
  .v2-hero-copy .v2-cta-row, .v2-hero-copy .v2-proof { justify-content: flex-start; }
  .v2-lead { margin-left: 0; }
  .v2-sec { padding: 64px 0; }
}

/* Small phones (390px target and below) */
@media (max-width: 400px) {
  .home-v2 .v2-wrap { padding: 0 14px; }
  .v2-cta-row { gap: 10px; }
  .v2-primary, .v2-ghost { width: 100%; justify-content: center; }
  .v2-book-grid { grid-template-columns: 1fr 1fr; }
  .v2-search-form input[type=search], .v2-search-go { flex-basis: 100%; }
  .v2-search-go { width: 100%; }
}

/* ============================================================
   Fixed background video + glass surfaces (added in this pass).
   The page scrolls over a single fixed poster/video layer.
   ============================================================ */

/* Reveal the fixed layer behind the page. The <html> navy (set in style.css)
   stays as the ultimate fallback, painted below the fixed wrapper. */
body:has(main.home-v2) { background: transparent; }

.bg-video {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg);
}
.bg-video .bg-poster { position: absolute; inset: 0; display: block; }
.bg-video .bg-poster img,
.bg-video video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 20% center;
}
.bg-video video { opacity: 0; transition: opacity .9s var(--v2-ease); will-change: opacity; }
.bg-video.is-playing video { opacity: 1; }

/* Dark navy overlay: stronger at the bottom and toward the left, where hero text sits. */
.bg-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top right, rgba(20, 22, 58, .70) 0%, rgba(20, 22, 58, .52) 30%, rgba(20, 22, 58, .18) 62%, rgba(20, 22, 58, 0) 85%),
    linear-gradient(0deg, rgba(20, 22, 58, .45) 0%, rgba(20, 22, 58, 0) 40%);
}

@media (max-width: 699px) {
  .bg-video .bg-poster img, .bg-video video { object-position: center center; }
  .bg-scrim { background: linear-gradient(180deg, rgba(20, 22, 58, .50) 0%, rgba(20, 22, 58, .40) 34%, rgba(20, 22, 58, .58) 68%, rgba(20, 22, 58, .90) 100%); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-video video { transition: none; }
}

/* Glass surfaces so the video shows through as content scrolls.
   Solid-ish fallback first; translucent + blur only where supported. */
.home-v2 .v2-feature,
.home-v2 .v2-books,
.home-v2 .v2-search,
.home-v2 .v2-covers { background: rgba(16, 18, 46, .84); }
.home-v2 .v2-verse { background: rgba(26, 28, 74, .88); }
.home-v2 .v2-card { background: rgba(26, 28, 74, .9); }

@supports ((-webkit-backdrop-filter: blur(6px)) or (backdrop-filter: blur(6px))) {
  .home-v2 .v2-feature,
  .home-v2 .v2-books,
  .home-v2 .v2-search,
  .home-v2 .v2-covers {
    background: rgba(16, 18, 46, .56);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  }
  .home-v2 .v2-verse {
    background: rgba(26, 28, 74, .60);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  }
  .home-v2 .v2-card {
    background: rgba(26, 28, 74, .64);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  }
}

/* Hero: transparent, tall, copy and carousel centred over the video. */
.v2-hero {
  background: transparent; border-bottom: 0;
  min-height: 92svh; display: flex; align-items: center;
}

/* Compact carousel inside the hero. Reuses home.js and the base .hb rules in
   style.css; these overrides shrink the band to a card and drop the solid
   surfaces so the glass and video read through. */
.v2-hero-carousel {
  --hold: 10s;
  width: 100%; max-width: 460px; height: clamp(400px, 56vh, 440px);
  margin: 0 auto; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: rgba(20, 22, 58, .80); box-shadow: 0 28px 64px -34px #000;
}
@supports ((-webkit-backdrop-filter: blur(6px)) or (backdrop-filter: blur(6px))) {
  .v2-hero-carousel { background: rgba(20, 22, 58, .46); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
}
.v2-hero-carousel .hb-slide { background: transparent; }
.v2-hero-carousel .hb-inner {
  grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 22px 22px 54px;
  text-align: center; align-content: center; justify-items: center;
}
.v2-hero-carousel .hb-copy { display: contents; }
.v2-hero-carousel .hb-copy .eyebrow { font-size: .78rem; }
.v2-hero-carousel .hb-copy h2 { font-size: 1.5rem; margin: 2px 0; }
.v2-hero-carousel .hb-cap { font-size: .98rem; margin: 0 auto 4px; max-width: 24em; }
.v2-hero-carousel .coffee.hb-cta { font-size: 1rem; padding: 9px 20px; }
.v2-hero-carousel .hb-covers { gap: 12px; }
.v2-hero-carousel .hb-cover { width: clamp(88px, 26vw, 104px); }
.v2-hero-carousel .hb-stills { display: flex; gap: 10px; justify-content: center; width: 100%; }
.v2-hero-carousel .hb-still { width: clamp(130px, 44%, 170px); font-size: .82rem; }
.v2-hero-carousel .hb-search-side { align-items: center; width: 100%; }
.v2-hero-carousel .hb-search { width: 100%; max-width: 320px; font-size: 1rem; }
.v2-hero-carousel .hb-sub { font-size: .9rem; }
.v2-hero-carousel .hb-ctrl { bottom: 6px; }
.v2-hero-carousel .hb-arrow {
  width: 36px; height: 36px; background: rgba(20, 22, 58, .72);
}
.v2-hero-carousel .hb-arrow.prev { left: 6px; }
.v2-hero-carousel .hb-arrow.next { right: 6px; }

@media (max-width: 879px) {
  /* Hero stacks: carousel sits below the copy and CTAs, still filling the viewport. */
  .v2-hero { min-height: 90svh; padding-top: 16px; }
  .v2-hero-carousel { margin-top: 8px; }
}
@media (max-width: 699px) {
  .v2-hero-carousel { height: 420px; }
}

/* Desktop hero: copy on top, smaller carousel anchored lower-left at about 40% width,
   leaving the right side of the video clear. */
@media (min-width: 880px) {
  .v2-hero { align-items: flex-end; min-height: 88svh; padding: 0 0 20px; }
  .v2-hero-in { grid-template-columns: minmax(0, 40%); gap: 12px; align-items: end; }
  .v2-hero-vis { width: 100%; }
  .v2-hero-carousel { max-width: none; margin: 0; height: clamp(330px, 39vh, 350px); }
}
@media (max-width: 699px) {
  .bg-video video { display: none; }
}

/* Hymn mute toggle */
.hymn-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); color: #f3ead2; background: rgba(20, 22, 58, .78); cursor: pointer;
  box-shadow: 0 10px 24px -12px #000; transition: background .2s;
}
.hymn-btn:hover { background: rgba(20, 22, 58, .95); }
.hymn-btn:focus-visible { outline: 2px solid #e8c873; outline-offset: 3px; }
.hymn-btn .ic-off { display: none; }
.hymn-btn[aria-pressed="true"] .ic-on { display: none; }
.hymn-btn[aria-pressed="true"] .ic-off { display: block; }

/* Desktop hero carousel: keep the covers clear of the dots/Pause row (Jeff 2026-10-29) */
@media (min-width: 880px) {
  .v2-hero-carousel .hb-slide { padding-bottom: 42px; }
  .v2-hero-carousel .hb-slide .eyebrow { display: none; }
  .v2-hero-carousel .hb-covers { gap: 10px; }
  .v2-hero-carousel .hb-cover { width: clamp(60px, 7.5vh, 84px); }
}
@media (min-width: 880px) and (max-height: 840px) {
  .v2-hero .v2-h1 { font-size: clamp(2.4rem, 5.6vh, 3.2rem); }
  .v2-hero .v2-lead { margin-block: 10px; }
  .v2-hero-carousel { height: clamp(300px, 40vh, 330px); }
  .v2-hero-carousel .hb-cover { width: 56px; }
  .v2-hero-carousel .hb-cover small { display: none; }
  .v2-hero-carousel .hb-still { width: 116px; }
  .v2-hero-carousel .hb-slide .eyebrow { display: none; }
}
