:root {
    --bg: #07101d;
    --bg-soft: #0b1728;
    --surface: #0d1b2e;
    --surface-2: #12233a;
    --text: #f7fbff;
    --muted: #a8b5c8;
    --line: rgba(255, 255, 255, 0.1);
    --primary: #2dd4bf;
    --primary-2: #38bdf8;
    --accent: #60a5fa;
    --shadow: 0 28px 75px rgba(0, 0, 0, 0.32);
    --radius: 24px;
    --header: rgba(7, 16, 29, 0.75);
}

html[data-theme="light"] {
    --bg: #f7fafc;
    --bg-soft: #eef5f9;
    --surface: #ffffff;
    --surface-2: #edf5fa;
    --text: #0f172a;
    --muted: #536278;
    --line: rgba(15, 23, 42, 0.11);
    --shadow: 0 24px 65px rgba(32, 65, 90, 0.15);
    --header: rgba(247, 250, 252, 0.82);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }
button { color: inherit; }
::selection { background: rgba(45, 212, 191, 0.25); }

.container { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.section-pad { padding: 112px 0; position: relative; }
.surface { background: var(--bg-soft); border-block: 1px solid var(--line); }
.skip-link { position: fixed; top: -100px; left: 20px; background: var(--primary); color: #041018; padding: 12px 18px; border-radius: 10px; z-index: 999; font-weight: 800; }
.skip-link:focus { top: 20px; }

.site-header { position: fixed; inset: 0 0 auto; z-index: 100; height: 82px; display: flex; align-items: center; background: transparent; transition: 0.25s ease; }
.site-header.scrolled { background: var(--header); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; letter-spacing: -1px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #06101d; box-shadow: 0 10px 30px rgba(45, 212, 191, 0.24); }
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand strong { font-size: 15px; letter-spacing: 0.02em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.12em; }
.main-nav { display: flex; align-items: center; gap: 23px; font-size: 14px; font-weight: 650; }
.main-nav > a:not(.nav-cta) { color: var(--muted); transition: 0.2s; }
.main-nav > a:not(.nav-cta):hover { color: var(--text); }
.nav-cta { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.theme-toggle { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.menu-toggle { display: none; background: transparent; border: 0; padding: 8px; }
.menu-toggle span { width: 25px; height: 2px; background: var(--text); display: block; margin: 5px 0; transition: 0.2s; }

.hero { min-height: 780px; padding-top: 170px; display: flex; align-items: center; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 60px 60px; mask-image: linear-gradient(to bottom, black, transparent 82%); opacity: 0.24; }
.hero-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; align-items: center; gap: 80px; }
.hero-glow { position: absolute; border-radius: 999px; filter: blur(90px); z-index: -1; opacity: 0.22; }
.hero-glow-one { width: 420px; height: 420px; background: var(--primary); top: 80px; left: -180px; }
.hero-glow-two { width: 430px; height: 430px; background: var(--accent); right: -160px; top: 160px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--primary); text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; font-weight: 800; margin: 0 0 20px; }
.eyebrow span { width: 34px; height: 2px; background: currentColor; }
.hero h1, .section-heading h2, .contact-copy h2 { margin: 0; line-height: 1.08; letter-spacing: -0.045em; }
.hero h1 { max-width: 790px; font-size: clamp(48px, 6vw, 78px); }
.hero h1 em { font-style: normal; color: transparent; background: linear-gradient(90deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; }
.hero-intro { font-size: 18px; color: var(--muted); max-width: 670px; margin: 28px 0 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border-radius: 14px; font-weight: 800; border: 1px solid transparent; transition: 0.2s ease; cursor: pointer; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #041018; box-shadow: 0 16px 34px rgba(45, 212, 191, 0.18); }
.btn-secondary { background: var(--surface); border-color: var(--line); }
.btn-full { width: 100%; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 35px; color: var(--muted); font-size: 13px; }
.hero-meta a:hover { color: var(--primary); }
.hero-visual { position: relative; min-height: 500px; display: grid; place-items: center; }
.portrait-card { width: min(420px, 88vw); position: relative; border: 1px solid var(--line); padding: 13px; border-radius: 36px; background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.01)); box-shadow: var(--shadow); transform: rotate(2deg); }
.portrait-card img { border-radius: 27px; aspect-ratio: 1; }
.portrait-badge { position: absolute; left: 28px; right: 28px; bottom: 28px; padding: 16px 18px 16px 44px; background: rgba(5, 13, 24, 0.82); color: #fff; border: 1px solid rgba(255,255,255,0.14); border-radius: 17px; backdrop-filter: blur(12px); }
.portrait-badge strong, .portrait-badge small { display: block; line-height: 1.4; }
.portrait-badge small { color: #b9c8da; font-size: 12px; }
.status-dot { width: 11px; height: 11px; background: #34d399; border-radius: 50%; position: absolute; left: 18px; top: 22px; box-shadow: 0 0 0 6px rgba(52,211,153,0.12); }
.floating-chip { position: absolute; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: 12px; font-weight: 800; color: var(--muted); }
.chip-code { top: 35px; right: -5px; }
.chip-data { left: -15px; bottom: 140px; }
.chip-train { right: 0; bottom: 55px; }

.stats-strip { border-block: 1px solid var(--line); background: var(--surface); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stats-grid div { padding: 26px 20px; border-right: 1px solid var(--line); }
.stats-grid div:last-child { border-right: 0; }
.stats-grid strong, .stats-grid span { display: block; }
.stats-grid strong { font-size: 18px; }
.stats-grid span { color: var(--muted); font-size: 12px; margin-top: 4px; }

.two-col { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 90px; align-items: start; }
.section-heading { max-width: 760px; margin-bottom: 50px; }
.section-heading.centered { text-align: center; margin-inline: auto; }
.section-heading.centered .eyebrow { justify-content: center; }
.section-heading h2, .contact-copy h2 { font-size: clamp(36px, 4.4vw, 58px); }
.section-heading > p:last-child { color: var(--muted); max-width: 670px; margin: 20px auto 0; }
.about-copy { color: var(--muted); font-size: 17px; }
.about-copy p:first-child { margin-top: 0; }
.about-links { display: flex; gap: 22px; margin-top: 30px; }
.about-links a, .text-link { color: var(--primary); font-weight: 800; }

.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill-card { padding: 29px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: 0.25s ease; }
.skill-card:hover { transform: translateY(-7px); border-color: rgba(45, 212, 191, 0.35); box-shadow: var(--shadow); }
.skill-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(135deg, rgba(45,212,191,0.17), rgba(56,189,248,0.15)); color: var(--primary); font-weight: 900; font-size: 19px; }
.skill-card h3 { margin: 22px 0 10px; font-size: 19px; }
.skill-card p { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.skill-card > span { display: block; padding-top: 16px; border-top: 1px solid var(--line); color: var(--primary); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }

.timeline { position: relative; margin-top: 20px; }
.timeline::before { content: ""; position: absolute; left: 115px; top: 5px; bottom: 15px; width: 1px; background: var(--line); }
.timeline-item { display: grid; grid-template-columns: 90px 1fr; gap: 55px; position: relative; padding: 0 0 54px; }
.timeline-item::before { content: ""; position: absolute; left: 108px; top: 9px; width: 13px; height: 13px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 7px rgba(45,212,191,0.11); }
.timeline-year { color: var(--muted); font-weight: 800; font-size: 13px; padding-top: 3px; text-align: right; }
.timeline-content { padding: 0 0 0 16px; max-width: 800px; }
.timeline-content h3 { margin: 9px 0 12px; font-size: 23px; }
.timeline-content p, .timeline-content li { color: var(--muted); }
.timeline-content ul { padding-left: 20px; margin-bottom: 0; }
.tag { display: inline-block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 900; color: var(--primary); }

.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.project-card { border: 1px solid var(--line); border-radius: 28px; overflow: hidden; background: var(--surface); min-width: 0; }
.project-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.2fr 0.8fr; }
.project-media { min-height: 430px; overflow: hidden; background: #020617; }
.project-media img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform 0.6s ease; }
.project-card:hover .project-media img { transform: scale(1.035); }
.project-content { padding: 32px; }
.project-topline { display: flex; justify-content: space-between; color: var(--primary); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.12em; }
.project-content h3 { margin: 19px 0 12px; font-size: 25px; line-height: 1.25; }
.project-content p { color: var(--muted); }
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 27px; }
.stack span { padding: 7px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; font-size: 10px; font-weight: 800; color: var(--muted); }
.project-symbol { height: 180px; display: grid; place-items: center; font-size: 58px; color: var(--primary); background: radial-gradient(circle at 50% 50%, rgba(45,212,191,0.18), transparent 55%), linear-gradient(135deg, rgba(255,255,255,0.035), transparent); border-bottom: 1px solid var(--line); }

.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cert-card { padding: 30px; border-left: 3px solid var(--primary); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; box-shadow: 0 16px 40px rgba(0,0,0,0.08); }
.cert-card span { color: var(--primary); font-size: 11px; font-weight: 900; }
.cert-card h3 { margin: 12px 0 9px; font-size: 19px; }
.cert-card p { color: var(--muted); margin: 0; font-size: 14px; }

.contact-section { background: linear-gradient(145deg, var(--bg-soft), var(--bg)); border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 85px; align-items: start; }
.contact-copy > p:not(.eyebrow) { color: var(--muted); max-width: 520px; }
.contact-list { display: grid; gap: 13px; margin-top: 34px; }
.contact-list a { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: 0.2s; }
.contact-list a:hover { border-color: rgba(45,212,191,0.35); transform: translateX(4px); }
.contact-list > a > span { width: 42px; height: 42px; display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; color: var(--primary); }
.contact-list small, .contact-list strong { display: block; }
.contact-list small { color: var(--muted); font-size: 11px; }
.contact-list strong { font-size: 13px; }
.contact-panel { padding: 30px; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.contact-form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label { display: grid; gap: 7px; font-size: 12px; font-weight: 800; }
.contact-form input, .contact-form textarea { width: 100%; color: var(--text); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; outline: none; transition: 0.2s; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(45,212,191,0.1); }
.contact-form textarea { resize: vertical; min-height: 150px; }
.form-note { color: var(--muted); font-size: 10px; text-align: center; margin: -4px 0 0; }
.honeypot { position: absolute; left: -9999px; }
.form-alert { margin-bottom: 18px; padding: 13px 15px; border-radius: 12px; font-size: 13px; }
.form-alert.success { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.25); }
.form-alert.error { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.25); }

.site-footer { padding: 32px 0; border-top: 1px solid var(--line); background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 25px; }
.footer-grid > p { color: var(--muted); font-size: 11px; text-align: center; }
.footer-links { display: flex; justify-content: flex-end; gap: 18px; color: var(--muted); font-size: 12px; }
.footer-links a:hover { color: var(--primary); }
.back-to-top { position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); opacity: 0; visibility: hidden; transform: translateY(10px); transition: 0.2s; box-shadow: var(--shadow); z-index: 50; }
.back-to-top.visible { opacity: 1; visibility: visible; transform: none; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: 0.01ms !important; }
    .reveal { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
    .menu-toggle { display: block; z-index: 102; }
    .main-nav { position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 26px; background: var(--bg); transform: translateX(100%); transition: transform 0.25s ease; font-size: 20px; }
    .main-nav.open { transform: none; }
    .main-nav .theme-toggle { margin-top: 10px; }
    .hero-grid, .two-col, .contact-grid { grid-template-columns: 1fr; }
    .hero-grid { gap: 55px; }
    .hero-copy { text-align: center; }
    .hero-copy .eyebrow, .hero-actions, .hero-meta { justify-content: center; }
    .hero-intro { margin-inline: auto; }
    .hero-visual { min-height: 430px; }
    .two-col, .contact-grid { gap: 42px; }
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .project-featured { grid-template-columns: 1fr; }
    .project-media { min-height: 360px; }
    .cert-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-grid .brand, .footer-links { justify-content: center; }
}

@media (max-width: 680px) {
    .container { width: min(100% - 28px, 1160px); }
    .section-pad { padding: 82px 0; }
    .site-header { height: 72px; }
    .hero { min-height: auto; padding-top: 130px; }
    .hero h1 { font-size: clamp(41px, 13vw, 58px); }
    .hero-intro { font-size: 16px; }
    .hero-actions .btn { width: 100%; }
    .floating-chip { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid div:nth-child(2) { border-right: 0; }
    .stats-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .skills-grid, .projects-grid { grid-template-columns: 1fr; }
    .timeline::before { left: 8px; }
    .timeline-item { grid-template-columns: 1fr; gap: 8px; padding-left: 34px; }
    .timeline-item::before { left: 2px; }
    .timeline-year { text-align: left; }
    .timeline-content { padding-left: 0; }
    .project-media { min-height: 260px; }
    .project-content, .contact-panel { padding: 23px; }
    .form-row { grid-template-columns: 1fr; }
    .section-heading h2, .contact-copy h2 { font-size: 38px; }
    .footer-grid > p { order: 3; }
}
