/* ============================================================
   global-nu.org — "Spectrum"
   Data-forward: figures lead, numerals are large, two accents
   carry the two mass orderings (NO / IO) consistently across
   the whole site.

   Two themes. Everything that must change between them is a
   token in the blocks below; nothing after them hard-codes a
   background or a text colour. Every colour added here must
   also be added to PAIRS in tools/tests/test_theme.js, which
   measures WCAG contrast in both themes.
   ============================================================ */

/* ---------- fonts (self-hosted, latin subset) ---------- */
@font-face{font-family:"Archivo";src:url("../fonts/archivo-latin-600-normal.woff2") format("woff2");font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:"Archivo";src:url("../fonts/archivo-latin-700-normal.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:"Archivo";src:url("../fonts/archivo-latin-800-normal.woff2") format("woff2");font-weight:800;font-style:normal;font-display:swap}
@font-face{font-family:"Inter";src:url("../fonts/inter-latin-400-normal.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Inter";src:url("../fonts/inter-latin-500-normal.woff2") format("woff2");font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:"Inter";src:url("../fonts/inter-latin-600-normal.woff2") format("woff2");font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:"JetBrains Mono";src:url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"JetBrains Mono";src:url("../fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2");font-weight:600;font-style:normal;font-display:swap}

/* ---------- shape tokens (theme-independent) ---------- */
:root{
  --display:"Archivo",ui-sans-serif,system-ui,"Segoe UI",Roboto,sans-serif;
  --body:"Inter",ui-sans-serif,system-ui,"Segoe UI",Roboto,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;

  --wide:80rem;
  --measure:40rem;
  --gutter:clamp(1.15rem,4.5vw,3rem);
  --sec-y:clamp(3rem,7vw,5.5rem);
  --r:16px;
  --r-sm:10px;
}

/* ---------- dark (default) ---------- */
:root,
:root[data-theme="dark"]{
  color-scheme:dark;

  --bg:#0d0f14;
  --bg-deep:#08090d;
  --surface:#151922;
  --surface-2:#1d222d;
  --line:rgba(255,255,255,.10);
  --line-strong:rgba(255,255,255,.20);

  --text:#f0f2f7;
  --text-soft:#b9c0cd;
  --text-mute:#8d95a4;

  /* Data colours. These two encode the mass ordering everywhere on the site,
     so they are chosen by the validator, not by eye: cyan/violet failed CVD
     separation (deutan ΔE 4.8 — a deuteranope could not tell NO from IO).
     This pair passes every check in scripts/validate_palette.js. */
  --no:#1f9fd4;            /* normal ordering */
  --io:#c67f28;            /* inverted ordering */
  /* Groups, on the comparison panels: a different job from the orderings
     above, so a different set of tokens. Validated as a categorical trio. */
  --grp-bari:#1f9fd4;
  --grp-nufit:#c67f28;
  --grp-valencia:#b06fc4;
  /* Decoration only — card rules, tags, section accents. These never encode
     a value, so telling two of them apart is never load-bearing; they are
     still validated as a categorical set, in this order. */
  --dec-1:#b8862c;
  --dec-2:#1f9fd4;
  --dec-3:#d1614a;
  --dec-4:#8c63c9;
  --dec-5:#5f9e35;
  --shadow:0 18px 48px -24px rgba(0,0,0,.75);
  --shadow-strong:0 26px 60px -28px rgba(0,0,0,.9);
  --glow-1:rgba(31,159,212,.13);
  --glow-2:rgba(140,99,201,.12);
  /* Brand and decoration only — never used to encode a value. */
  --accent:#39c2ff;
  --accent-2:#c084fc;
  --warn:#f0a44a;          /* "generated automatically" notices */
  --src-3:#5fd39a;         /* third database badge (Crossref) */
  --on-accent:#06121c;
}

/* ---------- light ----------
   Not the dark palette inverted: on a white page the saturated accents fail
   contrast against their own background, so both ordering colours are
   darkened until each clears its threshold on --bg and --surface. The hues
   are the same, which is what makes the two themes feel like one site. */
:root[data-theme="light"]{
  color-scheme:light;

  --bg:#ffffff;
  --bg-deep:#f2f4f8;
  --surface:#f7f9fc;
  --surface-2:#eaeef5;
  --line:rgba(10,15,25,.13);
  --line-strong:rgba(10,15,25,.26);

  --text:#0b0e14;
  --text-soft:#39414f;
  --text-mute:#5c6472;

  --no:#0b62a4;
  --io:#96590a;
  --grp-bari:#0b62a4;
  --grp-nufit:#96590a;
  --grp-valencia:#5b53b8;
  --dec-1:#8a5a0d;
  --dec-2:#0b62a4;
  --dec-3:#b0432c;
  --dec-4:#6d28d9;
  --dec-5:#3f6b14;
  --shadow:0 18px 44px -26px rgba(16,20,28,.24);
  --shadow-strong:0 26px 56px -30px rgba(16,20,28,.32);
  --glow-1:rgba(11,98,164,.09);
  --glow-2:rgba(109,40,217,.08);
  --accent:#0b62a4;
  --accent-2:#6d28d9;
  --warn:#8a4b06;
  --src-3:#0f7a52;
  --on-accent:#ffffff;
}

/* Readers who have expressed no preference follow their operating system.
   The attribute selectors above always win, so an explicit choice sticks. */
@media (prefers-color-scheme:light){
  :root:not([data-theme="dark"]){
    color-scheme:light;
    --bg:#ffffff;
    --bg-deep:#f2f4f8;
    --surface:#f7f9fc;
    --surface-2:#eaeef5;
    --line:rgba(10,15,25,.13);
    --line-strong:rgba(10,15,25,.26);
    --text:#0b0e14;
    --text-soft:#39414f;
    --text-mute:#5c6472;
    --no:#0b62a4;
    --io:#96590a;
    --grp-bari:#0b62a4;
    --grp-nufit:#96590a;
    --grp-valencia:#5b53b8;
  --dec-1:#8a5a0d;
    --dec-2:#0b62a4;
    --dec-3:#b0432c;
    --dec-4:#6d28d9;
    --dec-5:#3f6b14;
    --shadow:0 18px 44px -26px rgba(16,20,28,.24);
    --shadow-strong:0 26px 56px -30px rgba(16,20,28,.32);
    --glow-1:rgba(11,98,164,.09);
    --glow-2:rgba(109,40,217,.08);
    --accent:#0b62a4;
    --accent-2:#6d28d9;
    --warn:#8a4b06;
    --src-3:#0f7a52;
    --on-accent:#ffffff;
  }
}

/* ---------- base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--body);
  font-size:clamp(.98rem,.35vw + .9rem,1.03rem);
  line-height:1.62;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
img,svg{max-width:100%}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}

.wrap{width:min(100% - 2*var(--gutter),var(--wide));margin-inline:auto}
.prose{max-width:var(--measure)}
.prose p{margin:0 0 1rem}
.small{font-size:.86rem}
.muted{color:var(--text-mute)}
.mono{font-family:var(--mono)}

.skip{position:absolute;left:-9999px}
.skip:focus{left:var(--gutter);top:.6rem;z-index:20;background:var(--surface);
  color:var(--text);padding:.55rem 1rem;border-radius:var(--r-sm);
  border:1px solid var(--line-strong)}

h1,h2,h3,h4{font-family:var(--display);letter-spacing:-.015em;margin:0}
/* An academic page, not a poster: the display sizes are a step down from
   where they started, and the tracking is looser, so a heading reads as a
   heading rather than as a slogan. */
h1{font-weight:700;font-size:clamp(1.9rem,3.4vw,2.75rem);line-height:1.12;
  letter-spacing:-.02em}
h2{font-weight:700;font-size:clamp(1.35rem,2.2vw,1.8rem);line-height:1.2;
  letter-spacing:-.015em}
h3{font-weight:700;font-size:1.1rem;letter-spacing:-.02em}
h4{font-weight:700;font-size:.98rem}

/* ---------- header ---------- */
.site-header{position:sticky;top:0;z-index:10;
  background:color-mix(in srgb,var(--bg) 90%,transparent);
  backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}
.site-header__inner{display:flex;align-items:center;gap:1.1rem;
  padding-block:.85rem;flex-wrap:wrap}
.brand{font-family:var(--display);font-weight:800;font-size:1.12rem;
  letter-spacing:-.035em;color:var(--text);display:flex;flex-direction:column;
  line-height:1.15}
.brand:hover{text-decoration:none}
/* The wordmark is one flex child, not two. Without the <b>, "global" is an
   anonymous flex item and <i>-nu</i> is another, so a column layout stacked
   them and the name read as "global" above "-nu". */
.brand b{font-weight:inherit;white-space:nowrap}
.brand i{font-style:normal;color:var(--accent)}
.brand span{font-family:var(--body);font-size:.68rem;font-weight:400;
  letter-spacing:0;color:var(--text-mute)}
.nav{display:flex;gap:1rem;margin-left:auto;flex-wrap:wrap;
  font-size:.85rem;font-weight:500}
.nav a{color:var(--text-soft)}
.nav a:hover{color:var(--text);text-decoration:none}
.nav a[aria-current="page"]{color:var(--text);
  box-shadow:inset 0 -2px 0 var(--accent)}
.theme-toggle,.nav-toggle{background:var(--surface);border:1px solid var(--line);
  border-radius:999px;width:2.1rem;height:2.1rem;padding:.4rem;cursor:pointer;
  color:var(--text-soft);flex:none}
.theme-toggle:hover,.nav-toggle:hover{border-color:var(--accent);color:var(--text)}
.theme-toggle svg,.nav-toggle svg{width:100%;height:100%;fill:none;
  stroke:currentColor;stroke-width:1.7;display:block}
/* Scoped under .theme-toggle on purpose. `.theme-toggle svg` above is
   (0,1,1) and a bare `.theme-toggle__moon` is (0,1,0), so the display:block
   won whatever the order and BOTH icons showed at once — the moon spilling
   out of the round button. These are (0,2,0) and win properly. */
.theme-toggle .theme-toggle__moon{display:none}
:root[data-theme="light"] .theme-toggle .theme-toggle__sun{display:none}
:root[data-theme="light"] .theme-toggle .theme-toggle__moon{display:block}
@media (prefers-color-scheme:light){
  :root:not([data-theme="dark"]) .theme-toggle .theme-toggle__sun{display:none}
  :root:not([data-theme="dark"]) .theme-toggle .theme-toggle__moon{display:block}
}
.nav-toggle{display:none}

/* ---------- page head / hero ---------- */
.hero{position:relative;overflow:hidden;border-bottom:1px solid var(--line);background:
  radial-gradient(80rem 30rem at 15% -10%,color-mix(in srgb,var(--no) 13%,transparent),transparent 65%),
  radial-gradient(60rem 26rem at 85% 0%,color-mix(in srgb,var(--accent-2) 12%,transparent),transparent 60%),
  var(--bg-deep)}
.hero::after{content:"";position:absolute;inset:auto 0 0 0;height:2px;
  background:linear-gradient(90deg,var(--dec-1),var(--dec-2),var(--dec-4),var(--dec-3));
  opacity:.8}
.hero__in{position:relative;z-index:1;padding-block:clamp(2.8rem,6.5vw,5rem)}
.hero--split .hero__in{display:grid;gap:2.4rem;
  grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);align-items:center}
.kicker{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--mono);
  font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;
  color:var(--text-mute);border:1px solid var(--line);border-radius:999px;
  padding:.28rem .8rem;margin:0 0 1.3rem}
.kicker b{color:var(--no);font-weight:700}
.lede{color:var(--text-soft);font-size:clamp(1rem,1.4vw,1.08rem);
  margin:1.1rem 0 0;max-width:38rem}
.btn-row{display:flex;gap:.65rem;flex-wrap:wrap;margin-top:1.8rem}
.btn{border-radius:999px;padding:.6rem 1.15rem;font-size:.88rem;font-weight:600;
  background:var(--text);color:var(--bg);border:1px solid var(--text);
  display:inline-block}
.btn:hover{text-decoration:none;opacity:.86;color:var(--bg)}
.btn--ghost{background:transparent;color:var(--text);border-color:var(--line-strong)}
.btn--ghost:hover{border-color:var(--accent);color:var(--accent);opacity:1}
.btn--sm{padding:.4rem .85rem;font-size:.8rem}

/* ---------- sections ---------- */
.section{padding-block:var(--sec-y)}
.section--alt{background:var(--surface);border-block:1px solid var(--line)}
.section-head{display:flex;align-items:flex-end;gap:1rem;flex-wrap:wrap;
  margin-bottom:1.7rem}
.section-head p{margin:0;color:var(--text-mute);font-size:.86rem;
  font-family:var(--mono)}
.section-head .more{margin-left:auto;font-size:.88rem;font-weight:600}

/* ---------- generated-page notice ---------- */
.autogen{display:flex;gap:.7rem;align-items:flex-start;
  background:var(--surface-2);border:1px solid var(--line);
  border-left:3px solid var(--warn);border-radius:var(--r-sm);
  padding:.85rem 1rem;font-size:.85rem;color:var(--text-soft);margin:0 0 1.8rem}
.autogen b{color:var(--text)}
.autogen .stamp{font-family:var(--mono);font-size:.76rem;color:var(--text-mute);
  display:block;margin-top:.2rem}

/* ---------- figures ---------- */
.figure{background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r);padding:1.1rem 1.2rem 1rem}
.section--alt .figure{background:var(--bg)}
.figure h4{font-family:var(--mono);font-size:.72rem;letter-spacing:.1em;
  text-transform:uppercase;color:var(--text-mute);margin:0 0 .7rem;font-weight:600}
