/* CSS variables for Light and Dark themes */
:root {
    /* Fonts */
    --font-header: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Light Theme (Default) */
    --color-primary: #1b4332; /* Forest Dark */
    --color-accent: #2d6a4f; /* Green Accent */
    --color-bg: #f8fafc; /* Slate Light */
    --color-surface: #ffffff;
    --color-surface-hover: #f1f5f9;
    --color-text: #1e293b; /* Slate 800 */
    --color-text-muted: #64748b; /* Slate 500 */
    --color-border: #e2e8f0;
    --color-card-shadow: rgba(0, 0, 0, 0.05);
    --color-glass-bg: rgba(255, 255, 255, 0.7);
    --color-glass-border: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] {
    /* Dark Theme */
    --color-primary: #52b788; /* Bright Green */
    --color-accent: #74c69d;
    --color-bg: #0f172a; /* Deep Slate 900 */
    --color-surface: #1e293b; /* Slate 800 */
    --color-surface-hover: #334155; /* Slate 700 */
    --color-text: #f8fafc; /* Slate 50 */
    --color-text-muted: #94a3b8; /* Slate 400 */
    --color-border: #334155;
    --color-card-shadow: rgba(0, 0, 0, 0.3);
    --color-glass-bg: rgba(30, 41, 59, 0.7);
    --color-glass-border: rgba(255, 255, 255, 0.08);
}

/* Global resets and layout styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Accessibility: Keyboard Focus States */
*:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

.section-padding {
    padding: 100px 0;
}

/* Section headers styling */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-family: var(--font-header);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.section-header p {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.header-line {
    width: 60px;
    height: 4px;
    background-color: var(--color-accent);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Buttons style */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff !important;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-border);
    transform: translateY(-2px);
}

/* Navbar layout styling */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-glass-border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-primary);
    text-decoration: none;
}

.nav-logo span {
    color: var(--color-accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text);
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--color-accent);
}

.theme-toggle, .menu-toggle {
    font-size: 1.2rem;
    color: var(--color-text);
    cursor: pointer;
    width: 44px; /* Minimum Touch Target */
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--color-border);
}

.menu-toggle {
    display: none;
}

/* Hero section layout and aesthetics */
.hero {
    min-height: 100vh;
    padding-top: 120px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: center;
}

.hero-content {
    z-index: 10;
    transform: translateY(-60px); /* Subido más */
    padding-bottom: 70px;
}

.hero-tag {
    display: inline-block;
    padding: 6px 16px;
    background-color: rgba(45, 106, 79, 0.1);
    color: var(--color-accent);
    border-radius: 50px;
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.hero h1 {
    font-family: var(--font-header);
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--color-text);
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    margin-bottom: 35px;
    max-width: 550px;
}

.hero-actions {
    display: flex;
    gap: 15px;
}

/* Hero graphic animations & premium look */
/* Hero Profile Stage & Transparent Cutout Styling */
.hero-graphic {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    min-height: 520px;
}

/* Background Watermark Typography */
.hero-watermark-text {
    position: absolute;
    top: 25px;
    left: 20%;
    font-family: var(--font-header);
    font-size: 6.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(45, 106, 79, 0.16);
    user-select: none;
    z-index: 1;
    pointer-events: none;
    white-space: nowrap;
}

[data-theme="dark"] .hero-watermark-text {
    -webkit-text-stroke: 1.5px rgba(82, 183, 136, 0.22);
}

/* Ambient Backlight Glow Spotlight */
.hero-spotlight-glow {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45, 106, 79, 0.22) 0%, rgba(45, 106, 79, 0.06) 50%, rgba(0, 0, 0, 0) 75%);
    filter: blur(30px);
    z-index: 2;
    pointer-events: none;
}

[data-theme="dark"] .hero-spotlight-glow {
    background: radial-gradient(circle, rgba(82, 183, 136, 0.35) 0%, rgba(45, 106, 79, 0.12) 50%, rgba(0, 0, 0, 0) 75%);
    filter: blur(32px);
}

