/* =========================================================
   Shovon Lal Chakroborty — Portfolio
   Design system + layout + animation
========================================================= */

:root {
    --bg: #0a0e17;
    --bg-alt: #0d1220;
    --surface: #121828;
    --surface-2: #161d30;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text: #eef1f8;
    --text-dim: #98a2b8;
    --text-faint: #626d85;

    --accent: #6d5bff;
    --accent-2: #00d9c8;
    --accent-3: #ff5fa2;
    --accent-grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    --accent-grad-2: linear-gradient(135deg, var(--accent-3) 0%, var(--accent) 100%);

    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 40px rgba(109, 91, 255, 0.25);

    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 24px;

    --ff-heading: 'Space Grotesk', sans-serif;
    --ff-body: 'Inter', sans-serif;
    --ff-mono: 'JetBrains Mono', monospace;

    --header-h: 76px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    --bg: #f5f6fb;
    --bg-alt: #ffffff;
    --surface: #ffffff;
    --surface-2: #f0f2f9;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.14);

    --text: #10131c;
    --text-dim: #4b5468;
    --text-faint: #838da3;

    --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.10);
    --shadow-glow: 0 0 40px rgba(109, 91, 255, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--ff-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font: inherit; color: inherit; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.text-gradient {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* =========================================================
   Scroll progress bar
========================================================= */
.scroll-progress {
    position: fixed; top: 0; left: 0;
    height: 3px; width: 0%;
    background: var(--accent-grad);
    z-index: 1200;
    box-shadow: 0 0 12px rgba(109, 91, 255, 0.6);
}

/* =========================================================
   Background decor
========================================================= */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
    opacity: 0.6;
}

.bg-glow {
    position: fixed;
    z-index: -1;
    width: 60vw;
    height: 60vw;
    max-width: 900px;
    max-height: 900px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.18;
    pointer-events: none;
}
.bg-glow-1 { top: -20%; left: -10%; background: var(--accent); animation: float-glow 18s ease-in-out infinite; }
.bg-glow-2 { bottom: -25%; right: -10%; background: var(--accent-2); animation: float-glow 22s ease-in-out infinite reverse; }

@keyframes float-glow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, 8%) scale(1.15); }
}

/* =========================================================
   Preloader
========================================================= */
.preloader {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
.preloader.hidden { opacity: 0; visibility: hidden; }
.preloader-inner { text-align: center; }
.preloader-logo {
    font-family: var(--ff-mono);
    font-size: 2rem;
    font-weight: 500;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    margin-bottom: 20px;
    animation: pulse-scale 1.4s ease-in-out infinite;
}
@keyframes pulse-scale { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.preloader-bar { width: 160px; height: 3px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 0 auto; }
.preloader-bar span { display: block; height: 100%; width: 40%; background: var(--accent-grad); border-radius: 3px; animation: bar-slide 1.1s ease-in-out infinite; }
@keyframes bar-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* =========================================================
   Custom cursor (desktop only)
========================================================= */
.cursor-dot, .cursor-ring {
    position: fixed; top: 0; left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cursor-dot { width: 6px; height: 6px; background: var(--accent-2); }
.cursor-ring { width: 34px; height: 34px; border: 1.5px solid var(--accent); transition: opacity 0.3s ease, transform 0.15s ease, width .2s, height .2s; }
.cursor-active .cursor-dot, .cursor-active .cursor-ring { opacity: 1; }
.cursor-ring.grow { width: 54px; height: 54px; background: rgba(109, 91, 255, 0.1); }

/* =========================================================
   Buttons
========================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 13px 26px;
    border-radius: 999px;
    font-family: var(--ff-heading);
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.3s, border-color .3s;
    position: relative;
}
.btn-primary {
    background: var(--accent-grad);
    color: #fff;
    box-shadow: 0 8px 24px rgba(109, 91, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(109, 91, 255, 0.5); }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-strong);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); background: rgba(109, 91, 255, 0.08); transform: translateY(-3px); }
.btn-lg { padding: 15px 32px; font-size: 1rem; }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* =========================================================
   Navbar
========================================================= */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--header-h);
    display: flex; align-items: center;
    transition: background 0.4s var(--ease), border-color .4s, backdrop-filter .4s, height .3s;
    border-bottom: 1px solid transparent;
}
.navbar.scrolled {
    height: 66px;
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: blur(16px) saturate(160%);
    border-bottom-color: var(--border);
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.brand {
    font-family: var(--ff-mono);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text);
}
.brand span { color: var(--accent-2); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
    position: relative;
    padding: 8px 16px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-dim);
    border-radius: 999px;
    transition: color 0.3s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
    content: '';
    position: absolute;
    left: 16px; right: 16px; bottom: 2px;
    height: 2px;
    background: var(--accent-grad);
    border-radius: 2px;
}

