/* ═══════════════════════════════════════════════════════════════
   BAACADIA Landing Page Styles
   Art Bible Colors: Alien Desert Palette (Moebius-inspired)
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ═══ SKY GRADIENT ═══ */
    --sky-peach: #f5d5c8;
    --sky-lavender: #c8b8c0;
    --sky-pale: #e8dcd4;
    --sky-mid: #d4c4bc;
    
    /* ═══ TERRAIN / GROUND ═══ */
    --sand: #d4a574;
    --sand-light: #e8c8a8;
    
    /* ═══ FLORA (warm reds - NO green) ═══ */
    --flora-dark: #8b5a5a;
    --flora-coral: #c87878;
    
    /* ═══ ACCENTS ═══ */
    --crystal-pink: #e8a8b8;
    
    /* ═══ INK / TEXT ═══ */
    --ink: #2a2420;
    --ink-soft: #4a4038;
    --ink-light: #6a5a4a;
    
    /* ═══ CLOUDFEN ═══ */
    --cloudfen-white: #f8f8f5;
    --cloudfen-dark: #1a1a1a;
    
    /* ═══ SPACING SCALE ═══ */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    
    /* ═══ TYPOGRAPHY ═══ */
    --font-display: 'Caveat', cursive;
    --font-body: 'Crimson Pro', Georgia, serif;
    
    /* ═══ TRANSITIONS ═══ */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.8s var(--ease-out-expo);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(180deg, 
        var(--sky-peach) 0%, 
        #e8d0c4 20%,
        var(--sky-lavender) 45%, 
        var(--sky-mid) 65%,
        var(--sky-pale) 100%
    );
    color: var(--ink);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ─────────────────────────────────────────────────────────────────
   LOADING STATE
   ───────────────────────────────────────────────────────────────── */
.loading {
    position: fixed;
    inset: 0;
    background: var(--sky-peach);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 9999;
    transition: opacity 0.6s, visibility 0.6s;
}

.loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--sand-light);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--ink-soft);
    letter-spacing: 0.1em;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────────────────────────
   WEBGL CANVAS
   ───────────────────────────────────────────────────────────────── */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ─────────────────────────────────────────────────────────────────
   CONTENT LAYER (scrollable overlay)
   ───────────────────────────────────────────────────────────────── */
.content {
    position: relative;
    z-index: 10;
    pointer-events: none;
    
    /* Gradient overlay that darkens as you scroll down */
    background: linear-gradient(180deg,
        transparent 0%,
        transparent 60vh,
        rgba(232, 200, 168, 0.05) 80vh,
        rgba(232, 200, 168, 0.15) 110vh,
        rgba(210, 180, 160, 0.3) 140vh,
        rgba(180, 155, 140, 0.5) 180vh,
        rgba(120, 100, 90, 0.7) 220vh,
        rgba(70, 60, 54, 0.85) 260vh,
        rgba(42, 36, 32, 0.95) 300vh,
        var(--ink) 340vh,
        var(--ink) 100%
    );
}

/* Subtle pink/coral ambient glow at bottom */
.content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80vh;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(60, 50, 52, 0.15) 15%,
        rgba(80, 60, 65, 0.25) 30%,
        rgba(100, 75, 82, 0.35) 45%,
        rgba(130, 95, 108, 0.4) 60%,
        rgba(160, 115, 130, 0.42) 75%,
        rgba(185, 130, 148, 0.4) 90%,
        rgba(200, 140, 160, 0.35) 100%
    );
    pointer-events: none;
    z-index: -1;
}

.content > * {
    pointer-events: auto;
}

/* ─────────────────────────────────────────────────────────────────
   SECTION BASE
   ───────────────────────────────────────────────────────────────── */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-md);
}

/* ─────────────────────────────────────────────────────────────────
   HERO SECTION
   ───────────────────────────────────────────────────────────────── */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(5rem, 15vw, 12rem);
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--ink);
    text-shadow: 
        3px 3px 0 var(--sky-peach),
        -1px -1px 0 var(--sky-peach),
        1px -1px 0 var(--sky-peach),
        -1px 1px 0 var(--sky-peach);
    margin-bottom: var(--space-xs);
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 0.5s forwards;
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 300;
    font-style: italic;
    color: var(--ink-soft);
    letter-spacing: 0.1em;
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 1s forwards;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 1.5s forwards;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    opacity: 0;
    animation: fadeIn 1s ease-out 2.5s forwards, float 2s ease-in-out infinite 2.5s;
}

