:root {
    --bg: #f6f7fb;
    --bg-soft: #ffffff;
    --card: rgba(255,255,255,.78);
    --text: #11131a;
    --muted: #6f7482;
    --border: rgba(17,19,26,.09);
    --accent: #6c63ff;
    --accent-2: #8f87ff;
    --accent-soft: rgba(108,99,255,.11);
    --shadow: 0 20px 60px rgba(18, 20, 35, .08);
    --header: rgba(246,247,251,.72);
    --success: #2fbc78;
}

body.dark {
    --bg: #0b0d12;
    --bg-soft: #11141b;
    --card: rgba(19,23,31,.82);
    --text: #f2f4f8;
    --muted: #989fad;
    --border: rgba(255,255,255,.08);
    --accent: #8c84ff;
    --accent-2: #aaa4ff;
    --accent-soft: rgba(140,132,255,.14);
    --shadow: 0 20px 70px rgba(0,0,0,.28);
    --header: rgba(11,13,18,.72);
    --success: #42cf8d;
}


* { box-sizing: border-box; margin: 0; padding: 0; }
body { position: relative; overflow-x: hidden; }
#dotBackground {
    position: fixed; inset: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}
header, main, footer { position: relative; z-index: 1; }
html { scroll-behavior: smooth; }
body.modal-open { overflow: hidden; }
body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at 10% 0%, var(--accent-soft), transparent 22%), var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
section { scroll-margin-top: 90px; }

.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.section { padding: 110px 0; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .78rem; font-weight: 800; letter-spacing: .14em;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 16px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 40px; }
.section-head h2 {
    font-family: "Space Grotesk", sans-serif; font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05; letter-spacing: -.04em;
}
.section-head p { max-width: 560px; color: var(--muted); }

.navbar.nav-hero { background: transparent; backdrop-filter: none; border-bottom-color: transparent; }
.navbar.nav-hidden { transform: translateY(-105%); }
.nav-links a.active, .mobile-nav a.active { color: var(--text); font-weight: 800; }
.nav-links a.active::after { content: ""; display: block; width: 100%; height: 2px; margin-top: 3px; border-radius: 99px; background: var(--accent); }
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    backdrop-filter: blur(18px);
    background: var(--header);
    border-bottom: 1px solid var(--border);
    transition: .3s ease;
}
.nav-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { font-family: "Space Grotesk", sans-serif; font-size: 1.15rem; font-weight: 700; letter-spacing: -.03em; }
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { font-size: .9rem; color: var(--muted); font-weight: 600; transition: .2s ease; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn, .menu-btn {
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-soft); color: var(--text); display: grid; place-items: center;
    transition: .25s ease;
}
.icon-btn:hover, .menu-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.menu-btn { display: none; border-radius: 12px; }

.hero { min-height: 100vh; display: grid; align-items: center; padding: 145px 0 85px; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 70px; }
.hero h1 {
    font-family: "Space Grotesk", sans-serif; font-size: clamp(3.5rem, 8vw, 5rem);
    line-height: .93; letter-spacing: -.07em; max-width: 800px;
}
.hero h1 .accent { color: var(--accent); }
.hero-copy { margin: 26px 0 32px; max-width: 640px; color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
    border: 1px solid var(--border); border-radius: 14px; padding: 13px 18px; display: inline-flex;
    align-items: center; gap: 10px; font-weight: 700; transition: .25s ease;
}
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { background: var(--bg-soft); }
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }
.availability { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; margin-top: 26px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(66,207,141,.11); }

