/* =========================================================
   Nicolò Iacobone — sito personale
   Tema chiaro di default, dark mode via [data-theme="dark"]
   ========================================================= */

/* ---------- Design tokens (light) ---------- */
:root {
  --bg:            #ffffff;
  --bg-alt:        #f6f7f9;
  --bg-elev:       #ffffff;
  --bg-inset:      #f1f3f6;
  --text:          #14181f;
  --text-soft:     #4c5566;
  --text-faint:    #7b8598;
  --line:          #e3e7ed;
  --line-strong:   #cfd6e0;
  --accent:        #2f5bd8;
  --accent-soft:   #eaf0ff;
  --accent-text:   #23459f;
  --accent-2:      #0d9488;
  --shadow-sm:     0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md:     0 4px 10px rgba(16, 24, 40, .05), 0 12px 28px rgba(16, 24, 40, .07);
  --shadow-lg:     0 12px 24px rgba(16, 24, 40, .07), 0 32px 64px rgba(16, 24, 40, .10);
  --nav-bg:        rgba(255, 255, 255, .78);
  --glow-1:        rgba(47, 91, 216, .13);
  --glow-2:        rgba(13, 148, 136, .10);
  --map-land:      #e4e9f0;
  --map-line:      #ffffff;
  --map-visited:   #3f9e68;
  --map-lived:     #dd8a22;
  --radius:        14px;
  --radius-lg:     20px;
  --wrap:          1120px;
  --font-sans:     "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display:  "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono:     "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Design tokens (dark) ---------- */
[data-theme="dark"] {
  --bg:            #0e1118;
  --bg-alt:        #131826;
  --bg-elev:       #171d2b;
  --bg-inset:      #1c2333;
  --text:          #eef1f7;
  --text-soft:     #aab4c6;
  --text-faint:    #7c879b;
  --line:          #262e40;
  --line-strong:   #35405a;
  --accent:        #7ea2ff;
  --accent-soft:   #1b2545;
  --accent-text:   #a8c0ff;
  --accent-2:      #4fd1c5;
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md:     0 4px 10px rgba(0, 0, 0, .35), 0 12px 28px rgba(0, 0, 0, .38);
  --shadow-lg:     0 12px 24px rgba(0, 0, 0, .4), 0 32px 64px rgba(0, 0, 0, .45);
  --nav-bg:        rgba(14, 17, 24, .78);
  --map-land:      #232b3d;
  --map-line:      #0e1118;
  --map-visited:   #4cb87c;
  --map-lived:     #eda344;
  --glow-1:        rgba(126, 162, 255, .16);
  --glow-2:        rgba(79, 209, 197, .10);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}

img { max-width: 100%; height: auto; display: block; }
/* deve battere le regole display delle classi (es. .card__figure{display:grid}) */
[hidden] { display: none !important; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0; }
button { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }
.mono { font-family: var(--font-mono); font-size: .82em; letter-spacing: -.01em; }

.icon {
  width: 1.15em; height: 1.15em;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff;
  padding: 12px 20px; border-radius: 0 0 10px 0; text-decoration: none; font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s cubic-bezier(.22,.61,.36,1) var(--d, 0ms),
              transform .6s cubic-bezier(.22,.61,.36,1) var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* =========================================================
   NAVBAR
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.nav.is-stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.nav__inner {
  width: 100%; max-width: var(--wrap); margin-inline: auto;
  padding: 12px 22px;
  display: flex; align-items: center; gap: 18px;
}

.nav__brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 650; letter-spacing: -.015em;
  margin-right: auto; white-space: nowrap;
}
.nav__mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: 0; flex: none;
}
[data-theme="dark"] .nav__mark { color: #0e1118; }

.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  position: relative;
  padding: 8px 13px; border-radius: 9px;
  text-decoration: none; font-size: 14.5px; font-weight: 500;
  color: var(--text-soft);
  transition: color .18s ease, background-color .18s ease;
}
.nav__links a:hover { color: var(--text); background: var(--bg-inset); }
.nav__links a.is-active { color: var(--accent-text); background: var(--accent-soft); }

.nav__tools { display: flex; align-items: center; gap: 8px; }