.scroll-indicator span {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--ink-soft);
    border-bottom: 2px solid var(--ink-soft);
    transform: rotate(45deg);
}

/* ─────────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────────── */
.btn {
    padding: var(--space-sm) 2.5rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-decoration: none;
    border: 2px solid var(--ink);
    transition: all 0.4s var(--ease-out-expo);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Play icon in button */
.play-icon {
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-out-expo);
}

.btn:hover .play-icon {
    transform: scale(1.1);
}

.btn-primary {
    background: var(--ink);
    color: var(--sky-peach);
}

.btn-primary:hover {
    background: var(--flora-dark);
    border-color: var(--flora-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(139, 90, 90, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
}

.btn-secondary:hover {
    background: var(--ink);
    color: var(--sky-peach);
    transform: translateY(-3px);
}

.btn-steam {
    background: var(--crystal-pink);
    border-color: var(--crystal-pink);
    color: var(--ink);
}

.btn-steam:hover {
    background: var(--flora-coral);
    border-color: var(--flora-coral);
}

.btn-discord {
    background: transparent;
    border-color: var(--sand);
    color: var(--sand);
}

.btn-discord:hover {
    background: var(--sand);
    color: var(--ink);
}

/* ─────────────────────────────────────────────────────────────────
   PITCH SECTION
   ───────────────────────────────────────────────────────────────── */
.pitch {
    background: transparent;
}

.pitch-content {
    max-width: 800px;
    text-align: center;
}

.pitch-question {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 500;
    color: var(--flora-dark);
    margin-bottom: 3rem;
    line-height: 1.2;
}

.pitch-text {
    font-family: var(--font-body);
    font-size: 1.25rem;
    line-height: 2;
    color: var(--ink-soft);
    margin-bottom: var(--space-md);
}

.pitch-text strong {
    color: var(--ink);
    font-weight: 500;
}

/* Features grid */
.features-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.feature {
    padding: var(--space-md) var(--space-sm);
    border-top: 2px solid var(--ink);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-sm);
    color: var(--flora-dark);
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
    color: var(--ink);
}

.feature-desc {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--ink-soft);
    font-style: italic;
}

/* ─────────────────────────────────────────────────────────────────
   DEMO SECTION
   ───────────────────────────────────────────────────────────────── */
.demo-section {
    background: transparent;
    color: var(--sky-peach);
}

.demo-container {
    max-width: 1450px;
    width: 90%;
    text-align: center;
}

.demo-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
    color: var(--crystal-pink);
}

.demo-frame {
    aspect-ratio: 16/9;
    background: #E8C4A8;
    border: 3px solid var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.demo-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.demo-placeholder {
    color: var(--ink-soft);
    font-style: italic;
}

.demo-hint {
    margin-top: var(--space-md);
    font-size: 1rem;
    color: var(--sand);
    font-style: italic;
}

/* Fullscreen button for demo */
.demo-fullscreen-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.demo-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* ─────────────────────────────────────────────────────────────────
   CTA SECTION
   ───────────────────────────────────────────────────────────────── */
.cta-section {
    background: transparent;
    color: var(--sky-peach);
    text-align: center;
    min-height: 0;
    padding: var(--space-lg) var(--space-md) 16rem;
}

.cta-content {
    max-width: 600px;
}

.cta-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
}

.cta-buttons .btn {
    min-width: 280px;
}

.archives-link {
    margin-top: 3rem;
    font-size: 1rem;
    color: var(--ink-light);
}

