html {
    scroll-behavior: smooth;
}

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

:root {
    --bg-dark: #0f172a;
    --bg-dark-secondary: #1e293b;
    --bg-light: #f9fafb;
    --bg-light-secondary: #ffffff;
    --text-dark: #f1f5f9;
    --text-light: #1f2937;
    --accent-cyan: #22d3ee;
    --accent-emerald: #34d399;
    --border-dark: #334155;
    --border-light: #e5e7eb;
    --profile-border: linear-gradient(135deg, var(--accent-cyan), var(--accent-emerald));
    --profile-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-dark);
    transition: all 0.3s ease;
    overflow-x: hidden;
}

body.light-mode {
    background-color: #f1f5f9;
    color: #334155;
    --bg-light-secondary: #ffffff;
    --border-light: #e2e8f0;
    --profile-border: linear-gradient(135deg, #cbd5e1, #94a3b8);
    --profile-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background-color: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid var(--border-dark);
    padding: 1rem 2rem;
}

body.light-mode nav {
    background-color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

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

.nav-logo {
    font-family: 'Courier New', monospace;
    color: var(--accent-cyan);
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-logo:hover {
    text-shadow: 0 0 8px var(--accent-cyan);
}

body.light-mode .nav-logo {
    color: #0891b2;
}

.theme-toggle {
    background: var(--bg-dark-secondary);
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

body.light-mode .theme-toggle {
    background: white;
    color: #334155;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.theme-toggle:hover {
    transform: scale(1.05);
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.hero {
    padding: 8rem 2rem 5rem;
    background: linear-gradient(to bottom, #0f172a, #1e293b, #0f172a);
    text-align: left;
}

body.light-mode .hero {
    background: transparent;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.profile-wrapper {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
    position: relative;
    border-radius: 50%;
    padding: 4px;
    background: var(--profile-border);
    box-shadow: var(--profile-shadow);
    transition: all 0.5s ease;
}

.profile-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    padding: 10px;
    border: 4px solid var(--bg-dark);
    background-color: var(--bg-dark);
    object-position: center center;
}

body.light-mode .profile-wrapper img {
    border-color: #f1f5f9;
    background-color: #f1f5f9;
}

.hero-welcome {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #94a3b8;
}

.hero-welcome span:first-child {
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: bold;
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

body.light-mode .hero h1 {
    background: linear-gradient(to right, #0891b2, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h2 {
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: #cbd5e1;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

body.light-mode .hero h2 {
    color: #475569;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #94a3b8;
    margin-bottom: 2rem;
    max-width: 800px;
}

body.light-mode .hero p {
    color: #64748b;
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn span {
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.btn-primary {
    background: var(--accent-cyan);
    color: #0f172a;
}

body.light-mode .btn-primary {
    background: #0891b2;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(8, 145, 178, 0.3);
}

.btn-primary:hover {
    background: #06b6d4;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-dark-secondary);
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
}

body.light-mode .btn-secondary {
    background: white;
    color: #334155;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
    background: #334155;
    transform: translateY(-2px);
}

body.light-mode .btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
}

.icon-lg {
    font-size: 3rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    transform: translateY(-2px);
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

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

body.light-mode .timeline::before {
    background: var(--border-light);
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -0.55rem;
    top: 0;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--accent-cyan);
    border: 4px solid var(--bg-dark);
}

body.light-mode .timeline-item::before {
    border-color: #f1f5f9;
    background: #0891b2;
}

.timeline-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-dark);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

body.light-mode .timeline-card {
    background: white;
    border: 1px solid transparent;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.timeline-card:hover {
    transform: translateX(5px);
    border-color: var(--accent-cyan);
}

body.light-mode .timeline-card:hover {
    transform: translateY(-3px) translateX(0);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.timeline-period {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

body.light-mode .timeline-period {
    color: #0891b2;
    font-weight: bold;
}

.timeline-role {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.timeline-company {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

body.light-mode .timeline-company {
    color: #64748b;
}

.timeline-description {
    color: #cbd5e1;
}

body.light-mode .timeline-description {
    color: #475569;
}

.formation-grid, .skills-grid, .projects-grid {
    display: grid;
    gap: 1.5rem;
}

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

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

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

.formation-card, .skill-category, .project-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-dark);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

body.light-mode .formation-card,
body.light-mode .skill-category,
body.light-mode .project-card {
    background: white;
    border: 1px solid transparent;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.formation-card:hover, .project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
}

body.light-mode .formation-card:hover,
body.light-mode .project-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.skill-category h3 {
    color: var(--accent-cyan);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

body.light-mode .skill-category h3 {
    color: #0891b2;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: #334155;
    color: #cbd5e1;
    padding: 0.4rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

body.light-mode .skill-tag {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: bold;
}

.project-date {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}

body.light-mode .project-date {
    color: #0891b2;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.project-tag {
    background: rgba(52, 211, 153, 0.2);
    color: var(--accent-emerald);
    padding: 0.3rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

body.light-mode .project-tag {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-dark);
    background: var(--bg-dark);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #94a3b8;
}

body.light-mode footer {
    background: #f1f5f9;
    border-top: 1px solid var(--border-light);
    color: #64748b;
}

section:nth-child(even) {
    background: rgba(30, 41, 59, 0.3);
}

body.light-mode section:nth-child(even) {
    background: transparent;
}

.terminal-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.terminal-window {
    width: 80%;
    max-width: 800px;
    height: 500px;
    background-color: #0f172a;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid #334155;
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    animation: openTerminal 0.3s ease-out;
}

@keyframes openTerminal {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.terminal-header {
    background-color: #1e293b;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #334155;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
    margin-right: 15px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.close-btn { background-color: #ef4444; cursor: pointer; }
.minimize-btn { background-color: #f59e0b; }
.maximize-btn { background-color: #10b981; }

.terminal-title {
    color: #94a3b8;
    font-size: 0.9rem;
    flex-grow: 1;
    text-align: center;
    margin-right: 50px;
}

.terminal-body {
    flex-grow: 1;
    padding: 15px;
    color: #10b981;
    overflow-y: auto;
    font-size: 1rem;
}

.terminal-output div {
    margin-bottom: 5px;
}

.input-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: #22d3ee;
    margin-right: 10px;
    white-space: nowrap;
}

#terminalInput {
    background: transparent;
    border: none;
    color: #10b981;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    flex-grow: 1;
    outline: none;
}

.blog-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-dark);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

body.light-mode .blog-card {
    background: white;
    border: 1px solid transparent;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
}

body.light-mode .blog-card:hover {
    border-color: transparent;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.blog-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

body.light-mode .blog-title {
    color: var(--text-light);
}

.blog-brief {
    font-size: 0.95rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

body.light-mode .blog-brief {
    color: #64748b;
}

.blog-link {
    display: inline-block;
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

body.light-mode .blog-link {
    color: #0891b2;
}

@media (max-width: 768px) {
    .timeline {
        padding-left: 1.5rem;
    }

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

    section {
        padding: 3rem 1rem;
    }

    .hero {
        padding: 6rem 1rem 3rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

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

    .terminal-window {
        width: 95%;
        height: 400px;
    }
}

@media (min-width: 768px) {
    .timeline {
        padding-left: 3rem;
    }

    .timeline::before {
        left: 2rem;
    }

    .timeline-item::before {
        left: 1.45rem;
    }
}
