/* ==========================================================================
   Front-page hero
   Layers (back to front): slideshow w/ Ken Burns -> gradient + vignette ->
   drifting colour glows -> particle canvas -> content -> bottom controls.
   All motion is disabled under prefers-reduced-motion.
   ========================================================================== */

:root {
    --hero-slide-duration: 7000ms;
    --hero-fade-duration: 1600ms;
    --hero-accent: #fcd34d;          /* amber-300 */
    --hero-ease: cubic-bezier(0.16, 1, 0.3, 1);
}
html.dark {
    --hero-fade-to: #0f172a;         /* slate-900, the next section's dark background */
}

.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
    background-color: #0b1120;
    color: #fff;
}

/* --- Slideshow ---------------------------------------------------------- */
.hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    will-change: transform;
    animation: heroMediaIn 1.6s var(--hero-ease) both;
}
.hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--hero-fade-duration) ease-in-out;
    will-change: opacity;
}
.hero__slide.is-active {
    opacity: 1;
}
.hero__slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.04);
    transform-origin: center center;
    will-change: transform;
}
/* The animation stays attached while a slide fades out so it never snaps */
.hero__slide.is-active img,
.hero__slide.is-leaving img {
    animation: heroKenBurnsIn calc(var(--hero-slide-duration) + var(--hero-fade-duration) * 2) linear forwards;
}
.hero__slide[data-motion="zoom-out"].is-active img,
.hero__slide[data-motion="zoom-out"].is-leaving img {
    animation-name: heroKenBurnsOut;
}
.hero__slide[data-motion="pan-right"].is-active img,
.hero__slide[data-motion="pan-right"].is-leaving img {
    animation-name: heroKenBurnsPan;
}
@keyframes heroMediaIn {
    from { opacity: 0; transform: scale(1.06); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes heroKenBurnsIn {
    from { transform: scale(1.04) translate3d(0, 0, 0); }
    to   { transform: scale(1.16) translate3d(0, -1.5%, 0); }
}
@keyframes heroKenBurnsOut {
    from { transform: scale(1.16) translate3d(1%, 0, 0); }
    to   { transform: scale(1.04) translate3d(0, 0, 0); }
}
@keyframes heroKenBurnsPan {
    from { transform: scale(1.12) translate3d(-2%, 1%, 0); }
    to   { transform: scale(1.12) translate3d(2%, -1%, 0); }
}

/* --- Overlays ----------------------------------------------------------- */
.hero__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(2, 6, 23, 0.68) 0%,
            rgba(2, 6, 23, 0.38) 35%,
            rgba(2, 6, 23, 0.48) 70%,
            rgba(2, 6, 23, 0.82) 100%);
}
.hero__vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.6) 100%);
}
.hero__glow {
    position: absolute;
    width: 60vmax;
    height: 60vmax;
    border-radius: 50%;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.55;
    will-change: transform;
}
.hero__glow--amber {
    top: -20vmax;
    right: -15vmax;
    background: radial-gradient(circle, rgba(252, 211, 77, 0.32) 0%, rgba(252, 211, 77, 0.08) 35%, rgba(252, 211, 77, 0) 70%);
    animation: heroGlowA 22s ease-in-out infinite alternate;
}
.hero__glow--blue {
    bottom: -25vmax;
    left: -15vmax;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.30) 0%, rgba(59, 130, 246, 0.08) 35%, rgba(59, 130, 246, 0) 70%);
    animation: heroGlowB 26s ease-in-out infinite alternate;
}
@keyframes heroGlowA {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-12vw, 10vh, 0) scale(1.15); }
}
@keyframes heroGlowB {
    from { transform: translate3d(0, 0, 0) scale(1.1); }
    to   { transform: translate3d(14vw, -12vh, 0) scale(0.95); }
}
.hero__particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.9;
}

/* Soft fade into the next (dark) section. In light mode a fade to white would
   wash out the photo and the slide controls, so the hero keeps a crisp edge. */
.hero__fade {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 7rem;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--hero-fade-to));
    opacity: 0.9;
}
html.dark .hero__fade {
    display: block;
}

