/* =========================================
   RUTA 79 — THE DIGITAL FRONTIER
   Premium Tech-Fin Design System V5
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600;700&family=Cinzel:wght@400;700&display=swap');

:root {
    /* --- CORE COLORS (Deep Slate & Noir) --- */
    --bg-primary: #0F172A;
    --bg-secondary: #020617;
    /* Darker, almost black */
    --bg-glass: rgba(15, 23, 42, 0.75);

    /* --- PREMIUM GOLD PALETTE (5-Tone Metallic) --- */
    --gold-deep: #AA771C;
    --gold-base: #BF953F;
    --gold-highlight: #FCF6BA;
    --gold-mid: #B38728;
    --gold-premium: #B8860B;
    --gold-soft: #FBF5B7;

    /* --- GRADIENTS --- */
    --gold-metallic: linear-gradient(to right,
            var(--gold-base),
            var(--gold-highlight),
            var(--gold-mid),
            var(--gold-soft),
            var(--gold-deep));

    --gold-gradient: var(--gold-metallic);
    /* Alias for backward compatibility */

    --gold-glow: 0 0 20px rgba(191, 149, 63, 0.4);

    /* --- TEXT --- */
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    /* Slate 300 for better contrast */
    --text-gold: #FBF5B7;
    /* Using soft gold for flat text legibility */

    /* --- UI ELEMENTS --- */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-pill: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-gold: 0 4px 20px rgba(184, 134, 11, 0.15);

    /* --- TRANSITIONS --- */
    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.4s;
    --duration-slow: 0.8s;

    /* --- FUNCTIONAL COLORS --- */
    --color-success: #10B981;
    /* Emerald 500 */
    --color-success-bg: rgba(16, 185, 129, 0.2);
}

/* --- METRICS V2 (Vertical Stack) --- */
.metrics-v2-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 400px;
    /* Constrain width like the Tailwind example */
    margin: 0 auto;
}

.metric-card-v2 {
    background: rgba(15, 23, 42, 0.6);
    /* Slate 900/60 */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-align: left;
    /* Tailwind ex was left aligned */
}

.metric-card-v2:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(184, 134, 11, 0.3);
}

.metric-card-v2.highlight {
    background: var(--bg-primary);
    /* Slate 900 solid */
    border-color: rgba(184, 134, 11, 0.3);
    box-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.8);
    transform: translateX(16px);
    /* mimic translate-x-4 */
    z-index: 10;
}

.metric-card-v2.highlight:hover {
    transform: translateX(16px) scale(1.02);
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

.metric-label-sm {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-bottom: 4px;
}

.metric-value-lg {
    font-size: 2.25rem;
    /* ~text-4xl */
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    font-family: 'Space Grotesk', sans-serif;
}

.metric-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.icon-gold {
    background: rgba(184, 134, 11, 0.2);
    color: var(--gold-mid);
}

/* Progress Bar */
.progress-bg {
    width: 100%;
    height: 6px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-success);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Tags */
.status-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 4px;
    display: inline-block;
}

/* 1. ANIMATION: Shine Effect */
@keyframes shine {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* Light Mode Override (Auto-detect or toggled) */

/* =========================================
   V2: LUXURY ROI DASHBOARD
   Scoped Isolation: #app-module-wrapper
   Uses brand vars from :root (--gold-*, --bg-*, --text-*)
   ========================================= */
#app-module-wrapper {
    background: radial-gradient(circle at top right, rgba(30, 41, 59, 0.9), var(--bg-primary));
    border: 1px solid rgba(184, 134, 11, 0.25);
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), var(--gold-glow);
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
}

#app-module-wrapper .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 450px;
}

@media (max-width: 768px) {
    #app-module-wrapper .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Left Column: Controls --- */
#app-module-wrapper .controls-panel {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(184, 134, 11, 0.15);
}

@media (max-width: 768px) {
    #app-module-wrapper .controls-panel {
        border-right: none;
        border-bottom: 1px solid rgba(184, 134, 11, 0.15);
        padding: 30px;
    }
}

