/* ============================================================
   Variables
   ============================================================ */
:root {
    --bg: #090e1a;
    --bg-alt: #0d1424;
    --surface: #111827;
    --border: #1e2d45;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --nav-h: 64px;
    --radius: 12px;
    --ease: 0.2s ease;
}

/* Light theme */
[data-theme="light"] {
    --bg: #f8fafc;
    --bg-alt: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --accent: #2563eb;
    --accent-light: #3b82f6;
    --accent-glow: rgba(37, 99, 235, 0.12);
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
}

.section-alt {
    background: var(--bg-alt);
}

/* ============================================================
   Section title
   ============================================================ */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 56px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 48px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* ============================================================
   Navigation
   ============================================================ */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-h);
    border-bottom: 1px solid transparent;
    transition: background var(--ease), border-color var(--ease), backdrop-filter var(--ease);
}

#navbar.scrolled {
    background: rgba(9, 14, 26, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--border);
}

[data-theme="light"] #navbar.scrolled {
    background: rgba(248, 250, 252, 0.88);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 36px;
    align-items: center;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: width var(--ease);
}

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

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--ease);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--ease), border-color var(--ease), background var(--ease);
    flex-shrink: 0;
}

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

/* Show sun in dark mode, moon in light mode */
[data-theme="light"] .icon-sun {
    display: none;
}

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

.icon-moon {
    display: none;
}

.icon-sun {
    display: block;
}

/* ============================================================
   Hero
   ============================================================ */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--nav-h);
}

#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(59, 130, 246, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 720px;
}

.hero-greeting {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.hero-name {
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.hero-title {
    font-size: clamp(1.15rem, 2.5vw, 1.7rem);
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 36px;
}

.accent {
    color: var(--accent-light);
    font-weight: 500;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--ease);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text);
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    transform: translateY(-1px);
}

.hero-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-dim);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: scrollPulse 2s infinite;
}

@keyframes scrollPulse {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(6px);
    }
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.75;
}

.about-text p:last-child {
    margin-bottom: 0;
}

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

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: border-color var(--ease), transform var(--ease);
}

.stat-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--accent-light);
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ============================================================
   Timeline
   ============================================================ */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--border) 85%, transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 36px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -38px;
    top: 22px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-alt);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.timeline-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    transition: border-color var(--ease);
}

.timeline-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

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

.timeline-role {
    font-size: 1.08rem;
    font-weight: 600;
    margin-bottom: 4px;
}

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

.timeline-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.timeline-period {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.timeline-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-senior {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-middle {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-junior {
    background: rgba(168, 85, 247, 0.1);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.timeline-achievements {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-achievements li {
    font-size: 0.92rem;
    color: var(--text-muted);
    padding-left: 18px;
    position: relative;
    line-height: 1.55;
}

.timeline-achievements li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.timeline-achievements li strong {
    color: var(--text);
    font-weight: 500;
}

/* ============================================================
   Skills
   ============================================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.skill-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color var(--ease);
}

.skill-group:hover {
    border-color: rgba(59, 130, 246, 0.35);
}

.skill-group-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
}

.tag-primary {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.tag-db {
    background: rgba(251, 146, 60, 0.1);
    color: #fdba74;
    border: 1px solid rgba(251, 146, 60, 0.25);
}

.tag-infra {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.tag-arch {
    background: rgba(168, 85, 247, 0.1);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.tag-monitor {
    background: rgba(236, 72, 153, 0.1);
    color: #f9a8d4;
    border: 1px solid rgba(236, 72, 153, 0.25);
}

.tag-test {
    background: rgba(234, 179, 8, 0.1);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.25);
}

/* Light theme — darker text for contrast on white surfaces */
[data-theme="light"] .tag-primary {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.3);
}

[data-theme="light"] .tag-db {
    background: rgba(234, 88, 12, 0.08);
    color: #c2410c;
    border-color: rgba(234, 88, 12, 0.25);
}

[data-theme="light"] .tag-infra {
    background: rgba(5, 150, 105, 0.08);
    color: #047857;
    border-color: rgba(5, 150, 105, 0.25);
}

[data-theme="light"] .tag-arch {
    background: rgba(124, 58, 237, 0.08);
    color: #6d28d9;
    border-color: rgba(124, 58, 237, 0.25);
}

[data-theme="light"] .tag-monitor {
    background: rgba(219, 39, 119, 0.08);
    color: #be185d;
    border-color: rgba(219, 39, 119, 0.25);
}

[data-theme="light"] .tag-test {
    background: rgba(161, 98, 7, 0.08);
    color: #92400e;
    border-color: rgba(161, 98, 7, 0.25);
}

/* ============================================================
   Contact
   ============================================================ */
.contact-intro {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 48px;
}

.contact-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 420px));
    gap: 16px;
    justify-content: center;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: border-color var(--ease), transform var(--ease);
    color: var(--text);
}

.contact-card svg {
    color: var(--accent);
    flex-shrink: 0;
}

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

.contact-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.contact-value {
    font-size: 0.88rem;
    font-weight: 500;
}

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

footer p {
    font-size: 0.84rem;
    color: var(--text-dim);
}

/* ============================================================
   Reveal animation
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    .container {
        width: 100%;
        padding: 0 20px;
    }

    .section {
        padding: 64px 0;
    }

    /* Mobile nav */
    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 24px;
        gap: 24px;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    /* Hero */
    #hero {
        width: 100%;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
    }

    .hero-name {
        font-size: 2.4rem;
    }

    .hero-title {
        font-size: 1.15rem;
    }

    .hero-actions {
        flex-direction: column;
    }

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

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-grid > * {
        min-width: 0;
    }

    .about-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .about-stats > * {
        min-width: 0;
    }

    .stat-card {
        padding: 16px 8px;
    }

    .stat-label {
        font-size: 0.65rem;
        letter-spacing: 0.04em;
    }

    /* Timeline — strip the side decoration to avoid overflow */
    .timeline {
        padding-left: 0;
    }

    .timeline::before {
        display: none;
    }

    .timeline-marker {
        display: none;
    }

    .timeline-card {
        padding: 20px;
    }

    .timeline-header {
        flex-direction: column;
        gap: 10px;
    }

    .timeline-right {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    /* Skills */
    .skills-grid {
        grid-template-columns: 1fr;
    }

    /* Contact */
    .contact-links {
        grid-template-columns: 1fr;
    }
}