/* --- Content ------------------------------------------------------------ */
.hero__content {
    position: relative;
    z-index: 3;
    will-change: transform, opacity;
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.15rem;
    border-radius: 9999px;
    border: 1px solid rgba(252, 211, 77, 0.35);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fde68a;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    animation: heroFadeUp 0.9s var(--hero-ease) 0.35s both;
}
@media (min-width: 768px) {
    .hero__eyebrow { font-size: 0.8rem; }
}
.hero__eyebrow-dot {
    position: relative;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--hero-accent);
    flex-shrink: 0;
}
.hero__eyebrow-dot::after {
    content: "";
    position: absolute;
    inset: -0.3rem;
    border-radius: 50%;
    border: 1px solid rgba(252, 211, 77, 0.7);
    animation: heroPulse 2.4s ease-out infinite;
}
@keyframes heroPulse {
    0%   { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Headline with per-word reveal */
.hero__title {
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.5);
}
.hero__line {
    display: block;
}
.hero__word {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    padding-bottom: 0.14em;   /* room for descenders inside the clip box */
    margin-bottom: -0.14em;
}
.hero__word > span {
    display: inline-block;
    transform: translateY(115%);
    animation: heroWordIn 1s var(--hero-ease) forwards;
    animation-delay: calc(0.45s + var(--i, 0) * 0.09s);
}
@keyframes heroWordIn {
    to { transform: translateY(0); }
}
.hero__accent {
    position: relative;
    display: inline-block;
    color: var(--hero-accent);
    font-style: italic;
    padding: 0 0.1em;
    text-shadow: 0 0 50px rgba(252, 211, 77, 0.45), 0 4px 20px rgba(0, 0, 0, 0.55);
}
.hero__underline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.08em;
    height: 0.32em;
    width: 100%;
    overflow: visible;
    pointer-events: none;
}
.hero__underline path {
    fill: none;
    stroke: var(--hero-accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    opacity: 0.9;
    animation: heroDraw 1.1s cubic-bezier(0.65, 0, 0.35, 1) 1.25s forwards;
}
@keyframes heroDraw {
    to { stroke-dashoffset: 0; }
}

/* Scripture reference with growing rules on either side */
.hero__ref {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    animation: heroFadeIn 0.8s ease 1.2s both;
}
.hero__ref-line {
    height: 1px;
    width: 2.5rem;
    background: rgba(252, 211, 77, 0.6);
    transform: scaleX(0);
    animation: heroRule 0.9s var(--hero-ease) 1.3s forwards;
}
.hero__ref-line:first-child { transform-origin: right center; }
.hero__ref-line:last-child  { transform-origin: left center; }
@media (min-width: 768px) {
    .hero__ref-line { width: 3.5rem; }
}
@keyframes heroRule {
    to { transform: scaleX(1); }
}

.hero__text {
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.hero__reveal {
    animation: heroFadeUp 0.9s var(--hero-ease) both;
}
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Buttons */
.hero__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-size: 1.05rem;
    font-weight: 700;
    overflow: hidden;
    transition: transform 0.3s var(--hero-ease), box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}
.hero__btn:hover {
    transform: translateY(-3px);
}
.hero__btn:active {
    transform: translateY(-1px);
}
.hero__btn--primary {
    background: #fff;
    color: #1e3a8a;
    box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.65), 0 0 0 0 rgba(255, 255, 255, 0.35);
}
.hero__btn--primary:hover {
    box-shadow: 0 24px 48px -14px rgba(0, 0, 0, 0.7), 0 0 0 6px rgba(255, 255, 255, 0.14);
}
.hero__btn--primary::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 50%;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(191, 219, 254, 0.9) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg);
    transition: left 0.75s ease;
    pointer-events: none;
}
.hero__btn--primary:hover::after {
    left: 120%;
}
.hero__btn--primary svg {
    transition: transform 0.3s var(--hero-ease);
}
.hero__btn--primary:hover svg {
    transform: translateX(4px);
}
.hero__btn--ghost {
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.6);
}
.hero__btn--ghost:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: #fff;
}
@media (max-width: 639px) {
    .hero__btn {
        white-space: nowrap;
    }
    .hero__btn--ghost {
        padding: 0.95rem 0.75rem;
        font-size: 0.95rem;
        gap: 0.45rem;
    }
}