.figure svg{width:100%;height:auto;display:block}
.figure .cap{font-size:.74rem;color:var(--text-mute);margin:.5rem 0 0}
.legend{display:flex;gap:1.1rem;font-family:var(--mono);font-size:.72rem;
  color:var(--text-mute);margin-top:.7rem;flex-wrap:wrap}
.legend i{display:inline-block;width:1.6rem;height:2px;vertical-align:middle;
  margin-right:.35rem}
.legend .k-no{background:var(--no)}
.legend .k-io{background:var(--io)}

/* ---------- stat grid ---------- */
.stats{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(13rem,1fr))}
.stat{background:var(--bg);border:1px solid var(--line);border-radius:var(--r);
  padding:1.1rem 1.2rem;position:relative;overflow:hidden;box-shadow:var(--shadow)}
.section--alt .stat{background:var(--surface-2)}
.stat::after{content:"";position:absolute;inset:auto 0 0 0;height:3px;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));opacity:.65}
.stat .k{font-family:var(--mono);font-size:.75rem;color:var(--text-mute);
  display:block;margin-bottom:.45rem}
.stat .v{font-family:var(--display);font-weight:800;font-size:2rem;
  letter-spacing:-.045em;display:block;line-height:1;color:var(--text)}
.stat .u{font-family:var(--mono);font-size:.72rem;color:var(--text-mute);
  display:block;margin-top:.5rem}

