/* AIOS Prism - Holistic Aesthetic Sync Stylesheet (V3.0) */
@import 'variables.css';

/* ===== RESET & BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--surface-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== CINEMATIC BACKGROUND SYSTEM ===== */
.hero-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
    perspective: 1000px;
}

.glow-layer {
    position: absolute;
    filter: blur(100px);
    mix-blend-mode: screen;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.glow-blue {
    top: var(--cursor-y);
    left: var(--cursor-x);
    width: 100vw;
    height: 100vw;
    background: radial-gradient(circle, rgba(59, 130, 246, calc(var(--glow-pulse) * 0.3)) 0%, transparent 70%);
    transform: translate(-50%, -50%);
}

.glow-orange {
    top: calc(100% - var(--cursor-y));
    right: calc(100% - var(--cursor-x));
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(249, 115, 22, calc(var(--glow-pulse) * 0.2)) 0%, transparent 70%);
    transform: translate(50%, 50%);
}

.glow-purple {
    top: 50%;
    left: 50%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(168, 85, 247, calc(var(--glow-pulse) * 0.15)) 0%, transparent 60%);
    transform: translate(-50%, -50%);
}

.prism-field {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 700px;
    height: 700px;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.prism-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 30px rgba(59, 130, 246, 0.3));
    mix-blend-mode: color-dodge;
}

.prism-primary {
    transform: rotate(var(--prism-rotate)) scale(calc(1 + (var(--glow-pulse) - 0.6) * 0.4));
    z-index: 3;
}

.prism-secondary {
    transform: rotate(calc(var(--prism-rotate) * -1.2)) scale(calc(1.1 + (var(--glow-pulse) - 0.6) * 0.2));
    z-index: 2;
    opacity: 0.6;
}

.prism-ternary {
    transform: rotate(calc(var(--prism-rotate) * 0.8)) scale(calc(1.2 + (var(--glow-pulse) - 0.6) * 0.1));
    z-index: 1;
    opacity: 0.3;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

/* ===== UTILITIES ===== */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.text-gradient {
    background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 50%, #f8fafc 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 10s infinite linear;
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

/* ===== HEADER & BRAND LOGO ===== */
.site-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

.header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    transition: var(--transition);
}

.brand-icon {
    width: 34px;
    height: 34px;
    transform: rotate(var(--prism-rotate));
    filter: drop-shadow(0 0 10px rgba(249, 115, 22, 0.4));
    transition: filter 0.3s ease, transform 0.1s linear;
}

.brand-icon svg {
    width: 100%;
    height: 100%;
}

.brand:hover .brand-icon {
    filter: drop-shadow(0 0 20px var(--accent-orange)) drop-shadow(0 0 40px var(--accent-blue));
}

.brand-text {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 1.15rem;
    letter-spacing: 0.05em;
}

.brand .names {
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, var(--accent-blue) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
    position: relative;
    overflow: hidden;
}

/* Shimmer overlay on names */
.brand .names::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: text-shimmer 4s infinite linear;
}

@keyframes text-shimmer {
    to {
        left: 200%;
    }
}

.brand .divider {
    opacity: 0.2;
    font-weight: 200;
    color: var(--text-secondary);
    margin: 0 4px;
}

.brand .project {
    font-weight: 400;
    color: var(--text-secondary);
}

.brand .project span {
    color: var(--accent-blue);
    font-weight: 800;
}

.brand-icon {
    width: 32px;
    height: 32px;
    transform: rotate(var(--prism-rotate));
    filter: drop-shadow(0 0 10px rgba(249, 115, 22, 0.4));
    transition: filter 0.3s ease, transform 0.1s linear;
}

.nav-links {
    display: flex;
    gap: var(--space-xl);
}

.nav-link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.nav-link:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ===== MODAL & FORMS ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: var(--space-xl);
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 500px;
    width: 100%;
    padding: var(--space-3xl);
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-modal {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

#waitlist-form {
    margin-top: var(--space-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

#waitlist-email {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1rem;
}

#waitlist-email:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
}

#waitlist-message {
    margin-top: var(--space-md);
    font-size: 0.9rem;
}

#waitlist-message.success {
    color: #4ade80;
}

#waitlist-message.error {
    color: #f87171;
}

/* ===== ADAPTIVE CONFIGURATION ENGINE (Terminal-Specific) ===== */

/* Desktop / Ultra-High Experience */
body.env-desktop .hero h1 {
    font-size: 4.5rem;
}

body.env-desktop .app-preview-container {
    margin-top: 100px;
}

/* Mobile / Fluid-Performance Experience */
body.env-mobile header .container {
    padding: var(--space-md) var(--space-lg);
}

body.env-mobile .logo-text {
    font-size: 1.2rem;
}

body.env-mobile .nav-links {
    display: none;
}

body.env-mobile .btn-cta-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

body.env-mobile .hero {
    padding-top: 80px;
}

body.env-mobile .hero h1 {
    font-size: 2.2rem;
    line-height: 1.2;
}

body.env-mobile .hero p {
    font-size: 1rem;
    padding: 0 var(--space-lg);
}

body.env-mobile .hero-actions {
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

body.env-mobile .btn-primary,
body.env-mobile .btn-secondary {
    width: 100%;
    justify-content: center;
}

body.env-mobile .app-preview-container {
    margin-top: 40px;
    padding: 0 var(--space-md);
}

body.env-mobile .section-padding {
    padding: 60px 0;
}

body.env-mobile .grid-features {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

/* Touch-specific Interactions */
body.is-touch .magnetic-glow {
    /* Reduce glow scale on touch to avoid covering fingers */
    transform: translate(-50%, -50%) scale(0.6);
}

/* Performance Safelist: Drip heavy effects if too slow */
body.env-mobile .prism-bg {
    opacity: 0.6;
    /* Dim background to save GPU on mobile */
}

/* ===== BUTTONS ===== */
.btn-cta-sm {
    padding: 10px 24px;
    border-radius: var(--radius-full);
    background: #fff;
    color: #000;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition);
}

.btn-cta-sm:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

.btn-primary {
    padding: 16px 32px;
    border-radius: var(--radius-md);
    background: var(--accent-blue);
    color: #fff;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--header-height) + var(--space-section)) 0 var(--space-section);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    margin-bottom: var(--space-hero-gap);
    z-index: 10;
}

.badge {
    display: inline-flex;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-blue);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: var(--space-xl);
    text-transform: uppercase;
    letter-spacing: 0.25em;
}

.hero-title {
    font-size: 5.8rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xl);
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-subtitle strong {
    color: #fff;
    background: rgba(59, 130, 246, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ===== APP PREVIEW ===== */
.app-preview-container {
    padding: var(--space-section) 0;
    position: relative;
    z-index: 10;
}

.app-window {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
}

.app-window::before {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 1;
}

.window-header {
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.traffic-lights {
    display: flex;
    gap: 8px;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.app-content img {
    width: 100%;
    display: block;
    filter: saturate(1.2) contrast(1.1);
}

/* ===== FEATURES ===== */
.features {
    padding: var(--space-section) 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.feature-card {
    padding: var(--space-3xl);
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-10px);
}

/* ===== FOOTER ===== */
.site-footer {
    padding: var(--space-3xl) 0;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        gap: var(--space-lg);
        text-align: center;
    }

    .site-header {
        position: absolute;
    }
}