:root {
  --font-main: "Inter", sans-serif;
  --font-heading: "Inter", sans-serif;

  --color-primary: #245cf6;
  --color-primary-dark: #1747c9;
  --color-text: #111827;
  --color-text-soft: #5b6474;
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-alt: #eef3fb;
  --color-page-alt: #f3f4f6;
  --color-border: #e6e8ee;
  --color-footer: #08132b;

  --shadow-card: 0 10px 24px rgba(17, 24, 39, 0.08);
  --radius-xl: 2rem;
  --radius-lg: 1.25rem;
  --radius-md: 1rem;
  --radius-sm: 0.75rem;

  --container: min(92%, 1600px);

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.25rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overscroll-behavior: none;
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  padding-top: 5rem;
  overflow-x: hidden;
  width: 100%;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.narrow-container {
  max-width: 68rem;
}

.logo {
  height: 30px;
  width: auto;
  object-fit: contain;
}

.brand-name,
.nav-link,
.btn,
.section-heading h2,
.section-heading h1,
.bio-content h2,
.timeline-text h3,
.activity-content h3,
.publication-content h3,
.value-card h3,
.footer-grid h3 {
  font-family: var(--font-heading);
}

/* ---------------- HEADER ---------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  margin: 0;
  padding: 1rem 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #23407e;
}

.brand-role {
  font-size: 1rem;
  color: var(--color-text-soft);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  font-size: 1rem;
  font-weight: 500;
  padding-bottom: 0.1rem;
}

.nav-link.active {
  font-weight: 700;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -3px;
  width: calc(100% + 12px);
  height: 2px;
  background: transparent;
  border-radius: 999px;
  transition: 0.2s;
}

.nav-link:hover::after {
  background: rgba(36, 92, 246, 0.4);
}

.nav-link.active::after {
  background: var(--color-primary);
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 0.25rem;
  cursor: pointer;
  width: 2.5rem;
  height: 2.5rem;
  position: relative;
  z-index: 1100;
}

.menu-toggle span {
  position: absolute;
  left: 50%;
  width: 1.5rem;
  height: 2px;
  background: var(--color-text);
  border-radius: 999px;
  transform: translateX(-50%);
  transition:
    transform 0.3s ease,
    opacity 0.25s ease,
    top 0.3s ease,
    bottom 0.3s ease;
}

.menu-toggle span:nth-child(1) {
  top: 0.72rem;
}

.menu-toggle span:nth-child(2) {
  top: 50%;
  transform: translate(-50%, -50%);
}

.menu-toggle span:nth-child(3) {
  bottom: 0.72rem;
}

.menu-toggle.active span:nth-child(1) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translate(-50%, -50%) scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
  bottom: auto;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border-radius: 0.9rem;
  border: 1px solid transparent;
  font-weight: 600;
  transition: 0.25s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

/* ---------------- PAGE HERO ---------------- */
.about-hero {
  padding: 0;
}

.about-hero-box {
  width: 100%;
  background: #eef3fb;
  text-align: center;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  margin-top: 0;
  padding: clamp(2rem, 4vw, 3.5rem) 0;
}

.about-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.about-hero-box h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
}

.about-hero-box p {
  max-width: 46rem;
  margin: 0 auto;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--color-text-soft);
}

/* ---------------- BIO ---------------- */
.bio-section {
  padding: 2rem 0 3rem;
}

.bio-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.35fr);
  gap: 3.5rem;
  align-items: start;
}

.bio-image-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.bio-image-circle {
  width: 100%;
  max-width: 400px;
  border-radius: 1rem;
  overflow: hidden;
  background: transparent;
}

.bio-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.bio-content h2 {
  margin: 0 0 1.2rem;
  font-size: clamp(2rem, 3vw, 3.1rem);
  font-weight: 800;
  line-height: 1.08;
}

.bio-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
  margin-top: 2rem;
  margin-bottom: 0.2rem;
}

.bio-content p {
  margin: 0 0 1.2rem;
  color: var(--color-text-soft);
  font-size: 1.03rem;
}

.bio-buttons {
  display: flex;
  gap: 0.8rem;
  margin-top: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.bio-buttons2 {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: white;
}

.bio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;

  padding: 0.6rem 9.35rem;   
  font-size: 1.1rem;        
  border-radius: 0.9rem;    
}

.bio-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bio-btn-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------------- SECTIONS ---------------- */
.section {
  padding: 4rem 0 5rem;
}

.section-alt {
  background: var(--color-page-alt);
}

.section-heading {
  text-align: center;
  margin-bottom: 2.8rem;
}

.section-badge {
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  background: #dfe9ff;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.section-badge svg {
  width: 1.8rem;
  height: 1.8rem;
}

.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin: 0 0 0.55rem;
  font-weight: 800;
  line-height: 1.1;
}

.section-heading p {
  max-width: 48rem;
  margin: 0 auto;
  color: var(--color-text-soft);
  font-size: 1.2rem;
}