/* ---------- tiles / feed ---------- */
.tiles{display:grid;gap:1.2rem;grid-template-columns:repeat(auto-fit,minmax(17rem,1fr))}
.tile{background:var(--bg);border:1px solid var(--line);border-radius:var(--r);
  padding:1.25rem 1.3rem}
.section--alt .tile{background:var(--surface-2)}
.tile .stamp{font-family:var(--mono);font-size:.7rem;letter-spacing:.1em;
  text-transform:uppercase;color:var(--accent-2);margin-bottom:.55rem;font-weight:600}
.tile .stamp--no{color:var(--no)}
.tile h3{margin:0 0 .8rem}
.list{list-style:none;margin:0;padding:0;font-size:.9rem}
.list li{padding:.55rem 0;border-top:1px solid var(--line);color:var(--text-soft)}
.list li:first-child{border-top:0}
.list b{display:block;color:var(--text);font-weight:600}
.list span{font-family:var(--mono);font-size:.72rem;color:var(--text-mute)}
.tile .more{display:inline-block;margin-top:.9rem;font-size:.85rem;font-weight:600}

/* ---------- link strip ---------- */
.strip{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))}
.strip a{display:block;background:var(--bg);border:1px solid var(--line);
  border-radius:var(--r);padding:1.2rem 1.3rem;color:var(--text);
  box-shadow:var(--shadow);
  transition:transform .25s ease,box-shadow .25s ease,border-color .25s ease}