#app-module-wrapper h3 {
    font-family: 'Cinzel', serif;
    background: var(--gold-metallic);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    display: inline-block;
}

#app-module-wrapper .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 40px;
    line-height: 1.5;
}

#app-module-wrapper .input-group {
    background: var(--bg-glass);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(184, 134, 11, 0.1);
}

#app-module-wrapper .slider-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

#app-module-wrapper .slider-val-display {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    color: var(--text-gold);
    line-height: 1;
}

/* Slider Style */
#app-module-wrapper input[type=range] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

#app-module-wrapper input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--gold-gradient);
    border: 2px solid #fff;
    box-shadow: var(--gold-glow);
    margin-top: -10px;
    cursor: pointer;
    transition: transform 0.2s;
}

#app-module-wrapper input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

#app-module-wrapper input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

/* --- Right Column: Projections --- */
#app-module-wrapper .projections-panel {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: radial-gradient(circle at bottom left, rgba(184, 134, 11, 0.05), transparent);
}

@media (max-width: 768px) {
    #app-module-wrapper .projections-panel {
        padding: 30px;
    }
}

#app-module-wrapper .hero-metric {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

#app-module-wrapper .hero-label {
    font-family: 'Cinzel', serif;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: block;
}

#app-module-wrapper .hero-value {
    font-size: 3.5rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    background: var(--gold-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

@media (max-width: 768px) {
    #app-module-wrapper .hero-value {
        font-size: 2.5rem;
    }
}

#app-module-wrapper .metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#app-module-wrapper .metric-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    transition: border-color 0.3s;
}

#app-module-wrapper .metric-card:hover {
    border-color: rgba(184, 134, 11, 0.2);
}

#app-module-wrapper .metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

#app-module-wrapper .metric-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

#app-module-wrapper .metric-value.green {
    color: #10b981;
}

/* @media (prefers-color-scheme: light) { ... } */

[data-theme="light"] {
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --text-primary: #0F172A;
    --text-secondary: #475569;
}

/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    /* OPTION: MODERN CYBER GRID (Tech/Finance Standard) */
    background-color: #080C14;
    /* Deepest Noir */
    background-image:
        /* Vignette (Soft spotlight in center, dark edges) */
        radial-gradient(circle at 50% 30%, transparent 0%, #080C14 85%),
        /* The Grid Lines */
        linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 60px 60px, 60px 60px;
    background-attachment: fixed, fixed, fixed;

    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--duration-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- TYPOGRAPHY UTILITIES --- */
.text-gold,
.text-gold-premium {
    font-family: 'Cinzel', serif;
    background: var(--gold-metallic);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
    font-weight: 700;
    display: inline-block;
    letter-spacing: -0.02em;
}

.font-cinzel {
    font-family: 'Cinzel', serif;
}

.text-gradient {
    background: linear-gradient(to bottom, #F8FAFC 0%, #F5D77A 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
}

.text-highlight {
    color: var(--gold-mid);
    position: relative;
    white-space: nowrap;
}

/* Subtle underline highlight effect for H2s */
h2 .text-highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(184, 134, 11, 0.2);
    z-index: -1;
    transform: skewX(-10deg);
}

/* --- BUTTONS (METALLIC GOLD) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    transition: all var(--duration-normal) var(--ease-out);
    cursor: pointer;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bg-gold-premium {
    background: var(--gold-metallic);
    background-size: 200% auto;
    color: #0F172A;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: shine 4s linear infinite;
}

/* --- TAGS & PILLS --- */
.tag-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    background: rgba(184, 134, 11, 0.15);
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 100px;
    color: var(--gold-mid);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    /* Ensure no gradient text clipping here */
    -webkit-text-fill-color: var(--gold-mid);
    background-clip: border-box;
    -webkit-background-clip: border-box;
}

