/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Dark Theme Variables */
:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --accent: #00ff41;
    --border: #404040;
}

/* Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Matrix Canvas Background */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #000;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    padding: 2rem 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 1.5rem;
}

/* Navigation */
nav {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

nav a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: rgba(0, 255, 65, 0.1);
}

nav a.active {
    color: var(--accent);
    border-color: var(--accent);
    background-color: rgba(0, 255, 65, 0.15);
}

/* Typography */
h2 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-secondary);
}

p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Sections */
section {
    background-color: rgba(45, 45, 45, 0.85);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    backdrop-filter: blur(5px);
}

main {
    view-transition-name: main-content;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 2px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    section {
        padding: 1.5rem;
    }

    nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    nav a {
        text-align: center;
    }
}

/* View Transitions API */
@view-transition {
    navigation: auto;
}

/* Customize the transition animation */
::view-transition-old(root) {
    animation: fade-out 0.6s ease-out;
}

::view-transition-new(root) {
    animation: fade-in 0.6s ease-in;
}

@keyframes fade-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Matrix-themed transition with green glow */
::view-transition-old(root)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(0, 255, 65, 0.1) 0%, transparent 70%);
    animation: glow-fade 0.4s ease-out;
}

@keyframes glow-fade {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
