/* ============================================
   VJRanga Portfolio — Styles
   ============================================ */

:root {
    --bg: #060606;
    --bg-2: #0b0b0c;
    --card: #101012;
    --card-border: #1e1e21;
    --card-hover: #2e2e33;
    --text: #f4f4f5;
    --text-2: #9d9da6;
    --text-3: #5c5c66;
    --accent: #F5F3D9;
    --accent-dim: rgba(245, 243, 217, 0.12);
    --accent-glow: rgba(245, 243, 217, 0.25);
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

::selection { background: var(--accent); color: #111; }

/* ============ Preloader ============ */
.preloader {
    position: fixed; inset: 0; z-index: 11000;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity .6s var(--ease), visibility .6s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.preloader-inner { text-align: center; }
.preloader-logo {
    font-family: var(--font-display); font-size: 2rem; font-weight: 700;
    letter-spacing: .3em; color: var(--text);
    animation: pulseLogo 1.2s ease-in-out infinite;
}
.preloader-logo span { color: var(--accent); }
.preloader-bar {
    width: 160px; height: 2px; background: var(--card-border);
    margin: 1.2rem auto 0; border-radius: 2px; overflow: hidden;
}
.preloader-bar::after {
    content: ''; display: block; height: 100%; width: 40%;
    background: var(--accent); border-radius: 2px;
    animation: loadSlide 1s var(--ease) infinite;
}
@keyframes pulseLogo { 50% { opacity: .6; } }
@keyframes loadSlide {
    from { transform: translateX(-100%); }
    to { transform: translateX(420%); }
}

/* ============ Backgrounds ============ */
.noise-overlay {
    position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#particles {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 30%, transparent 75%);
}
.orb {
    position: fixed; border-radius: 50%; filter: blur(120px);
    z-index: 0; pointer-events: none; opacity: .5;
}
.orb-1 {
    width: 480px; height: 480px; top: -160px; left: -120px;
    background: radial-gradient(circle, rgba(245,243,217,0.08), transparent 70%);
    animation: drift1 22s ease-in-out infinite alternate;
}
.orb-2 {
    width: 420px; height: 420px; bottom: -140px; right: -100px;
    background: radial-gradient(circle, rgba(160,160,180,0.07), transparent 70%);
    animation: drift2 26s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(80px, 120px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-90px, -100px) scale(1.1); } }

/* ============ Custom Cursor ============ */
@media (pointer: fine) {
    body { cursor: none; }
    a, button { cursor: none; }
}
.cursor-dot, .cursor-outline {
    position: fixed; top: 0; left: 0; transform: translate(-50%, -50%);
    border-radius: 50%; z-index: 10000; pointer-events: none;
}
.cursor-dot { width: 7px; height: 7px; background: var(--accent); }
.cursor-outline {
    width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.28);
    transition: width .25s, height .25s, border-color .25s, background-color .25s;
}
.cursor-outline.hovering {
    width: 64px; height: 64px;
    border-color: rgba(245,243,217,.6);
    background: rgba(245,243,217,.05);
}
@media (pointer: coarse) {
    .cursor-dot, .cursor-outline { display: none; }
}

/* ============ Scroll progress ============ */
.scroll-progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0%;
    background: linear-gradient(to right, var(--accent), rgba(245,243,217,.4));
    z-index: 10001;
}

