@font-face {
    font-family: "JetBrains Mono";
    src: url("jetbrains-mono-latin.woff2") format("woff2");
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

/* Tema: shell Linux su sfondo scuro. Pixel art per le immagini, bordi a gradini e ombre nette per i box. */
:root {
    --bg: #0b1220;
    --panel: #111b2e;
    --bar: #16233b;
    --line: #2a3c5c;
    --ink: #d6e2f5;
    --bright: #f2f7ff;
    --muted: #8fa5c6;
    --green: #3fb950;
    --blue: #5b9dff;
    --amber: #e3b341;
    --orange: #ff7b72;
    --cyan: #39c5cf;
    --magenta: #d68cf0;
    --shadow: #060b15;
    --shadow-h: #1a2a47;
    
    color-scheme: dark;
    --accent: var(--blue);
    --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
    --bs-body-font-family: var(--mono);
    --bs-body-font-size: .9375rem;
    --bs-body-line-height: 1.7;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--bg);
    --bs-body-font-weight: 400;
    --datacenter: url("datacenter-dark.svg");
    color-scheme: dark;
}
.window-lights i:nth-child(1) { background: #ff5f56; }
.window-lights i:nth-child(2) { background: #e3b341; }

body { background: var(--bg) url("bg-circuit.svg") repeat left top / 288px 288px; color: var(--ink); font-family: var(--mono); font-feature-settings: "calt" 1; -webkit-font-smoothing: antialiased; }
.container { max-width: 1120px; padding-inline: 32px; }
a { color: inherit; text-underline-offset: .28em; text-decoration-thickness: 1px; }
::selection { background: var(--blue); color: var(--bg); }
:focus-visible { outline: 2px dashed var(--blue); outline-offset: 4px; }
[x-cloak] { display: none !important; }
img[src$=".svg"].pixel, .pixel { image-rendering: pixelated; }

.skip-link { position: absolute; top: 8px; left: 8px; z-index: 5; background: var(--blue); color: var(--bg); padding: 10px 14px; font-weight: 700; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

/* Barra in stile tmux */
.site-header { background: var(--bar); border-bottom: 1px solid var(--line); }
.site-nav, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.site-nav { min-height: 58px; }
.identity { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; color: var(--bright); text-decoration: none; }
.identity .prompt-mark { color: var(--green); }
.brand-logo { display: block; width: auto; height: 36px; max-width: 100%; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; padding: 0; list-style: none; font-size: .875rem; counter-reset: win; }
.nav-links li { counter-increment: win; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 10px; color: var(--muted); text-decoration: none; }
.nav-links a::before { content: counter(win) ":"; margin-right: 4px; color: var(--amber); }
.nav-links a:hover, .nav-links a:focus-visible { background: var(--blue); color: var(--bg); }
.nav-links a:hover::before, .nav-links a:focus-visible::before { color: var(--bg); }
.menu-toggle { display: none; padding: 8px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--blue); font: inherit; }
.menu-toggle::before { content: "["; } .menu-toggle::after { content: "]"; }

/* Hero */
.hero { padding-block: clamp(48px, 7vw, 96px); }
.eyebrow { display: block; color: var(--muted); font-size: .875rem; margin-bottom: 18px; }
.eyebrow span { display: none; }
.eyebrow::before { content: "# "; color: var(--amber); }
.prompt-line { margin: 0 0 6px; font-size: .9375rem; color: var(--muted); overflow-wrap: anywhere; }
.prompt-line .user { color: var(--green); font-weight: 700; }
.prompt-line .path { color: var(--cyan); font-weight: 700; }
h1, h2, h3 { color: var(--bright); font-family: var(--mono); }
h1 { font-size: clamp(2.5rem, 7vw, 5.4rem); font-weight: 800; letter-spacing: -.055em; line-height: 1; margin: 0 0 26px; }
h1 span { display: block; color: var(--blue); }
h1 span::after { content: ""; display: inline-block; width: .5em; height: .85em; margin-left: .12em; background: var(--blue); vertical-align: -.06em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-description { max-width: 44ch; font-size: 1.02rem; color: var(--ink); line-height: 1.7; margin-bottom: 28px; padding-left: 14px; border-left: 2px solid var(--line); }
.hero-button { display: inline-block; padding: 11px 18px; border: 1px solid var(--blue); border-radius: 0; background: transparent; color: var(--blue); font-family: var(--mono); font-weight: 700; box-shadow: 4px 4px 0 var(--shadow-h); }
.hero-button::before { content: "$ "; }
.hero-button:hover, .hero-button:focus-visible { background: var(--blue); color: var(--bg); border-color: var(--blue); box-shadow: 4px 4px 0 var(--shadow-h); }
.hero-button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow-h); }

/* Finestra di terminale con pixel art */
.orbit-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 0; background: var(--bg); box-shadow: 8px 8px 0 var(--shadow); }
.orbit-bar { position: relative; display: flex; justify-content: center; align-items: center; min-height: 36px; padding-inline: 72px; border-bottom: 1px solid var(--line); background: var(--bar); color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.window-lights { position: absolute; left: 12px; display: flex; gap: 6px; }
.window-lights i { width: 9px; height: 9px; background: #c0262d; }
.window-lights i:nth-child(2) { background: #c99a00; }
.window-lights i:nth-child(3) { background: var(--green); }
.orbit-art { display: block; width: 100%; height: auto; max-width: none; image-rendering: pixelated; }

/* Sezioni come comandi */
.section-pad { padding-block: clamp(48px, 6vw, 84px); }
h2 { font-size: clamp(1.45rem, 3.2vw, 2.1rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.2; margin: 0 0 30px; }
h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.services, .education, .site-footer { border-top: 1px solid var(--line); }
.services { background: transparent; }

.service-card { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--line); border-radius: 0; padding: clamp(20px, 2.4vw, 28px); background: var(--panel); box-shadow: 6px 6px 0 var(--shadow); transition: transform .12s steps(2), box-shadow .12s steps(2), border-color .12s; }
.service-card:hover { border-color: var(--blue); transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--shadow-h); }
.service-card h3::before { content: "> "; color: var(--green); }
.service-card p { color: var(--muted); line-height: 1.7; margin-bottom: 22px; font-size: .9rem; }
.service-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 22px; border: 1px solid currentColor; border-radius: 0; background: var(--bg); }
.service-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; stroke-linejoin: miter; }
.service-icon.code { color: var(--blue); }
.service-icon.app { color: var(--orange); }
.service-icon.cloud { color: var(--cyan); }
.service-icon.web { color: var(--blue); }
.tech-list { display: flex; flex-wrap: wrap; gap: 6px 10px; list-style: none; padding: 0; margin: auto 0 0; }
.tech-list li { color: var(--amber); font-size: .8125rem; }
.tech-list li::before { content: "["; color: var(--muted); } .tech-list li::after { content: "]"; color: var(--muted); }

