/* ===== COSMIC AURORA — GIULIO-INSPIRED DESIGN SYSTEM ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Outlined');

:root {
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --secondary: #06b6d4;
    --accent: #f472b6;
    --accent-warm: #fb923c;
    --surface: #050510;
    --surface-elevated: #0c0c20;
    --surface-card: rgba(12, 12, 32, 0.65);
    --surface-card-hover: rgba(20, 20, 50, 0.8);
    --border: rgba(124, 58, 237, 0.12);
    --border-hover: rgba(124, 58, 237, 0.35);
    --text: #eeeeff;
    --text-dim: rgba(238, 238, 255, 0.55);
    --text-muted: rgba(238, 238, 255, 0.28);
    --glow-purple: rgba(124, 58, 237, 0.4);
    --glow-cyan: rgba(6, 182, 212, 0.4);
    --glow-pink: rgba(244, 114, 182, 0.3);
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
    cursor: none;
}

/* ===== CUSTOM CURSOR (GIULIO-STYLE) ===== */
.cursor-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--primary-light);
    position: fixed; top: 0; left: 0; z-index: 99999;
    pointer-events: none;
    transition: transform 0.1s ease;
    mix-blend-mode: difference;
}
.cursor-ring {
    width: 40px; height: 40px; border-radius: 50%;
    border: 1.5px solid rgba(167, 139, 250, 0.5);
    position: fixed; top: 0; left: 0; z-index: 99998;
    pointer-events: none;
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}
.cursor-ring.hover {
    width: 60px; height: 60px;
    border-color: var(--secondary);
    background: rgba(6, 182, 212, 0.06);
}

/* ===== INTRO OVERLAY (GIULIO-STYLE BOOT) ===== */
#intro-overlay {
    position: fixed; inset: 0; z-index: 100000;
    background: var(--surface);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
#intro-overlay.done { opacity: 0; visibility: hidden; pointer-events: none; }
#intro-overlay .intro-text {
    font-family: var(--font-mono); font-size: 0.85rem;
    color: var(--text-dim); letter-spacing: 0.1em;
    margin-bottom: 2rem; text-transform: uppercase;
}
#intro-overlay .intro-name {
    font-family: var(--font-display); font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700; letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    opacity: 0; transform: translateY(20px);
    animation: intro-rise 0.8s ease 0.5s forwards;
}
#intro-overlay .intro-bar {
    width: 200px; height: 2px; background: rgba(124,58,237,0.15);
    margin-top: 2rem; border-radius: 1px; overflow: hidden;
}
#intro-overlay .intro-bar-fill {
    height: 100%; width: 0%; border-radius: 1px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    animation: intro-fill 2s ease 0.8s forwards;
}
@keyframes intro-rise { to { opacity: 1; transform: translateY(0); } }
@keyframes intro-fill { to { width: 100%; } }