/* ---------------- FORMAZIONE ---------------- */
.timeline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 1rem 1.25rem;
  max-width: 980px;
  margin: 0 auto;
}

.timeline-card {
  background: var(--color-surface);
  border: 1px solid rgba(230, 232, 238, 0.8);
  box-shadow: var(--shadow-card);
  border-radius: 1rem;
  padding: 1.2rem 1.1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
}

.timeline-card-wide {
  grid-column: 1 / -1;
  max-width: 460px;
  margin: 0 auto;
}

.timeline-year,
.publication-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  height: 2rem;
  padding: 0 0.7rem;
  border-radius: 0.45rem;
  background: var(--color-primary);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.timeline-text h3 {
  margin: 0 0 0.25rem;
  font-size: 1.08rem;
  font-weight: 600;
}

.timeline-text p {
  margin: 0.1rem 0;
  font-size: 0.94rem;
}

.timeline-link {
  color: var(--color-primary);
  font-weight: 500;
}

/* ---------------- ATTIVITA ---------------- */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.activity-card {
  background: var(--color-surface);
  border: 1px solid rgba(230, 232, 238, 0.8);
  box-shadow: var(--shadow-card);
  border-radius: 1rem;
  padding: 1.3rem 1.4rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  width: 100%;
}

.activity-year {
  display: inline-block;
  background: #F3F4F6;
  color: #4A5565;
  padding: 0.35rem 0.7rem;
  border-radius: 0.45rem;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.activity-content h3 {
  margin: 0 0 0.25rem;
  font-size: 1.08rem;
  font-weight: 600;
}

.activity-content p {
  margin: 0.12rem 0;
  font-size: 0.94rem;
}

/* ---------------- PUBBLICAZIONI ---------------- */
.publications-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10rem;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
}

.stats-column {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  align-items: center;
  justify-content: center;
  padding-top: 3rem;
}

.stat-box {
  text-align: center;
}

.stat-value {
  display: block;
  color: var(--color-primary);
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  display: block;
  color: var(--color-text-soft);
  font-weight: 800;
  line-height: 1;
}

.stat-value {
  font-size: clamp(2rem, 3vw, 3rem);
}

.stat-label {
  font-size: clamp(1.4rem, 2vw, 2rem);
  margin-top: 0.25rem;
}

.publication-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.publication-card {
  background: var(--color-surface);
  border: 1px solid rgba(230, 232, 238, 0.8);
  box-shadow: var(--shadow-card);
  border-radius: 1rem;
  padding: 1.2rem 1.1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
}

.publication-content h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.4;
}

.publication-authors {
  margin: 0.3rem 0 0;
  color: var(--color-text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.publication-link,
.inline-link {
  color: var(--color-primary);
  font-weight: 700;
}

.publication-link {
  display: inline-block;
  margin-top: 0.45rem;
}

.publication-note {
  text-align: center;
  color: var(--color-text-soft);
  font-size: 0.95rem;
  padding-left: 5.5%;
}

/* ---------------- VALORI ---------------- */
.values-section {
  padding-bottom: 4rem;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 920px;
  margin: 0 auto;
}

.value-card {
  background: var(--color-surface);
  border: 1px solid rgba(230, 232, 238, 0.8);
  box-shadow: var(--shadow-card);
  border-radius: 1rem;
  padding: 1.4rem 1.2rem;
  text-align: center;
}

.value-card h3 {
  margin: 0 0 0.6rem;
  color: var(--color-primary);
  font-size: 1.05rem;
  font-weight: 700;
}

.value-card p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 0.95rem;
}

/* ---------------- FOOTER ---------------- */
.site-footer {
  background: var(--color-footer);
  color: white;
  margin-top: 0;
  padding-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr;
  gap: 2rem;
}

.footer-grid h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.footer-grid p {
  margin: 0 0 0.55rem;
  color: rgba(255, 255, 255, 0.82);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 2rem;
  padding: 1.25rem 0;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.footer-social {
  margin-top: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  transition: 0.2s;
}

.social-link:hover {
  background: #0A66C2;
}

.social-icon {
  width: 1.2rem;
  height: 1.2rem;
}

.privacy-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
  font-size: 1.1rem;
  padding-bottom: 0.6rem;
}

.privacy-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ---------------- BACK TO TOP ---------------- */
#backToTop {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 999rem;
  background: var(--color-primary);
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    width 0.3s ease,
    opacity 0.3s ease,
    transform 0.3s ease,
    padding 0.3s ease;
  gap: 0;
}

#backToTop.show {
  opacity: 1;
  pointer-events: auto;
}

#backToTop:hover {
  width: 8rem;
  justify-content: flex-start;
  padding-left: 1rem;
  gap: 0.5rem;
}

.top-icon {
  width: 1.4rem;
  height: 1.4rem;
  flex: 0 0 auto;
  display: block;
  transform: translateY(-0.03rem);
}

