/* ========================================
   Base — Reset + Typography + Layout
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

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

img {
    max-width: 100%;
    display: block;
}

/* ========================================
   Utility
   ======================================== */

.hidden {
    display: none !important;
}

/* ========================================
   Background Grid Pattern
   ======================================== */

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.12) 2.5px, transparent 2.5px),
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 96px 96px;
    background-position: -48px -48px, 0 0, 0 0;
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.15) 20%, rgba(0,0,0,1) 70%);
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.15) 20%, rgba(0,0,0,1) 70%);
}

[data-theme="light"] .bg-grid {
    background-image:
        radial-gradient(circle, rgba(0, 0, 0, 0.12) 2.5px, transparent 2.5px),
        linear-gradient(rgba(0, 0, 0, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.07) 1px, transparent 1px);
}

/* ========================================
   Landing Page
   ======================================== */

.landing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: var(--space-xl);
    position: relative;
    z-index: 1;
}

.landing-hero {
    max-width: 560px;
}

.landing-title {
    font-size: 3rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
}

.landing-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.6;
}

.landing-cta {
    display: inline-block;
    margin-bottom: var(--space-md);
}

.landing-note {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.landing-tagline {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-xl);
    line-height: 1.6;
}

/* ========================================
   Header
   ======================================== */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    z-index: var(--z-header);
}

.header-logo {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.header-logo:hover {
    color: var(--color-text-primary);
}

.header-nav {
    display: flex;
    gap: var(--space-lg);
}

.header-link {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.header-link:hover {
    color: var(--color-text-primary);
}

/* ========================================
   App Layout
   ======================================== */

body:not(.landing-active) .app-header {
    display: flex;
}

body.landing-active .app-header {
    display: none;
}

#mainContent {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    transition: opacity var(--transition-base);
}

body.landing-active #mainContent {
    display: none;
}

/* ========================================
   Transitions (used by router)
   ======================================== */

.fade-out {
    opacity: 0;
}

.fade-in {
    animation: fadeIn var(--transition-slow) ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 900px) {
    .landing-title {
        font-size: 2rem;
    }

    .landing-subtitle {
        font-size: var(--font-size-base);
    }
}
