/* ============================================
   General — Variables, Reset y Base
   Compartido por todas las vistas de Hefesto Docs
   ============================================ */

:root {
    --bg-base: #0a0e17;
    --bg-surface: #131820;
    --bg-card: #131820;
    --bg-card-hover: #171f2b;
    --bg-code: #0d1117;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-primary: #f59e0b;
    --accent-secondary: #fbbf24;
    --accent-hover: #fbbf24;
    --accent-glow: rgba(245, 158, 11, 0.15);

    --border-color: #1e293b;
    --border-hover: rgba(245, 158, 11, 0.4);

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-code: 'Fira Code', 'Consolas', monospace;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-secondary);
    font-family: var(--font-main);
    margin: 0;
    padding: 0 0 4rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Modal — Reutilizable en todas las vistas
   ============================================ */

.modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 1rem;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 2rem 1.75rem;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.7;
}

.modal-content p {
    margin: 0 0 1rem;
}

.modal-content h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

.modal-content p:last-of-type {
    margin-bottom: 0;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-btn-close {
    display: block;
    margin: 1.5rem auto 0;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.modal-btn-close:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

body.modal-open {
    overflow: hidden;
}

/* ============================================
   Footer con enlace a privacidad
   ============================================ */

.privacy-footer {
    text-align: center;
    padding: 2rem 0 1rem;
}

.privacy-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
    cursor: pointer;
}

.privacy-link:hover {
    color: var(--accent-primary);
}

/* ============================================
   Home — Estilos específicos de la página principal
   ============================================ */

body {
    color: var(--text-primary);
    padding: 2rem 1rem 4rem;
    line-height: 1.6;
}

/* ---- Hero Forge & Fire ---- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 4rem 1.5rem 3rem;
    margin-bottom: 3.5rem;
    text-align: center;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 20%, rgba(251, 191, 36, 0.04) 0%, transparent 40%);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.3), transparent);
}

@keyframes forge-glow {
    0%   { box-shadow: 0 0 35px var(--accent-glow), 0 0 70px rgba(245, 158, 11, 0.05); }
    50%  { box-shadow: 0 0 55px rgba(245, 158, 11, 0.30), 0 0 100px rgba(245, 158, 11, 0.12); }
    100% { box-shadow: 0 0 35px var(--accent-glow), 0 0 70px rgba(245, 158, 11, 0.05); }
}

.hero-logo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    animation: forge-glow 3s ease-in-out infinite;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0 auto 2rem;
    display: block;
    border: 2px solid rgba(245, 158, 11, 0.1);
}

.hero-logo:hover {
    transform: scale(1.05);
    animation-play-state: paused;
}

.hero-title {
    font-weight: 700;
    font-size: 3.5rem;
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 20px rgba(245, 158, 11, 0.25));
}

.hero-sub-brand {
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 1rem 0 0;
    display: block;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 1.5rem auto 0;
    font-weight: 400;
}

.hero-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* ---- Feature Pills ---- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 850px;
    margin: 0 auto 4rem;
    position: relative;
}

.feature-pill {
    text-align: center;
    padding: 1rem 1.5rem;
    position: relative;
}

.feature-pill + .feature-pill::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.2), transparent);
}

.feature-pill-icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.feature-pill:hover .feature-pill-icon {
    transform: translateY(-3px);
}

.feature-pill-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.feature-pill-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ---- Section Dividers ---- */
.section-divider {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 850px;
    margin: 3.5rem auto 2rem;
}

.section-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
}

.section-divider-title {
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent-primary);
    white-space: nowrap;
    padding: 0 0.5rem;
}

/* ---- Grid de Documentación (Cards) ---- */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    max-width: 850px;
    margin: 0 auto;
}

.doc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    display: block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.doc-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: all 0.3s ease;
}

.doc-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 0 15px rgba(245, 158, 11, 0.05);
    transform: translateY(-3px);
    background: var(--bg-card-hover);
}

.doc-card:hover::before {
    background: var(--accent-primary);
}

.doc-card-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.doc-card-sub {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Tarjetas agrupadas (Full Width) */
.doc-card-full {
    grid-column: 1 / -1;
    padding: 0;
}

.doc-card-full-header {
    padding: 1.5rem;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.doc-card-full:hover .doc-card-full-header {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Tarjetas anidadas (State, Message, etc.) */
.nested-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-top: 1px solid var(--border-color);
}

.doc-card-nested {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.doc-card-nested:hover {
    background: var(--bg-card-hover);
    box-shadow: inset 3px 0 0 var(--accent-primary);
}

.doc-card-nested .doc-card-title {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.doc-card-nested .doc-card-sub {
    font-size: 0.8rem;
}

/* ---- Footer Home ---- */
.home-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    text-align: center;
    position: relative;
}

.home-footer::before {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.4);
    margin: 0 auto 1rem;
    box-shadow: 20px 0 0 0 rgba(245, 158, 11, 0.2), -20px 0 0 0 rgba(245, 158, 11, 0.2);
}

.home-footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    margin: 0;
    text-transform: uppercase;
}

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

    .feature-pill + .feature-pill::before {
        display: none;
    }

    .docs-grid,
    .nested-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-logo {
        width: 120px;
        height: 120px;
    }

    .hero {
        padding: 2.5rem 1rem 2rem;
    }

    .doc-card {
        padding: 1.25rem;
    }
}