.section--alt .strip a{background:var(--surface-2)}
.strip a:hover{text-decoration:none;border-color:var(--accent);
  transform:translateY(-4px);box-shadow:var(--shadow-strong)}
.strip .t{font-family:var(--display);font-weight:700;display:block;
  margin-bottom:.2rem;letter-spacing:-.02em}
.strip .d{font-size:.85rem;color:var(--text-mute)}

/* ---------- data tables ---------- */
.table-scroll{overflow-x:auto;border:1px solid var(--line);border-radius:var(--r);
  background:var(--bg)}
.section--alt .table-scroll{background:var(--surface-2)}
table.data{width:100%;border-collapse:collapse;font-size:.92rem;min-width:44rem}
table.data caption{caption-side:bottom;text-align:left;font-size:.78rem;
  color:var(--text-mute);padding:.9rem 1rem;line-height:1.55}
table.data th,table.data td{padding:.6rem .9rem;text-align:left;
  border-bottom:1px solid var(--line)}
table.data thead th{font-family:var(--mono);font-size:.72rem;letter-spacing:.08em;
  text-transform:uppercase;color:var(--text-mute);font-weight:600;
  border-bottom:1px solid var(--line-strong);white-space:nowrap}
table.data tbody th{font-weight:600;color:var(--text);white-space:nowrap}
table.data td{font-family:var(--mono);color:var(--text-soft);white-space:nowrap}
table.data tbody tr:last-child td,table.data tbody tr:last-child th{border-bottom:0}
table.data .ord{font-family:var(--mono);font-size:.74rem;font-weight:600}
table.data .ord--no{color:var(--no)}
table.data .ord--io{color:var(--io)}
table.data tr.row-alt th,table.data tr.row-alt td{background:var(--surface)}
:root[data-theme="light"] table.data tr.row-alt th,
:root[data-theme="light"] table.data tr.row-alt td{background:var(--bg-deep)}

/* ---------- callout / conventions ---------- */
.callout{background:var(--surface);border:1px solid var(--line);
  border-left:3px solid var(--accent);border-radius:var(--r-sm);
  padding:1.1rem 1.2rem;font-size:.92rem;color:var(--text-soft)}
.section--alt .callout{background:var(--bg)}
.callout h4{color:var(--text);margin:0 0 .5rem}
.callout p{margin:0 0 .6rem}
.callout p:last-child{margin:0}

/* ---------- release entry ---------- */
.release{border-top:1px solid var(--line);padding-top:1.8rem;margin-top:2.4rem}
.release:first-of-type{border-top:0;padding-top:0;margin-top:0}
.release__meta{display:flex;gap:.5rem;flex-wrap:wrap;font-family:var(--mono);
  font-size:.75rem;color:var(--text-mute);margin:.6rem 0 1.2rem}
.tag{border:1px solid var(--line);border-radius:999px;padding:.18rem .65rem}
.authors{font-size:.88rem;color:var(--text-mute);margin:.4rem 0 0}
.authors strong{color:var(--text-soft)}

/* ---------- two-column split ---------- */
.split{display:grid;gap:2rem;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);
  align-items:start}

/* ---------- footer ---------- */
.site-footer{border-top:1px solid var(--line);background:var(--bg-deep);
  padding-block:2.6rem;font-size:.88rem;color:var(--text-soft)}
.site-footer__inner{display:grid;gap:2rem;
  grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))}
.site-footer h4{color:var(--text);margin:0 0 .6rem}
.site-footer ul{list-style:none;margin:0;padding:0}
.site-footer li{padding:.15rem 0}
.site-footer a{color:var(--text-soft)}
.site-footer a:hover{color:var(--accent)}
.site-footer__base{margin:2rem 0 0;color:var(--text-mute);font-size:.82rem}

/* ---------- accordion ---------- */
.acc{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-sm);
  overflow:hidden}
.acc > summary{cursor:pointer;list-style:none;padding:1rem 3rem 1rem 1.3rem;
  font-family:var(--display);font-weight:600;color:var(--text);position:relative}
.acc > summary::-webkit-details-marker{display:none}
.acc > summary::after{content:"";position:absolute;right:1.3rem;top:50%;
  width:.6rem;height:.6rem;border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;transform:translateY(-75%) rotate(45deg);
  transition:transform .18s ease}
.acc[open] > summary::after{transform:translateY(-25%) rotate(-135deg)}
.acc > summary:hover{color:var(--accent)}
.acc__body{padding:0 1.3rem 1.3rem;color:var(--text-soft)}
.acc__body > :last-child{margin-bottom:0}

/* ---------- literature search ----------
   Ported from the search page of home.ba.infn.it/~marrone: same behaviour and
   the same search.js, restyled onto this site's tokens (gold→accent,
   cyan→no, violet→io) so it belongs here rather than looking transplanted. */