/* ============ Nav ============ */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem 2rem;
    transition: background .4s, backdrop-filter .4s, border-color .4s, padding .4s;
    border-bottom: 1px solid transparent;
}
.nav.scrolled {
    background: rgba(6,6,6,.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--card-border);
    padding: .8rem 2rem;
}
.nav-logo {
    font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
    letter-spacing: .15em; color: var(--text); text-decoration: none;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a {
    color: var(--text-2); text-decoration: none; font-size: .88rem;
    font-weight: 500; position: relative; transition: color .3s;
}
.nav-links a::after {
    content: ''; position: absolute; left: 0; bottom: -5px;
    width: 100%; height: 1px; background: var(--accent);
    transform: scaleX(0); transform-origin: right;
    transition: transform .35s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after {
    transform: scaleX(1); transform-origin: left;
}
.nav-cta {
    font-size: .85rem; font-weight: 600; padding: .5rem 1.2rem;
    border: 1px solid var(--card-hover); border-radius: 50px;
    color: var(--text); text-decoration: none;
    transition: background .3s, color .3s, border-color .3s;
}
.nav-cta:hover { background: var(--accent); color: #111; border-color: var(--accent); }
@media (max-width: 768px) {
    .nav-links { display: none; }
}

/* ============ Layout ============ */
.container {
    max-width: 1200px; margin: 0 auto; padding: 0 2rem;
    position: relative; z-index: 1;
}
section { padding: 5.5rem 0 1rem; }

/* ============ Hero ============ */
.hero {
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; position: relative;
    padding: 7rem 0 4rem;
}
.hero-avatar-wrap { position: relative; margin-bottom: 2.2rem; }
.hero-avatar-wrap::before {
    content: ''; position: absolute; inset: -10px;
    border-radius: 50%;
    border: 1px dashed rgba(245,243,217,.35);
    animation: spin 18s linear infinite;
}
.hero-avatar-wrap::after {
    content: ''; position: absolute; inset: -22px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.06);
}
@keyframes spin { to { transform: rotate(360deg); } }
.profile-img {
    width: 140px; height: 140px; border-radius: 50%; object-fit: cover;
    display: block; border: 3px solid var(--card);
    box-shadow: 0 0 50px var(--accent-glow);
}
.hero-status {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .8rem; color: var(--text-2);
    background: rgba(255,255,255,.04);
    border: 1px solid var(--card-border);
    padding: .4rem 1rem; border-radius: 50px; margin-bottom: 1.6rem;
}
.hero-status .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #4ade80; position: relative;
}
.hero-status .dot::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: #4ade80; animation: ping 1.6s ease-out infinite;
}
@keyframes ping { to { transform: scale(2.6); opacity: 0; } }

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 8vw, 5.5rem);
    line-height: 1.05; font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1.2rem;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.4rem;
}
.hero h1 .word { display: inline-flex; overflow: hidden; padding-bottom: .08em; }
.hero h1 .char {
    display: inline-block;
    transform: translateY(110%);
    animation: charUp .8s var(--ease) forwards;
    background: linear-gradient(to bottom, #fff 55%, #777);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
@keyframes charUp { to { transform: translateY(0); } }

.hero-roles {
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 2.5vw, 1.4rem);
    color: var(--text-2); min-height: 2.2em;
    margin-bottom: 1rem;
}
.hero-roles .typed { color: var(--accent); }
.hero-roles .caret {
    display: inline-block; width: 2px; height: 1.1em;
    background: var(--accent); vertical-align: text-bottom;
    margin-left: 3px; animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
    color: var(--text-2); max-width: 620px; font-size: 1.02rem;
    margin-bottom: 2.4rem;
    text-wrap: balance;
    opacity: 0; animation: fadeUp 1s var(--ease) .9s forwards;
}
.hero-sub strong { color: var(--text); }

.hero-actions {
    display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
    opacity: 0; animation: fadeUp 1s var(--ease) 1.1s forwards;
}
.btn {
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .85rem 1.8rem; border-radius: 50px;
    font-family: var(--font-main); font-weight: 600; font-size: .92rem;
    text-decoration: none; border: 1px solid transparent;
    transition: transform .3s var(--ease), background .3s, color .3s, border-color .3s, box-shadow .3s;
    will-change: transform;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
    background: var(--accent); color: #131309; border-color: var(--accent);
}
.btn-primary:hover { box-shadow: 0 0 35px var(--accent-glow); }
.btn-ghost {
    color: var(--text); border-color: var(--card-hover);
    background: rgba(255,255,255,.03);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.scroll-hint {
    position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
    color: var(--text-3); font-size: .75rem; letter-spacing: .25em;
    text-transform: uppercase; display: flex; flex-direction: column;
    align-items: center; gap: .6rem;
    opacity: 0; animation: fadeUp 1s var(--ease) 1.6s forwards;
}
.scroll-hint .mouse {
    width: 22px; height: 36px; border: 1.5px solid var(--text-3);
    border-radius: 12px; position: relative;
}
.scroll-hint .mouse::after {
    content: ''; position: absolute; left: 50%; top: 6px;
    width: 3px; height: 7px; margin-left: -1.5px; border-radius: 3px;
    background: var(--accent); animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel { 50% { transform: translateY(9px); opacity: .2; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* ============ Section titles ============ */
.section-head { margin-bottom: 2.6rem; }
.section-eyebrow {
    font-family: var(--font-display); font-size: .8rem;
    letter-spacing: .3em; text-transform: uppercase;
    color: var(--accent); display: flex; align-items: center; gap: .8rem;
    margin-bottom: .8rem;
}
.section-eyebrow::before {
    content: ''; width: 34px; height: 1px; background: var(--accent);
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4.5vw, 2.8rem);
    font-weight: 700; letter-spacing: -0.01em;
}

/* ============ Reveal on scroll ============ */
.reveal {
    opacity: 0; transform: translateY(36px);
    transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============ Cards ============ */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 22px; padding: 2rem;
    position: relative; overflow: hidden;
    transition: border-color .35s, transform .35s var(--ease), box-shadow .35s;
}
.card::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(245,243,217,.06), transparent 45%);
    opacity: 0; transition: opacity .35s; pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: var(--card-hover); }
.card > * { position: relative; z-index: 1; }

/* ============ Bento ============ */
.bento {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem;
}
.span-2 { grid-column: span 2; }
.span-4 { grid-column: span 4; }
.rspan-2 { grid-row: span 2; }

.about-text p { color: var(--text-2); margin-bottom: 1rem; font-size: .98rem; }
.about-text strong { color: var(--text); }
.about-card h3, .stats-card h3 {
    font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 1.2rem;
    display: flex; align-items: center; gap: .7rem;
}
.about-card h3 svg, .stats-card h3 svg { width: 20px; height: 20px; color: var(--accent); }

/* Stats */
.stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; height: 100%;
    align-content: center;
}
.stat {
    text-align: center; padding: 1.4rem .5rem; border-radius: 16px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.05);
    transition: transform .35s var(--ease), border-color .35s;
}
.stat:hover { transform: translateY(-4px); border-color: rgba(245,243,217,.3); }
.stat-num {
    font-family: var(--font-display); font-size: 2.4rem; font-weight: 700;
    color: var(--accent); line-height: 1;
}
.stat-label { font-size: .8rem; color: var(--text-2); margin-top: .5rem; }

