/* ========================================
   SaucedoCode — Portafolio v2.0
   Glassmorphism Futurista · Cosmos Tech
   ======================================== */

/* ========================================
   Variables y Reset
   ======================================== */
:root {
    /* Paleta de marca */
    --color-primary: #5B6EF5;
    --color-secondary: #A855F7;
    --color-accent: #22D3EE;
    --color-gold: #FFC24B;
    --color-green: #4ADE80;
    --color-red: #F87171;

    --grad: linear-gradient(120deg, #5B6EF5, #A855F7 55%, #22D3EE);

    /* Fondos y superficies (oscuro) */
    --bg: #0A0C16;
    --surface: rgba(20, 26, 43, 0.55);
    --surface-strong: rgba(20, 26, 43, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    --text: #EDEFF7;
    --text-muted: #9BA1B8;

    --glow-primary: rgba(91, 110, 245, 0.25);
    --glow-secondary: rgba(168, 85, 247, 0.2);

    --radius: 20px;
    --radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 24px 70px rgba(0, 0, 0, 0.5), 0 0 40px var(--glow-primary);

    --font-display: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

/* Modo claro */
[data-theme="light"] {
    --bg: #F6F7FB;
    --surface: rgba(255, 255, 255, 0.65);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(75, 91, 224, 0.14);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --text: #101321;
    --text-muted: #5A6072;
    --glow-primary: rgba(75, 91, 224, 0.18);
    --glow-secondary: rgba(124, 58, 237, 0.14);
    --shadow: 0 20px 60px rgba(16, 19, 33, 0.12);
    --shadow-hover: 0 24px 70px rgba(16, 19, 33, 0.18), 0 0 40px var(--glow-primary);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

input,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

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

::selection {
    background: rgba(91, 110, 245, 0.4);
    color: #fff;
}

.mono {
    font-family: var(--font-mono);
}

/* ========================================
   Fondo: Canvas 3D + Aurora
   ======================================== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.aurora-blob {
    position: absolute;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    filter: blur(130px);
    opacity: 0.35;
    transition: background 0.4s ease;
}

.blob-1 { background: #3B47C0; top: -180px; left: -120px; }
.blob-2 { background: #6D28D9; top: 25%; right: -160px; }
.blob-3 { background: #0E7490; bottom: -200px; left: 30%; opacity: 0.22; }

[data-theme="light"] .aurora-blob { opacity: 0.18; }
[data-theme="light"] .blob-1 { background: #8B9BF8; }
[data-theme="light"] .blob-2 { background: #C4A5F5; }
[data-theme="light"] .blob-3 { background: #9BE8FB; }

/* ========================================
   Utilidades Glass
   ======================================== */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-highlight), var(--shadow);
}

.glass-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-green);
    box-shadow: 0 0 10px var(--color-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    50% { opacity: 0.4; }
}

/* ========================================
   Navegación
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.4rem 0;
    background: rgba(10, 12, 22, 0.55);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 0.9rem 0;
    background: rgba(10, 12, 22, 0.8);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
}

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

.logo {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo-dot {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.7rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--grad);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switch {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 3px;
    backdrop-filter: blur(10px);
}

.lang-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn.active {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 4px 12px var(--glow-primary);
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: scale(1.1) rotate(20deg);
}

.theme-toggle:active {
    transform: scale(0.95) rotate(20deg);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text);
    transition: var(--transition);
    border-radius: 3px;
}

/* ========================================
   Hero
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0 2rem;
}

.hero-content {
    max-width: 900px;
    width: 100%;
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.greeting {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.subtitle {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin: 1.8rem auto 0;
    max-width: 640px;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
}

.hero-buttons {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2.2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1s forwards;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-top: 3.2rem;
    padding: 1.6rem 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1.2s forwards;
}

.hs-item {
    text-align: center;
}

.hs-num {
    display: block;
    font-size: 1.9rem;
    font-weight: 700;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.hs-lbl {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Botones */
.btn {
    padding: 0.95rem 1.9rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--grad);
    color: white;
    box-shadow: 0 10px 30px var(--glow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px var(--glow-secondary);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--glass-border);
    backdrop-filter: blur(10px);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--glass-border);
}

