/* ═════════════════════════════════════════════════════════════════════════
   VibeHarbor — Home Specific Styles (home.css)
   Full-Bleed Immersive Scene Layout
   ═════════════════════════════════════════════════════════════════════════ */

/* ─── 1. Layout Tokens ─── */
:root {
    --home-hero-min-h: 90vh;
}

.home-container {
    position: relative;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ─── 2. Top Navigation Alignment ─── */
.nav-inner {
    max-width: 1360px;
}

.nav-links-desktop {
    display: flex;
    align-items: center;
    gap: 28px;
}

/* ─── 3. Full-Bleed Hero Section ─── */
.hero-v2 {
    position: relative;
    min-height: calc(var(--home-hero-min-h) - 64px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 72px 0 48px;
    isolation: isolate;
}

/* Background Scene: Spans 100% Full Viewport Width & Height */
.hero-scene-wrapper {
    left: 50%;
    right: auto;
    width: 100vw;
    transform: translateX(-50%);
    position: absolute;
    inset: 0 calc(50% - 50vw);
    z-index: 0;
    overflow: hidden;
    background: #06080c;
    pointer-events: auto;
}

/* Static fallback layer shown only before the procedural scene is ready. */
.scene-poster-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: 55% 50%;
    background-repeat: no-repeat;
    background-image: linear-gradient(135deg, #08121a 0%, #102a36 48%, #0a1018 100%);
    transition: opacity 0.8s ease;
    z-index: 1;
}

/* WebGL Three.js Wave & Ripple Canvas */
.scene-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.8s ease;
    cursor: default;
}

.scene-canvas.is-ready {
    opacity: 1;
}

/* Cinema Scrim: Soft dark vignette on the left (for crisp typography) and bottom fade */
.scene-scrim {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
        /* Left gradient to ensure pristine text readability */
        linear-gradient(90deg,
            rgba(6, 8, 12, 0.85) 0%,
            rgba(6, 8, 12, 0.65) 28%,
            rgba(6, 8, 12, 0.25) 45%,
            transparent 62%
        ),
        /* Bottom smooth blend into page content */
        linear-gradient(180deg,
            rgba(6, 8, 12, 0.2) 0%,
            transparent 25%,
            transparent 75%,
            #0a0a0f 100%
        );
}

/* Interactive Water Ripple Hint */
.ripple-hint {
    position: absolute;
    right: 48px;
    bottom: 24px;
    z-index: 4;
    pointer-events: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(8, 10, 14, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: opacity 0.5s ease;
}

/* Hero Content Grid (Left 42% Copy / Right 58% Scenic Showcase) */
.hero-v2-content {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 44% 56%;
    align-items: center;
    width: 100%;
    min-height: 520px;
    pointer-events: none; /* Let clicks pass to scene, copy buttons override */
}

/* Left Copy Column */
.hero-copy-col {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 20px;
    pointer-events: auto;
}

.hero-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-label);
    margin-bottom: 28px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
}

/* Main Title */
.hero-v2-title {
    font-size: clamp(46px, 4.8vw, 72px);
    font-weight: 750;
    line-height: 1.14;
    letter-spacing: -0.035em;
    color: var(--text-title);
    margin-bottom: 24px;
    text-shadow: 0 4px 36px rgba(0, 0, 0, 0.7);
}

.hero-v2-title .title-accent {
    background: linear-gradient(135deg, #ffffff 30%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Subtitle */
.hero-v2-subtitle {
    font-size: clamp(16px, 1.25vw, 18px);
    line-height: 1.75;
    color: rgba(231, 228, 237, 0.85);
    max-width: 480px;
    margin-bottom: 38px;
    font-weight: 400;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

/* Hero CTA Button */
.hero-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: all 0.3s var(--ease-fluid);
    cursor: pointer;
    pointer-events: auto;
}

.hero-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 38px rgba(99, 102, 241, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    filter: brightness(1.05);
}

.hero-cta-btn:active {
    transform: translateY(0);
}

.hero-cta-btn .material-symbols-outlined {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.hero-cta-btn:hover .material-symbols-outlined {
    transform: translateY(3px);
}

/* Right Spacer (Tree and Wave stage) */
.hero-spacer-col {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 480px;
    pointer-events: auto; /* Click here triggers water ripple */
    cursor: crosshair;
}

/* ─── 4. Hero Bottom Portal Cards (2 Products) ─── */
.hero-portals {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 36px;
    margin-bottom: 84px;
    position: relative;
    z-index: 15;
}

.portal-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 24px;
    border-radius: 18px;
    background: rgba(14, 16, 23, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s var(--ease-fluid);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.portal-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(19, 22, 34, 0.88);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(99, 102, 241, 0.14);
}

.portal-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.portal-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.3s var(--ease-fluid);
}

.portal-card:hover .portal-icon-box {
    transform: scale(1.06);
}

.portal-icon-box img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.portal-info {
    flex: 1;
    min-width: 0;
}

.portal-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.portal-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-title);
    letter-spacing: -0.01em;
}

