/* ==========================================================================
   Pasquale Pio Gagliano Pisa - tema personalizzato
   --------------------------------------------------------------------------
   Tutto il colore, il tipo e la forma passano dalle variabili --bs-* di
   Bootstrap 5.3: cosi restano modificabili dal pannello Theme di Bootstrap
   Studio, con valori indipendenti per modalita chiara e scura.
   Non scrivere colori letterali fuori da questi due blocchi: un colore
   scritto a mano resta chiaro quando si passa al tema scuro.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tema chiaro (valori di base)
   -------------------------------------------------------------------------- */
:root {
  /* Verde del brand, versione accessibile su fondo chiaro.
     #2fbf71 su bianco dava 2,24:1 (sotto il minimo WCAG di 4,5:1):
     questo verde piu profondo arriva a 5,0:1 mantenendo la stessa identita. */
  --bs-primary: #127a44;
  --bs-primary-rgb: 18, 122, 68;
  --bs-secondary: #1f6feb;
  --bs-secondary-rgb: 31, 111, 235;

  --bs-body-bg: #ffffff;
  /* Bootstrap calcola gli sfondi semitrasparenti dal triplo rgb, non dall'hex:
     se si cambia --bs-body-bg senza cambiare anche questo, barra laterale e
     barra superiore restano del colore di serie invece che del nostro. */
  --bs-body-bg-rgb: 255, 255, 255;
  --bs-body-color: #1b2027;
  --bs-body-color-rgb: 27, 32, 39;
  --bs-emphasis-color-rgb: 10, 13, 18;
  --bs-emphasis-color: #0a0d12;
  --bs-secondary-color: rgba(27, 32, 39, 0.72);
  --bs-border-color: #dfe4e8;

  /* Tipografia: due famiglie reali, niente stack di sistema. */
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-size: 1.0625rem;
  --bs-body-line-height: 1.7;
  --bs-heading-color: var(--bs-emphasis-color);

  /* Forma: raggio piu generoso del 0.375rem di serie. */
  --bs-border-radius: 0.75rem;
  --bs-border-radius-sm: 0.5rem;
  --bs-border-radius-lg: 1.25rem;
  --bs-border-radius-xl: 1.75rem;

  --bs-link-color: var(--bs-primary);
  --bs-link-color-rgb: var(--bs-primary-rgb);
  --bs-link-hover-color: #0d5c33;
  --bs-link-hover-color-rgb: 13, 92, 51;

  /* Token del progetto, non di Bootstrap. */
  --pg-display-font: "Space Grotesk", "Inter", system-ui, sans-serif;
  --pg-mono-font: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --pg-surface: #f5f8f6;
  --pg-surface-2: #eef3f0;
  --pg-accent-glow: rgba(18, 122, 68, 0.14);
  --pg-shadow: 0 18px 45px rgba(15, 26, 20, 0.09);
  --pg-shadow-strong: 0 26px 60px rgba(15, 26, 20, 0.16);
  --pg-section-y: clamp(3.5rem, 8vw, 7rem);
  --pg-sidebar-w: 250px;
  --pg-topbar-h: 4rem;
  --pg-sidebar-bg: #f2f5f3;
  /* Testo che va sopra il verde pieno (pulsanti, badge). */
  --pg-on-primary: #ffffff;
  /* Testo verde su superfici gia velate di verde: il primary normale si
     ferma a 4,17:1 su quel fondo, questo arriva a 6,2:1. */
  --pg-on-tint: #0d5c33;
}

/* --------------------------------------------------------------------------
   2. Tema scuro
   Solo i valori che cambiano. La meccanica dell'attributo data-bs-theme e
   nativa di Bootstrap Studio: qui si dichiarano soltanto i colori.
   -------------------------------------------------------------------------- */
