:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d232b;
  --muted: #5b6672;
  --line: #e3e0d8;
  --accent: #1f3a5f;
  --accent-soft: #e8eef5;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161b;
    --surface: #1a2027;
    --text: #e6e9ec;
    --muted: #9aa5b1;
    --line: #2a323b;
    --accent: #8fb3dc;
    --accent-soft: #1f2a37;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; }
nav .brand { font-family: var(--serif); font-size: 18px; color: var(--text); text-decoration: none; white-space: nowrap; }
nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; font-size: 15px; }
nav ul a { color: var(--muted); text-decoration: none; }
nav ul a:hover { color: var(--accent); }
@media (max-width: 720px) {
  nav .wrap { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; height: auto; padding-top: 10px; padding-bottom: 8px; }
  nav ul { gap: 18px; font-size: 14px; max-width: 100%; overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding-right: 24px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  nav ul::-webkit-scrollbar { display: none; }
}

header.hero { padding: 72px 0 60px; border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: 1fr 220px; gap: 48px; align-items: center; }
.hero img { width: 220px; height: 220px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 7vw, 62px); line-height: 1.05; margin: 0 0 16px; letter-spacing: -0.01em;
}
.hero .role { font-size: 18px; color: var(--accent); margin: 0 0 20px; font-weight: 500; }
.hero p.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; }
@media (max-width: 680px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .hero img { width: 140px; height: 140px; order: -1; }
}
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px; font-size: 15px;
  text-decoration: none; border: 1px solid var(--accent);
}
.btn.primary { background: var(--accent); color: var(--bg); }
.btn.ghost { color: var(--accent); }

