/**
 * index.css — 首页 index.html 专用样式
 * 依赖：reset / base / components / tela（首屏 slider）
 *
 * 结构概览：
 * 0. 顶栏：文档流 + sticky（不叠盖 main）
 * 1. 首屏视频触发 + 全屏弹层
 * 2. New Arrivals
 * 3. Brand Story
 * 4. Home story 标语
 * 5. VAPTIO logo 区块
 * 6. Our DNA
 * 7. Home contact
 * 8. 响应式（≤768px） + ≥769px 补充
 */

/* --------------------------------------------------------------------------
 * 0. 首页顶栏：文档流占位 + sticky 吸顶（不覆盖首屏 main；主题红见 components .header）
 * -------------------------------------------------------------------------- */

html:has(body.index-page) {
    --header-bar-height: 96px;
    scroll-padding-top: var(--header-bar-height);
}

@media (max-width: 768px) {
    html:has(body.index-page) {
        --header-bar-height: 64px;
    }
}

body.index-page .header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

/* Skip 链接跳到 #main-content 时，避免 sticky 顶栏遮住主内容顶部；截断子项横向溢出，避免整页可横拖 */
body.index-page #main-content {
    scroll-margin-top: var(--header-bar-height);
    max-width: 100%;
    overflow-x: clip;
}

/* --------------------------------------------------------------------------
 * 1. 首屏视频触发 & 弹层
 * -------------------------------------------------------------------------- */

.home-hero-video-trigger {
    position: relative;
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: transparent;
}

.home-hero-video-trigger img {
    display: block;
    width: 100%;
    height: auto;
}

.home-hero-video-trigger__play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72px;
    height: 72px;
    margin-left: -36px;
    margin-top: -36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

.home-hero-video-trigger__play::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    margin-left: -6px;
    margin-top: -12px;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 20px solid #fff;
}

.home-video-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
}

html.is-home-video-open,
body.is-home-video-open {
    overflow: hidden;
}

.home-video-modal.is-open {
    display: block;
}

.home-video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.home-video-modal__dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(1200px, calc(100% - 48px));
    transform: translate(-50%, -50%);
}

.home-video-modal__player {
    display: block;
    width: 100%;
    max-height: calc(100vh - 120px);
    background: #000;
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.home-video-modal__close {
    position: absolute;
    right: -14px;
    top: -14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    z-index: 3;
    pointer-events: auto;
}

.home-video-modal__close::before,
.home-video-modal__close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 2px;
    background: #fff;
}

.home-video-modal__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.home-video-modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* --------------------------------------------------------------------------
 * 2. New Arrivals
 * -------------------------------------------------------------------------- */

.new-arrival {
    padding: 8rem 0;
    background-color: var(--color-surface-alt);
}

.new-arrival .new-arrival__title-wrapper {
    text-align: center;
    margin-bottom: 4rem;
}

