/* Modern Portfolio - Jorge Eithan Treviño Selles */
/* Paleta: Negro/Blanco/Gris + Azul celeste + Morado + Verde caribe */

:root {
    /* Color palette - DARK MODE (default) */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;

    --accent-blue: #38bdf8;
    --accent-purple: #a78bfa;
    --accent-green: #2dd4bf;

    --border-color: rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(255, 255, 255, 0.05);

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', var(--font-body);
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

    /* Spacing */
    --header-height: 80px;
    --section-padding: clamp(4rem, 10vw, 8rem);
    --container-padding: clamp(1.5rem, 5vw, 3rem);
}

/* LIGHT MODE */
body.light {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #0a0a0a;
    --text-secondary: #495057;
    --text-muted: #6c757d;

    --accent-blue: #0284c7;
    --accent-purple: #7c3aed;
    --accent-green: #14b8a6;

    --border-color: rgba(0, 0, 0, 0.1);
    --hover-bg: rgba(0, 0, 0, 0.05);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent-blue);
    color: white;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 8vw, 5.5rem); }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }

p {
    line-height: 1.8;
    color: var(--text-secondary);
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
    color: var(--accent-purple);
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: var(--section-padding) 0;
}

/* Header - Modern fixed navbar */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(10, 10, 10, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1001;
}

.logo:hover {
    transform: scale(1.05);
}

/* Desktop Navigation */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
    margin: 0;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    transition: width 0.3s ease;
}

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

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

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

/* Language Switcher */
.language-switcher {
    position: relative;
}

.language-switcher button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-switcher button:hover {
    border-color: var(--accent-blue);
}

#lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    display: none;
    min-width: 120px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#lang-dropdown a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

#lang-dropdown a:hover {
    background: var(--bg-secondary);
    color: var(--accent-blue);
}

/* Mobile menu - hidden by default */
.mobile-menu {
    display: none;
}

.mobile-menu-toggle {
    display: none;
}

/* Hero Section - Bold Statement */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-height);
    position: relative;
    overflow: hidden;
}

/* Animated gradient background */
#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(167, 139, 250, 0.08) 0%, transparent 50%);
    animation: rotateGradient 20s linear infinite;
    pointer-events: none;
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hero-content {
    text-align: center;
    max-width: 1000px;
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.hero-statement {
    font-size: clamp(3rem, 10vw, 6.5rem);
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg,
        var(--accent-blue) 0%,
        var(--accent-purple) 50%,
        var(--accent-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

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

.hero-name {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.hero-title {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 3rem;
}

/* Buttons */
.btn {
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.4);
}

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

.btn-secondary:hover {
    border-color: var(--accent-blue);
    background: var(--hover-bg);
    transform: translateY(-3px);
}

/* Section Titles */
.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 4rem;
    text-align: center;
    position: relative;
}

.section-title span {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.section-title span::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 2px;
}

/* About Section */
#about {
    background: var(--bg-secondary);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-content p {
    font-size: 1.15rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

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

/* Timeline */
.timeline {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg,
        var(--accent-blue) 0%,
        var(--accent-purple) 50%,
        var(--accent-green) 100%);
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 2px currentColor;
    z-index: 1;
}

.timeline-item:nth-child(1)::before { color: var(--accent-blue); }
.timeline-item:nth-child(2)::before { color: var(--accent-purple); }
.timeline-item:nth-child(3)::before { color: var(--accent-green); }
.timeline-item:nth-child(4)::before { color: var(--accent-blue); }
.timeline-item:nth-child(5)::before { color: var(--accent-purple); }

.timeline-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.timeline-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.timeline-company {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-item ul {
    list-style: none;
    margin-top: 1rem;
}

.timeline-item li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.timeline-item li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: bold;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.tag {
    padding: 0.4rem 1rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-blue);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-2px);
}

/* Theme Toggle */
#theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    border-color: var(--accent-blue);
    transform: scale(1.05);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
}

.footer-content {
    text-align: center;
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.social-links a:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    transform: translateY(-5px);
    background: var(--hover-bg);
}

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

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --header-height: 65px;
        --container-padding: 1.25rem;
    }

    /* Hide desktop navigation */
    .nav-desktop {
        display: none;
    }

    /* Show mobile menu toggle button */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        padding: 0.6rem 0.75rem;
        border-radius: 0.5rem;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 1.3rem;
        z-index: 1001;
    }

    .mobile-menu-toggle:hover {
        border-color: var(--accent-blue);
    }

    /* Mobile menu */
    .mobile-menu {
        display: block;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, padding 0.4s ease;
        z-index: 999;
    }

    .mobile-menu.active {
        max-height: calc(100vh - var(--header-height));
        padding: 1.5rem 0;
        overflow-y: auto;
    }

    .mobile-nav-links {
        list-style: none;
        padding: 0 1.5rem;
        margin: 0 0 2rem 0;
    }

    .mobile-nav-links li {
        margin-bottom: 0.25rem;
    }

    .mobile-nav-links a {
        display: block;
        padding: 0.875rem 1rem;
        color: var(--text-primary);
        font-weight: 500;
        border-radius: 0.5rem;
        transition: all 0.3s ease;
    }

    .mobile-nav-links a:hover {
        background: var(--hover-bg);
        color: var(--accent-blue);
    }

    .mobile-controls {
        padding: 0 1.5rem;
        border-top: 1px solid var(--border-color);
        padding-top: 1.5rem;
    }

    .mobile-lang-switcher {
        margin-bottom: 1.5rem;
    }

    .lang-btn {
        display: inline-block;
        padding: 0.5rem 1rem;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: 0.5rem;
        color: var(--text-primary);
        font-size: 0.875rem;
        transition: all 0.3s ease;
    }

    .lang-btn:hover {
        border-color: var(--accent-blue);
        color: var(--accent-blue);
    }

    .lang-btn.active {
        background: var(--accent-blue);
        border-color: var(--accent-blue);
        color: white;
    }

    .theme-toggle-mobile {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        padding: 0.875rem 1rem;
        border-radius: 0.5rem;
        cursor: pointer;
        font-size: 0.95rem;
        transition: all 0.3s ease;
    }

    .theme-toggle-mobile:hover {
        border-color: var(--accent-blue);
    }

    .theme-icon-mobile {
        font-size: 1.2rem;
    }

    /* Fix navbar padding */
    header nav {
        padding: 0 1.25rem;
    }

    /* Hero mobile optimizations */
    .hero-statement {
        font-size: 2.5rem !important;
        line-height: 1.1;
    }

    .hero-name {
        font-size: 1.1rem !important;
    }

    .hero-title {
        font-size: 1rem !important;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Section optimizations */
    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 2rem !important;
    }

    /* Timeline mobile */
    .timeline::before {
        left: 8px;
    }

    .timeline-item {
        padding-left: 2.5rem;
    }

    .timeline-item::before {
        left: 0;
        top: 0;
    }

    .timeline-date {
        font-size: 0.8rem;
    }

    .timeline-title {
        font-size: 1.1rem !important;
    }

    /* Tags mobile */
    .tags {
        gap: 0.4rem;
    }

    .tag {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* Container mobile */
    .container {
        padding: 0 1.25rem;
        max-width: 100%;
    }

    /* Projects grid mobile - FIX OVERFLOW */
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        width: 100% !important;
    }

    .project-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .project-card * {
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    /* About content mobile */
    .about-content p {
        font-size: 1rem;
        line-height: 1.7;
    }

    /* Fix any potential overflow */
    * {
        max-width: 100%;
    }

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}
