/* Ro.S.A. — Robust Statistics Academy, University of Parma */

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/literata-latin-opsz-normal.woff2) format("woff2-variations");
  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: "Literata";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/literata-latin-ext-opsz-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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: "Literata";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/literata-latin-opsz-italic.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/public-sans-latin-wght-normal.woff2) format("woff2-variations");
  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: "Public Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/public-sans-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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;
}

:root {
  --paper: #ffffff;
  --mist: #f1f4f7;
  --rule: #d9dee5;
  --slate: #556070;
  --ink: #172033;
  --teal: #0e6b6b;
  --teal-dark: #0a5252;
  --teal-light: #d7ebea;
  --red: #c8102e; /* reserved for outliers */

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;  /* 14 */
  --step-0: 1.0625rem;  /* 17 */
  --step-1: 1.3125rem;  /* 21 */
  --step-2: 1.625rem;   /* 26 */
  --step-3: 2.125rem;   /* 34 */
  --step-4: clamp(2.25rem, 1.4rem + 3.2vw, 3.5rem);

  --measure: 68ch;
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--teal-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 0.6em; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--step-4); font-weight: 500; letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); font-weight: 500; }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; text-wrap: pretty; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--slate); max-width: 40ch; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.5rem 1rem; font-family: var(--sans); z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.5rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.375rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1; }
.brand-sub { display: block; font-family: var(--sans); font-size: 0.78rem; color: var(--slate); font-weight: 450; margin-top: 0.25rem; letter-spacing: 0; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; flex-wrap: wrap; }
.nav a { display: block; font-family: var(--sans); font-size: 0.95rem; font-weight: 500; color: var(--ink); text-decoration: none; padding: 0.5rem 0.75rem; border-radius: 6px; }
.nav a:hover { background: var(--mist); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--teal-dark); box-shadow: inset 0 -2px 0 var(--teal); border-radius: 0; }
.nav-toggle { display: none; }

@media (max-width: 56rem) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--sans); font-size: 0.95rem; font-weight: 500; background: none; border: 1px solid var(--rule); border-radius: 6px; padding: 0.45rem 0.8rem; color: var(--ink); cursor: pointer; }
  .site-header .wrap { flex-wrap: wrap; }
  .nav { flex-basis: 100%; display: none; padding-bottom: 1rem; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--teal); }
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.btn { display: inline-block; font-family: var(--sans); font-size: 0.98rem; font-weight: 600; text-decoration: none; padding: 0.75rem 1.2rem; border-radius: 6px; border: 1.5px solid var(--teal); color: var(--teal-dark); background: transparent; }
.btn:hover { background: var(--teal-light); color: var(--teal-dark); text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }

/* Hero */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { max-width: 14ch; }
@media (max-width: 56rem) { .hero .wrap { grid-template-columns: 1fr; } }

.fit-figure { margin: 0; }
.fit-figure svg { width: 100%; height: auto; display: block; }
.fit-figure figcaption { font-family: var(--sans); font-size: var(--step--1); color: var(--slate); line-height: 1.5; margin-top: 0.75rem; max-width: 52ch; }
.key { display: inline-block; vertical-align: middle; width: 1.6em; height: 0; margin: 0 0.3em 0.2em 0; border-top: 2px solid var(--ink); }
.key-ls { border-top: 2px dashed var(--slate); }
.key-rob { border-top: 3px solid var(--teal); }
.key-out { width: 0.6em; height: 0.6em; border: 0; border-radius: 50%; background: var(--red); margin-bottom: 0.05em; }

.pt { fill: var(--ink); opacity: 0.78; }
.pt-out { fill: var(--red); }
.line-ls { stroke: var(--slate); stroke-width: 2; stroke-dasharray: 7 6; fill: none; }
.line-rob { stroke: var(--teal); stroke-width: 3.5; fill: none; stroke-linecap: round; }
.axis { stroke: var(--rule); stroke-width: 1.5; }