/* Grounding Floor Shadow */
.hero-floor-shadow {
    position: absolute;
    bottom: 95px;
    width: 250px;
    height: 25px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 75%);
    z-index: 2;
    pointer-events: none;
}

[data-theme="dark"] .hero-floor-shadow {
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 75%);
}

/* Frameless Cutout Image Wrapper */
.frameless-portrait-wrapper {
    position: relative;
    z-index: 4;
    width: 350px;
    height: 430px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.cutout-standalone {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.2));
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.hero-img-enlarged {
    transform: scale(1.3);
    transform-origin: bottom center;
}

[data-theme="dark"] .cutout-standalone {
    filter: drop-shadow(0 18px 35px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 25px rgba(82, 183, 136, 0.18));
}

.cutout-standalone.switching {
    opacity: 0.2;
    transform: scale(0.96);
}

/* Floating Text Cards Surrounding Figure */
.floating-text-card {
    position: absolute;
    z-index: 5;
    background: var(--color-glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--color-glass-border);
    padding: 10px 16px;
    border-radius: 16px;
    box-shadow: 0 10px 25px var(--color-card-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 220px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.floating-text-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 14px 30px rgba(45, 106, 79, 0.2);
}

.float-badge-left {
    top: 45px;
    left: -25px;
    animation: float-slow 7s ease-in-out infinite alternate;
}

.float-badge-right {
    top: 95px;
    right: -30px;
    animation: float-slow 8s ease-in-out infinite alternate-reverse;
}

.float-badge-bottom {
    bottom: 140px;
    left: -20px;
    animation: float-slow 6.5s ease-in-out infinite alternate;
}

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

.badge-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(45, 106, 79, 0.12);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

[data-theme="dark"] .badge-icon {
    background: rgba(82, 183, 136, 0.15);
    color: var(--color-primary);
}

.badge-info {
    display: flex;
    flex-direction: column;
}

.badge-info strong {
    font-family: var(--font-header);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.badge-info span {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.frameless-badge {
    position: relative;
    z-index: 6;
    margin-top: -10px;
    margin-bottom: 5px;
}

.frameless-pose-selector {
    position: relative;
    z-index: 6;
}

.portrait-badge {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    padding: 8px 22px;
    border-radius: 50px;
    font-family: var(--font-header);
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.portrait-badge i {
    color: var(--color-accent);
}

/* Pose & Role Selector Bar */
.pose-selector {
    display: flex;
    gap: 8px;
    background: var(--color-glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--color-glass-border);
    padding: 6px 10px;
    border-radius: 50px;
    box-shadow: 0 8px 20px var(--color-card-shadow);
    z-index: 10;
}

.pose-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: 40px;
    cursor: pointer;
    font-family: var(--font-header);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pose-btn:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.pose-btn.active {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(45, 106, 79, 0.4);
}

.pose-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid transparent;
    transition: border-color 0.2s ease;
}

.pose-btn.active .pose-thumb {
    border-color: #ffffff;
}

/* About Section layout */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text p {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    max-width: 65ch;
    line-height: 1.65;
}

.highlights {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.highlight-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.highlight-item i {
    font-size: 1.3rem;
    color: var(--color-accent);
    background-color: rgba(45, 106, 79, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.highlight-item h4 {
    font-family: var(--font-header);
    font-size: 1.05rem;
    margin-bottom: 3px;
}

.highlight-item p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0;
}

/* Skill bars */
.about-skills h3 {
    font-family: var(--font-header);
    font-size: 1.3rem;
    margin-bottom: 25px;
    color: var(--color-primary);
}

.skill-bar {
    margin-bottom: 20px;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

.skill-progress {
    height: 6px;
    background-color: var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--color-accent);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.1, 0.8, 0.3, 1);
}

/* Interactive Timeline styling */
.timeline-container {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 40px;
    margin-top: 40px;
}

.timeline-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    text-align: left;
    padding: 16px 24px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px var(--color-card-shadow);
}

.nav-btn:hover {
    background-color: var(--color-surface-hover);
    transform: translateX(3px);
}

.nav-btn.active {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    font-weight: 600;
}

.timeline-content {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px var(--color-card-shadow);
    min-height: 380px;
}

.contract-card {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.contract-card.active {
    display: block;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h3 {
    font-family: var(--font-header);
    font-size: 1.3rem;
    color: var(--color-primary);
}

.card-date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.card-role {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 15px;
}

.card-body p {
    font-size: 0.95rem;
    margin-bottom: 15px;
    text-align: justify;
    max-width: 65ch;
    line-height: 1.65;
}

.card-body ul {
    list-style: none;
    margin-left: 15px;
}

.card-body ul li {
    font-size: 0.9rem;
    position: relative;
    padding-left: 15px;
    margin-bottom: 8px;
    text-align: justify;
}

.card-body ul li::before {
    content: "▪";
    color: var(--color-accent);
    position: absolute;
    left: 0;
    top: 2px;
}

/* Other experience cards layout */
.other-experience {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.other-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px var(--color-card-shadow);
}

.other-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
}

.other-header h3 {
    font-family: var(--font-header);
    font-size: 1.1rem;
    color: var(--color-primary);
}

.other-header span {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.other-card h4 {
    font-family: var(--font-header);
    font-size: 1rem;
    color: var(--color-accent);
    margin-bottom: 10px;
}

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

/* Education Cards design */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.edu-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 4px 15px var(--color-card-shadow);
    transition: transform 0.25s ease;
}

.edu-card:hover {
    transform: translateY(-4px);
}

.edu-icon {
    font-size: 1.8rem;
    color: var(--color-accent);
    margin-bottom: 20px;
    display: inline-block;
}

.edu-card h3 {
    font-family: var(--font-header);
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.edu-org {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 15px;
}

.edu-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background-color: rgba(45, 106, 79, 0.08);
    color: var(--color-accent);
    border-radius: 50px;
}

/* Certifications ESAP Grid */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.cert-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px var(--color-card-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease;
}

.cert-card:hover {
    transform: translateY(-3px);
}

.cert-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--color-primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-bottom-left-radius: 16px;
    font-family: var(--font-header);
}

.cert-content h3 {
    font-family: var(--font-header);
    font-size: 1.05rem;
    color: var(--color-text);
    margin-bottom: 4px;
    margin-top: 15px;
    padding-right: 60px; /* avoid overlap with badge */
}

.cert-org {
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 12px;
}

.cert-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

.btn-cert {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.btn-cert:hover {
    color: var(--color-accent);
}

/* Achievements Section Styles */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin-top: 30px;
}

.achievement-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--color-card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--color-card-shadow);
}

.achievement-img {
    height: 220px;
    position: relative;
    overflow: hidden;
    background-color: #cbd5e1;
}

.achievement-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.achievement-card:hover .achievement-img img {
    transform: scale(1.05);
}

.achievement-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #ffb703;
    color: #1e293b;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-header);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.achievement-badge.badge-blue {
    background-color: #3a86c8;
    color: #ffffff;
}

