/* ========================================================================
   Alessandro Muscolino — design system
   ======================================================================== */

:root {
  --bg: #f6f7fb;
  --bg-alt: #eef0f6;
  --surface: #ffffff;
  --surface-hover: #f2f4f9;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.15);
  --text: #14171f;
  --text-dim: #555e72;
  --text-faint: #8891a4;
  --accent: #6d5efc;
  --accent-2: #0891b2;
  --accent-3: #db2777;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --gradient-warm: linear-gradient(135deg, var(--accent-3), var(--accent));
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 30px -16px rgba(15, 23, 42, 0.16);
  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
}

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

::selection {
  background: var(--accent);
  color: #fff;
}

/* background ambience -------------------------------------------------- */

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 15% 10%, rgba(109, 94, 252, 0.12), transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(8, 145, 178, 0.10), transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(219, 39, 119, 0.07), transparent 50%),
    var(--bg);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 90%);
}

/* header ----------------------------------------------------------------*/

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background 0.3s var(--ease), padding 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  padding: 12px 0;
  background: rgba(246, 247, 251, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  white-space: nowrap;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  object-fit: contain;
  padding: 4px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  position: relative;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.25s ease, background 0.25s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-links a.active {
  color: var(--text);
  background: var(--surface);
}

.nav-cta {
  background: var(--gradient) !important;
  color: #0a0c11 !important;
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

/* buttons ---------------------------------------------------------------*/

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  transition: transform 0.3s var(--ease), border-color 0.3s ease, background 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--gradient);
  color: #0a0c11;
  border: none;
}

.btn-primary:hover {
  box-shadow: 0 12px 30px -8px rgba(109, 94, 252, 0.45);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease);
}

.btn:hover svg {
  transform: translateX(3px);
}

/* hero --------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
}

.hero .container {
  display: grid;
  gap: 32px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-dim);
  width: fit-content;
}

.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 12px var(--accent);
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  max-width: 16ch;
}

.hero h1 .grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-dim);
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hero .tag-row {
  margin-top: 40px;
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-cue .stick {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--text-faint), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-cue .stick::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(var(--accent-2), transparent);
  animation: scrollcue 1.8s ease-in-out infinite;
}

@keyframes scrollcue {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}

/* sections ------------------------------------------------------------ */

section {
  position: relative;
  padding: 110px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-tag {
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  display: block;
}

.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 16px;
}

.section-head p {
  color: var(--text-dim);
  font-size: 1.05rem;
}

/* reveal animations ----------------------------------------------------*/

[data-reveal] {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}

[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="scale"] {
  transform: translateY(24px) scale(0.94);
}

[data-reveal="scale"].in-view {
  transform: translateY(0) scale(1);
}

[data-reveal="left"] {
  transform: translateX(-48px);
}

[data-reveal="left"].in-view {
  transform: translateX(0);
}

[data-reveal="right"] {
  transform: translateX(48px);
}

[data-reveal="right"].in-view {
  transform: translateX(0);
}

/* about ------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: start;
}

.avatar-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-logo {
  width: 46%;
  z-index: 1;
  filter: drop-shadow(0 8px 20px rgba(15, 23, 42, 0.12));
}

.avatar-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent, rgba(109, 94, 252, 0.16), transparent 30%);
  animation: spin 9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.about-body p {
  color: var(--text-dim);
  margin-bottom: 18px;
  font-size: 1.02rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.tag {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* course cards ---------------------------------------------------------*/

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.course-card {
  position: relative;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform 0.4s var(--ease), border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}

.course-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 24px 40px -18px rgba(15, 23, 42, 0.22);
}

.course-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: #0a0c11;
}

.course-icon svg {
  width: 26px;
  height: 26px;
}

.course-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.course-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.course-meta span {
  font-size: 0.75rem;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.035);
  color: var(--text-faint);
  border: 1px solid var(--border);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-2);
}

.card-link svg {
  width: 15px;
  height: 15px;
  transition: transform 0.3s var(--ease);
}

.course-card:hover .card-link svg {
  transform: translateX(4px);
}

.badge-soon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(219, 39, 119, 0.1);
  color: var(--accent-3);
  border: 1px solid rgba(219, 39, 119, 0.28);
  z-index: 2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* publications ----------------------------------------------------------*/

.pub-list {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  background: var(--surface);
}

