/* ==========================================================================
   SPAC2 RESEARCH — CINEMATIC DEEP SPACE ATMOSPHERE & MASTER TYPOGRAPHY
   Theme: Pure Deep Space Monochrome (Zero-G Void)
   Typography: Plus Jakarta Sans (Bold Modern) + Instrument Serif (Artistic Italic)
   ========================================================================== */

:root {
    /* Pure Deep Cosmos Palette */
    --bg-page: #040507;
    --bg-surface: #0a0c10;
    --bg-card: rgba(14, 17, 23, 0.7);
    
    /* White & Stellar Silver Typography */
    --text-primary: #ffffff;
    --text-secondary: #d4d4d8;
    --text-tertiary: #a1a1aa;
    --text-muted: #52525b;
    
    /* Silver Hairline Borders */
    --border-subtle: rgba(255, 255, 255, 0.10);
    --border-medium: rgba(255, 255, 255, 0.20);
    
    /* Floating Header Tokens */
    --header-bg: rgba(10, 12, 16, 0.82);
    --header-border: rgba(255, 255, 255, 0.12);
    --header-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 1px rgba(255, 255, 255, 0.1);
    --header-blur: 24px;
    --header-radius: 22px;
    
    /* Typography Tokens */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif-italic: 'Instrument Serif', Georgia, serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
}

::selection {
    background: #ffffff;
    color: #000000;
}

/* ==========================================================================
   DEEP SPACE CANVAS & CINEMATIC ATMOSPHERE OVERLAYS
   ========================================================================== */
#spatial-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

/* Cinematic Edge Vignette */
.cinematic-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.85);
    pointer-events: none;
    z-index: 2;
}

/* Central Cinematic Lens Glow */
.cinematic-lens-glow {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1000px;
    height: 550px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 40%, transparent 70%);
    pointer-events: none;
    z-index: 2;
    filter: blur(40px);
}

/* Coordinate Grid Overlay */
.lab-grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    z-index: 2;
}

/* Interactive Cursor Light */
.cursor-light {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.01) 45%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: opacity 0.3s ease;
}

/* ==========================================================================
   STANDARDIZED FLOATING GLASSMORPHISM HEADER (SPAC2 SPEC)
   ========================================================================== */
.header-outer-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: calc(1.1rem + env(safe-area-inset-top, 0px)) 1.5rem 0.5rem;
    pointer-events: none;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.header-blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: linear-gradient(to bottom, rgba(4, 5, 7, 0.95) 25%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.glass-header {
    pointer-events: auto;
    width: 100%;
    max-width: 1080px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.85rem;
    background: var(--header-bg);
    border: 1px solid var(--header-border);
    border-radius: var(--header-radius);
    box-shadow: var(--header-shadow);
    backdrop-filter: blur(var(--header-blur));
    -webkit-backdrop-filter: blur(var(--header-blur));
    transition: var(--transition-smooth);
}

/* Left Group */
.header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-subtle);
}

.btn-back:hover {
    background: #ffffff;
    color: #000000;
    transform: translateX(-2px);
}

.brand-logo-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.brand-logo-img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    object-fit: contain;
    display: block;
}

.brand-text {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    user-select: none;
}

.brand-main {
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.brand-divider {
    color: var(--text-muted);
    font-weight: 300;
}

.brand-app {
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* Right Group (Status Indicator) */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.header-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    user-select: none;
}

.status-pulse-ring {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 0 8px #ffffff;
    animation: statusBlink 2.5s infinite ease-in-out;
}

@keyframes statusBlink {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 12px #ffffff; }
}

/* ==========================================================================
   SINGLE-PAGE HERO WRAPPER
   ========================================================================== */
.single-page-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    min-height: 100vh;
    padding: calc(96px + env(safe-area-inset-top, 0px)) 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.corner-mark {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    user-select: none;
}

.corner-mark.top-left { top: 1.25rem; left: 1.5rem; }
.corner-mark.top-right { top: 1.25rem; right: 1.5rem; }
.corner-mark.bottom-left { bottom: 5rem; left: 1.5rem; }
.corner-mark.bottom-right { bottom: 5rem; right: 1.5rem; }

/* ==========================================================================
   CINEMATIC STAGE & BLACK HOLE GRAVITATIONAL FIELD
   ========================================================================== */
.cinematic-stage {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin: auto 0;
    padding: 2rem 0;
    position: relative;
}

/* CINEMATIC BLACK HOLE (Lơ lửng bay qua lại phía sau tiêu đề) */
.cinematic-blackhole {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 640px;
    height: 320px;
    pointer-events: none;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: blackholeFloatDrift 14s ease-in-out infinite alternate;
    opacity: 0.88;
}

/* Chu kỳ trôi dạt qua lại nhẹ nhàng điện ảnh */
@keyframes blackholeFloatDrift {
    0% {
        transform: translate(-54%, -52%) rotate(-1.5deg) scale(0.96);
    }
    50% {
        transform: translate(-46%, -47%) rotate(1.8deg) scale(1.04);
    }
    100% {
        transform: translate(-52%, -54%) rotate(-0.8deg) scale(1.0);
    }
}

/* Đĩa bồi tụ ánh sáng (Accretion Disk) */
.blackhole-accretion-disk {
    position: absolute;
    width: 580px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, transparent 35%, rgba(255, 255, 255, 0.28) 46%, rgba(255, 255, 255, 0.12) 62%, transparent 75%);
    transform: rotateX(74deg) rotateZ(0deg);
    filter: blur(5px);
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.18), inset 0 0 30px rgba(255, 255, 255, 0.2);
    animation: accretionSpin 20s linear infinite;
}