/* ===== AURORA BACKGROUND ===== */
.aurora-bg {
    position: fixed; inset: 0; z-index: -2; overflow: hidden;
    background: radial-gradient(ellipse at 15% 50%, rgba(124,58,237,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 85% 15%, rgba(6,182,212,0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 85%, rgba(244,114,182,0.05) 0%, transparent 50%),
                var(--surface);
}
.aurora-bg::before {
    content: ''; position: absolute; inset: -50%;
    background: conic-gradient(from 0deg at 50% 50%, transparent 0%, rgba(124,58,237,0.04) 25%, transparent 50%, rgba(6,182,212,0.04) 75%, transparent 100%);
    animation: aurora-rotate 40s linear infinite;
}
@keyframes aurora-rotate { 100% { transform: rotate(360deg); } }

/* Cursor Glow Follower */
.cursor-glow {
    position: fixed; width: 500px; height: 500px;
    border-radius: 50%; pointer-events: none; z-index: -1;
    background: radial-gradient(circle, rgba(124,58,237,0.07) 0%, transparent 70%);
    transition: transform 0.6s cubic-bezier(0.2, 0, 0, 1);
}

#particles-canvas { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* ===== NAVIGATION ===== */
.nav {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 1.25rem 3rem;
    background: transparent;
    display: flex; justify-content: space-between; align-items: center;
    transition: background 0.4s ease, padding 0.4s ease, backdrop-filter 0.4s ease;
}
.nav.scrolled {
    background: rgba(5, 5, 16, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 0.8rem 3rem;
    border-bottom: 1px solid var(--border);
}
.nav-logo {
    font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
    color: var(--text); cursor: pointer; text-decoration: none;
    letter-spacing: -0.02em;
}
.nav-logo span { color: var(--secondary); }
.nav-links { display: flex; gap: 0.25rem; align-items: center; }
.nav-link {
    font-family: var(--font-mono); font-size: 0.75rem; font-weight: 400;
    color: var(--text-dim); text-decoration: none; text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 1rem; border-radius: var(--radius-sm);
    transition: var(--transition); position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after {
    content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: var(--secondary);
}

.nav-toggle { display: none; background: none; border: none; color: var(--text); cursor: none; font-size: 1.5rem; }
.mobile-nav {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(5,5,16,0.98); backdrop-filter: blur(30px);
    flex-direction: column; align-items: center; justify-content: center; gap: 2.5rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
    font-family: var(--font-display); font-size: 2rem; color: var(--text-dim);
    text-decoration: none; transition: var(--transition); letter-spacing: -0.02em;
}
.mobile-nav a:hover { color: var(--text); }
.mobile-close { position: absolute; top: 2rem; right: 2rem; background: none; border: none; color: var(--text); font-size: 2rem; cursor: none; }

.nav-icon-btn {
    background: none; border: none; color: var(--text-dim);
    cursor: none; display: flex; align-items: center; justify-content: center;
    padding: 0.5rem; transition: var(--transition);
}
.nav-icon-btn:hover { color: var(--text); transform: scale(1.1); }
.nav-icon-btn .material-icons-outlined { font-size: 1.25rem; }


@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links { display: none; }
    .nav { padding: 1rem 1.5rem; }
    .nav.scrolled { padding: 0.75rem 1.5rem; }
    body { cursor: auto; }
    .cursor-dot, .cursor-ring, .cursor-glow { display: none !important; }
}

/* ===== GLASS CARD ===== */
.glass {
    background: var(--surface-card);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), transform 0.5s cubic-bezier(0.2, 0, 0, 1), box-shadow var(--transition);
}
.glass:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 40px rgba(124,58,237,0.08), 0 25px 70px rgba(0,0,0,0.3);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.9rem 2.2rem; border-radius: 50px; font-family: var(--font-body);
    font-weight: 600; font-size: 0.88rem; cursor: none;
    transition: var(--transition); text-decoration: none; border: none;
    position: relative; overflow: hidden;
}
.btn::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    opacity: 0; transition: opacity 0.3s ease;
}
.btn:hover::before { opacity: 1; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #9333ea);
    color: white; box-shadow: 0 4px 25px var(--glow-purple);
}
.btn-primary::before { background: linear-gradient(135deg, #9333ea, var(--primary)); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 35px var(--glow-purple); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid rgba(238,238,255,0.15); }
.btn-outline:hover { border-color: var(--primary-light); background: rgba(124,58,237,0.06); }

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.8rem; border-radius: 50px;
    font-size: 0.72rem; font-weight: 500; font-family: var(--font-mono);
    letter-spacing: 0.03em;
}
.badge-purple { background: rgba(124,58,237,0.1); color: var(--primary-light); border: 1px solid rgba(124,58,237,0.2); }
.badge-cyan { background: rgba(6,182,212,0.1); color: var(--secondary); border: 1px solid rgba(6,182,212,0.2); }
.badge-pink { background: rgba(244,114,182,0.1); color: var(--accent); border: 1px solid rgba(244,114,182,0.2); }

/* ===== SECTION LAYOUT ===== */
.section { padding: 7rem 3rem; max-width: 1200px; margin: 0 auto; }
.section-label {
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--secondary);
    text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 0.75rem;
}
.section-title {
    font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700; line-height: 1.08; margin-bottom: 1rem;
    letter-spacing: -0.03em;
}
.section-subtitle { color: var(--text-dim); font-size: 1rem; max-width: 550px; line-height: 1.8; }

/* ===== HERO ===== */
.hero {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 8rem 3rem; text-align: center; position: relative;
}
.hero-content { max-width: 850px; z-index: 10; }
.hero-badge { margin-bottom: 2rem; }
.hero-name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 9vw, 6rem);
    font-weight: 700; line-height: 1.0;
    margin-bottom: 1.5rem;
    letter-spacing: -0.04em;
}
.hero-name .gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-size: 200% 200%; animation: gradient-shift 5s ease-in-out infinite;
}
@keyframes gradient-shift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero-desc {
    color: var(--text-dim); font-size: 1.1rem;
    max-width: 500px; margin: 0 auto 3rem;
    line-height: 1.9; font-weight: 300;
}
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.scroll-indicator {
    position: absolute; bottom: 3rem; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
    color: var(--text-muted); font-family: var(--font-mono);
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.2em;
}
.scroll-line {
    width: 1px; height: 40px; position: relative; overflow: hidden;
    background: rgba(238,238,255,0.1);
}
.scroll-line::after {
    content: ''; position: absolute; top: -100%; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent, var(--primary-light));
    animation: scroll-move 2s ease-in-out infinite;
}
@keyframes scroll-move { 0% { top: -100%; } 100% { top: 100%; } }

