/* ==========================================================================
   Quality Engineering and Management Group — Politecnico di Torino
   One dark, quiet world: big type, hairlines, a single orange accent,
   and the 3D point cloud as the only imagery.
   ========================================================================== */
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-tight-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-tight-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter Tight"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-tight-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --polito: #002b49;          /* Politecnico di Torino blue */
  --bg: #00121f;
  --bg-2: #002b49;
  --fg: #f1f4f8;
  --mut: rgba(241, 244, 248, .64);
  --dim: rgba(241, 244, 248, .40);
  --line: rgba(241, 244, 248, .13);
  --line-2: rgba(241, 244, 248, .26);
  --accent: #ff8200;          /* Politecnico di Torino orange, lifted for dark ground */
  --cyan: #6bdbf2;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: var(--sans);
  --wrap: 1360px;
  --gutter: clamp(20px, 4.4vw, 64px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; font-weight: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: #140900; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.arr { display: inline-block; transition: transform .3s var(--ease); }

/* ---------- canvas, progress ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 120; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; transition: opacity .6s;
  background: radial-gradient(100% 80% at 65% 25%, var(--polito) 0%, var(--bg) 72%); }
main, .contact, .site-footer { position: relative; z-index: 1; }
.trail { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; transition: transform .5s var(--ease), background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.nav.is-hidden { transform: translateY(-100%); }
.nav.is-solid { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border-bottom-color: var(--line); }
.nav__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand__polito img { height: 38px; width: auto; display: block; }
.brand__group { display: flex; align-items: center; min-width: 0; padding-left: 16px; border-left: 1px solid var(--line-2); height: 30px; }
.site-footer__logo { height: 44px; width: auto; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__name { font-weight: 560; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__name span { color: var(--dim); font-weight: 400; }
.nav__links { display: flex; gap: clamp(14px, 2.2vw, 34px); list-style: none; margin: 0; padding: 0; }
.nav__links a { font-size: 14.5px; color: var(--mut); position: relative; padding: 6px 0; transition: color .2s; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform .35s var(--ease); }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--fg); }
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__toggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 16px; font-size: 14px; }
@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links { position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0; padding: 8px var(--gutter) 32px; background: var(--bg); border-bottom: 1px solid var(--line);
    clip-path: inset(0 0 100% 0); transition: clip-path .5s var(--ease); max-height: calc(100dvh - 72px); overflow: auto; }
  .nav.is-open .nav__links { clip-path: inset(0); }
  .nav__links a { font-size: 34px; font-weight: 500; letter-spacing: -.03em; padding: 12px 0; display: block; border-bottom: 1px solid var(--line); color: var(--fg); }
  .nav__links a::after { display: none; }
  .brand__name span { display: none; }
}

/* ---------- display type ---------- */
.display { font-weight: 520; font-size: clamp(46px, 9.6vw, 156px); line-height: .9; letter-spacing: -.055em; }
.display em, .title em { font-style: normal; color: var(--accent); }
.title { font-weight: 520; font-size: clamp(40px, 6.6vw, 104px); line-height: .94; letter-spacing: -.05em; }
.lead { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.45; color: var(--mut); max-width: 34ch; }
.line { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.line > span { display: block; transform: translateY(108%); animation: rise 1.2s var(--ease) forwards; }
.line:nth-child(2) > span { animation-delay: .08s; } .line:nth-child(3) > span { animation-delay: .16s; }
@keyframes rise { to { transform: none; } }

.go { display: inline-flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 500; padding: 14px 0 12px; border-bottom: 1px solid var(--line-2); transition: border-color .25s, color .25s, gap .3s var(--ease); background: none; border-top: 0; border-left: 0; border-right: 0; }
.go:hover { border-color: var(--accent); color: var(--accent); gap: 18px; }
.go--solid { background: var(--accent); color: #140900; border: 0; border-radius: 999px; padding: 14px 24px; }
.go--solid:hover { color: #140900; background: #ffa24a; }

/* ---------- home: chapters ---------- */
.ch { position: relative; min-height: 118vh; }
.ch--hero { min-height: 105vh; }
.ch--two { min-height: 180vh; }
.ch--three { min-height: 225vh; }       /* three shapes */         /* two shapes: hold, morph, hold */
.ch__in { position: sticky; top: 0; height: 100svh; display: flex; align-items: flex-end; padding-bottom: clamp(44px, 9vh, 96px); pointer-events: none; }
.ch__in > .wrap { display: flex; }
.ch__txt { pointer-events: auto; max-width: min(640px, 100%); display: grid; gap: clamp(16px, 2.4vh, 28px); justify-items: start; }
.ch--r .ch__in > .wrap { justify-content: flex-end; }
.ch__k { display: flex; align-items: center; gap: 14px; color: var(--dim); }
.ch__k b { color: var(--accent); font-weight: 500; }
.ch__k i { width: 40px; height: 1px; background: var(--line-2); }
.ch__n { font-weight: 480; font-size: clamp(88px, 15vw, 240px); line-height: .8; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.ch--hero .ch__txt { max-width: none; width: 100%; }
.hero__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; width: 100%; }
.scrollhint { display: inline-flex; align-items: center; gap: 12px; color: var(--dim); }
.scrollhint i { width: 1px; height: 34px; background: linear-gradient(var(--fg), transparent); animation: drip 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
/* scroll-linked fade of each chapter's text */
.ch__txt { opacity: var(--o, 1); transform: translateY(calc((1 - var(--o, 1)) * 40px)); will-change: opacity, transform; }
.rail { position: fixed; right: clamp(14px, 2vw, 28px); top: 50%; transform: translateY(-50%); z-index: 50; display: grid; gap: 12px; }
.rail a { width: 22px; height: 14px; display: grid; place-items: center; }
.rail a i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); transition: transform .3s var(--ease), background .3s; }
.rail a.on i { background: var(--accent); transform: scale(1.7); }
.ch--photo .ch__in::before, .pagehead--photo::before { content: ""; position: absolute; inset: 35% 0 0 0; pointer-events: none; opacity: var(--o, 1);
  background: linear-gradient(transparent, color-mix(in srgb, var(--bg) 82%, transparent) 62%, var(--bg)); }
.ch--photo .ch__in > .wrap, .pagehead--photo > .wrap { position: relative; }
.pagehead.pagehead--photo { position: relative; min-height: 100vh; }
@media (max-width: 860px) { .rail { display: none; } .ch { min-height: 115vh; } .ch--two { min-height: 175vh; } .ch--three { min-height: 220vh; } .lead { max-width: 30ch; } }

/* ---------- sections on solid ground (sub-pages, lists) ---------- */
.band { background: var(--bg); position: relative; padding: clamp(64px, 10vh, 130px) 0; border-top: 1px solid var(--line); }
.band--glass { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.band__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(28px, 5vh, 56px); }
.h2 { font-weight: 520; font-size: clamp(32px, 4.6vw, 68px); line-height: .98; letter-spacing: -.045em; }
.h2 em { font-style: normal; color: var(--accent); }
.eyebrow { color: var(--dim); display: block; margin-bottom: 18px; }
.pagehead { padding: clamp(150px, 26vh, 260px) 0 clamp(48px, 9vh, 100px); min-height: 78vh; display: flex; align-items: flex-end; }
.pagehead .lead { margin-top: 26px; max-width: 44ch; }

.rv { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; } .rv { opacity: 1; transform: none; transition: none; }
  .line > span { animation: none; transform: none; } .scrollhint i { animation: none; } .ch__txt { opacity: 1; transform: none; }
}

/* ---------- rows (news, areas, generic lists) ---------- */
.rows { border-top: 1px solid var(--line-2); }
.rowlink { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 24px; align-items: baseline; padding: 22px 0; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; transition: padding .4s var(--ease); }
.rowlink time, .rowlink .k { color: var(--dim); }
.rowlink h3 { font-weight: 480; font-size: clamp(19px, 1.9vw, 27px); line-height: 1.18; letter-spacing: -.025em; transition: color .2s; }
.rowlink:hover { padding-left: 12px; } .rowlink:hover h3 { color: var(--accent); }
.rowlink .tag { color: var(--dim); white-space: nowrap; }
@media (max-width: 720px) { .rowlink { grid-template-columns: 1fr; gap: 6px; } }
.pill { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); white-space: nowrap; }
.pill--live { color: #7fe0a6; } .pill--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--accent { color: var(--accent); }

/* research areas */
.area { border-bottom: 1px solid var(--line); }
.areas { border-top: 1px solid var(--line-2); }
.area__btn { width: 100%; display: grid; grid-template-columns: 70px minmax(0, 1fr) 40px; gap: 16px; align-items: center; padding: clamp(20px, 3vh, 34px) 0; background: none; border: 0; text-align: left; }
.area__n { color: var(--dim); }
.area__t { font-weight: 500; font-size: clamp(24px, 3.6vw, 54px); line-height: 1.02; letter-spacing: -.04em; transition: transform .5s var(--ease), color .2s; }
.area__btn:hover .area__t { transform: translateX(12px); } .area.open .area__t { color: var(--accent); }
.area__x { width: 40px; height: 40px; display: grid; place-items: center; transition: transform .5s var(--ease); color: var(--mut); }
.area__x svg { width: 18px; height: 18px; } .area.open .area__x { transform: rotate(45deg); color: var(--accent); }
.area__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.area.open .area__panel { grid-template-rows: 1fr; } .area__panel > div { overflow: hidden; }
.area__body { display: grid; grid-template-columns: 70px minmax(0, 6fr) minmax(0, 5fr); gap: 16px clamp(24px, 4vw, 72px); padding: 0 0 40px; }
.area__desc { grid-column: 2; color: var(--mut); } .area__desc p + p { margin-top: 12px; }
.area__refs { grid-column: 3; } .area__refs h4 { color: var(--dim); margin-bottom: 14px; }
.area__refs ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.area__refs li { font-size: 14.5px; line-height: 1.45; color: var(--mut); padding-left: 16px; border-left: 1px solid var(--accent); }
@media (max-width: 820px) { .area__btn { grid-template-columns: 36px minmax(0, 1fr) 32px; gap: 10px; } .area__body { grid-template-columns: 1fr; } .area__desc, .area__refs { grid-column: 1; } }

/* labs: big generated images */
.lab { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.lab__img { aspect-ratio: 21 / 9; width: 100%; object-fit: cover; opacity: .9; transition: transform 1.6s var(--ease), opacity .4s; }
.lab:hover .lab__img { transform: scale(1.04); opacity: 1; }
.lab__cap { position: absolute; inset: auto 0 0 0; padding: clamp(20px, 4vw, 56px) var(--gutter); display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(transparent, color-mix(in srgb, var(--bg) 88%, transparent)); }
.lab__cap h3 { font-weight: 520; font-size: clamp(28px, 4.6vw, 72px); line-height: .96; letter-spacing: -.045em; max-width: 14ch; }
.lab__cap p { color: var(--mut); max-width: 40ch; }
@media (max-width: 720px) { .lab__img { aspect-ratio: 4 / 5; } }

/* people */
.role { padding: clamp(28px, 5vh, 56px) 0; border-top: 1px solid var(--line); }
.role__name { color: var(--dim); margin-bottom: 26px; display: block; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 36px 22px; }
.person { display: grid; gap: 14px; align-content: start; }
.avatar { aspect-ratio: 1; width: 100%; overflow: hidden; background: var(--bg-2); display: grid; place-items: center; font-weight: 500; font-size: 64px; letter-spacing: -.04em; color: var(--dim); border-radius: 4px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.person:hover .avatar img { transform: scale(1.04); }
.person h3 { font-weight: 520; font-size: 21px; line-height: 1.12; letter-spacing: -.025em; }
.person p { font-size: 14.5px; line-height: 1.45; color: var(--mut); }
.person__links { display: flex; gap: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.person__links a:hover { color: var(--accent); }

/* projects + partners */
.grid { display: grid; gap: 0; border-top: 1px solid var(--line-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.card { background: none; border: 0; border-bottom: 1px solid var(--line); padding: 28px 28px 28px 0; display: flex; flex-direction: column; gap: 14px; text-align: left; transition: padding .4s var(--ease); min-height: 220px; }
button.card:hover { padding-left: 12px; } button.card:hover h3 { color: var(--accent); }
.card__meta { display: flex; gap: 14px; align-items: center; color: var(--dim); }
.card h3 { font-weight: 520; font-size: clamp(24px, 2.2vw, 32px); line-height: 1.05; letter-spacing: -.035em; transition: color .2s; }
.card p { font-size: 15.5px; color: var(--mut); line-height: 1.45; }
.card__foot { margin-top: auto; color: var(--dim); }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tabs { display: inline-flex; gap: 22px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 6px 0; font-size: 15px; color: var(--dim); border-bottom: 1px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--fg); border-color: var(--accent); }
.names { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.names button { background: none; border: 0; padding: 4px 0; font-weight: 500; font-size: clamp(22px, 2.8vw, 40px); letter-spacing: -.035em; line-height: 1.15; color: var(--mut); transition: color .2s; text-align: left; }
.names button:hover { color: var(--accent); }

/* publications */
.pubs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.pub { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 8px 22px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: start; }
.pub__y { color: var(--dim); padding-top: 5px; }
.pub__t { font-weight: 500; font-size: 20.5px; line-height: 1.2; letter-spacing: -.02em; }
.pub__t a:hover { color: var(--accent); }
.pub__a { font-size: 14.5px; color: var(--dim); margin-top: 7px; line-height: 1.45; } .pub__a b { font-weight: 500; color: var(--fg); }
.pub__v { font-size: 14.5px; color: var(--dim); margin-top: 2px; } .pub__v i { color: var(--mut); }
.pub__links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; padding-top: 5px; }
.chip { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); background: none; border: 0; padding: 0; white-space: nowrap; border-bottom: 1px solid var(--line-2); }
a.chip:hover, button.chip:hover { color: var(--accent); border-color: var(--accent); }
.chip--type { border: 0; color: var(--dim); } .chip--pdf { color: var(--accent); border-color: var(--accent); }
@media (max-width: 720px) { .pub { grid-template-columns: 1fr; gap: 4px; } .pub__links { justify-content: flex-start; margin-top: 10px; } }
.toolbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-block: 1px solid var(--line); padding: 14px 0; transition: top .5s var(--ease); }
body.nav-shown .toolbar { top: 72px; }
.toolbar__in { display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: center; }
.field { display: inline-flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line-2); height: 42px; color: var(--mut); }
.field input, .field select { border: 0; background: none; font: inherit; font-size: 15.5px; color: var(--fg); outline: none; height: 100%; min-width: 0; }
.field select option { background: var(--bg-2); color: var(--fg); }
.field--search { flex: 1 1 260px; } .field--search input { width: 100%; }
.field:focus-within { border-color: var(--accent); }
.toolbar__count { margin-left: auto; color: var(--dim); }
.yearhead { font-weight: 480; font-size: clamp(56px, 9vw, 132px); letter-spacing: -.06em; line-height: .9; padding: 64px 0 18px; display: flex; align-items: baseline; gap: 18px; color: var(--fg); }
.yearhead small { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--dim); text-transform: uppercase; font-weight: 400; }
.empty { padding: 80px 0; text-align: center; color: var(--dim); }
.loadmore { display: flex; justify-content: center; padding: 44px 0 0; }
@media (max-width: 560px) { .toolbar { position: static; } .field { flex: 1 1 140px; } .field select { width: 100%; } .toolbar__count { width: 100%; } }

/* ---------- prose + side sheet ---------- */
.prose { font-size: 17px; line-height: 1.62; color: var(--mut); }
.prose > * + * { margin-top: 1em; }
.prose strong, .prose b { color: var(--fg); font-weight: 560; }
.prose a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); word-break: break-word; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 1em 0; } .prose li + li { margin-top: .35em; }
.prose img { border-radius: 4px; margin: 1.4em 0; max-height: 520px; width: auto; }
.prose h3, .prose h4 { color: var(--fg); font-weight: 560; font-size: 21px; margin-top: 1.6em; }
dialog.sheet { border: 0; padding: 0; background: var(--bg-2); color: var(--fg); width: min(860px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border-left: 1px solid var(--line); overflow: hidden; }
dialog.sheet::backdrop { background: rgba(2, 4, 8, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.sheet[open] { animation: slidein .6s var(--ease); display: flex; flex-direction: column; }
@keyframes slidein { from { transform: translateX(80px); opacity: 0; } }
.sheet__bar { display: flex; justify-content: space-between; align-items: center; padding: 18px clamp(20px, 4vw, 48px); border-bottom: 1px solid var(--line); color: var(--dim); flex: none; }
.sheet__close { background: none; border: 0; padding: 4px 0; font-size: 14px; color: var(--fg); border-bottom: 1px solid var(--line-2); }
.sheet__close:hover { color: var(--accent); border-color: var(--accent); }
.sheet__scroll { overflow: auto; padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 48px) 72px; overscroll-behavior: contain; }
.sheet__scroll h2 { font-weight: 520; font-size: clamp(30px, 4vw, 52px); line-height: 1; letter-spacing: -.045em; margin-bottom: 14px; }
.sheet__sub { font-size: 19px; color: var(--mut); margin-bottom: 26px; }
.sheet__logo { max-height: 60px; max-width: 200px; width: auto; margin-bottom: 26px; background: #fff; padding: 8px 12px; border-radius: 4px; }
.sheet__gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 26px 0; }
.sheet__gallery img { border-radius: 4px; width: 100%; aspect-ratio: 4/3; object-fit: cover; }

/* ---------- contact + footer ---------- */
.contact { padding: clamp(120px, 24vh, 260px) 0 clamp(56px, 9vh, 100px); min-height: 100vh; display: flex; align-items: flex-end; }
.contact__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-top: clamp(44px, 9vh, 100px); padding-top: 28px; border-top: 1px solid var(--line); }
.contact__grid h3 { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; }
.contact__grid p, .contact__grid li { color: var(--mut); white-space: pre-line; }
.contact__grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.contact__grid a:hover { color: var(--accent); }
.site-footer { color: var(--dim); padding: 22px 0 28px; border-top: 1px solid var(--line); background: var(--bg); font-size: 13.5px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; } .site-footer a:hover { color: var(--fg); }
noscript p { padding: 20px var(--gutter); background: #2a1c06; color: #ffd9a8; }

@media (max-width: 560px) { .brand__polito img { height: 30px; } .brand__name span { display: none; } .brand__name { font-size: 14px; } .brand { gap: 10px; } .brand__group { padding-left: 10px; } }

/* ---------- People: the ring ---------- */
.ring { position: relative; border-top: 1px solid var(--line); }
.ring__in { position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; padding: 92px 0 clamp(22px, 5vh, 52px); overflow: hidden; }
.ring__bar { min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px 24px; flex-wrap: wrap; }
.ring__bar .tabs { gap: 6px 20px; }
.ring__hint { color: var(--dim); }
.ring__stage { position: relative; z-index: 1; perspective: 1500px; perspective-origin: 50% 20%; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.ring__stage:active { cursor: grabbing; }
.ring__spin { position: absolute; left: 50%; top: 46%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.pcard { position: absolute; width: var(--cw); height: calc(var(--cw) * 1.28); left: calc(var(--cw) / -2); top: calc(var(--cw) * -.64); padding: 0; border: 0;
  background: none; backface-visibility: hidden; -webkit-backface-visibility: hidden; cursor: pointer; }
/* the portrait melts into the page: its edges fade out */
.pcard img, .pcard__ini { -webkit-mask-image: radial-gradient(ellipse 62% 64% at 50% 44%, #000 52%, rgba(0,0,0,.55) 74%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 64% at 50% 44%, #000 52%, rgba(0,0,0,.55) 74%, transparent 100%); }
.pcard img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.pcard.on .pcard__cap { opacity: 0; }
.pcard__ini { display: grid; place-items: center; height: 100%; font-size: calc(var(--cw) * .3); font-weight: 500; letter-spacing: -.04em; color: var(--mut);
  background: radial-gradient(120% 90% at 30% 20%, #0f3a62 0%, var(--bg) 80%); }
.pcard__cap { position: absolute; inset: auto 0 0 0; padding: 0 8px 4px; font-size: 12px; line-height: 1.2; text-align: center; font-weight: 500; color: var(--mut); text-shadow: 0 1px 10px var(--bg), 0 0 3px var(--bg); transition: color .3s; }
.ring__panel { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 18px clamp(24px, 4vw, 64px); align-items: end; min-height: 0; position: relative; z-index: 2; }
.ring__panel.in > * { animation: panelIn .55s var(--ease) both; }
.ring__panel.in > *:nth-child(2) { animation-delay: .07s; }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px); } }
.ring__who > .mono { color: var(--accent); display: block; margin-bottom: 10px; }
.ring__who h2 { font-weight: 520; font-size: clamp(30px, 4.2vw, 60px); line-height: .98; letter-spacing: -.045em; }
.ring__who p { color: var(--mut); margin-top: 12px; max-width: 52ch; font-size: 15.5px; line-height: 1.5; }
.ring__who .person__links { margin-top: 14px; }
.abars > .mono { color: var(--dim); display: block; margin-bottom: 10px; }
.abars ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.abars ol a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 8px 0 9px; border-bottom: 1px solid var(--line); position: relative; }
.abars__t { font-size: clamp(15px, 1.25vw, 18px); font-weight: 500; letter-spacing: -.01em; transition: color .2s; }
.abars__n { color: var(--dim); align-self: center; }
.abars ol a i { grid-column: 1 / -1; height: 2px; background: var(--line); position: relative; }
.abars ol a i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--cyan); opacity: .55; transition: background .2s, opacity .2s; }
.abars ol a.lead-area i::after, .abars ol a:hover i::after, .abars ol a:focus-visible i::after { background: var(--accent); opacity: 1; }
.abars ol a:hover .abars__t, .abars ol a:focus-visible .abars__t { color: var(--accent); }
@media (max-width: 860px) {
  .ring__in { padding-top: 84px; }
  .ring__panel { grid-template-columns: 1fr; gap: 12px; min-height: 0; }
  .ring__who p { display: none; }
  .ring__hint { display: none; }
  .ring__bar .tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .ring__bar .tabs button { white-space: nowrap; }
  .abars ol { gap: 0; } .abars a { padding: 6px 0 7px; }
}
@media (prefers-reduced-motion: reduce) { .ring__panel.in > * { animation: none; } }

.abars__more { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--dim); }
.abars__more .mono { margin-right: 8px; }
.abars__more a { display: inline; color: var(--mut); border-bottom: 1px solid var(--line-2); }
.abars__more a:hover, .abars__more a:focus-visible { color: var(--accent); border-color: var(--accent); }
@media (max-width: 640px) {
  .ring__in { grid-template-rows: auto minmax(230px, 1fr) auto; padding-bottom: 16px; }
  .ring__who .person__links { display: none; }
  .ring__stage { perspective: 900px; }
  .pcard__cap { font-size: 10.5px; }
  .pcard:not(.on) .pcard__cap { opacity: 0; }
  .ring__who > .mono { margin-bottom: 4px; }
  .ring__who h2 { font-size: 28px; }
  .ring__who .person__links { margin-top: 8px; }
  .abars > .mono { margin-bottom: 4px; }
  .abars__t { font-size: 14.5px; }
  .abars__more { font-size: 13px; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