.achievement-info {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.achievement-info h3 {
    font-family: var(--font-header);
    font-size: 1.3rem;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.achievement-info h4 {
    font-family: var(--font-header);
    font-size: 1rem;
    color: var(--color-accent);
    margin-bottom: 15px;
    font-weight: 500;
}

.achievement-info p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: justify;
}

.achievement-tags {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.achievement-tags span {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    background-color: rgba(45, 106, 79, 0.08);
    color: var(--color-accent);
    border-radius: 50px;
}

/* Documents / Support Hub layout */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.doc-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px var(--color-card-shadow);
}

.pdf-icon {
    font-size: 2.2rem;
    color: #e63946; /* Red PDF Icon */
}

.doc-info {
    flex-grow: 1;
}

.doc-info h3 {
    font-family: var(--font-header);
    font-size: 1rem;
    margin-bottom: 3px;
}

.doc-info p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.btn-doc {
    width: 44px;
    height: 44px;
    border-radius: 50px;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-doc:hover {
    background-color: var(--color-accent);
    color: #ffffff;
    border-color: var(--color-accent);
}

/* Footer layout */
footer {
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 40px 0;
    margin-top: 50px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-content p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.social-links a:hover {
    color: var(--color-accent);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.08) translate(5px, 5px);
    }
}

@keyframes drift {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-10px, 15px);
    }
}

