/* ============================================
   Dghem Portfolio — Tech-Noir Premium Design
   Pure Black + Minimal Cyan Accent
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@200;300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&family=Caveat:wght@400;500;600&display=swap');

/* === Design Tokens === */
:root {
    --black: #000000;
    --black-soft: #060608;
    --black-card: #0a0a0c;
    --black-elevated: #111114;
    --black-border: rgba(255, 255, 255, 0.06);

    --white: #ffffff;
    --white-90: rgba(255, 255, 255, 0.9);
    --white-70: rgba(255, 255, 255, 0.7);
    --white-50: rgba(255, 255, 255, 0.5);
    --white-30: rgba(255, 255, 255, 0.3);
    --white-15: rgba(255, 255, 255, 0.15);
    --white-08: rgba(255, 255, 255, 0.08);
    --white-04: rgba(255, 255, 255, 0.04);

    /* Minimal accent — used VERY sparingly */
    --accent: #22d3ee;
    --accent-dim: rgba(34, 211, 238, 0.15);
    --accent-glow: rgba(34, 211, 238, 0.3);

    /* MafiaMC Red */
    --red: #ef4444;
    --red-light: #f87171;
    --red-glow: rgba(239, 68, 68, 0.25);

    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-signature: 'Caveat', cursive;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === THEME HACKED OVERRIDES === */
body.theme-hacked {
    --accent: #00ff41;
    --accent-dim: rgba(0, 255, 65, 0.15);
    --accent-glow: rgba(0, 255, 65, 0.3);
    /* Distort visuals slightly when globally hacked */
    background: #020502;
}

/* Ambient Glitch: Vertical Screen Slice */
.ambient-glitch-slice {
    animation: ambientSlice 0.5s steps(4, end) forwards;
}
@keyframes ambientSlice {
    0%, 100% { transform: translateX(0); clip-path: inset(0 0 0 0); filter: drop-shadow(0); }
    25% { transform: translateX(-30px); clip-path: inset(50% 0 0 0); filter: drop-shadow(20px 0 0 var(--accent)); }
    50% { transform: translateX(30px); clip-path: inset(0 0 50% 0); filter: drop-shadow(-20px 0 0 red); }
    75% { transform: translateX(-15px); clip-path: inset(20% 0 20% 0); }
}

/* Ambient Glitch: Sudden Screen Quake */
.ambient-glitch-quake {
    animation: ambientQuake 0.4s cubic-bezier(.36,.07,.19,.97) forwards;
}
@keyframes ambientQuake {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    20%, 60% { transform: translate(-25px, 15px) rotate(-3deg); filter: contrast(1.5); }
    40%, 80% { transform: translate(25px, -15px) rotate(3deg); filter: contrast(1.2); }
}

/* Ambient Glitch: Freeze & Desaturate */
.ambient-glitch-freeze {
    animation: ambientFreeze 1.5s ease-in-out forwards;
}
@keyframes ambientFreeze {
    0%, 100% { filter: grayscale(0) contrast(1); pointer-events: auto; }
    10% { filter: grayscale(0.8) contrast(2) hue-rotate(90deg); pointer-events: none; }
    90% { filter: grayscale(0.8) contrast(2) hue-rotate(90deg); pointer-events: none; }
}

/* Hacked Text Signature Replacement */
.hero-signature.hacked-text {
    font-size: 3.5rem;
    font-family: var(--font-mono);
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    text-shadow: 0 0 15px var(--accent-glow);
    letter-spacing: 5px;
    margin-bottom: 28px;
    height: 80px;
    display: flex;
    align-items: center;
    cursor: crosshair;
    filter: none;
    /* Chaotic text animation */
    animation: textJitter 0.1s infinite alternate;
}
@keyframes textJitter {
    0% { transform: skewX(-5deg); text-shadow: 2px 0 0 red, -2px 0 0 blue; }
    100% { transform: skewX(5deg); text-shadow: -2px 0 0 red, 2px 0 0 blue; }
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: var(--black);
    color: var(--white-70);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    cursor: none;
}

/* Restore native cursor on touch devices */
@media (hover: none), (pointer: coarse) {
    body {
        cursor: auto;
    }
}

img {
    -webkit-user-drag: none;
    user-select: none;
}

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

/* === Scrollbar — Thin premium dark === */
::-webkit-scrollbar {
    width: 4px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--white-15);
    border-radius: 2px;
}

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