.btn-ghost:hover {
    border-color: var(--color-primary);
    background: rgba(91, 110, 245, 0.1);
}

.btn-sm {
    padding: 0.6rem 1.3rem;
    font-size: 0.9rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    animation: fadeIn 1s ease-out 1.4s forwards;
    opacity: 0;
}

.mouse {
    width: 25px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.wheel {
    width: 3px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

/* ========================================
   Secciones Generales
   ======================================== */
.section {
    padding: 6rem 2rem;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    position: relative;
}

.section-title span {
    background: linear-gradient(120deg, var(--text), var(--color-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .section-title span {
    background: linear-gradient(120deg, #101321, #4B5BE0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    margin: 1.2rem auto 0;
    background: var(--grad);
    border-radius: 2px;
}

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

/* ========================================
   Sobre Mí
   ======================================== */
.sobre-mi-content {
    max-width: 800px;
    margin: 0 auto;
}

.sobre-mi-text .lead {
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.sobre-mi-text p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.08rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-6px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   Código (Editor + Preview en vivo)
   ======================================== */
.code-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
    align-items: stretch;
    max-width: 1000px;
    margin: 0 auto;
}

.code-window {
    border-radius: calc(var(--radius) + 2px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.code-window.done .code-line,
.code-window.done .code-num {
    opacity: 1;
    transform: translateY(0);
}

.code-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.4rem;
    border-bottom: 1px solid var(--glass-border);
    background: var(--surface-strong);
}

.code-dots {
    display: flex;
    gap: 0.5rem;
}

.code-dots i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
}

.code-dots i:nth-child(1) { background: #F87171; }
.code-dots i:nth-child(2) { background: #FBBF24; }
.code-dots i:nth-child(3) { background: #4ADE80; }

.code-file {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.code-lang {
    margin-left: auto;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-accent);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    padding: 0.2rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
}

.code-body {
    flex: 1;
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 0.5rem;
    padding: 1.3rem 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    line-height: 1.7;
}

.code-line-nums {
    text-align: right;
    color: var(--text-muted);
    opacity: 0.55;
    user-select: none;
}

.code-content {
    overflow-x: auto;
}

.code-line {
    white-space: pre;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.code-num {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.code-line.visible,
.code-num.visible {
    opacity: 1;
    transform: translateY(0);
}

.code-line.typing::after {
    content: '▍';
    color: var(--color-accent);
    animation: blink 1s steps(1) infinite;
}

.code-line.typed {
    opacity: 1;
    transform: translateY(0);
}

.tok-comment { color: var(--text-muted); opacity: 0.75; font-style: italic; }
.tok-string { color: var(--color-accent); }
.tok-keyword { color: var(--color-secondary); }
.tok-fn { color: var(--color-primary); }
.tok-num { color: var(--color-gold); }

/* Panel de preview (lo que se está construyendo) */
.code-preview {
    border-radius: calc(var(--radius) + 2px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.prev-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.4rem;
    border-bottom: 1px solid var(--glass-border);
    background: var(--surface-strong);
}

.prev-dots i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
    background: var(--color-accent);
    box-shadow: 0 0 10px var(--glow-primary);
}

.prev-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.prev-badge {
    margin-left: auto;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-accent);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    padding: 0.2rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
}

.prev-body {
    flex: 1;
    padding: 2rem 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.6rem;
    min-height: 320px;
}

.prev-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.prev-name::before {
    content: '📦 ';
    font-size: 1rem;
}

.prev-name.visible {
    opacity: 1;
    transform: translateY(0);
}

.prev-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.prev-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.prev-status-dot.concept { background: var(--color-accent); }
.prev-status-dot.build { background: var(--color-gold); animation: pulse 1.2s infinite; }
.prev-status-dot.prod { background: var(--color-primary); box-shadow: 0 0 12px var(--glow-primary); }
.prev-status-dot.launch { background: var(--color-green); box-shadow: 0 0 12px var(--color-green); }

.prev-status-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.prev-bar {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-strong);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.prev-bar-fill {
    height: 100%;
    width: 0;
    background: var(--grad);
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.prev-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    min-height: 34px;
}

.prev-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text);
    opacity: 0;
    transform: translateY(6px) scale(0.9);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.prev-chip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.prev-chip i {
    color: var(--color-green);
}

.prev-launch {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.prev-launch.visible {
    opacity: 1;
    transform: translateY(0);
}

.prev-launch-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--grad);
    box-shadow: 0 0 30px var(--glow-primary);
    animation: float 3s ease-in-out infinite;
}

.prev-launch span:last-child {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
}

@keyframes blink {
    50% { opacity: 0; }
}

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

/* ========================================
   Productos
   ======================================== */
.productos {
    padding-top: 8rem;
}

.product-card {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    margin-bottom: 3rem;
    transition: var(--transition);
}

.product-card:hover {
    border-color: rgba(91, 110, 245, 0.4);
    box-shadow: var(--shadow-hover);
}

.product-card-reverse .product-media {
    order: 2;
}

.product-media {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    background: linear-gradient(135deg, #141A2B, #1C2236);
}

.product-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: opacity 0.5s ease, transform 0.4s ease;
}

.product-img-second {
    opacity: 0;
    transform: scale(1.05);
}

.product-card:hover .product-img {
    transform: scale(1.03);
}

.product-card:hover .product-img-first {
    opacity: 0;
}

.product-card:hover .product-img-second {
    opacity: 1;
    transform: scale(1);
}

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 3;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: var(--grad);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.product-body {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

.product-kicker {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.product-body h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.product-desc {
    color: var(--text-muted);
    font-size: 1.02rem;
    line-height: 1.8;
    margin-bottom: 1.4rem;
}

.product-feats {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.6rem;
}

.product-feats li {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.product-feats i {
    color: var(--color-green);
    font-size: 0.85rem;
}

.product-tags {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.product-tags span {
    padding: 0.4rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.product-actions {
    margin-top: auto;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* ========================================
   Experiencia (Timeline)
   ======================================== */
.timeline {
    max-width: 820px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--grad);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 2.5rem;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--grad);
    border: 3px solid var(--bg);
    box-shadow: 0 0 20px var(--glow-primary);
}

.timeline-content {
    padding: 2rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateX(10px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-hover);
}

.timeline-date {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--grad);
    color: white;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-content h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: -0.01em;
    margin-bottom: 0.4rem;
}

.company {
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-content p:last-child {
    color: var(--text-muted);
    line-height: 1.8;
}

/* ========================================
   Habilidades
   ======================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.8rem;
}

.skill-card {
    padding: 2.4rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-hover);
}

.skill-icon {
    font-size: 2.8rem;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.4rem;
}

.skill-card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
}

.skill-card ul {
    list-style: none;
}

.skill-card li {
    color: var(--text-muted);
    padding: 0.45rem 0;
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.95rem;
}

.skill-card li::before {
    content: '▹';
    position: absolute;
    left: 0;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========================================
   Proyectos (Carrusel)
   ======================================== */
.projects-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 1rem 5rem 0;
}

.projects-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.projects-carousel {
    display: flex;
    gap: 2rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    align-items: stretch;
}

.project-card {
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-width: calc((100% - 4rem) / 3);
    max-width: calc((100% - 4rem) / 3);
    flex-shrink: 0;
    box-sizing: border-box;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-hover);
}

.project-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.project-image {
    height: 220px;
    min-height: 220px;
    background: linear-gradient(135deg, var(--g1, #5B6EF5), var(--g2, #22D3EE));
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
}

.project-image i {
    font-size: 3.5rem;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.3));
    transition: transform 0.4s ease;
}

.project-card:hover .project-image i {
    transform: scale(1.15) rotate(-6deg);
}

.project-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 40%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.15) 0%, transparent 45%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-image::before {
    opacity: 1;
}

.project-content {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex-grow: 1;
}

.project-content h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
}

.project-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.6rem;
}

.project-tags span {
    padding: 0.35rem 0.8rem;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: 999px;
    font-size: 0.78rem;
    font-family: var(--font-mono);
}

.carousel-btn {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: var(--grad);
    border-color: transparent;
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 24px var(--glow-primary);
}

.carousel-prev { left: 0.8rem; }
.carousel-next { right: 0.8rem; }

.carousel-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    width: 100%;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
}

.carousel-dot:hover {
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--grad);
    border-color: transparent;
    width: 32px;
    border-radius: 6px;
}

/* ========================================
   Contacto
   ======================================== */
.contact-lead {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    line-height: 1.8;
}

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

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.3rem;
    padding: 1.7rem;
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-hover);
}

.contact-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: var(--grad);
    color: white;
    flex-shrink: 0;
}

.contact-icon.whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.contact-icon.telegram {
    background: linear-gradient(135deg, #2aabee, #229ed9);
}

.contact-icon.linkedin {
    background: linear-gradient(135deg, #0077b5, #00a0dc);
}

.contact-icon.github {
    background: linear-gradient(135deg, #333, #111);
}

.contact-details h4 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.contact-details p {
    color: var(--text-muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 2.5rem 2rem;
    border-top: 1px solid var(--glass-border);
    background: var(--surface);
    backdrop-filter: blur(20px);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

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

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 1.2rem;
}

.social-links a:hover {
    background: var(--grad);
    border-color: transparent;
    color: white;
    transform: translateY(-3px);
}

/* ========================================
   Animaciones
   ======================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scroll {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(10px); opacity: 0; }
}

[data-scroll] {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-scroll].in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Notificaciones Toast
   ======================================== */
#toast-container {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: var(--surface-strong);
    backdrop-filter: blur(20px);
    color: var(--text);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 280px;
    pointer-events: all;
    transform: translateX(400px);
    animation: slideIn 0.3s ease forwards, slideOut 0.3s ease 2.7s forwards;
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast-content { flex: 1; }

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.toast-message {
    font-size: 0.875rem;
    opacity: 0.8;
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(400px); opacity: 0; }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .projects-carousel-wrapper {
        padding: 1rem 4rem 0;
    }
    .project-card {
        min-width: calc((100% - 2rem) / 2);
        max-width: calc((100% - 2rem) / 2);
    }
    .carousel-prev { left: 0.5rem; }
    .carousel-next { right: 0.5rem; }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 72px;
        flex-direction: column;
        background: var(--surface-strong);
        backdrop-filter: blur(20px);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        padding: 2rem 0;
        border-bottom: 1px solid var(--glass-border);
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }

    .section {
        padding: 4rem 1.5rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .skills-grid,
    .contact-methods {
        grid-template-columns: 1fr;
    }

    .product-card,
    .product-card-reverse {
        grid-template-columns: 1fr;
    }

    .product-card-reverse .product-media {
        order: 0;
    }

    .product-media {
        min-height: 240px;
    }

    .product-body {
        padding: 2rem 1.5rem;
    }

    .code-grid {
        grid-template-columns: 1fr;
    }

    .code-body {
        grid-template-columns: 40px 1fr;
        font-size: 0.78rem;
        padding: 1rem 0.8rem;
    }

    .code-topbar {
        padding: 0.7rem 1rem;
    }

    .code-lang {
        display: none;
    }

    .prev-body {
        padding: 1.6rem 1.3rem;
        min-height: 240px;
    }

    .projects-carousel-wrapper {
        padding: 1rem 3.5rem 0;
    }

    .project-card {
        min-width: calc(100% - 2rem);
        max-width: calc(100% - 2rem);
    }

    .carousel-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .carousel-prev { left: 0.2rem; }
    .carousel-next { right: 0.2rem; }

    .timeline::before {
        left: 10px;
    }

    .timeline-item {
        padding-left: 50px;
    }

    .timeline-dot {
        left: 1px;
    }

    .hero-stats {
        gap: 2rem;
        padding: 1.4rem 1rem;
    }

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

    #toast-container {
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   Accesibilidad
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --text: #ffffff;
        --text-muted: #d0d4e6;
        --glass-border: rgba(255, 255, 255, 0.35);
    }
}