.portal-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.portal-desc {
    font-size: 13px;
    color: var(--text-label);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-label);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.portal-card:hover .portal-arrow {
    background: var(--primary);
    color: #ffffff;
    transform: translateX(3px);
}

/* ─── 5. Section 2: Detailed Showcase Cards ─── */
.section-v2 {
    padding-bottom: 110px;
}

.section-v2-head {
    margin-bottom: 40px;
}

.section-v2-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 8px;
}

.section-v2-title {
    font-size: clamp(26px, 3.2vw, 36px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-title);
}

/* Cards Grid */
.works-grid-v2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.work-card-v2 {
    position: relative;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    padding: 32px;
    border-radius: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    transition: transform 0.3s var(--ease-fluid), border-color 0.3s ease, box-shadow 0.3s ease;
}

.work-card-v2:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.28);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38), 0 0 24px rgba(99, 102, 241, 0.08);
}

/* Card Visual Stage */
.work-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 24px;
}

/* VibePet Hover Reaction */
.pet-interactive-stage {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pet-avatar-main {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(99, 102, 241, 0.25));
    transition: transform 0.3s var(--ease-fluid), filter 0.3s ease;
}

.work-card-v2:hover .pet-avatar-main {
    transform: translateY(-6px) scale(1.05);
    filter: drop-shadow(0 12px 28px rgba(139, 92, 246, 0.4));
}

/* Fuyu Diary Hover Reaction */
.diary-preview-deck {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.diary-icon-main {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s var(--ease-fluid);
}

.diary-popover {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(15, 12, 24, 0.92);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #e2e8f0;
    font-size: 11px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s var(--ease-fluid);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.work-card-v2:hover .diary-icon-main {
    transform: translateY(-12px);
}

.work-card-v2:hover .diary-popover {
    opacity: 1;
    transform: translateY(0);
}

/* Work Card Body */
.work-card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.work-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.work-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-body);
}

.work-pill.accent {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.32);
    color: #818cf8;
}

.work-card-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-title);
    margin-bottom: 12px;
    letter-spacing: -0.015em;
}

.work-card-desc {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-body);
    margin-bottom: 20px;
}

.work-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tech-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech-chip {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-label);
}

.card-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
    transition: all 0.3s ease;
}

