/* ==================== VARIABLES & RESET ==================== */
:root {
    --primary-dark: #1e3c72;
    --primary-medium: #2a5298;
    --primary-light: #0d47a1;
    --accent-yellow: #f59e0b;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --bg-light: #f5f7fa;
    --bg-lighter: #e8eef7;
    --border-color: #e0e0e0;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
    overflow-x: hidden;
}

/* ==================== NAVIGATION ==================== */
header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 50%, var(--primary-light) 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.logo:hover {
    color: var(--accent-yellow);
    transition: color 0.3s ease;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

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

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

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

.nav-links a.active {
    color: var(--accent-yellow);
    border-bottom: 2px solid var(--accent-yellow);
    padding-bottom: 3px;
}

/* ==================== MAIN CONTAINER ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}

main {
    min-height: calc(100vh - 100px);
    padding: 3rem 0;
}

/* ==================== HERO SECTION ==================== */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 50%, var(--primary-light) 85%, var(--accent-yellow) 100%);
    color: var(--text-light);
    padding: 4rem 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,64 Q150,0 300,64 T600,64 T900,64 T1200,64 L1200,120 L0,120 Z" fill="rgba(255,255,255,0.05)"/></svg>');
    background-repeat: no-repeat;
    background-size: cover;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    word-wrap: break-word;
}

.hero .subtitle {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    opacity: 0.95;
    word-wrap: break-word;
}

.hero p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
    opacity: 0.9;
    max-width: 700px;
    word-wrap: break-word;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--accent-yellow);
    color: var(--text-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

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

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

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ==================== SECTIONS ==================== */
section {
    background: var(--bg-lighter);
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    word-wrap: break-word;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    opacity: 0.8;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-yellow) 0%, var(--primary-medium) 100%);
    margin-top: 1rem;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--text-light);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid var(--accent-yellow);
    word-wrap: break-word;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-5px);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.card-subtitle {
    font-size: 0.95rem;
    color: var(--primary-medium);
    font-style: italic;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.card-date {
    font-size: 0.85rem;
    color: var(--text-dark);
    opacity: 0.7;
    margin-bottom: 1rem;
}

.card-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-dark);
    word-wrap: break-word;
}

.card-description ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.card-description li {
    margin-bottom: 0.5rem;
}

/* ==================== GRID LAYOUTS ==================== */
.grid {
    display: grid;
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
}

/* ==================== SKILL BADGES ==================== */
.skill-item {
    background: var(--text-light);
    color: var(--primary-dark);
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    border: 2px solid var(--accent-yellow);
    transition: all 0.3s ease;
}

.skill-item:hover {
    background: var(--accent-yellow);
    color: var(--text-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.2);
}

/* ==================== TIMELINE ==================== */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent-yellow) 0%, var(--primary-medium) 100%);
}

.timeline-item {
    margin-left: 100px;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -80px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-yellow);
    border: 4px solid var(--bg-lighter);
    box-shadow: 0 0 0 4px var(--primary-dark);
}

.timeline-item .card {
    border-left: 4px solid var(--accent-yellow);
}

/* ==================== FOOTER ==================== */
footer {
    background: var(--primary-dark);
    color: var(--text-light);
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
    width: 100%;
    box-sizing: border-box;
}

footer p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
    word-wrap: break-word;
}

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

.footer-links a {
    color: var(--accent-yellow);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--text-light);
}

/* ==================== RESPONSIVE ==================== */

/* Tablets - 768px and below */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    nav {
        padding: 1rem 1.5rem;
        flex-wrap: wrap;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 0.8rem;
        font-size: 0.85rem;
        flex: 1 1 100%;
        order: 3;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        padding: 3rem 1.5rem;
        margin-bottom: 2rem;
    }

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

    .hero .subtitle {
        font-size: 1.2rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

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

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

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

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }

    section {
        padding: 2.5rem 1.5rem;
        margin-bottom: 2rem;
    }

    .card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .timeline {
        padding: 1.5rem 0;
    }

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

    .timeline-item {
        margin-left: 70px;
    }

    .timeline-item::before {
        left: -58px;
    }

    .footer-links {
        gap: 1.5rem;
    }
}