.btn-primary {
    background: var(--gold-metallic);
    background-size: 200% auto;
    color: #0F172A;
    /* Contrast Text */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-gold);
    animation: shine 4s linear infinite;
    font-weight: 700;
}

.btn-primary:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(184, 134, 11, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--gold-mid);
    color: var(--gold-light);
}

/* --- HERO SCROLLYTELLING LAYOUT --- */
.hero-sticky {
    position: relative;
    /* Create a long scroll track for the animation */
    height: 300vh;
    padding: 0;
    /* Reset padding to let sticky work edge-to-edge */
    z-index: 10;
}

.hero-bg {
    /* Sticky container: Stays fixed while parent scrolls */
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    /* Static Image (First Frame) - Fast Load */
    background-color: #020617;
    /* REGLA DE ORO / "GOLDEN RULE": Start with this static image */
    background-image: url('assets/hero-start.webp') !important;
    background-size: 100% 100%;
    background-position: center;
    z-index: 1;
}

#hero-canvas {
    background-color: transparent;
    /* Hidden initially - Shows static image */
    opacity: 0;
    transition: opacity 0.5s ease-out;

    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    /* Matches JS stretch logic */
    z-index: 2;
}

#hero-canvas.loaded {
    opacity: 1;
}

/* --- NAV APP-BAR (OPTION 3: BOTTOM CENTER LOGO) --- */
.nav-pill-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    padding: 0 0 30px;
    /* Space from bottom */
    display: flex;
    justify-content: center;
    pointer-events: none;
    /* Let clicks through the container */
}

.nav-pill {
    position: relative;
    background: rgba(2, 6, 23, 0.85);
    /* Deep Noir */
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(184, 134, 11, 0.1) inset;
    pointer-events: auto;
    /* Re-enable clicks */
    transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

.nav-pill:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(184, 134, 11, 0.2);
}

.nav-logo {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border: 2px solid var(--gold-mid);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    /* Overhang effect */
    z-index: 10;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(184, 134, 11, 0.4);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-logo:hover {
    transform: translate(-50%, -60%) scale(1.1) rotate(5deg);
    border-color: var(--gold-highlight);
    box-shadow: 0 15px 50px rgba(184, 134, 11, 0.6);
}

.nav-logo img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(212, 168, 67, 0.5));
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Spacer for the logo in the middle */
.nav-spacer {
    width: 70px;
}

.nav-item {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 30px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    border: 1px solid rgba(184, 134, 11, 0.3);
}

.btn-nav-accent {
    background: var(--gold-metallic);
    color: var(--bg-secondary);
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 20px;
    animation: shine 4s linear infinite;
}

/* --- SECTIONS --- */
.section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- PREMIUM PAGE HEADERS --- */
.page-header-wrapper {
    padding: 120px 0 60px;
    /* Top spacing for fixed nav */
    max-width: 900px;
    margin: 0 auto;
}

.page-header-minimal {
    margin-bottom: 40px;
}

.page-kicker {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    /* Default clean look */
    margin-bottom: 16px;
    opacity: 0.8;
}

.page-kicker.accent {
    color: var(--gold-mid);
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    /* letter-spacing: -0.02em; */
}

