/* =========================================================
   SCROLL EXPERIENCE
   Smooth scrolling, progress bar, hide-on-scroll header,
   stacked rounded sections, stats, ticker, loader.
   Loaded after style.css.
   ========================================================= */

/* ---------- Lenis smooth scroll (required rules) ---------- */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* ---------- Details ---------- */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--green) transparent;
}

::selection {
    background: var(--orange);
    color: #fff;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    width: 100%;
    height: 3px;
    background: var(--orange);
    transform: scaleX(0);
    transform-origin: 0 50%;
    pointer-events: none;
}

.admin-bar .scroll-progress {
    top: 32px;
}

/* ---------- Header: fixed, shrinks, hides on scroll down ---------- */
.site-header {
    position: fixed;
    transition: transform .55s cubic-bezier(.2, .7, .2, 1);
}

.admin-bar .site-header {
    top: 32px;
}

.site-header.is-hidden {
    transform: translateY(-130%);
}

.site-header nav {
    transition: min-height .4s ease, background-color .4s ease, box-shadow .4s ease, border-color .4s ease;
}

.site-header .site-logo img,
.site-header .custom-logo {
    transition: height .4s ease, max-height .4s ease;
}

.site-header.is-scrolled nav {
    min-height: 70px;
    border-color: rgba(18, 59, 51, .12);
    background: rgba(250, 249, 243, .95);
    box-shadow: 0 14px 40px rgba(28, 48, 38, .12);
}

.site-header.is-scrolled .site-logo img,
.site-header.is-scrolled .custom-logo {
    height: 54px;
    max-height: 54px;
}

/* ---------- Stacked, rounded sections (homepage) ---------- */
.homepage-block-content {
    --stack-radius: clamp(26px, 4vw, 46px);
}

.homepage-block-content > .hero {
    z-index: 1;
    isolation: isolate;
}

.homepage-block-content > .wp-block-group.section,
.homepage-block-content > .product-section,
.homepage-block-content > .stats-section,
.homepage-block-content > .lifestyle-band,
.homepage-block-content > .wp-block-group.final-cta {
    position: relative;
    z-index: 2;
    margin-top: calc(-1 * var(--stack-radius));
    border-radius: var(--stack-radius) var(--stack-radius) 0 0;
}

.homepage-block-content > .wp-block-group.section,
.homepage-block-content > .stats-section {
    padding-top: calc(clamp(78px, 9vw, 118px) + var(--stack-radius) * .4);
}

.homepage-block-content > .hero {
    padding-bottom: calc(80px + var(--stack-radius));
}

.site-footer {
    position: relative;
    z-index: 3;
    margin-top: -40px;
    padding-top: 85px;
    border-radius: 40px 40px 0 0;
}

/* ---------- Product image parallax (value set by scroll-ui.js) ---------- */
.product-visual img {
    transform: translate3d(0, var(--py, 0px), 0) rotate(-4deg);
}

.product-visual img:hover {
    transform: translate3d(0, var(--py, 0px), 0) rotate(0) scale(1.03);
}

.active-man-visual img {
    transform: translate3d(0, var(--py, 0px), 0);
}

/* ---------- Ingredient latin names ---------- */
.ingredient-latin {
    display: block;
    margin: -2px 0 14px;
    color: var(--orange);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: lowercase;
}

/* ---------- Stats ---------- */
.stats-section {
    padding: clamp(90px, 10vw, 130px) 0 clamp(70px, 8vw, 100px);
    background: var(--cream);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 40px;
    border-top: 1px solid var(--line);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 34px 28px 10px 0;
}

.stat + .stat {
    padding-left: 28px;
    border-left: 1px solid var(--line);
}

.stat-number {
    color: var(--green);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(52px, 7vw, 108px);
    font-weight: 400;
    letter-spacing: -.06em;
    line-height: .9;
}

.stat-number--text {
    font-size: clamp(38px, 5vw, 76px);
}

.stat-label {
    max-width: 200px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1em;
    line-height: 1.5;
    text-transform: uppercase;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat:nth-child(odd) {
        padding-left: 0;
        border-left: 0;
    }

    .stat:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }
}

/* ---------- Ticker strip ---------- */
.marquee {
    position: relative;
    z-index: 2;
    padding: 26px 0;
    overflow: hidden;
    background: var(--green);
    color: var(--cream);
}