.hero-card {
    position: relative; padding: 22px; border: 1px solid var(--border); border-radius: 30px;
    background: linear-gradient(145deg, var(--bg-soft), var(--accent-soft)); box-shadow: var(--shadow); overflow: hidden;
}
.hero-card::before {
    content: ""; position: absolute; width: 230px; height: 230px; right: -60px; top: -60px;
    border-radius: 50%; background: radial-gradient(circle, var(--accent), transparent 68%); opacity: .45; filter: blur(14px);
}
.profile-box { aspect-ratio: 4 / 5; border-radius: 24px; overflow: hidden; background: #dcdcf0; position: relative; }
.profile-placeholder {
    height: 100%; display: grid; place-items: center; padding: 24px; text-align: center;
    background: linear-gradient(145deg, #cdc9ff, #f1f1ff); color: #333054;
    font-family: "Space Grotesk", sans-serif; font-size: 1.3rem; font-weight: 700;
}
.floating-tag { position: absolute; left: 34px; bottom: 35px; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.88); color: #16131f; font-size: .8rem; font-weight: 800; box-shadow: 0 10px 24px rgba(0,0,0,.1); }
body.dark .floating-tag { background: rgba(17,20,27,.9); color: #fff; }

.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; }
.card { background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 24px; }
.about-story { padding: 0; position: relative; min-height: 410px; overflow: hidden; }
.about-slider { touch-action: pan-y; }
.about-slide { position: absolute; inset: 0; padding: 30px 30px 78px; opacity: 0; transform: translateX(28px); pointer-events: none; transition: opacity .38s ease, transform .38s ease; }
.about-slide.active { opacity: 1; transform: none; pointer-events: auto; }
.about-slide-text { overflow: auto; }
.about-photo { height: 100%; min-height: 300px; border-radius: 18px; overflow: hidden; background: linear-gradient(145deg, var(--accent-soft), var(--bg)); }
.about-photo img, .about-photo .profile-placeholder { width: 100%; height: 100%; }
.about-slide-caption { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.about-slide-caption span { color: var(--muted); font-size: .86rem; }
.about-slide-btn { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); box-shadow: var(--shadow); transition: .25s ease; z-index: 3; }
.about-slide-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateX(-50%) translateY(-2px); }
.about-story h3 { font-family: "Space Grotesk"; font-size: 1.65rem; margin-bottom: 14px; }
.about-story p { color: var(--muted); }
.facts { padding: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.fact { padding: 18px; border-radius: 17px; background: var(--bg-soft); border: 1px solid var(--border); }
.fact small { color: var(--muted); display: block; font-size: .74rem; margin-bottom: 6px; }
.fact strong { font-size: .95rem; }

.skills-shell { overflow: hidden; padding: 10px 0; position: relative; }
.skills-track { display: flex; gap: 14px; width: max-content; animation: marquee 34s linear infinite; }
.skills-shell:hover .skills-track { animation-play-state: paused; }
.skill-pill { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 18px; background: var(--bg-soft); border: 1px solid var(--border); min-width: 150px; }
.skill-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .72rem; background: var(--accent-soft); color: var(--accent); }
.skill-pill strong { font-size: .92rem; }
.skill-pill span { display: block; color: var(--muted); font-size: .7rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

.timeline { position: relative; margin-top: 30px; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline-item { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 22px; padding-bottom: 30px; }
.timeline-dot { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-soft); display: grid; place-items: center; z-index: 1; color: var(--accent); font-weight: 800; font-size: .76rem; }
.timeline-card { padding: 20px 22px; border: 1px solid var(--border); background: var(--bg-soft); border-radius: 18px; }
.timeline-card small { color: var(--accent); font-weight: 700; }
.timeline-card h3 { margin: 4px 0 5px; font-family: "Space Grotesk"; font-size: 1.12rem; }
.timeline-card p { color: var(--muted); font-size: .9rem; }

.carousel { position: relative; }
.carousel-viewport { overflow: hidden; border-radius: 24px; }
.carousel-track { display: flex; transition: transform .45s cubic-bezier(.2,.75,.25,1); }
.slide { flex: 0 0 100%; }
[data-carousel="achievement"] .carousel-track, [data-carousel="projects"] .carousel-track { gap: 16px; }
[data-carousel="achievement"] .slide, [data-carousel="projects"] .slide { flex: 0 0 calc((100% - 32px) / 3); }
[data-carousel="achievement"] .slide, [data-carousel="experience"] .slide, [data-carousel="projects"] .slide { cursor: pointer; }
.achievement-card, .experience-card { padding: 22px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 24px; }
.slide-media { aspect-ratio: 16/8.7; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), var(--bg)); }
.image-placeholder { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--muted); font-weight: 700; }
.slide-info { padding: 20px 4px 0; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; }
.slide-info h3 { font-family: "Space Grotesk"; font-size: 1.35rem; }
.slide-info p { color: var(--muted); font-size: .9rem; }
.slide-year { color: var(--accent); font-weight: 800; font-size: .85rem; }
.carousel-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.control-group { display: flex; gap: 8px; }
.carousel-btn { width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); }
.carousel-btn:hover { border-color: var(--accent); }
.dots { display: flex; gap: 7px; }
.dot-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: .25s ease; }
.dot-indicator.active { width: 24px; border-radius: 10px; background: var(--accent); }

