@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

:root {
    --bg: #07070d;
    --bg-surface: #0f0f1a;
    --bg-card: #13131f;
    --bg-card-hover: #1a1a28;
    --border: rgba(255,255,255,0.07);
    --border-accent: rgba(99,102,241,0.4);
    --accent: #6366f1;
    --accent-glow: rgba(99,102,241,0.15);
    --accent-bright: #818cf8;
    --accent-2: #06b6d4;
    --text: #f0f0fa;
    --text-muted: #7c7c9a;
    --text-subtle: #4a4a6a;
    --font-display: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --radius: 12px;
    --radius-lg: 20px;
}

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

html { scroll-behavior: smooth; }

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

/* ───── SCROLLBAR ───── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ───── TYPOGRAPHY ───── */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; text-align: center; margin-bottom: 0.6rem; }
.section-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 4rem; font-size: 1rem; font-weight: 300; }

/* ───── NOISE OVERLAY ───── */
body::before {
    content: '';
    position: fixed; inset: 0;
    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)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 9999;
    opacity: 0.4;
}

/* ───── NAVIGATION ───── */
header {
    position: fixed; top: 0; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.2rem 5%;
    background: rgba(7,7,13,0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: padding 0.3s;
}

header.scrolled { padding: 0.8rem 5%; }

.logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }

.nav-links { list-style: none; display: flex; gap: 8px; }
.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.88rem;
    padding: 6px 14px;
    border-radius: 30px;
    transition: all 0.25s;
    letter-spacing: 0.01em;
}
.nav-links a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.burger { display: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 4px; }
.burger div { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s ease; }

.burger.toggle .line1 { transform: rotate(-45deg) translate(-5px, 6px); }
.burger.toggle .line2 { opacity: 0; }
.burger.toggle .line3 { transform: rotate(45deg) translate(-5px, -6px); }

/* ───── SECTIONS ───── */
section { padding: 7rem 5% 5rem; }
.bg-surface { background: var(--bg-surface); }

/* ───── HERO ───── */
.hero {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--bg);
    padding-top: 0;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(99,102,241,0.18) 0%, transparent 70%);
    top: -100px; left: -100px;
}
.orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(6,182,212,0.12) 0%, transparent 70%);
    bottom: -80px; right: -80px;
    animation-delay: -4s;
}
.orb-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -2s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(20px, -20px); }
    66% { transform: translate(-15px, 15px); }
}

.hero-grid-lines {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.hero-content { position: relative; z-index: 2; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(99,102,241,0.1);
    border: 1px solid var(--border-accent);
    color: var(--accent-bright);
    font-size: 0.8rem; font-weight: 500;
    padding: 6px 16px;
    border-radius: 30px;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    animation: fadeUp 0.8s ease both;
}

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

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

.hero-content h1 {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 1.2rem;
    animation: fadeUp 0.8s 0.1s ease both;
}

.hero-content h1 .highlight {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 1.5rem;
    animation: fadeUp 0.8s 0.2s ease both;
}

.hero-desc {
    max-width: 560px;
    margin: 0 auto 2.5rem;
    color: var(--text-muted);
    font-size: 1rem;
    animation: fadeUp 0.8s 0.3s ease both;
}

.tags {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
    margin-bottom: 2.5rem;
    animation: fadeUp 0.8s 0.4s ease both;
}
.tags span {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem; font-weight: 500;
}

.cta-buttons {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
    animation: fadeUp 0.8s 0.5s ease both;
}

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s;
    font-family: var(--font-body);
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px rgba(99,102,241,0.3);
}
.btn-primary:hover {
    background: var(--accent-bright);
    box-shadow: 0 0 30px rgba(99,102,241,0.5);
    transform: translateY(-2px);
}
.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    transform: translateY(-2px);
}

.hero-scroll {
    position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: var(--text-subtle); font-size: 0.75rem; letter-spacing: 0.1em;
    text-transform: uppercase; animation: fadeIn 1s 1s ease both;
}
.scroll-line {
    width: 1px; height: 40px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ───── ABOUT ───── */
.about-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    transition: border-color 0.3s, transform 0.3s;
}
.glass-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
}
.glass-card h3 {
    font-size: 1.3rem; font-weight: 700; margin-bottom: 1.5rem;
    color: var(--text);
}

.percorso-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.percorso-list li {
    display: flex; align-items: center; gap: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: border-color 0.3s;
}
.percorso-list li:hover { border-color: var(--border-accent); }
.percorso-list img { width: 28px; height: 28px; object-fit: contain; filter: brightness(0.9); }
.percorso-text strong { display: block; color: var(--text); font-weight: 600; font-size: 0.9rem; }
.percorso-text { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

.interessi-list {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 1.8rem;
}
.interesse-item {
    background: rgba(99,102,241,0.08);
    border: 1px solid var(--border-accent);
    color: var(--accent-bright);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem; font-weight: 500;
}

.soft-skills-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
}
.soft-skills-box h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 1rem; }
.soft-skills-list { list-style: none; }
.soft-skills-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text-muted); font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.soft-skills-list li:last-child { border-bottom: none; }
.soft-skills-list .check { color: var(--accent); font-weight: bold; font-size: 1rem; }

