/* ===== Variables & Resets ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary-color: #1e3a8a;
  --secondary-color: #1e40af;
  --accent-color: #059669;
  --text-dark: #111827;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --bg-gray: #f3f4f6;
  --border-light: #e5e7eb;
  --border-gray: #d1d5db;
  --gradient-primary: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
  --gradient-accent: linear-gradient(135deg, #059669 0%, #047857 100%);
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  overflow-x: hidden;
  font-weight: 400;
  background: var(--bg-white);
}

/* ===== Navigation ===== */
.navbar {
  position: fixed; top: 0; width: 100%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--border-light);
}
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.25rem; font-weight: 600; color: var(--primary-color); letter-spacing: -0.025em; text-decoration: none; }
.nav-links { display: flex; list-style: none; gap: 2rem; }
.nav-links a { text-decoration: none; color: var(--text-dark); font-weight: 500; transition: all 0.3s ease; position: relative; }
.nav-links a:hover { color: var(--primary-color); }
.nav-links a::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px; background: var(--primary-color); transition: width 0.3s ease; }
.nav-links a:hover::after { width: 100%; }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
  display: flex; align-items: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url('data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><defs><pattern id=%22grid%22 width=%2220%22 height=%2220%22 patternUnits=%22userSpaceOnUse%22><path d=%22M 20 0 L 0 0 0 20%22 fill=%22none%22 stroke=%22rgba(255,255,255,0.05)%22 stroke-width=%220.5%22/></pattern></defs><rect width=%22100%25%22 height=%22100%25%22 fill=%22url(%23grid)%22/></svg>');
  opacity: 0.4;
}
.hero-content { max-width: 1200px; margin: 0 auto; padding: 0 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; position: relative; z-index: 1; }
.hero-text h1 { font-size: 3rem; font-weight: 600; color: #fff; margin-bottom: 1.5rem; line-height: 1.1; letter-spacing: -0.025em; }
.hero-text h1 .accent { color: #10b981; font-weight: 600; }
.hero-text p { font-size: 1.125rem; color: rgba(255,255,255,0.85); margin-bottom: 2.5rem; line-height: 1.7; max-width: 500px; }
.cta-buttons { display: flex; gap: 1rem; }
.btn { padding: 0.875rem 1.75rem; border: none; border-radius: 8px; font-weight: 500; text-decoration: none; transition: all 0.3s ease; cursor: pointer; display: inline-block; font-size: 0.95rem; letter-spacing: 0.025em; }
.btn-primary { background: var(--accent-color); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: #047857; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.4); }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); }

.hero-visual { display: flex; justify-content: center; align-items: center; }
.avatar-container { position: relative; width: 280px; height: 280px; }
.avatar { width: 100%; height: 100%; border-radius: 16px; background: linear-gradient(135deg, #374151 0%, #1f2937 100%); display: flex; align-items: center; justify-content: center; font-size: 4rem; color: #fff; font-weight: 600; box-shadow: var(--shadow-xl); border: 3px solid rgba(255,255,255,0.1); }
.floating-elements { position: absolute; inset: 0; }
.floating-element { position: absolute; width: 50px; height: 50px; background: rgba(255,255,255,0.08); border-radius: 8px; backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.6); font-size: 1.25rem; border: 1px solid rgba(255,255,255,0.1); animation: float 8s ease-in-out infinite; }
.floating-element:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.floating-element:nth-child(2) { top: 20%; right: 10%; animation-delay: 2s; }
.floating-element:nth-child(3) { bottom: 20%; left: 20%; animation-delay: 4s; }
.floating-element:nth-child(4) { bottom: 10%; right: 20%; animation-delay: 1s; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-20px) rotate(5deg); } }

/* ===== Sections ===== */
.section { padding: 5rem 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-title { font-size: 2.25rem; font-weight: 600; margin-bottom: 1rem; position: relative; display: inline-block; color: var(--text-dark); letter-spacing: -0.025em; }
.section-title::after { content: ''; position: absolute; bottom: -8px; left: 0; width: 40px; height: 3px; background: var(--accent-color); border-radius: 2px; }
.section-subtitle { font-size: 1.125rem; color: var(--text-light); max-width: 600px; margin: 0 auto; }

/* About */
.about { background: var(--bg-light); }
.about-content { display: grid; grid-template-columns: 1fr 2fr; gap: 4rem; align-items: center; }
.about-card { background: var(--bg-white); padding: 2rem; border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--border-light); transition: transform 0.3s ease; }
.about-card:hover { transform: translateY(-2px); }
.about-card h3 { font-size: 1.25rem; margin-bottom: 1rem; color: var(--primary-color); font-weight: 600; }
.about-text p { margin-bottom: 1.5rem; font-size: 1.1rem; line-height: 1.7; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 2rem; }
.stat-item { text-align: center; padding: 1.5rem; background: var(--bg-white); border-radius: 12px; box-shadow: var(--shadow-md); border: 1px solid var(--border-light); }
.stat-number { font-size: 1.875rem; font-weight: 600; color: var(--primary-color); display: block; }
.stat-label { color: var(--text-light); font-size: 0.875rem; font-weight: 500; }

/* Research */
.research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; }
.research-card { background: var(--bg-white); padding: 2rem; border-radius: 12px; box-shadow: var(--shadow-md); border: 1px solid var(--border-light); transition: all 0.3s ease; position: relative; overflow: hidden; }
.research-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent-color); }
.research-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }
.research-icon { width: 56px; height: 56px; background: var(--bg-gray); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-size: 1.25rem; margin-bottom: 1.5rem; border: 1px solid var(--border-gray); }
.research-card h3 { font-size: 1.125rem; margin-bottom: 1rem; color: var(--text-dark); font-weight: 600; }
.research-card p { color: var(--text-light); line-height: 1.6; }