/* Responsive breakdowns (mobile compatibility) */
@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 40px;
        gap: 30px;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .hero p {
        margin: 0 auto 30px;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-graphic {
        height: 320px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .timeline-container {
        grid-template-columns: 1fr;
    }

    .timeline-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        white-space: nowrap;
    }

    .nav-btn {
        padding: 12px 20px;
    }

    .other-experience {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .navbar .nav-links {
        display: none;
    }

    .navbar .nav-links.is-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--color-surface);
        padding: 20px;
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   Video Pitch & Proyectos Destacados Sections
   ========================================================================== */

/* Video Pitch Section (Cinematic Layout) */
.cinematic-video-container {
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    margin: 40px 0;
    border: 1px solid var(--color-border);
    position: relative;
}

.cinematic-video {
    width: 100%;
    aspect-ratio: 21 / 9; /* Cinematic Ultra-wide Aspect Ratio */
    object-fit: cover;
    display: block;
}

/* Fallback to 16:9 on smaller screens */
@media (max-width: 992px) {
    .cinematic-video {
        aspect-ratio: 16 / 9;
    }
}

.cinematic-features {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.cinematic-features .feature-card {
    height: 100%;
}

.video-features h3 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.feature-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 18px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    background-color: var(--color-surface-hover);
    border-color: var(--color-accent);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: rgba(45, 106, 79, 0.12);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-text h4 {
    font-family: var(--font-header);
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: var(--color-text);
}

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

/* Proyectos Destacados Section */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 22px;
    border-radius: 30px;
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(27, 67, 50, 0.2);
}

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

.project-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px var(--color-card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.project-img {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.06);
}

.project-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(27, 67, 50, 0.85);
    backdrop-filter: blur(6px);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.project-badge.badge-gold {
    background: linear-gradient(135deg, #d4af37, #aa7c11);
    color: #fff;
}

.project-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.project-meta i {
    color: var(--color-accent);
    margin-right: 4px;
}

.project-info h3 {
    font-family: var(--font-header);
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 8px;
    line-height: 1.3;
}

.project-info p {
    font-size: 0.92rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tags span {
    background-color: var(--color-surface-hover);
    color: var(--color-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--color-border);
}

@media (max-width: 992px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   REACT BITS & MODERN UI/UX ENHANCEMENTS
   ========================================================================== */

/* 1. Hero Canvas (Aurora + Particles Hybrid Background) */
.hero {
    position: relative;
    overflow: hidden;
}

.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.75;
}

.hero-container {
    position: relative;
    z-index: 2;
}

/* 2. Shiny & Decrypted Text (React Bits ShinyText + DecryptedText) */
.shiny-title,
.shiny-text {
    background: linear-gradient(120deg, var(--color-primary) 0%, var(--color-accent) 40%, #10b981 60%, var(--color-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shinyShimmer 6s linear infinite;
    display: inline-block;
}

[data-theme="dark"] .shiny-title,
[data-theme="dark"] .shiny-text {
    background: linear-gradient(120deg, #52b788 0%, #38bdf8 35%, #34d399 70%, #a7f3d0 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes shinyShimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.decrypted-text {
    font-family: var(--font-header);
    transition: opacity 0.2s ease;
    cursor: default;
}

.decrypted-char {
    display: inline-block;
    transition: color 0.1s ease, transform 0.15s ease;
}

.encrypted-char {
    color: var(--color-accent);
    opacity: 0.7;
    font-family: monospace;
}

/* 3. Rotating Role Pill (React Bits RotatingText) */
.rotating-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 6px 18px;
    border-radius: 30px;
    box-shadow: 0 4px 15px var(--color-card-shadow);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-primary);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rotating-pill i {
    color: #10b981;
    font-size: 0.95rem;
    animation: spinSparkle 4s linear infinite;
}

@keyframes spinSparkle {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

.rotating-text-val {
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

/* 4. Spotlight Cursor Tracking (React Bits SpotlightCard) */
.card-spotlight {
    position: relative;
    --mouse-x: 50%;
    --mouse-y: 50%;
    --spotlight-color: rgba(16, 185, 129, 0.12);
}

[data-theme="dark"] .card-spotlight {
    --spotlight-color: rgba(56, 189, 248, 0.15);
}

.card-spotlight::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y), var(--spotlight-color), transparent 80%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 3;
}

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

/* 5. 3D Tilt Parallax (React Bits TiltedCard) */
.tilted-card-wrapper {
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}

/* 6. Magic Bento Grid Layout (React Bits MagicBento) */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 30px;
}

.bento-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 10px 30px var(--color-card-shadow);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

.bento-span-2 {
    grid-column: span 2;
}

.bento-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 18px;
}

.bento-card h3 {
    font-family: var(--font-header);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
}

.bento-card p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    line-height: 1.6;
}

.bento-subtags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
}