.education { background: rgba(17, 27, 46, .86); }
.education h2 { margin-bottom: 0; }
.education-list { list-style: none; padding: 0; margin: 0; font-size: .9375rem; }
.education-list li { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 18px 0; border-top: 1px dashed var(--line); }
.education-list li:last-child { border-bottom: 1px dashed var(--line); }
.education-list time { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }
.education-list h3 { margin-bottom: 4px; }
.education-list p { margin: 0; color: var(--muted); }

.client-card { display: grid; grid-template-rows: 48px auto; align-content: center; justify-items: center; gap: 14px; height: 100%; min-height: 137px; padding: 16px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--panel); text-align: center; text-decoration: none; font-size: .8125rem; color: var(--muted); box-shadow: 4px 4px 0 var(--shadow); }
.client-card:hover, .client-card:focus-visible { border-color: var(--blue); color: var(--blue); }
.client-card img { max-width: 100%; max-height: 48px; padding: 4px 8px; object-fit: contain; background: #fff; border: 1px solid var(--line); }

.site-footer { background: var(--bar); }
.footer-inner { flex-wrap: wrap; gap: 4px 20px; padding-block: 12px; font-size: .8125rem; color: var(--muted); }
.footer-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.footer-name { font-weight: 700; color: var(--green); }
.footer-name::before { content: "$ "; color: var(--muted); font-weight: 400; }
.footer-details address { margin: 0; }
.footer-order { flex-basis: 100%; margin: 0; color: var(--muted); }
.footer-inner > a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; color: var(--cyan); }
.footer-inner > a:hover { text-decoration: underline; }

