/* sim-ai.xyz — Cursor Reactive Creative */

/* ========== Reset & Base ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #0A0A14;
    color: #7B8FA1;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(0, 212, 170, 0.25);
    color: #E8ECF1;
}

/* ========== Typography ========== */
.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: #E8ECF1;
    text-align: center;
    letter-spacing: 0.01em;
    margin-bottom: 2.5rem;
}

/* ========== Hero Zone ========== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0A0A14;
}

.dot-grid-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.headline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    color: #E8ECF1;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.hero-sub {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 1.15rem;
    color: #7B8FA1;
    margin-bottom: 2.5rem;
    letter-spacing: 0.04em;
}

.cta-glow {
    display: inline-block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #0A0A14;
    background: #00D4AA;
    padding: 0.85rem 2.5rem;
    border-radius: 8px;
    text-decoration: none;
    transition: box-shadow 0.3s ease, transform 0.25s ease;
    cursor: pointer;
}

.cta-glow:hover {
    box-shadow: 0 0 24px rgba(0, 212, 170, 0.35), 0 0 48px rgba(0, 212, 170, 0.15);
    transform: translateY(-2px);
}

.cta-glow:active {
    transform: translateY(0);
}

/* ========== Templates Section ========== */
.templates {
    max-width: 960px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.template-card {
    background: #141420;
    border: 1px solid #1A1A2E;
    border-radius: 12px;
    padding: 1.5rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.template-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 212, 170, 0.1);
}

.template-preview {
    height: 140px;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
    background: #0A0A14;
}

/* Particle System animation */
.particles {
    background: #0A0A14;
}

.p-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00D4AA;
    animation: bounce 2s ease-in-out infinite;
    opacity: 0.85;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-24px); }
}

/* Fluid Dynamics animation */
.fluid {
    background: #0A0A14;
    overflow: hidden;
}

.fluid-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00D4AA, #6C63FF, transparent);
    animation: flow 3s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes flow {
    0%, 100% { transform: translateX(-30%) scaleX(0.6); opacity: 0.3; }
    50% { transform: translateX(30%) scaleX(1); opacity: 0.7; }
}

/* Swarm Intelligence animation */
.swarm {
    background: #0A0A14;
}

.s-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6C63FF;
    animation: cluster 3s ease-in-out infinite;
}

@keyframes cluster {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(8px, -6px); }
    50% { transform: translate(3px, -10px); }
    75% { transform: translate(-5px, -3px); }
}

.template-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: #E8ECF1;
    margin-bottom: 0.4rem;
}

.template-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.82rem;
    color: #7B8FA1;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.load-btn {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    color: #00D4AA;
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: 0.02em;
}

.load-btn:hover {
    color: #E8ECF1;
}

/* ========== Editor Preview ========== */
.editor-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.editor-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.code-panel,
.canvas-panel {
    background: #141420;
    border: 1px solid #1A1A2E;
    border-radius: 8px;
    overflow: hidden;
}

.panel-chrome {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid #1A1A2E;
    background: rgba(20, 20, 32, 0.8);
}

.chrome-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chrome-dot.red { background: #FF6B4A; }
.chrome-dot.yellow { background: #FFCC00; }
.chrome-dot.green { background: #00D4AA; }

.panel-title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    color: #7B8FA1;
    margin-left: 8px;
}

.code-body {
    display: flex;
    padding: 0;
}

.line-numbers {
    display: flex;
    flex-direction: column;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #7B8FA1;
    padding: 14px 10px 14px 14px;
    text-align: right;
    line-height: 1.65;
    opacity: 0.4;
    user-select: none;
    border-right: 1px solid #1A1A2E;
}

.code-content {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.78rem;
    color: #E8ECF1;
    padding: 14px 16px;
    line-height: 1.65;
    flex: 1;
    white-space: pre;
    overflow-x: auto;
}

.kw { color: #00D4AA; }
.str { color: #FF6B4A; }
.val { color: #6C63FF; }
.prop { color: #E8ECF1; }
.fn { color: #6C63FF; }

/* Canvas panel */
.canvas-content {
    height: 240px;
    position: relative;
    overflow: hidden;
}

.canvas-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00D4AA;
    opacity: 0;
    animation: canvasFade 3s ease-in-out infinite;
}

.canvas-dot:nth-child(odd) {
    animation-delay: 0.3s;
    background: #6C63FF;
}

.canvas-dot:nth-child(3n) {
    width: 4px;
    height: 4px;
    animation-delay: 0.7s;
}

.canvas-dot:nth-child(4n) {
    width: 8px;
    height: 8px;
    animation-delay: 1.2s;
    background: #FF6B4A;
    opacity: 0;
}

@keyframes canvasFade {
    0% { opacity: 0; transform: translateY(10px); }
    30% { opacity: 0.8; }
    70% { opacity: 0.8; }
    100% { opacity: 0; transform: translateY(-15px); }
}

/* ========== Community Gallery ========== */
.gallery {
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.gallery-card {
    transition: transform 0.15s ease-out;
    transform-style: preserve-3d;
    cursor: pointer;
    will-change: transform;
}

.gallery-thumb {
    aspect-ratio: 1;
    border-radius: 10px;
    margin-bottom: 0.6rem;
    transition: box-shadow 0.3s ease;
}

.gallery-card:hover .gallery-thumb {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.g1 { background: radial-gradient(circle at 40% 40%, #6C63FF 0%, #1A1A2E 50%, #0A0A14 100%); }
.g2 { background: conic-gradient(from 90deg at 50% 50%, #00D4AA, #0A0A14, #00D4AA); }
.g3 { background: radial-gradient(circle at 30% 30%, #FF6B4A 0%, transparent 50%), radial-gradient(circle at 70% 70%, #00D4AA, #0A0A14); }
.g4 { background: conic-gradient(from 180deg at 50% 50%, #6C63FF, #00D4AA, #141420, #6C63FF); }
.g5 { background: radial-gradient(circle at 60% 30%, #FF6B4A 0%, #141420 40%, #0A0A14 100%); }
.g6 { background: repeating-conic-gradient(from 0deg at 50% 50%, #00D4AA 0deg 10deg, #0A0A14 10deg 20deg); }

.gallery-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #E8ECF1;
    margin-bottom: 0.2rem;
}

.gallery-meta {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.72rem;
    color: #7B8FA1;
}

.view-count {
    color: #7B8FA1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

/* ========== Footer ========== */
.footer {
    max-width: 700px;
    margin: 0 auto;
    padding: 4rem 2rem 3rem;
    text-align: center;
    position: relative;
}

.footer-dot-cluster {
    position: relative;
    width: 120px;
    height: 60px;
    margin: 0 auto 2rem;
}

.footer-dot-cluster .fdot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #00D4AA;
    opacity: 0.3;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #E8ECF1;
    margin-bottom: 1.5rem;
    letter-spacing: 0.01em;
}

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

.flink {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    color: #00D4AA;
    text-decoration: none;
    transition: color 0.2s ease;
}

.flink:hover {
    color: #E8ECF1;
}

.footer-copy {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: #7B8FA1;
    opacity: 0.6;
}

/* ========== Fade-in Animations ========== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .template-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .editor-split {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-heading {
        font-size: 1.35rem;
    }

    .hero {
        min-height: 85vh;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

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

    .headline {
        font-size: 2rem;
    }
}