.navbar-actions { display: flex; align-items: center; gap: 14px; }

.theme-toggle {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    color: var(--text-dim);
    position: relative;
    transition: border-color .3s, color .3s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle i { position: absolute; transition: opacity .3s, transform .4s var(--ease); font-size: 0.95rem; }
.theme-toggle .fa-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.theme-toggle .fa-moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .theme-toggle .fa-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .theme-toggle .fa-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

.hamburger {
    display: none;
    width: 38px; height: 38px;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.hamburger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .35s var(--ease), opacity .3s; }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Hero
========================================================= */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-h);
    overflow: hidden;
}
#particles { position: absolute; inset: 0; z-index: 0; opacity: 0.6; }

.hero-inner {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 60px;
    perspective: 1200px;
}

.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--ff-mono);
    font-size: 0.85rem;
    color: var(--accent-2);
    background: rgba(0, 217, 200, 0.08);
    border: 1px solid rgba(0, 217, 200, 0.25);
    padding: 7px 16px;
    border-radius: 999px;
    margin-bottom: 24px;
}
.dot-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); position: relative; }
.dot-pulse::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--accent-2);
    animation: ping 1.8s cubic-bezier(0,0,0.2,1) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(3); opacity: 0; } }

.hero-title {
    font-family: var(--ff-heading);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-bottom: 22px;
    --typed-size: clamp(1.6rem, 3.4vw, 2.5rem);
    min-height: calc((clamp(2.4rem, 5vw, 3.8rem) + 2 * var(--typed-size)) * 1.12);
}
.typed { color: var(--text-dim); font-size: var(--typed-size); }
.typed-cursor { color: var(--accent); font-weight: 300; font-size: var(--typed-size); animation: blink 0.9s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc { font-size: 1.08rem; color: var(--text-dim); max-width: 540px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 22px; font-size: 0.88rem; color: var(--text-faint); font-family: var(--ff-mono); }
.hero-meta i { color: var(--accent); margin-right: 6px; }

/* Hero visual */
.hero-visual { display: flex; align-items: center; justify-content: center; position: relative; transition: transform 0.3s ease-out; transform-style: preserve-3d; }
.avatar-ring { position: relative; width: 340px; height: 340px; display: flex; align-items: center; justify-content: center; }

.avatar-orbit {
    position: absolute; inset: 0;
    border: 1px dashed var(--border-strong);
    border-radius: 50%;
    animation: spin 30s linear infinite;
}
.avatar-orbit-2 { inset: 30px; border-style: solid; border-color: var(--border); animation-duration: 22s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.avatar-circle {
    width: 220px; height: 220px;
    border-radius: 50%;
    background: var(--accent-grad);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-glow), 0 0 0 8px var(--bg), 0 0 0 9px var(--border);
    animation: float-y 5s ease-in-out infinite;
    padding: 5px;
    overflow: hidden;
}
.avatar-circle img {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
}
.avatar-circle span {
    font-family: var(--ff-heading);
    font-size: 4.2rem;
    font-weight: 700;
    color: #fff;
}
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.badge {
    position: absolute;
    width: 52px; height: 52px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    box-shadow: var(--shadow-lg);
    animation: float-y 4s ease-in-out infinite;
}
.badge-1 { top: 0; right: 10px; color: var(--accent-2); animation-delay: 0.2s; }
.badge-2 { bottom: 40px; left: -20px; color: var(--accent); animation-delay: 0.6s; }
.badge-3 { bottom: 0; right: 40px; color: var(--accent-3); animation-delay: 1s; }
.badge-4 { top: 60px; left: -10px; color: #83cd29; animation-delay: 1.4s; }
.badge-5 { top: -20px; left: calc(50% - 26px); color: #ffd166; animation-delay: 1.8s; }

.scroll-indicator {
    position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
    width: 26px; height: 42px; border: 2px solid var(--border-strong); border-radius: 20px;
    display: flex; justify-content: center; padding-top: 8px;
    z-index: 2;
}
.scroll-indicator span { width: 4px; height: 8px; border-radius: 2px; background: var(--accent); animation: scroll-dot 1.6s ease-in-out infinite; }
@keyframes scroll-dot { 0% { opacity: 1; transform: translateY(0); } 70%,100% { opacity: 0; transform: translateY(12px); } }

/* =========================================================
   Sections (generic)
========================================================= */
.section { padding: 130px 0; position: relative; }
.section-alt { background: var(--bg-alt); }

.section-eyebrow {
    font-family: var(--ff-mono);
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
    text-align: center;
}
.section-title {
    font-family: var(--ff-heading);
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}
.section-sub { text-align: center; color: var(--text-dim); max-width: 560px; margin: 0 auto 60px; }
.section-title + .about-grid,
.section-title + .skills-grid,
.section-title + .filter-bar { margin-top: 60px; }

/* =========================================================
   Reveal-on-scroll
========================================================= */
[data-reveal] {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-reveal].in-view { opacity: 1; transform: translateY(0); }

/* Timeline items slide in from alternating sides instead of the default up-fade */
.timeline-item[data-reveal] { transform: translateX(-44px); }
.timeline-item[data-side="right"][data-reveal] { transform: translateX(44px); }
.timeline-item[data-reveal].in-view { transform: translateX(0); }

/* =========================================================
   Section title underline draw-in
========================================================= */
.section-title { position: relative; padding-bottom: 20px; }
.section-title::after {
    content: '';
    position: absolute; left: 50%; bottom: 0;
    width: 60px; height: 3px;
    border-radius: 3px;
    background: var(--accent-grad);
    transform: translateX(-50%) scaleX(0);
    transition: transform 0.7s var(--ease) 0.15s;
}
.section-title.in-view::after { transform: translateX(-50%) scaleX(1); }

/* =========================================================
   Spotlight glow + 3D tilt cards
========================================================= */
.glow-card { position: relative; isolation: isolate; }
.glow-card::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(109, 91, 255, 0.18), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: -1;
}
.glow-card:hover::before { opacity: 1; }

.tilt-card { will-change: transform; }
.tilt-card, .tilt-card:hover { transition: transform 0.15s ease-out, border-color 0.4s, box-shadow 0.4s; }

/* =========================================================
   Magnetic buttons & icons
========================================================= */
.magnetic, .magnetic-sm { transition: transform 0.2s ease-out, box-shadow 0.35s, border-color 0.35s, background 0.3s; }

/* =========================================================
   Tech marquee
========================================================= */
.marquee-section {
    padding: 36px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
    overflow: hidden;
}
.marquee {
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
    display: flex;
    align-items: center;
    gap: 56px;
    width: max-content;
    animation: marquee-scroll 32s linear infinite;
}
.marquee-section:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--ff-mono);
    font-size: 0.92rem;
    color: var(--text-faint);
    white-space: nowrap;
    transition: color 0.3s;
}
.marquee-item i { font-size: 1.4rem; color: var(--text-dim); transition: color 0.3s, transform 0.3s; }
.marquee-item:hover { color: var(--accent); }
.marquee-item:hover i { color: var(--accent-2); transform: scale(1.15) translateY(-2px); }
@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* =========================================================
   Confetti burst (contact form success)
