/* ============================================================
   ALI HATEM — PREMIUM PORTFOLIO  |  style.css
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
    /* Dark Theme (default) */
    --bg-primary: #050508;
    --bg-secondary: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-1: #6c63ff;
    --accent-2: #00d4ff;
    --accent-3: #ff6584;
    --text-primary: #f0f0f8;
    --text-secondary: #9090b0;
    --text-muted: #505068;
    --glow-1: rgba(108, 99, 255, 0.25);
    --glow-2: rgba(0, 212, 255, 0.20);
    --cursor-color: #6c63ff;
    --nav-blur: rgba(5, 5, 8, 0.85);
    --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.5);
    --gradient-hero: linear-gradient(135deg, #6c63ff 0%, #00d4ff 100%);
    --transition-theme: 0.5s ease;
}

[data-theme="light"] {
    --bg-primary: #f4f4fa;
    --bg-secondary: #eaeaf5;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --border-color: rgba(0, 0, 0, 0.08);
    --accent-1: #5a52e0;
    --accent-2: #00aad4;
    --accent-3: #e05070;
    --text-primary: #0d0d1a;
    --text-secondary: #4a4a6a;
    --text-muted: #9898b8;
    --glow-1: rgba(90, 82, 224, 0.18);
    --glow-2: rgba(0, 170, 212, 0.18);
    --cursor-color: #5a52e0;
    --nav-blur: rgba(244, 244, 250, 0.85);
    --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.12);
    --gradient-hero: linear-gradient(135deg, #5a52e0 0%, #00aad4 100%);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: none;
    overflow-x: hidden;
    transition: background var(--transition-theme), color var(--transition-theme);
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-1);
    border-radius: 4px;
}

/* ── Custom Cursor ────────────────────────────────────────── */
#cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--cursor-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease, width 0.25s ease, height 0.25s ease, background 0.3s;
    box-shadow: 0 0 10px var(--cursor-color), 0 0 20px var(--cursor-color);
}

#cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--cursor-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.35s ease, height 0.35s ease, border-color 0.3s, opacity 0.3s;
    opacity: 0.6;
}

body.cursor-hover #cursor-dot {
    width: 12px;
    height: 12px;
}

body.cursor-hover #cursor-ring {
    width: 60px;
    height: 60px;
    opacity: 1;
    box-shadow: 0 0 20px var(--cursor-color);
}

body.cursor-button #cursor-dot {
    width: 16px;
    height: 16px;
    background: var(--accent-2);
    box-shadow: 0 0 20px var(--accent-2);
}

body.cursor-button #cursor-ring {
    width: 70px;
    height: 70px;
    border-color: var(--accent-2);
    box-shadow: 0 0 30px var(--glow-2);
}

/* ── Navigation ───────────────────────────────────────────── */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--nav-blur);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-theme), padding 0.3s;
}

#navbar.scrolled {
    padding: 0.7rem 3rem;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    transition: color 0.3s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-hero);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#theme-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-glass);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

#theme-toggle:hover {
    border-color: var(--accent-1);
    box-shadow: 0 0 15px var(--glow-1);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: none;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ── Background FX Canvas ─────────────────────────────────── */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

/* ── HERO SECTION ─────────────────────────────────────────── */
#hero {
    position: relative;
    height: 200vh;
    z-index: 1;
}

.hero-inner {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 4rem;
    padding: 0 8vw;
    padding-top: 5rem;
    z-index: 2;
}

/* ── Hero Left ────────────────────────────────────────────── */
.hero-left {
    flex: 1;
    position: relative;
    z-index: 2;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 6px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-2);
    margin-bottom: 1.8rem;
    backdrop-filter: blur(10px);
    animation: fadeSlideUp 0.8s ease both;
    animation-delay: 0.2s;
}