.display-hero {
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 700;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.page-meta {
    font-family: 'Outfit', sans-serif;
    color: var(--text-secondary);
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {

    /* TYPOGRAPHY SCALING */
    html {
        font-size: 14px;
    }

    .display-hero {
        font-size: clamp(2.5rem, 8vw, 3.5rem);
    }

    .page-title {
        font-size: 2.5rem;
    }

    /* NAVIGATION */
    .nav-pill-container {
        width: 95%;
        max-width: 440px;
        bottom: 20px;
    }

    .nav-pill {
        padding: 4px 8px;
        /* More compact */
        gap: 4px;
        justify-content: center;
    }

    .nav-logo {
        width: 52px;
        /* Balanced size */
        height: 52px;
        margin: -14px 2px;
        /* Overhang effect with less side space */
        flex-shrink: 0;
    }

    .nav-logo img {
        height: 32px;
    }

    .nav-item {
        padding: 6px 10px;
        font-size: 0.72rem;
        letter-spacing: -0.02em;
    }

    /* Hide decorative elements on mobile nav to save space if needed */
    /* .nav-links a[data-i18n="nav_roadmap"], .nav-links a[data-i18n="nav_invest"] { display: none; } */

    /* SECTIONS & LAYOUT */
    .section {
        padding: 60px 0;
    }

    .page-header-wrapper {
        padding-top: 80px;
    }

    .asset-row,
    .asset-row.reverse {
        flex-direction: column !important;
        gap: 40px;
        text-align: center;
    }

    .asset-stats {
        justify-content: center;
    }

    .footer-grid {
        gap: 40px;
        text-align: center;
        padding-bottom: 120px;
        /* Safe area for floating nav pill */
    }

    .footer-info {
        align-items: center;
        /* Center logo in footer flex column */
    }

    /* GLOBAL GRIDS & CARDS RESPONSIVE */
    .blog-grid,
    .grid-3,
    .matrix-grid {
        grid-template-columns: 1fr !important;
        /* Force single column on mobile */
        gap: 30px;
    }

    .legal-card,
    .template-card,
    .layer-card,
    .timeline-phase {
        padding: 24px !important;
        /* Standardize mobile padding */
    }

    .page-hero {
        min-height: 300px;
        /* Reduce hero height on mobile */
    }

    /* HERO FRAMES */
    .metrics-grid {
        gap: 20px;
    }

    .metric-card {
        padding: 20px;
        min-width: 45%;
    }

    .metric-val {
        font-size: 2rem !important;
    }
}

/* ===== VERTICAL TIMELINE ===== */
.tl-vertical {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Central Line (Background) */
.tl-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-50%);
    border-radius: 3px;
}

/* Gold Fill (Animated) */
.tl-line-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, var(--gold-mid), var(--gold-premium));
    box-shadow: 0 0 12px rgba(184, 134, 11, 0.5);
    border-radius: 3px;
    transition: height 0.1s linear;
}

/* Each Milestone Node */
.tl-node {
    position: relative;
    width: 50%;
    padding: 20px 40px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.tl-node.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Left side */
.tl-left {
    left: 0;
    text-align: right;
    padding-right: 60px;
}

/* Right side */
.tl-right {
    left: 50%;
    text-align: left;
    padding-left: 60px;
}

/* The Dot on the line */
.tl-dot {
    position: absolute;
    top: 28px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid rgba(255, 255, 255, 0.15);
    z-index: 2;
    transition: all 0.4s ease;
}

.tl-left .tl-dot {
    right: -8px;
}

.tl-right .tl-dot {
    left: -8px;
}

/* Dot States */
.tl-dot.done {
    background: var(--gold-mid);
    border-color: var(--gold-mid);
    box-shadow: 0 0 10px rgba(179, 135, 40, 0.4);
}

.tl-dot.now {
    background: var(--gold-premium);
    border-color: var(--gold-highlight);
    box-shadow: 0 0 20px rgba(184, 134, 11, 0.7);
    width: 20px;
    height: 20px;
    animation: tlPulse 2s infinite;
}

.tl-left .tl-dot.now {
    right: -10px;
}

.tl-right .tl-dot.now {
    left: -10px;
}

@keyframes tlPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(184, 134, 11, 0.6);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(184, 134, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(184, 134, 11, 0);
    }
}

/* Year Label */
.tl-year {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--gold-mid);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

/* Glass Card Container */
.tl-card {
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px 22px;
    transition: all 0.4s ease;
}