/* Quick-facts strip */
.hero__facts {
    display: inline-flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.9rem 1.25rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.92);
}
.hero__fact {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    white-space: nowrap;
}
.hero__fact svg {
    width: 1.1rem;
    height: 1.1rem;
    color: #fde68a;
    flex-shrink: 0;
}
.hero__fact strong {
    font-weight: 600;
    color: #fff;
}
.hero__fact-sep {
    display: none;
    width: 1px;
    height: 1.25rem;
    background: rgba(255, 255, 255, 0.2);
}
@media (min-width: 768px) {
    .hero__facts {
        flex-direction: row;
        align-items: center;
        gap: 1.1rem;
        padding: 0.85rem 1.6rem;
        border-radius: 9999px;
    }
    .hero__fact-sep { display: block; }
}

/* --- Bottom controls ---------------------------------------------------- */
.hero__bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1.5rem;
    z-index: 4;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: heroFadeIn 1s ease 1.8s both;
}
.hero__bottom-inner {
    width: 100%;
    max-width: 80rem;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}
@media (min-width: 640px)  { .hero__bottom-inner { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .hero__bottom-inner { padding: 0 2rem; } }

.hero__counter {
    grid-column: 1;
    display: none;
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.7);
}
.hero__counter strong {
    color: #fff;
    font-weight: 600;
}
@media (min-width: 768px) {
    .hero__counter { display: block; }
}

.hero__dots {
    grid-column: 2;
    display: flex;
    gap: 0.6rem;
    justify-self: center;
}
.hero__dot {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;        /* generous hit area */
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.hero__dot::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.3);
    transition: background-color 0.3s ease;
}
.hero__dot:hover::before {
    background: rgba(255, 255, 255, 0.55);
}
.hero__dot-bar {
    position: absolute;
    left: 0;
    top: 50%;
    height: 3px;
    width: 100%;
    margin-top: -1.5px;
    border-radius: 9999px;
    background: var(--hero-accent);
    transform: scaleX(0);
    transform-origin: left center;
}
.hero__dot.is-active .hero__dot-bar {
    animation: heroDotFill var(--hero-slide-duration) linear forwards;
}
.hero.is-paused .hero__dot-bar {
    animation-play-state: paused;
}
@keyframes heroDotFill {
    to { transform: scaleX(1); }
}

.hero__scroll {
    grid-column: 3;
    display: none;
    justify-self: end;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.3s ease;
}
.hero__scroll:hover {
    color: #fff;
}
@media (min-width: 768px) {
    .hero__scroll { display: inline-flex; }
}
.hero__mouse {
    width: 1.35rem;
    height: 2.1rem;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 9999px;
    position: relative;
}
.hero__mouse::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0.4rem;
    width: 3px;
    height: 6px;
    margin-left: -1.5px;
    border-radius: 9999px;
    background: #fff;
    animation: heroWheel 1.8s ease-in-out infinite;
}
@keyframes heroWheel {
    0%   { transform: translateY(0); opacity: 1; }
    70%  { transform: translateY(0.75rem); opacity: 0; }
    100% { transform: translateY(0); opacity: 0; }
}

/* --- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .hero__media,
    .hero__slide img,
    .hero__glow,
    .hero__word > span,
    .hero__underline path,
    .hero__ref,
    .hero__ref-line,
    .hero__eyebrow,
    .hero__eyebrow-dot::after,
    .hero__reveal,
    .hero__bottom,
    .hero__dot-bar,
    .hero__mouse::after {
        animation: none !important;
    }
    .hero__word > span   { transform: none; }
    .hero__ref-line      { transform: none; }
    .hero__underline path { stroke-dashoffset: 0; }
    .hero__dot.is-active .hero__dot-bar { transform: scaleX(1); }
    .hero__particles     { display: none; }
    .hero__btn,
    .hero__btn--primary::after { transition: none; }
}
