
/* ═══════════════════════════════════════════════════════
   EVENT HORIZON — Scientific Keyboard Design System
   Design: Google Stitch "Quantum Laboratory" Theme
   Tokens: From Stitch MCP Design System
   ═══════════════════════════════════════════════════════ */

/* --- DESIGN TOKENS (Event Horizon / Stitch) --- */
:root {
    /* Core Palette */
    --bg: #0e0e13;
    --surface: #0e0e13;
    --surface-container: #19191f;
    --surface-container-low: #131319;
    --surface-container-high: #1f1f26;
    --surface-container-highest: #25252d;
    --surface-bright: #2c2b33;
    --surface-variant: #25252d;

    /* Brand Colors */
    --primary: #97a9ff;
    --primary-dim: #3e65ff;
    --primary-container: #859aff;
    --secondary: #c180ff;
    --secondary-dim: #9c48ea;
    --tertiary: #69daff;
    --tertiary-dim: #00c0ea;

    /* Text Colors */
    --on-surface: #f9f5fd;
    --on-surface-variant: #acaab1;
    --on-primary: #002283;
    --on-background: #f9f5fd;

    /* Borders & Outlines */
    --outline: #76747b;
    --outline-variant: #48474d;
    --ghost-border: rgba(72, 71, 77, 0.15);

    /* Functional */
    --error: #ff716c;
    --error-dim: #d7383b;

    /* Effects */
    --glow-primary: rgba(151, 169, 255, 0.15);
    --glow-secondary: rgba(193, 128, 255, 0.12);
    --glow-tertiary: rgba(105, 218, 255, 0.12);
    --glass-bg: rgba(37, 37, 45, 0.40);
    --glass-blur: 20px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    --tracking-tight: -0.04em;
    --tracking-wide: 0.1em;
}

/* --- BASE --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg) !important;
    color: var(--on-surface) !important;
    font-family: var(--font-sans) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    overflow-x: hidden;
}

::selection {
    background: var(--primary);
    color: var(--on-primary);
}

/* --- SURFACES (Tonal Depth, No Borders) --- */
.lab-surface {
    background: var(--surface-container) !important;
    border: 1px solid var(--ghost-border) !important;
    border-radius: 20px;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lab-surface:hover {
    border-color: rgba(151, 169, 255, 0.1) !important;
    box-shadow: 0 0 30px var(--glow-primary);
}

/* --- GLASSMORPHIC NAV --- */
nav {
    background: rgba(14, 14, 19, 0.75) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid var(--ghost-border) !important;
}

/* --- HERO TYPOGRAPHY --- */
.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem) !important;
    font-weight: 800 !important;
    letter-spacing: var(--tracking-tight) !important;
    background: linear-gradient(135deg, #f9f5fd 0%, var(--primary) 50%, var(--secondary) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    line-height: 1.1 !important;
    color: transparent !important;
}

.hero-subtitle {
    color: var(--on-surface-variant) !important;
    font-size: 1.125rem;
    line-height: 1.7;
    max-width: 640px;
    margin: 0 auto;
}

/* --- KEYBOARD KEYS (Luminous Depth) --- */
.key-btn {
    background: var(--surface-container-highest) !important;
    border: 1px solid var(--ghost-border) !important;
    color: var(--on-surface) !important;
    font-weight: 600 !important;
    font-family: var(--font-mono) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 52px !important;
    border-radius: 12px !important;
    font-size: 1.25rem !important;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 1 !important;
}

.key-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    opacity: 0;
    background: radial-gradient(circle at center, var(--glow-primary), transparent 70%);
    transition: opacity 0.3s ease;
}

.key-btn:hover {
    transform: translateY(-2px) !important;
    border-color: rgba(151, 169, 255, 0.25) !important;
    box-shadow: 0 0 20px var(--glow-primary), 0 4px 12px rgba(0,0,0,0.3) !important;
}

.key-btn:hover::before {
    opacity: 1;
}

.key-btn:active {
    transform: scale(0.95) !important;
    box-shadow: 0 0 10px var(--glow-primary) !important;
}

/* --- TABS (High-Energy Actuators) --- */
.tab {
    position: relative;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    cursor: pointer;
    color: var(--on-surface-variant);
    border: none;
    background: transparent;
}

.tab:hover {
    color: var(--on-surface);
    background: var(--surface-container-high);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary-dim), var(--primary)) !important;
    color: white !important;
    box-shadow: 0 0 20px var(--glow-primary), 0 4px 12px rgba(62, 101, 255, 0.3) !important;
}

/* --- INPUT AREA (Data Entry Cell) --- */
.input-area {
    font-family: var(--font-mono);
    background: transparent !important;
    border: none !important;
    outline: none !important;
    resize: none !important;
    color: var(--on-surface) !important;
    width: 100%;
    font-size: 1.4rem;
    line-height: 1.6;
}