.tl-card:hover {
    border-color: rgba(184, 134, 11, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Card Title */
.tl-title {
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

/* Card Subtitle */
.tl-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.4;
}

/* UNIFIED GOLD STYLE for Now & Done */
.tl-card-now,
.tl-card-done {
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--gold-premium);
    /* Uniform Bright Gold Border */
    box-shadow: 0 0 20px rgba(184, 134, 11, 0.25);
    /* Uniform Glow */
}

/* Gold Title for all active cards */
.tl-card-now .tl-title,
.tl-card-done .tl-title {
    color: var(--gold-premium);
    font-weight: 700;
}

/* White Subtitle for all active cards */
.tl-card-now .tl-sub,
.tl-card-done .tl-sub {
    color: #f8fafc;
    /* Bright White/Slate-50 */
    opacity: 1;
    font-weight: 400;
}

/* Hover Effect for both */
.tl-card-now:hover,
.tl-card-done:hover {
    box-shadow: 0 0 30px rgba(184, 134, 11, 0.4);
    transform: translateY(-2px);
}

/* FUTURE Card — Dimmed */
.tl-card-future {
    opacity: 0.45;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.05);
}

.tl-card-future .tl-title {
    color: var(--text-secondary);
}

/* Horizontal connecting arm (Desktop only) */
.tl-left::after,
.tl-right::before {
    content: '';
    position: absolute;
    top: 34px;
    width: 30px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.tl-left::after {
    right: 0;
}

.tl-right::before {
    left: 0;
}

.tl-now.tl-left::after,
.tl-now.tl-right::before {
    background: var(--gold-mid);
    box-shadow: 0 0 6px rgba(184, 134, 11, 0.3);
}

/* ===== MOBILE — PREMIUM ===== */
@media (max-width: 768px) {
    .tl-vertical {
        padding: 20px 0;
    }

    .tl-line {
        left: 20px;
        transform: none;
    }

    .tl-node {
        width: 100%;
        left: 0 !important;
        text-align: left !important;
        padding: 8px 0 8px 55px !important;
    }

    .tl-dot {
        left: 12px !important;
        right: auto !important;
    }

    .tl-dot.now {
        left: 10px !important;
    }

    .tl-left::after,
    .tl-right::before {
        display: none;
    }

    .tl-card {
        padding: 16px 18px;
        border-radius: 12px;
    }

    .tl-title {
        font-size: 0.95rem;
    }

    .tl-sub {
        font-size: 0.78rem;
    }

    .tl-year {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .nav-pill {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-logo {
        order: -1;
        margin-bottom: 5px;
    }

    /* Stack metrics on very small screens */
    .metric-card {
        min-width: 100%;
    }
}


/* --- SCROLLYTELLING HERO STYLES --- */
#hero {
    height: 300vh;
    /* 3 Frames */
    position: relative;
}

.hero-sticky {
    position: relative;
    /* Removed 'sticky' to avoid conflict with GSAP Pinning */
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    z-index: 0;
}

.hero-bg-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    /* Placeholder Gradient */
    background: radial-gradient(circle at center, #1E293B, #020617);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-primary) 90%);
    z-index: 1;
}

.hero-frame {
    position: absolute;
    width: 100%;
    max-width: 900px;
    text-align: center;
    z-index: 2;
    opacity: 0;
    /* JS handles fade in */
    transform: translateY(20px);
    will-change: transform, opacity;
    /* GPU Hint */
}

.hero-frame.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- PLACEHOLDERS --- */

/* --- PREMIUM FLIP CARDS (OFFSET STACK) --- */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
    /* Remove if you want isometric look, keep for 3D */
    height: 400px;
    /* Fixed height for uniformity */
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    /* Smoother, elegant premium flip */
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
}

/* Front: Glassmorphism with Premium Gold Glow */
.flip-card-front {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.85));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Premium Border with Gradient intent */
    border: 1px solid rgba(184, 134, 11, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    z-index: 2;
    /* Soft Premium Shadow & Inner Bezel */
    box-shadow:
        0 10px 30px -10px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 0 20px rgba(184, 134, 11, 0.05);
    transition: all 0.4s ease;
}

