/* ============================================
   MSX Expert - Gradiente | Enhanced Stylesheet
   Paleta baseada no gabinete do MSX Expert
   ============================================ */

:root {
    --expert-dark: #121212;
    --expert-graphite: #2b2b2b;
    --expert-red: #d32f2f;
    --expert-red-glow: rgba(211, 47, 47, 0.4);
    --msx-blue: #1d2b53;
    --msx-green: #00e436;
    --text-main: #e0e0e0;
    --text-muted: #aaaaaa;
    --font-ui: 'Inter', sans-serif;
    --font-retro: 'VT323', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-ui);
    background-color: var(--expert-graphite);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Film Grain Overlay — retro atmosphere across the whole page */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   Cabeçalho — sticky com blur de fundo
   ========================================== */
.site-header {
    background-color: rgba(18, 18, 18, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 4px solid var(--expert-red);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    font-style: italic;
    transition: text-shadow 0.3s;
}

.logo a:hover {
    text-shadow: 0 0 12px var(--expert-red-glow);
}

.logo span { color: var(--expert-red); }

/* Navegação */
.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s, text-shadow 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--expert-red);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover, .nav-links a.active {
    color: #fff;
    text-shadow: 0 0 8px var(--expert-red-glow);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
}

/* ==========================================
   Hero Section — com partículas e atmosfera
   ========================================== */
.hero {
    padding: 4rem 0;
    background-color: var(--expert-dark);
    border-bottom: 1px solid #333;
    position: relative;
    overflow: hidden;
}

/* Fundo animado sutil — grid de circuitos */
.hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0.03;
    background-image:
        linear-gradient(var(--expert-red) 1px, transparent 1px),
        linear-gradient(90deg, var(--expert-red) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    animation: gridShift 20s linear infinite;
}

@keyframes gridShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

.hero-flex {
    display: flex;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.hero-text {
    flex: 1;
    min-width: 300px;
}

.hero-text h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.hero-text h1 .accent {
    color: var(--expert-red);
    text-shadow: 0 0 20px var(--expert-red-glow);
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 520px;
}

.hero-text p strong {
    color: var(--expert-red);
}

/* Specs Ticker — faixa rolante de especificações */
.specs-ticker {
    margin-top: 1.8rem;
    overflow: hidden;
    border: 1px solid #333;
    border-radius: 4px;
    background: rgba(0,0,0,0.4);
    padding: 0.5rem 0;
    position: relative;
}

.specs-ticker::before,
.specs-ticker::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}

.specs-ticker::before {
    left: 0;
    background: linear-gradient(90deg, var(--expert-dark), transparent);
}

.specs-ticker::after {
    right: 0;
    background: linear-gradient(-90deg, var(--expert-dark), transparent);
}

.ticker-track {
    display: flex;
    gap: 3rem;
    white-space: nowrap;
    animation: tickerScroll 25s linear infinite;
    font-family: var(--font-retro);
    font-size: 1.05rem;
    color: var(--msx-green);
    text-shadow: 0 0 6px rgba(0, 228, 54, 0.5);
}

.ticker-track span {
    flex-shrink: 0;
}

.ticker-track span::before {
    content: "▸ ";
    color: var(--expert-red);
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==========================================
   Monitor CRT — com LED de power e brilho
   ========================================== */
.msx-monitor {
    flex: 1;
    min-width: 320px;
    padding: 15px;
    background: linear-gradient(145deg, #222, #1a1a1a, #181818);
    border-radius: 14px;
    box-shadow:
        inset 0 0 10px #000,
        0 15px 35px rgba(0,0,0,0.8),
        0 0 0 1px #333;
    position: relative;
    border: 2px solid #2a2a2a;
}

/* LED de Power no canto do monitor */
.msx-monitor::after {
    content: '';
    position: absolute;
    bottom: 6px;
    right: 18px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--msx-green);
    box-shadow: 0 0 6px var(--msx-green), 0 0 12px var(--msx-green);
    animation: ledPulse 3s ease-in-out infinite;
}

@keyframes ledPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--msx-green), 0 0 12px var(--msx-green); }
    50% { opacity: 0.7; box-shadow: 0 0 3px var(--msx-green); }
}

/* Label "GRADIENTE" gravado no monitor */
.msx-monitor::before {
    content: 'GRADIENTE';
    position: absolute;
    bottom: 4px;
    left: 18px;
    font-family: var(--font-ui);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: #444;
    text-transform: uppercase;
}

/* A tela CRT */
.msx-screen {
    background-color: var(--msx-blue);
    padding: 1.5rem;
    height: 320px;
    position: relative;
    border-radius: 10px;
    font-family: var(--font-retro);
    color: #fff;
    font-size: 1.4rem;
    overflow: hidden;
    transition: background-color 0.8s ease;
    display: flex;
    flex-direction: column;
}

/* Phosphor glow — brilho interno da tela */
.msx-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 10px;
    box-shadow: inset 0 0 60px rgba(29, 43, 83, 0.6);
    z-index: 1;
    pointer-events: none;
    transition: box-shadow 0.8s ease;
}

.msx-screen.game-mode::before {
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
}

#text-layer {
    z-index: 5;
    position: relative;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