/* ===== SKILL RING ===== */
.skill-ring {
    width: 110px; height: 110px; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.skill-ring svg { position: absolute; width: 100%; height: 100%; transform: rotate(-90deg); }
.skill-ring circle { fill: none; stroke-width: 3; stroke-linecap: round; }
.skill-ring .bg { stroke: rgba(124,58,237,0.08); }
.skill-ring .fill {
    stroke: var(--primary);
    transition: stroke-dashoffset 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.skill-ring .label {
    font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
    color: var(--text); z-index: 1;
}

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary), transparent);
}
.timeline-item { position: relative; padding-bottom: 2.5rem; }
.timeline-item::before {
    content: ''; position: absolute; left: -2.5rem; top: 0.5rem;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary); border: 2px solid var(--surface);
    box-shadow: 0 0 15px var(--glow-purple);
}
.timeline-item .glass { padding: 1.75rem; }

/* ===== PROJECT CARD ===== */
.project-card { padding: 2rem; position: relative; overflow: hidden; }
.project-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-card:hover::before { transform: scaleX(1); }
.project-card h3 {
    font-family: var(--font-display); font-size: 1.3rem;
    font-weight: 600; margin-bottom: 0.6rem; letter-spacing: -0.02em;
}
.project-card p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.7; }
.project-tech { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }

/* ===== CONTACT FORM ===== */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.75rem; color: var(--text-dim); font-weight: 500; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.form-group input, .form-group textarea {
    background: rgba(12,12,32,0.5); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.9rem 1.1rem;
    color: var(--text); font-family: var(--font-body); font-size: 0.92rem;
    transition: var(--transition); outline: none;
}
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 20px rgba(124,58,237,0.12);
}
.form-group textarea { resize: vertical; min-height: 140px; }

/* ===== FOOTER ===== */
.footer {
    padding: 3rem 3rem; text-align: center;
    border-top: 1px solid var(--border);
}
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.footer-links { display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center; }
.footer-links a {
    color: var(--text-muted); text-decoration: none; font-size: 0.8rem;
    font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em;
    transition: var(--transition);
}
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text-muted); font-size: 0.75rem; font-family: var(--font-mono); }

/* ===== SOCIAL LINK ===== */
.social-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1.25rem 1.5rem; text-decoration: none; color: var(--text);
}
.social-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
    opacity: 0; transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.2, 0, 0, 1), transform 1s cubic-bezier(0.2, 0, 0, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.45s; }
.reveal-delay-4 { transition-delay: 0.6s; }

/* ===== TYPED CURSOR ===== */
.typed-cursor {
    display: inline-block; width: 2px; height: 1.1em;
    background: var(--secondary); margin-left: 2px;
    animation: cursor-blink 0.7s step-end infinite; vertical-align: text-bottom;
}
@keyframes cursor-blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ===== GRID HELPERS ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .section { padding: 5rem 1.5rem; }
    .hero { padding: 6rem 1.5rem; }
}

/* ===== SCROLLBAR & SELECTION ===== */
::selection { background: var(--primary); color: white; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.4); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== HORIZONTAL DIVIDER ===== */
.divider {
    width: 60px; height: 1px; margin: 1.5rem 0;
    background: linear-gradient(90deg, var(--primary), transparent);
}

/* ===== GLITCH EFFECTS (DESIGN UPGRADE) ===== */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(-1deg); }
    40% { transform: skew(1deg); }
    60% { transform: skew(-0.5deg); }
    80% { transform: skew(0.5deg); }
    100% { transform: skew(0deg); }
}

.glitch-hover:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite,
               glitch-skew 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    text-shadow: 2.5px 0 var(--secondary), -2.5px 0 var(--accent);
}

.btn:hover, .nav-item a:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both;
    text-shadow: 1.5px 0 var(--secondary), -1.5px 0 var(--accent);
}

/* Image Glitch for Profile Photo */
.profile-glitch:hover {
    filter: url(#glitch-filter);
    animation: glitch-skew 0.5s ease infinite;
}

