/* ============================================================
   style.css — Index page specific styles
   Shared nav/font/reset styles are in nav.css
   ============================================================ */

/* Canvas Background */
#canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: calc(80dvh);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 40px 20px 40px 20px;
    gap: 0;
}

/* ---- Keyframes ---- */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes expandDown {
    from { max-height: 0; opacity: 0; }
    to   { max-height: 400px; opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* ---- Initial hidden states ---- */
.hero-text-top,
.hero-text-bottom {
    opacity: 0;
}

.hero-img-item {
    opacity: 0;
}

/* ---- Active animation classes (added by JS) ---- */
.hero-text-top.anim-in {
    animation: fadeSlideUp 0.9s ease forwards;
}

.hero-text-bottom.anim-in {
    animation: fadeSlideUp 0.9s ease forwards;
}

.hero-images.anim-in {
    animation: expandDown 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    overflow: hidden;
}

/* Clip wrapper handles the expand — uses transition not keyframe */
.hero-images-clip {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.6s ease;
}

.hero-images-clip.anim-in {
    max-height: 1000px;
    opacity: 1;
    overflow: visible;
}

.hero-img-item.anim-in {
    animation: fadeIn 0.7s ease forwards;
}

/* Staggered delays for each image */
.hero-img-item:nth-child(1).anim-in { animation-delay: 0s; }
.hero-img-item:nth-child(2).anim-in { animation-delay: 0.15s; }
.hero-img-item:nth-child(3).anim-in { animation-delay: 0.3s; }
.hero-img-item:nth-child(4).anim-in { animation-delay: 0.45s; }

/* ---- Hero text ---- */
.hero-text-top {
    margin-bottom: 30px;
}

.hero h1 {
    font-family: 'Helvetica', sans-serif;
    font-size: 56px;
    font-weight: bold;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.hero h2 {
    font-family: 'Hiragino Sans', sans-serif;
    font-size: 24px;
    font-weight: normal;
    opacity: 0.9;
}

.hero-text-bottom {
    margin-top: 30px;
}

.hero p {
    font-family: 'Hiragino Sans', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    max-width: 800px;
    opacity: 0.9;
}

/* ---- Hero images row ---- */
.hero-images {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    overflow: visible;
    padding: 20px 0;
}

.hero-img-item {
    background: rgba(255,255,255,0.92);
    flex: 0 0 auto;
    width: 200px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* When any sibling is hovered, dim all items */
.hero-images:hover .hero-img-item {
    filter: brightness(0.6);
    transform: scale(0.95);
}

/* Brighten and scale up the hovered item */
.hero-images .hero-img-item:hover {
    filter: brightness(1) !important;
    transform: scale(1.3) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    z-index: 10;
    position: relative;
    transition: ease-in-out 0.1s;
}

.hero-img-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===== Warp Background Layer ===== */
.warp-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background-image: url('../images/hero-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    mix-blend-mode: screen;
    opacity: 0.6;
}

/* ===== Responsive (page-specific) ===== */
@media (max-width: 900px) {
    .hero h1 { font-size: 36px; }
    .hero h2 { font-size: 18px; }

    .hero-images {
        flex-wrap: wrap;
        gap: 10px;
    }

    .hero-img-item {
        width: calc(50% - 10px);
        margin-bottom: 10px;
    }
}
