/* ============================================
   iMATE Engine for Business - Top Page CSS
   Scroll-driven cinematic landing page
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: auto; /* JS controls scroll behavior */
}

body {
    font-family: 'Helvetica Neue', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    color: #e8e8f0;
    background: #050510;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Scroll Spacer --- */
.scroll-spacer {
    height: 1200vh;
    pointer-events: auto;
}

/* --- Fixed Layers --- */
.fixed-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* --- Background --- */
.site-background {
    z-index: 0;
    background: url('../images/siteBack1.png') center center / cover no-repeat;
    will-change: transform;
}

/* --- Overlay (iMATE → LIVRA transition) --- */
.site-overlay {
    z-index: 5;
    background: rgba(20, 10, 60, 0.5);
    will-change: opacity;
}

/* --- Particles Canvas --- */
.particles-canvas {
    z-index: 3;
}

/* --- Character --- */
.site-character {
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    will-change: transform, opacity;
}

.site-character img {
    max-height: 160vh;
    width: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    margin-bottom: -15vh;
}

/* --- Fox Fire --- */
.fox-fire {
    z-index: 15;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Position at character's hands (bottom-center, raised to hand level) */
    padding-bottom: 35vh;
    opacity: 0;
    will-change: transform, opacity;
}

.fox-fire img {
    max-height: 22vh;
    width: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Fox fire flicker (always active once visible) */
@keyframes fire-flicker {
    0%   { transform: scale(1) translateY(0); }
    25%  { transform: scale(1.03) translateY(-3px); }
    50%  { transform: scale(0.97) translateY(2px); }
    75%  { transform: scale(1.02) translateY(-1px); }
    100% { transform: scale(1) translateY(0); }
}

.fox-fire.flickering img {
    animation: fire-flicker 2.5s ease-in-out infinite;
}

/* --- Hero Text --- */
.hero-text {
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    will-change: transform, opacity;
}

.hero-title {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 20px rgba(100, 120, 255, 0.5), 0 0 60px rgba(80, 100, 200, 0.3);
    letter-spacing: 0.05em;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    color: rgba(200, 210, 255, 0.8);
    margin-top: 1rem;
    font-weight: 300;
}

/* --- Catchcopy --- */
.catchcopy {
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    will-change: transform, opacity;
}

.catchcopy-text {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 15px rgba(0, 200, 255, 0.4), 0 0 40px rgba(0, 150, 200, 0.2);
    line-height: 1.5;
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    text-align: center;
    color: rgba(200, 210, 255, 0.7);
    font-size: 0.85rem;
    will-change: opacity;
}

.scroll-indicator-arrow {
    display: block;
    font-size: 1.5rem;
    margin-top: 0.3rem;
    animation: arrow-bounce 1.5s ease-in-out infinite;
}

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

/* --- Scene Flash --- */
.scene-flash {
    position: fixed;
    inset: 0;
    background: white;
    opacity: 0;
    z-index: 50;
    pointer-events: none;
    transition: opacity 0.15s ease-out;
}

/* --- Progress Indicator --- */
.progress-indicator {
    position: fixed;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.progress-line {
    width: 2px;
    flex: 1;
    background: rgba(150, 170, 255, 0.15);
    min-height: 8px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(150, 170, 255, 0.2);
    border: 1px solid rgba(150, 170, 255, 0.3);
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
    pointer-events: auto;
    position: relative;
}

.progress-dot.active {
    background: rgba(100, 180, 255, 0.9);
    box-shadow: 0 0 8px rgba(100, 180, 255, 0.6);
    transform: scale(1.3);
}

.progress-dot-label {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-size: 0.7rem;
    color: rgba(180, 190, 255, 0.6);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.progress-dot:hover .progress-dot-label {
    opacity: 1;
}

/* --- Navigation --- */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: background 0.4s, backdrop-filter 0.4s;
    pointer-events: auto;
}

.site-nav.scrolled {
    background: rgba(5, 5, 20, 0.7);
    backdrop-filter: blur(12px);
}

.nav-logo {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    flex-shrink: 0;
}

.nav-links li {
    flex-shrink: 0;
}

.nav-links a {
    color: rgba(220, 225, 255, 0.85);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #fff;
}

/* --- Content Sections --- */
.content-layer {
    z-index: 30;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.content-panel {
    position: fixed;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 30, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(100, 150, 255, 0.12);
    border-radius: 16px;
    padding: 2.5rem 3rem;
    max-width: 680px;
    width: 90%;
    color: #e8e8f0;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
    z-index: 30;
}

.content-panel.visible {
    opacity: 1;
    pointer-events: auto;
}

.content-panel h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.content-panel h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(180, 210, 255, 0.95);
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
}

.content-panel p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: rgba(220, 225, 240, 0.9);
    margin-bottom: 0.8rem;
}

.content-panel table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.content-panel th {
    background: rgba(80, 100, 200, 0.2);
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-weight: 600;
    color: rgba(180, 200, 255, 0.95);
    border-bottom: 1px solid rgba(100, 150, 255, 0.2);
}

.content-panel td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid rgba(100, 150, 255, 0.08);
    color: rgba(210, 215, 230, 0.85);
}

.content-panel tr:hover td {
    background: rgba(80, 100, 200, 0.08);
}

/* --- CTA Buttons --- */
.cta-button {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, rgba(80, 120, 255, 0.8), rgba(120, 80, 255, 0.8));
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 0.3rem;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(80, 120, 255, 0.4);
}