.langswitch {
  display: flex; padding: 3px; gap: 2px;
  background: var(--bg-inset); border: 1px solid var(--line); border-radius: 10px;
}
.langswitch__btn {
  border: 0; background: none; cursor: pointer;
  padding: 4px 10px; border-radius: 7px;
  font-size: 12.5px; font-weight: 650; letter-spacing: .03em;
  color: var(--text-faint);
  transition: color .18s ease, background-color .18s ease;
}
.langswitch__btn:hover { color: var(--text); }
.langswitch__btn[aria-pressed="true"] {
  background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm);
}

.iconbtn {
  display: grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-elev); cursor: pointer;
  color: var(--text-soft); font-size: 17px;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.iconbtn:hover { color: var(--text); border-color: var(--line-strong); }

/* sole/luna: mostra solo quella pertinente */
.icon--moon { display: none; }
[data-theme="dark"] .icon--sun { display: none; }
[data-theme="dark"] .icon--moon { display: block; }

.navtoggle { display: none; }
.navtoggle .icon path { transition: transform .25s ease, opacity .2s ease; transform-origin: 50% 50%; }
.navtoggle[aria-expanded="true"] .navtoggle__top { transform: translateY(5px) rotate(45deg); }
.navtoggle[aria-expanded="true"] .navtoggle__mid { opacity: 0; }
.navtoggle[aria-expanded="true"] .navtoggle__bot { transform: translateY(-5px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero { position: relative; padding: clamp(44px, 7vw, 92px) 0 clamp(44px, 6vw, 76px); overflow: hidden; }
.hero__glow {
  position: absolute; inset: -30% -10% auto -10%; height: 620px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(46% 52% at 22% 42%, var(--glow-1), transparent 70%),
    radial-gradient(40% 48% at 78% 30%, var(--glow-2), transparent 72%);
  filter: blur(6px);
}

.hero__grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.35fr .85fr;
  gap: clamp(32px, 5vw, 64px); align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 11px; margin-bottom: 20px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 550; color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 22%, transparent);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6.4vw, 4.1rem);
  font-weight: 600; letter-spacing: -.035em; line-height: 1.02;
}
.hero__role {
  margin-top: 12px;
  font-size: clamp(1.02rem, 2.1vw, 1.3rem); font-weight: 600;
  color: var(--accent-text); letter-spacing: -.012em;
}
.hero__tag {
  margin-top: 18px; max-width: 54ch;
  font-size: clamp(1rem, 1.6vw, 1.09rem); color: var(--text-soft);
}

.hero__facts {
  display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 24px;
  font-size: 14.5px; color: var(--text-soft);
}
.hero__facts li { display: flex; align-items: center; gap: 8px; }
.hero__facts .icon { color: var(--text-faint); }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: 11px;
  text-decoration: none; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  background: var(--accent); color: #fff; box-shadow: var(--shadow-md);
}
[data-theme="dark"] .btn--primary { color: #0b0f18; }
.btn--primary:hover { box-shadow: var(--shadow-lg); }
.btn--ghost {
  background: var(--bg-elev); color: var(--text);
  border-color: var(--line-strong); box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-text); }

.hero__photo { position: relative; margin: 0; justify-self: center; width: 100%; max-width: 330px; }
.hero__photo img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 22%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.hero__photo::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; z-index: -1;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: .16;
}
.hero__photocaption {
  position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%);
  white-space: nowrap;
  padding: 7px 14px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--line);
  box-shadow: var(--shadow-md); color: var(--text-soft);
}

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: clamp(56px, 8vw, 100px) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

.section__head { max-width: 62ch; margin-bottom: clamp(30px, 4vw, 48px); }
.section__kicker {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text);
  margin-bottom: 12px;
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 600; letter-spacing: -.03em;
}
.section__lead { margin-top: 14px; color: var(--text-soft); font-size: 1.03rem; }

.subhead {
  font-size: 13px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint);
  margin: clamp(36px, 5vw, 54px) 0 20px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.subhead:first-of-type { margin-top: 0; }

/* ---------- Chi sono ---------- */
.about__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.about__prose p + p { margin-top: 16px; }
.about__prose p { color: var(--text-soft); font-size: 1.04rem; }
.about__prose p:first-child { color: var(--text); font-size: 1.12rem; }

