:root {
    --bg: #07080c;
    --bg-2: #0d0f16;
    --card: rgba(255, 255, 255, .035);
    --line: rgba(255, 255, 255, .08);
    --text: #e9ecf3;
    --muted: #8b93a7;
    --a1: #7c5cff;
    --a2: #22d3ee;
    --a3: #f472b6;
    --grad: linear-gradient(110deg, var(--a1), var(--a2) 55%, var(--a3));
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--a1); color: #fff; }
a { color: var(--text); text-decoration: none; transition: color .2s; }
a:hover { color: var(--a2); }
h1, h2, h3 { font-family: "Space Grotesk", sans-serif; letter-spacing: -.02em; }
.mono { font-family: "JetBrains Mono", monospace; }
.muted { color: var(--muted); }
.accent { color: var(--a2); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- background ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora span {
    position: absolute; width: 55vw; height: 55vw; border-radius: 50%;
    filter: blur(110px); opacity: .28; animation: float 22s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: var(--a1); top: -20vw; left: -10vw; }
.aurora span:nth-child(2) { background: var(--a2); top: 20vh; right: -20vw; animation-delay: -7s; opacity: .18; }
.aurora span:nth-child(3) { background: var(--a3); bottom: -30vw; left: 30vw; animation-delay: -14s; opacity: .14; }
@keyframes float {
    to { transform: translate(8vw, 6vh) scale(1.15); }
}
.grid-bg {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
    opacity: .5;
}

/* ---------- nav ---------- */
.topnav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    padding: 18px 0; transition: background .3s, padding .3s, border-color .3s;
    border-bottom: 1px solid transparent;
}
.topnav.scrolled {
    background: rgba(7, 8, 12, .72); backdrop-filter: blur(14px);
    padding: 10px 0; border-color: var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: "Space Grotesk"; font-weight: 600; font-size: 1.1rem; }
.brand-mark {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
    background: var(--grad); color: #fff; font-weight: 700; font-size: .95rem;
}
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.nav-links a:not(.btn-pill) { color: var(--muted); }
.nav-links a:not(.btn-pill):hover { color: var(--text); }
@media (max-width: 767px) { .nav-links li:not(:last-child) { display: none; } }

