:root {
    --bg: #070a12;
    --bg-soft: #0d1322;
    --card: rgba(255, 255, 255, .075);
    --card-strong: rgba(255, 255, 255, .11);
    --text: #f7f8ff;
    --muted: #aab4c8;
    --line: rgba(255, 255, 255, .14);
    --accent: #7c3aed;
    --accent-2: #18c8ff;
    --accent-3: #ffbd45;
    --shadow: 0 24px 80px rgba(0, 0, 0, .35);
    --radius: 26px;
    --header: 82px;
    --bs-heading-color: inherit;
}

html[data-theme="light"] {
    --bg: #f5f7fb;
    --bg-soft: #ffffff;
    --card: rgba(255, 255, 255, .82);
    --card-strong: rgba(255, 255, 255, .95);
    --text: #111523;
    --muted: #5b6678;
    --line: rgba(17, 21, 35, .12);
    --accent: #5b32d6;
    --accent-2: #007ead;
    --accent-3: #cc8500;
    --shadow: 0 22px 70px rgba(25, 38, 70, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 105px; }
main section[id] { scroll-margin-top: 105px; }
body {
    margin: 0;
    min-width: 320px;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 8%, rgba(124, 58, 237, .26), transparent 34rem),
        radial-gradient(circle at 90% 12%, rgba(24, 200, 255, .18), transparent 30rem),
        linear-gradient(145deg, var(--bg), var(--bg-soft));
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.decor {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    width: 420px;
    height: 420px;
    border-radius: 999px;
    filter: blur(70px);
    opacity: .2;
}
.decor-a { left: -180px; top: 18%; background: var(--accent); }
.decor-b { right: -190px; top: 56%; background: var(--accent-2); }

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    padding: 14px 0;
    transition: padding .22s ease, background .22s ease, border .22s ease;
}
.site-header.is-scrolled {
    padding: 8px 0;
    background: rgba(7, 10, 18, .72);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}
html[data-theme="light"] .site-header.is-scrolled { background: rgba(255, 255, 255, .75); }

.nav-shell {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .075);
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .18);
}
html[data-theme="light"] .nav-shell { background: rgba(255, 255, 255, .82); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 950; letter-spacing: -.04em; }
.brand-mark {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; align-items: center; justify-content: center; gap: 3px; margin-left: auto; }
.nav-links a {
    padding: 10px 11px;
    border-radius: 999px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 850;
    transition: color .2s ease, background .2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255, 255, 255, .1); }
html[data-theme="light"] .nav-links a:hover, html[data-theme="light"] .nav-links a.active { background: rgba(17, 21, 35, .07); }

.theme-toggle, .nav-toggle {
    border: 0;
    color: var(--text);
    background: rgba(255, 255, 255, .105);
    border-radius: 999px;
}
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 14px; font-weight: 900; }
.nav-toggle { display: none; width: 44px; height: 44px; margin-left: auto; place-items: center; }
.nav-toggle span { display: block; width: 18px; height: 2px; margin: 3px auto; border-radius: 99px; background: currentColor; transition: .2s ease; }
.nav-toggle.is-active span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.section { position: relative; z-index: 2; padding: 96px 0; }
.compact { padding-top: 72px; }
.hero { min-height: 100svh; display: flex; align-items: center; padding-top: 115px; padding-bottom: 58px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    color: var(--accent-2);
    font-size: .74rem;
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; border-radius: 99px; background: currentColor; }
.section-head h2, .contact-card h2 {
    margin: 0;
    font-size: clamp(2.65rem, 6.2vw, 5.75rem);
    line-height: 1;
    letter-spacing: .015em;
    font-weight: 950;
}
.hero h1 {
    margin: 0;
    font-size: clamp(2.55rem, 5.7vw, 5.3rem);
    line-height: .98;
    letter-spacing: .012em;
    font-weight: 950;
}
.lead-text, .section-head p, .info-card p, .project-card p, .skill-card p, .contact-card p {
    color: var(--muted);
    line-height: 1.62;
}
.lead-text { max-width: 720px; margin: 22px 0 0; font-size: 1.08rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn-main, .btn-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 950;
    transition: transform .22s ease, box-shadow .22s ease;
}
.btn-main { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 18px 45px rgba(24, 200, 255, .2); }
.btn-soft { color: var(--text); border: 1px solid var(--line); background: var(--card); }
.btn-main:hover, .btn-soft:hover { transform: translateY(-3px); color: #fff; }
html[data-theme="light"] .btn-soft:hover { color: var(--text); }
.tag-list, .project-stack { display: flex; flex-wrap: wrap; gap: 9px; }
.tag-list { margin-top: 22px; }
.tag-list span, .project-stack span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    color: var(--muted);
    font-size: .82rem;
    font-weight: 850;
}