.card-link-btn:hover {
    transform: translateX(2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.card-link-btn .material-symbols-outlined {
    font-size: 16px;
    transition: transform 0.25s ease;
}

.card-link-btn:hover .material-symbols-outlined {
    transform: translateX(4px);
}

/* ─── 6. Mobile & Responsive ─── */
@media (max-width: 900px) {
    .hero-v2 {
        min-height: 85vh;
        padding-top: 60px;
        padding-bottom: 24px;
    }

    .hero-v2-content {
        grid-template-columns: 1fr;
        min-height: auto;
        gap: 24px;
    }

    .hero-copy-col {
        padding-right: 0;
        align-items: flex-start;
        max-width: 600px;
    }

    .hero-v2-title {
        font-size: clamp(38px, 9vw, 54px);
    }

    .hero-v2-subtitle {
        font-size: 15px;
        margin-bottom: 28px;
    }

    .hero-spacer-col {
        min-height: 180px;
    }

    .scene-poster-layer {
        background-image: linear-gradient(180deg, #102a36 0%, #08121a 100%);
        background-position: 50% 50%;
    }

    .scene-scrim {
        background:
            linear-gradient(180deg,
                rgba(6, 8, 12, 0.82) 0%,
                rgba(6, 8, 12, 0.4) 40%,
                rgba(6, 8, 12, 0.2) 65%,
                #0a0a0f 100%
            );
    }

    .hero-portals {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 24px;
        margin-bottom: 60px;
    }

    .portal-card {
        padding: 16px 20px;
    }

    .work-card-v2 {
        grid-template-columns: 1fr;
        padding: 24px;
        gap: 20px;
    }

    .work-card-media {
        max-width: 200px;
        margin: 0 auto;
    }
}

@media (max-width: 520px) {
    .home-container {
        padding: 0 16px;
    }

    .ripple-hint {
        display: none;
    }
}

/* ─── 7. Accessibility ─── */
@media (prefers-reduced-motion: reduce) {
    .scene-canvas {
        display: none !important;
    }
    .scene-poster-layer {
        opacity: 1 !important;
        display: block !important;
    }
    .hero-cta-btn,
    .portal-card,
    .work-card-v2,
    .pet-avatar-main,
    .diary-icon-main {
        transition: none !important;
        transform: none !important;
    }
}

/* ─── Procedural harbor scene ─── */
body.vh-home {
    overflow-x: hidden;
}

.hero-scene-wrapper {
    background:
        radial-gradient(circle at 72% 22%, rgba(255, 191, 119, 0.18), transparent 28%),
        radial-gradient(circle at 34% 70%, rgba(31, 105, 126, 0.26), transparent 38%),
        linear-gradient(145deg, #07111e 0%, #0b1e2a 52%, #06101a 100%);
    left: 50%;
    right: auto;
    width: 100vw;
    transform: translateX(-50%);
    touch-action: none;
}

.scene-poster-layer {
    background-image:
        radial-gradient(circle at 72% 20%, rgba(255, 208, 131, 0.16), transparent 25%),
        linear-gradient(145deg, #07111e 0%, #0b1e2a 56%, #06101a 100%);
    opacity: 1;
}

.scene-poster-layer.is-retired {
    opacity: 0;
    pointer-events: none;
}

.scene-canvas {
    cursor: grab;
    opacity: 1;
    touch-action: none;
}

.scene-canvas:active {
    cursor: grabbing;
}

.hero-v2-title,
.hero-v2-subtitle,
.hero-copy-col {
    text-shadow: none;
}

.hero-spacer-col {
    pointer-events: none;
}

.scene-scrim {
    background:
        linear-gradient(90deg, rgba(5, 13, 22, 0.78) 0%, rgba(5, 13, 22, 0.38) 35%, transparent 63%),
        linear-gradient(180deg, rgba(4, 10, 17, 0.22) 0%, transparent 36%, rgba(5, 10, 16, 0.84) 100%);
}

.scene-object-label {
    position: absolute;
    z-index: 4;
    transform: translate(-50%, -50%);
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--label-color) 34%, transparent);
    border-radius: 999px;
    background: rgba(7, 18, 28, 0.62);
    color: var(--label-color);
    font: 600 11px/1 'JetBrains Mono', monospace;
    letter-spacing: .04em;
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.scene-toast {
    position: absolute;
    right: 28px;
    bottom: 28px;
    z-index: 8;
    display: grid;
    gap: 5px;
    min-width: 190px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 221, 167, .24);
    border-radius: 14px;
    background: rgba(7, 17, 27, .84);
    color: #f6ead9;
    box-shadow: 0 16px 40px rgba(0,0,0,.25);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .24s ease, transform .24s ease;
    pointer-events: none;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.scene-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.scene-toast strong {
    font-size: 15px;
}

.scene-toast span {
    color: rgba(246, 234, 217, .7);
    font-size: 12px;
}

@media (max-width: 760px) {
    .hero-scene-wrapper {
        left: 50%;
        right: auto;
        width: 100vw;
        transform: translateX(-50%);
    }

    .scene-scrim {
        background: linear-gradient(180deg, rgba(5, 13, 22, .74) 0%, rgba(5, 13, 22, .12) 43%, rgba(5, 10, 16, .92) 100%);
    }

    .scene-object-label {
        font-size: 10px;
        padding: 5px 8px;
    }

    .scene-toast {
        right: 16px;
        bottom: 18px;
        left: 16px;
        min-width: 0;
    }
}

/* Give the detailed model its own mobile space instead of covering the copy. */
@media (max-width: 760px) {
    .hero-v2 { min-height: 740px; padding-top: 96px; justify-content: flex-start; }
    .hero-v2-content { align-items: start; }
    .hero-scene-wrapper { top: 390px; bottom: auto; height: 330px; touch-action: pan-y; }
    .scene-canvas { touch-action: pan-y; }
    .scene-scrim { background: linear-gradient(180deg, #0a0a0f 0%, transparent 15%, transparent 84%, #0a0a0f 100%); }
    .hero-spacer-col { min-height: 330px; }
}