.flip-card:hover .flip-card-front {
    border-color: rgba(184, 134, 11, 0.6);
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.6),
        inset 0 0 0 1px rgba(184, 134, 11, 0.2),
        0 0 25px rgba(184, 134, 11, 0.15);
}



/* Back: Premium Image Integration */
.flip-card-back {
    background-color: #020617;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(184, 134, 11, 0.3);
    /* Gold border for consistency */
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.flip-card-back img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.5;
    /* Better blend */
    filter: sepia(20%) contrast(110%) saturate(80%);
    transition: transform 6s ease;
}

.flip-card:hover .flip-card-back img {
    transform: scale(1.1);
    /* Slow zoom effect */
}

/* Decorative Frame inside Back */
.flip-card-back::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 8px;
    z-index: 2;
    pointer-events: none;
    opacity: 0.8;
}

.flip-card-back::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(2, 6, 23, 0.6) 50%, rgba(184, 134, 11, 0.1) 100%);
    z-index: 1;
}

.flip-card-back-content {
    position: relative;
    z-index: 3;
    padding: 30px;
    transform: translateZ(50px);
    /* Parallax text feeling */
    text-align: center;
    width: 100%;
}

.flip-card-front .icon-wrap i {
    text-shadow: 0 0 15px rgba(184, 134, 11, 0.3);
    transition: all 0.3s ease;
}

.flip-card:hover .flip-card-front .icon-wrap i {
    color: var(--gold-highlight);
    text-shadow: 0 0 25px rgba(184, 134, 11, 0.6);
    transform: scale(1.1);
}

.flip-card-back-content h4 {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--text-gold);
    /* Corrected variable */
    margin-bottom: 10px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.flip-card-back-content p {
    font-family: 'Space Grotesk', sans-serif;
    color: #fff;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.img-placeholder {
    width: 100%;
    height: 100%;
    min-height: 240px;
    background: #1E293B;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}

.img-placeholder i {
    font-size: 2rem;
    margin-bottom: 8px;
    color: var(--gold-mid);
}

.img-placeholder span {
    font-size: 0.8rem;
    font-family: 'Space Grotesk', sans-serif;
    opacity: 0.7;
}

/* --- AI WIDGET SLOTS --- */
#ai-chat-widget,
#elevenlabs-voice-widget {
    position: fixed;
    z-index: 9998;
}

#ai-chat-widget {
    bottom: 100px;
    right: 24px;
}

#elevenlabs-voice-widget {
    bottom: 100px;
    left: 24px;
}

/* --- SHARED UTILITIES --- */
.glass-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out), border-color var(--duration-normal);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(184, 134, 11, 0.3);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* --- NON-RESPONSIVE BASE STYLES FOR THESE GRIDS (Moved from Inline) --- */
.matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.template-card {
    padding: 40px;
    display: block;
    text-decoration: none;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.template-card:hover {
    border-color: var(--gold-mid);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gold-mid);
    opacity: 0;
    transition: opacity 0.3s ease;
}


.template-card:hover::before {
    opacity: 1;
}

/* --- ZOOM OVERLAY & LIGHTBOX --- */
.img-container {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.img-container img {
    transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
    transform-origin: center center;
}

.img-container:hover img {
    transform: scale(1.1);
}

.zoom-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.img-container:hover .zoom-overlay {
    opacity: 1;
}

.zoom-overlay i {
    font-size: 3rem;
    color: var(--gold-mid);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.img-container:hover .zoom-overlay i {
    transform: scale(1);
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(184, 134, 11, 0.2);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--text-secondary);
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
    z-index: 100000;
}

.lightbox-close:hover {
    color: var(--gold-mid);
}

.lightbox-caption {
    margin-top: 15px;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}

/* --- TEAM SECTION (PREMIUM GOLD) --- */
#equipo {
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
    padding-bottom: 80px;
}