/* ============ Marquee ============ */
.marquee-card { padding: 1.6rem 0; display: flex; flex-direction: column; gap: .9rem; justify-content: center; }
.marquee {
    display: flex; overflow: hidden; gap: .9rem;
    mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}
.marquee-track {
    display: flex; gap: .9rem; min-width: max-content;
    animation: scrollL 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track.rev { animation-name: scrollR; animation-duration: 32s; }
.marquee-track.fast { animation-duration: 19s; }
@keyframes scrollL { to { transform: translateX(-50%); } }
@keyframes scrollR { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.pill {
    display: inline-flex; align-items: center; gap: .45rem;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06);
    padding: .45rem 1.05rem; border-radius: 50px;
    font-size: .85rem; color: var(--text-2); white-space: nowrap;
    transition: border-color .3s, color .3s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill::before { content: '◆'; font-size: .5rem; color: var(--accent); opacity: .7; }

/* ============ Timeline ============ */
.timeline { position: relative; padding-left: 2.2rem; }
.timeline::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 1px; background: var(--card-border);
}
.timeline-progress {
    position: absolute; left: 0; top: 8px; width: 1px; height: 0;
    background: linear-gradient(to bottom, var(--accent), rgba(245,243,217,.3));
    transition: height .2s linear;
}
.t-item { position: relative; padding-bottom: 2.6rem; }
.t-item:last-child { padding-bottom: 0; }
.t-item::before {
    content: ''; position: absolute; left: -2.2rem; top: 7px;
    width: 11px; height: 11px; margin-left: -5px;
    border-radius: 50%; background: var(--bg);
    border: 2px solid var(--text-3);
    transition: border-color .4s, box-shadow .4s;
}
.t-item.in::before {
    border-color: var(--accent);
    box-shadow: 0 0 14px var(--accent-glow);
}
.t-date {
    display: inline-block; font-family: var(--font-display);
    font-size: .78rem; letter-spacing: .12em; color: var(--accent);
    background: var(--accent-dim); padding: .25rem .85rem;
    border-radius: 50px; margin-bottom: .7rem;
}
.t-item h3 { font-family: var(--font-display); font-size: 1.18rem; margin-bottom: .2rem; }
.t-item h4 { font-size: .92rem; color: var(--text-2); font-weight: 500; margin-bottom: .7rem; }
.t-item ul { list-style: none; }
.t-item li {
    position: relative; padding-left: 1.3rem; margin-bottom: .4rem;
    color: var(--text-2); font-size: .92rem;
}
.t-item li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-size: .8rem; top: .1rem; }
.t-item p { color: var(--text-2); font-size: .92rem; }

