:root {
    --bg-primary: #fafafa;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #0a0a0a;
    --text-secondary: #525252;
    --text-muted: #a3a3a3;
    --accent: #0066ff;
    --accent-hover: #4FB7B3;
    --border: #e5e5e5;
    --shadow: rgba(0, 0, 0, 0.08);
    color-scheme: light;
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --text-primary: #fafafa;
    --text-secondary: #a3a3a3;
    --text-muted: #525252;
    --border: #262626;
    --shadow: rgba(0, 0, 0, 0.3);
    color-scheme: dark;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Floating Navigation */
.floating-nav {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: rgba(250, 250, 250, 0.8);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 100px;
    border: 1px solid var(--border);
}

@keyframes unroll {
    0% { clip-path: inset(0 0 0 100%); }
    100% { clip-path: inset(0 0 0 0); }
}

.floating-nav.animate-unroll {
    clip-path: inset(0 0 0 100%);
    animation: unroll 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    animation-delay: 0.2s;
}

[data-theme="dark"] .floating-nav {
    background: rgba(10, 10, 10, 0.8);
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 100px;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-btn:hover {
    color: var(--accent-hover);
    background: var(--bg-secondary);
}

.nav-btn.active {
    color: var(--accent-hover);
    background: var(--bg-secondary);
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 16px;
    outline: none;
}

/* Footer */
footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.footer-github {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.footer-github:hover {
    color: var(--accent-hover);
}

.footer-github svg {
    width: 24px;
    height: 24px;
}

.footer-linkedin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.footer-linkedin:hover {
    color: var(--accent-hover);
}

.footer-linkedin svg {
    width: 24px;
    height: 24px;
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-fade-in {
    opacity: 0;
    animation: cardFadeIn 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes cardFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Responsive - Floating Nav Mobile */
@media (max-width: 768px) {
    .floating-nav {
        top: auto;
        bottom: 24px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        padding: 8px;
        gap: 4px;
    }

    .nav-btn {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
    }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .card-fade-in {
        opacity: 1;
        transform: none;
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