/* Publications */
.publications { background: var(--bg-light); }
.publication-item { background: var(--bg-white); padding: 1.75rem; border-radius: 12px; margin-bottom: 1rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); transition: all 0.3s ease; border-left: 4px solid var(--accent-color); }
.publication-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.publication-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; }
.publication-content h3 { font-size: 1.125rem; margin-bottom: 0.5rem; color: var(--text-dark); font-weight: 600; line-height: 1.4; }
.publication-authors { color: var(--text-light); font-size: 0.925rem; margin-bottom: 0.5rem; }
.publication-venue { color: var(--primary-color); font-weight: 500; font-size: 0.875rem; }
.publication-year { background: var(--primary-color); color: #fff; padding: 0.375rem 0.75rem; border-radius: 6px; font-weight: 500; font-size: 0.875rem; min-width: 50px; text-align: center; }

/* Contact */
.contact { background: var(--gradient-primary); color: #fff; }
.contact-content { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.contact-info h3 { font-size: 1.875rem; margin-bottom: 1rem; font-weight: 600; }
.contact-info p { font-size: 1rem; margin-bottom: 2rem; opacity: 0.9; line-height: 1.6; }
.contact-links { display: flex; gap: 1rem; }
.contact-link { width: 48px; height: 48px; background: rgba(255,255,255,0.1); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; font-size: 1.125rem; transition: all 0.3s ease; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); }
.contact-link:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
.contact-form { background: rgba(255,255,255,0.08); padding: 2rem; border-radius: 12px; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.form-group input, .form-group textarea { width: 100%; padding: 1rem; border: none; border-radius: 10px; background: rgba(255,255,255,0.9); color: var(--text-dark); font-size: 1rem; }
.form-group textarea { resize: vertical; min-height: 120px; }

/* Floating Add button */
.add-publication { position: fixed; bottom: 2rem; right: 2rem; width: 56px; height: 56px; background: var(--accent-color); border: none; border-radius: 50%; color: #fff; font-size: 1.25rem; cursor: pointer; box-shadow: var(--shadow-lg); transition: all 0.3s ease; z-index: 999; }
.add-publication:hover { transform: scale(1.05); box-shadow: var(--shadow-xl); }

/* Utilities */
.fade-in { opacity: 0; transform: translateY(30px); animation: fadeIn 0.6s ease forwards; }
@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-content { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
  .hero-text h1 { font-size: 2.5rem; }
  .about-content, .contact-content { grid-template-columns: 1fr; gap: 2rem; }
  .stats { grid-template-columns: 1fr; }
  .research-grid { grid-template-columns: 1fr; }
  .cta-buttons { flex-direction: column; align-items: center; }
}


/* ===== Specials (Workshops & Special Issues) ===== */
.specials { background: var(--bg-white); }
.specials-controls { display: flex; gap: .5rem; justify-content: center; margin-bottom: 2rem; }
.specials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.special-card { background: var(--bg-white); padding: 1.25rem; border: 1px solid var(--border-light); border-radius: 12px; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.special-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.special-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.special-title { font-weight: 600; line-height: 1.4; margin-bottom: .25rem; }
.special-venue { color: var(--primary-color); font-weight: 500; font-size: 0.9rem; }
.special-year { background: var(--bg-gray); border: 1px solid var(--border-gray); font-size: .85rem; padding: .2rem .5rem; border-radius: 6px; }
.role-badge { display: inline-block; font-size: .8rem; padding: .2rem .5rem; border-radius: 999px; border: 1px solid var(--border-light); color: var(--text-light); background: var(--bg-light); margin-left: .5rem; }
.special-actions { margin-top: .75rem; }
.special-actions a { text-decoration: none; }



/* ===== Publications: Horizontal Scroll ===== */
.publications-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.pub-controls {
  display: flex;
  gap: .5rem;
}

.pub-btn {
  padding: .6rem .9rem;
  border: 1px solid var(--border-light);
  background: var(--bg-white);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-weight: 500;
}
.pub-btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.pub-scroller-wrap {
  position: relative;
  mask-image: linear-gradient(to right, transparent 0, black 24px, black calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 24px, black calc(100% - 24px), transparent 100%);
}

.pub-scroller {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: .5rem;
  scrollbar-width: thin;
}
.pub-scroller::-webkit-scrollbar { height: 8px; }
.pub-scroller::-webkit-scrollbar-thumb { background: var(--border-gray); border-radius: 999px; }

.publication-item {
  flex: 0 0 360px;
  scroll-snap-align: start;
  min-height: 160px;
}

@media (max-width: 480px) {
  .publication-item { flex-basis: 85%; }
}

/* Year chips */
.pub-year-chips {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
}
.pub-chip {
  padding: .35rem .7rem; border: 1px solid var(--border-light);
  border-radius: 999px; background: var(--bg-light); cursor: pointer; font-size: .9rem;
}
.pub-chip.active { background: var(--accent-color); color: #fff; border-color: transparent; }


.hero-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}


.hero-visual .hero-image {
  width: 260px;        /* aumenta la dimensione */
  height: auto;        /* proporzioni naturali */
  border-radius: 12px; /* angoli morbidi, non più cerchio */
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.site-footer {
  background: var(--bg-gray, #f3f4f6);
  color: var(--text-dark, #111);
  padding: 2rem 1rem;
  text-align: center;
  margin-top: 3rem;
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0 0 0.75rem;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.footer-socials .social-icon {
  width: 28px;
  height: 28px;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.footer-socials .social-icon:hover {
  filter: none;
}
.logo img {
  height: 48px;   /* regola a piacere */
  width: auto;
  display: block;
}

.publication-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* spinge giù l'ultimo blocco */
}

.publication-content {
  flex-grow: 1;
  margin-bottom: 1rem;
}

.publication-actions {
  margin-top: auto;
}

/* Allinea i bottoni in basso e uniforma l'altezza visiva delle card */
.publication-item {
  display: flex;
  flex-direction: column;
}
.publication-meta { display: flex; flex-direction: column; height: 100%; }
.publication-content { flex: 1 1 auto; }
.publication-actions { margin-top: auto; padding-top: .5rem; }


/* Hobbies: rifiniture */
#hobbies .icon-cube {
  width: 24px;
  height: 24px;
  margin-right: .5rem;
  vertical-align: -4px; /* allinea con il testo del titolo */
}

#hobbies .hobbies-text {
  max-width: 60ch;
  margin: 0 auto;
  text-align: center;
}


.twitter-box {
  max-width: 600px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}