.about__stats { display: grid; gap: 12px; }
.stat {
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.stat__num {
  display: block;
  font-family: var(--font-display); font-size: 1.85rem; font-weight: 600;
  color: var(--accent-text); letter-spacing: -.03em; line-height: 1.1;
}
.stat__den { font-size: .55em; color: var(--text-faint); }
.stat__label { display: block; margin-top: 4px; font-size: 14px; color: var(--text-soft); line-height: 1.5; }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: grid; gap: 20px; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 12px; bottom: 12px; width: 2px;
  background: linear-gradient(var(--accent), var(--line));
  opacity: .45; border-radius: 2px;
}
.tl { position: relative; }
.tl__marker {
  position: absolute; left: -26px; top: 24px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg-alt);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.tl__card {
  padding: 22px 24px; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.tl__card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.tl__date { color: var(--text-faint); letter-spacing: .02em; }
.tl__role { margin-top: 6px; font-size: 1.16rem; font-weight: 650; }
.tl__org { margin-top: 3px; font-size: 14.5px; color: var(--text-soft); }
.tl__topic {
  margin-top: 12px; padding: 9px 13px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 14.5px; font-weight: 550; font-style: italic;
}
.tl__list { margin-top: 14px; display: grid; gap: 9px; }
.tl__list li {
  position: relative; padding-left: 20px;
  font-size: 15px; color: var(--text-soft); line-height: 1.6;
}
.tl__list li::before {
  content: ""; position: absolute; left: 4px; top: .62em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .55;
}
.tl__links, .card__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.linkpill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--bg);
  font-size: 13.5px; font-weight: 550; text-decoration: none; color: var(--text-soft);
  transition: color .18s ease, border-color .18s ease, background-color .18s ease, transform .18s ease;
}
a.linkpill:hover {
  color: var(--accent-text); border-color: var(--accent);
  background: var(--accent-soft); transform: translateY(-1px);
}
.linkpill--static { cursor: default; color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 18px; }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  display: flex; flex-direction: column;
  padding: 24px; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card__date { color: var(--text-faint); margin-bottom: 6px; }
.card__title { font-size: 1.1rem; font-weight: 650; letter-spacing: -.018em; }
.card__sub { margin-top: 4px; font-size: 14.5px; color: var(--accent-text); font-weight: 550; }
.card__body { margin-top: 11px; font-size: 15px; color: var(--text-soft); }
.card__links { margin-top: auto; padding-top: 16px; }

/* card "oltre la ricerca" */
.card--fun { padding-top: 26px; }
.card--fun .card__body { flex: 1; }
.card__icon {
  display: grid; place-items: center;
  width: 46px; height: 46px; margin-bottom: 16px; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent-text); font-size: 22px;
}
.card__icon--juggle .icon circle { animation: bob 2.8s ease-in-out infinite; }
.card__icon--juggle .icon circle:nth-child(2) { animation-delay: .35s; }
.card__icon--juggle .icon circle:nth-child(3) { animation-delay: .7s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }

.card__figure {
  margin: 0 0 16px; display: grid; place-items: center;
  padding: 14px; border-radius: 13px;
  background: radial-gradient(circle at 50% 40%, var(--accent-soft), var(--bg-inset));
  border: 1px solid var(--line);
}
.card__figure img {
  width: 118px; height: auto;
  filter: drop-shadow(0 8px 18px rgba(16, 24, 40, .22));
  animation: float 5.5s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-7px) rotate(1deg); } }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.skillgroup {
  padding: 20px 22px; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.skillgroup__name {
  font-size: 12.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 13px;
}
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
  padding: 5px 12px; border-radius: 8px;
  background: var(--bg-inset); border: 1px solid var(--line);
  font-size: 13.2px; font-weight: 500; color: var(--text-soft);
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.tags li:hover { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Contatti ---------- */
.contact__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.contactcard {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 14px; row-gap: 2px; align-items: center;
  padding: 20px 22px; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.contactcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.contactcard .icon {
  grid-row: 1 / 3; width: 34px; height: 34px; padding: 7px;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-text);
  stroke-width: 1.6;
}
.contactcard__label { font-size: 12px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); }
.contactcard__value { font-size: 14.8px; font-weight: 550; color: var(--text); word-break: break-word; }
.contactcard--cv { background: var(--accent-soft); border-color: var(--accent); grid-column: span 2; }
.contactcard--cv .icon { background: var(--accent); color: #fff; }
[data-theme="dark"] .contactcard--cv .icon { color: #0e1118; }

/* ---------- Footer ---------- */
.footer { padding: 30px 0 40px; border-top: 1px solid var(--line); background: var(--bg); }
.footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  font-size: 13.8px; color: var(--text-faint);
}
.footer__note { margin-right: auto; }
.footer__top { text-decoration: none; font-weight: 550; transition: color .18s ease; }
.footer__top:hover { color: var(--accent-text); }

/* ---------- Card larga: galleria pesca ---------- */
.card--wide { grid-column: span 2; }

.card__gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.card__shot { margin: 0; }
.card__shot img {
  width: 100%; height: 210px; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-inset);
}
.card__shot:first-child img { object-position: center 62%; }
.card__shot figcaption {
  margin-top: 7px; font-size: 12.8px; color: var(--text-faint); text-align: center;
}

/* ---------- Locandina film ---------- */
.card__figure--poster { padding: 0; background: none; border: 0; }
.card__figure--poster img {
  width: 100%; max-height: 240px; object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 10px 22px rgba(16, 24, 40, .2));
  animation: none;
}

