/* ========================================================
   serlonghi.it — Personal site theme
   Dark mode + neon accents (GitHub dark palette)
   ======================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
    --bg-primary:    #0d1117;
    --bg-secondary:  #161b22;
    --bg-card:       #1c2128;
    --bg-card-hover: #21262d;
    --accent-neon:   #00d4ff;
    --accent-green:  #39d353;
    --accent-purple: #a371f7;
    --text-primary:  #e6edf3;
    --text-secondary:#c9d1d9;
    --text-muted:    #8b949e;
    --border:        #30363d;
    --border-hover:  #484f58;
    --font-mono:     'JetBrains Mono', 'Fira Code', monospace;
    --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
    --radius:        8px;
    --radius-lg:     12px;
    --transition:    0.2s ease;
    --shadow-neon:   0 0 20px rgba(0, 212, 255, 0.15);
    --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.4);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

a {
    color: var(--accent-neon);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #33ddff;
}

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

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ========================================================
   HEADER / NAV
   ======================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.nav-logo .accent { color: var(--accent-neon); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-neon);
    transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

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

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
}

.lang-btn {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 4px;
    transition: all var(--transition);
}

.lang-btn:hover { color: var(--text-primary); }

.lang-btn.active {
    background: var(--accent-neon);
    color: var(--bg-primary);
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ========================================================
   HERO
   ======================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(57, 211, 83, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hero-terminal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card), var(--shadow-neon);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green  { background: #28c840; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 8px;
}

.terminal-body {
    padding: 28px 32px 36px;
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.8;
}

.terminal-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.terminal-prompt {
    color: var(--accent-green);
    user-select: none;
    flex-shrink: 0;
}

.terminal-cmd {
    color: var(--text-secondary);
}

.terminal-output {
    padding-left: 28px;
    margin-bottom: 8px;
}

.terminal-output .name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.terminal-output .role {
    font-size: 1rem;
    color: var(--accent-neon);
}

.terminal-output .detail {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.terminal-spacer { height: 16px; }

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--accent-neon);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

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

.hero-cta {
    display: flex;
    gap: 16px;
    padding: 24px 32px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent-neon);
    color: var(--bg-primary);
    border-color: var(--accent-neon);
}

.btn-primary:hover {
    background: #33ddff;
    color: var(--bg-primary);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--accent-neon);
    color: var(--accent-neon);
}

/* ========================================================
   SECTIONS — shared
   ======================================================== */
.section {
    padding: 96px 24px;
}

.section-alt {
    background: var(--bg-secondary);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

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

.section-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-neon);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-label::before {
    content: '//';
    color: var(--text-muted);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* ========================================================
   ABOUT
   ======================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 64px;
    align-items: start;
}

.about-photo-wrap {
    position: relative;
}

.about-photo {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    object-fit: cover;
    border: 2px solid var(--border);
    filter: grayscale(20%);
}

.about-photo-placeholder {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 4rem;
    color: var(--accent-neon);
    font-weight: 700;
}

.about-badge {
    position: absolute;
    bottom: -12px;
    right: -12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    box-shadow: var(--shadow-card);
}

.about-badge-num {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-neon);
    line-height: 1;
}

.about-badge-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

.about-bio {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 32px;
}

.about-bio p + p { margin-top: 16px; }

.about-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 32px;
}

.about-meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.about-meta-item .icon {
    width: 16px;
    color: var(--accent-neon);
    flex-shrink: 0;
}

.about-social {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.social-link:hover {
    border-color: var(--accent-neon);
    color: var(--accent-neon);
}

/* ========================================================
   SKILLS
   ======================================================== */
.skills-categories {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.skill-category-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--transition);
    cursor: default;
}

.skill-chip:hover {
    border-color: var(--accent-neon);
    color: var(--text-primary);
    background: var(--bg-card-hover);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.1);
}

.skill-chip img,
.skill-chip i {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(57, 211, 83, 0.05));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.cert-badge .cert-icon {
    font-size: 1.5rem;
    color: var(--accent-neon);
}

/* ========================================================
   PROJECTS
   ======================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--accent-neon);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.1), var(--shadow-card);
    transform: translateY(-2px);
}

.project-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--bg-secondary);
}

.project-image-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.project-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.project-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 16px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 3px 8px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 4px;
    color: var(--accent-neon);
}

.project-links {
    display: flex;
    gap: 10px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all var(--transition);
}

.project-link:hover {
    color: var(--accent-neon);
    border-color: var(--accent-neon);
}

.projects-empty {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

/* ========================================================
   CONTACT
   ======================================================== */
.contact-inner {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.7;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.contact-link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    transition: all var(--transition);
    min-width: 180px;
    justify-content: center;
}

.contact-link-card:hover {
    border-color: var(--accent-neon);
    color: var(--accent-neon);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.1);
}

.contact-link-card svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.contact-link-label {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.contact-link-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-link-value {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========================================================
   FOOTER
   ======================================================== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 32px 24px;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-copy .accent { color: var(--accent-neon); }

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color var(--transition);
}

.footer-links a:hover { color: var(--accent-neon); }

/* ========================================================
   MOBILE NAV OVERLAY
   ======================================================== */
.nav-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 99;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.nav-mobile-overlay.open { display: flex; }

.nav-mobile-overlay a {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.nav-mobile-overlay a:hover { color: var(--accent-neon); }

.nav-mobile-close {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* ========================================================
   RESPONSIVE
   ======================================================== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }

    .hero-content { padding: 0; }
    .terminal-body { padding: 20px; font-size: 0.875rem; }
    .terminal-output .name { font-size: 1.4rem; }
    .hero-cta { padding: 16px 20px; }

    .section { padding: 64px 24px; }
    .section-title { font-size: 1.6rem; }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .about-photo-wrap { max-width: 200px; margin: 0 auto; }
    .about-badge { bottom: -8px; right: -8px; }

    .projects-grid { grid-template-columns: 1fr; }

    .contact-links { flex-direction: column; align-items: center; }
    .contact-link-card { width: 100%; max-width: 320px; }

    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
    .terminal-body { padding: 16px; font-size: 0.8rem; }
    .hero-cta { flex-direction: column; }
    .btn { justify-content: center; }
}