.cta-button.secondary {
    background: rgba(100, 120, 200, 0.2);
    border: 1px solid rgba(100, 150, 255, 0.3);
}

.cta-button.secondary:hover {
    background: rgba(100, 120, 200, 0.35);
}

/* --- Feature Cards --- */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.feature-card {
    background: rgba(60, 80, 160, 0.12);
    border: 1px solid rgba(100, 150, 255, 0.1);
    border-radius: 10px;
    padding: 1.2rem;
}

.feature-card h4 {
    font-size: 0.95rem;
    color: rgba(160, 200, 255, 0.95);
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.82rem;
    color: rgba(200, 205, 220, 0.8);
    margin-bottom: 0;
    line-height: 1.6;
}

/* --- Footer --- */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 35;
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: rgba(150, 160, 180, 0.6);
    opacity: 0;
    will-change: opacity;
    pointer-events: none;
}

.site-footer.visible {
    opacity: 1;
    pointer-events: auto;
}

.site-footer a {
    color: rgba(150, 170, 200, 0.7);
    text-decoration: none;
    margin-left: 1rem;
}

/* ============================================
   Responsive
   ============================================ */

/* Tablet */
@media (max-width: 1199px) {
    .site-character img {
        max-height: 110vh;
        margin-bottom: -10vh;
    }

    .fox-fire {
        padding-bottom: 25vh;
    }

    .content-panel {
        left: 50%;
        max-width: 600px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .site-character img {
        max-height: 90vh;
        margin-bottom: -8vh;
    }

    .fox-fire {
        padding-bottom: 35vh;
    }

    .fox-fire img {
        max-height: 12vh;
    }

    .content-panel {
        left: 50%;
        max-width: 95%;
        padding: 1.5rem 1.2rem;
    }

    .content-panel h2 {
        font-size: 1.2rem;
    }

    .content-panel p {
        font-size: 0.85rem;
    }

    .content-panel table {
        font-size: 0.75rem;
    }

    .progress-indicator {
        display: none;
    }

    .site-nav {
        padding: 0.6rem 0.8rem;
    }

    .nav-logo {
        font-size: 0.85rem;
    }

    /* Hide "ホーム" on mobile (logo already links to home) */
    .nav-links li:first-child {
        display: none;
    }

    .nav-links {
        gap: 0.6rem;
    }

    .nav-links a {
        font-size: 0.7rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .cta-button {
        display: block;
        text-align: center;
        margin: 0.4rem 0;
    }
}

/* iPhone / Small screens */
@media (max-width: 430px) {
    .site-nav {
        padding: 0.5rem 0.6rem;
    }

    .nav-logo {
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .nav-links li:first-child {
        display: none;
    }

    .nav-links {
        gap: 0.4rem;
    }

    .nav-links a {
        font-size: 0.6rem;
    }

    .fox-fire {
        padding-bottom: 36vh;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .fox-fire.flickering img {
        animation: none;
    }

    .scroll-indicator-arrow {
        animation: none;
    }

    .scene-flash {
        display: none;
    }
}