.team-grid-main {
    max-width: 1000px;
    /* Constrain width for better reading */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Universal Team Card */
.team-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    background: rgba(15, 23, 42, 0.4);
    /* Glass base */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.team-card:hover {
    border-color: var(--gold-premium);
    /* Gold Reveal */
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(184, 134, 11, 0.15);
    /* Gold Glow */
}

/* Image Handling */
.team-img-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.team-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.1);
    /* Artistic B&W */
    transition: all 0.6s ease;
}

.team-card:hover .team-img {
    filter: grayscale(0%) contrast(1);
    /* Color Reveal */
    transform: scale(1.05);
    /* Gentle Zoom */
}

/* Gradient Overlay for Text Readability */
.team-overlay {
    position: absolute;
    inset: 0;
    /* Gradient starts dark at bottom, transparent at top */
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 10%, rgba(15, 23, 42, 0.6) 40%, transparent 100%);
    opacity: 0.9;
    transition: opacity 0.4s;
}

.team-card:hover .team-overlay {
    opacity: 1;
    /* Slightly darker on hover to pop text */
}

/* Text Content */
.team-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    z-index: 2;
}

.team-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold-premium);
    border: 1px solid var(--gold-premium);
    background: rgba(184, 134, 11, 0.1);
    border-radius: 4px;
    margin-bottom: 8px;
}

.team-name {
    color: white;
    font-size: 1.35rem;
    /* Large Name */
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.1;
    font-family: 'Space Grotesk', sans-serif;
}

.team-role {
    color: #94A3B8;
    /* Slate-400 */
    font-size: 0.9rem;
    font-weight: 400;
    font-family: 'Outfit', sans-serif;
}

.team-card:hover .team-role {
    color: #CBD5E1;
    /* Brighter on hover */
}

/* CEO Card Specifics */
.ceo-card .team-img-wrapper {
    height: 380px;
    /* Taller presence */
}

.ceo-card .team-name {
    font-size: 1.8rem;
}

/* Grid Layout for Members */
.team-grid-members {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 cols by default on mobile */
    gap: 16px;
}

@media (min-width: 768px) {
    .team-grid-members {
        grid-template-columns: repeat(3, 1fr);
        /* 3 cols on desktop */
        gap: 24px;
    }

    .ceo-card .team-img-wrapper {
        height: 420px;
    }
}

@media (max-width: 480px) {
    .team-name {
        font-size: 1.1rem;
    }

    .ceo-card .team-name {
        font-size: 1.5rem;
    }

    .team-badge {
        font-size: 0.6rem;
    }
}

/* --- WOW EFFECTS (AUDIT IMPLEMENTATION) --- */

/* B. GRAIN OVERLAY */
.grain-overlay {
    /* DISABLED PER USER FEEDBACK */
    display: none;
    /* 
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    */
}

/* A. SPOTLIGHT EFFECT */
.spotlight-card {
    position: relative;
    overflow: hidden;
    /* Ensure z-index allows overlay */
}

/* FIX: Flip card faces must remain absolute to stack correctly */
.flip-card-front.spotlight-card,
.flip-card-back.spotlight-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.spotlight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 215, 0, 0.1), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 2;
}

.spotlight-card:hover::before {
    opacity: 1;
}