/* ---------- Mappa dei viaggi ---------- */
.map { margin: 0; }

.map__legend { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 16px; }
.legenditem {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14.5px; color: var(--text-soft);
}
.swatch {
  width: 15px; height: 15px; border-radius: 5px; flex: none;
  border: 1px solid rgba(0, 0, 0, .16);
}
.swatch--visited { background: var(--map-visited); }
.swatch--lived   { background: var(--map-lived); }
.legenditem__n {
  padding: 1px 9px; border-radius: 999px;
  background: var(--bg-inset); border: 1px solid var(--line);
  color: var(--text); font-size: 13px;
}

.map__canvas {
  position: relative;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.map__fallback { padding: 40px 0; text-align: center; color: var(--text-faint); font-size: 14.5px; }

.worldmap { display: block; width: 100%; height: auto; }
.country {
  fill: var(--map-land);
  stroke: var(--map-line);
  stroke-width: 0.6;
  transition: fill .18s ease;
}
.country--visited { fill: var(--map-visited); }
/* microstati: pallino con contorno, altrimenti si perdono sul fondo */
.country--dot { stroke: var(--bg-elev); stroke-width: 1.4; }
.country--dot.country--lived { stroke-width: 1.4; }
.country--lived   { fill: var(--map-lived); stroke: var(--map-line); stroke-width: 0.9; }
/* l'evidenziazione all'hover funziona anche in stampa e senza JS */
.worldmap:hover .country:hover { fill: var(--accent); }

.map__tip {
  position: absolute; z-index: 5; pointer-events: none;
  padding: 6px 11px; border-radius: 8px;
  background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 550; white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.map__note {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  margin-top: 12px; font-size: 13.2px; color: var(--text-faint);
}
.map__src { opacity: .8; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; text-align: left; }
  .hero__photo { grid-row: 1; max-width: 250px; justify-self: start; }
  .about__grid { grid-template-columns: 1fr; }
  .about__stats { grid-template-columns: repeat(3, 1fr); }
  .cards--3 { grid-template-columns: 1fr 1fr; }
  .card--wide { grid-column: span 2; }
  .contact__grid { grid-template-columns: repeat(2, 1fr); }
  .contactcard--cv { grid-column: span 2; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 72px; }

  .nav__brandtext { display: none; }
  .navtoggle { display: grid; }

  .nav__links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 8px 14px 16px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    /* chiuso di default su mobile */
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
  }
  .nav__links.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__links a { padding: 12px 14px; font-size: 15.5px; }

  .cards--2, .cards--3, .skills, .contact__grid { grid-template-columns: 1fr; }
  .card--wide { grid-column: auto; }
  .card__shot img { height: 175px; }
  .map__canvas { padding: 6px 8px; }
  .contactcard--cv { grid-column: auto; }
  .about__stats { grid-template-columns: 1fr; }
  .timeline { padding-left: 20px; }
  .tl__marker { left: -20px; }
  .tl__card { padding: 20px 18px; }
  .section__head { margin-bottom: 26px; }
  .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .footer__note { margin-right: 0; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .wrap, .nav__inner { padding-inline: 16px; }
  .hero__photo { max-width: 240px; }
  .langswitch__btn { padding: 4px 8px; }
}

/* ---------- Stampa ---------- */
@media print {
  .nav, .footer__top, .hero__glow, .hero__cta { display: none; }
  body { background: #fff; color: #000; }
  .section, .hero { padding: 18px 0; }
  .card, .tl__card, .contactcard { break-inside: avoid; box-shadow: none; }
}