/* === Scroll Progress Bar === */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), rgba(34, 211, 238, 0.6), var(--accent));
    transform-origin: left;
    transform: scaleX(0);
    z-index: 10000;
    transition: none;
    pointer-events: none;
}

/* ============================================
   LOADING SCREEN — Cinematic
   ============================================ */
.loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 1s cubic-bezier(0.4, 0, 0, 1),
        visibility 1s cubic-bezier(0.4, 0, 0, 1);
}

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

.loader.hidden .loader-center {
    transform: scale(1.5);
    opacity: 0;
    filter: blur(20px);
}

.loader.hidden .loader-progress-container {
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
}

.loader.hidden .loader-scan {
    opacity: 0;
}

/* Particle canvas */
.loader-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}



/* Center logo + glow */
.loader-center {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 1s cubic-bezier(0.4, 0, 0, 1),
        opacity 0.6s ease,
        filter 0.8s ease;
}

.loader-text-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    color: var(--white);
    white-space: nowrap;
}

.signature-gif-like {
    height: 180px; /* Larger image */
    filter: brightness(0) invert(1);
    animation: logoRevealMaster 1.2s var(--ease-out) 0.3s forwards;
    opacity: 0;
    display: block;
    margin: 0;
    z-index: 2;
    transform: translateY(-8px);
}

@keyframes logoRevealMaster {
    0% { opacity: 0; transform: scale(0.85) translateY(-10px); filter: blur(12px); }
    100% { opacity: 1; transform: scale(1) translateY(-10px); filter: blur(0); }
}

.loader-text-logo .bracket {
    font-size: 3.8rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--white);
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
}

.loader-text-logo .bracket-left {
    justify-content: flex-end;
    animation: smoothBracketChar 0.8s var(--ease-spring) 0.8s forwards;
}

.loader-text-logo .bracket-slash {
    justify-content: flex-end;
    animation: smoothBracketChar 0.8s var(--ease-spring) 1.8s forwards;
}

.loader-text-logo .bracket-right {
    justify-content: flex-start;
    animation: smoothBracketChar 0.8s var(--ease-spring) 1.3s forwards;
}

@keyframes smoothBracketChar {
    0% { max-width: 0; opacity: 0; transform: scale(0.9); }
    100% { max-width: 1em; opacity: 1; transform: scale(1); }
}

.loader-glow {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: glowPulse 2.5s ease-in-out infinite;
    z-index: 1;
}

@keyframes glowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Cinematic Progress Bar */
.loader-progress-container {
    position: relative;
    margin-top: -20px; /* Tightly tucked under the signature */
    width: 220px;      /* Slightly wider than the signature bounds */
    height: 1px;       /* Extremely sleek */
    background: var(--white-10);
    border-radius: 2px;
    overflow: hidden;
    z-index: 2;
    opacity: 0;
    animation: loaderBottomIn 0.6s var(--ease-out) 1.2s forwards; /* Fades in after logo */
}

.loader-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent), 0 0 5px var(--accent);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); 
}

@keyframes loaderBottomIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Horizontal scan line */
.loader-scan {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(34, 211, 238, 0.08) 20%,
        rgba(34, 211, 238, 0.2) 50%,
        rgba(34, 211, 238, 0.08) 80%,
        transparent 100%);
    animation: scanMove 2.5s ease-in-out infinite;
    z-index: 1;
    transition: opacity 0.5s ease;
}

@keyframes scanMove {
    0% { top: 20%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 80%; opacity: 0; }
}