.pub-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-item:hover {
  background: var(--surface-hover);
}

.pub-year {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: var(--accent-2);
  font-size: 1.05rem;
}

.pub-title {
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.pub-authors {
  font-size: 0.82rem;
  color: var(--text-faint);
}

.pub-link {
  font-size: 0.85rem;
  color: var(--text-dim);
  white-space: nowrap;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.pub-link:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

/* quote ------------------------------------------------------------- */

.quote-section {
  text-align: center;
  padding: 100px 0;
}

.quote-section blockquote {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  max-width: 18ch;
  margin: 0 auto 20px;
  line-height: 1.3;
}

.quote-section cite {
  color: var(--text-faint);
  font-style: normal;
  font-size: 0.9rem;
}

/* contact / footer -------------------------------------------------------*/

.cta-band {
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.1), rgba(8, 145, 178, 0.08));
  border: 1px solid var(--border);
  padding: 64px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.cta-band h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  max-width: 20ch;
}

.social-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.social-row a {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease), border-color 0.3s ease, color 0.3s ease;
  color: var(--text-dim);
}

.social-row a:hover {
  transform: translateY(-4px);
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.social-row svg {
  width: 19px;
  height: 19px;
}

.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.85rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* page hero (corsi-scuola) ----------------------------------------------*/

.page-hero {
  padding: 150px 0 30px;
}

.page-hero + section {
  padding-top: 30px;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  max-width: 20ch;
}

.page-hero p {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 60ch;
  margin-top: 18px;
}

.notice-box {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  background: rgba(8, 145, 178, 0.07);
  border: 1px solid rgba(8, 145, 178, 0.22);
  max-width: 640px;
}

.notice-box svg {
  width: 20px;
  height: 20px;
  color: var(--accent-2);
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-box p {
  font-size: 0.92rem;
  color: var(--text-dim);
  margin: 0;
}

.track-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 64px 0 32px;
  color: var(--text-faint);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.container > .track-divider:first-child {
  margin-top: 0;
}

.track-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* uda (dettaglio corso) --------------------------------------------------*/

.uda-grid {
  margin-bottom: 48px;
}

.uda-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.uda-card-head h3 {
  font-size: 1.15rem;
}

.uda-ore-badge {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(109, 94, 252, 0.1);
  color: var(--accent);
}

.uda-card strong {
  color: var(--text);
}

.uda-topics {
  list-style: none;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.uda-topics a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  margin-inline: -12px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.uda-topics a:hover,
.uda-topics a:focus-visible {
  background: var(--surface-hover);
  color: var(--accent-2);
}

.topic-name {
  flex: 1;
  min-width: 0;
}

.topic-arrow {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform 0.3s var(--ease), color 0.2s ease;
}

.uda-topics a:hover .topic-arrow {
  transform: translateX(4px);
  color: var(--accent-2);
}

.topic-track {
  flex-shrink: 0;
  font-size: 0.68rem;
  padding: 2px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.topic-track-tecnico {
  background: rgba(8, 145, 178, 0.1);
  color: var(--accent-2);
}

.topic-track-professionale {
  background: rgba(219, 39, 119, 0.1);
  color: var(--accent-3);
}

/* lezione (dettaglio argomento) -------------------------------------------*/

.lesson-breadcrumb {
  color: var(--text-faint);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.lesson-breadcrumb a {
  color: var(--accent-2);
}

/* pager argomento precedente/successivo ----------------------------------*/

.lesson-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.lesson-pager-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease), border-color 0.3s ease;
  min-width: 0;
}

.lesson-pager-link:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.lesson-pager-link.course {
  grid-column: 2;
  justify-content: center;
  text-align: center;
  padding: 16px 20px;
  white-space: nowrap;
}

.lesson-pager-link.next {
  grid-column: 3;
  justify-content: flex-end;
  text-align: right;
}

.lesson-pager-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent-2);
}

.lesson-pager-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lesson-pager-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.lesson-pager-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .lesson-pager {
    grid-template-columns: 1fr;
  }
  .lesson-pager-link.course {
    grid-column: 1;
  }
  .lesson-pager-link.next {
    grid-column: 1;
  }
}

.lesson-body {
  max-width: 760px;
}

.lesson-text {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 22px;
  line-height: 1.75;
}