.top-text {
  white-space: nowrap;
  font-weight: 600;
  line-height: 1;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-width 0.3s ease,
    opacity 0.2s ease;
}

#backToTop:hover .top-text {
  max-width: 5rem;
  opacity: 1;
}

/* ---------------- ANIMATIONS ---------------- */
.reveal {
  opacity: 0;
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  will-change: opacity, transform;
}

.reveal-up {
  transform: translateY(2rem);
}

.reveal-left {
  transform: translateX(-2rem);
}

.reveal-right {
  transform: translateX(2rem);
}

.reveal-hero {
  transform: translateY(1.5rem);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

.delay-1 {
  transition-delay: 0.1s;
}

.delay-2 {
  transition-delay: 0.2s;
}

.delay-3 {
  transition-delay: 0.3s;
}

.delay-4 {
  transition-delay: 0.4s;
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1100px) {
  .bio-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

    .bio-image-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
  }

  .bio-image-circle {
    width: min(62vw, 260px);
    max-width: none;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    background: #eaf1fb;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    border: 2px solid #e6e8ee;
  }

  .bio-image-secondary,
  .bio-buttons,
  .bio-buttons2 {
    display: none;
  }

  .bio-image {
    width: 90%;
    height: auto;
    max-width: none;
    object-fit: contain;
    object-position: center bottom;
    transform: translateY(60px);
  }

  .publications-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stats-column {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 0;
    margin-bottom: 0.25rem;
    align-items: start;
  }

  .stat-box {
    text-align: center;
  }

  .stat-value {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.95rem;
    margin-top: 0.15rem;
  }
}

@media (max-width: 860px) {
  body {
    padding-top: 4.5rem;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 5rem;
    right: 4%;
    left: 4%;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    z-index: 100;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.98);
    pointer-events: none;
    transition:
      opacity 0.28s ease,
      transform 0.28s ease,
      visibility 0.28s ease;
  }

  .main-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .main-nav ul,
  .main-nav .nav-cta {
    opacity: 0;
    transform: translateY(-6px);
    transition:
      opacity 0.22s ease,
      transform 0.22s ease;
  }

  .main-nav.open ul,
  .main-nav.open .nav-cta {
    opacity: 1;
    transform: translateY(0);
  }

  .main-nav.open ul {
    transition-delay: 0.05s;
  }

  .main-nav.open .nav-cta {
    transition-delay: 0.1s;
  }

  .main-nav li {
    width: 100%;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    font-size: 1.1rem;
    padding-bottom: 0.9rem;
  }

  .nav-link::after {
    content: none;
  }

  .nav-link.active {
    background: #eef4ff;
    color: var(--color-primary);
    font-weight: 600;
  }

  .nav-link:hover {
    background: #f5f8ff;
    color: var(--color-primary);
  }

  .nav-cta {
    width: 100%;
    margin-top: 0.75rem;
  }

  .timeline-card-wide {
    grid-column: auto;
    max-width: none;
    margin: 0;
    width: 100%;
  }

  .activity-year {
    display: inline-block;
    width: fit-content;
    max-width: max-content;
  }

  .timeline-grid,
  .values-grid {
    grid-template-columns: 1fr;
  }

  .timeline-card-wide {
    max-width: none;
  }

  .activity-card {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .value-card {
    text-align: start;
  }
}

@media (max-width: 640px) {
  .about-hero {
    padding: 0;
    margin: 0;
  }

  .about-hero-box {
    width: 100%;
    min-height: 220px;
    padding: 3rem 1rem;
    margin: 0;
  }

  .about-hero-content {
    width: 100%;
    padding: 0;
  }

  .about-hero-box h1 {
    font-size: 2.2rem;
  }

  .about-hero-box p {
    font-size: 1rem;
  }

  .bio-section,
  .section {
    padding: 3rem 0;
  }

  .bio-content h2,
  .section-heading h2 {
    font-size: 2rem;
  }

  .bio-content p,
  .section-heading p,
  .timeline-text p,
  .activity-content p,
  .publication-authors,
  .value-card p {
    font-size: 0.95rem;
  }

  .timeline-card,
  .publication-card {
    grid-template-columns: 1fr;
  }

  .timeline-grid {
    grid-template-columns: 1fr;
  }

  .timeline-card-wide {
    grid-column: auto;
    max-width: none;
    margin: 0;
    width: 100%;
  }

  .activity-year {
    display: inline-block;
    width: fit-content;
    max-width: max-content;
  }

  .timeline-year,
  .publication-year {
    width: fit-content;
  }

  .publications-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stats-column {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 0;
    margin-bottom: 0.25rem;
    align-items: start;
  }

  .stat-box {
    text-align: center;
  }

  .stat-value {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.95rem;
    margin-top: 0.15rem;
  }

  #backToTop {
    display: none;
  }
}