/* ================================================================
   MARUF AHMED — PORTFOLIO STYLES
   A dark, cinematic, animated portfolio
   ================================================================ */

/* ==================== VARIABLES ==================== */
:root {
    /* Colors */
    --bg: #0a0a0b;
    --bg-secondary: #111113;
    --bg-tertiary: #1a1a1e;
    --surface: #16161a;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text: #e8e8ec;
    --text-secondary: #8b8b96;
    --text-muted: #55555e;
    --accent: #6c63ff;
    --accent-light: #8b83ff;
    --accent-glow: rgba(108, 99, 255, 0.15);
    --accent-glow-strong: rgba(108, 99, 255, 0.3);
    --gradient-1: linear-gradient(135deg, #6c63ff, #3b82f6, #06b6d4);
    --gradient-2: linear-gradient(135deg, #6c63ff 0%, #8b83ff 50%, #3b82f6 100%);
    --gradient-text: linear-gradient(135deg, #fff 0%, #a8a3ff 50%, #6c63ff 100%);

    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --section-padding: clamp(80px, 12vh, 160px);
    --container-width: 1200px;
    --container-padding: clamp(20px, 4vw, 60px);

    /* Animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ==================== RESET ==================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

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

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

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

/* ==================== NOISE OVERLAY ==================== */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ==================== PARTICLE CANVAS ==================== */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ==================== PRELOADER ==================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s var(--ease-out-expo), visibility 0.8s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-inner {
    text-align: center;
}

.preloader-line-wrap {
    width: 200px;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 24px;
}

.preloader-line {
    width: 0%;
    height: 100%;
    background: var(--gradient-2);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.preloader-text {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 40px;
}

.preloader-name {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 3px;
    color: var(--text-secondary);
}

.preloader-counter {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-muted);
}

/* ==================== NAVIGATION ==================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transition: all 0.5s var(--ease-out-expo);
}

.nav.scrolled {
    padding: 16px var(--container-padding);
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo-text {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    position: relative;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.4s var(--ease-out-expo);
}

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

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

.nav-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    z-index: 1001;
}

.nav-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.4s var(--ease-out-expo);
    transform-origin: center;
}

.nav-menu-btn.active span:first-child {
    transform: rotate(45deg) translate(3px, 3px);
}

.nav-menu-btn.active span:last-child {
    transform: rotate(-45deg) translate(3px, -3px);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-menu-btn {
        display: flex;
    }
}

/* ==================== MOBILE MENU ==================== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s var(--ease-out-expo);
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
}

.mobile-link {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 600;
    color: var(--text);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s var(--ease-out-expo);
}

.mobile-menu.active .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.active .mobile-link:nth-child(1) {
    transition-delay: 0.1s;
}

.mobile-menu.active .mobile-link:nth-child(2) {
    transition-delay: 0.15s;
}

.mobile-menu.active .mobile-link:nth-child(3) {
    transition-delay: 0.2s;
}

.mobile-menu.active .mobile-link:nth-child(4) {
    transition-delay: 0.25s;
}

.mobile-menu.active .mobile-link:nth-child(5) {
    transition-delay: 0.3s;
}

/* ==================== SOCIAL SIDEBAR ==================== */
.social-sidebar {
    position: fixed;
    left: 32px;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 100;
}

.social-link {
    color: var(--text-muted);
    transition: all 0.3s ease;
    padding: 4px;
}

.social-link:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.social-line {
    width: 1px;
    height: 80px;
    background: var(--text-muted);
}

@media (max-width: 768px) {
    .social-sidebar {
        display: none;
    }
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    position: relative;
}

/* ==================== SECTION HEADER ==================== */
.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 64px;
}

.section-number {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent);
    font-weight: 500;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    white-space: nowrap;
}

.section-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ==================== HERO SECTION ==================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 var(--container-padding);
    position: relative;
    z-index: 1;
    max-width: var(--container-width);
    margin: 0 auto;
}

.hero-content {
    padding-top: 80px;
    position: relative;
    z-index: 2;
}

.hero-greeting {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    opacity: 0;
}

.hero-line {
    width: 40px;
    height: 1px;
    background: var(--accent);
}

.hero-greeting-text {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(48px, 10vw, 120px);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -2px;
    margin-bottom: 24px;
    overflow: hidden;
    position: relative;
}

.hero-name::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-glow-strong) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    filter: blur(60px);
    animation: heroGlow 4s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

