/* ============================================
   chloe.cx - Y2K Chrome Metallic Game Engine
   ============================================ */

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

:root {
    --bg-dark: #0d0d12;
    --surface: #1a1a22;
    --border: #2a2a35;
    --text: #e0e0e8;
    --muted: #6b6b78;
    --neon-pink: #ff2d7b;
    --neon-blue: #00b4ff;
    --neon-green: #39ff14;
    --chrome-light: #c0c0c0;
    --chrome-mid: #ffffff;
    --chrome-dim: #a0a0a0;
    --chrome-shadow: #808080;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #0d0d12;
    color: var(--text);
    font-family: 'Exo 2', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
}

/* --- Chrome Text Effect --- */
.chrome-text {
    background: linear-gradient(180deg, #a0a0a0, #ffffff 25%, #808080 50%, #ffffff 75%, #a0a0a0);
    background-size: 100% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
}

h2 {
    font-size: clamp(2.5rem, 6vw, 6rem);
}

h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

code, pre {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    font-weight: 400;
}

/* ============================================
   PIXEL GRID TEXTURE
   ============================================ */
.pixel-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.5;
    z-index: 0;
}

/* ============================================
   HERO / SPLASH SCREEN
   ============================================ */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0d0d12;
    overflow: hidden;
}

.hero-grid {
    opacity: 0.35;
}

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

.engine-name {
    font-size: clamp(4rem, 14vw, 12rem);
    letter-spacing: 0.1em;
    line-height: 1;
    margin-bottom: 0;
    filter: drop-shadow(0 4px 30px rgba(255, 255, 255, 0.1));
}

.engine-ext {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    color: #ff2d7b;
    letter-spacing: 0.2em;
    margin-top: -0.2em;
    text-shadow: 0 0 20px rgba(255, 45, 123, 0.6), 0 0 40px rgba(255, 45, 123, 0.3);
}

.engine-tagline {
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    color: var(--muted);
    margin-top: 1.2rem;
    letter-spacing: 0.05em;
}

/* Play Button */
.play-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2.5rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    transition: transform 0.3s ease;
    padding: 4px;
}

.play-button:hover {
    transform: scale(1.15);
}

.play-button svg {
    display: block;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 45, 123, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 45, 123, 0.8);
    }
}

/* Scroll Hint */
.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.scroll-arrow {
    width: 16px;
    height: 16px;
    margin: 0.5rem auto 0;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(6px); }
}

/* ============================================
   Y2K GEOMETRIC FLOATERS
   ============================================ */
.floater {
    position: absolute;
    z-index: 1;
    opacity: 0.15;
    will-change: transform;
    pointer-events: none;
}

