/* ==========================================================================
   Portfolio · Cyber Security — design system
   Nessuna risorsa esterna: font di sistema, icone SVG inline.
   ========================================================================== */

:root {
  --bg: #06080c;
  --bg2: #0a0e15;
  --surface: #0d121a;
  --surface2: #121926;
  --line: #1a2331;
  --line2: #263247;
  --text: #e8eef6;
  --muted: #8b98ad;
  --dim: #5a6679;
  --ok: #34d399;
  --warn: #fbbf24;
  --info: #60a5fa;
  --danger: #fb7185;
  --accent: #34d399;
  --accent-rgb: 52, 211, 153;
  --accent-ink: #04140d;
  --radius: 14px;
  --radius-sm: 9px;
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", "Fira Code", Consolas, ui-monospace, monospace;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
body[data-accent="cyan"]   { --accent: #22d3ee; --accent-rgb: 34, 211, 238;  --accent-ink: #031418; }
body[data-accent="violet"] { --accent: #a78bfa; --accent-rgb: 167, 139, 250; --accent-ink: #120a24; }
body[data-accent="amber"]  { --accent: #fbbf24; --accent-rgb: 251, 191, 36;  --accent-ink: #1a1203; }
body[data-accent="red"]    { --accent: #fb7185; --accent-rgb: 251, 113, 133; --accent-ink: #1d0509; }
body[data-accent="blue"]   { --accent: #60a5fa; --accent-rgb: 96, 165, 250;  --accent-ink: #04101f; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.65 var(--sans); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.025em; margin: 0 0 .5em; font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.12rem; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
::selection { background: rgba(var(--accent-rgb), .3); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.mono { font-family: var(--mono); letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(800px, 100% - 40px); }
.mt { margin-top: 3rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; margin-right: .4em; }
kbd { font-family: var(--mono); font-size: .8em; padding: 1px 6px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; color: var(--text); background: var(--surface); }

/* Background */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(var(--accent-rgb), .13), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(96, 165, 250, .07), transparent 60%),
    linear-gradient(var(--bg), var(--bg));
}
.bg-grid::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .78em 1.25em; border-radius: 10px; border: 1px solid transparent;
  font: 600 .95rem/1 var(--sans); cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 30px -8px rgba(var(--accent-rgb), .6), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { box-shadow: 0 12px 40px -8px rgba(var(--accent-rgb), .75), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-ghost { background: rgba(255,255,255,.03); color: var(--text); border-color: var(--line2); }
.btn-ghost:hover { border-color: rgba(var(--accent-rgb), .6); color: var(--accent); }
.btn-sm { padding: .55em .95em; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn .ic { margin: 0; }
.linklike { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 8, 12, .72); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); background: rgba(6, 8, 12, .88); }
.nav-in { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  font: 700 .82rem/1 var(--mono); color: var(--accent-ink); background: var(--accent);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 6px 20px -6px rgba(var(--accent-rgb), .7);
}
.brand-txt { font: 500 .92rem/1.35 var(--mono); display: flex; flex-direction: column; }
.bt-line { white-space: nowrap; }

/* Profili in cima alla pagina */
.topbar { border-bottom: 1px solid var(--line); background: rgba(6, 8, 12, .9); position: relative; z-index: 51; }
.topbar-in { display: flex; justify-content: flex-end; align-items: center; gap: 6px 20px; min-height: 36px; flex-wrap: wrap; }
.topbar a { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font: 500 .8rem var(--mono); padding: 6px 0; }
.topbar a:hover { color: var(--accent); text-decoration: none; }
.tb-ab { display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 4px; border-radius: 5px; border: 1px solid rgba(var(--accent-rgb), .4); color: var(--accent); font: 700 .66rem/1 var(--mono); text-transform: uppercase; }
.caret { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: .92rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,.04); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.lang { font: 600 .78rem var(--mono); color: var(--muted); border: 1px solid var(--line2); padding: 6px 9px; border-radius: 7px; }
.lang:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.burger { display: none; width: 40px; height: 40px; border: 1px solid var(--line2); background: transparent; border-radius: 9px; cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.burger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* Pills, tags, dots */
.pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 10px;
  border: 1px solid rgba(var(--accent-rgb), .35); background: rgba(var(--accent-rgb), .08);
  color: var(--accent); border-radius: 999px; font-size: .85rem; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--accent); flex: none; }
.dot-live { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .7); animation: pulse 2s infinite; }
.dot-ok { background: var(--ok); margin-right: 8px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .6); } 70% { box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); } }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font: 500 .74rem/1.6 var(--mono); color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--line2); }
.tag-cert { color: #fbbf24; border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.07); }
.tag-lab { color: #22d3ee; border-color: rgba(34,211,238,.3); background: rgba(34,211,238,.07); }
.tag-ctf { color: #fb7185; border-color: rgba(251,113,133,.3); background: rgba(251,113,133,.07); }
.tag-platform { color: #a3e635; border-color: rgba(163,230,53,.3); background: rgba(163,230,53,.07); }
.tag-training { color: #a78bfa; border-color: rgba(167,139,250,.3); background: rgba(167,139,250,.07); }
.tag-career { color: #93a4bb; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font: 500 .74rem/1 var(--mono); color: var(--muted); padding: 5px 8px; border-radius: 6px; background: rgba(255,255,255,.035); }
.st { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.st-done { background: var(--ok); }
.st-progress { background: var(--warn); box-shadow: 0 0 10px rgba(251,191,36,.6); }
.st-planned { background: transparent; border: 1.5px dashed var(--dim); }

/* Cards */
.card {
  position: relative; background: linear-gradient(180deg, var(--surface2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
a.card { color: inherit; display: block; }
a.card:hover, .card.why:hover { text-decoration: none; border-color: rgba(var(--accent-rgb), .45); transform: translateY(-3px); box-shadow: var(--shadow), 0 0 0 1px rgba(var(--accent-rgb), .08); }

/* Hero */
.hero { padding: clamp(48px, 9vw, 110px) 0 40px; }
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero-name { font-size: clamp(2.8rem, 7.2vw, 5.4rem); line-height: .98; letter-spacing: -.045em; margin: 22px 0 14px; font-weight: 800;
  background: linear-gradient(180deg, #fff 30%, #a9b6c9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-role { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--accent); margin-bottom: 22px; min-height: 1.6em; }
.hero-title { font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.3; margin-bottom: 14px; }
.hero-sub { color: var(--muted); font-size: 1.05rem; max-width: 60ch; }
.hero-sub strong { color: var(--text); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 18px; }
.hero-avail { display: flex; align-items: center; gap: 2px; }
.hero-term {
  background: rgba(10, 14, 21, .85); border: 1px solid var(--line2); border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 80px -30px rgba(var(--accent-rgb), .35); overflow: hidden;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); }
.tl { width: 11px; height: 11px; border-radius: 50%; }
.tl.r { background: #ff5f57; } .tl.y { background: #febc2e; } .tl.g { background: #28c840; }
.term-bar .mono { margin-left: 8px; }
.hero-term pre { margin: 0; padding: 18px 20px 22px; min-height: 330px; font-size: .84rem; line-height: 1.7; color: #c9d4e3; white-space: pre-wrap; word-break: break-word; }
.hero-term .p { color: var(--accent); }
.hero-term .c { color: #fff; }
.hero-term .o { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 56px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(13, 18, 26, .6); overflow: hidden; }
.stat { padding: 22px 24px; border-right: 1px solid var(--line); margin: 0; }
.stat:last-child { border-right: 0; }
.stat dt { font-size: clamp(1.35rem, 2.6vw, 1.9rem); font-weight: 700; color: var(--text); line-height: 1.1; }
.stat dd { margin: 6px 0 0; color: var(--muted); font-size: .86rem; }

/* Sections */
.section { padding: clamp(64px, 9vw, 112px) 0; position: relative; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(13, 18, 26, .55) 12%, rgba(13, 18, 26, .55) 88%, transparent); }
.sec-head { max-width: 720px; margin-bottom: 44px; }
.sec-head p.muted { font-size: 1.05rem; }
.kicker { color: var(--accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 12px; }

/* Why */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.why-ic { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 18px; color: var(--accent); background: rgba(var(--accent-rgb), .1); border: 1px solid rgba(var(--accent-rgb), .25); }
.why-ic svg, .cert-badge svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.why p { color: var(--muted); font-size: .93rem; margin: 0; }

/* About */
.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: start; }
.about-side { position: sticky; top: 100px; }
.about-lang { margin-top: 28px; padding: 16px; border: 1px dashed var(--line2); border-radius: var(--radius-sm); }
.about-lang p { margin: 6px 0 0; color: var(--text); }

/* Prose */
.prose { font-size: 1.04rem; color: #cfd8e5; }
.prose h2 { font-size: 1.5rem; margin-top: 2em; color: var(--text); }
.prose h3 { font-size: 1.2rem; margin-top: 1.6em; color: var(--text); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--accent); }
.prose code { font: .88em var(--mono); background: rgba(255,255,255,.06); padding: .15em .4em; border-radius: 5px; color: #f0f4f9; }
.prose pre { background: #070a0f; border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; position: relative; }
.prose pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 6px; right: 10px; font: .7rem var(--mono); color: var(--dim); text-transform: uppercase; }
.prose pre code { background: none; padding: 0; font-size: .86rem; line-height: 1.6; }
.prose blockquote { margin: 1.5em 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: rgba(var(--accent-rgb), .06); border-radius: 0 8px 8px 0; color: var(--muted); }
.prose img { border-radius: var(--radius-sm); border: 1px solid var(--line2); margin: 1.5em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line2); margin: 2.5em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--line2); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface2); }
.table-wrap { overflow-x: auto; margin: 1.5em 0; }

/* Roadmap */
.road-progress { margin-bottom: 26px; }
.rp-bar { height: 8px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); overflow: hidden; }
.rp-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, rgba(var(--accent-rgb), .6), var(--accent)); border-radius: 99px; box-shadow: 0 0 20px rgba(var(--accent-rgb), .6); transition: width 1.6s cubic-bezier(.2, .8, .2, 1); }
.rp-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; color: var(--muted); }
.rp-legend b { color: var(--text); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.chip { font: 500 .82rem var(--sans); color: var(--muted); background: transparent; border: 1px solid var(--line2); padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: all .2s; }
.chip:hover { color: var(--text); border-color: var(--dim); }
.chip.is-on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-1px);
  background: linear-gradient(180deg, var(--ok) 0%, var(--ok) 60%, var(--warn) 80%, var(--line2) 100%); opacity: .5; }
.tl-item { position: relative; width: 50%; padding: 0 40px 28px 0; }
.tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 28px 40px; }
.tl-item.is-hidden { display: none; }
.tl-dot { position: absolute; top: 22px; right: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--ok); z-index: 1; }
.tl-item:nth-child(even) .tl-dot { right: auto; left: -8px; }
.tl-item.is-progress .tl-dot { border-color: var(--warn); box-shadow: 0 0 0 5px rgba(251,191,36,.15); }
.tl-item.is-planned .tl-dot { border-style: dashed; border-color: var(--dim); }
.tl-card { background: linear-gradient(180deg, var(--surface2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; transition: border-color .25s; }
.tl-card:hover { border-color: var(--line2); }
.tl-item.is-planned .tl-card { background: transparent; border-style: dashed; }
.tl-item.is-progress .tl-card { border-color: rgba(251,191,36,.3); }
.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); }
.tl-date { color: var(--text); font-weight: 600; }
.tl-status { margin-left: auto; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.is-done .tl-status { color: var(--ok); } .is-progress .tl-status { color: var(--warn); } .is-planned .tl-status { color: var(--dim); }
.tl-card h3 { margin-bottom: 6px; }
.tl-card p { color: var(--muted); font-size: .92rem; margin: 0; }

/* Study heatmap */
.study-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(13,18,26,.6); margin-bottom: 18px; overflow: hidden; }
.heat-wrap { overflow-x: auto; padding: 20px; }
.heat { display: flex; gap: 3px; min-width: max-content; }
.heat-col { display: flex; flex-direction: column; gap: 3px; }
.heat i, .heat-legend i { display: block; width: 12px; height: 12px; border-radius: 3px; background: rgba(255,255,255,.045); }
.heat .h-x { background: transparent; }
.heat .h1, .heat-legend .h1 { background: rgba(var(--accent-rgb), .25); }
.heat .h2, .heat-legend .h2 { background: rgba(var(--accent-rgb), .45); }
.heat .h3, .heat-legend .h3 { background: rgba(var(--accent-rgb), .7); }
.heat .h4, .heat-legend .h4 { background: var(--accent); box-shadow: 0 0 6px rgba(var(--accent-rgb), .6); }
.heat-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 12px; }
.heat-legend i { display: inline-block; }
.recent { margin-top: 26px; }
.recent-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.recent-list li { display: grid; grid-template-columns: 52px auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: .92rem; }

/* Projects */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.proj { display: flex !important; flex-direction: column; }
.proj.is-hidden { display: none !important; }
.proj.is-featured { border-color: rgba(var(--accent-rgb), .22); }
.proj-cover { margin: -24px -24px 18px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; aspect-ratio: 16/9; background: var(--bg2); border-bottom: 1px solid var(--line); }
.proj-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.proj:hover .proj-cover img { transform: scale(1.04); }
.proj-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; color: var(--muted); flex-wrap: wrap; }
.proj h3 { font-size: 1.15rem; }
.proj p { color: var(--muted); font-size: .93rem; flex: 1; }
.proj .tags { margin: 6px 0 18px; }
.proj-more { color: var(--accent); }
.small-grid .proj p { flex: none; }

/* Skills */
.skill-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.skill-legend span { display: inline-flex; align-items: center; gap: 8px; }
.lv { display: inline-block; width: 22px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--w, 33%), var(--line2) var(--w, 33%)); }
.lv2 { --w: 66%; } .lv3 { --w: 100%; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.skill-card h3 { font-size: .9rem; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.skill-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.skill-card li { display: flex; align-items: center; gap: 12px; font-size: .94rem; }
.lv-dots { display: inline-flex; gap: 3px; flex: none; }
.lv-dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--line2); }
li.lv1 .lv-dots i:nth-child(-n+1), li.lv2 .lv-dots i:nth-child(-n+2), li.lv3 .lv-dots i:nth-child(-n+3) { background: var(--accent); }

