/* ==========================================================================
   PREMIUM PORTFOLIO — DESIGN SYSTEM v2.0
   Author: Nouman Sajid
   ========================================================================== */

/* ── Font Imports ───────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
    /* Color Palette — Dark Theme (Default) */
    --bg-primary: #030712;
    --bg-secondary: #0a1628;
    --bg-tertiary: #111e38;
    --bg-elevated: #162036;

    --accent-primary: #6366f1;
    --accent-secondary: #06b6d4;
    --accent-tertiary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 50%, #8b5cf6 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(6,182,212,0.10) 100%);
    --accent-glow: rgba(99, 102, 241, 0.15);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(99, 102, 241, 0.3);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 20px 60px rgba(99, 102, 241, 0.15);
    --glass-bg: rgba(10, 22, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.04);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 0.2s var(--ease-out);
    --t-medium: 0.4s var(--ease-out);
    --t-slow: 0.8s var(--ease-out);

    /* Layout */
    --max-width: 1200px;
    --header-height: 72px;
    --section-gap: 6rem;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

/* ── Light Theme ────────────────────────────────────────────────────────── */
body.light-mode {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-elevated: #e2e8f0;

    --accent-primary: #4f46e5;
    --accent-secondary: #0891b2;
    --accent-tertiary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #0891b2 50%, #7c3aed 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(79,70,229,0.08) 0%, rgba(8,145,178,0.06) 100%);
    --accent-glow: rgba(79, 70, 229, 0.06);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(79, 70, 229, 0.25);
    --card-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --card-shadow-hover: 0 16px 48px rgba(79, 70, 229, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(15, 23, 42, 0.06);
}

/* ── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 2rem);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-primary);
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--t-fast);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

img {
    max-width: 100%;
    display: block;
}

ul { list-style: none; }

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: var(--accent-gradient);
    border-radius: 3px;
}

/* Interactive elements */
a, button, .project-card, .cert-card, [data-project], [data-cert] {
    cursor: pointer;
}

/* ── Layout Utilities ───────────────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 2;
}

.section {
    padding: var(--section-gap) 0;
    position: relative;
}

.section-header {
    margin-bottom: 3.5rem;
    text-align: center;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Glass Card System ──────────────────────────────────────────────────── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-lg);
    transition: transform var(--t-medium), border-color var(--t-medium), box-shadow var(--t-medium);
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
}

/* ── Animated Background ────────────────────────────────────────────────── */
#canvas-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.mesh-glow {
    position: fixed;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: -15vw;
    right: -10vw;
    z-index: 0;
    pointer-events: none;
    animation: floatGlow 20s infinite alternate ease-in-out;
}

.mesh-glow-2 {
    position: fixed;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
    bottom: -10vw;
    left: -10vw;
    z-index: 0;
    pointer-events: none;
    animation: floatGlow 25s infinite alternate-reverse ease-in-out;
}

body.light-mode .mesh-glow {
    background: radial-gradient(circle, rgba(79, 70, 229, 0.04) 0%, transparent 70%);
}

body.light-mode .mesh-glow-2 {
    background: radial-gradient(circle, rgba(8, 145, 178, 0.04) 0%, transparent 70%);
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(3vw, 3vw) scale(1.15); }
}

/* ── Header / Navigation ────────────────────────────────────────────────── */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: background var(--t-medium), box-shadow var(--t-medium), height var(--t-medium);
}

header.scrolled {
    height: 64px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    z-index: 1002;
}

.logo .logo-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Nav links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    padding: 0.4rem 0;
    color: var(--text-secondary);
    transition: color var(--t-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width var(--t-medium);
    border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Nav right controls */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Theme toggle */
.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
    z-index: 1002;
}

.theme-toggle-btn:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
    background: var(--accent-gradient-subtle);
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.5s ease;
}

body.light-mode .sun-icon { display: none; }
body:not(.light-mode) .moon-icon { display: none; }

/* Mobile hamburger */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    height: 20px;
    justify-content: center;
    z-index: 1002;
    padding: 0;
}

.mobile-nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Social icon SVGs */
.social-icon-svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
    display: block;
}

/* ── Hero Section ───────────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: var(--header-height);
}

.hero-content {
    max-width: 720px;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    background: var(--accent-gradient-subtle);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-secondary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-secondary);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

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

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin-bottom: 1rem;
}

.hero-taglines {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: var(--text-secondary);
    min-height: 2.5rem;
    margin-bottom: 2rem;
}

.hero-taglines span {
    font-weight: 500;
    color: var(--text-primary);
    border-right: 2px solid var(--accent-primary);
    padding-right: 4px;
    animation: blinkCursor 0.75s infinite;
}

@keyframes blinkCursor {
    50% { border-color: transparent; }
}

.hero-buttons {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.875rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--t-medium);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}

.btn svg, .btn i {
    width: 16px;
    height: 16px;
    transition: transform var(--t-fast);
}

.btn:hover svg, .btn:hover i {
    transform: translateX(2px);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
}

.scroll-indicator .mouse {
    width: 22px;
    height: 36px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
    opacity: 0.5;
}

.scroll-indicator .wheel {
    width: 3px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, 12px); }
}

.scroll-indicator span {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ── About Section ──────────────────────────────────────────────────────── */
.about-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4rem;
    align-items: start;
}

