/* ============================================
   PRESENTACIONES — "Observatory" Design System
   Deep-space control room aesthetic
   Warm amber instrumentation / infinite dark
   ============================================ */

/* ---- Root variables ---- */
:root {
    --void: #050810;
    --void-900: #0a0e1a;
    --void-800: #0f1424;
    --void-700: #161c32;
    --amber-glow: #f0a830;
    --amber-dim: rgba(240, 168, 48, 0.12);
    --coral: #ff6b6b;
    --grid-color: rgba(100, 116, 139, 0.06);
    --glass-bg: rgba(15, 20, 36, 0.7);
    --glass-border: rgba(100, 116, 139, 0.12);
    --glass-bg-strong: rgba(15, 20, 36, 0.85);
}

/* ---- Glassmorphism ---- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border: 1px solid var(--glass-border);
}

.glass-strong {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(48px) saturate(1.3);
    -webkit-backdrop-filter: blur(48px) saturate(1.3);
    border: 1px solid rgba(100, 116, 139, 0.18);
}

/* ---- Constellation grid overlay ---- */
.grid-overlay {
    position: relative;
}

.grid-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* ---- Mesh gradient (observatory nebula) ---- */
.mesh-gradient {
    background:
        radial-gradient(ellipse 600px 500px at 15% 20%, rgba(240, 168, 48, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 500px 600px at 85% 70%, rgba(99, 102, 241, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 50% 50%, rgba(255, 107, 107, 0.04) 0%, transparent 70%);
}

/* ---- Animated gradient text ---- */
.gradient-text {
    background: linear-gradient(135deg, #fcd34d, #f0a830, #ff8a80, #fcd34d);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 8s ease infinite;
}

.gradient-text-cool {
    background: linear-gradient(135deg, #94a3b8, #e2e8f0, #fcd34d, #94a3b8);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 10s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ---- Glow effects ---- */
.glow-amber-sm {
    box-shadow: 0 0 20px rgba(240, 168, 48, 0.1), 0 0 4px rgba(240, 168, 48, 0.05);
}

.glow-amber-md {
    box-shadow: 0 0 30px rgba(240, 168, 48, 0.15), 0 0 60px rgba(240, 168, 48, 0.06);
}

.glow-amber-lg {
    box-shadow:
        0 0 40px rgba(240, 168, 48, 0.2),
        0 0 80px rgba(240, 168, 48, 0.08),
        inset 0 0 40px rgba(240, 168, 48, 0.03);
}

/* ---- Hover card lift ---- */
.card-lift {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease;
}

.card-lift:hover {
    transform: translateY(-6px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(240, 168, 48, 0.08);
    border-color: rgba(240, 168, 48, 0.2);
}

/* ---- Ambient orbs (nebula blobs) ---- */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.orb-amber {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(240, 168, 48, 0.12), transparent 70%);
    top: -10%;
    left: -5%;
}

.orb-indigo {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08), transparent 70%);
    bottom: -10%;
    right: -5%;
}

.orb-coral {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.06), transparent 70%);
    top: 40%;
    right: 20%;
}

/* ---- Slide system ---- */
.slide-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    perspective: 1200px;
}

.slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5rem 4rem 6rem;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.97) translateZ(-30px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Slide inner scrollable cuando el contenido es extenso */
.slide .slide-inner {
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(240, 168, 48, 0.3) transparent;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateZ(0);
}

.slide.exiting {
    opacity: 0;
    transform: scale(1.03) translateZ(30px);
    transition:
        opacity 0.4s cubic-bezier(0.7, 0, 0.84, 0),
        transform 0.4s cubic-bezier(0.7, 0, 0.84, 0);
}

/* ---- Slide inner scrollable ---- */
.slide .slide-inner {
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(240, 168, 48, 0.3) transparent;
    padding-right: 0.5rem;
}

/* ---- Slide type-specific ---- */
.slide[data-type="titulo"] .slide-inner {
    text-align: center;
}

.slide[data-type="codigo"] .slide-inner {
    text-align: left;
    max-width: 72rem;
}

/* ---- Typography inside slides ---- */
.slide-inner h1 {
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(2.4rem, 5.5vw, 5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.slide-inner h2 {
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3.8vw, 3.2rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.slide-inner h3 {
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    line-height: 1.25;
}

.slide-inner p,
.slide-inner li {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1.05rem, 1.8vw, 1.45rem);
    line-height: 1.7;
    color: #94a3b8;
}

.slide-inner ul {
    list-style: none;
    padding: 0;
}

.slide-inner ul li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.85rem;
}

.slide-inner ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: var(--amber-glow);
    box-shadow: 0 0 8px rgba(240, 168, 48, 0.4);
    transform: rotate(45deg);
}

/* Code in slides */
.slide-inner pre {
    background: rgba(5, 8, 16, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.15);
    border-left: 3px solid var(--amber-glow);
    border-radius: 0.75rem;
    padding: 1.5rem 2rem;
    font-family: 'Azeret Mono', 'JetBrains Mono', monospace;
    font-size: clamp(0.8rem, 1.1vw, 0.95rem);
    overflow-x: auto;
    max-width: 100%;
    color: #e2e8f0;
}

.slide-inner code {
    font-family: 'Azeret Mono', 'JetBrains Mono', monospace;
    background: rgba(240, 168, 48, 0.08);
    border: 1px solid rgba(240, 168, 48, 0.12);
    padding: 0.15em 0.45em;
    border-radius: 0.25rem;
    font-size: 0.88em;
    color: #fcd34d;
}

.slide-inner pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

/* ---- Tables in slides ---- */
.slide-inner table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, 0.15);
}

