/* ═══════════════════════════════════════════════════════════════════════════════
   MeaCore OS — Estilo "Obsidian & Parchment" (Minimalista, Medieval & Voxel)
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* Paleta Obsidiana y Piedra */
    --bg-obsidian: #0d0f12;
    --bg-surface: #141820;
    --bg-card: #1b202a;
    --bg-card-hover: #222834;
    --border-stone: #2f3644;
    --border-stone-light: #444d60;

    /* Acentos Pergamino y Oro Medieval */
    --gold-primary: #d4af37;
    --gold-light: #f5e298;
    --gold-dark: #997a15;
    --parchment-bg: #1c1a16;
    --parchment-border: #4d4433;

    /* Voxel Acentos Minecraft */
    --emerald-green: #48b04d;
    --emerald-glow: rgba(72, 176, 77, 0.35);
    --redstone-red: #e74c3c;
    --lapis-blue: #2980b9;
    --lapis-glow: rgba(41, 128, 185, 0.35);

    /* Textos */
    --text-primary: #f0f2f5;
    --text-muted: #9aa3b2;
    --text-gold: #f3df9b;

    /* Fuentes */
    --font-heading: 'Cinzel', 'Trajan Pro', 'Georgia', serif;
    --font-pixel: 'Press Start 2P', monospace, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-code: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

    /* Sombras Pixel-Art Táctiles */
    --shadow-pixel: 0 4px 0 #07080a;
    --shadow-pixel-hover: 0 2px 0 #07080a;
    --inset-bevel: inset 2px 2px 0 rgba(255, 255, 255, 0.12), inset -2px -2px 0 rgba(0, 0, 0, 0.45);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-obsidian);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.06), transparent 50%),
        radial-gradient(circle at 10% 30%, rgba(41, 128, 185, 0.04), transparent 40%),
        radial-gradient(circle at 90% 70%, rgba(72, 176, 77, 0.04), transparent 40%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* ── Tipografía y Utilidades ──────────────────────────────────────────────── */

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    letter-spacing: 0.04em;
    color: var(--text-gold);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.text-gold { color: var(--gold-primary); }
.text-emerald { color: var(--emerald-green); }
.text-muted { color: var(--text-muted); }

/* ── Barra de Navegación ─────────────────────────────────────────────────── */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(13, 15, 18, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-stone);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.brand-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-stone);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.4);
    object-fit: cover;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-brand:hover .brand-logo-img {
    transform: scale(1.08);
    box-shadow: 0 0 16px rgba(46, 204, 113, 0.6);
}

.emerald-gem {
    width: 24px;
    height: 24px;
    background: var(--emerald-green);
    transform: rotate(45deg);
    border: 2px solid #2d6b30;
    box-shadow: 0 0 12px var(--emerald-glow), inset 2px 2px 0 rgba(255, 255, 255, 0.4);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 0.2s, text-shadow 0.2s;
}

.nav-links a:hover {
    color: var(--gold-light);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.nav-launcher-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--emerald-green) !important;
    border: 1px dashed var(--emerald-green);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem !important;
}

.nav-launcher-link:hover {
    background: rgba(72, 176, 77, 0.12);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--gold-primary);
    margin: 4px 0;
    transition: 0.3s;
}

