/* =========================================
   CSS Variables & Base Reset
   ========================================= */
:root {
    /* Premium Dark Theme variables */
    --bg-primary: #0a0a0c;
    --bg-secondary: #121216;
    --text-primary: #f0f0f5;
    --text-secondary: #94a3b8;
    
    /* Brand Gradients & Accents */
    --accent-primary: #8b5cf6; /* Violet */
    --accent-secondary: #3b82f6; /* Blue */
    --accent-glow: rgba(139, 92, 246, 0.4);
    
    /* Structural Elements */
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(20, 20, 25, 0.6);
    --glass-border: rgba(255, 255, 255, 0.06);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing & Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   Particle Background Canvas
   ========================================= */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
}

/* Make sure all main content sits above the canvas */
.navbar,
main,
footer,
.cursor-dot,
.cursor-outline,
.theme-creator,
.project-modal,
.lightbox {
    position: relative;
    z-index: 1;
}

/* =========================================
   Typography & Utilities
   ========================================= */
h1, h2, h3, h4, .logo {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-padding {
    padding: 120px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.wrapper-dark {
    position: relative;
    max-width: 100%;
}
.wrapper-dark::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-secondary);
    z-index: -1;
}

.section-header {
    margin-bottom: 70px;
}

.section-title {
    font-size: 3.5rem;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
}

.section-line {
    height: 4px;
    width: 60px;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    margin-top: 20px;
}

/* Glassmorphism */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    transition: var(--transition);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 10px;
    font-weight: 500;
    font-family: var(--font-body);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 14px 28px;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 28px;
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.95rem;
}

/* =========================================
   Navigation
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(10, 10, 12, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

.logo {
    font-size: 1.8rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo .highlight {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 35px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -6px;
    left: 0;
    background-color: var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
    position: relative;
    overflow: visible;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981; /* Emerald green */
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
    font-size: 5rem;
    margin-bottom: 25px;
    letter-spacing: -2px;
}

.typewrite > .wrap {
    border-right: 0.08em solid var(--text-primary);
    animation: blink-caret .75s step-end infinite;
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--text-primary); }
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 45px;
    max-width: 550px;
}

.hero-cta {
    display: flex;
    gap: 20px;
}

.hero-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.profile-image-container {
    position: relative;
    width: 320px; /* Reduced to make photo smaller */
    margin: 0 auto; /* Center it */
    max-width: 100%;
    aspect-ratio: 4/5;
    z-index: 1;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
    border: 2px solid var(--border-color);
    position: relative;
    z-index: 2;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.hero-stats {
    position: relative;
    display: flex;
    gap: 30px;
    padding: 24px 36px;
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
    justify-content: center;
    transition: var(--transition);
}

.hero-stats:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to bottom, #fff, #a0a0ab);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.glow-orb {
    position: absolute;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, rgba(59, 130, 246, 0.2) 40%, rgba(0,0,0,0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    filter: blur(60px);
}

/* =========================================
   About
   ========================================= */
.about-text {
    max-width: 900px;
}
.about-text p {
    margin-bottom: 25px;
    color: var(--text-secondary);
    font-size: 1.2rem;
}
.about-text .large-text {
    font-size: 2rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 35px;
}

/* =========================================
   Skills
   ========================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.skill-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.skill-icon {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 25px;
    background: rgba(139, 92, 246, 0.1);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.skill-card h3 {
    margin-bottom: 25px;
    font-size: 1.6rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tags span {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.skill-card:hover .skill-tags span {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* =========================================
   Experience Timeline
   ========================================= */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding-left: 70px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 40px;
    width: 20px;
    height: 20px;
    background: var(--bg-primary);
    border: 4px solid var(--accent-primary);
    border-radius: 50%;
    z-index: 2;
}

.timeline-card {
    padding: 35px;
}

