:root {
  --bg: #000;
  --bg-alt: #0a0b0d;
  --fg: #fff;
  --muted: rgba(255, 255, 255, .62);
  --line: rgba(255, 255, 255, .18);
  --line-strong: rgba(255, 255, 255, .85);
  --gutter: clamp(20px, 5vw, 64px);
  --font: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Barlow Condensed", "Barlow", "Arial Narrow", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-weight: 400; font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.lb-open, body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  transition: background .3s, backdrop-filter .3s;
}
.topbar.scrolled { background: rgba(0, 0, 0, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: .28em; text-transform: uppercase; white-space: nowrap; }
.nav { display: flex; gap: clamp(14px, 2.2vw, 34px); }
.nav a, .lang button {
  white-space: nowrap; font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  opacity: .72; transition: opacity .2s; padding: 6px 0; position: relative;
}
.nav a:hover, .nav a.active, .lang button:hover, .lang button.active { opacity: 1; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: #fff; transform: scaleX(0); transition: transform .25s; transform-origin: left; }
.nav a.active::after { transform: scaleX(1); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.lang { display: flex; align-items: center; gap: 6px; }
.lang span { opacity: .4; font-size: 12px; }
.lang button { padding: 6px 2px; }
.burger { display: none; width: 32px; height: 32px; position: relative; }
.burger span { position: absolute; left: 4px; right: 4px; height: 1.5px; background: #fff; transition: transform .25s, top .25s; }
.burger span:first-child { top: 12px; } .burger span:last-child { top: 20px; }
.menu-open .burger span:first-child { top: 16px; transform: rotate(45deg); }
.menu-open .burger span:last-child { top: 16px; transform: rotate(-45deg); }

/* ---------- Dot nav ---------- */
.dots { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 14px; }
.dots a { width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .7); transition: background .2s, transform .2s; }
.dots a.active { background: #fff; transform: scale(1.35); }

/* ---------- Panels ---------- */
.panel { position: relative; padding: clamp(96px, 14vh, 150px) 0 clamp(72px, 10vh, 120px); min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.panel.alt { background: var(--bg-alt); }
.panel + .panel { border-top: 1px solid var(--line); }

.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; text-transform: uppercase; line-height: 1.02; }
h2 { font-size: clamp(38px, 6vw, 76px); letter-spacing: .06em; }
h3 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: .08em; }
h4 { font-size: 15px; letter-spacing: .2em; font-weight: 600; }
.sec-head { margin-bottom: clamp(36px, 6vh, 64px); }
.sec-head h2 { margin-top: 12px; }
.lead { font-size: clamp(17px, 1.6vw, 21px); font-weight: 300; max-width: 620px; color: rgba(255, 255, 255, .88); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.btn {
  display: inline-block; min-width: 190px; text-align: center; padding: 14px 26px;
  font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  background: #fff; color: #000; border: 1px solid #fff; transition: background .2s, color .2s;
}
.btn:hover { background: transparent; color: #fff; }
.btn.ghost { background: rgba(0, 0, 0, .15); color: #fff; border-color: var(--line-strong); }
.btn.ghost:hover { background: #fff; color: #000; }

/* ---------- Hero ---------- */
.hero { padding: 0; overflow: hidden; justify-content: flex-end; height: 100vh; min-height: 620px;
  background: radial-gradient(120% 80% at 70% 0%, #101a2e 0%, #05070d 45%, #000 100%); }
.hero canvas, .hero-img, .hero-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-img { background-size: cover; background-position: center; opacity: 0; transition: opacity 1s; }
.hero-img.on { opacity: 1; }
.hero-shade { background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,.75) 100%); }
.hero-content { position: relative; padding-bottom: clamp(90px, 16vh, 160px); }
.hero h1 { font-size: clamp(52px, 11vw, 150px); letter-spacing: .05em; margin: 16px 0 22px; }
.hero .eyebrow { color: rgba(255, 255, 255, .8); }
.scroll-cue { position: absolute; left: 50%; bottom: 28px; width: 26px; height: 44px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 14px; transform: translateX(-50%); }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; background: #fff; border-radius: 2px; animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }

/* ---------- Timeline rows ---------- */
.timeline { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 32px 0; border-bottom: 1px solid var(--line); }
.row-when { font-family: var(--font-head); font-size: 18px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.row-org { margin-top: 8px; font-weight: 500; letter-spacing: .04em; }
.row-org span { color: var(--muted); font-weight: 400; }
.row-text { margin-top: 14px; color: rgba(255, 255, 255, .78); max-width: 720px; font-weight: 300; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags li { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; padding: 5px 12px; border: 1px solid var(--line); color: var(--muted); }

/* ---------- Skills ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); }
.sub { font-size: 14px; letter-spacing: .3em; color: var(--muted); font-weight: 600; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.skill-group { margin-bottom: 30px; }
.skill-group h4 { margin-bottom: 8px; }
.skills li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.skill-name { font-weight: 400; }
.meter { display: flex; justify-content: flex-end; gap: 4px; flex-shrink: 0; }
.meter i { width: 22px; height: 3px; background: rgba(255, 255, 255, .18); }
.meter i.on { background: #fff; }
.soft li { display: flex; gap: 22px; padding: 20px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.soft .num { font-family: var(--font-head); font-size: 20px; letter-spacing: .1em; color: var(--muted); min-width: 34px; }
.soft h4 { margin-bottom: 6px; }
.soft p { color: rgba(255, 255, 255, .72); font-weight: 300; }

/* ---------- Cards (tesi/pubblicazioni) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.card { border: 1px solid var(--line); padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; background: rgba(255, 255, 255, .02); transition: border-color .25s, background .25s; }
.card:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .04); }
.card-meta { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.card h3 { margin-bottom: 14px; }
.card p:not(.card-meta) { color: rgba(255, 255, 255, .75); font-weight: 300; flex: 1; }
.card .actions { margin-top: 28px; }
.card .btn { min-width: 0; flex: 1; padding: 13px 16px; }

/* ---------- Volontariato ---------- */
.vol { display: grid; grid-template-columns: minmax(260px, 1fr) 1.6fr; gap: clamp(28px, 5vw, 72px); padding: 36px 0; border-top: 1px solid var(--line); }
.vol:last-child { border-bottom: 1px solid var(--line); }
.vol h3 { margin: 10px 0 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-content: start; }
.ph { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #111; border: 1px solid var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s, opacity .3s; }
.ph:hover img { transform: scale(1.06); }
.ph-fallback { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  background: repeating-linear-gradient(45deg, #0d0e10, #0d0e10 10px, #121316 10px, #121316 20px); }
.ph.missing { cursor: default; }
.ph.missing img { display: none; }
.ph.missing .ph-fallback { display: flex; }

/* ---------- Contatti ---------- */
.contact .lead { margin-top: 0; }
.contact-list { margin-top: 36px; border-top: 1px solid var(--line); max-width: 640px; }
.contact-list li { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 18px; letter-spacing: .04em; }
.contact-list a { transition: opacity .2s; }
.contact-list a:hover { opacity: .65; }
.contact-list span { color: var(--muted); }

.footer { padding: 28px var(--gutter); text-align: center; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .94); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.lightbox[hidden] { display: none; }
.lightbox figure { max-width: 1100px; max-height: 100%; text-align: center; }
.lightbox img { max-height: 78vh; margin: 0 auto; object-fit: contain; }
.lightbox figcaption { margin-top: 14px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.lb-close { position: absolute; top: 14px; right: 22px; font-size: 40px; line-height: 1; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .burger { display: block; }
  .nav {
    position: fixed; inset: 64px 0 0 0; background: rgba(0, 0, 0, .96); flex-direction: column; justify-content: center; align-items: center; gap: 26px;
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .menu-open .nav { opacity: 1; pointer-events: auto; }
  .nav a { font-size: 18px; }
  .dots { display: none; }
}
@media (max-width: 820px) {
  .row { grid-template-columns: 1fr; gap: 8px; }
  .two-col, .vol { grid-template-columns: 1fr; }
  .btn { min-width: 0; flex: 1 1 100%; }
  .brand { font-size: 16px; letter-spacing: .2em; }
}

/* ---------- Varianti ---------- */
.row.nowhen { grid-template-columns: 1fr; }
.row-org a.ext { border-bottom: 1px solid var(--line); transition: border-color .2s; }
.row-org a.ext:hover { border-color: #fff; }
.vol-info .row-org { margin-top: 8px; }

/* ---------- Mappe ---------- */
.maps { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); }
.map-card { display: flex; flex-direction: column; min-width: 0; }
.map-head { margin-bottom: 18px; }
.map-head p { margin-top: 8px; color: var(--muted); font-weight: 300; }
.map { height: clamp(380px, 64vh, 620px); border: 1px solid var(--line); background: #0b0c0e; z-index: 0; }
.map.offline { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.leaflet-container { font-family: var(--font); background: #0b0c0e; }
.leaflet-control-attribution { background: rgba(0, 0, 0, .6) !important; color: rgba(255, 255, 255, .5) !important; font-size: 10px; }
.leaflet-control-attribution a { color: rgba(255, 255, 255, .7) !important; }
.leaflet-bar a { background: #0b0c0e; color: #fff; border-color: var(--line); }
.leaflet-bar a:hover { background: #fff; color: #000; }
.pin-wrap { background: none; border: 0; }
.pin { position: relative; width: 28px; height: 28px; }
.pin-flag { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .7); transition: transform .2s; }
.pin-flag .flag { width: 100%; height: 100%; display: block; }
.pin:hover .pin-flag { transform: scale(1.18); }
.pin.avail .pulse { position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .8); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
.maptip { background: rgba(0, 0, 0, .78); border: 1px solid var(--line); color: #fff; box-shadow: none; padding: 3px 9px; font-family: var(--font-head); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.maptip::before { display: none; }
.poppy .leaflet-popup-content-wrapper { background: #000; color: #fff; border: 1px solid var(--line-strong); border-radius: 0; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); }
.poppy .leaflet-popup-tip { background: #000; border: 1px solid var(--line-strong); }
.poppy .leaflet-popup-close-button { color: #fff; }
.pop { font-family: var(--font); }
.pop h5 { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 16px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
.pop h5 .flag { width: 22px; height: 15px; border: 1px solid var(--line); }
.pop ul { list-style: disc; padding-left: 16px; }
.pop li, .pop p { font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .8); margin: 0 0 3px; }
.legend { margin-top: 14px; border-top: 1px solid var(--line); }
.legend button { display: grid; grid-template-columns: 28px minmax(90px, auto) 1fr; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); transition: background .2s, padding .2s; }
.legend button:hover { background: rgba(255, 255, 255, .04); padding-left: 8px; }
.lg-flag { width: 28px; height: 19px; overflow: hidden; border: 1px solid var(--line); display: block; }
.lg-flag .flag { width: 100%; height: 100%; display: block; }
.lg-name { font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; }
.lg-note { color: var(--muted); font-size: 13px; font-weight: 300; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 980px) { .maps { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .legend button { grid-template-columns: 28px 1fr; } .lg-note { grid-column: 2; white-space: normal; } }
/* ---------- Contatti: schede ---------- */
.c-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 36px; }
.c-card { border: 1px solid var(--line); padding: clamp(22px, 2.6vw, 34px); display: flex; flex-direction: column; gap: 14px; background: rgba(255, 255, 255, .02); transition: border-color .25s, background .25s; }
.c-card:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .04); }
.c-main { font-family: var(--font-head); font-weight: 600; font-size: clamp(17px, 2vw, 26px); letter-spacing: .03em; word-break: normal; overflow-wrap: normal; }
.c-main:hover { text-decoration: underline; text-underline-offset: 6px; }
.c-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 10px; }
.c-actions .btn { min-width: 0; flex: 1 1 120px; padding: 13px 14px; cursor: pointer; }
.c-hint { margin-top: 14px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.c-info { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 28px; color: var(--muted); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.vol.nophotos { grid-template-columns: 1fr; }
.vol.nophotos .gallery { display: none; }

/* ---------- Ritratto nella hero ---------- */
.hero-glow { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(48% 62% at 76% 52%, rgba(74, 118, 205, .30) 0%, rgba(74, 118, 205, .10) 45%, transparent 72%),
              radial-gradient(30% 40% at 90% 92%, rgba(190, 120, 60, .16) 0%, transparent 70%); }
.hero-content.has-portrait { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr); align-items: end; gap: clamp(24px, 5vw, 80px); }
.hero-content:not(.has-portrait) .hero-text { max-width: 900px; }
.portrait { position: relative; justify-self: end; width: min(100%, 380px); margin: 0; animation: portraitIn 1.2s ease .2s both; }
.portrait[hidden] { display: none; }
.p-frame { position: relative; aspect-ratio: 3 / 4; padding: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35); backdrop-filter: blur(3px); box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(74, 118, 205, .18); }
.p-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; filter: contrast(1.04) saturate(.95); }
.p-frame::after { content: ""; position: absolute; inset: 10px; pointer-events: none; background: linear-gradient(180deg, transparent 62%, rgba(0, 0, 0, .78) 100%); }
.p-frame .c { position: absolute; width: 22px; height: 22px; border: 0 solid #fff; z-index: 2; }
.p-frame .tl { top: -6px; left: -6px; border-top-width: 2px; border-left-width: 2px; }
.p-frame .tr { top: -6px; right: -6px; border-top-width: 2px; border-right-width: 2px; }
.p-frame .bl { bottom: -6px; left: -6px; border-bottom-width: 2px; border-left-width: 2px; }
.p-frame .br { bottom: -6px; right: -6px; border-bottom-width: 2px; border-right-width: 2px; }
.p-frame figcaption { position: absolute; left: 22px; right: 22px; bottom: 18px; z-index: 2; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.p-frame figcaption b { font-family: var(--font-head); font-weight: 700; font-size: 17px; letter-spacing: .2em; text-transform: uppercase; }
.p-frame figcaption span { font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: rgba(255, 255, 255, .7); white-space: nowrap; }
.orbit { position: absolute; left: 50%; top: 50%; width: 175%; max-width: none; transform: translate(-50%, -50%); z-index: -1; pointer-events: none; animation: spin 90s linear infinite; }
.orbit ellipse { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: .7; }
.orbit .sat { fill: #fff; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes portraitIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (max-width: 980px) {
  .hero { height: auto; min-height: 100vh; padding-top: 96px; }
  .hero-content.has-portrait { grid-template-columns: 1fr; gap: 36px; }
  .portrait { order: -1; justify-self: start; width: min(56vw, 230px); }
  .p-frame figcaption span { display: none; }
  .hero-content { padding-bottom: 120px; }
}
@media (prefers-reduced-motion: reduce) { .orbit { animation: none; } .portrait { animation: none; } }
/* ---------- Ritratto a sinistra, testo a destra ---------- */
.hero-glow { background: radial-gradient(48% 62% at 24% 52%, rgba(74, 118, 205, .30) 0%, rgba(74, 118, 205, .10) 45%, transparent 72%),
                         radial-gradient(30% 40% at 8% 92%, rgba(190, 120, 60, .16) 0%, transparent 70%); }
@media (min-width: 981px) {
  .hero-content.has-portrait { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); align-items: center; }
  .hero-content.has-portrait .portrait { order: -1; justify-self: start; margin-left: clamp(0px, 2vw, 30px); }
  .hero-content.has-portrait h1 { font-size: clamp(44px, 6.4vw, 100px); margin: 14px 0 20px; }
  .hero-content.has-portrait .lead { max-width: 560px; }
}
/* ---------- Hero: il nome vive nella foto, presentazione più ampia ---------- */
.hero-content.has-portrait h1 { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-content.has-portrait .eyebrow { font-size: 13px; letter-spacing: .32em; color: #fff; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); max-width: 640px; }
.hero-content.has-portrait .lead { max-width: 640px; font-size: clamp(16px, 1.45vw, 20px); line-height: 1.7; }
.hero-content.has-portrait .lead p + p { margin-top: 14px; color: rgba(255, 255, 255, .78); }
.hero-content.has-portrait .actions { margin-top: 30px; }
.hero-text { position: relative; z-index: 3; }
.portrait { z-index: 1; }

/* ---------- I miei lavori (locandine) ---------- */
.works-sub { margin: -24px 0 36px; }
.works { columns: 3 300px; column-gap: 24px; }
.work { break-inside: avoid; margin: 0 0 28px; display: flex; flex-direction: column; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); transition: border-color .25s, transform .3s; }
.work:hover { border-color: var(--line-strong); }
.poster { display: block; width: 100%; overflow: hidden; background: #111; cursor: zoom-in; position: relative; }
.poster img { width: 100%; height: auto; display: block; transition: transform .6s ease; }
.poster:hover img { transform: scale(1.04); }
.poster::after { content: "+"; position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; background: rgba(0, 0, 0, .7); border: 1px solid var(--line-strong); opacity: 0; transition: opacity .25s; }
.poster:hover::after, .poster:focus-visible::after { opacity: 1; }
.work-info { padding: 18px 20px 22px; }
.work-info .card-meta { margin-bottom: 10px; }
.work-info h3 { font-size: clamp(18px, 1.7vw, 22px); letter-spacing: .06em; line-height: 1.15; }
.work-when { margin-top: 10px; font-size: 14px; font-weight: 500; }
.work-when span { color: var(--muted); font-weight: 400; }
.work-info .row-text { font-size: 14px; }
/* ---------- Locandine in fila (più piccole, scorrimento orizzontale se serve) ---------- */
.works { columns: auto; display: flex; align-items: stretch; gap: 18px; overflow-x: auto; padding-bottom: 14px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .35) transparent; }
.works::-webkit-scrollbar { height: 6px; }
.works::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .3); }
.work { flex: 1 0 200px; max-width: 250px; margin: 0; scroll-snap-align: start; }
.poster { aspect-ratio: 4 / 5; }
.poster img { width: 100%; height: 100%; object-fit: contain; background: #0b0c0e; }
.work-info { padding: 14px 14px 18px; flex: 1; }
.work-info .card-meta { font-size: 10px; letter-spacing: .18em; margin-bottom: 8px; }
.work-info h3 { font-size: 16px; letter-spacing: .05em; }
.work-when { font-size: 12.5px; margin-top: 8px; }
.work-info .row-text { font-size: 12.5px; margin-top: 8px; }
@media (max-width: 700px) { .work { flex-basis: 70vw; max-width: none; } }
/* ---------- Loghi ---------- */
.row.has-logo { grid-template-columns: 220px 1fr auto; }
.row.nowhen.has-logo { grid-template-columns: 1fr auto; }
.row-logo { order: 3; align-self: start; justify-self: end; }
.row-logo a, .row-logo:not(:has(a)) { display: flex; align-items: center; justify-content: center; }
.row-logo { display: flex; align-items: center; justify-content: center; width: 132px; height: 84px; padding: 10px 14px; background: rgba(255, 255, 255, .95); border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); transition: transform .25s, box-shadow .25s; }
.row-logo:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.row-logo a { width: 100%; height: 100%; }
.row-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.row.has-logo .row-main { order: 2; }
.row.has-logo .row-when { order: 1; }

/* stemma accanto alla foto */
.crest { position: absolute; top: -30px; right: -34px; width: 92px; height: auto; z-index: 4; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .65)); animation: crestIn 1.1s ease .7s both; }
.crest[hidden] { display: none; }
.portrait .p-frame .tr { display: none; }
@keyframes crestIn { from { opacity: 0; transform: translateY(-10px) scale(.9); } to { opacity: 1; transform: none; } }
@media (max-width: 980px) { .crest { width: 66px; top: -22px; right: -22px; } }
@media (max-width: 820px) {
  .row.has-logo, .row.nowhen.has-logo { grid-template-columns: 1fr; }
  .row-logo { order: -1; justify-self: start; width: 112px; height: 70px; margin-bottom: 4px; }
  .row.has-logo .row-when { order: 0; }
}
@media (prefers-reduced-motion: reduce) { .crest { animation: none; } }
/* ---------- Loghi a sinistra, sotto le date ---------- */
.row.has-logo, .row.nowhen.has-logo { grid-template-columns: 220px 1fr; }
.row-side { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.row-side .row-when { padding-top: 4px; }
.row-side .row-logo { order: 0; justify-self: auto; width: 172px; height: 84px; margin: 0; }
.row.has-logo .row-main { order: 0; }
@media (max-width: 820px) {
  .row.has-logo, .row.nowhen.has-logo { grid-template-columns: 1fr; }
  .row-side { gap: 12px; }
  .row-side .row-logo { order: 0; width: 148px; height: 72px; margin: 0; }
}
.row-side .row-when, .row.has-logo .row-side .row-when { order: 0; }
.row-side .row-logo { order: 1; }
@media (max-width: 820px) { .row-side .row-when, .row.has-logo .row-side .row-when { order: 0; } .row-side .row-logo { order: 1; } }

/* ---------- Loghi senza sfondo (bianchi) ---------- */
#experience[data-logos="mono"] .row-logo { background: none; box-shadow: none; border-radius: 0; padding: 0; width: 150px; height: 64px; justify-content: flex-start; transform: none; }
#experience[data-logos="mono"] .row-logo:hover { transform: none; box-shadow: none; }
#experience[data-logos="mono"] .row-logo img { object-position: left center; filter: brightness(0) invert(1); opacity: .82; transition: opacity .25s; }
#experience[data-logos="mono"] .row-logo:hover img { opacity: 1; }
@media (max-width: 820px) { #experience[data-logos="mono"] .row-logo { width: 130px; height: 56px; } }
/* Email su una sola riga: il carattere si adatta alla larghezza della scheda */
.c-card { container-type: inline-size; }
.c-email { display: block; white-space: nowrap; font-size: clamp(14px, 1.4vw, 20px); letter-spacing: .02em; }
@supports (font-size: 1cqw) { .c-email { font-size: clamp(13px, 6.6cqw, 26px); } }