.bento-subtags span {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--color-surface-hover);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

/* Animated Stat Counter Grid (React Bits CountUp) */
.bento-header-mini {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-counter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    flex-grow: 1;
}

.stat-item {
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: scale(1.03);
}

.stat-number {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

[data-theme="dark"] .stat-number {
    color: #38bdf8;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* Bento Skills List */
.bento-skills-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.bento-skills-list .skill-bar {
    margin-bottom: 0;
}

.glow-cyan {
    background: linear-gradient(90deg, #06b6d4, #3b82f6) !important;
}

/* Stack Pills */
.tech-stack-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tech-pill {
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.tech-pill:hover {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

/* 7. Star & Metallic Shimmer Borders (React Bits StarBorder) */
.star-border-btn,
.star-border-card {
    position: relative;
    isolation: isolate;
}

.star-border-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.6), rgba(56, 189, 248, 0.6), rgba(212, 175, 55, 0.6));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.7;
}

/* Responsive Bento Grid */
@media (max-width: 992px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-span-2 {
        grid-column: span 1;
    }
}

/* ==========================================================================
   THEMATIC PANELS (SPLIT DESIGN)
   ========================================================================== */
.theme-panel {
    display: flex;
    flex-direction: column;
    padding: 80px 5%;
    border-bottom: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
    gap: 60px;
}

.theme-panel-top {
    display: flex;
    align-items: stretch; /* Image and text block will stretch to equal height */
    justify-content: center;
    gap: 60px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.theme-panel:nth-child(even) {
    background-color: var(--color-surface);
}

.theme-panel:nth-child(even) .theme-panel-top {
    flex-direction: row-reverse;
}

.theme-panel-support {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 2;
}
/* Custom Thematic Backgrounds - Animated */
@keyframes animatedBg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#analitica-ia {
    background: linear-gradient(-45deg, #f0f9ff, #e0f2fe, #bae6fd, #7dd3fc);
    background-size: 400% 400%;
    animation: animatedBg 15s ease infinite;
}
[data-theme="dark"] #analitica-ia {
    background: linear-gradient(-45deg, #0f172a, #1e293b, #0284c7, #0369a1);
    background-size: 400% 400%;
    animation: animatedBg 15s ease infinite;
}
#conservacion {
    background: linear-gradient(-45deg, #f0fdf4, #dcfce7, #bbf7d0, #86efac);
    background-size: 400% 400%;
    animation: animatedBg 15s ease infinite;
}
[data-theme="dark"] #conservacion {
    background: linear-gradient(-45deg, #052e16, #14532d, #166534, #15803d);
    background-size: 400% 400%;
    animation: animatedBg 15s ease infinite;
}

#institucional {
    background: linear-gradient(-45deg, #f8fafc, #f1f5f9, #e2e8f0, #cbd5e1);
    background-size: 400% 400%;
    animation: animatedBg 15s ease infinite;
}
[data-theme="dark"] #institucional {
    background: linear-gradient(-45deg, #0f172a, #1e293b, #334155, #475569);
    background-size: 400% 400%;
    animation: animatedBg 15s ease infinite;
}

.theme-panel-content {
    flex: 1;
    max-width: 600px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centers the text vertically inside its stretched block */
    padding-bottom: 80px; /* Bulletproof gap so text NEVER collides with bottom franja */
    padding-top: 40px;
}

.theme-panel-content h2 {
    font-family: var(--font-header);
    font-size: 3rem; /* Títulos más grandes y llamativos */
    margin-bottom: 25px;
    color: var(--color-primary); /* Color sólido para evitar bugs de invisibilidad */
    line-height: 1.2;
    cursor: default;
}

/* When JS activates, the h2 becomes a focus-container */
.theme-panel-content h2.focus-container {
    display: block;
}

/* --- TRUE FOCUS TEXT INTERACTION --- */
.focus-container {
    /* No flex needed, spans are inline-block */
}

.focus-word {
    transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
    display: inline-block;
    color: var(--color-primary);
}

.focus-container:hover .focus-word {
    filter: blur(4px);
    opacity: 0.4;
    transform: scale(0.95);
}

.focus-container .focus-word:hover {
    filter: blur(0px);
    opacity: 1;
    transform: scale(1.05) translateY(-2px);
    color: var(--color-accent); /* Destacar con el color de acento */
    text-shadow: 0 10px 20px rgba(16, 185, 129, 0.4);
}
[data-theme="dark"] .focus-container .focus-word:hover {
    color: #38bdf8;
    text-shadow: 0 10px 20px rgba(56, 189, 248, 0.4);
}

.theme-panel-content p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    line-height: 1.7;
}

.theme-panel-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Ensures image always sits at the absolute bottom */
    position: relative;
    z-index: 2;
    min-height: 450px;
}

.theme-panel-visual img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: bottom center;
    transition: transform 0.3s ease;
}