@keyframes accretionSpin {
    0% { transform: rotateX(74deg) rotateZ(0deg); }
    100% { transform: rotateX(74deg) rotateZ(360deg); }
}

/* Vòng cong ánh sáng hấp dẫn (Einstein Photon Ring) */
.blackhole-photon-ring {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.4), inset 0 0 25px rgba(255, 255, 255, 0.3);
    background: radial-gradient(circle, transparent 55%, rgba(255, 255, 255, 0.08) 80%, transparent 100%);
    filter: blur(1.5px);
    animation: photonPulse 6s ease-in-out infinite alternate;
}

@keyframes photonPulse {
    0% { transform: scale(0.97); opacity: 0.7; }
    100% { transform: scale(1.03); opacity: 1; }
}

/* Lõi Hố Đen (Singularity Void) */
.blackhole-singularity {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: #020204;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.95), inset 0 0 20px #000000;
    z-index: 1;
}

/* Dải khúc xạ ánh sáng không gian */
.blackhole-light-beam {
    position: absolute;
    width: 750px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.15), transparent);
    filter: blur(1px);
    transform: rotate(-12deg);
    opacity: 0.6;
    animation: beamSway 8s ease-in-out infinite alternate;
}

@keyframes beamSway {
    0% { transform: rotate(-14deg) scaleX(0.9); opacity: 0.4; }
    100% { transform: rotate(-9deg) scaleX(1.1); opacity: 0.75; }
}

/* Soft white starlight halo behind headline */
.headline-halo {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 650px;
    height: 200px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 50%, transparent 80%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 1;
}

/* Primary Brand Title */
.brand-hero-unit {
    position: relative;
    z-index: 3;
    margin-bottom: 2rem;
    opacity: 0;
    transform: scale(0.96);
    filter: blur(12px);
    animation: cinematicTitleEntrance 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes cinematicTitleEntrance {
    0% {
        opacity: 0;
        transform: scale(0.96) translateY(20px);
        filter: blur(12px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0px);
    }
}

.main-title {
    font-size: clamp(3.6rem, 9.5vw, 7.8rem);
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.3em;
    user-select: none;
    letter-spacing: -0.03em;
}

/* "Spac2" - Ultra-clean Bold Sans */
.title-spac2 {
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.04em;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.25);
}

/* "Research" - Artistic Elegant Italic Serif */
.title-research {
    font-family: var(--font-serif-italic);
    font-weight: 400;
    font-style: italic;
    letter-spacing: -0.01em;
    color: #f4f4f5;
    text-shadow: 0 0 35px rgba(255, 255, 255, 0.35);
    background: linear-gradient(180deg, #ffffff 30%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   HERO SUB-CONTENT UNIT (Smooth Cinematic Fade-In)
   ========================================================================== */
.hero-content-unit {
    max-width: 680px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    filter: blur(6px);
    animation: cinematicContentEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

@keyframes cinematicContentEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0px);
    }
}

.hero-subtext {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-weight: 400;
    margin-bottom: 2.25rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
    text-decoration: none;
    padding: 0.9rem 2.2rem;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 24px rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.3);
    background: #ffffff;
}

.btn-svg {
    transition: transform 0.25s ease;
}

.btn-primary:hover .btn-svg {
    transform: translateX(4px);
}