/* === Video Background === */
.hero-video-bg {
    position: absolute;
    inset: -40px;
    z-index: 0;
    overflow: hidden;
    filter: blur(1px) saturate(0.75) brightness(0.4);
    transform: scale(1.15);
    will-change: transform;
}

.hero-video-bg iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 130%;
    height: 130%;
    min-width: 130vw;
    min-height: 130vh;
    transform: translate(-50%, -50%);
    object-fit: cover;
    border: none;
}

.hero-video-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 35%, rgba(0, 0, 0, 0.5) 65%, rgba(0, 0, 0, 0.85) 100%),
        radial-gradient(ellipse at 60% 40%, transparent 25%, rgba(0, 0, 0, 0.5) 100%);
}

/* === 3D Canvas Background === */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* === Vignette Glow — very subtle blue edge glow === */
.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(ellipse at 0% 50%, rgba(34, 211, 238, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 50%, rgba(34, 211, 238, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 0%, rgba(34, 211, 238, 0.02) 0%, transparent 40%);
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0 48px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--black-border);
    transition: background 0.4s ease;
}

.header.scrolled {
    background: rgba(0, 0, 0, 0.92);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo img {
    height: 72px;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

.header-logo:hover img {
    opacity: 0.8;
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -1px;
}

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

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--white-50);
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link:hover {
    color: var(--white);
}

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

.nav-link.active {
    color: var(--white-90);
}

/* Mobile toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.menu-toggle span {
    width: 28px;
    height: 1.5px;
    background: var(--white);
    transition: all 0.3s ease;
}

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

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

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

/* ============================================
   HERO
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    position: relative;
    overflow: hidden;
    padding: 0 48px 100px;
    background: var(--black);
    isolation: isolate;
}

.hero-content {
    position: relative;
    z-index: 5;
    max-width: 800px;
    will-change: transform, opacity;
}

/* Hero signature — large, prominent */
.hero-signature {
    height: 80px;
    filter: brightness(0) invert(1);
    opacity: 0.6;
    margin-bottom: 28px;
    display: block;
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.hero-signature:hover {
    opacity: 1;
    transform: scale(1.03);
    filter: brightness(0) invert(1) drop-shadow(0 0 12px rgba(255, 255, 255, 0.4));
}

/* Progressive Hack Hover States */
.hero-signature.hack-level-1:hover {
    transform: scale(1.05) rotate(1deg);
    filter: brightness(0) invert(1) drop-shadow(0 0 15px rgba(34, 211, 238, 0.8)) hue-rotate(15deg);
}
.hero-signature.hack-level-2:hover {
    transform: scale(1.08) rotate(-2deg);
    filter: drop-shadow(0 0 15px red) contrast(1.5);
    animation: hackStage1 0.1s infinite !important;
}
.hero-signature.hack-level-3:hover {
    transform: scale(1.1) skew(5deg);
    filter: invert(1) drop-shadow(5px 0 0 red) drop-shadow(-5px 0 0 #0055ff) hue-rotate(180deg);
    animation: hackStage2 0.2s steps(2) infinite !important;
}
.hero-signature.hack-level-4:hover {
    transform: scale(1.15) skew(-10deg) translate(5px, 5px);
    filter: sepia(1) hue-rotate(-50deg) blur(1px) contrast(3) drop-shadow(0 0 20px #00ff41);
    animation: hackStage3 0.1s steps(2) infinite !important;
}
.hero-signature.hack-level-5 {
    filter: drop-shadow(0 0 15px #00ff41);
}
.hero-signature.hack-level-5:hover {
    transform: scale(1.2) skew(-12deg) translate(8px, 5px);
    filter: sepia(1) hue-rotate(-50deg) blur(2px) contrast(3) drop-shadow(0 0 30px #00ff41);
    animation: hackStage3 0.1s steps(2) infinite !important;
}

/* White Flash Event */
body.theme-flash-white {
    background-color: #fff !important;
    filter: invert(1) hue-rotate(180deg);
}
body.theme-flash-white * {
    color: #222 !important;
}
@keyframes lightQuake {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    25% { transform: translate(-2px, -1px) rotate(-0.5deg); }
    50% { transform: translate(2px, 1px) rotate(0.5deg); }
    75% { transform: translate(-1px, 2px) rotate(-0.2deg); }
}

body.ambient-glitch-quake {
    animation: hackStage6 0.2s 3 cubic-bezier(.36,.07,.19,.97) both !important;
    filter: invert(0.2) hue-rotate(-45deg);
}



@keyframes niceClickPulse {
    0% { transform: scale(1.03); filter: brightness(0) invert(1) drop-shadow(0 0 12px rgba(255,255,255,0.4)); }
    50% { transform: scale(1.12); filter: brightness(0) invert(1) drop-shadow(0 0 25px rgba(34, 211, 238, 0.8)); }
    100% { transform: scale(1); filter: brightness(0) invert(1); }
}

/* ============================================
   PROGRESSIVE HACKER EVENTS (Stages 1-8)
   ============================================ */

/* STAGE 1: Tiny Signature Jitter */
.glitch-stage-1 { animation: hackStage1 0.2s steps(2, end) both; }
@keyframes hackStage1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-2px, 1px); }
}

/* STAGE 2: Signature Blue Flash & Shake */
.glitch-stage-2 { animation: hackStage2 0.3s steps(3, end) both; }
@keyframes hackStage2 {
    0%, 100% { transform: scale(1); filter: drop-shadow(0); }
    30% { transform: scale(1.1) translate(-2px, 3px); filter: drop-shadow(4px 0 0 var(--accent)); }
    60% { transform: scale(1.05) translate(3px, -2px); filter: drop-shadow(-4px 0 0 #0055ff); }
}

/* STAGE 3: Signature Diagonal Slash */
.glitch-stage-3 { animation: hackStage3 0.3s ease-out both; }
@keyframes hackStage3 {
    0%, 100% { clip-path: inset(0 0 0 0); filter: brightness(1); }
    50% { clip-path: polygon(0 0, 100% 0, 100% 40%, 0 60%); filter: drop-shadow(0 5px 15px var(--accent)) brightness(1.5); transform: skew(-10deg) translate(-5px); }
}



/* STAGE 6: Heavy Body Earthquake */
body.glitch-stage-6 { animation: hackStage6 0.6s cubic-bezier(.36,.07,.19,.97) both; overflow: hidden; }
@keyframes hackStage6 {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    10%, 50%, 90% { transform: translate(-15px, 10px) rotate(-1deg); filter: contrast(1.2); }
    30%, 70% { transform: translate(15px, -10px) rotate(1deg); filter: contrast(1.5); }
}



/* STAGE 8: Critical Corruption */
body.glitch-stage-8 { animation: hackStage8 0.5s ease-in-out both; overflow: hidden; }
@keyframes hackStage8 {
    0%, 100% { filter: blur(0) contrast(1); }
    50% { filter: blur(5px) contrast(3) drop-shadow(0 20px 20px var(--accent)) hue-rotate(-90deg); transform: scale(1.02); }
}

.hero-title {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 200;
    line-height: 1.08;
    letter-spacing: -3px;
    color: var(--white-50);
    margin-bottom: 32px;
}

.hero-title strong {
    font-weight: 800;
    color: var(--white);
}

.hero-subtitle {
    font-size: 1.05rem;
    font-weight: 300;
    color: var(--white-30);
    max-width: 520px;
    line-height: 1.8;
    margin-bottom: 48px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Primary CTA — Cyan pill */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--accent);
    color: var(--black);
    border: none;
    border-radius: 50px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn-primary .arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    transition: transform 0.3s var(--ease-out);
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 0 40px var(--accent-glow);
}

.btn-primary:hover .arrow {
    transform: translateX(3px);
}

/* Ghost link */
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--white-50);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    cursor: pointer;
}

.btn-ghost .arrow-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--white-15);
    border-radius: 50%;
    transition: all 0.3s var(--ease-out);
}