/* Hero carousel */
.hero-charts .slides { display: grid; }
.hero-charts .slide { grid-area: 1 / 1; }
.hero-charts .slide[hidden] { display: none; }
.slide-controls { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; font-family: var(--sans); }
.slide-tab, .slide-pause { font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--slate); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 0.35rem 0.85rem; cursor: pointer; min-height: 2.25rem; }
.slide-tab:hover, .slide-pause:hover { color: var(--ink); border-color: var(--slate); }
.slide-tab[aria-pressed="true"] { color: #fff; background: var(--teal); border-color: var(--teal); }
.slide-pause { margin-left: auto; }
.fs-line { fill: none; stroke: #9aa7b8; stroke-width: 1.4; }
.fs-out { stroke: var(--red); stroke-width: 2.6; }
.fs-band { fill: var(--mist); }
.cl-pt { fill: var(--slate); }
.cl-pt.g1 { fill: var(--teal); } .cl-pt.g2 { fill: var(--ink); } .cl-pt.g3 { fill: #6b7fae; }
.cl-out { fill: var(--red); }
.cl-ell { fill: none; stroke-width: 1.6; }
.cl-ell.g1 { stroke: var(--teal); } .cl-ell.g2 { stroke: var(--ink); } .cl-ell.g3 { stroke: #6b7fae; }

@media (prefers-reduced-motion: no-preference) {
  .slide.is-active .pt { animation: pt-in 0.5s ease-out both; }
  .slide.is-active .pt-out { animation: pt-out 0.9s ease-out both; animation-delay: 1.6s; }
  .slide.is-active .line-ls { animation: fade 0.6s ease-out both; animation-delay: 0.8s; }
  .slide.is-active .line-rob { stroke-dasharray: 800; stroke-dashoffset: 800; animation: draw 1.1s cubic-bezier(.45,0,.2,1) forwards; animation-delay: 2.3s; }
  .slide.is-active .fs-line { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 2.4s ease-out forwards; }
  .slide.is-active .fs-out { animation-delay: 0.6s; animation-duration: 2.8s; }
  .slide.is-active .cl-pt { animation: cl-in 1.6s ease-out both; }
  .slide.is-active .cl-out { animation: pt-out 0.9s ease-out both; animation-delay: 2.2s; }
  .slide.is-active .cl-ell { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 1.2s ease-out forwards; animation-delay: 1.5s; }
}
@keyframes cl-in { 0% { opacity: 0; fill: var(--slate); } 40% { opacity: 1; fill: var(--slate); } }
@keyframes pt-in { from { opacity: 0; } }
@keyframes pt-out { 0% { fill: var(--ink); r: 4; } 60% { r: 8; } 100% { fill: var(--red); r: 5.5; } }
@keyframes fade { from { opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Sections */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { max-width: var(--measure); margin-bottom: 2.25rem; }
.section-head p { color: var(--slate); }

.areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.areas h3 { margin-bottom: 0.4em; }
.areas p { color: var(--slate); }
.areas a.more { font-family: var(--sans); font-weight: 600; font-size: 0.95rem; }
@media (max-width: 56rem) { .areas { grid-template-columns: 1fr; } }

/* Ink band (FSDA) */
.band { background: var(--ink); color: #e8ecf1; }
.band h2, .band h3 { color: #fff; }
.band a { color: #9fd6d3; }
.band a:hover { color: #fff; }
.band .section-head p { color: #b9c2ce; }
.band .btn { border-color: #9fd6d3; color: #fff; }
.band .btn:hover { background: rgba(159, 214, 211, 0.14); }
.band .btn-primary { background: #9fd6d3; border-color: #9fd6d3; color: var(--ink); }
.band .btn-primary:hover { background: #fff; border-color: #fff; color: var(--ink); }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 56rem) { .split { grid-template-columns: 1fr; } }

.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding-left: 1.4rem; margin-bottom: 0.6rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--teal); }
.band .ticks li::before { background: #9fd6d3; }

/* Rows (projects, events) */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.rows > li { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 0.5rem 2.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
.rows .meta { font-family: var(--sans); font-size: 0.92rem; color: var(--slate); line-height: 1.5; }
.rows h3 { margin-bottom: 0.35em; }
.rows p:last-child { margin-bottom: 0; }
@media (max-width: 44rem) { .rows > li { grid-template-columns: 1fr; } }

/* Page header (inner pages) */
.page-head { padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(1.5rem, 3vw, 2.25rem); border-bottom: 1px solid var(--rule); background: var(--mist); }
.page-head h1 { margin-bottom: 0.35em; }
.page-head .lead { max-width: 52ch; margin: 0; }
.subnav { font-family: var(--sans); font-size: 0.95rem; margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.subnav a { font-weight: 600; }

/* People */
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 2rem 1.75rem; }
.person { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.avatar { width: 4.5rem; height: 4.5rem; border-radius: 50%; overflow: hidden; background: var(--teal-light); color: var(--teal-dark); display: grid; place-items: center; font-family: var(--sans); font-weight: 650; font-size: 1.15rem; position: relative; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person h3 { font-size: 1.05rem; margin: 0.1rem 0 0.2rem; line-height: 1.3; }
.person p { font-family: var(--sans); font-size: 0.88rem; color: var(--slate); line-height: 1.45; margin: 0 0 0.2rem; }
.person a.profile { font-family: var(--sans); font-size: 0.88rem; font-weight: 600; }
.people-lead { margin-bottom: 1.75rem; }
.group + .group { margin-top: 3rem; }

/* Videos */
.videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 2rem; }
.videos figure { margin: 0; }
.videos video { width: 100%; aspect-ratio: 16 / 9; background: var(--ink); border-radius: 6px; display: block; }
.videos figcaption { margin-top: 0.75rem; }
.videos figcaption h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.videos figcaption p { font-family: var(--sans); font-size: 0.92rem; color: var(--slate); margin: 0; }
.videos .feature { grid-column: 1 / -1; }
@media (max-width: 44rem) { .videos { grid-template-columns: 1fr; } }

/* Definition list (contacts, install) */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.75rem 2rem; margin: 0; }
.facts dt { font-family: var(--sans); font-weight: 600; font-size: 0.95rem; color: var(--slate); padding-top: 0.15rem; }
.facts dd { margin: 0; }
@media (max-width: 30rem) { .facts { grid-template-columns: 1fr; gap: 0.15rem; } .facts dd { margin-bottom: 0.9rem; } }

.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 44rem) { .cols-2 { grid-template-columns: 1fr; } }

.note { font-family: var(--sans); font-size: 0.92rem; color: var(--slate); }

/* Footer */
.site-footer { background: var(--mist); border-top: 1px solid var(--rule); padding: 3rem 0 2.5rem; font-family: var(--sans); font-size: 0.92rem; color: var(--slate); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
.site-footer h2 { font-family: var(--sans); font-size: 0.95rem; font-weight: 650; color: var(--ink); margin: 0 0 0.6rem; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer a { color: var(--ink); }
.site-footer p { margin: 0 0 0.5rem; }
.footer-legal { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 1.25rem; margin-top: 0.5rem; }
@media (max-width: 44rem) { .site-footer .wrap { grid-template-columns: 1fr; } }

@media print {
  .site-header nav, .nav-toggle, .actions, .site-footer { display: none; }
  .band { background: none; color: var(--ink); }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.rows-compact > li { grid-template-columns: 1fr; padding: 1.1rem 0; }
.rows-compact h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.rows-compact .meta { margin: 0; }

@media (max-width: 56rem) {
  .brand { flex: 1 1 0; min-width: 0; }
  .site-header .wrap { padding-top: 0.75rem; padding-bottom: 0.75rem; }
}

/* Institutional logos */
.brand { display: flex; align-items: center; gap: 1.1rem; }
.brand a { display: block; line-height: 0; }
.brand a:focus-visible { outline-offset: 4px; }
.brand-rosa img { height: 60px; width: auto; }
.brand-unipr { padding-left: 1.1rem; border-left: 1px solid var(--rule); }
.brand-unipr img { height: 52px; width: auto; }
.site-header .wrap { min-height: 6rem; }
@media (max-width: 56rem) {
  .brand { gap: 0.8rem; }
  .brand-rosa img { height: 42px; }
  .brand-unipr { padding-left: 0.8rem; }
  .brand-unipr img { height: 36px; }
}
.fsda-title { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 0.35em; }
.fsda-title img { width: 72px; height: auto; flex: none; }
.fsda-title h1 { margin: 0; }

/* Sub-navigation current item */
.subnav a[aria-current="page"] { color: var(--ink); text-decoration: none; box-shadow: inset 0 -2px 0 var(--teal); }
.page-head .actions + .subnav { margin-top: 1.75rem; }

/* Consulting */
.clients { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--rule); }
.clients li { padding: 0.6rem 0; border-bottom: 1px solid var(--rule); font-size: 1.02rem; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.1rem 3rem; color: #d3dae3; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -0.1rem; width: 2rem; height: 2rem; border-radius: 50%; border: 1.5px solid #9fd6d3; color: #9fd6d3; font-family: var(--sans); font-weight: 650; font-size: 0.95rem; display: grid; place-items: center; }
.steps b { color: #fff; font-weight: 600; }

/* FSDA documentation frames */
.doc-section { padding: 1.5rem 0 3rem; }
.doc-open { margin: 0 0 0.75rem; }
.doc-frame { display: block; width: 100%; height: 85vh; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }

/* FSDA download */
.owners { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; }
.owners img { height: 70px; width: auto; }
.releases { border-top: 1px solid var(--rule); }
.releases details { border-bottom: 1px solid var(--rule); }
.releases summary { cursor: pointer; display: flex; align-items: baseline; gap: 1.25rem; padding: 1rem 0; list-style: none; }
.releases summary::-webkit-details-marker { display: none; }
.releases summary::before { content: "+"; font-family: var(--sans); font-weight: 600; color: var(--teal); width: 1rem; flex: none; }
.releases details[open] summary::before { content: "−"; }
.rel-name { font-family: var(--serif); font-size: var(--step-1); font-weight: 600; }
.rel-date { font-family: var(--sans); font-size: 0.92rem; color: var(--slate); }
.rel-body { padding: 0 0 1.5rem 2.25rem; max-width: var(--measure); }
.rel-body h4 { font-family: var(--sans); font-size: 0.98rem; font-weight: 650; margin: 1.25rem 0 0.4rem; color: var(--ink); }
.rel-body h4:first-child { margin-top: 0; }
.rel-body p, .rel-body li { font-size: 0.98rem; }
.rel-body ul { padding-left: 1.2rem; }
.rel-more { font-family: var(--sans); font-weight: 600; font-size: 0.95rem; }

/* Profile pages */
.profile { padding-top: clamp(2rem, 4vw, 3rem); }
.crumb { font-family: var(--sans); font-size: 0.92rem; color: var(--slate); margin-bottom: 2rem; }
.crumb a { font-weight: 600; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.profile-photo { margin: 0; }
.profile-photo img { width: 100%; height: auto; border-radius: 6px; filter: grayscale(1); }
.profile-text h1 { margin-bottom: 0.3em; }
.profile-role { font-family: var(--sans); font-weight: 600; margin: 0; }
.profile-aff { font-family: var(--sans); color: var(--slate); margin: 0 0 2rem; }
.profile-bio { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
@media (max-width: 44rem) { .profile-grid { grid-template-columns: 1fr; } .profile-photo { max-width: 16rem; } }
.slide-pause { display: inline-grid; place-items: center; width: 2.25rem; padding: 0; }
.slide-pause svg { fill: currentColor; }
.slide-pause .ic-play { display: none; }
.slide-pause[aria-pressed="true"] .ic-pause { display: none; }
.slide-pause[aria-pressed="true"] .ic-play { display: inline; }

/* Policy page */
.policy h2 { font-size: var(--step-2); margin-top: 2.25rem; }
.policy h2:first-child { margin-top: 0; }
