:root {
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    --nav-height: 70px;
    --container-max: 1100px;
    --container-padding: 25px;
}

[data-theme="dark"] {
    --bg-primary: #0a192f;
    --bg-secondary: #112240;
    --bg-tertiary: #1d3461;
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --text-tertiary: #64748b;
    --accent: #64ffda;
    --accent-secondary: #ff6b9d;
    --gradient-80s: linear-gradient(135deg, #00d4ff 0%, #ff00ff 50%, #ff6b9d 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(100, 255, 218, 0.1), rgba(255, 107, 157, 0.1));
    --shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
    --border: rgba(100, 255, 218, 0.1);
    --badge-bg: linear-gradient(135deg, rgba(255, 107, 157, 0.08), rgba(255, 0, 128, 0.04));
    --badge-bg-hover: linear-gradient(135deg, rgba(255, 107, 157, 0.15), rgba(255, 0, 128, 0.08));
    --badge-border: rgba(255, 107, 157, 0.6);
    --badge-border-hover: rgba(255, 107, 157, 0.85);
    --badge-text: #ff7eb3;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --accent: #0891b2;
    --accent-secondary: #db2777;
    --gradient-80s: linear-gradient(135deg, #0891b2 0%, #7c3aed 50%, #db2777 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(8, 145, 178, 0.05), rgba(219, 39, 119, 0.05));
    --shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.1);
    --border: rgba(0, 0, 0, 0.1);
    --badge-bg: linear-gradient(135deg, rgba(219, 39, 119, 0.08), rgba(190, 24, 93, 0.04));
    --badge-bg-hover: linear-gradient(135deg, rgba(219, 39, 119, 0.12), rgba(190, 24, 93, 0.06));
    --badge-border: rgba(219, 39, 119, 0.5);
    --badge-border-hover: rgba(219, 39, 119, 0.7);
    --badge-text: #be185d;
}

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

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

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    transition: background-color var(--transition-base), color var(--transition-base);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg-primary);
    padding: 0.5rem 1rem;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ─────────────────────────────────────────────────
   HEADER & NAV
   ───────────────────────────────────────────────── */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: background-color var(--transition-base);
}

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

.nav__logo {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav__logo:hover {
    color: var(--accent);
}

.nav__links {
    display: flex;
    gap: 2rem;
}

.nav__links a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    position: relative;
}

.nav__links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-80s);
    transition: width var(--transition-base);
}

.nav__links a:hover,
.nav__links a:focus {
    color: var(--accent);
}

.nav__links a:hover::after,
.nav__links a:focus::after {
    width: 100%;
}

.nav__links a.is-active {
    color: var(--accent-secondary);
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast), border-color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.theme-toggle svg {
    transition: transform var(--transition-base);
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

.theme-toggle:active svg {
    transform: rotate(45deg);
}

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

.nav__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

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

.hamburger__line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: transform var(--transition-base), opacity var(--transition-base), background-color var(--transition-fast);
}

.nav__hamburger:hover .hamburger__line {
    background: var(--accent);
}

.nav__hamburger[aria-expanded="true"] .hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav__hamburger[aria-expanded="true"] .hamburger__line:nth-child(2) {
    opacity: 0;
}

.nav__hamburger[aria-expanded="true"] .hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.mobile-nav {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.mobile-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav__links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.mobile-nav__links a {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(20px);
    transition: color var(--transition-fast), opacity var(--transition-base), transform var(--transition-base);
}

.mobile-nav__links a:hover,
.mobile-nav__links a.is-active {
    color: var(--accent-secondary);
}

.mobile-nav.is-open .mobile-nav__links a {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav.is-open .mobile-nav__links li:nth-child(1) a { transition-delay: 0.15s; }
.mobile-nav.is-open .mobile-nav__links li:nth-child(2) a { transition-delay: 0.25s; }
.mobile-nav.is-open .mobile-nav__links li:nth-child(3) a { transition-delay: 0.35s; }
.mobile-nav.is-open .mobile-nav__links li:nth-child(4) a { transition-delay: 0.45s; }

/* ─────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────── */

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

.animate-in {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-in--delay-1 { animation-delay: 0.1s; }
.animate-in--delay-2 { animation-delay: 0.2s; }
.animate-in--delay-3 { animation-delay: 0.3s; }
.animate-in--delay-4 { animation-delay: 0.5s; }
.animate-in--delay-5 { animation-delay: 0.7s; }

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.reveal--left {
    transform: translateX(-30px);
}

.reveal--left.is-visible {
    transform: translateX(0);
}

.reveal--right {
    transform: translateX(30px);
}

.reveal--right.is-visible {
    transform: translateX(0);
}

/* Staggered children reveal */
.reveal-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.reveal-children.is-visible > *:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.reveal-children.is-visible > *:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.reveal-children.is-visible > *:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.reveal-children.is-visible > *:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.reveal-children.is-visible > *:nth-child(5) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
.reveal-children.is-visible > *:nth-child(6) { transition-delay: 0.6s; opacity: 1; transform: translateY(0); }

/* ─────────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────────── */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
}

.hero__greeting {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.hero__name {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.hero__tagline {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    background: var(--gradient-80s);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    padding-bottom: 0.1em;
}

.hero__tagline-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.hero__description {
    max-width: 540px;
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

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

/* ─────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────── */

.btn {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 1rem 1.75rem;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-block;
    text-align: center;
}

.btn--primary {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}

.btn--primary:hover {
    background: rgba(100, 255, 218, 0.1);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 255, 218, 0.2);
}

[data-theme="light"] .btn--primary:hover {
    background: rgba(8, 145, 178, 0.1);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.15);
}

.btn--secondary {
    background: transparent;
    border-color: var(--text-tertiary);
    color: var(--text-secondary);
}

.btn--secondary:hover {
    background: rgba(100, 255, 218, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 255, 218, 0.15);
}

[data-theme="light"] .btn--secondary:hover {
    background: rgba(8, 145, 178, 0.1);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.1);
}

.btn--large {
    padding: 1.25rem 2.5rem;
    font-size: 1rem;
}

/* ─────────────────────────────────────────────────
   SECTIONS
   ───────────────────────────────────────────────── */

.section {
    padding: 100px 0;
}

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

.section--contact {
    text-align: center;
    padding: 150px 0;
    position: relative;
}

.section--contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: var(--gradient-80s);
    border-radius: 2px;
}

.section__title {
    font-family: var(--font-mono);
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--text-primary);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section__title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    max-width: 300px;
}