.projects-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.project-card { grid-column: span 6; padding: 18px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 24px; transition: .25s ease; }
.project-card:nth-child(3n) { grid-column: span 12; }
.project-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.project-thumb { aspect-ratio: 16/9; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), var(--bg)); }
.project-thumb .image-placeholder { font-size: 1rem; }
.project-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; }
.project-meta h3 { font-family: "Space Grotesk"; font-size: 1.25rem; }
.project-meta p { color: var(--muted); font-size: .88rem; margin-top: 5px; max-width: 760px; }
.stack { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.stack span { padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .72rem; }
.project-link { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; border: 1px solid var(--border); display: grid; place-items: center; }

.gallery-grid { columns: 4 220px; column-gap: 16px; }
.gallery-item { break-inside: avoid; margin-bottom: 16px; border-radius: 20px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-soft); transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease; }
.gallery-item:hover { transform: translateY(-7px) scale(1.012); box-shadow: var(--shadow); border-color: var(--accent); }
.gallery-item:hover .gallery-caption { color: var(--text); }
.gallery-item .image-placeholder { min-height: 180px; }
.gallery-more-wrap { display: flex; justify-content: center; margin-top: 26px; }
.gallery-extra { display: none; }
.gallery-grid.expanded .gallery-extra { display: block; }
.gallery-more-wrap .btn { min-width: 120px; justify-content: center; }
.gallery-item.tall .image-placeholder { min-height: 320px; }
.gallery-item.small .image-placeholder { min-height: 150px; }
.gallery-caption { padding: 12px 14px; color: var(--muted); font-size: .78rem; }

.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 20px; }
.contact-card { padding: 28px; }
.contact-card h3 { font-family: "Space Grotesk"; font-size: 1.7rem; margin-bottom: 10px; }
.contact-card p { color: var(--muted); }
.contact-list { display: grid; gap: 10px; margin-top: 24px; }
.contact-item { display: flex; align-items: center; gap: 13px; padding: 14px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 15px; }
.contact-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.contact-item small { display: block; color: var(--muted); font-size: .72rem; }
.contact-item strong { font-size: .88rem; }
.contact-form { padding: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1/-1; }
.field label { font-size: .78rem; color: var(--muted); }
.field input, .field textarea { width: 100%; padding: 13px 14px; border-radius: 13px; border: 1px solid var(--border); outline: none; background: var(--bg-soft); color: var(--text); transition: .2s ease; }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

footer { padding: 30px 0 45px; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 15px; color: var(--muted); font-size: .84rem; }
.footer-links { display: flex; gap: 14px; }
.footer-links a:hover { color: var(--text); }

.reveal { opacity: 1; transform: none; }
.education-reveal { opacity: 0; transform: translateY(22px); transition: .7s ease; }
.education-reveal.show { opacity: 1; transform: none; }