.lit{max-width:52rem;margin-inline:auto}
.lit__label{display:block;font-family:var(--display);font-size:.7rem;font-weight:600;
  letter-spacing:.17em;text-transform:uppercase;color:var(--accent);margin:0 0 .6rem}
.lit__free{width:100%;font-family:var(--display);font-size:clamp(1rem,.9rem + .5vw,1.25rem);
  padding:.95rem 1.2rem;color:var(--text);background:var(--surface);
  border:1px solid var(--line-strong);border-radius:999px;
  transition:border-color .2s ease,box-shadow .2s ease}
.lit__free::placeholder{color:var(--text-mute)}
.lit__free:focus{outline:none;border-color:var(--accent);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 20%,transparent)}
.lit input[type=text],.lit select{width:100%;font-family:var(--body);font-size:.95rem;
  padding:.6rem .85rem;color:var(--text);background:var(--bg);
  border:1px solid var(--line-strong);border-radius:var(--r-sm)}
.lit input[type=text]:focus,.lit select:focus{outline:none;border-color:var(--no)}
.lit__hint{font-size:.86rem;color:var(--text-mute);margin:.85rem 0 0;line-height:1.6}
.lit__hint code{font-size:.85em;font-family:var(--mono)}
.lit__note{display:block;font-size:.78rem;color:var(--text-mute);margin-top:.35rem}
.lit__grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(13rem,1fr))}
.lit__acc{margin-top:1.25rem}
.lit__chips{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1.1rem;min-height:1.9rem}
.chip{display:inline-flex;align-items:center;gap:.5rem;font-size:.83rem;
  background:var(--surface);border:1px solid var(--line-strong);border-radius:999px;
  padding:.32rem .85rem;color:var(--text-soft)}
.chip__k{font-family:var(--mono);font-size:.66rem;letter-spacing:.13em;
  text-transform:uppercase;color:var(--accent)}
.lit__sources{border:0;padding:0;margin:1.5rem 0 0;display:flex;flex-wrap:wrap;
  gap:.5rem 1.4rem;align-items:center}
.lit__sources legend{float:left;width:100%;margin-bottom:.6rem}
.lit__check{display:inline-flex;align-items:center;gap:.5rem;font-size:.93rem;
  color:var(--text-soft);cursor:pointer}
.lit__check input{accent-color:var(--accent);width:1rem;height:1rem}
.lit__status:focus{outline:none}
/* the sticky header must not cover the results when we scroll to them */
#lit-pane{scroll-margin-top:5rem}
.lit__status{font-size:.92rem;color:var(--text-soft);margin:0 0 1.5rem;
  display:flex;align-items:center;gap:.6rem;min-height:1.5rem}
.lit__results{display:grid;gap:2.25rem}
.lit-group{display:flex;align-items:baseline;gap:.85rem;font-size:1rem;
  font-family:var(--mono);color:var(--accent);text-transform:uppercase;
  letter-spacing:.1em;margin:0 0 .35rem;padding-bottom:.6rem;
  border-bottom:1px solid var(--line)}
.lit-group .count{margin-left:auto;font-family:var(--body);font-size:.78rem;
  letter-spacing:0;text-transform:none;color:var(--text-mute);
  background:var(--surface-2);border-radius:999px;padding:.1rem .6rem}
.lit-group__note{font-size:.84rem;color:var(--text-mute);margin:0 0 1.1rem}

/* match buckets, strongest first — colour-coded down the left edge */
.lit-bucket{border-left:2px solid transparent;padding-left:1.1rem}
.lit-bucket--exact{border-left-color:var(--accent)}
.lit-bucket--authors{border-left-color:var(--no)}
.lit-bucket--authors .lit-group{color:var(--no)}
.lit-bucket--some{border-left-color:var(--accent-2)}
.lit-bucket--some .lit-group{color:var(--accent-2)}
.lit-bucket--topic{border-left-color:var(--line-strong)}
.lit-bucket--topic .lit-group{color:var(--text-soft)}
@media (max-width:600px){.lit-bucket{padding-left:.75rem}}

/* which database(s) returned a given record */
.src-row{display:inline-flex;gap:.35rem;flex-wrap:wrap;margin-left:auto}
.src{font-family:var(--mono);font-size:.66rem;letter-spacing:.1em;
  text-transform:uppercase;padding:.1rem .5rem;border-radius:999px;
  border:1px solid var(--line-strong);color:var(--text-mute)}
.src--inspire{color:var(--no);border-color:color-mix(in srgb,var(--no) 40%,transparent)}
.src--crossref{color:var(--src-3);border-color:color-mix(in srgb,var(--src-3) 40%,transparent)}
.src--openalex{color:var(--accent-2);border-color:color-mix(in srgb,var(--accent-2) 40%,transparent)}
.src--s2{color:var(--dec-1);border-color:color-mix(in srgb,var(--dec-1) 40%,transparent)}
.spin{width:.95rem;height:.95rem;border:2px solid var(--line-strong);
  border-top-color:var(--accent);border-radius:50%;display:inline-block;
  animation:spin .7s linear infinite;flex:none}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation:none}}