.input-area::placeholder {
    color: var(--outline);
}

/* --- SEARCH FIELD --- */
.search-field {
    background: var(--surface-container-highest) !important;
    border: 1px solid var(--ghost-border) !important;
    border-radius: 12px !important;
    padding: 10px 16px !important;
    color: var(--on-surface) !important;
    font-size: 0.875rem !important;
    font-family: var(--font-sans) !important;
    transition: all 0.3s ease;
}

.search-field:focus {
    border-color: rgba(151, 169, 255, 0.3) !important;
    box-shadow: 0 0 0 3px var(--glow-primary) !important;
    outline: none;
}

.search-field::placeholder {
    color: var(--outline);
}

/* --- BUTTONS --- */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-dim), var(--primary)) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 24px !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(62, 101, 255, 0.35);
}

/* --- FEATURE CARDS --- */
.feature-card {
    background: var(--surface-container) !important;
    border: 1px solid var(--ghost-border) !important;
    color: var(--on-surface) !important;
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card:hover {
    border-color: rgba(151, 169, 255, 0.15);
    box-shadow: 0 0 40px var(--glow-primary);
    transform: translateY(-4px);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-icon.physics { background: rgba(151, 169, 255, 0.12); color: var(--primary); }
.feature-icon.math { background: rgba(193, 128, 255, 0.12); color: var(--secondary); }
.feature-icon.chemistry { background: rgba(105, 218, 255, 0.12); color: var(--tertiary); }

/* --- FOOTER (Vercel/Linear Aesthetic) --- */
.premium-footer {
    background: var(--surface-container-low);
    border-top: 1px solid var(--ghost-border);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-brand-logo .logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-dim), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
}

.footer-brand-logo span {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--on-surface);
}

.footer-brand p {
    color: var(--on-surface-variant);
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 280px;
}

.footer-col h5 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--on-surface-variant);
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-col a {
    color: var(--outline);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 72rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--ghost-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--outline);
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--outline);
}

.footer-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

/* --- AMBIENT BACKGROUND EFFECTS --- */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: -1;
    opacity: 0.4;
}

.glow-orb.primary {
    width: 500px;
    height: 500px;
    background: var(--primary-dim);
    top: -200px;
    right: -200px;
    opacity: 0.06;
}

.glow-orb.secondary {
    width: 400px;
    height: 400px;
    background: var(--secondary-dim);
    bottom: 20%;
    left: -150px;
    opacity: 0.04;
}

/* --- SCROLLBAR (Dark Premium) --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline); }

/* --- AD SLOTS (Invisible when empty, no "Space Reserved") --- */
.ad-slot {
    min-height: 0;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
}

.ad-slot:empty {
    display: none;
}

/* Remove the cheap "Space Reserved" text */
.ad-slot::after {
    content: none !important;
}

/* --- BLOG STYLES --- */
.blog-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    color: var(--on-surface-variant);
}

.blog-content h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--on-surface);
}

.blog-content p {
    margin-bottom: 1.5rem;
}

.blog-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.blog-content a:hover {
    border-bottom-color: var(--primary);
}

.pro-tip {
    background: rgba(62, 101, 255, 0.08);
    border-left: 3px solid var(--primary);
    padding: 1.5rem 2rem;
    border-radius: 0 16px 16px 0;
    margin: 2rem 0;
    color: var(--on-surface);
}

.cta-banner {
    background: var(--surface-container);
    border: 1px solid rgba(151, 169, 255, 0.15);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    margin-top: 4rem;
    box-shadow: 0 0 40px var(--glow-primary);
}

/* --- LINK STYLES --- */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-container);
}

/* --- LANG TOGGLE (Refined) --- */
.lang-toggle {
    display: flex;
    align-items: center;
    background: var(--surface-container-highest);
    padding: 3px;
    border-radius: 20px;
    border: 1px solid var(--ghost-border);
}

.lang-btn {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--on-surface-variant);
    background: transparent;
    letter-spacing: 0.05em;
}

.lang-btn.active {
    background: var(--surface-bright);
    color: var(--on-surface);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* --- DARK MODE TOGGLE --- */
.darkmode-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--ghost-border);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.darkmode-toggle:hover {
    background: var(--surface-container-high);
    border-color: rgba(151, 169, 255, 0.15);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .hero-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    nav .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* --- ANIMATIONS --- */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.06; }
    50% { opacity: 0.1; }
}

.glow-orb.primary {
    animation: pulse-glow 8s ease-in-out infinite;
}

.glow-orb.secondary {
    animation: pulse-glow 12s ease-in-out infinite 4s;
}

/* --- HOW-TO STEPS --- */
.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-dim), var(--primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
    box-shadow: 0 0 12px var(--glow-primary);
}
