/* sim-ai.com - Raw Authentic Pixel-Art AI */
/* Colors: #1a1a2e (deep base), #4a90d9 (primary blue), #f5f0e8 (warm off-white), #e8b84b (accent gold), #6c757d (muted gray) */
/* Fonts: Inter (display/body), Space Mono (monospace/pixel-influenced) */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #1a1a2e;
    color: #f5f0e8;
    overflow-x: hidden;
    position: relative;
}

/* Grid Overlay - Simulation Structure */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(232, 184, 75, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 184, 75, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(26, 26, 46, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(232, 184, 75, 0.15);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-pixel {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #e8b84b;
    image-rendering: pixelated;
    box-shadow: 4px 0 0 #4a90d9, 0 4px 0 #4a90d9;
}

.logo-text {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 20px;
    color: #e8b84b;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #6c757d;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #e8b84b;
}

/* Bounce-in Animation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(-8px) scale(1.02);
    }
    80% {
        transform: translateY(3px) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bounce-in {
    opacity: 0;
    transform: translateY(40px);
}

.bounce-in.visible {
    animation: bounceIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 32px 80px;
    z-index: 1;
}

.hero-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 80px;
}

.hero-left {
    flex-shrink: 0;
}

.pixel-art-hero {
    position: relative;
}

/* Pixel Art Brain */
.pixel-brain,
.pixel-heart {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pixel-row {
    display: flex;
    gap: 0;
}

.px {
    display: inline-block;
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    transition: background-color 0.3s ease;
}

.px[data-c='0'] { background: transparent; }
.px[data-c='1'] { background: #1a1a2e; border: 1px solid rgba(74, 144, 217, 0.15); }
.px[data-c='2'] { background: #2a2a4e; }
.px[data-c='3'] { background: #4a90d9; }
.px[data-c='4'] { background: #e8b84b; }
.px[data-c='5'] { background: #f5f0e8; }

.pixel-annotation {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #6c757d;
    margin-top: 8px;
    text-align: center;
    letter-spacing: 1px;
}

.hero-right {
    flex: 1;
}

.hero-title {
    font-family: 'Inter', sans-serif;
    font-size: 72px;
    font-weight: 900;
    line-height: 1.05;
    color: #f5f0e8;
    margin-bottom: 24px;
}

.hero-accent {
    color: #e8b84b;
    position: relative;
}

.hero-subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    line-height: 1.7;
    color: #6c757d;
    margin-bottom: 40px;
    max-width: 480px;
}

.hero-cta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-primary {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 16px 36px;
    background: #e8b84b;
    color: #1a1a2e;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.btn-primary::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 100%;
    height: 100%;
    border: 2px solid #4a90d9;
    z-index: -1;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translate(-2px, -2px);
    background: #f5f0e8;
}

.btn-primary:hover::after {
    bottom: -6px;
    right: -6px;
}

.cta-annotation {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #4a90d9;
    opacity: 0.6;
}

/* Abstract Shapes */
.hero-abstract-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.abstract-shape {
    position: absolute;
    image-rendering: pixelated;
}

.shape-1 {
    width: 120px;
    height: 120px;
    top: 15%;
    right: 10%;
    background: rgba(74, 144, 217, 0.08);
    border: 2px solid rgba(74, 144, 217, 0.12);
    animation: floatShape 8s ease-in-out infinite;
}

.shape-2 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 5%;
    background: rgba(232, 184, 75, 0.06);
    border: 2px solid rgba(232, 184, 75, 0.1);
    animation: floatShape 10s ease-in-out infinite reverse;
}

.shape-3 {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 25%;
    background: rgba(108, 117, 125, 0.08);
    border: 2px solid rgba(108, 117, 125, 0.12);
    animation: floatShape 12s ease-in-out infinite;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -15px) rotate(2deg); }
    50% { transform: translate(-5px, -25px) rotate(-1deg); }
    75% { transform: translate(15px, -10px) rotate(3deg); }
}

/* Simulations Section */
.simulations {
    position: relative;
    z-index: 1;
    padding: 100px 32px;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-title {
    font-family: 'Inter', sans-serif;
    font-size: 48px;
    font-weight: 900;
    color: #f5f0e8;
    margin-bottom: 16px;
}

.section-desc {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    color: #6c757d;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

.sim-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.sim-card {
    background: rgba(42, 42, 78, 0.5);
    border: 1px solid rgba(74, 144, 217, 0.15);
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sim-card:hover {
    border-color: rgba(232, 184, 75, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.sim-card-visual {
    height: 180px;
    background: rgba(26, 26, 46, 0.8);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(74, 144, 217, 0.1);
}

.sim-status {
    position: absolute;
    top: 12px;
    right: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    padding: 4px 10px;
}

.sim-status.running {
    background: rgba(74, 144, 217, 0.15);
    color: #4a90d9;
    border: 1px solid rgba(74, 144, 217, 0.3);
}

.sim-status.idle {
    background: rgba(108, 117, 125, 0.15);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

/* Terrain Scene */
.terrain-row {
    display: flex;
    align-items: flex-end;
    height: 100%;
    padding: 0 16px;
    gap: 2px;
}

.t-px {
    flex: 1;
    background: #4a90d9;
    image-rendering: pixelated;
    transition: height 0.5s ease;
}

.t-px[data-h='1'] { height: 20px; background: #2a5a8a; }
.t-px[data-h='2'] { height: 35px; background: #3a7ab9; }
.t-px[data-h='3'] { height: 50px; background: #4a90d9; }
.t-px[data-h='4'] { height: 65px; background: #5aa0e9; }
.t-px[data-h='5'] { height: 80px; background: #e8b84b; }
.t-px[data-h='6'] { height: 95px; background: #d4a63d; }
.t-px[data-h='7'] { height: 120px; background: #e8b84b; }

/* Neural Scene */
.neural-nodes {
    position: relative;
    width: 100%;
    height: 100%;
}

.n-node {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #e8b84b;
    border-radius: 0;
    image-rendering: pixelated;
    animation: pulseNode 2s ease-in-out infinite;
}

.n-node:nth-child(2) { animation-delay: 0.3s; background: #4a90d9; }
.n-node:nth-child(3) { animation-delay: 0.6s; }
.n-node:nth-child(4) { animation-delay: 0.9s; background: #4a90d9; }
.n-node:nth-child(5) { animation-delay: 1.2s; }

@keyframes pulseNode {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232, 184, 75, 0.4); }
    50% { transform: scale(1.5); box-shadow: 0 0 20px 4px rgba(232, 184, 75, 0.2); }
}

/* Language Scene */
.lang-chars {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px;
    justify-content: center;
    align-items: center;
}

.l-char {
    font-family: 'Space Mono', monospace;
    font-size: 22px;
    color: #4a90d9;
    padding: 8px 12px;
    border: 1px solid rgba(74, 144, 217, 0.2);
    animation: charFlicker 3s ease-in-out infinite;
}

.l-char:nth-child(even) { color: #e8b84b; border-color: rgba(232, 184, 75, 0.2); animation-delay: 0.5s; }

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

/* Evolution Scene */
.evo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 32px;
}

.e-cell {
    aspect-ratio: 1;
    background: rgba(26, 26, 46, 0.5);
    border: 1px solid rgba(74, 144, 217, 0.1);
    image-rendering: pixelated;
    transition: background 0.3s ease;
}

.e-cell.alive {
    background: #4a90d9;
    box-shadow: 0 0 8px rgba(74, 144, 217, 0.3);
}

.sim-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #f5f0e8;
    padding: 20px 24px 8px;
}

.sim-card-desc {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.6;
    padding: 0 24px;
}

.sim-card-meta {
    display: flex;
    gap: 16px;
    padding: 16px 24px 24px;
}

.meta-tag {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #4a90d9;
    padding: 4px 10px;
    background: rgba(74, 144, 217, 0.08);
    border: 1px solid rgba(74, 144, 217, 0.15);
}

/* How It Works */
.how-it-works {
    position: relative;
    z-index: 1;
    padding: 100px 32px;
    background: rgba(42, 42, 78, 0.2);
}

.process-steps {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.process-step {
    flex: 1;
    text-align: center;
    padding: 24px;
}

.step-number {
    font-family: 'Space Mono', monospace;
    font-size: 48px;
    font-weight: 700;
    color: rgba(232, 184, 75, 0.2);
    margin-bottom: 16px;
}

.step-pixel-icon {
    margin-bottom: 20px;
}

.step-icon {
    image-rendering: pixelated;
}

.step-title {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #e8b84b;
    margin-bottom: 12px;
}

.step-desc {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.7;
}

.step-connector {
    display: flex;
    align-items: center;
    gap: 0;
    padding-top: 80px;
    width: 60px;
    flex-shrink: 0;
}

.connector-dot {
    width: 6px;
    height: 6px;
    background: #e8b84b;
    flex-shrink: 0;
}

.connector-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, #e8b84b, #4a90d9);
    min-width: 20px;
}

/* Gallery */
.gallery {
    position: relative;
    z-index: 1;
    padding: 100px 32px;
}

.gallery-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.gallery-item {
    background: rgba(42, 42, 78, 0.3);
    border: 1px solid rgba(74, 144, 217, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    border-color: rgba(232, 184, 75, 0.3);
    transform: translateY(-2px);
}

.gallery-canvas {
    position: relative;
    overflow: hidden;
    background: #0d0d1a;
}

.gallery-canvas canvas {
    display: block;
    width: 100%;
    height: 200px;
    image-rendering: pixelated;
}

.gallery-label {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(74, 144, 217, 0.1);
}

.gallery-name {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #f5f0e8;
}

.gallery-note {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #4a90d9;
    opacity: 0.6;
}

/* About */
.about {
    position: relative;
    z-index: 1;
    padding: 100px 32px;
    background: rgba(42, 42, 78, 0.15);
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 80px;
}

.about-left {
    flex: 1;
}

.about-text {
    font-family: 'Space Mono', monospace;
    font-size: 15px;
    color: #6c757d;
    line-height: 1.8;
    margin-bottom: 20px;
}

.about-annotation {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #4a90d9;
    opacity: 0.5;
    margin-top: 32px;
}

.about-right {
    flex-shrink: 0;
}

.about-pixel-art {
    position: relative;
}

.pixel-heart .px {
    width: 32px;
    height: 32px;
}

/* Footer */
.footer {
    position: relative;
    z-index: 1;
    padding: 32px;
    border-top: 1px solid rgba(232, 184, 75, 0.1);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-logo {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    color: #e8b84b;
}

.footer-anno {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #6c757d;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-status {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #4a90d9;
    padding: 4px 10px;
    border: 1px solid rgba(74, 144, 217, 0.2);
}

.footer-epoch {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #6c757d;
}

.footer-grid-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(232, 184, 75, 0.1), transparent);
    margin-top: 24px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Simulation Overlay */
.sim-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.sim-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.sim-overlay-content {
    background: #1a1a2e;
    border: 1px solid rgba(232, 184, 75, 0.2);
    width: 90%;
    max-width: 500px;
    padding: 0;
}

.sim-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(232, 184, 75, 0.1);
}

.sim-overlay-title {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #e8b84b;
    letter-spacing: 2px;
}

.sim-overlay-close {
    font-family: 'Space Mono', monospace;
    font-size: 18px;
    color: #6c757d;
    background: none;
    border: 1px solid rgba(108, 117, 125, 0.3);
    cursor: pointer;
    padding: 4px 10px;
    transition: all 0.2s ease;
}

.sim-overlay-close:hover {
    color: #e8b84b;
    border-color: rgba(232, 184, 75, 0.3);
}

.sim-overlay-terminal {
    padding: 16px 20px;
    max-height: 200px;
    overflow-y: auto;
    border-bottom: 1px solid rgba(74, 144, 217, 0.1);
}

.terminal-line {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #4a90d9;
    line-height: 1.8;
    opacity: 0.8;
}

.terminal-line.success {
    color: #e8b84b;
}

.terminal-line.error {
    color: #d9534f;
}

.sim-overlay-canvas {
    padding: 16px;
}

.sim-overlay-canvas canvas {
    display: block;
    width: 100%;
    height: 300px;
    background: #0d0d1a;
    image-rendering: pixelated;
}

/* Responsive */
@media (max-width: 900px) {
    .hero-content {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .hero-title {
        font-size: 48px;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta {
        justify-content: center;
    }

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

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

    .process-steps {
        flex-direction: column;
        align-items: center;
    }

    .step-connector {
        width: 2px;
        height: 40px;
        flex-direction: column;
        padding-top: 0;
    }

    .connector-line {
        width: 2px;
        height: 100%;
        min-width: unset;
        min-height: 20px;
    }

    .about-content {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .nav-links {
        display: none;
    }

    .section-title {
        font-size: 36px;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 36px;
    }

    .px {
        width: 20px;
        height: 20px;
    }

    .pixel-heart .px {
        width: 24px;
        height: 24px;
    }
}