/* Full-width colored bands (Franjas) to ground the cut-off images */
.theme-panel-top {
    position: relative;
}

.franja-base {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 40px; /* Franja sutil y pequeña */
    z-index: 10;
}

/* Base Canvas for animated particles in panels */
.panel-canvas, .hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Below text and franjas */
    pointer-events: none;
}

.franja-hero {
    background-color: #0b3425; /* Dark solid green from the mockup */
}
[data-theme="dark"] .franja-hero {
    background-color: #061c14;
}

.franja-ia {
    background-color: #0284c7; /* Solid subtle tech blue */
}
[data-theme="dark"] .franja-ia {
    background-color: #0c4a6e;
}

.franja-conservacion {
    background-color: #15803d; /* Solid subtle forest green */
}
[data-theme="dark"] .franja-conservacion {
    background-color: #052e16;
}

.franja-institucional {
    background-color: #475569; /* Solid subtle slate */
}
[data-theme="dark"] .franja-institucional {
    background-color: #0f172a;
}

.theme-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--color-surface-hover);
    color: var(--color-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
    border: 1px solid var(--color-border);
}

[data-theme="dark"] .theme-badge {
    background: rgba(16, 185, 129, 0.1);
}

@media (max-width: 992px) {
    .theme-panel-top,
    .theme-panel:nth-child(even) .theme-panel-top {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
}