/* C. SCROLL REVEAL */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* C. STAGGERED REVEAL (Children) */
.stagger-children>* {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.stagger-children.visible>*:nth-child(1) {
    transition-delay: 0.1s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible>*:nth-child(2) {
    transition-delay: 0.2s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible>*:nth-child(3) {
    transition-delay: 0.3s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible>*:nth-child(4) {
    transition-delay: 0.4s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible>*:nth-child(5) {
    transition-delay: 0.5s;
    opacity: 1;
    transform: translateY(0);
}

/* E. ICON GLOW */
i[class^="ri-"],
i[class^="fa-"] {
    transition: text-shadow 0.3s ease, transform 0.3s ease;
}

i[class^="ri-"]:hover,
i[class^="fa-"]:hover {
    text-shadow: 0 0 12px currentColor;
    transform: scale(1.1);
}

/* --- NAV RESTRUCTURE UPDATE (V2: CLEAN TEXT + UNDERLINE) --- */

/* 1. Base Item Style */
.nav-item {
    position: relative;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

/* 2. Subtle Underline (Active/Hover) */
.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 4px;
    left: 50%;
    background: var(--gold-premium);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    box-shadow: 0 0 8px rgba(184, 134, 11, 0.6);
    opacity: 0;
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 60%;
    /* Subtle width, not full */
    opacity: 1;
}

/* 3. Text Color for Active */
.nav-item.active {
    color: #fff;
    text-shadow: 0 0 10px rgba(184, 134, 11, 0.3);
}

/* 4. Fix Spacer / Logo Overlap */
.nav-spacer {
    width: 100px;
    /* Force sufficient space for the 80px logo */
    flex-shrink: 0;
}

/* 5. Mobile Optimization (Text Only) */
@media (max-width: 768px) {
    .nav-pill-container {
        bottom: 15px;
        padding-bottom: 20px;
        background: linear-gradient(to top, rgba(2, 6, 23, 0.9) 0%, transparent 100%);
        pointer-events: none;
    }

    .nav-pill {
        width: 95%;
        max-width: 440px;
        justify-content: space-evenly;
        padding: 12px 16px;
        gap: 5px;
        /* Glass Effect */
        background: rgba(15, 23, 42, 0.9);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 40px;
        pointer-events: auto;
        /* CRITICAL FIX: Re-enable clicks */
    }

    .nav-links {
        gap: 8px;
        /* Tighter gap */
        width: auto;
    }

    .nav-item {
        font-size: 0.75rem;
        /* Smaller text to fit "Calculadora" */
        padding: 8px 8px;
        white-space: nowrap;
        letter-spacing: 0.5px;
    }

    /* Show Logo on Mobile (Scaled Down) */
    .nav-logo,
    .nav-spacer {
        display: flex;
    }

    .nav-spacer {
        width: 60px;
    }

    .nav-logo {
        width: 54px;
        height: 54px;
        /* Keep absolute positioning from desktop but scale down */
    }

    .nav-logo img {
        height: 28px;
    }

    /* Hide 'Inicio' text on mobile since it's too small */
    .nav-logo::after {
        display: none;
    }

    /* Adjust Accent Button */
    .btn-nav-accent {
        padding: 8px 14px;
        font-size: 0.75rem;
        background: var(--gold-metallic);
        color: var(--bg-secondary);
        border-radius: 20px;
        /* Remove underline from button */
    }

    .btn-nav-accent::after {
        display: none;
    }
}

/* Add 'Inicio' label below main logo */
.nav-logo::after {
    content: 'Inicio';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.nav-logo:hover::after {
    color: var(--gold-premium);
    text-shadow: 0 0 8px rgba(184, 134, 11, 0.4);
}

/* --- 9. GLOBAL UI ELEMENTS (Progress & BackToTop) --- */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    width: 0%;
    z-index: 99999;
    box-shadow: 0 0 10px rgba(184, 134, 11, 0.5);
    transition: width 0.1s ease-out;
    pointer-events: none;
}

#back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    /* Moved to Left to avoid ElevenLabs Widget */
    width: 45px;
    height: 45px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(184, 134, 11, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #BF953F;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9990;
    /* Below Mobile Nav (9999?) or check nav z-index */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: rgba(184, 134, 11, 0.2);
    box-shadow: 0 0 20px rgba(184, 134, 11, 0.4);
    transform: translateY(-3px);
    color: #FCF6BA;
}

/* Adjust for Mobile to not overlap content too much */
@media (max-width: 768px) {
    #back-to-top {
        bottom: 90px;
        /* Above bottom nav */
        left: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* --- 10. SCROLLYTELLING CANVAS --- */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fallback */
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

#hero-canvas.loaded {
    opacity: 1;
}