.hero-first,
.hero-last {
    display: block;
    opacity: 0;
    transform: translateY(100%);
}

.hero-first {
    background: linear-gradient(135deg, #fff 0%, #a8a3ff 50%, #6c63ff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== HERO SVG ANIMATION ==================== */
.hero-svg-container {
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    height: 280px;
    z-index: 1;
    pointer-events: none;
}

.hero-svg-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-svg-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 40px rgba(108, 99, 255, 0.3));
}

.hero-svg-icon svg path,
.hero-svg-icon svg circle,
.hero-svg-icon svg line,
.hero-svg-icon svg polyline,
.hero-svg-icon svg rect {
    stroke: var(--accent);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
}

.hero-svg-icon svg .svg-fill {
    fill: rgba(108, 99, 255, 0.05);
}

@media (max-width: 968px) {
    .hero-svg-container {
        display: none;
    }
}

.hero-title-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    opacity: 0;
}

.hero-title-line {
    width: 60px;
    height: 2px;
    background: var(--gradient-2);
    border-radius: 2px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: 400;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
}

.hero-title-static {
    color: var(--text-secondary);
}

.hero-title-dynamic {
    color: var(--accent-light);
    font-weight: 600;
    min-width: 200px;
}

.hero-title-cursor {
    color: var(--accent);
    animation: cursorBlink 1s infinite;
    font-weight: 300;
}

@keyframes cursorBlink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.hero-description {
    font-size: clamp(16px, 1.5vw, 20px);
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: 48px;
    opacity: 0;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    opacity: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 50px;
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-2);
    color: #fff;
    box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-primary:hover {
    box-shadow: 0 8px 40px var(--accent-glow-strong);
    transform: translateY(-2px);
}

.btn-ghost {
    border: 1px solid var(--border-hover);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* Hero Scroll Indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: var(--container-padding);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: var(--border);
    position: relative;
    overflow: hidden;
}

.scroll-dot {
    width: 3px;
    height: 12px;
    background: var(--accent);
    border-radius: 3px;
    position: absolute;
    left: -1px;
    animation: scrollDown 2s infinite var(--ease-in-out);
}

@keyframes scrollDown {
    0% {
        top: 0;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        top: calc(100% - 12px);
        opacity: 0;
    }
}

.hero-scroll-indicator span {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* ==================== ABOUT SECTION ==================== */
.about {
    padding: var(--section-padding) 0;
    position: relative;
    z-index: 1;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 80px;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.about-intro {
    font-size: 20px !important;
    color: var(--text) !important;
    line-height: 1.7 !important;
}

.about-text strong {
    color: var(--accent-light);
    font-weight: 600;
}

.about-text em {
    color: var(--text);
    font-style: normal;
    border-bottom: 1px solid var(--accent-glow-strong);
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-2);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-suffix {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

/* ==================== WHAT I DO ==================== */
.whatido {
    padding: var(--section-padding) 0;
    position: relative;
    z-index: 1;
}

.whatido-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

.whatido-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s var(--ease-out-expo);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.whatido-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

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

.whatido-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(108, 99, 255, 0.15);
}

.whatido-icon {
    color: var(--accent);
    margin-bottom: 4px;
    transition: transform 0.4s var(--ease-out-expo);
    transform-origin: center center;
    will-change: transform;
    display: inline-flex;
}

.whatido-card:hover .whatido-icon {
    transform: scale(1.1);
}

.whatido-card h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
}

.whatido-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.whatido-subs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.whatido-subs span {
    padding: 5px 14px;
    background: var(--accent-glow);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: 20px;
    font-size: 12px;
    color: var(--accent-light);
    font-weight: 500;
    transition: all 0.3s ease;
}

.whatido-subs span:hover {
    background: rgba(108, 99, 255, 0.2);
    border-color: var(--accent);
}

/* ==================== TECH STACK LOGOS ==================== */
.techstack-logos {
    margin-bottom: 60px;
}

.techstack-logos-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 28px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.techstack-logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.tech-logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 80px;
    padding: 16px 8px;
    border-radius: 14px;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.4s var(--ease-out-expo);
    cursor: default;
}