@media (max-width: 991.98px) {
    .education h2 { margin-bottom: 12px; }
}
@media (max-width: 767.98px) {
    .container { padding-inline: 24px; }
    .orbit-panel { max-width: 420px; }
}
@media (max-width: 575.98px) {
    .site-nav { flex-wrap: wrap; gap: 0 12px; padding-block: 8px; }
    .menu-toggle:not([x-cloak]) { display: block; }
    .nav-links { width: 100%; padding-bottom: 6px; }
    .nav-links.is-closed { display: none; }
    .container { padding-inline: 18px; }
    .orbit-bar { padding-inline: 56px; font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
    h1 span::after { animation: none; }
    .service-card, .service-card:hover { transition: none; transform: none; }
}

/* Chi sono, progetti, intestazioni di sezione */
.section-lead { max-width: 62ch; margin: -14px 0 28px; color: var(--muted); }
.section-lead::before { content: "# "; color: var(--amber); }
.about { border-top: 1px solid var(--line); }
.about h2 { margin-bottom: 0; }
.about-text p { margin: 0 0 16px; max-width: 66ch; line-height: 1.8; }
.about-text p:last-child { margin-bottom: 0; }
.projects { background: rgba(17, 27, 46, .86); border-top: 1px solid var(--line); }
.project-card { display: flex; flex-direction: column; height: 100%; padding: clamp(20px, 2.4vw, 28px); border: 1px solid var(--line); background: var(--bg); box-shadow: 6px 6px 0 var(--shadow); }
.project-card:hover { border-color: var(--blue); }
.project-card h3 { font-size: 1.45rem; margin: 6px 0 2px; }
.project-card p { color: var(--muted); line-height: 1.7; margin-bottom: 18px; font-size: .9rem; }
.project-card .project-tagline { color: var(--ink); font-weight: 600; font-size: .95rem; margin-bottom: 10px; }
.project-head { display: flex; justify-content: flex-start; align-items: center; gap: 12px; font-size: .75rem; color: var(--muted); }
.project-kind { padding: 1px 8px; border: 1px solid currentColor; }
.kind-cloud { color: var(--cyan); }
.kind-local { color: var(--magenta); }
.about + .services { border-top: 1px solid var(--line); }

/* Fila di rack di un data center in pixel art, ripetuta in orizzontale */
.datacenter { height: clamp(96px, 13vw, 160px); background: var(--bg) var(--datacenter) repeat-x left bottom / auto 100%; image-rendering: pixelated; border-top: 1px solid var(--line); }

/* Contatti, link del footer, pagina privacy */
.contact { border-top: 1px solid var(--line); background: rgba(17, 27, 46, .86); }
.contact-text { max-width: 56ch; margin: -14px 0 24px; color: var(--muted); }
.contact-mail { text-transform: none; overflow-wrap: anywhere; }
.contact-mail::before { content: "> "; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; color: var(--cyan); }
.footer-links a:hover { text-decoration: underline; }
.legal { max-width: 820px; padding-block: clamp(40px, 6vw, 72px); }
.legal h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 8px; }
.legal h1 span { display: inline; }
.legal h1 span::after { content: none; }
.legal .updated { color: var(--muted); margin-bottom: 36px; }
.legal h2 { font-size: 1.2rem; margin: 34px 0 10px; }
.legal p, .legal li { line-height: 1.8; }
.legal ul { padding-left: 1.2rem; }
.legal a { color: var(--blue); }
.back-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--cyan); text-decoration: none; }
.back-link:hover { text-decoration: underline; }
