/* ============================
   Variables & Theme
============================ */
:root {
    --transition-speed: 0.3s;
    
    /* Dark theme (default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7a;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --border: #2a2a3a;
    --success: #22c55e;
    --code-bg: #0d0d12;
}

[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-card: #f5f5f7;
    --bg-card-hover: #ebebef;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-muted: #8a8a9a;
    --accent: #4f46e5;
    --accent-light: #6366f1;
    --accent-glow: rgba(79, 70, 229, 0.2);
    --border: #e0e0e5;
    --code-bg: #f0f0f2;
}

/* ============================
   Base Styles
============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition-speed), color var(--transition-speed);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

/* ============================
   Theme Toggle
============================ */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-speed);
    z-index: 100;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    transform: scale(1.05);
}

.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }

[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

/* ============================
   Hero Section
============================ */
.hero {
    margin-bottom: 80px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 48px;
}

.hero-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
}

.photo-container {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

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

.photo.night {
    opacity: 1;
    transform: scale(1);
}

.photo.day {
    opacity: 0;
    transform: scale(1.1);
}

[data-theme="light"] .photo.night {
    opacity: 0;
    transform: scale(1.1);
}

[data-theme="light"] .photo.day {
    opacity: 1;
    transform: scale(1);
}

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

.name {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 12px;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.badge.highlight {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Code Block */
.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    color: var(--text-secondary);
}

.code-block .keyword { color: #c792ea; }
.code-block .class { color: #82aaff; }
.code-block .property { color: #f78c6c; }
.code-block .string { color: #c3e88d; }
.code-block .number { color: #f78c6c; }

/* Hero Stats */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.stat {
    text-align: center;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 4px;
}

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

/* ============================
   Sections
============================ */
.section {
    margin-bottom: 64px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 32px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.summary-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 800px;
    line-height: 1.8;
}

/* ============================
   Competencies Grid
============================ */
.competencies-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.competency-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    transition: all var(--transition-speed);
    position: relative;
}

.competency-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.competency-card.featured {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
}

.competency-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.featured-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.competency-card li {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.competency-card li strong {
    color: var(--text-primary);
}

/* ============================
   Value Cards
============================ */
.value-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.value-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    transition: all var(--transition-speed);
}

.value-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.value-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.value-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.value-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================
   Timeline / Experience
============================ */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-light) 50%, var(--accent) 100%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 48px;
    width: 45%;
}

.timeline-item:nth-child(odd) {
    margin-left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    margin-left: 55%;
    text-align: left;
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    top: 24px;
    box-shadow: 0 0 20px var(--accent-glow);
    z-index: 1;
}

.timeline-item:nth-child(odd)::before {
    right: -8px;
    transform: translateX(50%);
}

.timeline-item:nth-child(even)::before {
    left: -8px;
    transform: translateX(-50%);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: all var(--transition-speed);
}

.timeline-content:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-item:nth-child(odd) .timeline-header {
    flex-direction: row-reverse;
}

.timeline-company {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-light);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: 12px;
}

.timeline-role {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-duration {
    font-size: 0.85rem;
    color: var(--success);
    margin-bottom: 16px;
}

.timeline-results {
    margin-bottom: 16px;
}

.result-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.timeline-item:nth-child(odd) .result-item {
    flex-direction: row-reverse;
    text-align: left;
}

.timeline-item:nth-child(odd) .result-item > div {
    text-align: right;
}

.result-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.result-item strong {
    color: var(--text-primary);
}

.timeline-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.timeline-item:nth-child(odd) .timeline-stack {
    justify-content: flex-end;
}

.timeline-stack span {
    font-size: 0.7rem;
    padding: 4px 10px;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    font-weight: 500;
}

/* Timeline Responsive */
@media (max-width: 900px) {
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        width: calc(100% - 50px);
        margin-left: 50px;
        text-align: left;
    }
    
    .timeline-item::before,
    .timeline-item:nth-child(odd)::before,
    .timeline-item:nth-child(even)::before {
        left: -30px;
        transform: translateX(0);
    }
    
    .timeline-header,
    .timeline-item:nth-child(odd) .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-item,
    .timeline-item:nth-child(odd) .result-item {
        flex-direction: row;
    }
    
    .timeline-item:nth-child(odd) .result-item > div {
        text-align: left;
    }
    
    .timeline-stack,
    .timeline-item:nth-child(odd) .timeline-stack {
        justify-content: flex-start;
    }
}

/* ============================
   Skills Cloud
============================ */
.skills-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tag {
    padding: 10px 20px;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 24px;
    font-size: 0.9rem;
    color: white;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.skill-tag:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.skill-tag.primary {
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    border-color: transparent;
    color: white;
    font-weight: 600;
}

/* ============================
   Footer
============================ */
.footer {
    text-align: center;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.contact-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.contact-icon {
    font-size: 1.25rem;
}

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

/* ============================
   Responsive
============================ */
@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .competencies-grid {
        grid-template-columns: 1fr;
    }
    
    .value-cards {
        grid-template-columns: 1fr;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 40px 16px 60px;
    }
    
    .hero-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .photo-container {
        width: 70px;
        height: 70px;
    }
    
    .name {
        font-size: 2.5rem;
    }
    
    .title {
        font-size: 1.25rem;
    }
    
    .contact-links {
        flex-direction: column;
        gap: 16px;
    }
    
    .hero-badges {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

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

.hero, .section {
    animation: fadeInUp 0.6s ease-out;
}

.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.2s; }
.section:nth-child(4) { animation-delay: 0.3s; }