.hero-tag .dot {
    width: 6px;
    height: 6px;
    background: var(--accent-2);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero-name {
    font-size: clamp(3rem, 7vw, 6.5rem);
    font-weight: 900;
    line-height: 1.0;
    letter-spacing: -2px;
    margin-bottom: 0.6rem;
    animation: fadeSlideUp 0.8s ease both;
    animation-delay: 0.4s;
}

.hero-name .line {
    display: block;
    overflow: hidden;
}

.hero-name .line span {
    display: block;
    transform: translateY(110%);
    animation: revealUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-name .line:nth-child(1) span {
    animation-delay: 0.5s;
}

.hero-name .line:nth-child(2) span {
    animation-delay: 0.65s;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.35rem);
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.8s ease both;
    animation-delay: 0.8s;
}

.hero-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 480px;
    margin-bottom: 2.5rem;
    animation: fadeSlideUp 0.8s ease both;
    animation-delay: 1s;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    animation: fadeSlideUp 0.8s ease both;
    animation-delay: 1.15s;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: none;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: var(--gradient-hero);
    color: #fff;
    box-shadow: 0 4px 24px var(--glow-1);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px var(--glow-1), 0 0 0 1px var(--accent-1);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--glow-1);
}

.btn-icon {
    font-size: 1rem;
    transition: transform 0.3s;
}

.btn:hover .btn-icon {
    transform: translateX(4px);
}

/* ── Hero Right ───────────────────────────────────────────── */
.hero-right {
    flex: 0 0 400px;
    position: relative;
    z-index: 2;
    animation: fadeSlideLeft 1s ease both;
    animation-delay: 0.6s;
}

.hero-image-wrapper {
    position: relative;
    width: 360px;
    height: 450px;
    margin: 0 auto;
}

.hero-image-frame {
    position: absolute;
    inset: 0;
    border-radius: 40px;
    background: var(--gradient-hero);
    opacity: 0.15;
    filter: blur(30px);
    animation: breathe 4s ease-in-out infinite;
}

.hero-image-border {
    position: absolute;
    inset: -2px;
    border-radius: 42px;
    background: var(--gradient-hero);
    z-index: 0;
    opacity: 0.5;
}

/* !! REPLACE src with your actual photo !! */
.hero-photo {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 40px;
    object-fit: cover;
    z-index: 1;
    display: block;
}

.hero-photo-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 40px;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(108, 99, 255, 0.08) 100%);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 8px;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.hero-photo-placeholder .ph-icon {
    font-size: 3rem;
    opacity: 0.3;
}

.hero-badge {
    position: absolute;
    bottom: -16px;
    right: -16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 12px 18px;
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 3;
    animation: float 3s ease-in-out infinite;
    box-shadow: var(--shadow-card);
}

.hero-badge .badge-num {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.hero-badge .badge-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.hero-badge-2 {
    position: absolute;
    top: 30px;
    left: -20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 10px 14px;
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 3;
    animation: float 3.5s ease-in-out infinite reverse;
    box-shadow: var(--shadow-card);
}

.hero-badge-2 .status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero-badge-2 .badge-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Hero Scroll Down ─────────────────────────────────────── */
.hero-scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    z-index: 2;
    animation: fadeIn 2s ease both;
    animation-delay: 1.5s;
}

.scroll-line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, var(--accent-1), transparent);
    animation: scrollDown 2s ease-in-out infinite;
}

/* ── Name Reveal Section ──────────────────────────────────── */
#name-reveal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.name-reveal-text {
    font-size: clamp(4rem, 14vw, 14rem);
    font-weight: 900;
    letter-spacing: -4px;
    line-height: 1;
    text-align: center;
    opacity: 0;
    position: relative;
    user-select: none;
}

.name-reveal-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(120px) rotateX(-90deg);
    transform-origin: bottom center;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── BG Typography ────────────────────────────────────────── */
.bg-typography {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(5rem, 18vw, 20rem);
    font-weight: 900;
    letter-spacing: -6px;
    white-space: nowrap;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.04;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* ── Section Base ─────────────────────────────────────────── */
section {
    position: relative;
    z-index: 2;
    padding: 8rem 8vw;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-1);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.section-tag::before {
    content: '';
    width: 30px;
    height: 2px;
    background: var(--accent-1);
    border-radius: 2px;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 1.5rem;
}

/* ── Reveal Animations ────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ── ABOUT SECTION ────────────────────────────────────────── */
#about {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

.about-left {
    position: relative;
}

.about-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 2;
    margin-bottom: 2rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--accent-1);
    box-shadow: 0 0 24px var(--glow-1);
    transform: translateY(-4px);
}