.mobile-nav { display: none; padding: 8px 20px 18px; }
.mobile-nav a { display: block; padding: 10px 0; color: var(--muted); font-weight: 600; opacity: 0; transform: translateY(-8px); }
.mobile-nav.open a { animation: mobileNavItem .42s cubic-bezier(.2,.75,.25,1) forwards; }
.mobile-nav.open a:nth-child(1) { animation-delay: .03s; }
.mobile-nav.open a:nth-child(2) { animation-delay: .06s; }
.mobile-nav.open a:nth-child(3) { animation-delay: .09s; }
.mobile-nav.open a:nth-child(4) { animation-delay: .12s; }
.mobile-nav.open a:nth-child(5) { animation-delay: .15s; }
.mobile-nav.open a:nth-child(6) { animation-delay: .18s; }
.mobile-nav.open a:nth-child(7) { animation-delay: .21s; }
.mobile-nav.open a:nth-child(8) { animation-delay: .24s; }
@keyframes mobileNavItem { to { opacity: 1; transform: translateY(0); } }

.detail-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; transition: .25s ease; }
.detail-modal.open { opacity: 1; visibility: visible; }
.detail-backdrop { position: absolute; inset: 0; background: rgba(6,8,14,.58); backdrop-filter: blur(8px); }
.detail-dialog { position: relative; width: min(620px, 100%); max-height: min(80vh, 720px); overflow: auto; padding: 30px; background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 30px 90px rgba(0,0,0,.28); transform: translateY(18px) scale(.98); transition: .3s ease; }
.detail-modal.open .detail-dialog { transform: none; }
.detail-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 1.35rem; }
.detail-eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 800; margin-bottom: 8px; }
.detail-dialog h3 { font-family: "Space Grotesk"; font-size: clamp(1.7rem, 4vw, 2.3rem); margin-right: 48px; }
.detail-dialog #detailBody { margin-top: 14px; color: var(--muted); line-height: 1.8; }

.to-top { position: fixed; right: 24px; bottom: 24px; width: 54px; height: 54px; border: 0; border-radius: 50%; background: var(--bg-soft); color: var(--text); display: grid; place-items: center; z-index: 1200; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(12px); transition: .25s ease; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.to-top circle { fill: none; stroke-width: 2.5; }
.to-top-track { stroke: var(--border); }
.to-top-progress { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; }
.to-top span { position: relative; font-weight: 800; font-size: 1.1rem; }

@media (min-width: 981px) {
    #achievement.section, #experience.section, #projects.section { padding: 72px 0; }
    #achievement .section-head, #experience .section-head, #projects .section-head { margin-bottom: 28px; }
    .achievement-card, .experience-card, .project-card { padding: 16px; border-radius: 20px; }
    .slide-media, .project-thumb { aspect-ratio: 16/7.2; }
    #achievement .slide-info, #experience .slide-info, #projects .project-meta { padding-top: 14px; }
    #achievement .slide-info h3, #experience .slide-info h3, #projects .project-meta h3 { font-size: 1.1rem; }
    #achievement .slide-info p, #experience .slide-info p, #projects .project-meta p { font-size: .82rem; }
}

@media (max-width: 980px) {
    .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .hero-grid { gap: 40px; }
    .hero-card { max-width: 520px; margin: 0 auto; width: 100%; }
    .nav-links { display: none; }
    .menu-btn { display: grid; }
    .mobile-nav.open { display: block; }
    [data-carousel="achievement"] .slide, [data-carousel="projects"] .slide { flex-basis: 100%; }
    .section { padding: 90px 0; }
}

@media (max-width: 700px) {
    .container { width: min(100% - 28px, 1180px); }
    .nav-inner { height: 66px; }
    .hero { padding-top: 118px; }
    .hero h1 { font-size: clamp(3.1rem, 17vw, 5rem); }
    .section-head { display: block; }
    .section-head p { margin-top: 14px; }
    .facts, .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .slide-info { grid-template-columns: 1fr; }
    .about-story { min-height: 390px; }
    .about-slide { padding: 22px 22px 74px; }

    .contact-grid,
    .contact-list,
    .contact-item { display: flex; flex-direction: column; overflow-wrap: anywhere; word-break: break-word; }
    .contact-item { text-align: center; }

    .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}