/* Certs */
.cert-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.cert { display: flex; gap: 20px; align-items: flex-start; }
.cert.is-prep { border-style: dashed; background: transparent; }
.cert-badge { flex: none; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; color: var(--warn); background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25); }
.cert.is-prep .cert-badge { color: var(--muted); background: rgba(255,255,255,.03); border-color: var(--line2); }
.cert-img { flex: none; width: 96px; border-radius: 10px; border: 1px solid var(--line2); }
.cert-body { min-width: 0; }
.cert-body h3 { margin-bottom: 8px; }
.cert-body p.small { color: var(--muted); margin-bottom: 8px; }
.verify { overflow-wrap: anywhere; }
.copy { background: rgba(255,255,255,.04); border: 1px dashed var(--line2); color: var(--text); font: inherit; padding: 2px 6px; border-radius: 5px; cursor: copy; overflow-wrap: anywhere; text-align: left; }
.copy:hover { border-color: var(--accent); }
.copy.copied { border-color: var(--ok); color: var(--ok); }

/* Experience */
.exp-list { display: grid; gap: 0; border-left: 1px solid var(--line2); margin-left: 6px; }
.exp { display: grid; grid-template-columns: 170px 1fr; gap: 28px; padding: 6px 0 34px 28px; position: relative; }
.exp::before { content: ""; position: absolute; left: -6px; top: 12px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface2); border: 2px solid var(--accent); }
.exp-when { color: var(--accent); padding-top: 3px; }
.exp-body h3 { margin-bottom: 2px; }
.exp-body ul { margin: 12px 0 0; padding-left: 1.1em; color: #c6d0dd; font-size: .95rem; }
.exp-body li { margin: .25em 0; }
.exp-body li::marker { color: var(--dim); }

/* Contact */
.contact-sec { background: radial-gradient(800px 400px at 20% 100%, rgba(var(--accent-rgb), .09), transparent 70%); }
.contact { display: grid; grid-template-columns: .85fr 1.15fr; gap: 56px; align-items: start; }
.profiles { margin-top: 30px; display: grid; gap: 10px; }
.profile { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); transition: border-color .2s, transform .2s; }
.profile:hover { text-decoration: none; border-color: rgba(var(--accent-rgb), .5); transform: translateX(3px); }
.profile .mono { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: rgba(var(--accent-rgb), .1); color: var(--accent); font-size: .75rem; font-weight: 700; }
.profile span:last-child { margin-left: auto; color: var(--muted); }
.form { display: grid; gap: 16px; padding: 28px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field span { font-size: .84rem; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text); background: var(--bg2);
  border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 11px 13px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.field.invalid input, .field.invalid textarea, .check.invalid { border-color: var(--danger); }
.check.invalid span { color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin: 0; min-height: 1.4em; }
.form-msg.ok { color: var(--ok); } .form-msg.err { color: var(--danger); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Project page */
.project-page { padding-top: 48px; }
.back { display: inline-block; margin-bottom: 28px; color: var(--muted); }
.back:hover { color: var(--accent); }
.proj-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 14px 0 14px; letter-spacing: -.035em; }
.proj-head .proj-top { justify-content: flex-start; gap: 14px; }
.lead { font-size: 1.18rem; color: var(--muted); }
.proj-head .tags { margin: 18px 0 0; }
.proj-hero-img { margin: 10px 0 36px; }
.proj-hero-img img { border-radius: var(--radius); border: 1px solid var(--line2); width: 100%; }
.cta-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 56px; flex-wrap: wrap; border-color: rgba(var(--accent-rgb), .3); }
.cta-box h2 { font-size: 1.4rem; margin-bottom: 4px; }
.cta-box p { margin: 0; }