.btn-ghost:hover {
    color: var(--white);
}

.btn-ghost:hover .arrow-circle {
    border-color: var(--white-30);
    transform: translateX(4px);
}

/* Scroll indicator */
.scroll-hint {
    position: absolute;
    bottom: 32px;
    right: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
    will-change: transform, opacity;
}

.scroll-hint span {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--white-30);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.scroll-line-v {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--white-30), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* ============================================
   PROJECTS
   ============================================ */
.projects {
    padding: 140px 48px;
    position: relative;
    background: var(--black);
}

.section-header {
    margin-bottom: 80px;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white-30);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-out);
}

.section-label.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 200;
    color: var(--white-50);
    letter-spacing: -1.5px;
    line-height: 1.15;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-out) 0.1s;
}

.section-title strong {
    font-weight: 800;
    color: var(--white);
}

.section-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-subtitle {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--white-30);
    margin-top: 16px;
    letter-spacing: 0.3px;
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.8s var(--ease-out) 0.2s;
}

.section-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    max-width: 1400px;
    width: 100%;
}

.project-card {
    display: block;
    background: var(--black-card);
    border: 1px solid var(--black-border);
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    transition: all 0.5s var(--ease-out);
    opacity: 0;
    transform: translateY(50px);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-6px);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}

/* MafiaMC card red glow */
.project-card.mafia-card:hover {
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 0 60px var(--red-glow);
}