[data-bs-theme="dark"] {
  /* Su fondo scuro il verde acceso originale arriva a 8,2:1: si puo tenere. */
  --bs-primary: #2fbf71;
  --bs-primary-rgb: 47, 191, 113;
  --bs-secondary: #5aa2ff;
  --bs-secondary-rgb: 90, 162, 255;

  --bs-body-bg: #0b0d12;
  --bs-body-bg-rgb: 11, 13, 18;
  --bs-body-color: #e6e9ef;
  --bs-body-color-rgb: 230, 233, 239;
  --bs-emphasis-color-rgb: 255, 255, 255;
  --bs-emphasis-color: #ffffff;
  --bs-secondary-color: rgba(230, 233, 239, 0.72);
  --bs-border-color: #232a35;

  --bs-link-hover-color: #6fe1a3;
  --bs-link-hover-color-rgb: 111, 225, 163;

  --pg-surface: #12161d;
  --pg-surface-2: #171d26;
  --pg-sidebar-bg: #0a0c11;
  --pg-accent-glow: rgba(47, 191, 113, 0.16);
  --pg-shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
  --pg-shadow-strong: 0 26px 60px rgba(0, 0, 0, 0.55);
  /* Testo scuro sul verde acceso: 8:1, contro il 2,38:1 del bianco. */
  --pg-on-primary: #06170e;
  --pg-on-tint: #6fe1a3;
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */
body {
  -webkit-font-smoothing: antialiased;
  /* NON mettere overflow-x: hidden qui. Bootstrap decide il root
     dell'IntersectionObserver dello Scrollspy leggendo overflow-y del body:
     se non e "visible" usa il body come root, tutte le sezioni risultano
     sempre visibili insieme e la voce attiva del menu resta ferma su Home.
     Se serve contenere uno sbordamento orizzontale, mettilo su .page-shell. */
  overflow: visible;
}

h1, h2, h3, .display-1, .display-2, .display-3, .display-4 {
  font-family: var(--pg-display-font);
  font-weight: 600;
  letter-spacing: -0.025em;
}

h4, h5, h6 {
  font-family: var(--pg-display-font);
  font-weight: 600;
  letter-spacing: -0.012em;
}

.lead {
  font-size: 1.15rem;
  color: var(--bs-secondary-color);
}

:focus-visible {
  outline: 3px solid var(--bs-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.btn:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.35);
}

/* Ritmo verticale variabile: non tutte le fasce hanno la stessa altezza. */
.section-lead { padding-block: var(--pg-section-y); }
.section-dense { padding-block: calc(var(--pg-section-y) * 0.6); }

.section-surface { background-color: var(--pg-surface); }

.section-heading {
  margin-bottom: 2.75rem;
}

.section-heading__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--pg-mono-font);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bs-primary);
  margin-bottom: 0.75rem;
}

.section-heading__eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background-color: currentColor;
}

.section-heading__title {
  font-size: clamp(2rem, 4.2vw, 3rem);
  margin-bottom: 0.75rem;
}

.section-heading__text {
  max-width: 46rem;
  color: var(--bs-secondary-color);
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   4. Pulsanti
   -------------------------------------------------------------------------- */
.btn {
  --bs-btn-padding-x: 1.6rem;
  --bs-btn-padding-y: 0.72rem;
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: var(--bs-border-radius);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, color 0.22s ease;
}

.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-color: var(--pg-on-primary);
  --bs-btn-hover-bg: var(--bs-link-hover-color);
  --bs-btn-hover-border-color: var(--bs-link-hover-color);
  --bs-btn-hover-color: var(--pg-on-primary);
  --bs-btn-active-bg: var(--bs-link-hover-color);
  --bs-btn-active-border-color: var(--bs-link-hover-color);
  --bs-btn-active-color: var(--pg-on-primary);
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
  --bs-btn-disabled-color: var(--pg-on-primary);
}

.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-hover-color: var(--pg-on-primary);
  --bs-btn-active-bg: var(--bs-primary);
  --bs-btn-active-border-color: var(--bs-primary);
  --bs-btn-active-color: var(--pg-on-primary);
}

.btn-primary:hover,
.btn-outline-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(var(--bs-primary-rgb), 0.28);
}

/* --------------------------------------------------------------------------
   5. Barra laterale e barra superiore
   La struttura e l'Offcanvas responsive di Bootstrap: sopra 1200px resta
   fissa a sinistra come nel sito originale, sotto scorre dentro da sinistra.
   -------------------------------------------------------------------------- */
.site-topbar {
  min-height: var(--pg-topbar-h);
  background-color: rgba(var(--bs-body-bg-rgb), 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--bs-border-color);
}

.site-topbar .navbar-brand,
.site-sidebar__name {
  font-family: var(--pg-display-font);
}