.marquee__track {
    display: flex;
    width: max-content;
    white-space: nowrap;
    will-change: transform;
}

.marquee__track span {
    display: inline-flex;
    align-items: center;
    padding-right: 28px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(28px, 4.4vw, 60px);
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.marquee__track span::after {
    width: .32em;
    height: .32em;
    margin-left: 28px;
    border-radius: 50%;
    background: var(--orange);
    content: "";
}

/* ---------- Section index (fixed, bottom left) ---------- */
.scroll-index {
    position: fixed;
    bottom: 26px;
    left: 28px;
    z-index: 40;
    display: none;
    align-items: baseline;
    gap: 12px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    mix-blend-mode: difference;
    pointer-events: none;
    text-transform: uppercase;
}

.scroll-index__num {
    font-variant-numeric: tabular-nums;
}

@media (min-width: 1100px) {
    .scroll-index.is-visible {
        display: flex;
    }
}

/* ---------- Hero scroll cue ---------- */
.hero-scroll-cue {
    position: absolute;
    bottom: calc(26px + var(--stack-radius, 40px));
    left: 50%;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--green);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
    transform: translateX(-50%);
    pointer-events: none;
}

.hero-scroll-cue i {
    display: block;
    width: 1px;
    height: 44px;
    overflow: hidden;
    background: rgba(18, 59, 51, .22);
}

.hero-scroll-cue i::after {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--green);
    content: "";
    animation: hhdCue 1.8s cubic-bezier(.65, 0, .35, 1) infinite;
}

@keyframes hhdCue {
    0% { transform: translateY(-100%); }
    60%, 100% { transform: translateY(100%); }
}

/* ---------- Loader ---------- */
.site-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: var(--cream);
    color: var(--green);
    animation: hhdLoaderFailsafe 0s linear 5s forwards;
}

.no-loader .site-loader {
    display: none;
}

.site-loader__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.site-loader__brand {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .3em;
    text-transform: uppercase;
}

.site-loader__count {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(72px, 14vw, 170px);
    letter-spacing: -.06em;
    line-height: .9;
    font-variant-numeric: tabular-nums;
}

.site-loader__count::after {
    color: var(--orange);
    content: "%";
    font-size: .35em;
    letter-spacing: 0;
    vertical-align: top;
}

/* If scripts fail, the loader hides itself after 5 seconds */
@keyframes hhdLoaderFailsafe {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-loader,
    .scroll-progress,
    .scroll-index,
    .hero-scroll-cue {
        display: none !important;
    }

    .site-header {
        transition: none;
    }
}

/* ---------- Lifestyle photo band ---------- */
.lifestyle-band {
    display: flex;
    min-height: clamp(500px, 62vw, 740px);
    align-items: flex-end;
    overflow: hidden;
    background: var(--green);
    color: #fff;
}

.lifestyle-band__image {
    position: absolute;
    inset: -9% 0;
    background-position: center 30%;
    background-repeat: no-repeat;
    background-size: cover;
    will-change: transform;
}

/* darkens the lower part for the text, keeps the faces clear, adds a little film grain */
.lifestyle-band__shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8, 47, 47, .06) 0%, rgba(8, 47, 47, .16) 40%, rgba(8, 47, 47, .84) 100%),
        linear-gradient(90deg, rgba(8, 47, 47, .42) 0%, rgba(8, 47, 47, 0) 62%);
}

.lifestyle-band__shade::after {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    content: "";
    mix-blend-mode: overlay;
    opacity: .1;
}

.lifestyle-band__content {
    position: relative;
    z-index: 2;
    padding-top: 140px;
    padding-bottom: clamp(52px, 7vw, 88px);
}

.lifestyle-band .eyebrow {
    color: rgba(255, 255, 255, .8);
}

.lifestyle-band .section-title {
    max-width: 760px;
    color: #fff;
    font-size: clamp(52px, 7.4vw, 112px);
}

.lifestyle-band .section-copy {
    max-width: 480px;
    margin: 20px 0 30px;
    color: rgba(255, 255, 255, .84);
}

@media (max-width: 700px) {
    .lifestyle-band {
        min-height: 540px;
    }

    .lifestyle-band__image {
        background-position: 38% 20%;
    }
}