.slide-inner th {
    background: rgba(240, 168, 48, 0.08);
    color: #fcd34d;
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.75rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid rgba(240, 168, 48, 0.15);
}

.slide-inner td {
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.08);
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
    color: #94a3b8;
}

.slide-inner tr:last-child td {
    border-bottom: none;
}

.slide-inner tr:hover td {
    background: rgba(240, 168, 48, 0.03);
}

/* ---- Progress bar ---- */
.progress-bar {
    background: linear-gradient(90deg, #f0a830, #fcd34d, #ff8a80);
    background-size: 200% 100%;
    animation: gradient-shift 4s ease infinite;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 12px rgba(240, 168, 48, 0.4);
}

/* ---- Watermark slide number ---- */
.slide-watermark {
    position: absolute;
    bottom: 4rem;
    right: 4rem;
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 900;
    font-size: 12rem;
    line-height: 1;
    color: rgba(100, 116, 139, 0.04);
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

/* ---- Accent strip (diagonal) for cards ---- */
.accent-strip {
    position: relative;
    overflow: hidden;
}

.accent-strip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--amber-glow), transparent 80%);
    border-radius: 0 2px 2px 0;
    opacity: 0.6;
    transition: opacity 0.4s ease, height 0.4s ease;
}

.accent-strip:hover::before {
    opacity: 1;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(240, 168, 48, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(240, 168, 48, 0.4);
}

/* ---- Noise texture ---- */
.noise::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

/* ---- Dot grid for specific sections ---- */
.dot-grid {
    background-image: radial-gradient(circle, rgba(100, 116, 139, 0.12) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ---- Stagger reveal helpers ---- */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.reveal-stagger > *:nth-child(2) { animation-delay: 0.12s; }
.reveal-stagger > *:nth-child(3) { animation-delay: 0.19s; }
.reveal-stagger > *:nth-child(4) { animation-delay: 0.26s; }
.reveal-stagger > *:nth-child(5) { animation-delay: 0.33s; }
.reveal-stagger > *:nth-child(6) { animation-delay: 0.40s; }
.reveal-stagger > *:nth-child(7) { animation-delay: 0.47s; }
.reveal-stagger > *:nth-child(8) { animation-delay: 0.54s; }
.reveal-stagger > *:nth-child(9) { animation-delay: 0.61s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Nav button hover ring ---- */
.nav-ring {
    position: relative;
    transition: color 0.3s ease;
}

.nav-ring::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.nav-ring:hover::after {
    border-color: rgba(240, 168, 48, 0.3);
    transform: scale(1.1);
}

/* ---- Responsive adjustments ---- */
@media (max-width: 768px) {
    .slide {
        padding: 3rem 1.5rem 5rem;
    }
    .slide-watermark {
        font-size: 6rem;
        bottom: 3rem;
        right: 1.5rem;
    }
}


/* ============================================
   LIGHT MODE — Alto contraste texto oscuro
   ============================================ */
html.light {
    --void: #f8fafc;
    --void-900: #f1f5f9;
    --void-800: #e2e8f0;
    --void-700: #cbd5e1;
    --amber-glow: #92400e;
    --amber-dim: rgba(146, 64, 14, 0.08);
    --grid-color: rgba(100, 116, 139, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(100, 116, 139, 0.2);
    --glass-bg-strong: rgba(255, 255, 255, 0.92);
}

/* Fondo y texto base */
html.light body {
    background: #f8fafc;
    color: #0f172a;
}

html.light .bg-void-950 {
    background-color: #f8fafc !important;
}

html.light .slide-container {
    background: #f8fafc;
}

/* Gradientes de fondo suaves */
html.light .mesh-gradient {
    background:
        radial-gradient(ellipse 600px 500px at 15% 20%, rgba(146, 64, 14, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 500px 600px at 85% 70%, rgba(99, 102, 241, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 50% 50%, rgba(255, 107, 107, 0.03) 0%, transparent 70%);
}

/* Gradient text: oscuro y legible */
html.light .gradient-text {
    background: linear-gradient(135deg, #78350f, #92400e, #b91c1c, #78350f);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Tipografía slides: CONTRASTE ALTO ---- */
html.light .slide-inner h1 {
    color: #0f172a;
    -webkit-text-fill-color: initial;
}

html.light .slide-inner h2 {
    color: #0f172a !important;
}

html.light .slide-inner h3 {
    color: #1e293b !important;
}

html.light .slide-inner p,
html.light .slide-inner li {
    color: #334155 !important;
}

/* Inline strongs con color de acento oscuro */
html.light .slide-inner strong {
    color: #92400e !important;
}

/* Tablas */
html.light .slide-inner table {
    border-color: rgba(100, 116, 139, 0.25);
}

html.light .slide-inner th {
    background: rgba(146, 64, 14, 0.08);
    color: #78350f;
    border-bottom-color: rgba(146, 64, 14, 0.2);
}

html.light .slide-inner td {
    color: #334155;
    border-bottom-color: rgba(100, 116, 139, 0.15);
}

html.light .slide-inner tr:hover td {
    background: rgba(146, 64, 14, 0.03);
}

/* Código */
html.light .slide-inner code {
    background: rgba(146, 64, 14, 0.06);
    border-color: rgba(146, 64, 14, 0.18);
    color: #78350f;
}

html.light .slide-inner pre {
    background: #f1f5f9;
    border-color: rgba(100, 116, 139, 0.2);
    border-left-color: #92400e;
    color: #1e293b;
}

html.light .slide-inner pre code {
    color: inherit;
    background: none;
    border: none;
}

/* Bullets */
html.light .slide-inner ul li::before {
    background: #92400e;
    box-shadow: 0 0 8px rgba(146, 64, 14, 0.3);
}

/* Orbs suaves */
html.light .orb-amber {
    background: radial-gradient(circle, rgba(146, 64, 14, 0.05), transparent 70%);
}
html.light .orb-indigo {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.04), transparent 70%);
}

/* Watermark */
html.light .slide-watermark {
    color: rgba(100, 116, 139, 0.06);
}

/* Barra de controles */
html.light .glass-strong {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(100, 116, 139, 0.2);
}

html.light .glass {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(100, 116, 139, 0.2);
}

html.light .progress-bar {
    background: linear-gradient(90deg, #92400e, #b45309, #b91c1c);
    box-shadow: 0 0 12px rgba(146, 64, 14, 0.3);
}

/* Scrollbar light */
html.light ::-webkit-scrollbar-thumb {
    background: rgba(146, 64, 14, 0.2);
}
html.light ::-webkit-scrollbar-thumb:hover {
    background: rgba(146, 64, 14, 0.4);
}
html.light .slide .slide-inner {
    scrollbar-color: rgba(146, 64, 14, 0.25) transparent;
}

/* Glow light */
html.light .glow-amber-sm {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Grid overlay */
html.light .grid-overlay::after {
    background-image:
        linear-gradient(rgba(100, 116, 139, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 116, 139, 0.08) 1px, transparent 1px);
}

/* Noise sutil */
html.light .noise::before {
    opacity: 0.3;
}

/* Dots y counter */
html.light .slide-dot {
    background: #cbd5e1 !important;
}

html.light .slide-dot.\!bg-amber-400 {
    background: #92400e !important;
}

/* ---- Home page light ---- */
html.light .text-white {
    color: #0f172a !important;
}

html.light .text-slate-200 {
    color: #1e293b !important;
}

html.light .text-slate-400 {
    color: #475569 !important;
}

html.light .text-slate-500 {
    color: #64748b !important;
}

html.light .text-slate-600 {
    color: #94a3b8 !important;
}

html.light .text-slate-700 {
    color: #cbd5e1 !important;
}

html.light .text-amber-300\/80 {
    color: #92400e !important;
}

html.light .text-amber-400\/80 {
    color: #92400e !important;
}

html.light .text-amber-400\/50 {
    color: rgba(146, 64, 14, 0.7) !important;
}

html.light .text-amber-400\/60 {
    color: rgba(146, 64, 14, 0.7) !important;
}

html.light .bg-void-800 {
    background-color: #e2e8f0 !important;
}

html.light .bg-amber-400\/8 {
    background-color: rgba(146, 64, 14, 0.06) !important;
}

html.light .border-amber-400\/20 {
    border-color: rgba(146, 64, 14, 0.2) !important;
}

html.light .border-white\/\[0\.04\] {
    border-color: rgba(0, 0, 0, 0.06) !important;
}

html.light .border-white\/\[0\.06\] {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Cards hover */
html.light .card-lift:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    border-color: rgba(146, 64, 14, 0.25);
}

/* Footer */
html.light footer span {
    color: #94a3b8 !important;
}

/* Transiciones suaves */
html.light body,
html.light .slide-container,
html.light .glass-strong,
html.light .glass {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