.site-topbar .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--bs-emphasis-color);
}

.site-brand__logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #ffffff;
  padding: 3px;
  object-fit: contain;
}

.navbar-toggler {
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.3);
}

.site-sidebar {
  --bs-offcanvas-width: 280px;
  --bs-offcanvas-bg: var(--pg-sidebar-bg);
  --bs-offcanvas-border-color: var(--bs-border-color);
}

.site-sidebar .offcanvas-body {
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Testata: la macchia verde arrotondata con il logo sopra, come nell'originale */
.site-sidebar__top {
  position: relative;
  text-align: center;
  padding: 2.25rem 1.25rem 1.5rem;
}

.site-sidebar__top::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -18%;
  right: -18%;
  height: 190px;
  border-radius: 50%;
  background-color: var(--bs-primary);
  opacity: 0.92;
}

.site-sidebar__badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background-color: #ffffff;
  padding: 0.6rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.site-sidebar__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.site-sidebar__name {
  position: relative;
  margin: 1.1rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bs-emphasis-color);
}

.site-sidebar__menu {
  flex-direction: column;
  gap: 0;
  padding: 0.5rem 0;
  margin-bottom: auto;
}

.site-sidebar__menu .nav-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bs-body-color);
  border-left: 3px solid transparent;
  transition: background-color 0.24s ease, color 0.24s ease, border-color 0.24s ease;
}

.site-sidebar__menu .nav-link i {
  width: 1.1rem;
  text-align: center;
  font-size: 0.95rem;
}

.site-sidebar__menu .nav-link:hover,
.site-sidebar__menu .nav-link:focus-visible {
  color: var(--pg-on-tint);
  background-color: rgba(var(--bs-primary-rgb), 0.08);
}

/* Sul fondo gia velato di verde serve il verde piu profondo: quello normale
   si ferma a 4,19:1, sotto il minimo WCAG di 4,5:1. */
.site-sidebar__menu .nav-link.active {
  color: var(--pg-on-tint);
  background-color: rgba(var(--bs-primary-rgb), 0.12);
  border-left-color: var(--bs-primary);
}

