/* ==========================================================================
   BASE.CSS — Structural layout, CSS variables, reset, typography
   All colors/fonts come from CSS variables — set dynamically by quantum.js
   ========================================================================== */

/* 1. CSS VARIABLES (defaults — overwritten by quantum.js per reality) */
:root {
    --bg-void:       #060610;
    --bg-deep:       #0a0a18;
    --bg-surface:    #10101f;
    --bg-glass:      rgba(255,255,255,0.04);
    --bg-glass-hi:   rgba(255,255,255,0.08);

    --accent-a:      #7b2fff;
    --accent-b:      #00d4ff;
    --accent-c:      #00ff88;
    --accent-a-rgb:  123,47,255;
    --accent-b-rgb:  0,212,255;
    --accent-c-rgb:  0,255,136;

    --glow-a:        rgba(123,47,255,0.4);
    --glow-b:        rgba(0,212,255,0.4);
    --glow-c:        rgba(0,255,136,0.4);

    --text-hi:       #f2f2ff;
    --text-mid:      #8888aa;
    --text-lo:       #3a3a55;
    --border:        rgba(255,255,255,0.07);
    --border-hi:     rgba(255,255,255,0.15);

    --font-display:  'Space Grotesk', sans-serif;
    --font-body:     'Inter', sans-serif;
    --font-mono:     'JetBrains Mono', monospace;

    --radius-sm:    6px;
    --radius-md:    12px;
    --radius-lg:    24px;
    --radius-full:  999px;

    --trans-fast:    0.2s ease;
    --trans-med:     0.4s ease;
    --trans-slow:    0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    background: var(--bg-void);
    color: var(--text-hi);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.8s ease, color 0.8s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select {
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
}
ul { list-style: none; }

/* 3. TYPOGRAPHY */
h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
}
h1 { font-size: clamp(3rem, 7vw, 6.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
p  { color: var(--text-mid); line-height: 1.7; }

/* 4. BOOT SCREEN */
#boot-screen {
    position: fixed; inset: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
#boot-screen.hidden { opacity: 0; visibility: hidden; }

#boot-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

.boot-terminal {
    position: relative;
    z-index: 2;
    width: min(560px, 90vw);
    font-family: var(--font-mono);
    color: #00ff88;
}

.boot-logo {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 2.5rem;
    color: #fff;
}
.boot-logo .boot-num { color: #00ff88; }

.boot-lines { min-height: 140px; margin-bottom: 2rem; }
.boot-line {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    color: rgba(0,255,136,0.7);
}
.boot-line.visible { opacity: 1; transform: translateX(0); }
.boot-line.active { color: #00ff88; }
.boot-line .cursor { display: inline-block; animation: blink 0.8s step-end infinite; }

.boot-bar {
    height: 2px;
    background: rgba(0,255,136,0.15);
    border-radius: 2px;
    overflow: hidden;
}
.boot-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #00d4ff);
    width: 0%;
    transition: width 0.05s linear;
    box-shadow: 0 0 12px #00ff88;
}

/* 5. MAIN APP */
#s78-app {
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.8s ease;
}
#s78-app.visible { opacity: 1; }

/* Background canvas */
#bg-canvas {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* 6. SCROLLABLE CONTENT */
#page-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 7. SECTIONS */
.section-hero    { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 8rem 0 4rem; }
.section-services{ padding: 8rem 0; }
.section-stats   { padding: 6rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-contact { padding: 8rem 0; }
.s78-footer      { padding: 3rem 0; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--text-lo); }

.section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--accent-b);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}
.section-title { margin-bottom: 1rem; }

/* Reality Badge */
.reality-badge {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-lo);
    letter-spacing: 0.08em;
    z-index: 1000;
    pointer-events: none;
    transition: color 0.3s;
}

/* Escape Hatch */
.btn-escape {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-lo);
    border: 1px solid var(--border);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-full);
    z-index: 1000;
    transition: all var(--trans-fast);
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
}
.btn-escape:hover {
    color: var(--text-hi);
    border-color: var(--border-hi);
}
.escape-icon { font-size: 0.9rem; }

/* Custom Cursor */
#cursor-dot, #cursor-ring {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
}
#cursor-dot {
    width: 6px; height: 6px;
    background: var(--accent-a);
    top: 0; left: 0;
}
#cursor-ring {
    width: 36px; height: 36px;
    border: 1px solid rgba(var(--accent-a-rgb), 0.5);
    top: 0; left: 0;
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}
.cursor-hover #cursor-ring {
    width: 60px; height: 60px;
    border-color: var(--accent-a);
}

/* Ground State Overlay */
.ground-state-overlay {
    position: fixed; inset: 0;
    background: #f9f9f9;
    color: #111;
    z-index: 9990;
    overflow-y: auto;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.ground-state-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.gs-back {
    position: fixed; top: 2rem; left: 2rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #555;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}
.gs-back:hover { background: #111; color: #fff; border-color: #111; }
.gs-content { max-width: 800px; width: 100%; margin-top: 4rem; font-family: 'Inter', sans-serif; }
.gs-content h1 { font-size: 4rem; font-weight: 900; letter-spacing: -0.04em; margin-bottom: 1rem; color: #111; }
.gs-tagline { font-size: 1.25rem; color: #555; margin-bottom: 3rem; }
.gs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; margin-bottom: 3rem; }
.gs-grid strong { display: block; margin-bottom: 0.5rem; color: #111; }
.gs-grid p { font-size: 0.9rem; color: #666; line-height: 1.6; }
.gs-email { font-family: var(--font-mono); font-size: 1.1rem; color: #0033cc; border-bottom: 2px solid #0033cc; }

/* 8. SCROLL ANIMATIONS */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--trans-slow), transform 0.8s var(--trans-slow);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* RESPONSIVE */
@media (max-width: 768px) {
    #page-content { padding: 0 1.25rem; }
    .s78-footer { flex-direction: column; gap: 0.5rem; text-align: center; }
}