#boot-text { display: inline; }

.cursor {
    display: inline-block;
    width: 12px;
    height: 1.2rem;
    background-color: #fff;
    animation: blink 1s step-end infinite;
    vertical-align: bottom;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

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

/* Prompt interativo pós-demo */
#interactive-prompt {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0.8rem 1.5rem;
    z-index: 15;
    display: none;
    background: rgba(0, 0, 0, 0.7);
    border-top: 1px solid #333;
}

#interactive-prompt.visible {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#interactive-prompt label {
    font-family: var(--font-retro);
    font-size: 1.2rem;
    color: var(--msx-green);
    text-shadow: 0 0 6px rgba(0, 228, 54, 0.5);
    flex-shrink: 0;
}

#basic-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-retro);
    font-size: 1.2rem;
    flex: 1;
    caret-color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Canvas do jogo */
#game-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    image-rendering: pixelated;
    object-fit: cover;
    z-index: 3;
    display: none;
}

/* Efeito CRT: Scanlines + Vinheta */
.crt-effect::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    border-radius: 10px;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
    box-shadow: inset 0 0 80px rgba(0,0,0,0.7);
}

/* Flicker sutil do CRT */
@keyframes crtFlicker {
    0% { opacity: 0.97; }
    5% { opacity: 1; }
    10% { opacity: 0.98; }
    15% { opacity: 1; }
    100% { opacity: 1; }
}

.crt-effect {
    animation: crtFlicker 0.15s infinite;
}

/* ==========================================
   Grid de Cards — com animação de entrada
   ========================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 4rem 20px;
}

.card {
    background-color: var(--expert-dark);
    padding: 2rem;
    border-radius: 8px;
    border-top: 4px solid var(--expert-red);
    transition: transform 0.3s ease, box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;

    /* Scroll reveal — começa invisível */
    opacity: 0;
    transform: translateY(30px);
}

.card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.4s ease;
}

/* Stagger nas animações dos cards */
.card:nth-child(1) { transition-delay: 0.0s; }
.card:nth-child(2) { transition-delay: 0.1s; }
.card:nth-child(3) { transition-delay: 0.2s; }
.card:nth-child(4) { transition-delay: 0.3s; }

/* Brilho vermelho no hover */
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at top center, var(--expert-red-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(211, 47, 47, 0.15);
}

.card:hover::before {
    opacity: 1;
}

.card h2 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    position: relative;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.btn {
    display: inline-block;
    background-color: var(--expert-graphite);
    color: #fff;
    padding: 0.5rem 1.2rem;
    text-decoration: none;
    border: 1px solid #444;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
}

.btn:hover {
    background-color: var(--expert-red);
    border-color: var(--expert-red);
    box-shadow: 0 0 15px var(--expert-red-glow);
}

/* ==========================================
   Seção "Sobre a Máquina" — specs em destaque
   ========================================== */
.about-machine {
    padding: 4rem 0;
    background: var(--expert-dark);
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
}

.about-machine h2 {
    font-family: var(--font-retro);
    font-size: 2rem;
    color: #fff;
    text-align: center;
    margin-bottom: 0.5rem;
}

.about-machine .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

.specs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.spec-item {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--expert-graphite);
    border-radius: 8px;
    border: 1px solid #333;
    transition: border-color 0.3s;
    /* Scroll reveal */
    opacity: 0;
    transform: translateY(20px);
}

.spec-item.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s;
}

.spec-item:hover {
    border-color: var(--expert-red);
}

.spec-item .spec-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.spec-item .spec-label {
    font-family: var(--font-retro);
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.3rem;
}

.spec-item .spec-value {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 800;
}

/* ==========================================
   Rodapé
   ========================================== */
footer {
    background-color: var(--expert-dark);
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    border-top: 1px solid #222;
    font-size: 0.9rem;
}

footer .footer-hint {
    font-family: var(--font-retro);
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.5rem;
}

/* ==========================================
   Easter Egg Overlay (Konami Code)
   ========================================== */
.easter-egg-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

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

.easter-egg-overlay h2 {
    font-family: var(--font-retro);
    font-size: 2.5rem;
    color: var(--msx-green);
    text-shadow: 0 0 20px rgba(0, 228, 54, 0.6);
    margin-bottom: 1rem;
    animation: eggPulse 1.5s ease-in-out infinite;
}

.easter-egg-overlay p {
    font-family: var(--font-retro);
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.easter-egg-overlay .close-egg {
    background: none;
    border: 1px solid var(--msx-green);
    color: var(--msx-green);
    font-family: var(--font-retro);
    font-size: 1.1rem;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.easter-egg-overlay .close-egg:hover {
    background: var(--msx-green);
    color: #000;
}

@keyframes eggPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* ==========================================
   Responsivo
   ========================================== */
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: rgba(18, 18, 18, 0.98);
        backdrop-filter: blur(12px);
        padding: 1rem 0;
        border-bottom: 4px solid var(--expert-red);
    }

    .nav-links.active { display: flex; }
    .nav-links li { text-align: center; }

    .hero-text h1 { font-size: 2rem; }

    .specs-ticker { display: none; }

    .msx-monitor { min-width: unset; }
}