.section__number {
    color: var(--accent);
    font-size: 0.9em;
}

/* ─────────────────────────────────────────────────
   ABOUT
   ───────────────────────────────────────────────── */

.about__content {
    display: grid;
    gap: 3rem;
}

.about__text p {
    margin-bottom: 1rem;
}

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

.skills-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 200px));
    gap: 0.5rem 1rem;
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.skills-list li {
    position: relative;
    padding-left: 1.25rem;
}

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

/* ─────────────────────────────────────────────────
   PROJECTS
   ───────────────────────────────────────────────── */

.projects {
    display: grid;
    gap: 2rem;
}

.project {
    background: var(--gradient-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
}

.project__overline {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.project__title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.project__title a {
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.project__title svg {
    opacity: 0;
    transform: translateX(-5px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.project__title a:hover svg {
    opacity: 1;
    transform: translateX(0);
}

.project__description {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.project__tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.project__tech li {
    position: relative;
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    background: var(--badge-bg);
    border: 1px solid var(--badge-border);
    color: var(--badge-text);
    transition: all var(--transition-fast);
}

.project__tech li:hover {
    background: var(--badge-bg-hover);
    border-color: var(--badge-border-hover);
    transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────
   TIMELINE
   ───────────────────────────────────────────────── */

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

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

.timeline__item {
    position: relative;
    padding-bottom: 2.5rem;
}

.timeline__item:last-child {
    padding-bottom: 0;
}

.timeline__marker {
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--accent);
    transform: translateX(-5px);
}

.timeline__item--highlight .timeline__marker {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.timeline__content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.timeline__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.timeline__header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.timeline__company {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
}

.timeline__date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.timeline__details {
    font-size: 0.95rem;
}

.timeline__details li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

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

/* ─────────────────────────────────────────────────
   CONTACT
   ───────────────────────────────────────────────── */

.section--contact .section__title {
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: 1.5rem;
}

.contact__content {
    max-width: 500px;
    margin: 0 auto;
}

.contact__content p {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────── */

.footer {
    padding: 2rem 0;
    text-align: center;
}

.social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.social a {
    color: var(--text-secondary);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.social a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.footer__links {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.footer__links a {
    color: var(--text-secondary);
}

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

.footer__divider {
    margin: 0 0.75rem;
    color: var(--text-tertiary);
}

.footer__credit {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* ─────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────── */

@media (max-width: 768px) {
    :root {
        --container-padding: 20px;
    }

    .nav__links {
        display: none;
    }

    .nav__hamburger {
        display: flex;
    }

    .hero {
        padding-top: calc(var(--nav-height) + 2rem);
    }

    .section {
        padding: 60px 0;
    }

    .section--contact {
        padding: 80px 0;
    }

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

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline__marker {
        left: -1.5rem;
    }

    .timeline__header {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .hero__cta {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .skills-list {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────────────────
   PRINT
   ───────────────────────────────────────────────── */

@media print {
    .header,
    .theme-toggle,
    .hero__cta,
    .footer {
        display: none;
    }

    body {
        background: white;
        color: #333;
    }

    .section {
        padding: 20px 0;
        page-break-inside: avoid;
    }

    .project,
    .timeline__item {
        page-break-inside: avoid;
    }

    a {
        color: #333;
    }

    .hero__name,
    .hero__tagline {
        background: none;
        -webkit-text-fill-color: #333;
        color: #333;
    }
}