.stat-num {
    font-size: 2.2rem;
    font-weight: 900;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Skill Cards ──────────────────────────────────────────── */
.about-right {
    position: relative;
}

.skills-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.skill-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    cursor: none;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
    transform: translateY(30px);
    backdrop-filter: blur(10px);
}

.skill-chip.popped {
    opacity: 1;
    transform: translateY(0);
}

.skill-chip:hover {
    border-color: var(--accent-1);
    box-shadow: 0 0 20px var(--glow-1);
    transform: translateY(-6px) rotateX(5deg) rotateY(5deg);
}

.skill-chip .skill-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
    display: block;
}

.skill-chip .skill-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ── PROJECTS SECTION ─────────────────────────────────────── */
#projects {
    overflow: hidden;
}

.projects-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 3rem;
}

.slider-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Slider Track ─────────────────────────────────────────── */
.slider-container {
    position: relative;
    overflow: hidden;
    margin: 0 -8vw;
    padding: 2rem 0;
    cursor: none;
}

.slider-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: slideLeft 35s linear infinite;
    padding: 0 8vw;
    will-change: transform;
}

.slider-track.paused {
    animation-play-state: paused;
}

.slider-track.dragging {
    animation-play-state: paused;
    cursor: none;
}

@keyframes slideLeft {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* ── Project Cards ────────────────────────────────────────── */
.project-card {
    flex: 0 0 350px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s ease;
    user-select: none;
    backdrop-filter: blur(10px);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 0;
    border-radius: 24px;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-1);
    box-shadow: 0 20px 60px var(--glow-1);
}

.project-card:hover::before {
    opacity: 0.04;
}

.project-img-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.project-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.project-card:hover .project-img-wrap img {
    transform: scale(1.08);
}

.project-info {
    padding: 1.4rem;
    position: relative;
    z-index: 1;
}

.project-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.project-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.2rem;
}

.project-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.ptag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 100px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--accent-2);
    backdrop-filter: blur(8px);
}

.project-actions {
    display: flex;
    gap: 0.6rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.78rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: none;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
}

.btn-sm-primary {
    background: var(--gradient-hero);
    color: #fff;
}

.btn-sm-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--glow-1);
}

.btn-sm-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-sm-outline:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════
   PROJECT MODAL — Full Browser Chrome
═══════════════════════════════════════════════════════════ */
#project-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    padding: 16px;
    pointer-events: none;
    /* Let clicks pass through to background */
}

#project-modal.open {
    display: block;
    /* Removing flex so that absolute positioning based on screen center works smoothly from JS */
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
    /* Crucial for interacting behind */
}

.modal-box {
    position: absolute;
    z-index: 10;
    width: 900px;
    max-width: 90vw;
    height: 600px;
    max-height: 85vh;
    background: rgba(26, 26, 36, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: macScaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1), floatWindow 6s ease-in-out infinite alternate;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: box-shadow 0.4s ease;
    pointer-events: auto;
    /* Enable interaction only on the box itself */
    resize: both;
    transform-style: preserve-3d;
    perspective: 1000px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

[data-theme="light"] .modal-box {
    background: rgba(232, 232, 240, 0.75);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.modal-box.fullscreen {
    width: 100vw !important;
    max-width: 100vw;
    height: 100vh !important;
    max-height: 100vh;
    left: 0 !important;
    top: 0 !important;
    border-radius: 0;
    resize: none;
    animation: none;
    transform: none;
}

@keyframes macScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px) rotateX(4deg);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0deg);
    }
}

@keyframes floatWindow {
    0% {
        transform: translateY(0px);
    }

    100% {
        transform: translateY(-8px);
    }
}

/* ── Toolbar ───────────────────────────────────────────────── */
.modal-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #13131c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
    position: relative;
}

.modal-toolbar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: toolbarShine 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes toolbarShine {
    0% {
        left: -150%;
    }

    20% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

[data-theme="light"] .modal-toolbar {
    background: #d8d8e8;
    border-color: rgba(0, 0, 0, 0.1);
}

/* Traffic Lights */
.modal-traffic {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 8px;
}

.traffic-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    cursor: none;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
}