/* Education cards */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.edu-card { text-align: left; }
.edu-icon {
    width: 46px; height: 46px; border-radius: 13px;
    background: var(--accent-dim); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.2rem;
}
.edu-icon svg { width: 22px; height: 22px; }
.edu-card .t-date { margin-bottom: .8rem; }
.edu-card h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: .3rem; }
.edu-card h4 { font-size: .88rem; color: var(--accent); font-weight: 500; margin-bottom: .6rem; }
.edu-card p { font-size: .88rem; color: var(--text-2); }

/* ============ Services ============ */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.service-card .num {
    position: absolute; top: 1.2rem; right: 1.6rem;
    font-family: var(--font-display); font-size: 3.2rem; font-weight: 700;
    color: rgba(255,255,255,.04); line-height: 1;
    transition: color .4s;
}
.service-card:hover .num { color: rgba(245,243,217,.12); }
.service-icon {
    width: 52px; height: 52px; border-radius: 15px;
    background: var(--accent-dim); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.4rem;
    transition: transform .4s var(--ease), background .4s, color .4s;
}
.service-icon svg { width: 24px; height: 24px; }
.service-card:hover .service-icon {
    background: var(--accent); color: #111;
    transform: rotate(-8deg) scale(1.08);
}
.service-card h3 { font-family: var(--font-display); font-size: 1.22rem; margin-bottom: 1rem; }
.service-list { list-style: none; }
.service-list li {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem 0; font-size: .9rem; color: var(--text-2);
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: color .3s, padding-left .3s;
}
.service-list li:last-child { border-bottom: none; }
.service-list li:hover { color: var(--text); padding-left: .4rem; }
.service-list svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }

/* ============ Projects ============ */
.projects-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
}
.project-card {
    display: block; text-decoration: none; color: var(--text);
    padding: 1.5rem 1.6rem;
    transform-style: preserve-3d; will-change: transform;
}
.project-card h3 {
    font-family: var(--font-display); font-size: 1.08rem;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .25rem; gap: .5rem;
}
.project-card .arrow {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%;
    border: 1px solid var(--card-hover);
    display: flex; align-items: center; justify-content: center;
    transition: background .35s, border-color .35s, transform .45s var(--ease);
    transform: rotate(0deg);
}
.project-card .arrow svg { width: 14px; height: 14px; transition: color .35s; }
.project-card:hover .arrow {
    background: var(--accent); border-color: var(--accent);
    transform: rotate(45deg);
}
.project-card:hover .arrow svg { color: #111; }
.project-domain { font-size: .82rem; color: var(--text-3); font-family: 'Space Grotesk', monospace; letter-spacing: .02em; }
.project-tag {
    display: inline-block; margin-top: .9rem; font-size: .7rem;
    letter-spacing: .15em; text-transform: uppercase;
    color: var(--text-3);
}

/* ============ Open Source ============ */
.repos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.repo-card {
    display: flex; flex-direction: column; gap: .65rem;
    text-decoration: none; color: var(--text);
    padding: 1.5rem 1.6rem;
    transform-style: preserve-3d; will-change: transform;
}
.repo-card h3 {
    font-family: var(--font-display); font-size: 1.02rem;
    display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem;
    word-break: break-word;
}
.repo-card .repo-gh {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%;
    border: 1px solid var(--card-hover);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2);
    transition: background .35s, border-color .35s, color .35s, transform .45s var(--ease);
}
.repo-card .repo-gh svg { width: 14px; height: 14px; }
.repo-card:hover .repo-gh {
    background: var(--accent); border-color: var(--accent); color: #111;
    transform: rotate(360deg);
}
.repo-desc { font-size: .88rem; color: var(--text-2); flex: 1; }
.repo-meta {
    display: flex; align-items: center; gap: 1.1rem;
    font-size: .78rem; color: var(--text-3);
    font-family: var(--font-display); letter-spacing: .04em;
}
.repo-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.repo-lang-dot { width: 9px; height: 9px; border-radius: 50%; }
.repo-meta svg { width: 13px; height: 13px; color: var(--accent); }
.repos-cta { text-align: center; margin-top: 2rem; }
@media (max-width: 1024px) { .repos-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .repos-grid { grid-template-columns: 1fr; } }

/* ============ CTA / Contact ============ */
.cta-card {
    text-align: center; padding: 4.5rem 2rem;
    background:
        radial-gradient(ellipse 60% 90% at 50% 110%, rgba(245,243,217,.07), transparent),
        var(--card);
}
.cta-card h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700;
    letter-spacing: -0.01em; margin-bottom: 1rem; line-height: 1.15;
}
.cta-card h2 em {
    font-style: normal; color: var(--accent); position: relative; white-space: nowrap;
}
.cta-card h2 em::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 4px;
    height: 8px; background: var(--accent-dim); z-index: -1;
    border-radius: 3px;
}
.cta-card > p { color: var(--text-2); max-width: 520px; margin: 0 auto 2.4rem; }
.contact-links {
    display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
}
.magnetic { will-change: transform; transition: transform .2s ease-out; }

/* ============ Footer ============ */
footer {
    margin-top: 5rem; padding: 2.6rem 0 2.4rem;
    border-top: 1px solid var(--card-border);
    text-align: center; color: var(--text-3); font-size: .88rem;
    position: relative; z-index: 1;
}
.social-row { display: flex; justify-content: center; gap: 1rem; margin-bottom: 1.6rem; }
.social-row a {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--card-border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2); transition: all .35s var(--ease);
}
.social-row a svg { width: 18px; height: 18px; }
.social-row a:hover {
    color: #111; background: var(--accent); border-color: var(--accent);
    transform: translateY(-5px);
}
.back-top {
    position: fixed; bottom: 1.8rem; right: 1.8rem; z-index: 1000;
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--card); border: 1px solid var(--card-border);
    color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transform: translateY(16px); pointer-events: none;
    transition: all .4s var(--ease);
    text-decoration: none;
}
.back-top svg { width: 18px; height: 18px; }
.back-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-top:hover { color: var(--accent); border-color: var(--accent); }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .bento { grid-template-columns: 1fr 1fr; }
    .span-2, .span-4 { grid-column: span 2; }
    .services-grid, .edu-grid { grid-template-columns: 1fr 1fr; }
    .projects-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .bento, .services-grid, .edu-grid, .projects-grid { grid-template-columns: 1fr; }
    .span-2, .span-4 { grid-column: span 1; }
    section { padding: 4rem 0 .5rem; }
    .container { padding: 0 1.25rem; }
    .nav { padding: 1rem 1.25rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .contact-links { flex-direction: column; align-items: stretch; }
    .contact-links .btn { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    html { scroll-behavior: auto; }
}