.profile-card {
    position: relative;
    overflow: hidden;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .05));
    box-shadow: var(--shadow);
}
.profile-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: 0;
    background: radial-gradient(circle at 20% 0%, rgba(24, 200, 255, .24), transparent 35%), radial-gradient(circle at 85% 20%, rgba(124, 58, 237, .24), transparent 42%);
}
.profile-photo, .profile-info { position: relative; z-index: 1; }
.profile-photo { overflow: hidden; border-radius: 25px; aspect-ratio: 1 / 1; background: #101624; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { padding: 20px 4px 4px; }
.small-title { display: block; margin-bottom: 5px; color: var(--accent-2); font-size: .72rem; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.profile-info h2 { margin: 0 0 16px; font-size: clamp(1.45rem, 3vw, 2.15rem); line-height: 1; letter-spacing: -.055em; font-weight: 950; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stats div { padding: 13px 9px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255, 255, 255, .065); }
.stats strong { display: block; font-size: 1.45rem; line-height: 1; }
.stats span { display: block; margin-top: 7px; color: var(--muted); font-size: .72rem; line-height: 1.25; }

.section-head { max-width: 850px; margin-bottom: 32px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head.center .eyebrow { justify-content: center; }
.section-head.center .eyebrow::before { display: none; }
.section-head.center .eyebrow::after { content: ""; width: 28px; height: 2px; border-radius: 99px; background: currentColor; }
.section-head h2 { font-size: clamp(2.2rem, 4.7vw, 4.3rem); }
.section-head p { margin: 14px 0 0; font-size: 1.02rem; }

.info-card, .project-card, .skill-card, .contact-card {
    height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
.info-card { padding: 24px; }
.info-card > span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 18px;
    border-radius: 15px;
    color: #fff;
    font-weight: 950;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.info-card h3, .project-card h3, .skill-card h3 { margin: 0 0 8px; font-weight: 950; letter-spacing: -.04em; }
.info-card p, .project-card p, .skill-card p { margin: 0; }

.section-accent { background: linear-gradient(180deg, transparent, rgba(124, 58, 237, .08), transparent); }
.filter-bar { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; }
.filter-bar.left { justify-content: flex-start; }
.filter-btn {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, .075);
    font-weight: 900;
    transition: transform .18s ease, background .18s ease, color .18s ease;
}
.filter-btn:hover, .filter-btn.active { transform: translateY(-1px); color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.portfolio-grid { align-items: stretch; }
.portfolio-item { content-visibility: auto; contain-intrinsic-size: 330px; }
.portfolio-item.is-hidden { display: none; }
.work-card {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    padding: 0;
    text-align: left;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, .075);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
    transition: transform .22s ease, border-color .22s ease, background .22s ease;
}
.work-card:hover { transform: translateY(-5px); border-color: rgba(24, 200, 255, .45); background: rgba(255, 255, 255, .105); }
.work-media {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    background: rgba(0, 0, 0, .20);
    overflow: hidden;
}
.work-media img { width: 100%; height: 100%; object-fit: cover; padding: 0; }
.play-icon {
    position: absolute;
    inset: 0;
    margin: auto;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding-left: 3px;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 42px rgba(0, 0, 0, .32);
}
.work-copy { display: block; min-width: 0; padding: 13px 13px 14px; }
.work-copy small {
    display: block;
    margin-bottom: 5px;
    color: var(--accent-2);
    font-size: .68rem;
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.work-copy strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.25em;
    font-size: .98rem;
    line-height: 1.13;
    font-weight: 950;
    letter-spacing: -.035em;
}

.project-card { position: relative; overflow: hidden; padding: 25px; }
.project-card.featured { min-height: 330px; background: radial-gradient(circle at 80% 0%, rgba(24, 200, 255, .22), transparent 34%), var(--card); }
.project-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.project-top span {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.project-card h3 { font-size: clamp(1.35rem, 2.4vw, 2.1rem); }
.project-card p { max-width: 56ch; }
.project-stack { margin-top: 18px; }
.project-link { display: inline-flex; margin-top: 18px; color: var(--accent-2); font-weight: 950; }
.project-link:hover { color: var(--accent-3); }
.project-wide { display: flex; align-items: center; justify-content: space-between; gap: 18px; }

/* Skills marquee */
.skills-marquee {
    position: relative;
    left: 50%;
    width: 100vw;
    margin: 28px 0 0;
    margin-left: -50vw;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 clamp(30px, 8vw, 120px), #000 calc(100% - clamp(30px, 8vw, 120px)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 clamp(30px, 8vw, 120px), #000 calc(100% - clamp(30px, 8vw, 120px)), transparent);
}
.skills-marquee::before, .skills-marquee::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    width: clamp(30px, 8vw, 120px);
    pointer-events: none;
}
.skills-marquee::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.skills-marquee::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.skills-track { display: flex; width: max-content; animation: skills-scroll 64s linear infinite; }
.skills-list {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0 6px;
    list-style: none;
}
.skills-list li {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 17px 26px;
    line-height: 1.4;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text);
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .01em;
}
@keyframes skills-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.contact-card {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 26px;
    align-items: center;
    padding: clamp(24px, 5vw, 52px);
    background: radial-gradient(circle at 82% 0%, rgba(124, 58, 237, .22), transparent 42%), var(--card);
}
.contact-card h2 { font-size: clamp(2.2rem, 4.7vw, 4.3rem); }
.contact-card p { margin-top: 18px; margin-bottom: 0; }
.contact-links { display: grid; gap: 12px; min-width: 0; }
.contact-links a {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .075);
    font-weight: 900;
    transition: transform .18s ease, background .18s ease, color .18s ease;
}
.contact-links a:hover { transform: translateX(4px); color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.site-footer { position: relative; z-index: 2; padding: 22px 0 34px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 18px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--accent-2); font-weight: 900; }

.media-modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 18px; height: 100vh; height: 100dvh; }
.media-modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; background: rgba(0, 0, 0, .72); backdrop-filter: blur(14px); }
.modal-panel {
    position: relative;
    z-index: 2;
    width: min(980px, 100%);
    max-height: min(88vh, 860px);
    max-height: min(88dvh, 860px);
    margin: auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--bg-soft);
    box-shadow: 0 30px 100px rgba(0, 0, 0, .5);
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    background: rgba(255, 255, 255, .13);
    font-size: 28px;
    line-height: 1;
}
.modal-head { padding: 17px 64px 14px 20px; border-bottom: 1px solid var(--line); }
.modal-head span { display: block; margin-bottom: 4px; color: var(--accent-2); font-size: .72rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.modal-head h3 { margin: 0; font-size: clamp(1.2rem, 4vw, 1.9rem); font-weight: 950; letter-spacing: -.05em; }
.modal-body { display: grid; place-items: center; padding: 14px; }
.modal-body img, .modal-body video { display: block; width: 100%; max-height: calc(88vh - 128px); max-height: calc(88dvh - 128px); object-fit: contain; border-radius: 18px; background: #03050b; }
body.modal-lock { overflow: hidden; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .62s ease, transform .62s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: .07s; }
.delay-2 { transition-delay: .14s; }
.delay-3 { transition-delay: .21s; }

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
    .skills-list--clone { display: none; }
    .skills-track { width: auto; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
}

@media (max-width: 1199px) {
    .brand-name { max-width: 130px; }
    .nav-links a { padding-inline: 9px; font-size: .82rem; }
}

@media (max-width: 991px) {
    html { scroll-padding-top: 96px; }
    main section[id] { scroll-margin-top: 96px; }
    .site-header { padding: 10px 0; }
    .nav-shell { border-radius: 26px; }
    .nav-toggle { display: grid; }
    .nav-links {
        position: absolute;
        left: 12px;
        right: 12px;
        top: calc(100% + 10px);
        display: grid;
        gap: 6px;
        margin-left: 0;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: rgba(7, 10, 18, .95);
        box-shadow: var(--shadow);
        backdrop-filter: blur(18px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px);
        transition: .2s ease;
    }
    html[data-theme="light"] .nav-links { background: rgba(255, 255, 255, .96); }
    .nav-links.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
    .nav-links a { padding: 13px 15px; font-size: .96rem; }
    .theme-toggle { padding-inline: 12px; }
    .hero { min-height: auto; padding-top: 112px; }
    .profile-card { max-width: 430px; margin-inline: auto; }
    .contact-card { grid-template-columns: 1fr; }
    .sticky-title { position: static; }
}

@media (max-width: 767px) {
    .container { padding-left: 16px; padding-right: 16px; }
    .section { padding: 62px 0; }
    .hero { padding-top: 104px; padding-bottom: 48px; }
    .hero h1 { font-size: clamp(2.18rem, 10.5vw, 3.6rem); line-height: 1.02; letter-spacing: .005em; }
    .section-head h2, .contact-card h2 { font-size: clamp(2rem, 9vw, 3.1rem); line-height: 1.02; letter-spacing: .008em; }
    .lead-text, .section-head p, .contact-card p { font-size: .97rem; line-height: 1.6; }
    .contact-card p { margin-top: 14px; }
    .eyebrow { font-size: .68rem; letter-spacing: .105em; margin-bottom: 12px; }
    .hero-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .btn-main, .btn-soft { width: 100%; min-height: 50px; }
    .tag-list { gap: 7px; }
    .tag-list span, .project-stack span { min-height: 31px; padding-inline: 10px; font-size: .75rem; }
    .profile-card { border-radius: 28px; padding: 11px; }
    .profile-photo { border-radius: 21px; }
    .stats { gap: 7px; }
    .stats div { padding: 10px 7px; border-radius: 14px; }
    .stats strong { font-size: 1.22rem; }
    .stats span { font-size: .64rem; }
    .info-card, .project-card, .skill-card { padding: 19px; border-radius: 22px; }
    .filter-bar { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; padding-bottom: 4px; scrollbar-width: none; }
    .filter-bar::-webkit-scrollbar { display: none; }
    .filter-btn { flex: 0 0 auto; min-height: 40px; padding-inline: 14px; }
    .portfolio-grid { --bs-gutter-x: .75rem; --bs-gutter-y: .75rem; }
    .work-card { border-radius: 17px; box-shadow: 0 12px 32px rgba(0, 0, 0, .16); }
    .work-copy { padding: 9px 9px 10px; }
    .work-copy small { font-size: .6rem; margin-bottom: 4px; }
    .work-copy strong { min-height: 2.18em; font-size: .78rem; line-height: 1.1; }
    .play-icon { width: 40px; height: 40px; font-size: .8rem; }
    .project-wide { display: block; }
    .skills-track { animation-duration: 48s; }
    .skills-list { gap: 9px; padding: 0 4px; }
    .skills-list li { padding: 13px 18px; line-height: 1.35; font-size: .82rem; border-radius: 999px; }
    .contact-card { padding: 22px; border-radius: 24px; }
    .contact-links a { padding: 13px 14px; }
    .footer-inner { display: grid; gap: 8px; }
    .decor { display: none; }
    .media-modal { align-items: center; padding: 10px; }
    .modal-panel { max-height: 92vh; max-height: 92dvh; border-radius: 22px; }
    .modal-head { padding: 15px 58px 12px 16px; }
    .modal-body { padding: 10px; }
    .modal-body img, .modal-body video { max-height: calc(92vh - 112px); max-height: calc(92dvh - 112px); border-radius: 14px; }
}

@media (max-width: 390px) {
    .brand-name { max-width: 116px; }
    .theme-label { display: none; }
    .theme-toggle { width: 44px; padding: 0; }
    .work-copy strong { font-size: .74rem; }
    .stats span { font-size: .6rem; }
}