.traffic-close {
    background: #ff5f57;
}

.traffic-min {
    background: #febc2e;
}

.traffic-max {
    background: #28c840;
}

.traffic-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.15);
}

.traffic-close:hover {
    box-shadow: 0 0 10px #ff5f57;
}

.traffic-min:hover {
    box-shadow: 0 0 10px #febc2e;
}

.traffic-max:hover {
    box-shadow: 0 0 10px #28c840;
}

.traffic-btn:active {
    transform: scale(0.9);
}

/* Nav row with address bar */
.modal-nav-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px 12px;
}

.modal-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
    text-decoration: none;
}

[data-theme="light"] .modal-nav-btn {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.6);
}

.modal-nav-btn:hover {
    background: rgba(108, 99, 255, 0.15);
    border-color: rgba(108, 99, 255, 0.4);
    color: #fff;
}

.modal-external {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-2);
    border-color: rgba(0, 212, 255, 0.25);
}

.modal-external:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--accent-2);
    color: var(--accent-2);
}

/* Address Bar */
.modal-address-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0 12px;
    height: 34px;
    transition: border-color 0.2s, background 0.2s;
}

.modal-address-bar:focus-within {
    border-color: var(--accent-1);
    background: rgba(108, 99, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

[data-theme="light"] .modal-address-bar {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
}

.modal-lock {
    font-size: 0.75rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.modal-url-text {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Space Grotesk', monospace;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="light"] .modal-url-text {
    color: rgba(0, 0, 0, 0.75);
}

.modal-go-btn {
    background: var(--gradient-hero);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    cursor: none;
    font-family: 'Outfit', sans-serif;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.modal-go-btn:hover {
    opacity: 0.85;
}

/* ── Loading Bar ───────────────────────────────────────────── */
.modal-loading-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-loading-bar.loading {
    opacity: 1;
}

.modal-loading-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--gradient-hero);
    border-radius: 0 3px 3px 0;
    width: 0%;
    transition: width 0.4s ease;
}

.modal-loading-fill.running {
    animation: loadProgress 2.5s ease forwards;
}

@keyframes loadProgress {
    0% {
        width: 0%;
    }

    30% {
        width: 50%;
    }

    70% {
        width: 80%;
    }

    100% {
        width: 95%;
    }
}

/* ── Iframe ────────────────────────────────────────────────── */
.modal-iframe {
    flex: 1;
    width: 100%;
    border: none;
    display: block;
    background: #fff;
    transition: opacity 0.3s;
}

/* ── Blocked Site Fallback ─────────────────────────────────── */
.modal-blocked {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-primary);
}

.modal-blocked-inner {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 900px;
    width: 100%;
}

.modal-blocked-img-wrap {
    flex: 0 0 480px;
    height: 320px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
}

.modal-blocked-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.4s ease;
}

.modal-blocked-img-wrap:hover img {
    transform: scale(1.03);
}

.modal-blocked-msg {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.blocked-icon {
    font-size: 2.5rem;
}

.modal-blocked-msg h3 {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
}

.modal-blocked-msg p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

@media (max-width: 700px) {
    .modal-blocked-inner {
        flex-direction: column;
    }

    .modal-blocked-img-wrap {
        flex: none;
        width: 100%;
        height: 200px;
    }
}

/* ── HONORS SECTION ───────────────────────────────────────── */
#honors {
    background: var(--bg-secondary);
    overflow: visible;
}

.honors-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: 4rem;
}

/* ── Stacked Cards ────────────────────────────────────────── */
.honors-stack {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.honor-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem 2.5rem;
    margin-bottom: 1.5rem;
    cursor: none;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(14px);
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px);
}

.honor-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.honor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-hero);
    border-radius: 4px 0 0 4px;
}

.honor-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    opacity: 0;
    transition: opacity 0.4s;
    border-radius: 24px;
}

.honor-card:hover::after {
    opacity: 0.04;
}

.honor-card:hover {
    border-color: var(--accent-1);
    box-shadow: 0 16px 50px var(--glow-1), 0 0 0 1px var(--accent-1);
    transform: translateX(12px) translateY(-4px);
}