.timeline-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.timeline-date {
    display: inline-block;
    color: var(--accent-secondary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.timeline-role {
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.timeline-company {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* =========================================
   Projects
   ========================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 40px;
}

.project-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
}

.sp-image-container {
    position: relative;
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, rgba(232, 111, 95, 0.1), rgba(139, 92, 246, 0.05));
    border-bottom: 1px solid var(--glass-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.laptop-frame {
    position: absolute;
    width: 85%;
    left: 50%;
    transform: translateX(-56%) translateY(15px);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.laptop-screen {
    width: 100%;
    aspect-ratio: 16/10;
    background: #000;
    border: 8px solid #222;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid #555;
}

.laptop-base {
    width: 110%;
    height: 12px;
    background: #bbb;
    border-radius: 0 0 10px 10px;
    position: relative;
    box-shadow: inset 0 -4px 10px rgba(0,0,0,0.2), 0 10px 20px rgba(0,0,0,0.5);
}

/* indent for the laptop opening notch */
.laptop-base::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 15%;
    height: 4px;
    background: #999;
    border-radius: 0 0 4px 4px;
}

.img-desktop {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.mobile-frame {
    position: absolute;
    bottom: -30px;
    right: 4%;
    width: 20%;
    min-width: 80px;
    aspect-ratio: 9/19;
    background: #000;
    border: 6px solid #1a1a1a;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.08); /* highlight edge */
    transform: rotate(-4deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.mobile-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 15px;
    background: #1a1a1a;
    border-radius: 0 0 10px 10px;
    z-index: 3;
}

.img-mobile {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.project-card:hover .sp-image-container {
    background: linear-gradient(135deg, rgba(232, 111, 95, 0.15), rgba(139, 92, 246, 0.1));
}

.project-card:hover .laptop-frame {
    transform: translateX(-56%) translateY(5px);
}

.project-card:hover .mobile-frame {
    transform: rotate(0deg) translateY(-15px);
}

.project-content {
    padding: 35px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    flex: 1;
    font-size: 1.05rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.project-tech span {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.project-links {
    display: flex;
    gap: 15px;
}

/* =========================================
   Contact
   ========================================= */
.contact-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.contact-desc {
    color: var(--text-secondary);
    margin: 0 auto 50px auto;
    font-size: 1.25rem;
    max-width: 600px;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-decoration: none;
    color: var(--text-primary);
}

.contact-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.contact-card i {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 20px;
}

.contact-card h3 {
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.contact-card p {
    color: var(--text-secondary);
}

/* =========================================
   Footer
   ========================================= */
footer {
    border-top: 1px solid var(--border-color);
    padding: 60px 5% 40px;
    background: var(--bg-primary);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-brand {
    margin-bottom: 30px;
}

.footer-brand .logo {
    display: inline-block;
    margin-bottom: 10px;
}

.footer-brand p {
    color: var(--text-secondary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-top: 30px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

/* =========================================
   Animations (Reveal)
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.9s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Delay for staggered internal elements if needed */
.skill-card:nth-child(2) { transition-delay: 0.1s; }
.skill-card:nth-child(3) { transition-delay: 0.2s; }
.project-card:nth-child(2) { transition-delay: 0.1s; }
.contact-card:nth-child(2) { transition-delay: 0.1s; }
.contact-card:nth-child(3) { transition-delay: 0.2s; }


/* =========================================
   Theme Creator Widget
   ========================================= */
.theme-creator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.theme-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    transform: rotate(45deg);
    border-color: var(--accent-primary);
}

.theme-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 250px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.theme-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-panel h4 {
    margin-bottom: 15px;
    font-size: 1rem;
    text-align: center;
}

.color-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.color-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: white;
    transform: scale(1.1);
}

.theme-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
}

/* =========================================
   About Grid (Story + Terminal)
   ========================================= */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-text em {
    color: var(--text-primary);
    font-style: italic;
}

.about-easter-hint {
    font-size: 0.95rem !important;
    color: var(--accent-primary) !important;
    font-style: italic;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* =========================================
   Currently Widget
   ========================================= */
.currently-widget {
    margin-top: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.currently-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.currently-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: subtlePulse 2.5s ease infinite;
}

@keyframes subtlePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.currently-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 70px;
}

/* =========================================
   Terminal Widget
   ========================================= */
.terminal-widget {
    background: #0d0d10;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: default;
}
.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green  { background: #28c840; }

.terminal-title {
    margin-left: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.terminal-body {
    padding: 25px 25px 15px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.terminal-line {
    display: flex;
    gap: 10px;
    align-items: center;
}

.terminal-prompt {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.terminal-cmd {
    color: #a5f3fc;
    font-size: 0.95rem;
}

.terminal-typed {
    color: #a5f3fc;
    font-size: 0.95rem;
}

.terminal-output {
    color: #94a3b8;
    font-size: 0.9rem;
    padding-left: 20px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.terminal-output.success { color: #86efac; }
.terminal-output.accent  { color: var(--accent-primary); }
.terminal-output.warn    { color: #fde68a; }

.terminal-cursor {
    display: inline-block;
    color: var(--accent-primary);
    animation: blinkCursor 1s step-end infinite;
    font-size: 1rem;
    line-height: 1;
    vertical-align: middle;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.terminal-commands {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: rgba(255,255,255,0.02);
}

.tcmd-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-body);
    margin-right: 4px;
}

.tcmd {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--accent-primary);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: var(--transition);
}

.tcmd:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* =========================================
   Skill Tag Hover Tooltips
   ========================================= */
.skill-tags span {
    position: relative;
}

.skill-tags span[data-joke]:hover::after {
    content: attr(data-joke);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--accent-primary);
    color: var(--text-primary);
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    font-family: var(--font-body);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    animation: tooltipPop 0.15s ease;
}

.skill-tags span[data-joke]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(110% - 6px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--accent-primary);
    z-index: 101;
    pointer-events: none;
}

@keyframes tooltipPop {
    from { opacity: 0; transform: translateX(-50%) translateY(6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* =========================================
   Stat Joke Caption
   ========================================= */
.stat-joke {
    font-size: 0.72rem;
    color: var(--accent-primary);
    font-style: italic;
    margin-top: 4px;
    opacity: 0.75;
    font-family: var(--font-body);
}

/* =========================================
   Marquee Banner
   ========================================= */
.marquee-banner {
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 16px 0;
    white-space: nowrap;
}

.marquee-track {
    display: inline-flex;
    gap: 0;
    animation: marqueeScroll 30s linear infinite;
}

.marquee-track span {
    display: inline-block;
    padding: 0 40px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: white;
    font-family: var(--font-heading);
    opacity: 0.95;
}

@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.marquee-banner:hover .marquee-track {
    animation-play-state: paused;
}

/* =========================================
   Mobile Responsiveness
   ========================================= */
@media (max-width: 1024px) {
    .section-padding { padding: 100px 5%; }
    .hero-title { font-size: 4rem; }
    .hero { gap: 40px; }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: calc(var(--nav-height) + 40px);
    }
    
    .hero-subtitle { margin: 0 auto 40px auto; }
    .hero-cta { justify-content: center; }
    
    .hero-visual {
        margin-top: 40px;
    }

    .hero-stats {
        transform: none;
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: -40px;
        flex-direction: row;
        justify-content: center;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-stats:hover {
        transform: none;
    }
    
    .nav-links {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: 0;
        background: rgba(10, 10, 12, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-color);
        overflow: hidden;
        transition: height 0.4s ease;
        padding: 0;
    }
    
    .nav-links.active {
        height: 350px;
        padding: 40px 0;
    }

    .nav-link::after { display: none; }
    
    .mobile-menu-btn { display: block; }

    .about-text .large-text { font-size: 1.6rem; }
    .section-title { font-size: 2.8rem; }
    
    .timeline::before { left: 15px; }
    .timeline-dot { left: 6px; }
    .timeline-item { padding-left: 50px; }

    .terminal-widget { font-size: 0.85rem; }
    .skill-tags span[data-joke]:hover::after { display: none; }
    .skill-tags span[data-joke]:hover::before { display: none; }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title { font-size: 3rem; }
    .section-title { font-size: 2.4rem; }
    .hero-stats {
        flex-direction: column;
        gap: 25px;
        padding: 30px;
        width: 100%;
    }
    .stat-number { font-size: 3rem; }
    .hero-cta { flex-direction: column; width: 100%; }
    .btn { width: 100%; }
    
    .projects-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr; }
}

/* =========================================
   Gallery Section — Masonry + Lightbox
   ========================================= */
.gallery-section {
    padding: 120px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-header {
    margin-bottom: 40px;
}

/* --- Masonry Grid --- */
.gallery-masonry {
    columns: 3;
    column-gap: 20px;
}

/* --- Gallery Item --- */
.gm-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease,
                opacity 0.4s ease;
}

.gm-item:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(139, 92, 246, 0.3);
}

/* Size variants */
.gm-item.gm-tall .gm-img { aspect-ratio: 2/3; }

/* Missing-image hidden state */
.gm-item.gm-hidden {
    display: none;
}

.gm-img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gm-item:hover .gm-img {
    transform: scale(1.07);
}

/* --- Hover Overlay --- */
.gm-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(10, 10, 15, 0.92) 0%,
        rgba(10, 10, 15, 0.4) 50%,
        rgba(10, 10, 15, 0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 24px 20px;
    gap: 8px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.gm-item:hover .gm-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gm-caption {
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

.gm-zoom-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}

.gm-item:hover .gm-zoom-icon {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* --- Category Tag Badge --- */
.gm-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(10, 10, 15, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.gm-item:hover .gm-tag {
    transform: translateY(-4px);
}

/* ===========================================
   Lightbox
   =========================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(4, 4, 8, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox.lb-open {
    opacity: 1;
    visibility: visible;
}

.lb-close {
    position: absolute;
    top: 24px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10001;
}

.lb-close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg) scale(1.05);
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10001;
}

.lb-nav:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 25px var(--accent-glow);
    transform: translateY(-50%) scale(1.05);
}

.lb-prev { left: 28px; }
.lb-next { right: 28px; }

.lb-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 90vw;
    max-height: 90vh;
}

.lb-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    min-height: 100px;
}

.lb-img {
    max-width: min(85vw, 900px);
    max-height: 78vh;
    border-radius: 16px;
    object-fit: contain;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lb-img.lb-img-ready {
    opacity: 1;
    transform: scale(1);
}

.lb-spinner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: lbSpin 0.8s linear infinite;
    display: none;
}

.lb-spinner.lb-loading {
    display: block;
}

@keyframes lbSpin {
    to { transform: rotate(360deg); }
}

.lb-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lb-caption {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 500;
    margin: 0;
}

.lb-counter {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    margin: 0;
    letter-spacing: 1px;
}

/* --- Gallery Responsiveness --- */
@media (max-width: 900px) {
    .gallery-masonry { columns: 2; }
    .lb-prev { left: 12px; }
    .lb-next { right: 12px; }
    .lb-nav { width: 44px; height: 44px; font-size: 1.2rem; }
}

@media (max-width: 600px) {
    .gallery-section { padding: 80px 4%; }
    .gallery-masonry { columns: 1; }
    .lb-close { top: 14px; right: 14px; width: 40px; height: 40px; font-size: 1.2rem; }
    .lb-img { max-width: 95vw; max-height: 70vh; border-radius: 10px; }
    .lb-nav { width: 38px; height: 38px; font-size: 1rem; }
    .lb-prev { left: 6px; }
    .lb-next { right: 6px; }
}

/* =========================================
   Project overlay hint
   ========================================= */
.sp-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 13, 16, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.sp-image-overlay span {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-card:hover .sp-image-overlay {
    opacity: 1;
}

.project-card:hover .sp-image-overlay span {
    transform: translateY(0);
}

/* ===========================================
   Project Details Modal
   =========================================== */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.project-modal.pm-open {
    opacity: 1;
    visibility: visible;
}

.pm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(4, 4, 8, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.pm-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10001;
}

.project-modal.pm-open .pm-content {
    transform: translateY(0) scale(1);
}

.pm-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.pm-close:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: rotate(90deg);
}

.pm-scroll {
    overflow-y: auto;
    width: 100%;
    height: 100%;
}

/* Custom Scrollbar for Modal */
.pm-scroll::-webkit-scrollbar { width: 8px; }
.pm-scroll::-webkit-scrollbar-track { background: transparent; }
.pm-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.pm-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.pm-body {
    padding: 0;
}

.pm-hero {
    position: relative;
    width: 100%;
    height: 450px;
    background: #000;
    overflow: hidden;
    border-bottom: 1px solid var(--glass-border);
}

.pm-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    opacity: 0.8;
}

.pm-hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-secondary) 0%, transparent 100%);
}

.pm-details {
    padding: 40px;
    position: relative;
    margin-top: -80px;
}

.pm-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.pm-subtitle {
    font-size: 1.2rem;
    color: var(--accent-primary);
    margin-bottom: 30px;
    font-weight: 500;
}

.pm-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.pm-section {
    margin-bottom: 30px;
}

.pm-section h4 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: white;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.pm-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 15px;
}

.pm-section ul {
    list-style: none;
    padding: 0;
}

.pm-section ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.pm-section ul li::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--accent-primary);
    font-size: 0.9rem;
}

.pm-mobile-mockup {
    margin-top: 30px;
    width: 100%;
    max-width: 300px;
    border-radius: 20px;
    border: 8px solid #1a1a1a;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: block;
}

.pm-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.pm-tech-tags span {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.pm-btn-group a {
    display: inline-flex;
    margin-right: 10px;
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .pm-grid { grid-template-columns: 1fr; }
    .pm-hero { height: 300px; }
    .pm-title { font-size: 2.2rem; }
}

@media (max-width: 600px) {
    .pm-content { width: 95%; height: 95vh; padding: 0; }
    .pm-details { padding: 25px; margin-top: -60px; }
}