/* ── Botones Medievales / Minecraft ───────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid;
    box-shadow: var(--shadow-pixel), var(--inset-bevel);
    transition: transform 0.1s, box-shadow 0.1s, background-color 0.2s;
    user-select: none;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: var(--shadow-pixel-hover), var(--inset-bevel);
}

.btn-gold {
    background: linear-gradient(180deg, #c49a2c 0%, #947116 100%);
    border-color: #ffd700;
    color: #1a1202;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-gold:hover {
    background: linear-gradient(180deg, #d8ac35 0%, #a67f1b 100%);
}

.btn-stone {
    background: linear-gradient(180deg, #2c3340 0%, #1d222b 100%);
    border-color: var(--border-stone-light);
    color: var(--text-primary);
}

.btn-stone:hover {
    background: linear-gradient(180deg, #373f50 0%, #242a36 100%);
    border-color: var(--gold-primary);
}

.btn-emerald {
    background: linear-gradient(180deg, #3fa144 0%, #29742d 100%);
    border-color: #5cee5f;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-emerald:hover {
    background: linear-gradient(180deg, #49b84e 0%, #2f8534 100%);
}

.btn-discord {
    background: linear-gradient(180deg, #5865F2 0%, #434eb8 100%);
    border-color: #7983f5;
    color: #ffffff;
}

/* ── Hero Section ─────────────────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 4rem 1.5rem 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero-logo-box {
    margin: 0 auto 1.75rem;
    width: 150px;
    height: 150px;
    border-radius: 20px;
    border: 2px solid var(--border-stone);
    background: radial-gradient(circle at center, rgba(30, 36, 44, 0.9) 0%, rgba(13, 15, 18, 0.95) 100%);
    padding: 10px;
    box-shadow: 
        0 0 30px rgba(52, 152, 219, 0.35),
        0 0 60px rgba(46, 204, 113, 0.15),
        var(--shadow-pixel);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logo-float 4s ease-in-out infinite alternate;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-logo-box:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 
        0 0 45px rgba(52, 152, 219, 0.55),
        0 0 85px rgba(46, 204, 113, 0.28),
        var(--shadow-pixel);
}

.hero-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

@keyframes logo-float {
    0% {
        transform: translateY(0px);
    }
    100% {
        transform: translateY(-6px);
    }
}

.badge-version {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--parchment-bg);
    border: 1px solid var(--gold-dark);
    color: var(--gold-light);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero h1 {
    font-size: 3.2rem;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    background: linear-gradient(180deg, #fff7dc 0%, #dfb542 60%, #9e7a17 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.25rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 3.5rem;
}

.metric-card {
    background: var(--bg-surface);
    border: 2px solid var(--border-stone);
    padding: 1.25rem 1rem;
    box-shadow: var(--shadow-pixel);
}

.metric-val {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Grid de Características ─────────────────────────────────────────────── */

.section {
    padding: 4.5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
}

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

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

.feature-card {
    background: var(--bg-surface);
    border: 2px solid var(--border-stone);
    padding: 2rem;
    box-shadow: var(--shadow-pixel);
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold-dark);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

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

/* ── Centro de Descargas ISO ─────────────────────────────────────────────── */

.download-box {
    background: var(--bg-surface);
    border: 2px solid var(--border-stone);
    box-shadow: var(--shadow-pixel);
    padding: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.download-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-stone);
    margin-bottom: 2rem;
}

.download-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.download-tab.active {
    color: var(--gold-light);
    border-color: var(--gold-primary);
}

.download-content {
    display: none;
}

.download-content.active {
    display: block;
}

.code-block {
    background: #090a0d;
    border: 1px solid var(--border-stone);
    padding: 1rem 1.25rem;
    border-radius: 4px;
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: #8be9fd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    overflow-x: auto;
}

.btn-copy {
    background: var(--bg-card);
    border: 1px solid var(--border-stone-light);
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    color: var(--text-primary);
    border-color: var(--gold-primary);
}

/* ── Grimorio del Desarrollador (Visor Docs) ──────────────────────────────── */

.grimorio-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    background: var(--bg-surface);
    border: 2px solid var(--border-stone);
    box-shadow: var(--shadow-pixel);
    min-height: 550px;
}

.grimorio-sidebar {
    background: rgba(9, 10, 13, 0.6);
    border-right: 2px solid var(--border-stone);
    padding: 1.5rem 1rem;
}

.grimorio-menu-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.doc-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    text-align: left;
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.65rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0.4rem;
    transition: all 0.15s;
}

.doc-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.doc-btn.active {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--gold-dark);
    color: var(--gold-light);
    font-weight: 600;
}

.grimorio-viewer {
    padding: 2.5rem;
    overflow-y: auto;
    max-height: 700px;
    color: #d1d7e0;
}