.tech-logo-item:hover {
    background: var(--surface);
    border-color: var(--border);
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.tech-logo-item img {
    width: 40px;
    height: 40px;
    transition: transform 0.4s var(--ease-out-expo);
    filter: grayscale(40%);
}

.tech-logo-item:hover img {
    transform: scale(1.2);
    filter: grayscale(0%);
}

.tech-logo-item span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.tech-logo-item:hover span {
    color: var(--text-primary);
}

/* ==================== LIFECYCLE PIPELINE ==================== */
.lifecycle {
    position: relative;
}

.lifecycle-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 40px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.lifecycle-diagram {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 32px;
    align-items: center;
}

.lifecycle-track {
    position: relative;
}

.lifecycle-track-label {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 20px;
    text-align: center;
}

.lifecycle-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding-top: 0;
}

.lifecycle-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    opacity: 0;
    transform: translateY(20px);
}

.lifecycle-step.active {
    opacity: 1;
    transform: translateY(0);
}

.lifecycle-step-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-primary);
    transition: all 0.4s ease;
    position: relative;
    flex-shrink: 0;
}

.lifecycle-step.active .lifecycle-step-dot {
    border-color: var(--accent);
    box-shadow: 0 0 16px var(--accent-glow-strong);
}

.lifecycle-step.active .lifecycle-step-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.lifecycle-step span {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.lifecycle-step.active span {
    color: var(--text-primary);
}

.lifecycle-connector {
    flex: 0.6;
    height: 2px;
    background: var(--border);
    position: relative;
    overflow: hidden;
    margin-top: 7px;
    flex-shrink: 0;
}

.lifecycle-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.6s ease;
}

.lifecycle-connector.active::after {
    width: 100%;
}

.lifecycle-merge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    justify-content: center;
    transition: all 0.6s ease;
    background: var(--surface);
}

.lifecycle-merge.active {
    border-color: var(--accent);
    box-shadow: 0 0 40px var(--accent-glow-strong), 0 0 80px rgba(108, 99, 255, 0.1);
}