========================================================= */
.confetti-piece {
    position: fixed;
    top: 0; left: 0;
    width: 8px; height: 8px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 3000;
    animation: confetti-burst 1.1s ease-out forwards;
}
@keyframes confetti-burst {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)); opacity: 0; }
}

/* =========================================================
   About
========================================================= */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; align-items: start; margin-bottom: 70px; margin-top: 60px; }
.about-text p { color: var(--text-dim); margin-bottom: 18px; font-size: 1.02rem; }
.about-text p:last-child { margin-bottom: 0; }

.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 20px;
    text-align: center;
    transition: transform .4s var(--ease), border-color .4s;
}
.stat-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.stat-value, .stat-suffix {
    font-family: var(--ff-heading);
    font-size: 2.1rem;
    font-weight: 700;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat-label { display: block; margin-top: 8px; font-size: 0.85rem; color: var(--text-faint); }

.highlight-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.highlight-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 22px;
    transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
}
.highlight-card:hover { transform: translateY(-8px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.highlight-icon {
    width: 48px; height: 48px; border-radius: 14px;
    background: var(--accent-grad);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.15rem;
    margin-bottom: 16px;
}
.highlight-card h3 { font-family: var(--ff-heading); font-size: 1.05rem; margin-bottom: 8px; }
.highlight-card p { color: var(--text-dim); font-size: 0.9rem; }

/* =========================================================
   Skills
========================================================= */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 60px; }
.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: border-color .4s, transform .4s var(--ease);
}
.skill-card:hover { border-color: var(--border-strong); }
.skill-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.skill-card-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: rgba(109, 91, 255, 0.12);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.skill-card-head h3 { font-family: var(--ff-heading); font-size: 1.1rem; }