.grimorio-viewer h1 { font-size: 1.8rem; margin-bottom: 1rem; }
.grimorio-viewer h2 { font-size: 1.4rem; margin: 1.5rem 0 0.75rem; border-bottom: 1px solid var(--border-stone); padding-bottom: 0.3rem; }
.grimorio-viewer h3 { font-size: 1.15rem; margin: 1.25rem 0 0.5rem; color: #fff; }
.grimorio-viewer p { margin-bottom: 1rem; font-size: 0.95rem; line-height: 1.7; }
.grimorio-viewer ul, .grimorio-viewer ol { margin: 0 0 1rem 1.5rem; }
.grimorio-viewer li { margin-bottom: 0.35rem; }
.grimorio-viewer pre {
    background: #090a0d;
    border: 1px solid var(--border-stone);
    padding: 1.25rem;
    overflow-x: auto;
    font-family: var(--font-code);
    font-size: 0.88rem;
    margin: 1.25rem 0;
    line-height: 1.5;
}
.grimorio-viewer code {
    font-family: var(--font-code);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.4rem;
    font-size: 0.85em;
    color: #e2c98d;
}
.grimorio-viewer pre code {
    background: none;
    padding: 0;
    color: #abb2bf;
}

/* ── Muro Comunitario & Soporte (Supabase) ─────────────────────────────────── */

.community-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.community-box {
    background: var(--bg-surface);
    border: 2px solid var(--border-stone);
    box-shadow: var(--shadow-pixel);
    padding: 2rem;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 420px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
}

.comment-item {
    background: var(--bg-card);
    border: 1px solid var(--border-stone);
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: var(--gold-light);
    font-size: 0.95rem;
}

.comment-stars {
    color: #ffca28;
    font-size: 0.9rem;
}

.comment-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.comment-body {
    font-size: 0.92rem;
    color: #c5cbd5;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-gold);
}

.form-control {
    width: 100%;
    background: #090a0d;
    border: 1px solid var(--border-stone);
    color: var(--text-primary);
    padding: 0.7rem 0.9rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-primary);
}

select.form-control {
    cursor: pointer;
}

/* ── Sinergia con MeaCore Launcher ────────────────────────────────────────── */

.ecosystem-banner {
    background: linear-gradient(135deg, rgba(20, 24, 32, 0.95) 0%, rgba(27, 32, 42, 0.95) 100%);
    border: 2px solid var(--emerald-green);
    box-shadow: 0 0 24px var(--emerald-glow), var(--shadow-pixel);
    padding: 3rem 2rem;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    align-items: center;
}

.ecosystem-content h2 {
    color: #70db75;
    margin-bottom: 0.75rem;
    font-size: 2rem;
}

.ecosystem-content p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.ecosystem-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.pill-badge {
    background: rgba(72, 176, 77, 0.15);
    border: 1px solid var(--emerald-green);
    color: #8be9fd;
    font-size: 0.82rem;
    padding: 0.25rem 0.6rem;
    font-weight: 500;
}

/* ── Discord Banner ──────────────────────────────────────────────────────── */

.discord-card {
    background: linear-gradient(135deg, #1e2230 0%, #151821 100%);
    border: 2px solid #5865F2;
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.25), var(--shadow-pixel);
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.discord-card h2 {
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.discord-card p {
    color: #b9bbbe;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

footer {
    border-top: 2px solid var(--border-stone);
    background: #090a0d;
    padding: 3rem 1.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.75rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--gold-light);
}

/* ── Responsividad ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .hero h1 { font-size: 2.4rem; }
    .grimorio-wrap { grid-template-columns: 1fr; }
    .grimorio-sidebar { border-right: none; border-bottom: 2px solid var(--border-stone); }
    .community-grid { grid-template-columns: 1fr; }
    .ecosystem-banner { grid-template-columns: 1fr; text-align: center; }
    .ecosystem-badges { justify-content: center; }
    
    .hamburger { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-obsidian);
        border-bottom: 2px solid var(--border-stone);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
    }
    .nav-links.open { display: flex; }
}