.honor-card-inner {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.honor-badge-icon {
    flex: 0 0 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--gradient-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 24px var(--glow-1);
    animation: spinSlow 8s linear infinite;
}

@keyframes spinSlow {
    0% {
        transform: rotateY(0)
    }

    100% {
        transform: rotateY(360deg)
    }
}

.honor-content {
    flex: 1;
}

.honor-year {
    font-size: 0.7rem;
    color: var(--accent-2);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.honor-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.honor-org {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.honor-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.honor-glow {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--glow-1), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
}

.honor-card:hover .honor-glow {
    opacity: 1;
}

/* ── In Dark Mode: animated border ───────────────────────── */
[data-theme="dark"] .honor-card:hover,
body:not([data-theme="light"]) .honor-card:hover {
    animation: borderPulse 1.5s ease-in-out infinite;
}

@keyframes borderPulse {

    0%,
    100% {
        box-shadow: 0 16px 50px var(--glow-1), 0 0 0 1px var(--accent-1);
    }

    50% {
        box-shadow: 0 20px 60px var(--glow-2), 0 0 0 2px var(--accent-2);
    }
}

/* ── CONTACT SECTION ──────────────────────────────────────── */
#contact {
    text-align: center;
}

.contact-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 3rem;
    line-height: 1.8;
}

.contact-grid {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.contact-card:hover {
    border-color: var(--accent-1);
    box-shadow: 0 8px 30px var(--glow-1);
    transform: translateY(-6px);
    color: var(--accent-1);
}

.contact-icon {
    font-size: 1.6rem;
}

.contact-info {
    text-align: left;
}

.contact-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.contact-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── FOOTER ───────────────────────────────────────────────── */
footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 8vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: 800;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-1);
}

/* ── Keyframe Animations ──────────────────────────────────── */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealUp {
    from {
        transform: translateY(110%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

@keyframes breathe {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.15;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.25;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.75);
    }
}

@keyframes scrollDown {

    0%,
    100% {
        transform: scaleY(1);
        opacity: 1;
    }

    50% {
        transform: scaleY(0.4);
        opacity: 0.3;
    }
}

/* ── Theme Transition Overlay ─────────────────────────────── */
#theme-ripple {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
}

.ripple-circle {
    position: absolute;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--bg-primary);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease, opacity 0.3s ease;
    opacity: 0;
}

.ripple-circle.active {
    width: 300vmax;
    height: 300vmax;
    opacity: 1;
}

/* ── Loading Screen ───────────────────────────────────────── */
#loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-bar {
    width: 200px;
    height: 2px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.loader-fill {
    height: 100%;
    background: var(--gradient-hero);
    border-radius: 2px;
    animation: loadFill 2s ease forwards;
}

@keyframes loadFill {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

/* ── Mobile Menu ──────────────────────────────────────────── */
.nav-mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background: var(--bg-primary);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.nav-mobile-menu.open {
    display: flex;
}

.nav-mobile-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    transition: color 0.3s;
}

.nav-mobile-menu a:hover {
    color: var(--accent-1);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .projects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    #navbar {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    #hero {
        padding: 0 5vw;
    }

    section {
        padding: 5rem 5vw;
    }

    footer {
        padding: 2rem 5vw;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .hero-inner {
        flex-direction: column-reverse;
        gap: 2.5rem;
        padding-top: 6rem;
    }

    .hero-right {
        flex: none;
        width: 100%;
    }

    .hero-image-wrapper {
        width: 260px;
        height: 320px;
        margin: 0 auto;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    #cursor-dot,
    #cursor-ring {
        display: none;
    }

    body {
        cursor: auto;
    }

    .btn,
    .skill-chip,
    .project-card,
    .honor-card,
    .contact-card,
    #theme-toggle,
    .hamburger,
    .btn-sm,
    .modal-close {
        cursor: pointer;
    }

    [data-theme="dark"] .honor-card:hover,
    body:not([data-theme="light"]) .honor-card:hover {
        animation: none;
    }
}

@media (max-width: 480px) {
    .hero-name {
        font-size: 2.8rem;
        letter-spacing: -1px;
    }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .name-reveal-text {
        font-size: 3.5rem;
        letter-spacing: -2px;
    }

    .contact-card {
        min-width: 100%;
    }
}