section { padding: 64px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 56px; }
@media (max-width: 720px) { section { scroll-margin-top: 84px; } }
section h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.2; margin: 0 0 28px; }
section h2 small { display: block; font-family: var(--sans); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
p { margin: 0 0 16px; }

blockquote { margin: 28px 0 0; padding: 0 0 0 20px; border-left: 3px solid var(--accent); font-family: var(--serif); font-size: 20px; color: var(--muted); }
blockquote cite { display: block; font-family: var(--sans); font-style: normal; font-size: 14px; margin-top: 6px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 32px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.fact strong { display: block; font-family: var(--serif); font-size: 28px; font-weight: 400; color: var(--accent); }
.fact > span { display: block; font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 4px; }
.fact strong { white-space: nowrap; }
.fact strong.txt { font-size: 20px; line-height: 1.6; padding: 4px 0 3px; letter-spacing: -.01em; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 130px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.timeline > li:first-child { border-top: 0; padding-top: 0; }
.timeline .when { font-size: 14px; color: var(--muted); padding-top: 3px; font-variant-numeric: tabular-nums; }
.timeline h3 { margin: 0 0 6px; font-size: 18px; }
.timeline p { margin: 0 0 8px; }
.timeline ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 15.5px; }
.timeline ul li { padding: 2px 0; }
@media (max-width: 600px) { .timeline > li { grid-template-columns: 1fr; gap: 4px; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 6px 14px; font-size: 14.5px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
@media (max-width: 400px) { .cards.two { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.card h3 { margin: 0 0 6px; font-size: 16.5px; }
.card .meta { font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.card p { font-size: 15.5px; margin: 0; }

.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { padding: 14px 0; border-top: 1px solid var(--line); }
.pubs li:first-child { border-top: 0; padding-top: 0; }
.pubs .t { font-weight: 500; }
.pubs a.t { text-decoration: none; color: var(--text); }
.pubs a.t:hover { color: var(--accent); text-decoration: underline; }
.pubs .v { font-size: 14.5px; color: var(--muted); }
h3.sub { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 40px 0 16px; font-weight: 600; }
.more { margin-top: 20px; font-size: 15.5px; }

.contact .card a { font-size: 17px; word-break: break-all; }

footer { padding: 36px 0 48px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

.riflessione { display: block; max-width: 560px; text-decoration: none; color: var(--text); }
.riflessione:hover h3 { color: var(--accent); text-decoration: underline; }
.riflessione h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 0 0 6px; }

article.essay { padding: 64px 0 72px; }
article.essay .back { font-size: 15px; text-decoration: none; }
article.essay h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 6vw, 50px); line-height: 1.1; margin: 28px 0 10px; }
article.essay .meta { font-size: 14.5px; color: var(--muted); margin-bottom: 40px; }
article.essay .body { max-width: 660px; font-family: var(--serif); font-size: 20px; line-height: 1.7; }
article.essay .body p { margin: 0 0 22px; }
article.essay .body blockquote { font-size: 21px; color: var(--text); margin: 32px 0; }
article.essay .body .end { font-style: italic; }

nav ul li.lang a { border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 13px; letter-spacing: .04em; }
nav ul li.lang a:hover { border-color: var(--accent); }

/* ---------- grafica ed effetti ---------- */
:root { --map-sea: #e9eef4; --map-land: #d9e0e8; --map-it: #a9bfd8; --map-line: #fbfaf7; --band: #f3f1ec; --hl: #c8661f; }
@media (prefers-color-scheme: dark) {
  :root { --map-sea: #172029; --map-land: #2a343f; --map-it: #3d5878; --map-line: #12161b; --band: #161b21; --hl: #f0a35c; }
}
nav ul { gap: 18px; }
nav ul a.active { color: var(--accent); }

header.hero { position: relative; overflow: hidden; isolation: isolate; }
header.hero::before {
  content: ""; position: absolute; inset: -8%; z-index: -1;
  background: url(img/topografia.svg) center / cover no-repeat;
  opacity: .42;
  -webkit-mask-image: linear-gradient(100deg, transparent 15%, #000 70%);
  mask-image: linear-gradient(100deg, transparent 15%, #000 70%);
  animation: drift 70s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-4%, 2%, 0) scale(1.08); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-text > * { animation: rise .8s ease both; }
.hero-text > :nth-child(2) { animation-delay: .08s; }
.hero-text > :nth-child(3) { animation-delay: .16s; }
.hero-text > :nth-child(4) { animation-delay: .24s; }
.hero img.portrait { animation: rise .9s .25s ease both; box-shadow: 0 0 0 8px var(--accent-soft), 0 24px 48px -24px rgba(0,0,0,.45); }

html.io .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
html.io .reveal.in { opacity: 1; transform: none; }

.card, .moment { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.card:hover, .moment:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -20px rgba(0,0,0,.4); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

section.band { background: var(--band); }

.feature { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; margin: 8px 0 64px; }
.feature.flip figure { order: 2; }
.feature figure { margin: 0; }
.feature img { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: 0 28px 56px -30px rgba(0,0,0,.5); transition: transform .6s ease; }
.feature figure:hover img { transform: scale(1.015); }
.feature figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.feature h3 { font-family: var(--serif); font-weight: 400; font-size: 27px; margin: 0 0 12px; }
.kicker { font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; font-weight: 600; }
@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; gap: 18px; margin-bottom: 48px; }
  .feature.flip figure { order: 0; }
}

.pullquote { margin: 0 0 56px; padding: 44px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.pullquote blockquote { border: 0; padding: 0; margin: 0 auto; max-width: 740px; font-family: var(--serif); font-size: clamp(22px, 3.2vw, 31px); line-height: 1.4; color: var(--text); }
.pullquote figcaption { margin: 18px auto 0; max-width: 620px; font-size: 14px; color: var(--muted); }

.moments { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.moment { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.moment .y { display: block; font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--accent); margin-bottom: 12px; }
.moment h3 { font-size: 16px; margin: 0 0 6px; }
.moment p { font-size: 14.5px; color: var(--muted); margin: 0; }
@media (max-width: 860px) { .moments { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .moments { grid-template-columns: 1fr; } }

.mappa { position: relative; display: grid; grid-template-columns: 1.65fr 1fr; grid-template-areas: "world italy" "list list" "note note"; gap: 22px 28px; align-items: start; }
.mappa-world { grid-area: world; } .mappa-italy { grid-area: italy; } .luoghi { grid-area: list; } .mappa-note { grid-area: note; }
.mappa figure { margin: 0; }
.mappa figcaption { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.mappa svg { width: 100%; height: auto; display: block; }
.mappa .sphere, .mappa .sea { fill: var(--map-sea); }
.mappa .grat { fill: none; stroke: var(--map-line); stroke-width: .6; }
.mappa .land { fill: var(--map-land); stroke: var(--map-line); stroke-width: .5; }
.mappa .it { fill: var(--map-it); stroke: var(--map-line); stroke-width: .5; }
.mappa .it-ring { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 3; }
.pt { cursor: pointer; outline: none; }
.pt .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; transition: r .2s ease, fill .2s ease; }
.pt .pulse { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: pulse 2.8s ease-out infinite; pointer-events: none; }
.pt .leader { stroke: var(--accent); stroke-width: 1; opacity: .7; pointer-events: none; }
.pt .true { fill: var(--accent); pointer-events: none; }
.pt title { pointer-events: none; }
.mappa svg { cursor: default; touch-action: manipulation; }
.pt:nth-of-type(3n+1) .pulse { animation-delay: .9s; }
.pt:nth-of-type(3n+2) .pulse { animation-delay: 1.8s; }
.pt:hover .dot, .pt:focus-visible .dot, .pt.on .dot { r: 8; fill: var(--hl); }
@keyframes pulse { from { transform: scale(1); opacity: .45; } to { transform: scale(3.4); opacity: 0; } }
.luoghi { list-style: none; margin: 4px 0 0; padding: 0; columns: 2; column-gap: 32px; font-size: 15px; }
.luoghi li { break-inside: avoid; display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 6px 10px; border-radius: 6px; transition: background .2s ease; }
.luoghi li .yr { color: var(--muted); font-size: 13.5px; padding-top: 1px; font-variant-numeric: tabular-nums; }
.luoghi li.on { background: var(--accent-soft); }
.mappa-note { font-size: 13px; color: var(--muted); margin: 0; }
.tip { position: absolute; z-index: 5; pointer-events: none; max-width: 260px; padding: 7px 11px; border-radius: 7px; background: var(--text); color: var(--bg); font-size: 13.5px; line-height: 1.35; transform: translate(-50%, calc(-100% - 14px)); opacity: 0; transition: opacity .15s ease; }
.tip.show { opacity: 1; }
@media (max-width: 760px) {
  .mappa { grid-template-columns: 1fr; grid-template-areas: "world" "italy" "list" "note"; }
  .mappa-italy svg { max-width: 340px; margin: 0 auto; }
  .luoghi { columns: 1; }
}

.timeline.line { position: relative; }
.timeline.line > li { grid-template-columns: 130px 1fr; column-gap: 44px; }
.timeline.line::before { content: ""; position: absolute; left: 151px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 10%, transparent)); border-radius: 2px; }
.timeline.line > li { position: relative; }
.timeline.line > li::after { content: ""; position: absolute; left: 146px; top: 28px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.timeline.line > li:first-child::after { top: 6px; }
.timeline.line .when { font-weight: 600; color: var(--accent); }
@media (max-width: 600px) {
  .timeline.line { padding-left: 24px; }
  .timeline.line > li { grid-template-columns: 1fr; row-gap: 4px; }
  .timeline.line > li::after { top: 26px; }
  .timeline.line > li:first-child::after { top: 4px; }
  .timeline.line::before { left: 5px; }
  .timeline.line > li::after { left: -24px; }
}

@media (prefers-reduced-motion: reduce) {
  header.hero::before, .hero-text > *, .hero img.portrait, .pt .pulse { animation: none; }
  html.io .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover, .moment:hover, .feature figure:hover img { transform: none; }
  html { scroll-behavior: auto; }
}

.cards.two .card.wide { grid-column: 1 / -1; }

p.intro { max-width: 680px; color: var(--muted); margin: -12px 0 28px; }
.card.dec { position: relative; border-top: 3px solid var(--accent); }
.card .tag { display: inline-block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; margin-bottom: 12px; font-weight: 600; }
.card.dec h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; }

/* mappa a tre riquadri: mondo, Europa, Italia */
.mappa { grid-template-columns: 1fr 1fr; grid-template-areas: "world world" "europe italy" "list list" "note note"; }
.mappa-europe { grid-area: europe; }
.mappa .visit { fill: var(--map-it); cursor: pointer; transition: fill .2s ease; }
.mappa .visit.on, .mappa .visit:hover { fill: color-mix(in srgb, var(--hl) 55%, var(--map-it)); }
.mappa .frame { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 4 3; }
.luoghi { columns: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 28px; }
.luoghi h4 { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 6px; padding: 0 10px; }
.luoghi ol { list-style: none; margin: 0; padding: 0; }
.luoghi li { grid-template-columns: 84px 1fr; font-size: 14.5px; }
@media (max-width: 960px) { .luoghi { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .mappa { grid-template-columns: 1fr; grid-template-areas: "world" "europe" "italy" "list" "note"; }
  .mappa-europe svg { max-width: 400px; margin: 0 auto; }
  .luoghi { grid-template-columns: 1fr; }
}
