/* Shared styles extracted from index.html */
/* This file is the source of truth - index.html should match exactly */

:root {
    /* Copper & oxblood palette (Oct 2026). The --cyan / --magenta names are
       historical: --cyan is the copper accent, --magenta the oxblood accent. */
    --cyan: #FF9455;
    --magenta: #E0566A;
    --dark: #16100d;
    --darker: #0e0a08;
    --gray: #221915;
    --light: #EDE3D9;
    --pixel-size: 4px;

    /* Light mode colors - deeper, more saturated for readability */
    --cyan-light: #B04E18;
    --magenta-light: #8E1F35;
    --bg-light: #F5F0EA;
    --bg-lighter: #FBF8F4;
    --gray-light: #EAE2D8;
    --text-dark: #2A1E18;
}

/* Light mode theme */
[data-theme="light"] {
    --cyan: var(--cyan-light);
    --magenta: var(--magenta-light);
    --dark: var(--gray-light);
    --darker: var(--bg-light);
    --gray: var(--bg-lighter);
    --light: var(--text-dark);
}

[data-theme="light"] body::before {
    background-image:
        linear-gradient(rgba(176, 78, 24, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(176, 78, 24, 0.08) 1px, transparent 1px);
}

[data-theme="light"] body::after {
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.02) 2px,
        rgba(0, 0, 0, 0.02) 4px
    );
    opacity: 0.5;
}

[data-theme="light"] nav {
    background: linear-gradient(to bottom, var(--bg-light) 0%, transparent 100%);
}

[data-theme="light"] ::selection {
    background: var(--cyan-light);
    color: #fff;
}

/* Theme toggle button */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--cyan);
    font-family: 'Silkscreen', cursive;
    font-size: 0.65rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
}

.theme-toggle:hover {
    background: var(--cyan);
    color: var(--darker);
    box-shadow: 0 0 15px var(--cyan);
}

.theme-toggle::before {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--cyan);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transition: all 0.3s ease;
}

[data-theme="light"] .theme-toggle::before {
    clip-path: circle(50% at 50% 50%);
}

.theme-toggle:hover::before {
    background: var(--darker);
}

/* Pixel icon for toggle */
.theme-icon {
    width: 14px;
    height: 14px;
    position: relative;
}

.theme-icon-dark,
.theme-icon-light {
    position: absolute;
    inset: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Moon icon (dark mode) - pixel art style */
.theme-icon-dark::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 50%;
    top: 1px;
    left: 1px;
}

.theme-icon-dark::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--darker);
    border-radius: 50%;
    top: 0;
    left: 4px;
}

[data-theme="light"] .theme-icon-dark::after {
    background: var(--bg-light);
}

/* Sun icon (light mode) */
.theme-icon-light::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    top: 4px;
    left: 4px;
}

.theme-icon-light::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(currentColor, currentColor) center/2px 100%,
        linear-gradient(currentColor, currentColor) center/100% 2px,
        linear-gradient(currentColor, currentColor) center/2px 100%,
        linear-gradient(currentColor, currentColor) center/100% 2px;
    background-repeat: no-repeat;
    transform: rotate(45deg) scale(0.7);
}

/* Show/hide icons based on theme */
.theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-icon-light {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="light"] .theme-icon-dark {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="light"] .theme-icon-light {
    opacity: 1;
    transform: rotate(0deg);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Mono', monospace;
    background: var(--darker);
    color: var(--light);
    overflow-x: hidden;
    cursor: crosshair;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10001;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.75rem 1rem;
    background: var(--cyan);
    color: var(--darker);
    font-family: 'Silkscreen', cursive;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid var(--magenta);
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Pixel grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 148, 85, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 148, 85, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

/* Scanline effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    z-index: 1000;
    opacity: 0.3;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(to bottom, var(--darker) 0%, transparent 100%);
}

.logo {
    font-family: 'Silkscreen', cursive;
    font-size: 1.2rem;
    color: var(--cyan);
    text-decoration: none;
    letter-spacing: 2px;
    padding: 0.5rem 0.75rem;
    margin: -0.5rem -0.75rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.logo:hover {
    text-shadow: 0 0 20px var(--cyan), 0 0 40px var(--cyan);
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    font-family: 'Silkscreen', cursive;
    font-size: 0.75rem;
    color: var(--light);
    text-decoration: none;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--magenta));
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--cyan);
}

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

/* Selection */
::selection {
    background: var(--cyan);
    color: var(--darker);
}

/* Footer */
footer {
    padding: 4rem 3rem;
    text-align: center;
    position: relative;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-link {
    font-family: 'Silkscreen', cursive;
    font-size: 0.75rem;
    color: var(--light);
    text-decoration: none;
    letter-spacing: 2px;
    opacity: 0.7;
    transition: all 0.3s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.footer-link:hover {
    opacity: 1;
    color: var(--cyan);
    text-shadow: 0 0 20px var(--cyan);
}

.footer-copy {
    font-size: 0.8rem;
    color: rgba(237, 227, 217, 0.4);
}

.footer-copy span {
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; color: var(--magenta); }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive Navigation */
@media (max-width: 968px) {
    nav {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .logo {
        font-size: 1rem;
        padding: 0.4rem 0.6rem;
        margin: -0.4rem -0.6rem;
    }

    .nav-links {
        gap: 0.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        font-size: 0.6rem;
        padding: 0.4rem 0.5rem;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.75rem 1rem;
    }

    .logo {
        font-size: 0.85rem;
        padding: 0.35rem 0.5rem;
        margin: -0.35rem -0.5rem;
    }

    .nav-links {
        gap: 0.15rem;
    }

    .nav-links a {
        font-size: 0.55rem;
        padding: 0.35rem 0.4rem;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 0.25rem 1.5rem;
    }
}