/* Mobile - 640px and below */
@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }

    nav {
        padding: 0.8rem 1rem;
        gap: 0.5rem;
    }

    .logo {
        font-size: 1rem;
        gap: 5px;
    }

    .nav-links {
        gap: 0.5rem;
        font-size: 0.75rem;
    }

    .nav-links a {
        padding: 0.4rem 0.6rem;
    }

    .hero {
        padding: 2.5rem 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
        margin-bottom: 0.3rem;
    }

    .hero .subtitle {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        line-height: 1.6;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-title::after {
        width: 60px;
    }

    .grid-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .btn {
        padding: 0.75rem 1.2rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    section {
        padding: 2rem 1rem;
        margin-bottom: 1.5rem;
    }

    .card {
        padding: 1.2rem;
        border-radius: 6px;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-description {
        font-size: 0.9rem;
    }

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

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

    .timeline-item::before {
        width: 16px;
        height: 16px;
        left: -40px;
        top: 8px;
    }

    .skill-item {
        padding: 0.8rem;
        font-size: 0.85rem;
    }

    .footer-links {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .footer-links a {
        font-size: 0.9rem;
    }

    main {
        padding: 2rem 0;
    }
}

/* Small Mobile - 480px and below */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    nav {
        padding: 0.75rem 0.75rem;
        flex-direction: column;
        align-items: stretch;
    }

    .logo {
        font-size: 0.9rem;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .nav-links {
        gap: 0.4rem;
        font-size: 0.7rem;
        justify-content: center;
    }

    .nav-links a {
        padding: 0.3rem 0.5rem;
    }

    .hero {
        padding: 2rem 0.75rem;
    }

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

    .hero .subtitle {
        font-size: 0.95rem;
    }

    .hero p {
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 1.3rem;
        margin-bottom: 0.4rem;
    }

    .section-title::after {
        width: 50px;
        height: 2px;
        margin-top: 0.8rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .grid-3 {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .grid-4 {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .btn {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
        min-height: 40px;
    }

    .btn-primary:hover {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }

    section {
        padding: 1.5rem 0.75rem;
        margin-bottom: 1rem;
    }

    .card {
        padding: 1rem;
        border-left: 3px solid var(--accent-yellow);
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .card-subtitle {
        font-size: 0.85rem;
    }

    .card-date {
        font-size: 0.75rem;
        margin-bottom: 0.8rem;
    }

    .card-description {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .timeline {
        padding: 1rem 0;
    }

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

    .timeline-item {
        margin-left: 40px;
        margin-bottom: 1.5rem;
    }

    .timeline-item::before {
        width: 14px;
        height: 14px;
        left: -32px;
        border-width: 3px;
    }

    .skill-item {
        padding: 0.7rem;
        font-size: 0.8rem;
    }

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

    footer {
        padding: 1.5rem 0.75rem;
    }

    .footer-links {
        gap: 0.8rem;
        margin: 1rem 0;
    }

    .footer-links a {
        font-size: 0.85rem;
    }

    main {
        padding: 1.5rem 0;
    }

    ul {
        margin-left: 1rem;
    }
}

/* Extra Small - 360px and below (para dispositivos muy pequeños) */
@media (max-width: 360px) {
    .logo span:last-child {
        display: none;
    }

    .nav-links {
        font-size: 0.65rem;
        gap: 0.3rem;
    }

    .nav-links a {
        padding: 0.2rem 0.4rem;
    }

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

    .hero .subtitle {
        font-size: 0.9rem;
    }

    .hero p {
        font-size: 0.8rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }

    .card {
        padding: 0.8rem;
    }

    section {
        padding: 1.2rem 0.5rem;
    }
}

/* ==================== UTILITIES ==================== */
.text-center {
    text-align: center;
}

.text-accent {
    color: var(--accent-yellow);
}

.text-primary {
    color: var(--primary-dark);
}

.mt-3 {
    margin-top: 3rem;
}

.mb-3 {
    margin-bottom: 3rem;
}

.py-3 {
    padding: 3rem 0;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

/* ==================== SPECIAL SECTIONS ==================== */
.highlight-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(42, 82, 152, 0.1) 100%);
    border-left: 4px solid var(--accent-yellow);
    padding: 1.5rem;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.quote {
    font-style: italic;
    color: var(--primary-dark);
    border-left: 4px solid var(--accent-yellow);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
}

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