/* result records */
.publist{list-style:none;padding:0;margin:0;display:grid;gap:.85rem}
.publist li{background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-sm);padding:.95rem 1.15rem}
.publist li:hover{border-color:var(--line-strong)}
.pub__title{font-family:var(--display);font-weight:600;color:var(--text);
  display:block;margin-bottom:.3rem;letter-spacing:-.01em}
.pub__authors{font-size:.89rem;color:var(--text-mute);margin-bottom:.3rem}
.pub__authors .me{font-weight:700;color:var(--text-soft)}
.pub__ref{font-size:.85rem;color:var(--text-mute);display:flex;flex-wrap:wrap;
  gap:.4rem .9rem;align-items:baseline}
.pub__ref .journal{color:var(--text-soft)}
.pub__ref a{color:var(--no)}
.pub__ref a:hover{color:var(--text)}
.pub__year{font-family:var(--mono);font-variant-numeric:tabular-nums;
  color:var(--text-mute)}

/* ---------- responsive ---------- */
@media (max-width:56rem){
  .hero--split .hero__in{grid-template-columns:1fr}
  .split{grid-template-columns:1fr}
}
@media (max-width:48rem){
  .nav{display:none;width:100%;flex-direction:column;gap:.55rem;
    padding-top:.6rem;border-top:1px solid var(--line);margin-top:.4rem}
  .nav.is-open{display:flex}
  .nav a[aria-current="page"]{box-shadow:none;color:var(--accent)}
  .nav-toggle{display:block}
}

/* ---------- parameter-history panels ---------- */
.panels{display:grid;gap:1.2rem;margin-top:1.6rem;
  grid-template-columns:repeat(auto-fit,minmax(20rem,1fr))}
.panels .figure{color:var(--text-soft)}          /* axes inherit currentColor */
.figure__unit{font-family:var(--mono);font-size:.68rem;color:var(--text-mute);
  text-transform:none;letter-spacing:0}
.legend--chart{gap:1.4rem;font-size:.78rem}
.legend .k-any{background:var(--text-soft)}
.legend .k-bari{background:var(--grp-bari)}
.legend .k-nufit{background:var(--grp-nufit)}
.legend .k-valencia{background:var(--grp-valencia)}
table.data--refs td{white-space:normal;font-family:var(--body)}
table.data--refs td.ref{min-width:20rem;color:var(--text)}
.ref__meta{display:block;font-family:var(--mono);font-size:.72rem;
  color:var(--text-mute);margin-top:.2rem}

/* ---------- automated pages: citations under an item ---------- */
.list--news li{padding:.75rem 0}
.list--news b{margin-bottom:.15rem}
.cites{display:flex;flex-wrap:wrap;gap:.35rem .9rem;margin-top:.4rem;
  font-family:var(--mono);font-size:.72rem;color:var(--text-mute)}
.cites a{color:var(--no)}
.cites a:hover{color:var(--text)}
.cite{display:inline-flex;gap:.4rem;flex-wrap:wrap}
.tile .cites{margin-top:.7rem;padding-top:.7rem;border-top:1px solid var(--line)}
.tile p{margin:0;color:var(--text-soft);font-size:.92rem}
.list--news li > p{margin:0 0 .1rem;color:var(--text-soft)}

/* ============================================================
   Richer surfaces
   Sections carry a faint field of light rather than a flat
   colour, cards a coloured rule and a lift on hover, interior
   pages a proper header. Nothing here encodes a value: the
   decorative accents cycle for rhythm, and every card also
   carries a written label.
   ============================================================ */

/* ---------- sections with a field of light ---------- */
.section{position:relative;overflow:hidden}
.section--glow::before{content:"";position:absolute;inset:-30% -10% auto -10%;
  height:70%;pointer-events:none;z-index:0;
  background:radial-gradient(58% 60% at 22% 0%,var(--glow-1),transparent 70%),
             radial-gradient(50% 55% at 82% 8%,var(--glow-2),transparent 72%)}
.section > .wrap{position:relative;z-index:1}


/* ---------- cards ---------- */
.cards{display:grid;gap:clamp(1.1rem,2.2vw,1.7rem);
  grid-template-columns:repeat(auto-fit,minmax(17.5rem,1fr))}
.cards--2{grid-template-columns:repeat(auto-fit,minmax(21rem,1fr))}
.card{position:relative;display:flex;flex-direction:column;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--r);
  padding:clamp(1.4rem,2.6vw,1.9rem);overflow:hidden;box-shadow:var(--shadow);
  transition:transform .25s ease,border-color .25s ease,box-shadow .25s ease}
.section--alt .card{background:var(--bg)}
.card::before{content:"";position:absolute;top:0;left:0;right:0;height:3px;
  background:var(--dec-1);opacity:.9}
.card--2::before{background:var(--dec-2)}
.card--3::before{background:var(--dec-3)}
.card--4::before{background:var(--dec-4)}
.card--5::before{background:var(--dec-5)}
a.card:hover{transform:translateY(-5px);border-color:var(--line-strong);
  box-shadow:var(--shadow-strong);text-decoration:none}
.card__tag{display:inline-block;font-family:var(--mono);font-size:.64rem;font-weight:600;
  letter-spacing:.15em;text-transform:uppercase;color:var(--text-mute);
  background:var(--surface-2);border:1px solid var(--line);border-radius:999px;
  padding:.28rem .7rem;margin-bottom:.9rem;align-self:flex-start}
