/* Reset styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: white;
    --background-color: black;
    --nav-height: 60px;
    --content-max-width: 1200px;
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --text-shadow: 0 0 10px #000000;
    --heading-shadow: 0 0 12px #000000, 0 2px 4px #000000;
}

body {
    margin: 0;
    background: var(--background-color);
    color: var(--primary-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    line-height: 1.6;
    font-size: 16px;
}

/* Background canvas */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    opacity: 0.3;
}

.home canvas {
    opacity: 1;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 3;
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 20px;
    font-weight: 500;
    transition: opacity 0.2s ease;
    text-shadow: var(--text-shadow);
}

nav a:hover,
nav a:focus {
    opacity: 0.8;
    outline: none;
}

/* Content layout */
.content-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: var(--nav-height) 0 0;
    z-index: 2;
    display: grid;
    place-items: center;
    overflow-y: auto;
}

.center-text {
    width: 100%;
    max-width: 90%;
    text-align: center;
    margin: 0;
    padding: var(--spacing-xl) 20px;
    position: relative;
    top: auto;
    left: auto;
    transform: none;
}

.center-text h1 {
    font-size: 1rem; /* Match nav bar font size */
    margin: 0;
    padding: 0;
    line-height: 1.2;
    letter-spacing: 0.1em; /* Match nav bar letter spacing */
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    font-weight: 700; /* Make text bold */
    opacity: 1 !important; /* Ensure full opacity */
}

.center-text h1 a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    display: inline-block;
}

.center-text h1 a:hover,
.center-text h1 a:focus {
    opacity: 1 !important;
    outline: none;
    text-decoration: none; /* Remove underline on hover */
}

/* Ensure nav stays on top */
nav {
    position: fixed;
    top: 0;
    z-index: 3;
}

@media (max-width: 768px) {
    .center-text h1 {
        font-size: 1rem; /* Keep font size consistent with desktop */
    }
}

.content-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1;
    pointer-events: none;
}

/* Section styles */
.section {
    margin: var(--spacing-xl) 0;
}

.section:first-child {
    margin-top: 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-md);
    max-width: 70ch;
}

/* Text shadows */
.content-wrapper * {
    text-shadow: var(--text-shadow);
}

.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3 {
    text-shadow: var(--heading-shadow);
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Loading screen */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: var(--spacing-md);
}

.loading-text {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    text-shadow: var(--text-shadow);
}

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

/* Media queries */
@media (max-width: 768px) {
    :root {
        --nav-height: 50px;
    }

    nav a {
        padding: 0 var(--spacing-sm);
        font-size: 14px;
    }

    .content-wrapper {
        padding: var(--spacing-md);
    }

    .section {
        margin: var(--spacing-lg) 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: var(--spacing-sm);
    }
}

/* Print styles */
@media print {
    canvas,
    nav {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .content-wrapper {
        margin: 0;
        padding: 2cm;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
}