.lesson-text strong,
.lesson-list strong {
  color: var(--text);
  font-weight: 700;
}

.lesson-list {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 22px;
  line-height: 1.7;
  padding-left: 22px;
}

.lesson-list li {
  margin-bottom: 8px;
}

.lesson-list li::marker {
  color: var(--accent-2);
}

.concept-map {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 32px;
  overflow-x: auto;
}

.concept-map svg {
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.focus-box {
  background: rgba(109, 94, 252, 0.06);
  border: 1px solid rgba(109, 94, 252, 0.2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.focus-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.focus-box h4 {
  font-size: 1rem;
  margin-bottom: 10px;
  line-height: 1.4;
}

.focus-box p {
  font-size: 0.94rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.curiosita-box {
  background: rgba(219, 39, 119, 0.06);
  border: 1px solid rgba(219, 39, 119, 0.2);
  border-left: 3px solid var(--accent-3);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.curiosita-box .focus-label {
  color: var(--accent-3);
}

.curiosita-box h4 {
  font-size: 1rem;
  margin-bottom: 10px;
  line-height: 1.4;
}

.curiosita-box p {
  font-size: 0.94rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.lesson-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.lesson-figure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 28px;
  max-width: 520px;
  margin-inline: auto;
}

.lesson-images .lesson-figure {
  max-width: none;
  margin-bottom: 0;
}

.lesson-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.lesson-figure figcaption {
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.video-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 28px;
  max-width: 520px;
  margin-inline: auto;
  transition: transform 0.3s var(--ease), border-color 0.3s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.video-thumb {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-alt);
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  color: #fff;
  font-size: 0.9rem;
}

.video-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.video-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-3);
}

.video-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.img-credit {
  display: block;
  color: var(--text-faint);
  font-size: 0.74rem;
  margin-top: 2px;
}

/* attività pratica ------------------------------------------------------*/

.activity-box {
  background: rgba(8, 145, 178, 0.05);
  border: 1px solid rgba(8, 145, 178, 0.2);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.activity-duration {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-faint);
  white-space: nowrap;
}

.activity-box h4 {
  font-size: 1rem;
  margin: 0 0 10px;
  line-height: 1.4;
}

.activity-box p {
  font-size: 0.94rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* gioco riordina ---------------------------------------------------------*/

.reorder-game {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px;
  margin-bottom: 32px;
}

.reorder-game h4 {
  font-size: 1.05rem;
  margin: 10px 0 8px;
  line-height: 1.4;
}

.reorder-hint {
  font-size: 0.88rem;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.reorder-list {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.reorder-list li {
  counter-increment: step;
  cursor: pointer;
  user-select: none;
  background: var(--surface-hover);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px 12px 42px;
  position: relative;
  font-size: 0.94rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.reorder-list li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reorder-list li:hover {
  border-color: var(--border-strong);
}

.reorder-list li.selected {
  border-color: var(--accent);
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(109, 94, 252, 0.15);
}

.reorder-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.reorder-actions .btn {
  margin-top: 0;
}

.reorder-feedback {
  margin-top: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  min-height: 1.3em;
}

.reorder-feedback.ok {
  color: #0a8a52;
}

.reorder-feedback.ko {
  color: var(--accent-3);
}

.exercises-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px;
  margin-bottom: 32px;
}

.exercises-block h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.exercise-item {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}

.exercise-item:first-of-type {
  border-top: none;
  padding-top: 0;
}

.exercise-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
}

.exercise-item summary::-webkit-details-marker {
  display: none;
}

.exercise-item summary::before {
  content: "▸ ";
  color: var(--accent-2);
}

.exercise-item[open] summary::before {
  content: "▾ ";
}

.exercise-item p {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 0.92rem;
  padding-left: 18px;
}

/* responsive ------------------------------------------------------------*/

@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .avatar-card {
    max-width: 260px;
    margin: 0 auto;
  }
  .nav-links {
    position: fixed;
    top: 74px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px;
    gap: 4px;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s var(--ease), opacity 0.3s ease;
  }
  .nav-links.open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a {
    text-align: center;
    padding: 13px 16px;
  }
  .nav-toggle {
    display: flex;
  }
  .pub-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .pub-link {
    width: fit-content;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  [data-reveal] {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .avatar-card::before,
  .scroll-cue .stick::after {
    animation: none;
  }
}
