/* ICMNS: IBM Plex Sans (display) and IBM Plex Mono (text) on the Nord palette
   (nordtheme.com). Light mode: Snow Storm paper, Polar Night ink, Frost accents.
   Dark mode: Polar Night paper. Aurora colours only for status signals. */

:root {
  --paper: #eceff4;
  --ink: #2e3440;
  --muted: #4c566a;
  --rule: #d8dee9;
  --accent: #4c6e96;          /* Frost #5e81ac, deepened for text contrast on Snow Storm */
  --accent-soft: #5e81ac;
  --btn: #88c0d0;
  --btn-ink: #2e3440;
  --band: #2e3440;            /* Polar Night panel: the footer */
  --band-ink: #eceff4;
  --band-muted: #a3acbd;
  --band-rule: #434c5e;
  --band-accent: #88c0d0;
  --red: #bf616a; --yellow: #ebcb8b; --green: #a3be8c;
  --display: "IBM Plex Sans", Arial, sans-serif;
  --text: "IBM Plex Mono", ui-monospace, monospace;
  --max: 72rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #2e3440; --ink: #eceff4; --muted: #a3acbd; --rule: #434c5e; --accent: #88c0d0; --accent-soft: #88c0d0;
    --band: #3b4252; --band-rule: #4c566a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #2e3440; --ink: #eceff4; --muted: #a3acbd; --rule: #434c5e; --accent: #88c0d0; --accent-soft: #88c0d0;
  --band: #3b4252; --band-rule: #4c566a;
  color-scheme: dark;
}

/* The logo hides fibres with the page colour, so each theme has its own file */
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-dark { display: block !important; }
}
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 15px/1.7 var(--text);
}
main { flex: 1; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
::selection { background: #88c0d0; color: #2e3440; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; }
.meta { color: var(--muted); }

/* ---------------------------------------------------------------- header */
.masthead { border-bottom: 1px solid var(--rule); padding: .8rem 0; }
.masthead .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand img { width: 44px; height: 44px; display: block; }
.brand span { font-family: var(--display); font-weight: 500; font-size: 1.3rem; letter-spacing: .04em; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.4rem; font-size: .85rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: .35em; }
.theme { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 4px; color: var(--muted); }
.theme:hover { color: var(--ink); background: color-mix(in srgb, var(--rule) 60%, transparent); }
.theme:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: none; }
.theme[data-mode="auto"] .i-auto, .theme[data-mode="light"] .i-light, .theme[data-mode="dark"] .i-dark { display: block; }

/* ---------------------------------------------------------------- buttons */
.cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.button { display: inline-block; padding: .55rem 1rem; border: 1px solid var(--rule); border-radius: 4px; text-decoration: none; font-size: .9rem; line-height: 1.4; }
.button:hover { border-color: var(--accent-soft); color: var(--accent); }
.button-primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.button-primary:hover { background: #8fbcbb; border-color: #8fbcbb; color: var(--btn-ink); }

/* ---------------------------------------------------------------- home */
/* the home page fits the window: logo and title centred between menu and footer */
.is-home main { display: flex; align-items: center; }
.is-home main > .wrap { width: 100%; }
.landing { display: grid; gap: 2rem clamp(1.5rem, 5vw, 5rem); align-items: center; padding: min(2rem, 3vh) 0; }
.landing-mark img { width: 100%; height: auto; max-height: calc(100vh - 12rem); object-fit: contain; display: block; }   /* never taller than the window */
.landing h1 { font-weight: 300; font-size: clamp(1.8rem, min(5.2vw, 8vh), 4.4rem); line-height: 1.04; letter-spacing: -.025em; margin: 0; }
.landing-next { margin: min(2rem, 3.5vh) 0 0; font-size: .95rem; }
@media (min-width: 52rem) { .landing { grid-template-columns: 5fr 7fr; } }
@media (max-width: 51.99rem) { .landing-mark { max-width: 22rem; } }

/* ---------------------------------------------------------------- inner pages */
.page-head { padding: clamp(2rem, 6vw, 4.5rem) 0 2.5rem; }
.page-head h1 { font-weight: 300; font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -.025em; margin: 0; max-width: 20ch; }
.page-head .meta { margin: 1rem 0 0; }
.page-head .meta a, .prose a { color: var(--accent); font-weight: 500; text-decoration: none; }
.page-head .meta a:hover, .prose a:hover, .page-head .meta a:focus-visible, .prose a:focus-visible { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }

.intro { padding-bottom: 2.5rem; }
.prose { max-width: 66ch; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .2em 0; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 500; }
.prose h3 { font-size: 1.2rem; margin: 1.8em 0 .5em; }

/* sections: heading on the left, text on the right */
.block { display: grid; gap: .75rem 3rem; border-top: 1px solid var(--rule); padding: 2.25rem 0; }
.block h2 { font-size: 1.5rem; line-height: 1.2; margin: 0; }
.block .prose { max-width: none; }
.block .prose > p, .block .prose > ul, .block .prose > ol { max-width: 66ch; }
@media (min-width: 52rem) { .block { grid-template-columns: 15rem 1fr; } }

/* lists of people (e.g. plenary speakers): name in Plex Sans */
.block .prose > ul:only-child { list-style: none; padding: 0; }
.block .prose > ul:only-child li { padding: .55rem 0; border-bottom: 1px solid var(--rule); margin: 0; font-size: .85rem; color: var(--muted); }
.block .prose > ul:only-child li:first-child { padding-top: 0; }
.block .prose > ul:only-child li strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.2rem; line-height: 1.35; color: var(--ink); letter-spacing: -.01em; }

/* ---------------------------------------------------------------- tables */
table { border-collapse: collapse; width: 100%; }
.prose table, .data { font-size: .9rem; }
th, td { text-align: left; vertical-align: baseline; padding: .5rem 1rem .5rem 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 400; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); border-bottom-color: var(--ink); padding-top: 0; }
.data td.year { font-family: var(--display); font-size: 1.1rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.data td.year a { text-decoration: none; }

/* past editions: each row links to its edition */
.editions tbody tr { cursor: pointer; }
.editions td.year a { color: var(--accent); }
.editions tbody tr:hover td, .editions tbody tr:focus-within td { background: color-mix(in srgb, var(--accent-soft) 10%, transparent); }
.editions td.year a:focus-visible { outline: none; }
.editions tbody tr:focus-within { outline: 2px solid var(--accent-soft); outline-offset: -2px; }
.editions td:first-child { padding-left: .5rem; }
.editions th:first-child { padding-left: .5rem; }
.editions-list { margin-bottom: 4rem; }
.table-scroll { overflow-x: auto; }

/* key dates: Aurora status signals */
.status { display: inline-flex; align-items: center; gap: .45em; font-size: .85em; white-space: nowrap; }
.status::before { content: ""; width: .6em; height: .6em; border-radius: 50%; background: currentColor; }
.s-done { color: var(--muted); }
.s-done::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.s-soon::before { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent); }
.s-open::before { background: var(--green); }
.s-next::before { background: var(--yellow); }
.key-dates tr.is-soon td:first-child { box-shadow: inset 3px 0 0 var(--red); padding-left: .75rem; }