.site-sidebar__foot {
  padding: 1.25rem 1.25rem 1.75rem;
  border-top: 1px solid var(--bs-border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.site-sidebar__tools {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
}

/* Selettore lingua: la lingua parte da sola da quella del browser, questa
   fila serve solo a forzarla a mano. Deve restare defilata, non un pulsante
   che compete con il menu. */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.lang-switch__btn {
  border: 0;
  background: none;
  padding: 0.2rem 0.4rem;
  border-radius: 0.35rem;
  font-family: var(--pg-mono-font);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--bs-secondary-color);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.lang-switch__btn:hover {
  color: var(--pg-on-tint);
  background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.lang-switch__btn.is-active {
  color: var(--pg-on-tint);
  background-color: rgba(var(--bs-primary-rgb), 0.14);
}

.theme-switch {
  border: 0;
  background: none;
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  color: var(--bs-secondary-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.theme-switch span {
  font-family: var(--pg-mono-font);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
}

.theme-switch:hover {
  color: var(--pg-on-tint);
  background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.site-sidebar__foot .social-links a {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 0.875rem;
}

/* Da 1200px in su la barra resta fissa e il contenuto le lascia spazio. */
@media (min-width: 1200px) {
  .site-sidebar {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--pg-sidebar-w);
    z-index: 1030;
    background-color: var(--pg-sidebar-bg) !important;
    border-right: 1px solid var(--bs-border-color);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
  }

  .site-sidebar .offcanvas-body {
    flex-grow: 1;
    min-height: 100%;
    background-color: transparent !important;
  }

  .page-shell {
    margin-left: var(--pg-sidebar-w);
  }
}

/* Sotto i 1200px c'e la barra superiore fissa: il contenuto le lascia spazio. */
@media (max-width: 1199.98px) {
  body {
    padding-top: var(--pg-topbar-h);
  }
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 6rem);
  overflow: hidden;
}

/* Griglia tecnica di sfondo: e il fondale del blocco, non un livello fisso
   a tutto schermo, cosi non costringe il browser a ridisegnare a ogni frame. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(var(--bs-primary-rgb), 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--bs-primary-rgb), 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%);
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.hero__eyebrow {
  font-family: var(--pg-mono-font);
  font-size: 0.875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bs-primary);
  margin-bottom: 1rem;
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.04;
  margin-bottom: 1rem;
}

.hero__role {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.hero__role-typed {
  color: var(--bs-primary);
  font-family: var(--pg-mono-font);
  font-weight: 600;
}

.hero__role-typed::after {
  content: "|";
  margin-left: 2px;
  animation: pgCaret 1s steps(2, end) infinite;
}

.hero__text {
  max-width: 34rem;
  color: var(--bs-secondary-color);
  margin-bottom: 1.75rem;
}

/* Elemento firma: la console che scrive da sola. */
.hero-console {
  font-family: var(--pg-mono-font);
  font-size: 0.875rem;
  background-color: var(--pg-surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  padding: 1.1rem 1.25rem;
  max-width: 34rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--pg-shadow);
}

.hero-console__bar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.hero-console__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--bs-border-color);
}

.hero-console__dot:first-child { background-color: #e06c75; }
.hero-console__dot:nth-child(2) { background-color: #e5c07b; }
.hero-console__dot:nth-child(3) { background-color: var(--bs-primary); }

.hero-console__line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  color: var(--bs-body-color);
}

.hero-console__line + .hero-console__line { margin-top: 0.35rem; }

.hero-console__line > span { color: var(--bs-primary); font-weight: 600; }

.hero__media {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero__media img {
  max-width: min(420px, 100%);
  border-radius: var(--bs-border-radius-xl);
  background-color: #ffffff;
  padding: 1.25rem;
  box-shadow: var(--pg-shadow-strong);
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.hero__badge {
  font-family: var(--pg-mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  background-color: var(--pg-surface);
  color: var(--bs-secondary-color);
}

/* --------------------------------------------------------------------------
   7. Numeri
   -------------------------------------------------------------------------- */
.stat {
  text-align: left;
}

.stat__value {
  display: block;
  font-family: var(--pg-display-font);
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1;
  color: var(--bs-primary);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  display: block;
  font-size: 0.9375rem;
  color: var(--bs-secondary-color);
  margin-top: 0.4rem;
}

/* --------------------------------------------------------------------------
   8. Card servizi e punti di forza
   -------------------------------------------------------------------------- */
.card {
  --bs-card-bg: var(--pg-surface);
  --bs-card-border-color: var(--bs-border-color);
  --bs-card-border-radius: var(--bs-border-radius-lg);
  --bs-card-inner-border-radius: var(--bs-border-radius);
  --bs-card-spacer-x: 1.6rem;
  --bs-card-spacer-y: 1.6rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card:hover,
.strength-card:hover,
.project-card:hover,
.resume-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--pg-shadow);
  border-color: rgba(var(--bs-primary-rgb), 0.4);
}

.service-card__icon,
.resume-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: var(--bs-primary);
  color: var(--pg-on-primary);
  font-size: 1.35rem;
  margin-bottom: 1.1rem;
}

.strength-card__avatar {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: var(--bs-border-radius);
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  padding: 0.35rem;
}

/* --------------------------------------------------------------------------
   9. Portfolio
   -------------------------------------------------------------------------- */
.portfolio-filter {
  --bs-nav-pills-border-radius: 999px;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.portfolio-filter .nav-link {
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  color: var(--bs-body-color);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 1.15rem;
  transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.portfolio-filter .nav-link:hover {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}

.portfolio-filter .nav-link.active {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: var(--pg-on-primary);
}

.project-card {
  overflow: hidden;
}

.project-card__media {
  position: relative;
  overflow: hidden;
  border-top-left-radius: var(--bs-card-border-radius);
  border-top-right-radius: var(--bs-card-border-radius);
  background-color: var(--pg-surface-2);
}

.project-card__media img {
  width: 100%;
  height: 15rem;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* Foto, grafica e riprese drone: l'immagine intera dentro una cornice, senza
   tagli, con lo sfondo che ne riprende il colore. */
.project-card--visual .project-card__media img {
  object-fit: contain;
  background-color: var(--pg-surface-2);
}

.project-card:hover .project-card__media img {
  transform: scale(1.05);
}

.project-card__tag {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  font-family: var(--pg-mono-font);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background-color: var(--bs-primary);
  color: var(--pg-on-primary);
  font-weight: 600;
}

.project-card__count {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-family: var(--pg-mono-font);
  font-size: 0.6875rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background-color: rgba(11, 13, 18, 0.78);
  color: #ffffff;
  font-weight: 600;
}

.project-card__kicker {
  font-family: var(--pg-mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bs-primary);
  margin-bottom: 0.35rem;
  display: block;
}

.project-card .card-text {
  font-size: 0.9375rem;
  color: var(--bs-secondary-color);
}

.project-card .card-footer {
  background-color: transparent;
  border-top: 1px solid var(--bs-border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-private {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
  padding-block: 0.4rem;
}

/* Elemento nascosto dal filtro categorie. */
.is-filtered-out { display: none; }

/* Galleria dentro il modale */
.gallery-modal .modal-content {
  background-color: var(--pg-surface);
}

.gallery-modal .carousel-item img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background-color: var(--pg-surface-2);
}

.gallery-modal .carousel-control-prev-icon,
.gallery-modal .carousel-control-next-icon {
  background-color: rgba(11, 13, 18, 0.6);
  border-radius: 50%;
  padding: 1.35rem;
  background-size: 45%;
}

/* --------------------------------------------------------------------------
   10. Curriculum
   -------------------------------------------------------------------------- */
.resume-card__period {
  font-family: var(--pg-mono-font);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--bs-primary);
  display: block;
  margin-bottom: 0.35rem;
}

.resume-card__org {
  font-size: 0.9375rem;
  color: var(--bs-secondary-color);
  display: block;
  margin-bottom: 0.75rem;
}

.resume-card__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background-color: rgba(var(--bs-primary-rgb), 0.14);
  color: var(--pg-on-tint);
  margin-bottom: 0.85rem;
}

.skill-row + .skill-row { margin-top: 1.1rem; }

.skill-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.skill-row__head span:last-child {
  font-family: var(--pg-mono-font);
  font-size: 0.8125rem;
  color: var(--bs-primary);
}

.progress {
  --bs-progress-bg: var(--pg-surface-2);
  --bs-progress-height: 0.5rem;
  --bs-progress-border-radius: 999px;
}

.progress-bar {
  background-color: var(--bs-primary);
}

/* --------------------------------------------------------------------------
   11. Contatti e footer
   -------------------------------------------------------------------------- */
.contact-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding-block: 0.7rem;
}

.contact-list li + li { border-top: 1px solid var(--bs-border-color); }

.contact-list i {
  color: var(--bs-primary);
  width: 1.35rem;
  text-align: center;
  margin-top: 0.2rem;
}

.contact-note {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background-color: rgba(var(--bs-primary-rgb), 0.09);
  border: 1px solid rgba(var(--bs-primary-rgb), 0.3);
  border-radius: var(--bs-border-radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.75rem;
}

.contact-note i {
  color: var(--bs-primary);
  font-size: 1.25rem;
  margin-top: 0.15rem;
}

.contact-note p {
  margin-bottom: 0;
  font-size: 0.9375rem;
  color: var(--bs-secondary-color);
}

.form-control,
.form-select {
  --bs-border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  background-color: var(--bs-body-bg);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.2);
}

.form-label {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.4rem;
}

.site-footer {
  background-color: var(--pg-surface);
  border-top: 1px solid var(--bs-border-color);
  padding-block: 3rem 2rem;
}

.site-footer a {
  color: var(--bs-body-color);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--bs-primary);
  text-decoration: underline;
}

.site-footer__legal {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

.social-links {
  display: flex;
  gap: 0.6rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.social-links a:hover {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: var(--pg-on-primary);
  transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   12. Azioni flottanti
   Su schermo stretto scendono in orizzontale in basso a destra, cosi non
   coprono piu i pulsanti dentro le card del portfolio.
   -------------------------------------------------------------------------- */
.floating-actions {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.floating-actions .btn {
  --bs-btn-padding-x: 0;
  --bs-btn-padding-y: 0;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: var(--pg-shadow);
}

.btn-whatsapp {
  --bs-btn-bg: #1c8c46;
  --bs-btn-border-color: #1c8c46;
  --bs-btn-color: #ffffff;
  --bs-btn-hover-bg: #146633;
  --bs-btn-hover-border-color: #146633;
  --bs-btn-hover-color: #ffffff;
}

[data-bs-theme="dark"] .btn-whatsapp {
  --bs-btn-bg: #25d366;
  --bs-btn-border-color: #25d366;
  --bs-btn-color: #06170e;
  --bs-btn-hover-bg: #1ebe5d;
  --bs-btn-hover-border-color: #1ebe5d;
  --bs-btn-hover-color: #06170e;
}

/* --------------------------------------------------------------------------
   13. Pagine legali
   -------------------------------------------------------------------------- */
.legal-page h2 {
  font-size: 1.35rem;
  color: var(--bs-primary);
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.legal-page h2:first-of-type { margin-top: 0; }

.legal-page p,
.legal-page li { color: var(--bs-secondary-color); }

/* --------------------------------------------------------------------------
   14. Animazioni
   -------------------------------------------------------------------------- */
@keyframes pgCaret {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes pgFadeUp {
  from { opacity: 0; transform: translateY(1.25rem); }
  to { opacity: 1; transform: none; }
}

/* Entrata dell'hero: parte subito, senza ritardare il primo testo utile. */
.hero__eyebrow,
.hero__title,
.hero__role,
.hero__text,
.hero-console,
.hero__actions,
.hero__badges {
  animation: pgFadeUp 0.7s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.hero__title { animation-delay: 0.06s; }
.hero__role { animation-delay: 0.12s; }
.hero__text { animation-delay: 0.18s; }
.hero-console { animation-delay: 0.24s; }
.hero__actions { animation-delay: 0.3s; }
.hero__badges { animation-delay: 0.36s; }

/* Coppie candidate per le View Transitions tra pagine. */
.site-brand__logo,
.site-sidebar__logo { view-transition-name: pg-logo; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   15. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .hero__media { margin-top: 2.5rem; }
  .hero__media img { max-width: min(320px, 80%); }
}

@media (max-width: 575.98px) {
  .floating-actions {
    flex-direction: row;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .floating-actions .btn {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1rem;
  }

  .project-card__media img { height: 12.5rem; }
}

/* --------------------------------------------------------------------------
   16. Larghezza delle barre competenze
   Espressa con un attributo data-width invece che con style inline: resta
   modificabile dal pannello Attributi di Bootstrap Studio e non viene
   segnalata da Check for Issues.
   -------------------------------------------------------------------------- */
.progress-bar[data-width="65"] { width: 65%; }
.progress-bar[data-width="70"] { width: 70%; }
.progress-bar[data-width="80"] { width: 80%; }
.progress-bar[data-width="82"] { width: 82%; }
.progress-bar[data-width="85"] { width: 85%; }
.progress-bar[data-width="88"] { width: 88%; }
.progress-bar[data-width="95"] { width: 95%; }

/* Sopra i 1200px non c'e barra fissa in alto, sotto si: le ancore si fermano
   comunque sotto la barra superiore invece di finirci dietro. */
.hero,
.section-lead,
.section-dense {
  scroll-margin-top: 1.5rem;
}

@media (max-width: 1199.98px) {
  .hero,
  .section-lead,
  .section-dense {
    scroll-margin-top: calc(var(--pg-topbar-h) + 1rem);
  }
}


/* --------------------------------------------------------------------------
   17. Animazioni particolari
   Quattro momenti, non uno sparso ovunque: la console che si scrive da sola
   nell'hero, il logo che respira, il bagliore che segue il cursore sulle card
   e le barre delle competenze che si riempiono quando entrano in pagina.
   -------------------------------------------------------------------------- */

/* La console dell'hero si scrive riga per riga */
.hero-console__line.is-typing::after {
  content: "";
  display: inline-block;
  width: 0.5ch;
  height: 1em;
  margin-left: 1px;
  background-color: var(--bs-primary);
  vertical-align: -0.12em;
  animation: pgCaret 0.9s steps(2, end) infinite;
}

/* Il logo respira piano, solo sopra i 992px per non pesare sul telefono */
@media (min-width: 992px) and (prefers-reduced-motion: no-preference) {
  .hero__media img {
    animation: pgFluttua 7s ease-in-out infinite;
  }

  .site-sidebar__badge {
    animation: pgFluttua 6s ease-in-out infinite;
  }
}

@keyframes pgFluttua {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

/* Bagliore che segue il cursore sulle card di testo */
.service-card,
.strength-card,
.resume-card {
  position: relative;
  isolation: isolate;
}

.service-card::after,
.strength-card::after,
.resume-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
              rgba(var(--bs-primary-rgb), 0.16), transparent 65%);
}

.service-card:hover::after,
.strength-card:hover::after,
.resume-card:hover::after {
  opacity: 1;
}

/* Le barre delle competenze partono da zero e si riempiono quando entrano
   in pagina: la larghezza finale resta quella dell'attributo data-width. */
.progress-bar {
  transition: width 1.1s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.progress:not(.is-in-view) .progress-bar {
  width: 0 !important;
}

/* L'anello verde attorno al logo della barra laterale pulsa piano */
.site-sidebar__badge::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(var(--bs-primary-rgb), 0.45);
  animation: pgAnello 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pgAnello {
  0%, 100% { opacity: 0.2; transform: scale(0.94); }
  50% { opacity: 0.75; transform: scale(1.06); }
}

/* La freccia "torna su" compare solo dopo che si e scesi un po' */
.floating-actions .btn-torna-su {
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

body.has-scrolled .floating-actions .btn-torna-su {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   18. Domande frequenti
   Le intestazioni sono domande vere: e la forma che i motori di ricerca e gli
   assistenti AI riprendono piu volentieri nelle risposte.
   -------------------------------------------------------------------------- */
.accordion {
  --bs-accordion-bg: transparent;
  --bs-accordion-border-color: var(--bs-border-color);
  --bs-accordion-border-radius: var(--bs-border-radius-lg);
  --bs-accordion-inner-border-radius: var(--bs-border-radius);
  --bs-accordion-btn-color: var(--bs-emphasis-color);
  --bs-accordion-btn-bg: var(--pg-surface);
  --bs-accordion-active-color: var(--pg-on-tint);
  --bs-accordion-active-bg: rgba(var(--bs-primary-rgb), 0.1);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
  --bs-accordion-body-padding-y: 1.25rem;
}

.faq-item {
  margin-bottom: 0.75rem;
  border-radius: var(--bs-border-radius-lg);
  overflow: hidden;
}

.accordion-button {
  font-family: var(--pg-display-font);
  font-weight: 600;
  font-size: 1.0625rem;
  padding-block: 1.15rem;
}

.accordion-button:not(.collapsed) {
  box-shadow: none;
}

/* La freccia di serie e un'immagine con il blu Bootstrap dentro: va rifatta
   con il verde del sito, altrimenti resta l'unico pezzo di stock nella pagina. */
.accordion-button::after {
  background-image: none;
  content: "\f078";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.8rem;
  color: var(--bs-primary);
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.accordion-body {
  color: var(--bs-secondary-color);
  background-color: var(--pg-surface);
}

/* Il primo paragrafo di "Chi sono" e scritto per essere citabile: si legge
   come una risposta autoconclusiva, quindi merita un po' piu di respiro. */
.lead-answer {
  font-size: 1.0625rem;
  line-height: 1.75;
}

/* --------------------------------------------------------------------------
   19. Barra informativa cookie
   Il sito non carica risorse di terze parti e non profila nessuno: la barra
   informa, non chiede un consenso che non serve. Per questo ha un solo
   pulsante e non blocca la lettura della pagina.
   -------------------------------------------------------------------------- */
.cookie-bar {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1040;
  max-width: 46rem;
  margin-inline: auto;
  background-color: var(--pg-surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--pg-shadow-strong);
  padding: 1.1rem 1.25rem;
  animation: pgFadeUp 0.5s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.cookie-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.cookie-bar__text {
  flex: 1 1 22rem;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--bs-secondary-color);
}

.cookie-bar__text a {
  color: var(--pg-on-tint);
  text-decoration: underline;
}

.cookie-bar__actions {
  flex: 0 0 auto;
}

/* Con la barra aperta i pulsanti flottanti salgono. L'altezza della barra
   cambia con la lunghezza del testo e con la lingua, quindi la misura lo
   script e la scrive in --pg-cookie-h: indovinarla a mano non funziona. */
body.has-cookie-bar .floating-actions {
  bottom: calc(var(--pg-cookie-h, 7rem) + 1.75rem);
}