/* Fadi Fitness blue glow */
.project-card.fadi-card:hover {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(37, 99, 235, 0.3);
}

.project-image {
    width: 100%;
    height: 320px;
    background-size: cover;
    background-position: center top;
    position: relative;
}

.project-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, var(--black-card) 100%);
}

.project-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--white-08);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--white-50);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.project-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.project-body {
    padding: 32px 36px 36px;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.project-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.project-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
}

/* MafiaMC title in RED */
.mafia-card .project-info h3 {
    color: var(--red-light);
}

.mafia-card:hover .project-info h3 {
    text-shadow: 0 0 30px var(--red-glow);
}

/* Fadi Fitness title in BLUE */
.fadi-card .project-info h3 {
    color: #3b82f6;
}

.fadi-card:hover .project-info h3 {
    text-shadow: 0 0 30px rgba(37, 99, 235, 0.5);
}

.project-info .type {
    font-size: 0.78rem;
    color: var(--white-30);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.project-desc {
    color: var(--white-30);
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.8;
    margin-bottom: 24px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.tag {
    padding: 5px 14px;
    background: var(--white-04);
    border: 1px solid var(--white-08);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--white-50);
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.mafia-card .tag {
    border-color: rgba(239, 68, 68, 0.12);
    color: var(--red-light);
    background: rgba(239, 68, 68, 0.05);
}

.fadi-card .tag {
    border-color: rgba(37, 99, 235, 0.3);
    color: #60a5fa;
    background: rgba(37, 99, 235, 0.1);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white-50);
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.project-link i {
    transition: transform 0.3s var(--ease-out);
    font-size: 0.75rem;
}

.project-card:hover .project-link {
    color: var(--white);
}

.project-card:hover .project-link i {
    transform: translateX(4px);
}

.mafia-card .project-link {
    color: var(--red-light);
}

.mafia-card:hover .project-link {
    color: var(--red);
}

.fadi-card .project-link {
    color: #60a5fa;
}

.fadi-card:hover .project-link {
    color: #3b82f6;
}

/* ============================================
   FOOTER / CONTACT CTA
   ============================================ */
.footer {
    padding: 120px 48px 48px;
    background: var(--black);
    border-top: 1px solid var(--black-border);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--white-15), transparent);
}

.footer-cta {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 80px;
}

.footer-cta-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 200;
    color: var(--white-50);
    letter-spacing: -1px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-out);
}

.footer-cta-title strong {
    font-weight: 800;
    color: var(--white);
}

