/* Stile comune alle pagine del portfolio. Tema scuro predefinito; il chiaro con
   <html data-theme="light"> (lo imposta tema.js in base alla scelta salvata). */
:root {
  --bg: #121418;
  --text: #e9e7e2;
  --muted: #9ba1ab;
  --line: #2a2e35;
  --accent: #8fb0f0;
  --accent-soft: #1c2433;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fbfaf7;
  --text: #1d1f23;
  --muted: #5f6570;
  --line: #e3e0d8;
  --accent: #2b4a8d;
  --accent-soft: #e8edf7;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
}
@media (prefers-reduced-motion: reduce) { body { transition: none; } }

/* Barra in alto: lingua e tema */
.barra {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1.5rem 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  font-size: .85rem;
}
.lingue { display: flex; gap: .25rem; }
/* Le pagine contengono entrambe le lingue: si vede solo quella di <html lang> */
html[lang="en"] [data-l="it"], html[lang="it"] [data-l="en"] { display: none; }
.lingue a {
  padding: .2rem .5rem;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--muted);
}
.lingue a:hover, .lingue a:focus-visible { color: var(--text); text-decoration: none; }
.lingue a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.tema {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tema:hover, .tema:focus-visible { color: var(--text); border-color: var(--muted); }
.tema svg { width: 1rem; height: 1rem; }
/* Mostra l'icona del tema in cui si passerà */
.tema .sole { display: block; }
.tema .luna { display: none; }
:root[data-theme="light"] .tema .sole { display: none; }
:root[data-theme="light"] .tema .luna { display: block; }

main {
  flex: 1;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 14vh 1.5rem 3rem;
}
.stato {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.stato::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: currentColor;
  animation: pulsa 2s ease-in-out infinite;
}
@keyframes pulsa { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .stato::before { animation: none; } }
h1 {
  margin: 1.25rem 0 .25rem;
  font: 400 clamp(2.2rem, 7vw, 3.2rem)/1.1 Georgia, "Times New Roman", serif;
  letter-spacing: -.01em;
}
.ruolo { margin: 0 0 2rem; color: var(--muted); font-size: 1.1rem; }
p { margin: 0 0 1rem; }
ul.link {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.75rem;
}
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
ul.link a { font-weight: 600; }
ul.link a::after { content: " →"; }
footer {
  max-width: 40rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  color: var(--muted);
  font-size: .85rem;
}