.about-image-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 3px;
    background: var(--accent-gradient);
    box-shadow: var(--card-shadow);
    width: 280px;
    flex-shrink: 0;
}

.about-image-wrapper::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: calc(var(--radius-lg) + 8px);
    background: var(--accent-gradient);
    opacity: 0.15;
    z-index: -1;
    filter: blur(20px);
    transition: opacity var(--t-medium);
}

.about-image-wrapper:hover::before {
    opacity: 0.3;
}

.about-image-inner {
    border-radius: calc(var(--radius-lg) - 3px);
    overflow: hidden;
    position: relative;
}

.about-image-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(3, 7, 18, 0.3) 100%);
    pointer-events: none;
}

.about-image {
    width: 100%;
    height: 360px;
    object-fit: cover;
    object-position: top center;
    filter: grayscale(15%) contrast(1.05);
    transition: filter var(--t-medium), transform var(--t-slow);
}

.about-image-wrapper:hover .about-image {
    filter: grayscale(0%) contrast(1);
    transform: scale(1.03);
}

.about-details h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.about-details p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.25rem 1rem;
}

.stat-num {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Skills Section ─────────────────────────────────────────────────────── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.skills-category {
    padding: 2rem;
}

.skills-category-title {
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.skills-category-title svg {
    color: var(--accent-primary);
    width: 20px;
    height: 20px;
}

/* Modern Skill Chips */
.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all var(--t-fast);
    cursor: default;
}

.skill-chip:hover {
    background: var(--accent-gradient-subtle);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.skill-chip .chip-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-primary);
    flex-shrink: 0;
}

/* ── Projects Section ───────────────────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.project-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.project-card .project-number {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    font-family: 'Space Grotesk', sans-serif;
}

.project-card .featured-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    z-index: 3;
}

.project-image-box {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow);
}

.project-card:hover .project-img {
    transform: scale(1.06);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: opacity var(--t-medium);
    z-index: 2;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-icon-link {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
}

.project-icon-link:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
    transform: scale(1.1);
}

.project-icon-link svg {
    width: 18px;
    height: 18px;
}

.project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.tech-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--accent-secondary);
    letter-spacing: 0.02em;
}

.project-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.project-more {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    transition: gap var(--t-fast);
}

.project-more svg {
    width: 14px;
    height: 14px;
    transition: transform var(--t-fast);
}

.project-card:hover .project-more svg {
    transform: translateX(4px);
}

/* ── Certificates Section ───────────────────────────────────────────────── */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.cert-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform var(--t-medium), box-shadow var(--t-medium), border-color var(--t-medium);
}

.cert-card:hover {
    transform: translateY(-6px) rotateX(2deg);
}

.cert-img-box {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    aspect-ratio: 1.4 / 1;
    position: relative;
}

.cert-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow);
}

.cert-card:hover .cert-img {
    transform: scale(1.05);
}

.cert-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--t-medium);
}

.cert-card:hover .cert-overlay {
    opacity: 1;
}

.cert-zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.85);
    transition: transform var(--t-medium);
}

.cert-card:hover .cert-zoom-btn {
    transform: scale(1);
}

.cert-zoom-btn svg {
    width: 18px;
    height: 18px;
}

.cert-issuer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
}

.cert-issuer svg {
    width: 13px;
    height: 13px;
}

.cert-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.cert-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* ── Education & Experience Timeline ────────────────────────────────────── */
.timeline-container {
    max-width: 820px;
    margin: 0 auto;
    position: relative;
}

.timeline-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--border-color), var(--accent-primary) 20%, var(--accent-secondary) 80%, var(--border-color));
}

.timeline-item {
    display: flex;
    width: 100%;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 28px;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--accent-primary);
    z-index: 5;
    transition: all var(--t-fast);
}

.timeline-item:hover .timeline-dot {
    transform: translate(-50%, -50%) scale(1.3);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.timeline-card-wrapper {
    width: 44%;
}

.timeline-item:nth-child(even) .timeline-card-wrapper {
    margin-left: auto;
}

.timeline-item:nth-child(odd) .timeline-card-wrapper {
    margin-right: auto;
}

.timeline-card {
    padding: 1.5rem;
}

.timeline-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.timeline-title {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.timeline-org {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.timeline-details {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.7;
}

.timeline-details li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.35rem;
}

.timeline-details li::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-secondary);
    position: absolute;
    left: 0;
    top: 0.55em;
}

/* ── Contact Section ────────────────────────────────────────────────────── */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
}