.new-arrival__title-wrapper .new-arrival__title {
    font-size: var(--font-size-32);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.new-arrival__title-wrapper .new-arrival__subtitle {
    font-size: var(--font-size-16);
    color: var(--color-text-muted);
}

.new-arrival__product-list {
    display: flex;
    gap: 20px;
    max-width: 1165px;
    margin: 0 auto;
    position: relative;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* 初始状态：所有卡片等宽 */
.new-arrival__product-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: flex 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.3s ease,
        visibility 0.3s ease;
    transition-delay: 0s;
    opacity: 1;
    visibility: visible;
    cursor: pointer;
}

.new-arrival__product-item:hover {
    transition-delay: 0.3s;
    flex: 1 1 100%;
    min-width: 0;
}

/* hover：当前卡片展开至 100%，其余隐藏（与 hover 卡统一延迟 0.3s） */
.new-arrival__product-list:has(.new-arrival__product-item:hover) .new-arrival__product-item:not(:hover) {
    flex: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    min-width: 0;
    transition-delay: 0.3s;
}

/* 图片容器：固定高度，避免 CLS */
.new-arrival__product-img {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background-color: var(--color-surface-alt);
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.new-arrival__product-img img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.4s ease;
    transition-delay: 0s;
}

.new-arrival__img-default {
    opacity: 1;
    z-index: 1;
}

.new-arrival__img-hover {
    opacity: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform: none;
    object-fit: cover;
}

.new-arrival__product-item:hover .new-arrival__product-img img {
    transition-delay: 0.3s;
}

.new-arrival__product-item:hover .new-arrival__img-default {
    opacity: 0;
}

.new-arrival__product-item:hover .new-arrival__img-hover {
    opacity: 1;
}

/* WebP <picture>：保持与原先 img 直接子级等价的布局参与方式 */
.new-arrival__product-img picture,
.product-menu__card-img picture,
.mobile-menu__card-img picture,
.brand-story__figure picture,
.vaptio-section__logo picture,
.home-dna__img-wrapper picture,
.back-to-top__inner picture,
.age-gate__logo picture {
    display: contents;
}

.new-arrival__product-info {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    height: 120px;
    text-align: center;
}

.new-arrival__product-info .new-arrival__product-title {
    font-size: var(--font-size-24);
    font-weight: 500;
    margin: 0;
    color: var(--color-text);
}

.new-arrival__product-info .new-arrival__short-desc {
    font-size: var(--font-size-14);
    opacity: 0.8;
    margin: 0;
    color: var(--color-text-tertiary);
}

.new-arrival__product-info .new-arrival__short-desc span {
    display: block;
}

.new-arrival__product-info a.new-arrival__learn-more {
    margin-top: 0.5rem;
    padding: 14px 22px;
    font-size: var(--font-size-12);
    font-weight: 600;
    text-transform: capitalize;
    text-decoration: none;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 30px;
    display: inline-block;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.new-arrival__product-info a.new-arrival__learn-more:hover {
    background-color: var(--color-primary);
    color: var(--color-accent);
    border-color: var(--color-primary);
}

/* --------------------------------------------------------------------------
 * 3. Brand Story（3D / mask 动画依赖透视与裁剪上下文）
 * -------------------------------------------------------------------------- */

.brand-story-wrapper {
    perspective: 1200px;
    position: relative;
    background: #efe8d8;
    max-width: 100%;
    overflow-x: clip;
}

.brand-story__inner {
    max-width: 100%;
    margin: 0 auto;
}

.brand-story-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 50% at 50% 30%, rgba(255, 255, 255, 0.06) 0%, transparent 55%);
    opacity: 0;
}

.brand-story-wrapper.brand-story--glow::after {
    opacity: 1;
}

.brand-story__lead,
.brand-story__media,
.brand-story__content {
    background: var(--color-surface-accent);
    padding: 4rem 0;
    text-align: center;
}

.brand-story__header,
.brand-story__intro p,
.brand-story__paragraph p,
.brand-story__title,
.brand-story__subtitle {
    transform-origin: left center;
}

.brand-story__title {
    color: var(--color-surface-dark);
    font-weight: 400;
    font-size: var(--font-size-32);
    margin-bottom: 2rem;
}

.brand-story__subtitle {
    color: var(--color-surface-dark);
    opacity: 0.8;
    font-size: var(--font-size-24);
    margin-bottom: 2rem;
}

.brand-story__intro,
.brand-story__paragraph {
    color: var(--color-surface-dark);
    opacity: 0.6;
    font-size: var(--font-size-16);
    margin: 2rem 0;
}

.brand-story__figure {
    display: inline-block;
    background: var(--color-surface);
    padding: 8px;
    overflow: hidden;
    transition: box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    margin: 0;
}

.brand-story__figure:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.brand-story__figure img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.4s ease;
    transform-origin: center center;
    max-width: 100%;
    will-change: transform;
}

.brand-story__figure img.gsap-animated {
    will-change: auto;
}

