@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.6;
    color: #666;
    background-color: #fff;
    position: relative;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease, text-shadow 0.3s ease, font-family 0.3s ease;
}

/* Header */
header {
    padding: 1.5rem 0;
}

nav {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1 {
    font-size: 1.8rem;
    font-weight: 400;
    color: #000;
    letter-spacing: -0.01em;
}

/* Main content */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero section */
.hero {
    padding: 4rem 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 4rem;
}

.hero h2 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #000;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1rem;
    color: #666;
    font-weight: 300;
}

/* Body content */
main p,
main ul,
main h3 {
    margin-bottom: 1rem;
}

main h3 {
    font-size: 1rem;
    font-weight: 500;
    color: #000;
}

main ul {
    padding-left: 1.5rem;
    list-style: none;
}

main li {
    position: relative;
    margin-bottom: 0.15rem;
}

main li:before {
    content: "—";
    position: absolute;
    left: -1.25rem;
    color: #999;
}

main .company-list {
    padding-left: 0;
}

main .company-list li:before {
    content: none;
}

main .company-list li {
    margin-bottom: 0.15rem;
    padding-left: calc(1.4em + 0.5rem);
    text-indent: calc(-1.4em - 0.5rem);
}

.logo-container {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.4em;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.company-logo,
.company-logo-dark {
    height: 1.2em;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    vertical-align: middle;
}

.company-logo-dark {
    display: none;
}

body.arcade-dark main ul {
    padding-left: 1.5rem;
}

body.arcade-dark main li {
    position: relative;
}

body.arcade-dark main li:before {
    content: "—";
    position: absolute;
    left: -1.25rem;
    color: #39d439;
}

body.arcade-dark main .company-list {
    padding-left: 0;
}

body.arcade-dark main .company-list li {
    margin-bottom: 0;
    padding-left: calc(1.4em + 0.5rem);
    text-indent: 0;
}

body.arcade-dark main .company-list .logo-container {
    margin-left: calc(-1.4em - 0.5rem);
}

body.arcade-dark main .company-list li:before {
    content: none;
}

body.arcade-dark .company-logo {
    display: none;
}

body.arcade-dark .company-logo-dark {
    display: inline;
    filter: invert(85%) sepia(25%) saturate(800%) hue-rotate(80deg) brightness(1.1)
           drop-shadow(0 0 6px rgba(102, 255, 102, 0.8))
           drop-shadow(0 0 12px rgba(102, 255, 102, 0.5))
           drop-shadow(0 0 20px rgba(102, 255, 102, 0.3));
}

main a {
    color: #000;
    text-decoration: none;
    border-bottom: 1px solid #999;
    transition: border-color 0.2s ease;
}

main a:hover {
    border-bottom-color: #000;
}


/* Projects section */
.projects {
    margin-bottom: 2rem;
    margin-top: 2rem;
}

.project-grid {
    display: block;
}

.project-card {
    padding: 2rem 0;
}

.project-card h3 {
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: #000;
}

.project-card h3 a {
    color: #000;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.project-card h3 a:hover {
    border-bottom-color: #000;
}

.project-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-weight: 300;
}

/* Tech stack */
.tech-stack {
    margin-bottom: 2rem;
}

.tech {
    color: #999;
    font-size: 0.875rem;
    font-weight: 300;
    margin-right: 1.5rem;
}

/* Project links */
.project-links {
    display: flex;
    gap: 2rem;
}

.btn {
    color: #000;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.btn:hover {
    border-bottom-color: #000;
}

.btn-outline {
    color: #666;
}

.btn-outline:hover {
    color: #000;
    border-bottom-color: #000;
}

/* Footer */
footer {
    padding: 1.5rem 0;
    margin-top: 2rem;
    text-align: center;
}

footer p {
    color: #999;
    font-size: 0.875rem;
    font-weight: 300;
}

header,
main,
footer {
    position: relative;
    z-index: 2;
}

