:root {
    --bg-color: #080d1c;
    --bg-mid: #0b1124;
    --surface-color: rgba(15, 20, 40, 0.65);
    --surface-bright: rgba(22, 30, 58, 0.8);
    --border-color: rgba(99, 120, 200, 0.15);
    --border-hover: rgba(99, 140, 255, 0.4);
    --text-main: #eef2ff;
    --text-muted: #8899bb;
    --text-dim: #4a5578;
    --accent: #4f8ef7;
    --accent-2: #a78bfa;
    --accent-3: #34d399;
    --accent-glow: rgba(79, 142, 247, 0.18);
    --accent-2-glow: rgba(167, 139, 250, 0.12);
    --font-mono: 'Space Mono', 'SFMono-Regular', Consolas, monospace;
    --font-pixel: 'VT323', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ease-spring: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* ================================
   SCROLL PROGRESS BAR
================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 12px var(--accent);
}

/* ================================
   AURORA BACKGROUND BLOBS
================================ */
.aurora-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
    animation: blob-reveal 2s ease forwards, blob-float var(--dur, 20s) ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes blob-reveal {
    to { opacity: var(--opacity, 0.18); }
}

@keyframes blob-float {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(var(--tx1, 40px), var(--ty1, -30px)) scale(1.05); }
    66%  { transform: translate(var(--tx2, -20px), var(--ty2, 50px)) scale(0.97); }
    100% { transform: translate(var(--tx3, 30px), var(--ty3, 20px)) scale(1.03); }
}

.blob-1 {
    width: 70vw; height: 70vw;
    top: -20vh; left: -15vw;
    background: radial-gradient(circle, #1a3a8f 0%, #0d1f5c 50%, transparent 75%);
    --opacity: 0.35; --dur: 25s; --delay: 0s;
    --tx1: 3vw; --ty1: -4vh; --tx2: -2vw; --ty2: 6vh; --tx3: 4vw; --ty3: 2vh;
}

.blob-2 {
    width: 55vw; height: 55vw;
    top: 30vh; right: -15vw;
    background: radial-gradient(circle, #3b1f8f 0%, #1e0d5c 50%, transparent 75%);
    --opacity: 0.22; --dur: 30s; --delay: 3s;
    --tx1: -4vw; --ty1: 3vh; --tx2: 2vw; --ty2: -5vh; --tx3: -3vw; --ty3: 4vh;
}

.blob-3 {
    width: 45vw; height: 45vw;
    bottom: 10vh; left: 10vw;
    background: radial-gradient(circle, #0f5c4a 0%, #062e24 50%, transparent 75%);
    --opacity: 0.2; --dur: 22s; --delay: 6s;
    --tx1: 5vw; --ty1: 2vh; --tx2: -3vw; --ty2: -4vh; --tx3: 2vw; --ty3: 5vh;
}

.blob-4 {
    width: 35vw; height: 35vw;
    top: 60vh; left: 35vw;
    background: radial-gradient(circle, #4f1a6b 0%, #280d38 50%, transparent 75%);
    --opacity: 0.15; --dur: 35s; --delay: 1s;
    --tx1: -5vw; --ty1: -3vh; --tx2: 3vw; --ty2: 6vh; --tx3: -2vw; --ty3: -4vh;
}

.blob-5 {
    width: 30vw; height: 30vw;
    top: 15vh; right: 25vw;
    background: radial-gradient(circle, #0c4a72 0%, #061f30 50%, transparent 75%);
    --opacity: 0.18; --dur: 18s; --delay: 9s;
    --tx1: 3vw; --ty1: 5vh; --tx2: -4vw; --ty2: -2vh; --tx3: 1vw; --ty3: 4vh;
}

/* ================================
   PARALLAX DOT GRIDS
================================ */
.parallax-bg {
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    z-index: -2; pointer-events: none;
    will-change: transform;
}

#bg-layer-1 {
    background-image: radial-gradient(circle at center, rgba(79, 142, 247, 0.12) 1px, transparent 1px);
    background-size: 48px 48px;
}

#bg-layer-2 {
    background-image: radial-gradient(circle at center, rgba(167, 139, 250, 0.1) 1.5px, transparent 1.5px);
    background-size: 120px 120px;
}

#bg-layer-3 {
    background-image: radial-gradient(circle at center, rgba(52, 211, 153, 0.06) 2px, transparent 2px);
    background-size: 240px 240px;
}

/* ================================
   NOISE / GRAIN TEXTURE
================================ */
.noise-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    animation: noise-shift 8s steps(4) infinite;
}

@keyframes noise-shift {
    0%   { background-position: 0 0; }
    25%  { background-position: -64px 32px; }
    50%  { background-position: 32px -48px; }
    75%  { background-position: -32px -16px; }
    100% { background-position: 64px 0; }
}

/* ================================
   NAVIGATION
================================ */
nav {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    padding: 1.25rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(8, 13, 28, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 120, 200, 0.1);
    transition: padding 0.3s var(--ease-out), background 0.3s;
}

nav.scrolled {
    padding: 1rem 3rem;
    background: rgba(8, 13, 28, 0.85);
    border-bottom-color: rgba(99, 120, 200, 0.2);
}

.nav-logo {
    font-family: var(--font-pixel);
    font-size: 2rem;
    color: var(--accent);
    letter-spacing: 0.05em;
    text-shadow: 0 0 20px rgba(79, 142, 247, 0.5);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.2s ease;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 1px;
    background: var(--accent);
    transition: width 0.3s var(--ease-spring);
}

nav a:hover { color: var(--text-main); }
nav a:hover::after { width: 100%; }

.nav-num {
    color: var(--accent);
    margin-right: 0.3em;
}

/* ================================
   CONTAINER & SECTION
================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 3rem;
    position: relative;
    z-index: 2;
}

section {
    padding: 120px 0 100px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* ================================
   HERO SECTION
================================ */
.hero-content {
    position: relative;
    max-width: 820px;
}

.mono-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.25rem;
    display: block;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }

.hero-name {
    font-size: clamp(3.5rem, 9vw, 6rem);
    line-height: 1.05;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #eef2ff 20%, #93b4ff 60%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 40px rgba(79, 142, 247, 0.2));
}

section#about h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: -0.01em;
}

p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 560px;
    line-height: 1.8;
}

.hero-links {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-radius: 6px;
    transition: all 0.3s var(--ease-spring);
    box-shadow: 0 4px 20px rgba(79, 142, 247, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before { left: 100%; }
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(79, 142, 247, 0.45);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    transition: all 0.3s var(--ease-spring);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--surface-bright);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(79, 142, 247, 0.1);
}

.btn-secondary .arrow {
    display: inline-block;
    transition: transform 0.3s var(--ease-spring);
}

.btn-secondary:hover .arrow { transform: translateY(3px); }

/* Floating language badges */
.float-badge {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    border: 1px solid;
    pointer-events: none;
    backdrop-filter: blur(4px);
    z-index: -1;
}

.float-badge.prominent {
    font-size: 1.1rem;
    padding: 0.6rem 1.2rem;
    border-width: 2px;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.badge-cpp {
    top: 2rem; right: -15rem;
    color: #659ad2; border-color: rgba(101, 154, 210, 0.3); background: rgba(101, 154, 210, 0.08);
    animation: float-1 12s ease-in-out infinite;
}

.badge-py {
    top: -3rem; right: -2rem;
    color: #ffd43b; border-color: rgba(255, 212, 59, 0.3); background: rgba(255, 212, 59, 0.08);
    animation: float-2 14s ease-in-out 1s infinite;
}

.badge-ts {
    top: 11rem; right: -17rem;
    color: #3178c6; border-color: rgba(49, 120, 198, 0.3); background: rgba(49, 120, 198, 0.08);
    animation: float-3 10s ease-in-out 2s infinite;
}

.badge-js {
    top: 16rem; right: -4rem;
    color: #f7df1e; border-color: rgba(247, 223, 30, 0.3); background: rgba(247, 223, 30, 0.08);
    animation: float-1 15s ease-in-out 3s infinite;
}

.badge-react {
    top: 6rem; right: 5rem;
    color: #61dafb; border-color: rgba(97, 218, 251, 0.3); background: rgba(97, 218, 251, 0.08);
    animation: float-2 11s ease-in-out 0.5s infinite;
}

.badge-rust {
    top: -1rem; right: -9rem;
    color: #fb923c; border-color: rgba(251, 146, 60, 0.3); background: rgba(251, 146, 60, 0.06);
    animation: float-3 13s ease-in-out 1.5s infinite;
}

.badge-svelte {
    top: 19rem; right: -11rem;
    color: #ff3e00; border-color: rgba(255, 62, 0, 0.3); background: rgba(255, 62, 0, 0.06);
    animation: float-1 16s ease-in-out 2.5s infinite;
}

@keyframes float-1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(25px, -35px) rotate(6deg); }
    66% { transform: translate(-20px, 25px) rotate(-4deg); }
}
@keyframes float-2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-30px, -20px) rotate(-6deg); }
    66% { transform: translate(20px, 30px) rotate(5deg); }
}
@keyframes float-3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(35px, 20px) rotate(7deg); }
    66% { transform: translate(-25px, -30px) rotate(-5deg); }
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.scroll-hint span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    text-transform: uppercase;
    writing-mode: vertical-rl;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--text-dim), transparent);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    animation: scroll-down 2s ease-in-out infinite;
}