/* ---------------------------------------------------------------- news */
.news { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.news li { display: grid; gap: .25rem 2rem; padding: 1.25rem 0; border-bottom: 1px solid var(--rule); }
.news time { font-size: .8rem; color: var(--muted); padding-top: .35rem; }
.news a { font-family: var(--display); font-size: 1.3rem; line-height: 1.3; letter-spacing: -.01em; text-decoration: none; }
.news a:hover { color: var(--accent); }
.news p { margin: .4rem 0 0; color: var(--muted); font-size: .9rem; max-width: 66ch; }
@media (min-width: 52rem) { .news li { grid-template-columns: 15rem 1fr; } }
main > .wrap > .news { margin-bottom: 4rem; }

.post .page-head { padding-bottom: 2rem; }
.post .page-head .meta { margin: 0 0 .75rem; }
.post .page-head h1 { max-width: 24ch; }
.post-body { padding-bottom: 1rem; }
.post-back { margin: 2rem 0 4rem; font-size: .9rem; }
.post-back a { color: var(--accent); text-decoration: none; }
figure { margin: 2rem 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 4px; }
figcaption { margin-top: .5rem; font-size: .75rem; color: var(--muted); }

/* maths: typeset by LaTeX (IBM Plex Mono Italic) as SVG, in the text colour */
.math svg { display: inline-block; overflow: visible; }
.math-inline { font-size: 1.12em; white-space: nowrap; }
.math-block { text-align: left; padding-left: 1.5em; margin: 1.4rem 0 1.6rem; font-size: 1.3em; overflow-x: auto; overflow-y: hidden; }   /* left, slightly indented, as with LaTeX's fleqn */
.math-missing { color: var(--red); }

/* bibliography: numbered [1], [2], ... to match the citations in the text */
.bibliography { list-style: none; counter-reset: ref; padding: 0; font-size: .85rem; }
.bibliography li { counter-increment: ref; position: relative; padding-left: 2.6em; margin: 0 0 .8em; }
.bibliography li::before { content: "[" counter(ref) "]"; position: absolute; left: 0; color: var(--muted); }
.bibliography li:target { background: color-mix(in srgb, var(--accent-soft) 12%, transparent); }
.bibliography a { word-break: break-all; }

/* colophon: the logo above the introduction */
.colophon-logo { max-width: 22rem; margin: 0 0 2rem; }
.colophon-logo img { width: 100%; height: auto; }

/* ---------------------------------------------------------------- network map */
.network { position: relative; margin: 0 0 3rem; }
.network-map { display: block; width: 100%; height: auto; overflow: hidden; }
/* the map is cropped to the nodes: soften its edges so the crop doesn't look cut */
.network-map { -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 88%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 88%, transparent); mask-composite: intersect; }
.network-map .land { stroke: var(--muted); stroke-opacity: .32; stroke-width: 3.1; stroke-linecap: round; fill: none; }
.network { --europe: #5e81ac; --north-america: #a3be8c; --asia: #b48ead; --oceania: #8fbcbb; --spike: #d08770; }
:root[data-theme="dark"] .network { --europe: #88c0d0; --spike: #ebcb8b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .network { --europe: #88c0d0; --spike: #ebcb8b; } }
.network-map .link { fill: none; stroke: var(--muted); stroke-width: 1; stroke-opacity: .45; }
.network-map .node { --c: var(--europe); }
.network-map .region-north-america { --c: var(--north-america); }
.network-map .region-asia { --c: var(--asia); }
.network-map .region-oceania { --c: var(--oceania); }
.network-map .dot { fill: var(--c); stroke: var(--paper); stroke-width: 1.5; }
.network-map .node { cursor: pointer; outline: none; }
.network-map .node:hover .dot, .network-map .node:focus .dot { fill: var(--ink); }
.network-map .halo { fill: none; stroke: var(--spike); stroke-width: 1.5; opacity: 0; }
.network-map .halo.fire { animation: fire 1.1s ease-out; }
@keyframes fire { from { r: 4; opacity: .9; } to { r: 18; opacity: 0; } }
.network-map .spike { fill: none; stroke: var(--spike); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.network-tip { position: absolute; transform: translate(-50%, calc(-100% - 14px)); padding: .25rem .55rem; border-radius: 4px;
  background: var(--band); color: var(--band-ink); font-size: .78rem; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; }
.network-tip.on { opacity: 1; }
/* the people: one column per region, then countries, then people */
.block .network-list { border-top: 0; padding: 1rem 0 0; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.network-list { display: grid; gap: 2rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); border-top: 1px solid var(--rule); padding: 2rem 0 4rem; }
.network-region h3 { font-weight: 300; font-size: 1.6rem; line-height: 1.1; margin: 0 0 1.25rem; letter-spacing: -.015em; }
.network-country { margin: 0 0 1.5rem; }
.network-country h4 { font-family: var(--display); font-weight: 500; font-size: 1.05rem; margin: 0 0 .6rem; padding-bottom: .35rem; border-bottom: 1px solid var(--rule); }
.network-country ul { list-style: none; margin: 0; padding: 0; }
.network-country li { margin: 0 0 .7rem; line-height: 1.3; }
.network-country .who { display: block; font-family: var(--display); font-size: 1rem; }
.network-country .where { display: block; font-size: .75rem; color: var(--muted); margin-top: .1rem; }

/* ---------------------------------------------------------------- footer */
.footer { background: var(--band); color: var(--band-muted); font-size: .8rem; padding: 1.5rem 0 2rem; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.footer a { color: var(--band-ink); text-decoration: none; }
.footer a:hover { color: var(--band-accent); }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 40rem) {
  body { font-size: 14px; }
  .brand img { width: 36px; height: 36px; }
  .landing { min-height: 0; padding-top: 1.5rem; gap: 1.25rem; }
  .landing-mark { max-width: 13rem; }
  .editions th:nth-child(2), .editions td:nth-child(2) { display: none; }
}