/* ───── SKILLS ───── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.skill-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: border-color 0.3s, transform 0.3s;
}
.skill-box:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
}
.skill-box-title {
    font-family: var(--font-display);
    font-size: 1rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--accent-bright);
    margin-bottom: 1.6rem;
    display: flex; align-items: center; gap: 8px;
}
.skill-box-title::before {
    content: '';
    width: 20px; height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.skill-item { margin-bottom: 1.2rem; }
.skill-item:last-child { margin-bottom: 0; }
.skill-name {
    display: flex; justify-content: space-between;
    font-size: 0.88rem; color: var(--text-muted);
    margin-bottom: 8px;
}
.skill-name .pct { color: var(--text-subtle); font-size: 0.8rem; }

.progress-bar-bg {
    width: 100%; height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px; overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    border-radius: 2px;
    width: 0;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ───── PROJECTS ───── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: border-color 0.3s, transform 0.3s;
}
.project-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-6px);
}

.project-img-wrap {
    position: relative; overflow: hidden;
    height: 200px;
}
.project-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: brightness(0.8);
}
.project-card:hover .project-img { transform: scale(1.05); filter: brightness(0.9); }

.project-img-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(19,19,31,0.9) 100%);
}

.project-content {
    padding: 1.8rem;
    display: flex; flex-direction: column; flex-grow: 1;
}
.project-content h3 {
    font-size: 1.1rem; font-weight: 700; color: var(--text);
    margin-bottom: 0.7rem;
}
.project-content p {
    color: var(--text-muted); font-size: 0.88rem;
    line-height: 1.65; margin-bottom: 1.2rem;
    flex-grow: 1;
}
.tech-stack {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 1.4rem;
}
.tech-stack span {
    background: rgba(99,102,241,0.08);
    border: 1px solid var(--border-accent);
    color: var(--accent-bright);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem; font-weight: 500;
}

.btn-github {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px;
    border: 1px solid var(--border);
    color: var(--text);
    background: transparent;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600; font-size: 0.82rem;
    align-self: flex-start;
    transition: all 0.25s;
}
.btn-github:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px rgba(99,102,241,0.3);
}

/* ───── EDUCATION ───── */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.edu-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    transition: border-color 0.3s, transform 0.3s;
    display: flex; flex-direction: column;
}
.edu-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
}
.edu-icon { width: 40px; height: 40px; object-fit: contain; margin-bottom: 1.4rem; filter: brightness(0.9); }
.edu-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; line-height: 1.35; }
.edu-institution { color: var(--accent-bright); font-size: 0.88rem; font-weight: 500; margin-bottom: 4px; }
.edu-date { color: var(--text-subtle); font-size: 0.8rem; margin-bottom: 1.2rem; }
.edu-desc { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; margin-bottom: 1.6rem; flex-grow: 1; }
.edu-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.edu-tag {
    background: rgba(6,182,212,0.08);
    border: 1px solid rgba(6,182,212,0.2);
    color: var(--accent-2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
}

.cert-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
    display: flex; flex-direction: column; gap: 6px;
    transition: border-color 0.3s;
}
.cert-box:hover { border-color: var(--border-accent); border-left-color: var(--accent-bright); }
.cert-box strong { color: var(--text); font-size: 0.88rem; }
.cert-box span { color: var(--text-muted); font-size: 0.8rem; }

/* ───── OS SECTION ───── */
.os-section-header { text-align: center; margin-bottom: 3.5rem; }
.os-main-title { color: var(--text); }

.os-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.os-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: border-color 0.3s, transform 0.3s;
}
.os-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
}
.os-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.4rem;
}
.os-card-header h4 { font-size: 1rem; font-weight: 700; color: var(--text); }
.os-icon-img { width: 32px; height: 32px; object-fit: contain; opacity: 0.7; }
.os-list { display: flex; flex-direction: column; gap: 8px; }
.os-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.88rem; color: var(--text-muted);
    transition: border-color 0.2s, color 0.2s;
}
.os-item:hover { border-color: var(--border-accent); color: var(--text); }

/* ───── FOOTER ───── */
footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 5rem 5% 3rem;
}
footer h2 { color: var(--text); margin-bottom: 1rem; }
footer > p { color: var(--text-muted); margin-bottom: 2rem; }

.footer-links { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 3rem; }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    color: var(--text-subtle);
    font-size: 0.82rem;
}
.footer-bottom p { margin-bottom: 4px; }

/* ───── SECTION LABEL ───── */
.section-label {
    text-align: center;
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--accent); font-weight: 600;
    margin-bottom: 0.6rem;
}

/* ───── ANIMATIONS ───── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}

.reveal {
    opacity: 0; transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1; transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ───── RESPONSIVE ───── */
@media screen and (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0; right: 0; bottom: 0;
        width: 70%;
        background: rgba(13,13,20,0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center; justify-content: center;
        gap: 8px;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
        border-left: 1px solid var(--border);
    }
    .nav-links.nav-active { transform: translateX(0); }
    .nav-links a { font-size: 1.1rem; padding: 10px 28px; }
    .burger { display: flex; }
    .hero-content h1 { font-size: clamp(2.4rem, 8vw, 3.5rem); }
    section { padding: 5rem 5% 4rem; }
}

@media screen and (max-width: 500px) {
    .cta-buttons { flex-direction: column; align-items: center; }
    .btn { width: 100%; justify-content: center; }
}