.card h3{color:var(--dec-1);margin-bottom:.5rem}
.card--2 h3{color:var(--dec-2)}
.card--3 h3{color:var(--dec-3)}
.card--4 h3{color:var(--dec-4)}
.card--5 h3{color:var(--dec-5)}
.card p{color:var(--text-soft);font-size:.95rem;margin:0 0 1.1rem}
.card__list{list-style:none;padding:0;margin:0 0 1.2rem;font-size:.9rem}
.card__list li{display:flex;gap:.6rem;align-items:flex-start;margin-bottom:.5rem;
  color:var(--text-soft)}
.card__list li::before{content:"→";color:var(--dec-1);flex:none;line-height:1.6}
.card--2 .card__list li::before{color:var(--dec-2)}
.card--3 .card__list li::before{color:var(--dec-3)}
.card--4 .card__list li::before{color:var(--dec-4)}
.card--5 .card__list li::before{color:var(--dec-5)}
.card__go{margin-top:auto;font-family:var(--mono);font-size:.72rem;font-weight:600;
  letter-spacing:.12em;text-transform:uppercase;color:var(--dec-1)}
.card--2 .card__go{color:var(--dec-2)}
.card--3 .card__go{color:var(--dec-3)}
.card--4 .card__go{color:var(--dec-4)}
.card--5 .card__go{color:var(--dec-5)}
a.card:hover .card__go{color:var(--text)}

/* tiles and stat cards join the same family */
.tile{box-shadow:var(--shadow);transition:transform .25s ease,box-shadow .25s ease}
.tile:hover{transform:translateY(-3px);box-shadow:var(--shadow-strong)}
.figure{box-shadow:var(--shadow)}

/* ---------- a sparkline inside a stat card ---------- */
.stat__spark{margin-top:.75rem;display:block;width:100%;height:2.4rem}
.stat__spark .line{fill:none;stroke:var(--no);stroke-width:2;stroke-linejoin:round;
  stroke-linecap:round}
.stat__spark .band{fill:var(--no);opacity:.14}
.stat__spark .dot{fill:var(--no)}
.stat__sparklabel{font-family:var(--mono);font-size:.64rem;color:var(--text-mute);
  display:block;margin-top:.25rem}

/* ---------- wide figure band ---------- */
.figure--wide{padding:clamp(1.2rem,2.6vw,1.8rem)}
.figure--wide svg{max-height:26rem}
.figure__head{display:flex;align-items:baseline;gap:.8rem;flex-wrap:wrap;margin-bottom:.9rem}
.figure__head h3{margin:0}
.figure__head p{margin:0;font-family:var(--mono);font-size:.72rem;color:var(--text-mute)}

/* ---------- back to top ---------- */
.to-top{position:fixed;right:1.1rem;bottom:1.1rem;z-index:15;width:2.6rem;height:2.6rem;
  border-radius:50%;border:1px solid var(--line-strong);background:var(--surface);
  color:var(--text-soft);cursor:pointer;padding:.6rem;opacity:0;visibility:hidden;
  transform:translateY(8px);transition:opacity .22s ease,transform .22s ease,
  visibility .22s ease;box-shadow:var(--shadow)}
.to-top.is-on{opacity:1;visibility:visible;transform:none}
.to-top:hover{color:var(--text);border-color:var(--accent)}
.to-top svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:2}

/* ---------- scroll reveal ---------- */
.reveal{opacity:0;transform:translateY(14px);
  transition:opacity .55s ease,transform .55s ease}
.reveal.is-in{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){
  .reveal{opacity:1;transform:none;transition:none}
  .card,.tile,.strip a{transition:none}
  a.card:hover,.tile:hover,.strip a:hover{transform:none}
}

/* ---------- world map: pan, zoom, filter, card ----------
   The photograph rules that used to style the standalone gallery (a grid of
   <figure class="shot">) now style the map's card instead — the pictures
   moved there, so the credit line and the image treatment moved with them,
   under new selectors rather than a rewrite of the declarations themselves. */
.map-stage{position:relative}
.map-stage svg{cursor:grab;touch-action:none}
.map-stage svg:active{cursor:grabbing}
.map-pin{cursor:pointer}

.legend--chart [data-filter]{cursor:pointer}
.legend--chart [data-filter][aria-pressed="false"]{opacity:.4}

.map-ctl{position:absolute;top:.8rem;right:.8rem;z-index:5;display:flex;
  flex-direction:column;gap:.4rem}
.map-ctl button{width:2rem;height:2rem;padding:0;display:flex;align-items:center;
  justify-content:center;font-family:var(--mono);font-size:1rem;line-height:1;
  border-radius:var(--r-sm);border:1px solid var(--line-strong);
  background:var(--surface);color:var(--text-soft);cursor:pointer}
.map-ctl button:hover{border-color:var(--accent);color:var(--text)}

/* The card sits at bottom-LEFT and the toolbar stays top-right on purpose:
   a fanned site's card can grow tall (Gran Sasso alone lists eight
   experiments), and anchoring both to the same corner let a tall card's
   higher z-index cover the zoom-out and reset buttons underneath it — silent
   and only caught by clicking there. Opposite corners cannot overlap
   regardless of how tall the card grows. */
.map-card{position:absolute;z-index:6;left:.8rem;bottom:.8rem;
  width:min(21rem,calc(100% - 1.6rem));max-height:min(75%,28rem);overflow-y:auto;
  background:var(--bg);border:1px solid var(--line-strong);border-radius:var(--r);
  box-shadow:var(--shadow-strong);padding:1rem 1.15rem}
