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

:root {
    --bg: #FFFFFF;
    --text: #000000;
    --text-secondary: #666666;
    --border: #E0E0E0;
    --accent: #000000;
    --hover: #333333;
    --surface: #F8F8F8;
    --mono: 'IBM Plex Mono', 'Space Mono', 'Courier New', monospace;
    --sans: 'Manrope', -apple-system, system-ui, sans-serif;
}

[data-theme="dark"] {
    --bg: #000000;
    --text: #FFFFFF;
    --text-secondary: #999999;
    --border: #2A2A2A;
    --accent: #FFFFFF;
    --hover: #CCCCCC;
    --surface: #0A0A0A;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.landing h1 {
    font-family: var(--mono);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    text-align: center;
    position: relative;
}

.landing h1 .char {
    display: inline-block;
    animation: charFade 3s ease-in-out infinite;
}

@keyframes charFade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.landing-subtitle {
    font-family: var(--mono);
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    letter-spacing: 0.05em;
    text-align: center;
}

.password-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.password-input {
    font-family: var(--mono);
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
    min-width: 200px;
}

.password-input:focus {
    border-color: var(--accent);
}

.btn {
    font-family: var(--mono);
    padding: 0.75rem 2rem;
    background: var(--accent);
    color: var(--bg);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.3s;
    letter-spacing: 0.05em;
}

.btn:hover {
    opacity: 0.8;
}

.error {
    color: #FF0000;
    font-family: var(--mono);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.hidden {
    display: none;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: background 0.3s;
}

.nav-brand {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

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

.nav-link {
    font-family: var(--mono);
    font-size: 0.875rem;
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s;
    letter-spacing: 0.05em;
}

.nav-link:hover {
    color: var(--hover);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.75rem;
    transition: all 0.3s;
    letter-spacing: 0.05em;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

.section {
    margin-bottom: 8rem;
}

.section-title {
    font-family: var(--mono);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 500;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
    padding-top: 2rem;
}

.intro {
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.8;
    max-width: 800px;
    margin-bottom: 4rem;
}

.token-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.token {
    aspect-ratio: 1;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    animation: tokenFade 3s ease-in-out infinite;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.token:nth-child(2n) { animation-delay: 0.2s; }
.token:nth-child(3n) { animation-delay: 0.4s; }
.token:nth-child(4n) { animation-delay: 0.6s; }
.token:nth-child(5n) { animation-delay: 0.8s; }

.token.has-milestone {
    animation: tokenPulse 3s ease-in-out infinite;
}

.token:hover,
.token:active {
    border-color: var(--accent);
    transform: scale(1.1);
}

.token-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    min-width: 220px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    margin-bottom: 10px;
    z-index: 100;
    white-space: nowrap;
}

.token:hover .token-popup,
.token:active .token-popup {
    opacity: 1;
    pointer-events: all;
}

.token-year {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.token-title {
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: normal;
}

.token-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: normal;
}

@keyframes tokenFade {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

@keyframes tokenPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Mobile token popup fixes */
@media (max-width: 768px) {
    .token-popup {
        position: fixed;
        bottom: auto;
        top: 50%;
        left: auto;
        right: auto;
        transform: translateY(-50%);
        min-width: 280px;
        max-width: calc(100vw - 3rem);
        padding: 1.5rem;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        white-space: normal;
    }

    [data-theme="dark"] .token-popup {
        box-shadow: 0 4px 20px rgba(255,255,255,0.1);
    }

    /* Position popups based on token location in grid */
    .token:nth-child(1) .token-popup,
    .token:nth-child(2) .token-popup,
    .token:nth-child(7) .token-popup,
    .token:nth-child(8) .token-popup {
        left: 1.5rem;
    }

    .token:nth-child(5) .token-popup,
    .token:nth-child(6) .token-popup,
    .token:nth-child(11) .token-popup,
    .token:nth-child(12) .token-popup {
        right: 1.5rem;
    }

    .token:nth-child(3) .token-popup,
    .token:nth-child(4) .token-popup,
    .token:nth-child(9) .token-popup,
    .token:nth-child(10) .token-popup {
        left: 50%;
        transform: translateX(-50%) translateY(-50%);
    }

    .token:active .token-popup {
        opacity: 1;
    }
}

.proposal-content {
    line-height: 1.8;
    max-width: 800px;
}

.proposal-content p {
    margin-bottom: 1.5rem;
}

.proposal-content strong {
    font-weight: 500;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.project-card {
    border: 1px solid var(--border);
    padding: 0;
    transition: border-color 0.3s;
    overflow: hidden;
}

.project-card:hover {
    border-color: var(--accent);
}

.project-thumb {
    width: 100%;
    height: 200px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.project-meta {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.about-content {
    max-width: 800px;
    line-height: 1.8;
}

.about-content p {
    margin-bottom: 1.5rem;
}

.contact {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.contact a {
    font-family: var(--mono);
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.3s;
}

.contact a:hover {
    opacity: 0.7;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .nav {
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.75rem;
    }

    .container {
        padding: 5rem 1.5rem 3rem;
    }

    .section-title {
        padding-top: 1rem;
        margin-bottom: 2rem;
    }

    .token-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 0.75rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}