.footer-cta-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.footer-cta-text {
    color: var(--white-30);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.8;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.8s var(--ease-out) 0.1s;
}

.footer-cta-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Discord button */
.discord-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 36px;
    background: #5865F2;
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    box-shadow: 0 8px 32px rgba(88, 101, 242, 0.2);
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.8s var(--ease-out) 0.2s, transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}

.discord-btn.visible {
    opacity: 1;
    transform: translateY(0);
}

.discord-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 16px 48px rgba(88, 101, 242, 0.35);
}

.discord-btn i {
    font-size: 1.1rem;
}

/* Footer bottom */
.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 40px;
    border-top: 1px solid var(--black-border);
}

.footer-signature {
    height: 90px;
    filter: brightness(0) invert(1);
    opacity: 0.5;
    transition: all 0.4s ease;
}

.footer-signature:hover {
    opacity: 0.9;
    transform: translateY(-4px) scale(1.05);
}

.copyright {
    font-size: 0.78rem;
    color: var(--white-30);
    letter-spacing: 1px;
    font-weight: 300;
}

.footer-tagline {
    font-size: 0.72rem;
    color: var(--white-15);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 400;
}

/* ============================================
   SIGNATURE DIVIDER
   ============================================ */
.signature-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 80px 48px;
    background: var(--black);
}

.sig-line {
    flex: 1;
    max-width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--white-08), transparent);
}

.sig-divider-img {
    height: 64px;
    filter: brightness(0) invert(1);
    opacity: 0.25;
    transition: all 0.4s ease;
}

.sig-divider-img:hover {
    opacity: 0.6;
    transform: scale(1.08);
}

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 48px 80px;
    position: relative;
}

.contact-container {
    max-width: 520px;
    width: 100%;
}

.contact-card {
    background: var(--black-card);
    border: 1px solid var(--black-border);
    border-radius: 20px;
    padding: 56px 44px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease-out);
}

.contact-card:hover {
    border-color: rgba(88, 101, 242, 0.15);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4), 0 0 60px rgba(88, 101, 242, 0.08);
    transform: translateY(-4px);
}

.contact-icon {
    font-size: 4rem;
    color: #5865F2;
    margin-bottom: 28px;
    opacity: 0.9;
}

.contact-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.contact-text {
    color: var(--white-30);
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 28px;
}

.username {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
    background: var(--white-04);
    border: 1px solid var(--white-08);
    padding: 12px 28px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 28px;
    position: relative;
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--white-04);
    border: 1px solid var(--white-08);
    color: var(--white-70);
    border-radius: 50px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    margin-bottom: 28px;
}

.copy-btn:hover {
    background: var(--white-08);
    color: var(--white);
    transform: translateY(-2px);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--white-50);
    border: 1px solid var(--white-08);
    border-radius: 50px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-btn:hover {
    color: var(--white);
    border-color: var(--white-15);
    transform: translateY(-2px);
}

/* ============================================
   NOTIFICATION
   ============================================ */
.notification {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--black-elevated);
    backdrop-filter: blur(20px);
    color: var(--white);
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.85rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--black-border);
    opacity: 0;
    transition: all 0.4s var(--ease-out);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification.red {
    border-color: rgba(239, 68, 68, 0.15);
}

/* ============================================
   REVEAL ANIMATIONS — Enhanced
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.9s var(--ease-out);
}

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

/* Hero animations */
.hero-content>* {
    opacity: 0;
    transform: translateY(40px);
}

.hero-loaded .hero-content>*:nth-child(1) {
    animation: fadeUp 1s var(--ease-out) 0.3s forwards;
}

.hero-loaded .hero-content>*:nth-child(2) {
    animation: fadeUp 1s var(--ease-out) 0.55s forwards;
}

.hero-loaded .hero-content>*:nth-child(3) {
    animation: fadeUp 1s var(--ease-out) 0.8s forwards;
}