.archives-link a {
    color: var(--crystal-pink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.archives-link a:hover {
    border-color: var(--crystal-pink);
}

/* ─────────────────────────────────────────────────────────────────
   MODAL
   ───────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(42, 36, 32, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, var(--sky-peach) 0%, var(--sky-pale) 100%);
    border: 3px solid var(--ink);
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s var(--ease-out-expo);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--ink-soft);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--ink);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--flora-dark);
    margin-bottom: 1rem;
}

.modal-text {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--ink-soft);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.modal-text:last-of-type {
    margin-bottom: 1.5rem;
}

.modal-btn {
    min-width: 150px;
}

/* ─────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────── */
footer {
    background: transparent;
    padding: var(--space-md) var(--space-md) 3rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--sand-light);
    letter-spacing: 0.1em;
}

/* ─────────────────────────────────────────────────────────────────
   MODEL CREDIT
   ───────────────────────────────────────────────────────────────── */
.model-credit {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: rgba(42, 36, 32, 0.8);
    color: var(--sand-light);
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    border-radius: 4px;
    z-index: 100;
    font-family: var(--font-body);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* ─────────────────────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* Scroll-triggered reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─────────────────────────────────────────────────────────────────
   DECORATIVE - Moebius ligne claire style
   ───────────────────────────────────────────────────────────────── */
.ligne-claire-border {
    position: relative;
}

.ligne-claire-border::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 2px solid var(--ink);
    pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 768px) {
    .features-row {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .section {
        padding: var(--space-lg) var(--space-sm);
    }

    .model-credit {
        font-size: 0.65rem;
        padding: 0.4rem 0.8rem;
    }

    /* 移动端hero区域调整 - 减少空白 */
    .hero {
        height: auto;
        min-height: 70vh;
        justify-content: flex-start;
        padding-top: 8vh;
        padding-bottom: 12vh;
    }

    .hero-title {
        font-size: clamp(3.5rem, 12vw, 6rem);
    }

    .hero-tagline {
        font-size: clamp(1rem, 2.5vw, 1.3rem);
    }

    .hero-cta {
        margin-top: 2rem;
    }

    .scroll-indicator {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: 3rem;
        animation: fadeIn 1s ease-out 2.5s forwards, floatMobile 2s ease-in-out infinite 2.5s;
    }

    @keyframes floatMobile {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(10px); }
    }

    /* Demo section mobile */
    .demo-section {
        padding: var(--space-md) var(--space-sm);
        min-height: 0;
    }

    .demo-container {
        max-width: 100%;
    }

    .demo-title {
        font-size: 1.2rem;
        margin-bottom: var(--space-sm);
    }

    .demo-frame {
        aspect-ratio: 4/3;
        border-width: 2px;
    }

    .demo-hint {
        font-size: 0.85rem;
        margin-top: var(--space-sm);
    }

    /* CTA section mobile */
    .cta-section {
        padding: var(--space-md) var(--space-sm) 4rem;
    }

    .cta-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }

    .cta-buttons .btn {
        min-width: 240px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --space-lg: 3rem;
        --space-xl: 4rem;
    }

    .pitch-text {
        font-size: 1.1rem;
        line-height: 1.8;
    }

    /* 更小屏幕的进一步调整 */
    .hero {
        min-height: 60vh;
        padding-top: 6vh;
        padding-bottom: 8vh;
    }

    .hero-title {
        font-size: clamp(3rem, 14vw, 5rem);
    }

    .scroll-indicator {
        margin-top: 2rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    /* Demo section small mobile */
    .demo-section {
        padding: var(--space-sm) 0.5rem;
    }

    .demo-frame {
        aspect-ratio: 1/1;
        border-radius: 8px;
    }

    .demo-title {
        font-size: 1rem;
    }

    .demo-hint {
        font-size: 0.75rem;
        padding: 0 0.5rem;
    }

    /* Pitch section small mobile */
    .pitch-question {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
        margin-bottom: 2rem;
    }

    .pitch-text {
        font-size: 1rem;
    }

    .feature {
        padding: var(--space-sm) var(--space-xs);
    }

    .feature-title {
        font-size: 1.1rem;
    }

    .feature-desc {
        font-size: 0.9rem;
    }
}

/* Short viewport height - hide scroll indicator to prevent compression */
@media (max-height: 700px) {
    .scroll-indicator {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: 2rem;
        animation: fadeIn 1s ease-out 2.5s forwards, floatMobile 2s ease-in-out infinite 2.5s;
    }

    .hero {
        height: auto;
        min-height: 100vh;
    }
}

/* Very short viewport - hide scroll indicator entirely */
@media (max-height: 550px) {
    .scroll-indicator {
        display: none;
    }

    .hero {
        min-height: 0;
        padding-bottom: 2rem;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding-top: 5vh;
        min-height: 0;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 4rem);
    }

    .hero-cta {
        flex-direction: row;
        margin-top: 1rem;
    }

    .scroll-indicator {
        display: none;
    }

    .demo-frame {
        aspect-ratio: 16/9;
        max-height: 70vh;
    }

    .section {
        min-height: 0;
        padding: var(--space-md) var(--space-sm);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}