.launch-announcement-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.launch-svg {
    flex-shrink: 0;
}

/* ==========================================================================
   SPACE METRICS TICKER & FOOTER
   ========================================================================== */
.lab-ticker-bar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(14, 17, 23, 0.85);
    border: 1px solid var(--border-subtle);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    user-select: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 95%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-bottom: 0.75rem;
}

.lab-ticker-bar::-webkit-scrollbar {
    display: none;
}

.ticker-item {
    display: flex;
    gap: 0.4rem;
    white-space: nowrap;
}

.ticker-item .lbl { color: var(--text-tertiary); }
.ticker-item .val { font-weight: 700; color: #ffffff; }
.ticker-dot { color: var(--border-subtle); }

.single-page-footer {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    user-select: none;
    text-align: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ==========================================================================
   GPU HARDWARE ACCELERATION
   ========================================================================== */
.cinematic-stage,
.brand-hero-unit,
.hero-content-unit,
.cinematic-blackhole,
.cursor-light {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform, opacity;
}

/* ==========================================================================
   MULTI-DEVICE RESPONSIVE OPTIMIZATIONS (TABLETS, PHONES, ULTRA-WIDE)
   ========================================================================== */

/* Tablets & Small Laptops (768px - 1024px) */
@media (max-width: 1024px) {
    .single-page-wrapper {
        padding-top: calc(85px + env(safe-area-inset-top, 0px));
    }
    
    .cinematic-blackhole {
        width: 520px;
        height: 260px;
        transform: translate(-50%, -50%) scale(0.85);
    }
    
    .blackhole-accretion-disk {
        width: 460px;
        height: 140px;
    }
}

/* Mobile Devices & Foldables (< 768px) */
@media (max-width: 768px) {
    .corner-mark {
        display: none;
    }
    
    .header-outer-wrapper {
        padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem 0.5rem;
    }
    
    .glass-header {
        height: 50px;
        padding: 0 0.75rem;
        border-radius: 18px;
    }
    
    .btn-back {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    
    .brand-logo-badge {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    
    .brand-text {
        font-size: 0.88rem;
    }
    
    .single-page-wrapper {
        padding: calc(75px + env(safe-area-inset-top, 0px)) 1.25rem 1rem;
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic Viewport Height on Mobile */
    }
    
    .cinematic-stage {
        padding: 1.5rem 0;
    }
    
    .main-title {
        font-size: clamp(2.8rem, 11vw, 4.8rem);
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.15em;
        justify-content: center;
    }
    
    .cinematic-blackhole {
        width: 360px;
        height: 190px;
        top: 20%;
        opacity: 0.75;
    }
    
    .blackhole-accretion-disk {
        width: 340px;
        height: 110px;
        filter: blur(4px);
    }
    
    .blackhole-photon-ring {
        width: 140px;
        height: 140px;
    }
    
    .blackhole-singularity {
        width: 90px;
        height: 90px;
    }
    
    .blackhole-light-beam {
        width: 420px;
    }
    
    .headline-halo {
        width: 340px;
        height: 140px;
    }
    
    .hero-subtext {
        font-size: 1.02rem;
        line-height: 1.6;
        padding: 0 0.25rem;
        margin-bottom: 1.85rem;
    }
    
    .btn-primary {
        padding: 0.85rem 2rem;
        font-size: 0.9rem;
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .hero-actions {
        width: 100%;
        margin-bottom: 1.6rem;
    }
    
    .launch-announcement-badge {
        font-size: 0.68rem;
        padding: 0.35rem 0.85rem;
        letter-spacing: 0.1em;
        max-width: 92%;
        text-align: center;
        line-height: 1.4;
    }
    
    .lab-ticker-bar {
        padding: 0.5rem 1.1rem;
        font-size: 0.7rem;
        gap: 0.9rem;
        max-width: 100%;
    }
}

/* Small Screens (< 380px, e.g. iPhone SE) */
@media (max-width: 380px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .hero-subtext {
        font-size: 0.92rem;
    }
    
    .launch-announcement-badge span {
        font-size: 0.65rem;
    }
}

/* Ultra-Wide & 4K Monitors (min-width: 1600px) */
@media (min-width: 1600px) {
    .main-title {
        font-size: 8.5rem;
    }
    
    .hero-subtext {
        font-size: 1.25rem;
        max-width: 760px;
    }
    
    .cinematic-blackhole {
        width: 760px;
        height: 380px;
    }
    
    .blackhole-accretion-disk {
        width: 700px;
        height: 220px;
    }
}