.skill-bar-row { margin-bottom: 18px; }
.skill-bar-row:last-child { margin-bottom: 0; }
.skill-bar-label { display: flex; justify-content: space-between; font-size: 0.88rem; margin-bottom: 8px; color: var(--text-dim); }
.skill-percent { font-family: var(--ff-mono); color: var(--text-faint); }
.skill-bar-track { height: 7px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.skill-bar-fill {
    height: 100%; width: 0%;
    border-radius: 6px;
    background: var(--accent-grad);
    transition: width 1.4s var(--ease);
    position: relative;
}
.skill-bar-fill.filled { width: var(--w); }

/* =========================================================
   Experience timeline
========================================================= */
.timeline { position: relative; max-width: 820px; margin: 60px auto 0; padding-left: 34px; }
.timeline::before {
    content: '';
    position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
    background: linear-gradient(var(--border-strong), var(--border) 90%);
}
.timeline-item { position: relative; margin-bottom: 44px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
    position: absolute; left: -34px; top: 6px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 5px var(--bg);
}
.timeline-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 30px;
    transition: transform .4s var(--ease), border-color .4s;
}
.timeline-card:hover { transform: translateX(6px); border-color: var(--border-strong); }
.timeline-period {
    display: inline-block;
    font-family: var(--ff-mono);
    font-size: 0.8rem;
    color: var(--accent-2);
    background: rgba(0, 217, 200, 0.08);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.timeline-card h3 { font-family: var(--ff-heading); font-size: 1.25rem; margin-bottom: 4px; }
.timeline-company { color: var(--text-faint); font-size: 0.92rem; margin-bottom: 16px; }
.timeline-card ul { display: flex; flex-direction: column; gap: 10px; }
.timeline-card li { position: relative; padding-left: 20px; color: var(--text-dim); font-size: 0.94rem; }
.timeline-card li::before { content: '▹'; position: absolute; left: 0; color: var(--accent); }

.education-block { max-width: 820px; margin: 70px auto 0; }
.education-heading {
    font-family: var(--ff-heading); font-size: 1.3rem;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px; color: var(--text);
}
.education-heading i { color: var(--accent); }
.education-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.education-card h4 { font-family: var(--ff-heading); font-size: 1.05rem; margin-bottom: 4px; }
.education-card p { color: var(--text-faint); font-size: 0.9rem; }
.education-meta { text-align: right; display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--text-dim); font-family: var(--ff-mono); }

/* =========================================================
   Projects
========================================================= */
.filter-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 60px 0 46px; }
.filter-btn {
    padding: 9px 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.87rem;
    font-weight: 500;
    transition: all 0.3s var(--ease);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active { background: var(--accent-grad); color: #fff; border-color: transparent; }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    transition: transform .45s var(--ease), border-color .4s, box-shadow .45s, opacity .4s, height .4s;
}
.project-card:hover { transform: translateY(-8px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.project-card.hide { display: none; }
.project-card-top { margin-bottom: 18px; }
.project-icon {
    width: 50px; height: 50px; border-radius: 14px;
    background: var(--accent-grad);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
}
.project-card h3 { font-family: var(--ff-heading); font-size: 1.12rem; margin-bottom: 10px; line-height: 1.35; }
.project-card p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    font-family: var(--ff-mono);
    font-size: 0.75rem;
    color: var(--accent-2);
    background: rgba(0, 217, 200, 0.08);
    border: 1px solid rgba(0, 217, 200, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
}

/* =========================================================
   Achievements
========================================================= */
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; margin-top: 60px; }
.achievement-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    transition: transform .4s var(--ease), border-color .4s;
}
.achievement-card:hover { transform: translateY(-6px) scale(1.02); border-color: var(--accent); }
.achievement-icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(109, 91, 255, 0.1);
    color: var(--accent);
    font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}
.achievement-card h3 { font-family: var(--ff-heading); font-size: 1.05rem; margin-bottom: 6px; }
.achievement-card p { color: var(--text-faint); font-size: 0.88rem; }