.lifecycle-merge-icon {
    color: var(--accent);
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

.lifecycle-merge.active .lifecycle-merge-icon {
    opacity: 1;
}

.lifecycle-merge span {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.lifecycle-merge.active span {
    color: var(--accent-light);
}

@media (max-width: 968px) {
    .whatido-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto 60px;
    }

    .lifecycle-diagram {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .lifecycle-merge {
        margin: 0 auto;
    }

    .lifecycle-steps {
        flex-direction: column;
        gap: 0;
    }

    .lifecycle-connector {
        width: 2px;
        height: 24px;
        flex: none;
    }

    .lifecycle-connector::after {
        width: 100% !important;
        height: 0%;
    }

    .lifecycle-connector.active::after {
        height: 100%;
        width: 100%;
    }

    .techstack-logo-grid {
        gap: 12px;
    }

    .tech-logo-item {
        width: 65px;
    }

    .tech-logo-item img {
        width: 32px;
        height: 32px;
    }
}

/* ==================== TECH MARQUEE ==================== */
.techstack {
    padding: 40px 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.techstack-marquee {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-track {
    display: inline-flex;
    gap: 24px;
    animation: marquee 30s linear infinite;
}

.marquee-item {
    font-family: var(--font-display);
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.marquee-item:hover {
    color: var(--accent);
}

.marquee-separator {
    color: var(--accent);
    font-size: 14px;
    opacity: 0.5;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ==================== EXPERIENCE / TIMELINE ==================== */
.experience {
    padding: var(--section-padding) 0;
    position: relative;
    z-index: 1;
}

.timeline {
    position: relative;
    padding-left: 60px;
}

.timeline-line {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.timeline-progress {
    width: 100%;
    height: 0%;
    background: var(--gradient-2);
    transition: height 0.1s linear;
}

.timeline-item {
    position: relative;
    margin-bottom: 48px;
}

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

.timeline-dot {
    position: absolute;
    left: -48px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.4s ease;
}

.timeline-item:hover .timeline-dot {
    background: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow-strong);
}

.timeline-dot-inner {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    transition: all 0.4s ease;
}

.timeline-item:hover .timeline-dot-inner {
    background: #fff;
}

.timeline-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.4s var(--ease-out-expo);
}

.timeline-item:hover .timeline-content {
    border-color: var(--border-hover);
    transform: translateX(8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.timeline-header h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.timeline-header h4 {
    font-size: 14px;
    color: var(--accent-light);
    font-weight: 500;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 4px 12px;
    background: var(--accent-glow);
    border-radius: 20px;
    border: 1px solid rgba(108, 99, 255, 0.15);
}

.timeline-content p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.timeline-content strong {
    color: var(--accent-light);
    font-weight: 600;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.timeline-tags span {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.timeline-tags span:hover {
    color: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .timeline {
        padding-left: 40px;
    }

    .timeline-line {
        left: 10px;
    }

    .timeline-dot {
        left: -36px;
        width: 12px;
        height: 12px;
    }

    .timeline-dot-inner {
        width: 4px;
        height: 4px;
    }

    .timeline-header {
        flex-direction: column;
    }

    .timeline-content {
        padding: 24px;
    }
}

/* ==================== PROJECTS ==================== */
.projects {
    padding: var(--section-padding) 0;
    position: relative;
    z-index: 1;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s var(--ease-out-expo);
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.project-card-featured {
    grid-column: 1 / -1;
    min-height: 360px;
}

.project-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, var(--accent-glow) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

.project-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.project-number {
    font-family: var(--font-display);
    font-size: 64px;
    font-weight: 800;
    color: var(--bg-tertiary);
    position: absolute;
    top: 24px;
    right: 32px;
    line-height: 1;
    transition: color 0.5s ease;
    z-index: 1;
}

.project-card:hover .project-number {
    color: rgba(108, 99, 255, 0.1);
}

.project-info {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-category {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.project-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.project-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
    margin-bottom: 20px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.project-tech span {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.project-tech span:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Project Image / Carousel */
.project-image {
    position: relative;
    z-index: 2;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    height: 220px;
    background: #0d0d10;
}

.project-card-featured .project-image {
    height: 300px;
}

.carousel-track {
    display: flex;
    height: 100%;
    align-items: flex-start;
    transition: transform 0.6s var(--ease-out-expo);
    will-change: transform;
}

.project-image img,
.project-image video {
    flex: 0 0 100%;
    width: 100%;
    display: block;
    filter: brightness(0.82);
    transition: filter 0.4s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
}

/* Images keep natural height so the slideshow can pan top -> bottom */
.project-image img {
    height: auto;
    will-change: transform;
}

.project-image video {
    height: 100%;
    object-fit: cover;
    background: #000;
}

.project-card:hover .project-image img,
.project-card:hover .project-image video {
    filter: brightness(1);
}

/* Popup owns zoom now — hide the per-card magnifier */
.project-image .carousel-zoom {
    display: none;
}

/* Whole card opens the deep-dive popup */
.project-card {
    cursor: pointer;
}

.project-open-hint {
    margin-top: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.8;
    transition: gap 0.3s ease, opacity 0.3s ease;
}

.project-card:hover .project-open-hint {
    opacity: 1;
    gap: 11px;
}

/* Bottom gradient scrim so dots/counter stay legible */
.project-image[data-gallery]::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    background: linear-gradient(to top, rgba(10, 10, 11, 0.6), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.project-image[data-gallery]:hover::after {
    opacity: 1;
}

.project-image.is-single::after {
    display: none;
}

/* Carousel arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-hover);
    background: rgba(10, 10, 11, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.carousel-arrow--prev { left: 12px; }
.carousel-arrow--next { right: 12px; }

.project-image:hover .carousel-arrow { opacity: 1; }

.carousel-arrow:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Zoom button */
.carousel-zoom {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border-hover);
    background: rgba(10, 10, 11, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text);
    cursor: zoom-in;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.project-image:hover .carousel-zoom { opacity: 1; }

.carousel-zoom:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Dots */
.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 4;
}

.carousel-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: width 0.3s ease, background 0.3s ease, border-radius 0.3s ease;
}

.carousel-dot.is-active {
    width: 20px;
    border-radius: 4px;
    background: var(--accent-light);
}

/* Counter pill */
.carousel-count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text);
    background: rgba(10, 10, 11, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3px 9px;
    border-radius: 20px;
    z-index: 4;
}

/* Single-image galleries: hide carousel chrome, keep zoom */
.project-image.is-single .carousel-arrow,
.project-image.is-single .carousel-dots,
.project-image.is-single .carousel-count {
    display: none;
}

/* Touch devices have no hover — keep controls visible */
@media (hover: none) {
    .carousel-arrow,
    .carousel-zoom {
        opacity: 1;
    }
}

/* Project Links */
.project-links {
    margin-top: 16px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    padding: 6px 16px;
    border: 1px solid var(--accent);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.project-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-2);
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card-featured {
        grid-column: auto;
    }

    .project-card {
        padding: 28px;
        min-height: auto;
    }

    .project-number {
        font-size: 48px;
    }
}

/* ==================== ACHIEVEMENTS ==================== */
.achievements {
    padding: 80px 0;
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    text-align: center;
}

.achievement-item {
    padding: 20px;
}

.achievement-value {
    font-family: var(--font-display);
    font-size: clamp(42px, 5vw, 64px);
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.achievement-unit {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 700;
    color: var(--accent);
}

.achievement-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* ==================== EDUCATION ==================== */
.education {
    padding: var(--section-padding) 0;
    position: relative;
    z-index: 1;
}

.education-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.education-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease-out-expo);
}

.education-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.education-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-2);
}

.education-year {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.education-card h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.education-card h4 {
    font-size: 15px;
    color: var(--accent-light);
    font-weight: 500;
    margin-bottom: 4px;
}

.education-location {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.education-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.education-highlights span {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--accent-glow);
    border: 1px solid rgba(108, 99, 255, 0.1);
    border-radius: 20px;
}

/* Scholarship highlight */
.education-scholarship {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
    border: 1px solid rgba(108, 99, 255, 0.25);
    border-radius: 14px;
    margin-bottom: 16px;
}

.scholarship-badge {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.scholarship-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scholarship-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-light);
}

.scholarship-detail {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .education-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== CONTACT ==================== */
.contact {
    padding: var(--section-padding) 0;
    padding-bottom: 40px;
    position: relative;
    z-index: 1;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 80px;
    align-items: center;
}

.contact-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.15;
    margin-top: 20px;
}

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

.contact-title-accent::after {
    content: '|';
    -webkit-text-fill-color: var(--accent);
    animation: contactBlink 1s step-end infinite;
    margin-left: 2px;
    font-weight: 300;
}

@keyframes contactBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.contact-info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
}

.contact-info-item {
    margin-bottom: 28px;
}

.contact-info-item:last-of-type {
    margin-bottom: 32px;
}

.contact-info-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 6px;
}

.contact-info-value {
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
    transition: color 0.3s ease;
}

a.contact-info-value:hover {
    color: var(--accent);
}

.contact-links {
    display: flex;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.contact-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

@media (max-width: 768px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

/* ==================== FOOTER ==================== */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

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

.footer-content p {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-content strong {
    color: var(--text-secondary);
}

.footer-year {
    font-family: var(--font-mono);
    font-size: 13px !important;
}

.footer-visitors {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.footer-visitors[hidden] {
    display: none;
}

.footer-visitors .visitor-num {
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-visitors .visitor-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #36d399;
    animation: visitorPulse 2.4s ease-out infinite;
}

@keyframes visitorPulse {
    0% { box-shadow: 0 0 0 0 rgba(54, 211, 153, 0.45); }
    70% { box-shadow: 0 0 0 7px rgba(54, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(54, 211, 153, 0); }
}

/* ==================== GLOBAL ANIMATIONS ==================== */
[data-animate] {
    opacity: 0;
    transform: translateY(40px);
}

[data-animate="fade-up"].animated {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

/* Stagger children */
[data-animate].animated:nth-child(2) {
    transition-delay: 0.1s;
}

[data-animate].animated:nth-child(3) {
    transition-delay: 0.2s;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ==================== GRADIENT BORDER (Featured card) ==================== */
.project-card-featured {
    position: relative;
}

.project-card-featured::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.4), rgba(139, 92, 246, 0.25), rgba(108, 99, 255, 0.15), rgba(139, 92, 246, 0.4));
    background-size: 300% 300%;
    border-radius: 21px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: gradientBorder 6s linear infinite;
}

.project-card-featured:hover::before {
    opacity: 0.6;
}

@keyframes gradientBorder {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ==================== GLOW EFFECT ON STAT CARDS ==================== */
.stat-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--accent-glow-strong) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    filter: blur(30px);
}

.stat-card:hover::after {
    opacity: 1;
}

/* ==================== SMOOTH SCROLL OVERRIDE ==================== */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

/* ==================== LIGHTBOX ==================== */
body.lightbox-open {
    overflow: hidden;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 7, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.lightbox-stage {
    position: relative;
    z-index: 2;
    width: min(92vw, 1400px);
    height: 86vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    transform: translate(0, 0) scale(1);
    transform-origin: center center;
    transition: transform 0.25s var(--ease-out-quart);
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}

.lightbox-img.is-zoomed {
    cursor: grab;
    transition: none;
}

.lightbox-img.is-panning {
    cursor: grabbing;
}

.lightbox-video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    background: #000;
    display: none;
}

/* Toggle between image and video viewers */
.lightbox.is-video .lightbox-img {
    display: none;
}

.lightbox.is-video .lightbox-video {
    display: block;
}

.lightbox.is-video .lightbox-hint {
    display: none;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-hover);
    background: rgba(20, 20, 26, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text);
    cursor: pointer;
    line-height: 1;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.lightbox-close {
    top: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 28px;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 30px;
}

.lightbox-nav--prev { left: 24px; }
.lightbox-nav--next { right: 24px; }

.lightbox-close:hover,
.lightbox-nav:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.lightbox-nav:hover {
    transform: translateY(-50%) scale(1.08);
}

.lightbox.is-single .lightbox-nav {
    display: none;
}

.lightbox-bar {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(20, 20, 26, 0.6);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: 30px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    white-space: nowrap;
}

.lightbox-counter {
    color: var(--text);
    letter-spacing: 1px;
}

.lightbox-hint {
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .lightbox-stage { height: 80vh; }
    .lightbox-hint { display: none; }
    .lightbox-close { top: 16px; right: 16px; width: 42px; height: 42px; }
    .lightbox-nav { width: 44px; height: 44px; font-size: 26px; }
    .lightbox-nav--prev { left: 10px; }
    .lightbox-nav--next { right: 10px; }
}

/* ==================== PROJECT DEEP-DIVE MODAL ==================== */
body.modal-open {
    overflow: hidden;
}

.project-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.project-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.project-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 7, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.project-modal-panel {
    position: relative;
    z-index: 2;
    width: min(1100px, 96vw);
    max-height: 92vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface);
    border: 1px solid var(--border-hover);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.4s var(--ease-out-expo);
}

.project-modal.is-open .project-modal-panel {
    transform: translateY(0) scale(1);
}

.project-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-hover);
    background: rgba(10, 10, 11, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.project-modal-close:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Media / gallery column */
.project-modal-media {
    background: #0d0d10;
    overflow-y: auto;
    max-height: 92vh;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.project-modal-media img,
.project-modal-media video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.project-modal-media img {
    cursor: zoom-in;
    transition: border-color 0.3s ease;
}

.project-modal-media img:hover {
    border-color: var(--accent);
}

.project-modal-media video {
    background: #000;
}

.project-modal-media-empty {
    margin: auto;
    padding: 40px 20px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
    text-align: center;
    line-height: 1.6;
}

/* Notes column */
.project-modal-body {
    padding: 44px 38px;
    overflow-y: auto;
    max-height: 92vh;
}

.project-modal-num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 14px;
    color: var(--accent);
}

.project-modal-category {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin: 6px 0 10px;
}

.project-modal-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 24px;
}

.project-modal-notes p {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.project-modal-notes strong {
    color: var(--text);
    font-weight: 600;
}

.project-modal-notes em {
    color: var(--text);
    font-style: italic;
}

.project-modal-notes h4 {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin: 24px 0 14px;
}

.project-modal-notes ul.dd-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.project-modal-notes ul.dd-list li {
    position: relative;
    padding-left: 18px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.project-modal-notes ul.dd-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.project-modal-notes code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--accent-light);
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: 5px;
}

@media (max-width: 820px) {
    .project-modal-panel {
        grid-template-columns: 1fr;
        max-height: 94vh;
    }

    .project-modal-media {
        max-height: 36vh;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .project-modal-media img,
    .project-modal-media video {
        width: auto;
        height: 100%;
    }

    .project-modal-body {
        max-height: none;
        padding: 30px 22px;
    }
}