.floater-1 {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    background: linear-gradient(135deg, #c0c0c0, #ffffff, #a0a0a0);
    top: 10%;
    left: 8%;
    animation: float 10s ease-in-out infinite;
}

.floater-2 {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff2d7b, #ff6da0);
    top: 20%;
    right: 12%;
    animation: float 12s ease-in-out infinite 1s;
}

.floater-3 {
    width: 140px;
    height: 50px;
    border-radius: 999px;
    background: linear-gradient(135deg, #c0c0c0, #ffffff, #a0a0a0);
    bottom: 25%;
    left: 15%;
    animation: float 14s ease-in-out infinite 2s;
}

.floater-4 {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #39ff14, #70ff50);
    top: 60%;
    right: 20%;
    animation: float 9s ease-in-out infinite 0.5s;
}

.floater-5 {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    background: linear-gradient(135deg, #00b4ff, #60d0ff);
    bottom: 15%;
    right: 8%;
    animation: float 11s ease-in-out infinite 3s;
}

.floater-6 {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0c0c0, #ffffff);
    top: 35%;
    left: 3%;
    animation: float 13s ease-in-out infinite 1.5s;
}

.floater-7 {
    width: 160px;
    height: 45px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff2d7b, #ff6da0);
    top: 75%;
    left: 25%;
    animation: float 15s ease-in-out infinite 4s;
}

.floater-8 {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    background: linear-gradient(135deg, #a0a0a0, #ffffff, #c0c0c0);
    top: 5%;
    right: 30%;
    animation: float 8s ease-in-out infinite 2.5s;
}

.floater-9 {
    width: 90px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, #00b4ff, #60d0ff);
    bottom: 35%;
    right: 35%;
    animation: float 12s ease-in-out infinite 3.5s;
}

.floater-10 {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #39ff14, #70ff50);
    top: 45%;
    left: 40%;
    animation: float 10s ease-in-out infinite 1s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* ============================================
   DIAGONAL SECTIONS
   ============================================ */
.diagonal-section {
    position: relative;
    padding: 8rem 2rem;
    overflow: hidden;
}

.diagonal-section.section-dark {
    background: #0d0d12;
    clip-path: polygon(0 0, 100% 5%, 100% 100%, 0 95%);
    margin-top: -3rem;
}

.diagonal-section.section-neon {
    background: var(--surface);
    clip-path: polygon(0 5%, 100% 0, 100% 95%, 0 100%);
    margin-top: -3rem;
}

.diagonal-section .section-inner {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 1rem;
}

.section-desc {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    color: var(--muted);
    font-size: 1.1rem;
}

/* ============================================
   FEATURE CARDS
   ============================================ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: rgba(26, 26, 34, 0.85);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(4px);
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: var(--neon-pink);
    box-shadow: 0 8px 30px rgba(255, 45, 123, 0.15);
}

.feature-icon {
    margin-bottom: 1.2rem;
}

.feature-card p {
    color: var(--muted);
    font-size: 0.95rem;
}

.section-neon .feature-card {
    background: rgba(13, 13, 18, 0.7);
}

/* ============================================
   CODE SHOWCASE
   ============================================ */
.code-preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: linear-gradient(135deg, #ff2d7b, #00b4ff);
    border-radius: 12px;
    overflow: hidden;
    max-width: 1000px;
    margin: 0 auto;
    box-shadow: 0 8px 40px rgba(255, 45, 123, 0.2);
}

.code-panel,
.preview-panel {
    background: var(--surface);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border);
}

.panel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.panel-dot.red { background: #ff5f57; }
.panel-dot.yellow { background: #ffbd2e; }
.panel-dot.green { background: var(--neon-green); }

.panel-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--muted);
    margin-left: 0.5rem;
}

.panel-status {
    margin-left: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--neon-green);
}

.code-block {
    padding: 1.5rem;
    overflow-x: auto;
    line-height: 1.7;
    color: var(--text);
}

.code-block code {
    white-space: pre;
}

/* Syntax Highlighting */
.code-keyword { color: #ff2d7b; }
.code-type { color: #00b4ff; }
.code-string { color: #39ff14; }
.code-number { color: #ffbd2e; }
.code-func { color: #e0e0e8; }

/* Preview Panel */
.preview-viewport {
    position: relative;
    height: 320px;
    overflow: hidden;
    background: #0a0a0f;
}

.preview-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
}

.preview-character {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: top 0.05s linear, left 0.05s linear;
    filter: drop-shadow(0 0 8px rgba(255, 45, 123, 0.6));
}

.code-hint {
    text-align: center;
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-content {
    text-align: center;
}

.cta-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    margin-bottom: 1rem;
}

.cta-desc {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    color: var(--muted);
    font-size: 1.15rem;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 2rem;
    border-radius: 999px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--neon-pink);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(255, 45, 123, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 30px rgba(255, 45, 123, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--neon-blue);
    box-shadow: 0 4px 20px rgba(0, 180, 255, 0.2);
}

.btn-icon {
    flex-shrink: 0;
}

/* Stats */
.cta-stats {
    display: flex;
    gap: 4rem;
    justify-content: center;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 2rem;
    color: var(--neon-green);
    text-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ============================================
   FOOTER
   ============================================ */
#footer {
    padding: 2rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: -2rem;
    position: relative;
    z-index: 2;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
}

.footer-copy {
    color: var(--muted);
    font-size: 0.85rem;
}

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

    .code-preview-container {
        grid-template-columns: 1fr;
    }

    .diagonal-section {
        padding: 6rem 1.5rem;
    }

    .cta-stats {
        gap: 2rem;
    }

    .footer-inner {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .engine-name {
        letter-spacing: 0.05em;
    }

    .diagonal-section {
        padding: 5rem 1rem;
        clip-path: polygon(0 0, 100% 3%, 100% 100%, 0 97%);
    }

    .diagonal-section.section-neon {
        clip-path: polygon(0 3%, 100% 0, 100% 97%, 0 100%);
    }

    .cta-buttons {
        gap: 1rem;
    }
}