/* =========================================================
   Contact
========================================================= */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 40px; margin-top: 60px; }

.contact-info { display: flex; flex-direction: column; gap: 16px; }
.contact-info-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    transition: transform .35s var(--ease), border-color .35s;
}
a.contact-info-card:hover { transform: translateX(6px); border-color: var(--accent); }
.contact-info-icon {
    width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
    background: var(--accent-grad);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.contact-info-card span { display: block; font-size: 0.8rem; color: var(--text-faint); margin-bottom: 3px; }
.contact-info-card p { font-size: 0.95rem; word-break: break-word; }

.contact-socials { display: flex; gap: 12px; margin-top: 10px; }
.contact-socials a {
    width: 46px; height: 46px; border-radius: 12px;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.35s var(--ease);
}
.contact-socials a:hover { background: var(--accent-grad); border-color: transparent; color: #fff; transform: translateY(-4px); }

.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { position: relative; margin-bottom: 22px; }
.form-group input, .form-group textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 16px 8px;
    color: var(--text);
    transition: border-color 0.3s;
    resize: vertical;
}
.form-group textarea { min-height: 120px; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group label {
    position: absolute; left: 16px; top: 16px;
    color: var(--text-faint);
    font-size: 0.95rem;
    pointer-events: none;
    transition: all 0.2s ease;
}
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: 7px; font-size: 0.7rem; color: var(--accent);
}

.btn-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.contact-form.loading .btn-text { display: none; }
.contact-form.loading .btn-spinner { display: inline-block; }
.contact-form.loading .btn-primary { pointer-events: none; opacity: 0.8; }

.form-status { margin-top: 14px; font-size: 0.9rem; text-align: center; min-height: 20px; }
.form-status.success { color: #2ecc71; }
.form-status.error { color: #ff5f6d; }

/* =========================================================
   Footer
========================================================= */
.footer { padding: 60px 0 40px; border-top: 1px solid var(--border); text-align: center; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.footer-tagline { color: var(--text-faint); font-size: 0.9rem; }
.footer-socials { display: flex; gap: 14px; }
.footer-socials a {
    width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.35s var(--ease);
}
.footer-socials a:hover { background: var(--accent-grad); border-color: transparent; color: #fff; transform: translateY(-4px); }
.footer-copy { color: var(--text-faint); font-size: 0.82rem; margin-top: 10px; }

/* =========================================================
   Back to top
========================================================= */
.back-to-top {
    position: fixed; bottom: 30px; right: 30px; z-index: 900;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--accent-grad);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: all 0.4s var(--ease);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-4px); }

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 1024px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 60px; }
    .hero-text { order: 2; }
    .hero-visual { order: 1; }
    .hero-desc { margin-left: auto; margin-right: auto; }
    .hero-actions, .hero-meta { justify-content: center; }
    .about-grid { grid-template-columns: 1fr; }
    .highlight-grid { grid-template-columns: repeat(2, 1fr); }
    .skills-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-links { position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; flex-direction: column; justify-content: flex-start; padding: 40px 24px; gap: 6px;
        background: var(--bg); backdrop-filter: blur(20px);
        transform: translateX(100%); opacity: 0; visibility: hidden;
        transition: transform 0.45s var(--ease), opacity 0.4s, visibility 0.4s; }
    .nav-links.open { transform: translateX(0); opacity: 1; visibility: visible; }
    .nav-link { width: 100%; padding: 16px; font-size: 1.05rem; border-bottom: 1px solid var(--border); border-radius: 0; }
    .hamburger { display: flex; }
    .avatar-ring { width: 260px; height: 260px; }
    .avatar-circle { width: 170px; height: 170px; }
    .avatar-circle span { font-size: 3.2rem; }
    .highlight-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .about-stats { grid-template-columns: 1fr 1fr; }
    .section { padding: 90px 0; }
    .education-card { flex-direction: column; align-items: flex-start; text-align: left; }
    .education-meta { text-align: left; }
    .marquee-track { gap: 34px; }
    .marquee-item { font-size: 0.82rem; }
    .marquee-item i { font-size: 1.2rem; }
    .timeline-item[data-reveal],
    .timeline-item[data-side="right"][data-reveal] { transform: translateY(30px); }
}

@media (max-width: 480px) {
    .hero-title { min-height: unset; }
    .contact-form { padding: 26px; }
}

@media (hover: none) {
    .cursor-dot, .cursor-ring { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
    .marquee-track { animation: none !important; }
}
