/* =============================================================================
   home.css — Homepage-only styles (Phase 3)
   =============================================================================
   Loaded only on index.php via $extraStyles (see templates/header.php).
   Builds on top of assets/css/style.css; nothing here should be needed by
   any other page.
   ============================================================================= */

body.page-home {
    padding-top: 0;
}

/* -----------------------------------------------------------------------
   Hero — scroll-driven zoom-through-text, then the cartridge photo + logo
   -----------------------------------------------------------------------
   .hero-scroller is an oversized (220vh) block; .hero-pin sticks to the
   viewport for the ride. assets/js/home.js reads how far the page has
   scrolled through that extra height (0 -> 1 "progress") and drives three
   things directly off it, no fixed timers:
     - .hero-intro-text scales up (a zoom "through" the letters)
     - .hero-bg / .hero-overlay crossfade in as the intro fades out
     - .hero-content (logo, subtitle, CTAs) fades/rises in last
   Scrolling back up reverses all of it. See home.js for the exact
   progress thresholds. Every element's *default* (pre-JS) state below is
   also the correct prefers-reduced-motion end state, so reduced-motion
   users and no-JS visitors both just see the final hero immediately.
   ----------------------------------------------------------------------- */
.hero-scroller {
    position: relative;
    height: 220vh;
}

.hero-pin {
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 560px;
    overflow: hidden;
    display: flex;
    /* Bottom-aligned rather than centered: the hero photo's subject (the
       cartridge) sits roughly in the vertical middle of the frame, and the
       overlay gradient below is darkest at the bottom for text legibility
       — so .hero-content (the only normal-flow child; .hero-intro is its
       own absolutely-positioned overlay and centers independently) lands
       low enough to clear it instead of sitting on top of it. */
    align-items: flex-end;
    justify-content: center;
    padding-bottom: clamp(2.5rem, 9vw, 5.5rem);
    text-align: center;
    background-color: var(--ols-black);
}

.hero-bg {
    position: absolute;
    top: -12%;
    left: 0;
    right: 0;
    bottom: -12%;
    background-size: cover;
    background-position: center;
    will-change: transform, opacity;
    opacity: 1;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(22, 22, 26, 0.55) 0%, rgba(22, 22, 26, 0.35) 45%, rgba(22, 22, 26, 0.9) 100%);
    opacity: 1;
}

.hero-intro {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--ols-black);
    pointer-events: none;
    opacity: 0;
}

.hero-intro-text {
    font-family: var(--ols-font-heading);
    font-weight: 700;
    font-size: clamp(3.25rem, 11vw, 8.5rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    /* The photo has dark wood-grain patches that, unboosted, come close
       enough to the solid black backdrop behind the letters to make those
       parts of the glyphs disappear. Brightening/adding contrast lifts the
       image's shadows so no letter goes fully illegible, and the faint
       off-white stroke traces each glyph's outline so its shape still reads
       even where the fill underneath it is dark. */
    filter: brightness(1.4) contrast(1.15);
    -webkit-text-stroke: 1px rgba(242, 242, 240, 0.18);
    transform: scale(1);
    transform-origin: center center;
}

.hero-scroll-cue {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--ols-off-white);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.75;
    pointer-events: auto;
}

.hero-scroll-cue i {
    font-size: 1.2rem;
    animation: hero-bounce 2s ease-in-out infinite;
}

@keyframes hero-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    padding: 0 1.5rem;
    opacity: 1;
    transform: none;
    will-change: transform, opacity;
}

.hero-logo {
    max-width: 320px;
    width: 60%;
    height: auto;
    margin: 0 auto;
    margin-bottom: clamp(2.5rem, 9vw, 5rem);
    display: block;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--ols-off-white);
    max-width: 560px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* .hero-cta, .intro-divider, and .cta-banner moved to style.css — they're
   generic page-building blocks reused by about.php, faq.php, etc., not
   hero-specific. */

/* JS hasn't run yet (or failed) — default to the fully-revealed end state
   rather than a broken half-hidden one. home.js immediately overrides
   these inline once it initializes. */
.hero-scroller.js-hero-ready .hero-intro {
    opacity: 1;
}

.hero-scroller.js-hero-ready .hero-content {
    opacity: 0;
    transform: translateY(16px);
}

/* -----------------------------------------------------------------------
   Stats strip
   ----------------------------------------------------------------------- */
.stats-bar {
    background-color: var(--ols-charcoal);
    border-bottom: 1px solid var(--ols-steel);
    padding: 2.75rem 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: var(--ols-font-heading);
    font-size: 2.1rem;
    font-weight: 600;
    color: var(--ols-brass-light);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ols-muted);
}

/* -----------------------------------------------------------------------
   Intro / brand statement
   ----------------------------------------------------------------------- */
.intro-section {
    padding: 5.5rem 0;
    text-align: center;
}

.intro-section p {
    max-width: 680px;
    margin: 0 auto;
    color: var(--ols-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* -----------------------------------------------------------------------
   Ammunition category cards
   ----------------------------------------------------------------------- */
.categories-section {
    padding: 1rem 0 5.5rem;
}

.category-card {
    background-color: var(--ols-charcoal);
    border: 1px solid var(--ols-steel);
    border-radius: 10px;
    padding: 2.75rem 1.75rem;
    text-align: center;
    height: 100%;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover,
.category-card:focus-within {
    transform: translateY(-6px);
    border-color: var(--ols-brass);
}

.category-icon {
    margin-bottom: 1.25rem;
}

.category-icon img {
    height: 110px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.category-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

.category-card p {
    color: var(--ols-muted);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
}

/* -----------------------------------------------------------------------
   Scroll-reveal (progressive enhancement — see assets/js/home.js)
   ----------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    .hero-intro {
        display: none;
    }

    .hero-bg,
    .hero-overlay,
    .hero-content {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .hero-scroll-cue {
        opacity: 0.8;
        animation: none;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

@media (max-width: 767.98px) {
    .hero {
        height: 100svh;
    }
}