.brand-story__figure:hover img {
    transform: scale(1.08);
    filter: brightness(1.05) contrast(1.05);
}

/* --------------------------------------------------------------------------
 * 4. Home story 标语
 * -------------------------------------------------------------------------- */

.home-story-section {
    text-align: center;
    font-size: var(--font-size-24);
    font-weight: 400;
    margin: 4rem 0;
}

.home-story-section .home-story-section__subtitle {
    margin-bottom: 1rem;
}

.home-story-section .home-story-section__title-wrapper {
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
 * 5. VAPTIO logo 区块（@keyframes logoBreath 见 components.css）
 * -------------------------------------------------------------------------- */

.vaptio-section__stage {
    background: var(--color-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 96px 0 4rem;
    min-height: 440px;
}

.vaptio-section__logo {
    border: 5px solid var(--color-accent);
    border-radius: 50%;
    padding: 70px 30px 40px 30px;
    width: 284px;
    height: 284px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vaptio-section__logo-img {
    width: 204px;
    height: 134px;
    object-fit: contain;
    display: block;
    transform-origin: center;
    will-change: transform;
    animation: logoBreath 1s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
}

/* --------------------------------------------------------------------------
 * 6. Our DNA（PC）
 * -------------------------------------------------------------------------- */

.home-dna {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 4rem 0;
}

.home-dna .home-dna__title {
    font-size: var(--font-size-32);
    font-weight: 400;
}

.home-dna .home-dna__right {
    display: flex;
    gap: 2rem;
}

.home-dna .home-dna__right .home-dna__card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.home-dna__img-wrapper {
    border-radius: 1rem;
    overflow: hidden;
}

.home-dna .home-dna__right .home-dna__card-title {
    font-size: var(--font-size-24);
    font-weight: 400;
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
 * 7. 首页底部 Contact CTA：样式见 components.css .site-call-to-action（与 Nolik Lab 共用）
 * -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
 * 8. 响应式 ≤768px（顺序与首页 DOM 一致）
 * -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .mobile-scroll-nav {
        gap: clamp(12px, 4vw, 40px);
        max-width: 100%;
        min-width: 0;
    }

    .new-arrival__container {
        max-width: 100%;
        overflow-x: clip;
        box-sizing: border-box;
    }

    /* --- 首屏 slider --- */
    .slider__pagination {
        display: none;
    }

    /* --- 首屏视频触发 & 弹层 --- */
    .home-hero-video-trigger__play {
        width: 56px;
        height: 56px;
        margin-left: -28px;
        margin-top: -28px;
    }

    .home-hero-video-trigger__play::before {
        margin-left: -5px;
        margin-top: -10px;
        border-top-width: 10px;
        border-bottom-width: 10px;
        border-left-width: 16px;
    }

    .home-video-modal__dialog {
        width: calc(100% - 24px);
    }

    .home-video-modal__player {
        max-height: calc(100vh - 80px);
        border-radius: 8px;
    }

    .home-video-modal__close {
        right: -6px;
        top: -10px;
    }

    /* --- New Arrivals --- */
    .new-arrival__container {
        padding: 0 20px;
    }

    .new-arrival {
        padding: 5rem 0 4rem;
    }

    .new-arrival .new-arrival__title-wrapper {
        margin-bottom: 2rem;
    }

    .new-arrival__title-wrapper .new-arrival__title {
        font-size: var(--font-size-24);
    }

    .new-arrival__title-wrapper .new-arrival__subtitle {
        font-size: var(--font-size-12);
    }

    .new-arrival__product-list {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: calc((100% - 12px) / 2);
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
        padding: 0 0 38px;
        margin: 0;
        scrollbar-width: none;
        -ms-overflow-style: none;
        max-width: 100%;
        box-sizing: border-box;
        touch-action: pan-x;
    }

    .new-arrival__product-list::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .new-arrival__product-list::-webkit-scrollbar-thumb {
        background: var(--color-primary);
        border-radius: var(--radius-full);
    }

    .new-arrival__product-item {
        flex: initial;
        min-width: 0;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        cursor: default;
    }

    .new-arrival__product-item--placeholder {
        visibility: hidden;
        pointer-events: none;
    }

    .new-arrival__product-img {
        height: clamp(170px, 42vw, 240px);
        margin-bottom: 0.75rem;
    }

    .new-arrival__product-info {
        height: auto;
        gap: 0.5rem;
    }

    .new-arrival__product-info .new-arrival__product-title {
        font-size: var(--font-size-14);
    }

    .new-arrival__product-info .new-arrival__short-desc {
        font-size: var(--font-size-8);
        line-height: 1.5;
    }

    .new-arrival__product-info a.new-arrival__learn-more {
        margin-top: 0.25rem;
        padding: 10px 18px;
        font-size: var(--font-size-8);
    }

    .new-arrival__product-item:hover .new-arrival__img-default {
        opacity: 1;
    }

    .new-arrival__product-item:hover .new-arrival__img-hover {
        opacity: 0;
    }

    .new-arrival__product-list:has(.new-arrival__product-item:hover) .new-arrival__product-item:not(:hover) {
        flex: 1;
        opacity: 1;
        visibility: visible;
    }

    .new-arrival__product-item:hover {
        flex: 1;
    }

    /* --- Brand Story --- */
    .brand-story__inner {
        padding: 0 20px;
    }

    .brand-story__title {
        font-size: var(--font-size-24);
    }

    .brand-story__subtitle {
        font-size: var(--font-size-14);
    }

    .brand-story__subtitle span {
        display: block;
    }

    .brand-story__intro,
    .brand-story__paragraph {
        font-size: var(--font-size-10);
        text-align: center;
    }

    .brand-story__lead,
    .brand-story__media,
    .brand-story__content {
        padding: 2rem 0;
    }

    /* --- Home story --- */
    .home-story-section {
        margin: 40px 0;
    }

    .home-story-section__subtitle,
    .home-story-section__title-wrapper {
        font-size: var(--font-size-14);
    }

    /* --- VAPTIO logo --- */
    .vaptio-section__stage {
        padding: 40px 0;
        min-height: auto;
    }

    .vaptio-section__logo {
        width: 135px;
        height: 135px;
        padding: 40px 15px 25px 15px;
    }

    /* --- Our DNA：约 1.5 卡、横滑/拖动、无滚动条 --- */
    .home-dna {
        --home-dna-m-gap: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        padding: 3rem 20px;
    }

    .home-dna .home-dna__title {
        font-size: var(--font-size-24);
    }

    .home-dna .home-dna__right .home-dna__card-title {
        font-size: var(--font-size-14);
    }

    .home-dna .home-dna__right {
        container-type: inline-size;
        container-name: home-dna-m;
        flex-wrap: nowrap;
        gap: var(--home-dna-m-gap);
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -ms-overflow-style: none;
        cursor: grab;
        touch-action: pan-x;
        box-sizing: border-box;
    }

    .home-dna .home-dna__right::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .home-dna .home-dna__right::-webkit-scrollbar-thumb {
        background: var(--color-primary);
        border-radius: var(--radius-full);
    }

    .home-dna .home-dna__right.is-dragging {
        cursor: grabbing;
        user-select: none;
    }

    .home-dna .home-dna__right.is-dragging .home-dna__img-wrapper img {
        pointer-events: none;
    }

    .home-dna .home-dna__right .home-dna__card {
        flex: 0 0 calc((100cqi - var(--home-dna-m-gap)) / 1.5);
        min-width: 0;
        box-sizing: border-box;
    }

    .home-dna__img-wrapper {
        border-radius: 9px;
        aspect-ratio: 3 / 4;
        cursor: pointer;
    }

    .home-dna__img-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .home-dna .home-dna__right .home-dna__card-title {
        margin-bottom: 0;
    }

}