.hero-loaded .scroll-hint {
    animation: fadeUp 0.8s var(--ease-out) 1.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background: var(--white);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.3s var(--ease-out),
        height 0.3s var(--ease-out),
        background 0.3s ease,
        opacity 0.3s ease;
    mix-blend-mode: difference;
    opacity: 0;
}

.cursor-dot.visible {
    opacity: 1;
}

.cursor-dot.hovering {
    width: 12px;
    height: 12px;
    background: var(--accent);
}

.cursor-dot.clicking {
    width: 4px;
    height: 4px;
}

.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--white-30);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99997;
    transform: translate(-50%, -50%);
    transition: width 0.4s var(--ease-out),
        height 0.4s var(--ease-out),
        border-color 0.3s ease,
        opacity 0.4s ease,
        background 0.3s ease;
    opacity: 0;
}

.cursor-ring.visible {
    opacity: 1;
}

.cursor-ring.hovering {
    width: 60px;
    height: 60px;
    border-color: var(--accent-glow);
    background: rgba(34, 211, 238, 0.05);
}

.cursor-ring.clicking {
    width: 32px;
    height: 32px;
    border-color: var(--accent);
}

/* Glow Trail Canvas */
.cursor-glow-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99996;
    opacity: 0.6;
}

/* Hide custom cursor on touch/mobile */
@media (hover: none), (pointer: coarse) {

    .cursor-dot,
    .cursor-ring,
    .cursor-glow-canvas {
        display: none !important;
    }
}

/* ============================================
   PAGE TRANSITION
   ============================================ */
.page-transition {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
    overflow: hidden;
}

.page-transition-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    transform: translateY(100%);
    will-change: transform;
}

/* Transition states */
.page-transition.entering .page-transition-inner {
    animation: pageSlideIn 0.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
    pointer-events: all;
}

.page-transition.leaving .page-transition-inner {
    animation: pageSlideOut 0.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
    pointer-events: all;
}

@keyframes pageSlideIn {
    0% {
        transform: translateY(100%);
    }

    100% {
        transform: translateY(0%);
    }
}

@keyframes pageSlideOut {
    0% {
        transform: translateY(0%);
    }

    100% {
        transform: translateY(-100%);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 0 24px;
        height: 64px;
    }

    .header-logo img {
        height: 56px;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.97);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
        transition: right 0.4s var(--ease-out);
        z-index: 999;
    }

    .nav.open {
        right: 0;
    }

    .nav-link {
        font-size: 1.1rem;
        letter-spacing: 3px;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        padding: 0 24px 80px;
        align-items: flex-end;
    }

    .hero-title {
        font-size: clamp(2.2rem, 8vw, 3.5rem);
        letter-spacing: -2px;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .projects {
        padding: 100px 24px;
    }

    .project-image {
        height: 220px;
    }

    .project-body {
        padding: 24px;
    }

    .footer {
        padding: 80px 24px 40px;
    }

    .scroll-hint {
        display: none;
    }

    .footer-signature {
        height: 70px;
    }

    .hero-signature {
        height: 60px;
    }

    .signature-divider {
        padding: 60px 24px;
        gap: 20px;
    }

    .sig-divider-img {
        height: 48px;
    }

    .contact-section {
        padding: 100px 24px 60px;
    }

    .contact-card {
        padding: 40px 24px;
    }

    .contact-icon {
        font-size: 3rem;
    }

    .contact-title {
        font-size: 1.4rem;
    }

    .username {
        font-size: 1.2rem;
    }

    .scroll-progress-bar {
        display: none;
    }
}

@media (max-width: 480px) {
    .project-info h3 {
        font-size: 1.2rem;
    }

    .loader-logo {
        height: 72px;
    }

    .loader-bar {
        width: 140px;
    }

    .hero-signature {
        height: 48px;
    }

    .footer-signature {
        height: 56px;
    }

    .sig-divider-img {
        height: 40px;
    }
}

/* ==============================================
   RARE HACKER SYSTEM BREACH (5 SEC TAKEOVER)
   ============================================== */
