/* ==========================================================================
   Base Styles — Typography, Body, Global Elements
   ========================================================================== */

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

h1 { font-size: clamp(2.5rem, 5vw, 5rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-muted);
    font-size: 1.125rem;
    font-weight: 300;
    line-height: 1.7;
}

small { font-size: 0.875rem; color: var(--text-dark); }

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
}

/* ── Background Effects ── */
.bg-grid {
    position: fixed; inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at 50% 50%, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 0%, transparent 70%);
    z-index: var(--z-background);
    pointer-events: none;
}

.bg-glow {
    position: fixed; inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--accent-glow), transparent 60%);
    opacity: 0.5;
    z-index: var(--z-bg-effects);
    pointer-events: none;
}

/* ── Loading Screen ── */
#loader {
    position: fixed; inset: 0;
    background: var(--bg-main);
    z-index: var(--z-loader);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    transition: opacity 0.8s var(--easing), visibility 0.8s;
}

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

.loader-logo {
    width: 48px; height: 48px;
    margin-bottom: var(--space-lg);
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow-strong);
}

.loader-ring {
    width: 40px; height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-xl);
}

.loader-text {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    height: 24px; overflow: hidden;
    position: relative;
}

.loader-text span {
    display: block;
    height: 24px; line-height: 24px;
    animation: textCycle 2s var(--easing) forwards;
}

@keyframes textCycle {
    0%, 20%   { transform: translateY(0); }
    30%, 45%  { transform: translateY(-24px); }
    55%, 70%  { transform: translateY(-48px); }
    80%, 100% { transform: translateY(-72px); }
}

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