.contact-info-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.contact-info-desc {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.contact-detail-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.contact-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--t-fast);
}

.contact-detail-item:hover .contact-icon {
    background: var(--accent-gradient-subtle);
    border-color: var(--border-hover);
}

.contact-icon svg {
    width: 18px;
    height: 18px;
}

.contact-detail-content {
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-weight: 500;
}

.contact-val {
    font-weight: 600;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
}

.social-btn:hover {
    border-color: var(--accent-secondary);
    background: var(--accent-primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

/* Contact Form */
.contact-form {
    padding: 2.5rem;
}

.form-group {
    position: relative;
    margin-bottom: 1.75rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 0;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--t-fast);
}

.form-input:focus {
    border-color: var(--accent-primary);
}

.form-label {
    position: absolute;
    left: 0;
    top: 0.875rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all var(--t-fast);
    pointer-events: none;
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    transform: translateY(-1.5rem) scale(0.8);
    color: var(--accent-primary);
    transform-origin: left;
}

textarea.form-input {
    min-height: 100px;
    resize: none;
}

.form-status {
    font-size: 0.85rem;
    margin-top: 0.75rem;
    min-height: 1.25rem;
    font-weight: 500;
}

.form-status.success { color: #10b981; }
.form-status.error { color: #ef4444; }

/* ── Lightbox Modal ─────────────────────────────────────────────────────── */
.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-medium);
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    max-width: 860px;
    width: 92%;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.5rem;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
    z-index: 10;
}

.lightbox-close:hover {
    transform: rotate(90deg);
    background: var(--accent-primary);
    color: #fff;
}

.lightbox-close svg {
    width: 18px;
    height: 18px;
}

.lightbox-media {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    height: fit-content;
}

.lightbox-media img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.lightbox-info {
    display: flex;
    flex-direction: column;
}

.lightbox-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-secondary);
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.lightbox-title {
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.lightbox-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.7;
}

.lightbox-meta {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.lightbox-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.lightbox-actions {
    display: flex;
    gap: 0.75rem;
}

.lightbox-content::-webkit-scrollbar {
    width: 3px;
}
.lightbox-content::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 2px;
}

/* ── Back to Top ────────────────────────────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: all var(--t-medium);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.back-to-top:hover {
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.45);
    transform: translateY(-4px);
}

.back-to-top svg {
    width: 18px;
    height: 18px;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 2;
    background: var(--bg-primary);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.footer-tagline span {
    color: #ef4444;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color var(--t-fast);
}

.footer-nav a:hover {
    color: var(--accent-primary);
}

/* ── CSS-only Reveal Animations (fallback for GSAP) ─────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN — Mobile First
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet (max 1024px) ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    :root {
        --section-gap: 5rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    .about-image-wrapper {
        margin: 0 auto;
        width: 240px;
    }

    .about-stats {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .skills-grid {
        grid-template-columns: 1fr 1fr;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-info {
        align-items: center;
        text-align: center;
    }

    .lightbox-content {
        grid-template-columns: 1fr;
        padding: 2rem;
    }

    .lightbox-media {
        max-height: 280px;
    }
}

/* ── Mobile (max 768px) ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --section-gap: 4rem;
        --header-height: 64px;
    }

    header {
        background: var(--glass-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border-color);
    }

    /* Mobile Nav */
    .mobile-nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-20px);
        transition: all 0.4s var(--ease-out);
        z-index: 1001;
    }

    .nav-links.active {
        opacity: 1;
        pointer-events: all;
        transform: translateY(0);
    }

    .nav-link {
        font-size: 1.25rem;
        font-weight: 600;
    }

    /* Hero */
    .hero {
        min-height: calc(100vh - 2rem);
        padding-top: calc(var(--header-height) + 1rem);
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        justify-content: center;
        width: 100%;
    }

    .scroll-indicator {
        display: none;
    }

    /* Skills */
    .skills-grid {
        grid-template-columns: 1fr;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Certificates */
    .certificates-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    /* Timeline */
    .timeline-line {
        left: 16px;
    }

    .timeline-dot {
        left: 16px;
    }

    .timeline-card-wrapper {
        width: calc(100% - 44px);
        margin-left: 44px !important;
        margin-right: 0 !important;
    }

    /* Footer */
    .footer-container {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
    }

    .footer-nav {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* ── Small Mobile (max 480px) ───────────────────────────────────────────── */
@media (max-width: 480px) {
    :root {
        --section-gap: 3.5rem;
    }

    .container {
        padding: 0 1rem;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.875rem 0.5rem;
    }

    .stat-num {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .certificates-grid {
        grid-template-columns: 1fr 1fr;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .back-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 38px;
        height: 38px;
    }

    .lightbox-content {
        padding: 1.5rem;
        width: 95%;
    }

    .lightbox-title {
        font-size: 1.25rem;
    }
}