/* 404 */
.notfound { min-height: 70vh; display: grid; place-items: center; }
.big-404 { font-size: clamp(2rem, 8vw, 4.5rem); color: var(--accent); margin: 0 0 20px; text-shadow: 0 0 40px rgba(var(--accent-rgb), .4); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 38px 0 26px; background: rgba(6,8,12,.8); }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-in .brand { margin-bottom: 8px; }
.foot-in p { margin: 0; }
.foot-sec { color: var(--muted); display: flex; align-items: center; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--accent); }
.term-hint { margin-top: 22px; text-align: center; }

/* Terminal overlay */
.term-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(2, 4, 8, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.term-overlay[hidden] { display: none; }
.term-win { width: min(780px, 100%); height: min(520px, 80vh); display: flex; flex-direction: column; background: #070a0f; border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: 0 30px 100px -20px #000, 0 0 60px -20px rgba(var(--accent-rgb), .4); overflow: hidden; }
.term-x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.term-x:hover { color: var(--text); }
.term-body { flex: 1; overflow-y: auto; padding: 16px 18px 6px; font-size: .86rem; line-height: 1.65; color: #c9d4e3; white-space: pre-wrap; word-break: break-word; }
.term-body .cmd { color: #fff; }
.term-body .acc { color: var(--accent); }
.term-body .err { color: var(--danger); }
.term-body a { color: var(--accent); }
.term-in { display: flex; align-items: center; gap: 8px; padding: 10px 18px 16px; font-size: .86rem; }
.term-in .prompt { color: var(--accent); white-space: nowrap; }
.term-in input { flex: 1; background: transparent; border: 0; outline: 0; color: #fff; font: inherit; caret-color: var(--accent); min-width: 0; }

/* Reveal on scroll (attivo solo con JS) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 1080px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 10px 16px 18px; background: rgba(6,8,12,.97); border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 13px 10px; font-size: 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .burger { display: inline-flex; }
  .nav-right { margin-left: auto; }
  .hero-in, .about, .contact { grid-template-columns: 1fr; gap: 40px; }
  .about-side { position: static; }
  .hero-term pre { min-height: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .study-stats { grid-template-columns: repeat(3, 1fr); }
  .study-stats .stat:nth-child(3) { border-right: 0; }
  .study-stats .stat:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .cert-grid { grid-template-columns: 1fr; }
  .timeline::before { left: 7px; }
  .tl-item, .tl-item:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 22px 36px; }
  .tl-dot, .tl-item:nth-child(even) .tl-dot { left: 0; right: auto; }
}
@media (max-width: 640px) {
  .wrap, .narrow { width: calc(100% - 32px); }
  .nav-right .btn-primary { display: none; }
  .brand-txt { font-size: .8rem; }
  .topbar-in { justify-content: center; gap: 4px 12px; flex-wrap: nowrap; }
  .topbar a > span:last-child { display: none; }
  .tb-ab { min-width: 0; }
  .topbar a { font-size: .7rem; gap: 5px; white-space: nowrap; }
  .why-grid, .proj-grid, .row2 { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .exp { grid-template-columns: 1fr; gap: 6px; }
  .recent-list li { grid-template-columns: 44px 1fr auto; }
  .recent-list li .tag { display: none; }
  .hero-cta .btn { flex: 1 1 auto; }
  .card { padding: 20px; }
  .proj-cover { margin: -20px -20px 16px; }
  .form { padding: 20px; }
  .cert { flex-direction: column; }
  .foot-in { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print {
  .nav, .bg-grid, .hero-term, .footer, .term-overlay, .filters, .form { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .tl-card { border-color: #ccc; background: #fff; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Mi piace ---------- */
.like { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; border: 1px solid rgba(var(--accent-rgb), .45); background: rgba(var(--accent-rgb), .06); color: var(--accent); font: 700 .9rem/1 var(--mono); cursor: pointer; z-index: 2; transition: border-color .2s, background .2s, box-shadow .2s; }
.like svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: transform .2s; }
.like:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), .12); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .1); }
.like.on { background: rgba(var(--accent-rgb), .16); border-color: var(--accent); }
.like.on svg { fill: currentColor; }
.like.pop svg { animation: likepop .45s ease; }
.like:disabled { cursor: wait; }
@keyframes likepop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
/* Nei box il pulsante sta sempre nell'angolo in basso a destra */
.card > .like { position: absolute; right: 18px; bottom: 18px; }
.card.has-like { padding-bottom: 72px; }
.proj .card-foot { min-height: 38px; padding-right: 96px; margin-bottom: -4px; }
.vid .card-foot { min-height: 38px; padding-right: 96px; }
.vid > .like { right: 16px; bottom: 16px; }
.skill-card .sk-name { min-width: 0; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }
.cert-body .card-foot { margin-top: 10px; }
.proj { position: relative; }
.stretch { color: inherit; text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.stretch:focus-visible { outline: none; }
.stretch:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-cta .like { padding: .55em .95em; }

/* ---------- Video ---------- */
.vid-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.vid { position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.vid-thumb { position: relative; aspect-ratio: 16/9; background: var(--bg2); border-bottom: 1px solid var(--line); overflow: hidden; }
.vid-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.vid:hover .vid-thumb img { transform: scale(1.04); }
.vid-ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; color: rgba(var(--accent-rgb), .5); }
.vid-play { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; display: grid; place-items: center; background: rgba(6,8,12,.7); border: 1px solid rgba(var(--accent-rgb), .5); backdrop-filter: blur(4px); transition: transform .2s; }
.vid-play svg { width: 22px; height: 22px; fill: var(--accent); margin-left: 3px; }
.vid:hover .vid-play { transform: scale(1.08); }
.vid-dur { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(6,8,12,.8); font-size: .72rem; }
.vid-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 16px; flex: 1; }
.vid-body h3 { font-size: 1.05rem; margin: 0; }
.vid-body p.small { color: var(--muted); margin: 0; }
.player { margin: 6px 0 18px; padding: 0; overflow: hidden; background: #000; }
.player video { display: block; width: 100%; max-height: 72vh; background: #000; }
.writeup { border-top: 1px solid var(--line); padding-top: 8px; }

/* ---------- Form ---------- */
.field-hint { color: var(--warn); font-size: .78rem; }

@media (max-width: 1080px) { .vid-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .vid-grid { grid-template-columns: 1fr; } }

/* Link invisibile agli utenti (non rimuovere) */
.hp-x { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
