/* Variabili di base */
:root {
  --bg: #0f172a;
  --bg-light: #111827;
  --bg-section-gray: #0b1220;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.1);
  --border: #1f2937;
  --radius: 12px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.9);
}

/* Reset veloce */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1f2937 0, #020617 45%, #000 100%);
  color: var(--text);
  line-height: 1.6;
}

/* Contenitore */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.7), transparent);
  border-bottom: 1px solid rgba(31, 41, 55, 0.8);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Logo */
.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

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

/* Nav */
.nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav__link {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s ease;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav__link:hover {
  color: var(--text);
}

.nav__link:hover::after {
  width: 100%;
}

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 4rem 0 3rem;
}

.hero__content {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 2.5rem;
  align-items: center;
}

.hero__subtitle {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero__title {
  font-size: clamp(2.1rem, 4vw, 2.8rem);
  margin: 0 0 0.75rem;
}

.hero__title span {
  color: var(--accent);
}

.hero__description {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Hero image */
.hero__image {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.2), rgba(15, 23, 42, 0.9));
  border-radius: 999px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-soft);
}

.hero__avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  font-weight: 600;
  color: var(--text);
  background: radial-gradient(circle at 30% 0, #38bdf8, #0f172a);
}

.hero__image-caption {
  margin-top: 1rem;
  font-size: 0.75rem;
  text-align: center;
  color: var(--muted);
}

/* Bottoni */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.1s ease, box-shadow 0.1s ease;
}

.btn--primary {
  background: var(--accent);
  color: #0b1120;
  box-shadow: 0 14px 35px rgba(56, 189, 248, 0.35);
}

.btn--primary:hover {
  background: #0ea5e9;
  transform: translateY(-1px);
  box-shadow: 0 20px 45px rgba(56, 189, 248, 0.45);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.6);
}

.btn--ghost:hover {
  border-color: var(--accent);
  background: rgba(15, 23, 42, 0.8);
}

/* Sezioni */
.section {
  padding: 3rem 0;
}

.section--gray {
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #000 100%);
}

.section__title {
  font-size: 1.6rem;
  margin: 0 0 0.25rem;
}

.section__subtitle {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* About */
.about {
  background: rgba(15, 23, 42, 0.85);
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  font-size: 0.95rem;
}

/* Progetti */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.project-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.project-card__text {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.project-card__link {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--accent);
}

/* Form contatti */
.contact-form {
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.form-field label {
  color: var(--muted);
}

.form-field input,
.form-field textarea {
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.form-message {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  padding: 1.5rem 0 2rem;
  border-top: 1px solid rgba(31, 41, 55, 0.8);
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* Responsivo */
@media (max-width: 768px) {
  .hero__content {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero__image {
    order: -1;
    max-width: 260px;
    margin: 0 auto 1.5rem;
  }

  .header-content {
    height: 56px;
  }

  .nav {
    position: absolute;
    top: 56px;
    right: 0;
    left: 0;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.98);
    padding: 0.75rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  .nav--open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle {
    display: block;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