@keyframes scroll-down {
    0%   { top: -100%; opacity: 0; }
    40%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* ================================
   WORK SECTION HEADER
================================ */
.section-header {
    margin-bottom: 3rem;
    position: relative;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #eef2ff, #93b4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-rule {
    width: 60px;
    height: 2px;
    margin-top: 1.5rem;
    background: linear-gradient(90deg, var(--accent), transparent);
}

/* ================================
   GRID & CARDS
================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.4s var(--ease-spring), border-color 0.3s, box-shadow 0.4s;
    overflow: hidden;
    will-change: transform;
}

/* Card inner glow that follows mouse */
.card-glow {
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(79, 142, 247, 0.15) 0%, transparent 70%);
}

.card:hover .card-glow { opacity: 1; }

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(79, 142, 247, 0.1);
    transform: translateY(-4px);
}

.card.hidden { opacity: 0; pointer-events: none; }

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.6rem;
    color: var(--text-main);
    position: relative;
    z-index: 1;
    transition: color 0.2s;
}

.card:hover h3 { color: #fff; }

.card > p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    position: relative;
    z-index: 1;
    max-width: none;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    position: relative;
    z-index: 1;
}

.tech-pill {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    background: rgba(79, 142, 247, 0.08);
    border: 1px solid rgba(79, 142, 247, 0.2);
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    color: var(--accent);
    letter-spacing: 0.03em;
    transition: background 0.2s, border-color 0.2s;
}

.card:hover .tech-pill {
    background: rgba(79, 142, 247, 0.14);
    border-color: rgba(79, 142, 247, 0.35);
}

/* Card corner tag */
.card-corner {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 28px; height: 28px;
    border-top: 2px solid var(--border-color);
    border-right: 2px solid var(--border-color);
    border-radius: 0 6px 0 0;
    transition: border-color 0.3s;
    z-index: 1;
}

.card:hover .card-corner {
    border-color: var(--accent);
    box-shadow: 4px -4px 10px var(--accent-glow);
}

/* --- Animated border lines --- */
.border-line { position: absolute; background: var(--accent); z-index: 10; pointer-events: none; border-radius: 1px; }
.border-line.top    { top: -1px; left: -1px; width: 0; height: 2px;  transition: width 0.25s linear 0.75s; }
.border-line.right  { top: -1px; right: -1px; width: 2px; height: 0; transition: height 0.25s linear 0.5s; }
.border-line.bottom { bottom: -1px; right: -1px; width: 0; height: 2px; transition: width 0.25s linear 0.25s; }
.border-line.left   { bottom: -1px; left: -1px; width: 2px; height: 0; transition: height 0.25s linear 0s; }

.card:hover .border-line.top    { width: calc(100% + 2px); transition: width 0.25s linear 0s; }
.card:hover .border-line.right  { height: calc(100% + 2px); transition: height 0.25s linear 0.25s; }
.card:hover .border-line.bottom { width: calc(100% + 2px); transition: width 0.25s linear 0.5s; }
.card:hover .border-line.left   { height: calc(100% + 2px); transition: height 0.25s linear 0.75s; }

/* ================================
   CONTACT SECTION
================================ */
.contact-section {
    min-height: 70vh !important;
    text-align: center;
    align-items: center;
}