.system-breach-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: black;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #00ff41;
    font-family: var(--font-mono), monospace;
    opacity: 1;
    animation: breachFlicker 0.2s steps(2, end) infinite;
}

.system-breach-overlay.vanishing {
    animation: breachVanish 0.5s forwards;
}

.system-breach-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(0deg, rgba(0, 255, 65, 0.15), rgba(0, 255, 65, 0.15) 1px, transparent 1px, transparent 4px);
    z-index: 1;
    animation: scanlines 10s linear infinite;
}

.system-breach-alert {
    position: relative;
    z-index: 2;
    color: #00ff41;
    font-size: clamp(2rem, 6vw, 5rem);
    font-weight: 800;
    text-shadow: 0 0 20px #00ff41;
    letter-spacing: 5px;
    margin-bottom: 30px;
    text-transform: uppercase;
    animation: alertPulse 0.5s steps(2, end) infinite;
    text-align: center;
}

.system-breach-terminal {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 1000px;
    height: 50vh;
    color: #00ff41;
    font-size: 1.1rem;
    line-height: 1.4;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-all;
    text-shadow: 0 0 5px #00ff41;
}

@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 1000px; }
}

@keyframes breachFlicker {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); filter: contrast(1.5); }
}

@keyframes alertPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes breachVanish {
    0% { opacity: 1; filter: contrast(2) brightness(3); transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(0.01); background: #fff; }
    100% { opacity: 0; transform: scaleY(0); }
}

/* ==========================================================
   PHASE 2: FATAL SYSTEM HACK (Terminal Flattening)
   ========================================================== */

/* The Red/Green Fatal Flash */
.system-breach-alert.fatal {
    color: #ff003c !important;
    text-shadow: 0 0 20px #ff003c, -5px 0 0 #00ff41 !important;
    animation: fatalPulse 0.1s infinite alternate;
}
@keyframes fatalPulse {
    0% { transform: scale(1) translateX(-5px); text-shadow: 4px 0 0 #00ff41; }
    100% { transform: scale(1.05) translateX(5px); text-shadow: -4px 0 0 #00ff41; color: #fff; }
}

.fatal-shake-body {
    animation: fatalQuake 0.05s infinite !important;
}
@keyframes fatalQuake {
    0% { transform: translate(5px, 5px) rotate(1deg); filter: blur(1px) contrast(2) hue-rotate(90deg); }
    25% { transform: translate(-5px, -5px) rotate(-1deg); filter: blur(0px) contrast(2) hue-rotate(0deg); }
    50% { transform: translate(-10px, 3px) rotate(2deg); filter: blur(2px) contrast(2) hue-rotate(-90deg); }
    75% { transform: translate(10px, -5px) rotate(-2deg); filter: blur(0px) contrast(2) hue-rotate(0deg); }
    100% { transform: translate(0px, 0px) rotate(0deg); }
}

/* Ensure the overlay is always visible and black! */
div.system-breach-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000 !important;
    z-index: 9999999 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #00ff41;
    font-family: var(--font-mono), monospace;
    opacity: 1;
    animation: breachFlicker 0.2s steps(2, end) infinite;
}

div.system-breach-overlay.vanishing {
    animation: breachVanish 0.5s forwards !important;
}

/* Total Global Asset Nuke */
body.theme-hacked-fatal * {
    background-color: transparent !important;
    background-image: none !important;
    color: #00ff41 !important;
    border-color: #00ff41 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
}

body.theme-hacked-fatal img,
body.theme-hacked-fatal iframe,
body.theme-hacked-fatal video,
body.theme-hacked-fatal .project-image {
    display: none !important;
}

body.theme-hacked-fatal {
    background: #000 !important;
    font-family: var(--font-mono) !important;
}

/* Scrambled Eradication Text */
.fatal-hacked {
    font-family: var(--font-mono) !important;
    font-weight: 900;
    font-size: inherit;
    color: #ff003c !important;
    background: #000 !important;
    animation: textJitter 0.1s infinite alternate;
}