@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-700.woff2") format("woff2");
}

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e7e5e4;
  --accent: #4f46e5;
  --accent-contrast: #ffffff;
  --radius: 14px;
  --maxw: 760px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: rgba(0, 0, 0, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f10;
    --surface: #1a1a1c;
    --text: #f5f5f4;
    --muted: #9ca3af;
    --border: #2a2a2e;
    --accent: #818cf8;
    --accent-contrast: #0f0f10;
    --shadow: rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero */
.hero { padding: 96px 0 48px; }
.name {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.role {
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 600;
  margin: 4px 0 20px;
}
.bio {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 28px;
}

.contacts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 0;
  margin: 0;
}
.contact {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.contact:hover { color: var(--accent); border-color: var(--accent); }
.contact:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Progetti */
#progetti { padding: 24px 0 64px; }
.section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 20px;
}
.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 640px) {
  .projects { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px -12px var(--shadow);
}
.card-title { font-size: 1.25rem; margin: 0 0 8px; }
.card-desc { color: var(--muted); margin: 0 0 16px; flex: 1; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 18px; }
.tag {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}

.button {
  align-self: flex-start;
  background: var(--accent);
  color: var(--accent-contrast);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 10px;
  transition: opacity 0.15s ease;
}
.button:hover { opacity: 0.9; }
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.badge {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 6px 14px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