/* Detail page styles */
.nav-back {
    color: #666;
    text-decoration: none;
    font-weight: 300;
    margin-right: 2rem;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav-back:hover {
    color: #000;
    border-bottom-color: #000;
}

.project-hero {
    padding: 2rem 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 2rem;
}

.project-image {
    display: none;
}

.project-info h2 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #000;
    letter-spacing: -0.02em;
}

.project-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.5;
    font-weight: 300;
}

.project-details {
    margin-bottom: 2rem;
    margin-top: 3rem;
}

.detail-section {
    margin-bottom: 2.5rem;
}

.detail-section h3 {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: #000;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.detail-section p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.detail-section ul {
    color: #666;
    line-height: 1.6;
    margin-left: 1rem;
    font-weight: 300;
}

.detail-section li {
    margin-bottom: 0.75rem;
    list-style: none;
    position: relative;
}

.detail-section li:before {
    content: "—";
    position: absolute;
    left: -1rem;
    color: #999;
}

.detail-section li strong {
    color: #000;
    font-weight: 400;
}

/* Responsive design */
@media (max-width: 768px) {
    nav, main {
        padding: 0 1.5rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero h2 {
        font-size: 1.75rem;
    }
    
    .project-card {
        padding: 2.5rem 0;
    }
    
    .project-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tech {
        display: block;
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .project-hero {
        padding: 3rem 0;
    }
    
    .project-info h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    nav, main {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .project-card h3 {
        font-size: 1.2rem;
    }
    
    .project-info h2 {
        font-size: 1.5rem;
    }
}

.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.7rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle:hover {
    color: #000;
}

.theme-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: inherit;
    transition: color 0.25s ease, opacity 0.25s ease;
}

.theme-toggle__icon--sun {
    color: #d4a217;
    opacity: 1;
}

.theme-toggle__icon--moon {
    color: #999;
    opacity: 0.5;
}

.theme-toggle__track {
    position: relative;
    width: 50px;
    height: 24px;
    border-radius: 999px;
    background: #e6e6e6;
    transition: background-color 0.25s ease;
}

.theme-toggle__knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle--dark .theme-toggle__knob {
    transform: translateX(26px);
}


.arcade-scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

body.arcade-dark {
    background-color: #000;
    color: #73ff73;
    font-family: "Courier New", "Lucida Console", monospace;
    text-shadow:
        0 0 6px rgba(115, 255, 115, 0.28),
        0 0 4px rgba(0, 0, 0, 0.95),
        0 0 4px rgba(0, 0, 0, 0.95),
        0 0 8px rgba(0, 0, 0, 0.85),
        0 0 8px rgba(0, 0, 0, 0.85);
}

body.arcade-dark .arcade-scene {
    opacity: 0.95;
}

body.arcade-dark main p,
body.arcade-dark main li,
body.arcade-dark .project-card p,
body.arcade-dark .project-subtitle,
body.arcade-dark .detail-section p,
body.arcade-dark .detail-section ul,
body.arcade-dark .btn-outline,
body.arcade-dark .tech,
body.arcade-dark .nav-back {
    color: #5eff5e;
}

body.arcade-dark h1,
body.arcade-dark h2,
body.arcade-dark h3,
body.arcade-dark .project-card h3 a,
body.arcade-dark .detail-section li strong,
body.arcade-dark main a,
body.arcade-dark .btn,
body.arcade-dark .btn-outline:hover,
body.arcade-dark .nav-back:hover {
    color: #9dff9d;
    text-shadow:
        0 0 8px rgba(102, 255, 102, 0.7),
        0 0 4px rgba(0, 0, 0, 0.95),
        0 0 4px rgba(0, 0, 0, 0.95),
        0 0 8px rgba(0, 0, 0, 0.85),
        0 0 8px rgba(0, 0, 0, 0.85);
}

body.arcade-dark main a,
body.arcade-dark .btn,
body.arcade-dark .btn-outline,
body.arcade-dark .nav-back,
body.arcade-dark .project-card h3 a {
    border-bottom-color: rgba(122, 255, 122, 0.6);
}

body.arcade-dark main li:before,
body.arcade-dark .detail-section li:before,
body.arcade-dark footer p {
    color: #39d439;
}

body.arcade-dark .hero,
body.arcade-dark .project-hero,
body.arcade-dark .detail-section h3 {
    border-bottom-color: rgba(57, 212, 57, 0.45);
}

body.arcade-dark .theme-toggle {
    background: transparent;
    box-shadow: none;
}

body.arcade-dark .theme-toggle__icon--sun {
    color: #4a5a4a;
    opacity: 0.5;
}

body.arcade-dark .theme-toggle__icon--moon {
    color: #9dff9d;
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(102, 255, 102, 0.7));
}

body.arcade-dark .theme-toggle__track {
    background: #0e2a0e;
    box-shadow: inset 0 0 6px rgba(57, 212, 57, 0.4);
}

body.arcade-dark .theme-toggle__knob {
    background: #9dff9d;
    box-shadow: 0 0 8px rgba(102, 255, 102, 0.85);
}

body.arcade-dark h1 {
    font-family: "Press Start 2P", "Courier New", monospace;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.02em;
}

.arcade-hint {
    display: none;
}

body.arcade-dark .arcade-hint {
    display: block;
    margin-top: 3rem;
    text-align: center;
    font-family: "Press Start 2P", "Courier New", monospace;
    font-size: 0.95rem;
    line-height: 1.4;
    letter-spacing: 0.04em;
    color: #9dff9d;
    text-shadow:
        0 0 8px rgba(102, 255, 102, 0.7),
        0 0 4px rgba(0, 0, 0, 0.95),
        0 0 4px rgba(0, 0, 0, 0.95),
        0 0 8px rgba(0, 0, 0, 0.85),
        0 0 8px rgba(0, 0, 0, 0.85);
}

body.arcade-dark .arcade-word {
    white-space: nowrap;
}

body.arcade-dark .arcade-glyph {
    display: inline-block;
    transition: color 0.14s ease, text-shadow 0.14s ease, transform 0.14s ease, opacity 0.14s ease, filter 0.14s ease;
}

body.arcade-dark .arcade-hit-1 {
    color: #ffe45c;
    text-shadow: 0 0 10px rgba(255, 228, 92, 0.85);
    transform: translateY(-1px) rotate(-2deg);
}

body.arcade-dark .arcade-hit-2 {
    color: #ff985c;
    text-shadow: 0 0 12px rgba(255, 152, 92, 0.9);
    transform: translateY(1px) rotate(2deg) scale(0.92);
}

body.arcade-dark img.arcade-glyph.arcade-hit-1 {
    filter: invert(90%) sepia(60%) saturate(600%) hue-rotate(5deg) brightness(1.1)
           drop-shadow(0 0 10px rgba(255, 228, 92, 0.85));
    transform: translateY(-1px) rotate(-2deg);
}

body.arcade-dark img.arcade-glyph.arcade-hit-2 {
    filter: invert(70%) sepia(80%) saturate(500%) hue-rotate(-10deg) brightness(1)
           drop-shadow(0 0 12px rgba(255, 152, 92, 0.9));
    transform: translateY(1px) rotate(2deg) scale(0.92);
}

body.arcade-dark .arcade-crumbled {
    color: rgba(255, 140, 100, 0.2);
    text-shadow: none;
    animation: arcadeCrumble 0.36s ease-in forwards;
}

body.arcade-dark img.arcade-glyph.arcade-crumbled {
    filter: invert(50%) sepia(80%) saturate(300%) hue-rotate(-10deg) brightness(0.5) opacity(0.2);
    animation: arcadeCrumble 0.36s ease-in forwards;
}

body.arcade-dark .arcade-gone {
    opacity: 0;
}

@keyframes arcadeCrumble {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0deg);
    }
    45% {
        opacity: 0.85;
        transform: scale(0.8) translateY(2px) rotate(-6deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.15) translateY(12px) rotate(15deg);
    }
}