.map-card__close{position:absolute;top:.6rem;right:.6rem;width:1.6rem;height:1.6rem;
  display:flex;align-items:center;justify-content:center;border:none;
  background:transparent;color:var(--text-mute);font-size:1.1rem;line-height:1;
  cursor:pointer}
.map-card__close:hover{color:var(--text)}
.map-card__title{margin:0 1.6rem .6rem 0;font-family:var(--display);
  font-size:1.02rem;letter-spacing:-.01em;color:var(--text)}
.map-card__exp{padding:.65rem 0}
.map-card__exp + .map-card__exp{border-top:1px solid var(--line)}
.map-card__name{margin:0;font-weight:600;color:var(--text)}
.map-card__name a{color:var(--accent);text-decoration:none}
.map-card__name a:hover{text-decoration:underline}
.map-card__meta{margin:.2rem 0 0;font-family:var(--mono);font-size:.72rem;
  color:var(--text-mute)}
.map-card__note{margin:.3rem 0 0;font-size:.82rem;color:var(--text-soft)}
.map-card__photo{margin:.7rem 0 0}
.map-card img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block;
  background:var(--surface-2);border-radius:var(--r-sm)}
.map-card__credit{display:block;margin-top:.45rem;font-family:var(--mono);
  font-size:.68rem;color:var(--text-mute);line-height:1.5}
.map-card__credit a{color:var(--text-mute);text-decoration:underline}
.map-card__credit a:hover{color:var(--accent)}

/* ---------- Δχ² explorer ---------- */
.chi2__bar{display:flex;flex-wrap:wrap;gap:.7rem 1.4rem;align-items:center;
  margin-bottom:1.1rem}
.chi2__group{display:flex;flex-wrap:wrap;gap:.4rem}
.chi2__chip{font-family:var(--mono);font-size:.72rem;letter-spacing:.04em;
  border:1px solid var(--line-strong);background:var(--bg);color:var(--text-soft);
  border-radius:999px;padding:.3rem .8rem;cursor:pointer}
.section--alt .chi2__chip{background:var(--surface-2)}
.chi2__chip:hover{border-color:var(--accent);color:var(--text)}
.chi2__chip[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);
  color:var(--on-accent)}
.chi2__switch{display:inline-flex;align-items:center;gap:.5rem;font-size:.82rem;
  color:var(--text-soft);cursor:pointer}
.chi2__switch input{accent-color:var(--accent);width:1rem;height:1rem}
.chi2__plot{color:var(--text-soft)}
.chi2__svg{width:100%;height:auto;display:block}
.chi2__readout{font-family:var(--mono);font-size:.78rem;color:var(--text);
  background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r-sm);
  padding:.55rem .8rem;margin:.9rem 0 0;min-height:1.2rem}

/* ---------------------------------------------------------- figure zoom --- */
/* A figure that can be opened says so quietly: the cursor and a hairline on
   hover, nothing that competes with the drawing itself. Only figures the
   script has wired get the class, so with JavaScript off nothing invites a
   click that would do nothing. */
.figure--openable{cursor:zoom-in}
.figure--openable:hover{border-color:var(--line-strong)}
.figure--openable:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

/* The page behind must not scroll while a figure is open. */
.figbox-open,.figbox-open body{overflow:hidden}

.figbox{position:fixed;inset:0;z-index:50;display:flex;flex-direction:column;
  background:var(--bg);padding:1rem clamp(1rem,4vw,3rem) 1.4rem}
.figbox__bar{display:flex;gap:.4rem;align-items:center;justify-content:flex-end;
  margin-bottom:.7rem}
.figbox__bar button{width:2.1rem;height:2.1rem;padding:0;display:flex;
  align-items:center;justify-content:center;font-family:var(--mono);
  font-size:1rem;line-height:1;border-radius:var(--r-sm);
  border:1px solid var(--line-strong);background:var(--surface);
  color:var(--text-soft);cursor:pointer}
.figbox__bar button:hover{border-color:var(--accent);color:var(--text)}
.figbox__close{margin-left:.5rem}

/* The frame clips; the stage is what moves. Keeping the transform on an inner
   element means panning never fights the scrollbar of the page underneath. */
.figbox__frame{flex:1;min-height:0;overflow:hidden;display:flex;
  align-items:center;justify-content:center;touch-action:none}
/* The stage must FILL the frame, not shrink to the drawing: an SVG with a
   520x250 viewBox has that as its intrinsic size, so a shrink-to-fit stage
   made "width:100%" resolve to 520px and the enlarged view was no larger than
   the page. It filled a screen only once the stage was given the frame's
   dimensions to resolve against. */
.figbox__stage{transform-origin:center center;will-change:transform;
  width:100%;height:100%;display:flex;align-items:center;justify-content:center}
.figbox__stage svg{width:100%;height:100%}
.figbox__stage img{width:100%;height:100%;object-fit:contain;display:block}

.figbox__cap{margin-top:.9rem;max-width:60ch;color:var(--text-soft);
  font-size:.88rem;line-height:1.5}
.figbox__cap b{display:block;color:var(--text);font-family:var(--display);
  font-size:1rem;margin-bottom:.3rem}
.figbox__cap p{margin:0}

@media (prefers-reduced-motion:reduce){
  .figbox__stage{will-change:auto}
}