/* ---------- buttons ---------- */
.btn-pill, .btn-ghost {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: .98rem;
    border: 0; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-pill { background: var(--grad); background-size: 200% 100%; color: #fff; box-shadow: 0 10px 40px -10px rgba(124, 92, 255, .7); }
.btn-pill:hover { color: #fff; transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 16px 50px -10px rgba(34, 211, 238, .6); }
.btn-pill .arrow { transition: transform .2s; }
.btn-pill:hover .arrow { transform: translateX(4px); }
.btn-pill-sm { padding: 8px 18px; font-size: .9rem; }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero { min-height: 100vh; display: flex; align-items: center; padding: 130px 0 60px; }
.status {
    display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 999px;
    background: rgba(34, 197, 94, .08); border: 1px solid rgba(34, 197, 94, .25); color: #86efac; font-size: .85rem;
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 #22c55e; animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.hero-name {
    font-size: clamp(3rem, 8.5vw, 6.4rem); font-weight: 700; line-height: .98; margin: 22px 0 18px;
    background: linear-gradient(180deg, #fff 30%, #9aa3b8); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-role { font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: var(--a2); margin-bottom: 20px; min-height: 1.6em; }
.hero-role .prompt { color: var(--a1); }
.caret { display: inline-block; width: .6ch; height: 1.1em; background: var(--a2); margin-left: 3px; vertical-align: -.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-tag { font-size: 1.2rem; color: var(--muted); max-width: 580px; margin-bottom: 32px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 34px; font-size: .9rem; color: var(--muted); }
.hero-meta a { color: var(--muted); }
.hero-meta a:hover { color: var(--a2); }

.code-card {
    position: relative; border-radius: var(--radius); background: rgba(13, 15, 22, .82);
    border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(124, 92, 255, .08);
    overflow: hidden; transform-style: preserve-3d; transition: transform .15s ease-out;
}
.code-card::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
    background: var(--grad); opacity: .45;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.code-head { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.code-head i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.code-head i:nth-child(2) { background: #febc2e; }
.code-head i:nth-child(3) { background: #28c840; }
.code-head span { margin-left: 10px; font: 500 .8rem "JetBrains Mono"; color: var(--muted); }
.code { margin: 0; padding: 22px; font: .86rem/1.75 "JetBrains Mono", monospace; color: #cbd2e1; white-space: pre; overflow-x: auto; }
.code .k { color: #c792ea; } .code .t { color: #22d3ee; } .code .s { color: #c3e88d; }
.code .n { color: #f78c6c; } .code .f { color: #82aaff; } .code .c { color: #5c6680; font-style: italic; }

.stats {
    display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 80px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); backdrop-filter: blur(6px);
}
.stat { padding: 26px 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font: 700 1.9rem "Space Grotesk"; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: .9rem; }
@media (max-width: 767px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .stat:nth-child(2) { border-right: 0; }
    .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ---------- sections ---------- */
.section { padding: 110px 0; position: relative; }
.eyebrow { font: 500 .85rem "JetBrains Mono"; color: var(--a2); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.section-title { font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 700; line-height: 1.05; }
.about-text p { font-size: 1.15rem; color: #c3c9d6; margin-bottom: 1.3rem; }
.about-text p:first-child { font-size: 1.45rem; color: var(--text); line-height: 1.5; }

.card-glow {
    position: relative; height: 100%; padding: 30px; border-radius: var(--radius);
    background: var(--card); border: 1px solid var(--line); overflow: hidden;
    transition: transform .3s, border-color .3s;
}
.card-glow::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
    background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 92, 255, .18), transparent 45%);
}
.card-glow:hover { transform: translateY(-4px); border-color: rgba(124, 92, 255, .4); }
.card-glow:hover::after { opacity: 1; }
.card-glow .icon {
    width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(124, 92, 255, .2), rgba(34, 211, 238, .12)); color: var(--a2);
}
.card-glow .icon svg { width: 24px; height: 24px; }
.card-glow h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 8px; }
.card-glow p { color: var(--muted); margin: 0; font-size: 1rem; }

.marquee { margin-top: 70px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: scroll 32s linear infinite; }
.marquee-track span { font: 600 1.5rem "Space Grotesk"; color: rgba(255, 255, 255, .28); white-space: nowrap; transition: color .2s; }
.marquee-track span:hover { color: var(--text); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }

.timeline { list-style: none; padding: 0 0 0 34px; margin: 0; border-left: 1px solid var(--line); }
.timeline > li { position: relative; padding-bottom: 50px; }
.timeline > li::before {
    content: ""; position: absolute; left: -41px; top: 8px; width: 13px; height: 13px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--a2); box-shadow: 0 0 18px var(--a2);
}
.timeline .period { color: var(--a2); font-size: .85rem; }
.timeline h3 { font-size: 1.6rem; margin: 6px 0 4px; }
.timeline .at { color: var(--muted); font-weight: 400; }
.timeline ul { color: #c3c9d6; padding-left: 1.1rem; }
.timeline ul li::marker { color: var(--a1); }

.skill-group { height: 100%; padding: 28px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.skill-group h3 { font-size: .85rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 6px 14px; border-radius: 999px; font-size: .9rem; border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03); transition: all .2s; cursor: default;
}
.chip:hover { border-color: var(--a1); background: rgba(124, 92, 255, .14); transform: translateY(-2px); }

.contact-card {
    text-align: center; padding: 80px 30px; border-radius: 28px; border: 1px solid var(--line);
    background: radial-gradient(ellipse at top, rgba(124, 92, 255, .22), transparent 60%), var(--bg-2);
}
.contact-title { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 700; line-height: 1.05; margin-bottom: 14px; }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; margin-top: 40px; color: var(--muted); font-size: .95rem; }
.contact-links a { color: var(--muted); }

.edu { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.edu:last-child, .lang:last-child { border-bottom: 0; }
.edu .period { color: var(--a2); font-size: .8rem; }
.lang { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lang .muted { font-size: .9rem; }

/* ---------- faq ---------- */
.faq { border-bottom: 1px solid var(--line); padding: 6px 0; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.6rem "Space Grotesk"; color: var(--a2); transition: transform .25s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq summary h3 { font-size: 1.15rem; font-weight: 600; margin: 0; }
.faq p { color: #c3c9d6; margin: 0 0 16px; }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--a1); color: #fff; }
.skip-link:focus { top: 16px; color: #fff; }

/* ---------- avatar ---------- */
.avatar {
    width: 96px; height: 96px; border-radius: 50%; padding: 3px; margin-bottom: 22px;
    background: var(--grad); box-shadow: 0 10px 40px -10px rgba(124, 92, 255, .8);
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg); display: block; }

/* ---------- projects ---------- */
.project {
    height: 100%; padding: 30px; border-radius: var(--radius); background: var(--card);
    border: 1px solid var(--line); transition: transform .3s, border-color .3s;
}
.project:hover { transform: translateY(-4px); border-color: rgba(34, 211, 238, .35); }
.project.featured {
    padding: 44px; position: relative; overflow: hidden;
    background: radial-gradient(ellipse at 0% 0%, rgba(124, 92, 255, .22), transparent 55%),
                radial-gradient(ellipse at 100% 100%, rgba(34, 211, 238, .14), transparent 55%), var(--bg-2);
}
.project.featured h3 { font-size: clamp(2rem, 4vw, 2.8rem); }
.project-kind { font-size: .78rem; color: var(--a2); letter-spacing: .04em; margin-bottom: 8px; }
.project h3 { font-size: 1.35rem; font-weight: 600; margin-bottom: 10px; }
.project-pitch { color: #c3c9d6; }
.project-points { color: var(--muted); font-size: .95rem; padding-left: 1.1rem; margin-bottom: 18px; }
.project-points li { margin-bottom: 4px; }
.project-points li::marker { color: var(--a1); }
.chip-sm { padding: 3px 11px; font-size: .78rem; }

/* ---------- contact form ---------- */
.contact-form { max-width: 720px; margin: 0 auto; text-align: left; }
.field {
    width: 100%; padding: 15px 18px; border-radius: 14px; color: var(--text); font: inherit;
    background: rgba(255, 255, 255, .04); border: 1px solid var(--line); outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s; resize: vertical;
}
.field::placeholder { color: #5f6779; }
.field:focus { border-color: var(--a1); background: rgba(124, 92, 255, .06); box-shadow: 0 0 0 4px rgba(124, 92, 255, .15); }
.field.invalid { border-color: #f87171; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { text-align: center; min-height: 1.6em; margin: 18px 0 0; font-size: .95rem; }
.form-status.ok { color: #86efac; }
.form-status.err { color: #fca5a5; }
.captcha-note { text-align: center; font-size: .75rem; color: #5f6779; margin: 6px 0 0; }
.captcha-note a { color: #7c849a; text-decoration: underline; }
.grecaptcha-badge { visibility: hidden; }
.btn-pill:disabled { opacity: .6; cursor: wait; transform: none; }

.footer { padding: 34px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ---------- print = clean CV ---------- */
@media print {
    @page { margin: 14mm; }
    body { background: #fff; color: #111; font-size: 11pt; line-height: 1.45; }
    .aurora, .grid-bg, .topnav, .code-card, .marquee, .btn-pill, .btn-ghost, .status, .caret, .footer, #work .row, .contact-form, #faq, .skip-link { display: none !important; }
    .project, .project.featured { background: none; border-color: #ccc; padding: 8pt; break-inside: avoid; }
    .project-pitch, .project-points { color: #333 !important; }
    #projects .col-md-6 { width: 50%; }
    .reveal { opacity: 1 !important; transform: none !important; }
    .hero { min-height: 0; padding: 0; }
    .hero-name, .grad, .stat strong { background: none !important; -webkit-text-fill-color: #111; color: #111 !important; }
    .hero-name { font-size: 28pt; margin: 0 0 4pt; }
    .hero-role, .eyebrow, .timeline .period { color: #444 !important; }
    .hero-tag, .muted, .about-text p, .timeline ul, .hero-meta, .hero-meta a, .contact-links, .contact-links a, .stat span { color: #333 !important; }
    .stats { margin-top: 12pt; border-color: #ccc; }
    .stat { padding: 8pt; border-color: #ccc !important; }
    .stat strong { font-size: 14pt; }
    .section { padding: 14pt 0 0; break-inside: avoid; }
    .section-title { font-size: 16pt; margin-bottom: 8pt !important; }
    .about-text p:first-child { font-size: 12pt; color: #111; }
    .about-text p { font-size: 11pt; margin-bottom: 6pt; }
    .skill-group, .contact-card, .chip { background: none; border-color: #ccc; }
    .skill-group { padding: 8pt; }
    .contact-card { padding: 10pt; text-align: left; }
    .contact-title { font-size: 14pt; }
    .contact-links { justify-content: flex-start; margin-top: 6pt; }
    .timeline > li::before { box-shadow: none; }
    .col-lg-4, .col-lg-8, .col-lg-7, .col-md-6 { width: 100%; }
    #skills .col-md-6 { width: 50%; }
}
