:root {
    /* Light Theme (Default) */
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --row: #f1f5f9;
    --border: #e2e8f0;
    --accent: #ed0096; /* Pink */
    --accent-alt: #ff8c00; /* Orange */
    --primary: #000000;
    --text: #000000;
    --muted: #64748b;
    --glass-border: rgba(15, 23, 42, 0.1);
    
    /* 2025 Fluid Typography & Spacing */
    --fs-base: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
    --fs-h1: clamp(2.5rem, 2rem + 4vw, 5rem);
    --space-outer: clamp(1.25rem, 5vw, 5rem);
    --max-content-width: 1440px;
}

/* 2025 Automatic Dark Theme Integration */
@media (prefers-color-scheme: dark) {
    body:not(.light-theme) {
        --bg: #0a0c1a;
        --card-bg: #0f1420;
        --row: #11121a;
        --border: #1b2130;
        --accent: #ed0096;
        --accent-alt: #ff8c00;
        --primary: #ffffff;
        --text: #ffffff;
        --muted: #bfc4cc;
        --glass-border: #1b2130;
    }
}

/* Explicit Dark Theme Overrides (if manual toggle is used) */
body.dark-theme {
    --bg: #0a0c1a;
    --card-bg: #0f1420;
    --row: #11121a;
    --border: #1b2130;
    --accent: #ed0096;
    --accent-alt: #ff8c00;
    --primary: #ffffff;
    --text: #ffffff;
    --muted: #bfc4cc;
    --glass-border: #1b2130;
}

/* Mixed Mode: Light Background with Dark Theme Elements */
body.bg-permanent-light {
    --bg: #f8fafc !important;
    --text: #000000 !important;
    --primary: #000000 !important;
}

body.bg-permanent-light #bg-canvas {
    background: #f8fafc !important;
    opacity: 1 !important;
}

/* 2025 Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    font-size: var(--fs-base);
    color: var(--text);
    background: var(--bg);
    /* Professional Blueprint Pattern - Triple Density */
    background-image: 
        radial-gradient(var(--border) 1px, transparent 0);
    background-size: 13.3px 13.3px;
    margin: 0;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease;
    /* Center body on ultra-wide screens */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

input, select, textarea {
    color: var(--text);
    background: var(--row);
    border: 1px solid var(--border);
    font-family: inherit;
}

header {
    background: var(--bg);
    color: var(--primary);
    padding: clamp(40px, 10vh, 120px) var(--space-outer);
    text-align: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

header h1 {
    font-size: var(--fs-h1);
    margin: 0;
    letter-spacing: -0.02em;
    font-weight: 800;
    max-width: 900px;
    text-wrap: balance;
}

.container {
    width: 100%;
    max-width: var(--max-content-width);
    margin-inline: auto; /* Modern Centering */
    padding: 0 var(--space-outer);
    position: relative;
    z-index: 10;
    flex-grow: 1;
}

.nav-bar {
    background: var(--card-bg);
    padding: 1rem 2rem;
    border-radius: 100px; /* Modern Pill Shape */
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(1rem, 2vw, 2.5rem);
    margin-block: 2rem 3rem;
    width: fit-content;
    margin-inline: auto; /* Center the nav bar itself */
    backdrop-filter: blur(10px);
}

.nav-bar a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
    position: relative;
}

.nav-bar a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: all 0.2s ease;
    transform: translateX(-50%);
}

.nav-bar a:hover {
    color: var(--accent);
    opacity: 1;
}

.nav-bar a:hover::after {
    width: 100%;
}

.theme-toggle {
    background: var(--row);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--border);
    transform: rotate(15deg);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 2rem;
    margin-block-end: 4rem;
}

/* 2025 Container Queries */
.grid {
    container-type: inline-size;
}

.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center; /* More Centered */
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
}

.card h2, .card h3 {
    color: var(--primary);
    margin-top: 0;
    font-weight: 800;
    font-size: 1.5rem;
}

.card p {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 0;
}

.footer {
    text-align: center;
    padding: 4rem var(--space-outer);
    color: var(--muted);
    background: var(--bg);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* Button Suite - 2025 High Fidelity */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
    font-family: inherit;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.btn-primary { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-alt)); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--row); border-color: var(--accent); }

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}

/* 2025 Responsive Logic - Modern Breakpoints */

/* Foldable / Small Tablet Support */
@media (max-width: 850px) {
    :root {
        --space-outer: 1.5rem;
    }
    
    .nav-bar {
        padding: 0.8rem 1.2rem;
        gap: 1rem;
        flex-wrap: wrap;
        border-radius: 20px;
        width: 100%;
        max-width: 500px;
    }
}

/* Mobile Support */
@media (max-width: 500px) {
    header {
        padding-block: 3rem;
    }

    .nav-bar a {
        font-size: 0.8rem;
    }

    .btn {
        width: 100%;
    }
    
    .card {
        padding: 2rem 1.5rem;
    }
}

/* Ultra-Wide Optimization (2025 Standard) */
@media (min-width: 2000px) {
    :root {
        --max-content-width: 1800px;
        --fs-base: 1.4rem;
    }
    
    .container {
        padding: 0 10vw;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
    :root {
        --text: #000000;
        --muted: #333333;
        --border: #000000;
    }
}