.contact-heading {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin: 0.5rem 0 1.5rem;
    background: linear-gradient(135deg, #eef2ff, #93b4ff, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-body {
    margin: 0 auto 2.5rem;
    max-width: 520px;
}

.email-wrapper {
    position: relative;
    display: inline-block;
}

.email-text {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--accent);
    padding: 1.25rem 2.5rem;
    background: rgba(79, 142, 247, 0.05);
    border: 1px solid rgba(79, 142, 247, 0.25);
    border-radius: 8px;
    display: inline-block;
    user-select: all;
    position: relative;
    z-index: 1;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.email-text:hover {
    background: rgba(79, 142, 247, 0.1);
    border-color: rgba(79, 142, 247, 0.5);
    box-shadow: 0 0 40px rgba(79, 142, 247, 0.15);
}

.email-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(ellipse at center, rgba(79, 142, 247, 0.08), transparent 70%);
    pointer-events: none;
    border-radius: 50%;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* ================================
   REVEAL ANIMATIONS
================================ */
.reveal {
    opacity: 0;
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.fade-up { transform: translateY(50px); }
.fade-right { transform: translateX(-50px); }

.reveal.active {
    opacity: 1;
    transform: translate(0, 0);
}

/* ================================
   CAROUSEL & MODAL
================================ */
.carousel-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(5, 8, 20, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.carousel-overlay.active { opacity: 1; }

.dummy-card {
    position: fixed;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    z-index: 1001;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
}

.carousel-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 1000;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s;
}

.carousel-container.active { pointer-events: all; }

.carousel-track {
    display: flex;
    align-items: center;
    height: 100%;
    width: max-content;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-slide {
    width: 70vw;
    max-width: 900px;
    height: 85vh;
    margin: 0 5vw;
    flex-shrink: 0;
    background: var(--surface-bright);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    overflow-y: auto;
    opacity: 0.2;
    transform: scale(0.88);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.carousel-slide::-webkit-scrollbar { display: none; }

.carousel-slide.active {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(99, 140, 255, 0.25);
    box-shadow: 0 0 0 1px rgba(79, 142, 247, 0.1), 0 40px 80px rgba(0,0,0,0.5);
}

.slide-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
    gap: 1rem;
}

.slide-header h2 {
    margin: 0;
    font-size: 2.5rem;
    line-height: 1.1;
    background: linear-gradient(135deg, #eef2ff, #93b4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.github-btn {
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(15, 20, 40, 0.5);
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

.github-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow), inset 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.slide-tech { margin-bottom: 2rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.slide-description { font-size: 1.05rem; margin-bottom: 2.5rem; flex-grow: 1; }

/* ================================
   FLASHCARD GALLERY
================================ */
.gallery-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
}

.gallery-stack {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    align-items: start;
    perspective: 1200px;
    cursor: pointer;
}

.gallery-stack .gallery-media {    
    grid-area: 1 / 1;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 45vh;
    justify-self: center;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    user-select: none;
    background-color: var(--bg-mid); /* Fallback while video loads */
}

/* ================================
   CAROUSEL CONTROLS
================================ */
.modal-close {
    position: absolute;
    top: 2rem; right: 3rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    z-index: 1005;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent);
    transform: rotate(90deg) scale(1.1);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(8, 13, 28, 0.7);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-size: 1.5rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    width: 56px; height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.25s ease;
    z-index: 1005;
    backdrop-filter: blur(8px);
}

.modal-nav:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px rgba(79, 142, 247, 0.4);
    transform: translateY(-50%) scale(1.05);
}

.modal-nav.left { left: 2rem; }
.modal-nav.right { right: 2rem; }

/* ================================
   MOBILE RESPONSIVENESS (<= 768px)
================================ */
@media (max-width: 768px) {
    /* Compress Navigation */
    nav {
        padding: 1rem 1.25rem;
    }
    nav.scrolled {
        padding: 0.75rem 1.25rem;
    }
    .nav-logo {
        font-size: 1.5rem;
    }
    .nav-links {
        gap: 1rem;
    }

    /* Reduce global padding */
    .container {
        padding: 0 1.25rem;
    }
    section {
        padding: 100px 0 60px;
    }

    /* Hide floating badges to prevent horizontal scrolling and clutter */
    .float-badge {
        display: none !important;
    }

    /* Stack hero buttons */
    .hero-links {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-links a {
        justify-content: center;
        text-align: center;
    }

    /* Make grid cards stack cleanly */
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    /* Adjust Carousel Modal for small screens */
    .carousel-slide {
        width: 85vw;
        margin: 0 7.5vw;
        padding: 1.5rem;
        height: 75vh;
    }
    .slide-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    .slide-header h2 {
        font-size: 1.8rem;
    }
    
    /* Reposition Modal Controls so they don't get cut off */
    .modal-nav {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        padding: 0;
    }
    .modal-nav.left {
        left: 0.25rem;
    }
    .modal-nav.right {
        right: 0.25rem;
    }
    .modal-close {
        top: 0.5rem;
        right: 1rem;
        font-size: 2rem;
    }

    /* Ensure email text doesn't overflow */
    .email-text {
        font-size: 0.95rem;
        padding: 1rem;
        word-break: break-all; /* Prevents long emails from stretching the screen */
    }
}