/* HYMN project page. Plain CSS, no build step. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-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: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-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;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/source-serif-4-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: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/source-serif-4-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;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/source-serif-4-latin-wght-italic.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;
}

/* ------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6b6a65;
  --rule: #e1e0d9;
  --rule-strong: #c3c2b7;
  --accent: #1c5cab;
  --accent-soft: #e6effb;
  --paper: #ffffff;
  --paper-ring: rgba(11, 11, 11, 0.08);

  /* technology identity, shared with the logo (brand/make_logo.py):
     UWB, BLE, WiFi validated as a 3-slot all-pairs palette, 5G NR in
     TUD CD Violett1, GNSS in the secondary ink. 5G NR violet sits close to
     UWB blue (dataviz check, 2026-09-29), so every marker keeps its shape
     and label and never relies on colour alone. */
  --uwb: #2a78d6;
  --ble: #eb6834;
  --wifi: #1baf7a;
  --nr5g: #7369be;
  --gnss: #52514e;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --radius: 12px;
  --gutter: 16px;
  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #a3a29b;
    --rule: #2c2c2a;
    --rule-strong: #45453f;
    --accent: #86b6ef;
    --accent-soft: #16263a;
    --paper-ring: rgba(255, 255, 255, 0.10);
    --uwb: #3987e5;
    --ble: #d95926;
    --wifi: #199e70;
    --nr5g: #8c86d2;
    --gnss: #c3c2b7;
  }
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font: 600 clamp(1.5rem, 1.2rem + 1.2vw, 1.9rem)/1.15 var(--serif); letter-spacing: -0.01em; margin-bottom: 1.25rem; }
h3 { font: 600 1.05rem/1.35 var(--sans); margin-bottom: 0.5rem; }
p { margin: 0 0 0.9rem; }
strong { font-weight: 600; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 28px; } }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bg); padding: 0.5rem 0.8rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topnav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.25rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font: 700 1.05rem/1 var(--serif); letter-spacing: 0.04em; color: var(--ink); text-decoration: none; }
.brand-mark { width: 2rem; height: 2rem; flex: none; }
.topnav ul { display: flex; gap: clamp(0.75rem, 2.5vw, 1.75rem); list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.topnav ul a { color: var(--ink-2); text-decoration: none; font-size: 0.92rem; font-weight: 500; white-space: nowrap; }
.topnav ul a:hover { color: var(--ink); }

/* ------------------------------------------------------------ intro */
.intro { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: 1.75rem; }
h1 { font: 650 clamp(2.6rem, 1.8rem + 3.6vw, 4rem)/1 var(--serif); letter-spacing: -0.015em; margin-bottom: 1.1rem; }
/* hero lockup: mark to text as in brand/logo/hymn-logo.svg */
h1.lockup { display: flex; align-items: center; gap: 0.33em; }
h1.lockup .brand-mark { width: 1.8em; height: 1.8em; }
h1 .expansion { display: block; font: 500 clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem)/1.3 var(--serif); letter-spacing: 0.01em; color: var(--ink-2); margin-top: 0.6rem; }
.lead { font-size: clamp(1.08rem, 1rem + 0.35vw, 1.22rem); line-height: 1.55; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--rule-strong); background: var(--surface);
  color: var(--ink); font-size: 0.93rem; font-weight: 500; text-decoration: none;
}
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }

/* ------------------------------------------------------------ hero */
.hero { display: grid; gap: 1.25rem; align-items: start; padding-bottom: 1.5rem; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.2fr 1fr; gap: 1.5rem; } }
figure { margin: 0; }
figcaption { font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); margin-top: 0.6rem; }
figcaption .credit, .credit { color: var(--muted); }
.map-figure, .env-photos, .plate-figure { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.85rem; }
.env-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 0.75rem; align-content: start; }
.env-photos .env-lead { grid-column: 1 / -1; }
.env-photos img { aspect-ratio: 4 / 3; object-fit: cover; }
.env-photos figcaption { font-size: 0.8rem; margin-top: 0.45rem; }
.env-photos .env-lead figcaption { font-size: 0.86rem; }
.plate-figure img { border-radius: 8px; width: 100%; }

.map-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1rem; margin-bottom: 0.6rem; font-size: 0.82rem; color: var(--ink-2); }
.key, .layers { display: flex; flex-wrap: wrap; gap: 0.25rem 0.8rem; list-style: none; margin: 0; padding: 0; }
.key li { display: inline-flex; align-items: center; gap: 0.35rem; }
.sw { width: 13px; height: 13px; flex: none; overflow: visible; }
.layers button {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.12rem 0.55rem; cursor: pointer;
}
.layers button[aria-pressed="false"] { color: var(--muted); background: transparent; text-decoration: line-through; }
.layers button[aria-pressed="false"] .sw { opacity: 0.35; }

/* legend swatches share the map's marker styles */
.k-hall { fill: #fff; stroke: #0b0b0b; stroke-width: 1.5; }
.k-gate { fill: #0b0b0b; stroke: #fff; stroke-width: 1.5; }
.k-out { fill: #fff; stroke: #0b0b0b; stroke-width: 1.5; }
.k-dot { fill: #0b0b0b; }
.k-ts { fill: #fff; stroke: #0b0b0b; stroke-width: 1.4; }
.k-uwb { fill: var(--uwb); }
.k-ble { fill: var(--ble); }
.k-wifi { fill: var(--wifi); }
.k-nr5g { fill: var(--nr5g); }
@media (prefers-color-scheme: dark) {
  .k-hall, .k-out { stroke: #0b0b0b; }
  .k-gate { stroke: #c3c2b7; }
  .k-ts { stroke: #0b0b0b; }
}

.map-wrap { position: relative; border-radius: 8px; overflow: hidden; background: #d9d8d2; }
.sitemap { width: 100%; height: auto; touch-action: manipulation; }
.sitemap text { font: 600 1.35px var(--sans); fill: #fff; stroke: #0b0b0b; stroke-width: 0.28px; paint-order: stroke; }
.sitemap image { filter: saturate(0.5) contrast(1.05); }
.sm-veil { fill: #fcfcfb; opacity: 0.18; pointer-events: none; }
@media (prefers-color-scheme: dark) { .sm-veil { fill: #0d0d0d; opacity: 0.28; } }
.sitemap [data-tip] { cursor: default; }
.sitemap circle, .sitemap polygon, .sitemap rect:not(.sm-veil), .sitemap path { vector-effect: non-scaling-stroke; }
.sm-pt circle { stroke-width: 1.5px; }
.sm-pt-hall circle, .sm-pt-out circle { fill: #fff; stroke: #0b0b0b; }
.sm-pt-gate circle { fill: #0b0b0b; stroke: #fff; }
.sm-pt-out .sm-dot { fill: #0b0b0b; stroke: none; }
.sm-an polygon, .sm-an rect { stroke: #fff; stroke-width: 1.5px; }
.sm-uwb > * { fill: var(--uwb); }
.sm-ble > * { fill: var(--ble); }
.sm-wifi > * { fill: var(--wifi); }
.sm-nr5g > * { fill: var(--nr5g); }
.sm-ts circle { fill: #fff; stroke: #0b0b0b; stroke-width: 1.5px; }
.sm-ts path { stroke: #0b0b0b; stroke-width: 1.5px; fill: none; }
.sm-north path { fill: none; stroke: #fff; stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round; }
.sitemap .sm-label { font-weight: 600; font-size: 1.25px; }
.sm-scale path { fill: none; stroke: #fff; stroke-width: 2px; stroke-linecap: square; }
.sm-north path, .sm-scale path { filter: drop-shadow(0 0 0.6px #0b0b0b) drop-shadow(0 0 0.6px #0b0b0b); }
.sitemap .sm-hit { fill: transparent !important; stroke: none !important; }
.sitemap [data-tip]:hover > :not(.sm-hit), .sitemap [data-tip].is-active > :not(.sm-hit) { stroke: #0b0b0b; stroke-width: 2.5px; }
.sitemap .sm-pt-gate:hover > circle:not(.sm-hit), .sitemap .sm-pt-gate.is-active > circle:not(.sm-hit) { stroke: #fff; }
.map-wrap.hide-uwb .sm-uwb, .map-wrap.hide-ble .sm-ble, .map-wrap.hide-wifi .sm-wifi, .map-wrap.hide-nr5g .sm-nr5g { display: none; }
.map-tip {
  position: absolute; z-index: 2; pointer-events: none;
  max-width: 17rem; padding: 0.35rem 0.55rem; border-radius: 6px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule-strong);
  font-size: 0.8rem; line-height: 1.35; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ facts */
.facts dl {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  margin: 0; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
}
@media (min-width: 720px) { .facts dl { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .facts dl { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.facts dl > div { background: var(--surface); padding: 0.9rem 1rem; }
.facts dt { font: 600 1.15rem/1.2 var(--serif); }
.facts dd { margin: 0.2rem 0 0; font-size: 0.84rem; line-height: 1.4; color: var(--ink-2); }

/* ------------------------------------------------------------ sections */
.section { padding-top: clamp(3rem, 6vw, 4.5rem); }
.prose { max-width: 70ch; }
.cols { display: grid; gap: 1.5rem; align-items: start; margin-bottom: 1.75rem; }
@media (min-width: 860px) {
  .cols { grid-template-columns: 1.1fr 1fr; gap: 2rem; }
  .cols-even { grid-template-columns: 1fr 1fr; }
}
.photo img { border-radius: 8px; width: 100%; }
.dataset-intro { margin-bottom: 2rem; }
.note { font-size: 0.9rem; color: var(--ink-2); }

.table-scroll { overflow-x: auto; margin-bottom: 1.75rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
caption { caption-side: top; text-align: left; font-size: 0.86rem; color: var(--ink-2); padding-bottom: 0.5rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--rule); }
thead th { font-size: 0.82rem; font-weight: 600; color: var(--muted); border-bottom-color: var(--rule-strong); }
tbody th { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; }
.sub { display: block; font-weight: 400; font-size: 0.84rem; color: var(--ink-2); }

.tech { display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.tech::before { content: ""; width: 10px; height: 10px; flex: none; background: var(--gnss); }
.t-uwb::before { background: var(--uwb); clip-path: polygon(50% 0, 100% 90%, 0 90%); }
.t-ble::before { background: var(--ble); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.t-wifi::before { background: var(--wifi); border-radius: 2px; }
.t-nr5g::before { background: var(--nr5g); clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%); }
.t-gnss::before { border-radius: 50%; }
.t-ref::before { background: transparent; border: 1.5px solid var(--ink-2); border-radius: 50%; width: 9px; height: 9px; }

.contents dt { font-weight: 600; font-size: 0.95rem; margin-top: 0.65rem; }
.contents dt:first-child { margin-top: 0; }
.contents dd { margin: 0.1rem 0 0; color: var(--ink-2); font-size: 0.97rem; }
.limits { margin: 0; padding-left: 1.1rem; color: var(--ink-2); font-size: 0.97rem; }
.limits li { margin-bottom: 0.4rem; }

.quickstart { max-width: 760px; }
.code-block { position: relative; }
pre {
  margin: 0 0 1rem; padding: 1rem 1.1rem; overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--rule); border-radius: 10px;
  font: 0.84rem/1.55 var(--mono); color: var(--ink); tab-size: 2;
}
.copy {
  position: absolute; top: 0.5rem; right: 0.5rem;
  font: 500 0.75rem/1 var(--sans); color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 6px;
  padding: 0.35rem 0.55rem; cursor: pointer;
}
.copy:hover { color: var(--ink); border-color: var(--ink-2); }

/* ------------------------------------------------------------ timeline */
.timeline { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 0.9rem 1.4rem; font-size: 0.9rem; line-height: 1.4; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 0.4rem; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-2); }
.timeline li::after { content: ""; position: absolute; left: 5px; top: 1.1rem; bottom: -0.2rem; width: 1px; background: var(--rule-strong); }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.timeline span { color: var(--ink-2); }
@media (min-width: 860px) {
  .timeline { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; }
  .timeline li { padding: 1.3rem 0 0; }
  .timeline li::before { top: 0; left: 0; }
  .timeline li::after { left: 0.95rem; right: -1rem; top: 5px; bottom: auto; width: auto; height: 1px; }
}

/* ------------------------------------------------------------ cards */
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: clamp(1.1rem, 2.5vw, 1.75rem); margin-bottom: 1.5rem;
  display: grid; gap: 1.25rem;
}
@media (min-width: 960px) {
  .card-split { grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
}
.card h3 { font: 600 clamp(1.15rem, 1.05rem + 0.45vw, 1.4rem)/1.25 var(--serif); margin: 0.35rem 0 0.4rem; letter-spacing: -0.005em; }
.venue { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; margin-bottom: 0.4rem; font-size: 0.84rem; color: var(--ink-2); }
.badge { font-size: 0.72rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0.2rem 0.6rem; }
.authors { color: var(--ink-2); font-size: 0.95rem; margin-bottom: 0.9rem; }
.data-note { font-size: 0.9rem; color: var(--ink-2); border-left: 2px solid var(--rule-strong); padding-left: 0.75rem; }
.findings { margin: 0 0 0.9rem; padding-left: 1.1rem; }
.findings li { margin-bottom: 0.45rem; }
.findings li::marker { color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.92rem; font-weight: 500; margin: 0; }
.card-links { margin-top: -0.25rem; }
.card-media { display: grid; gap: 1.1rem; }
.card:not(.card-split) .card-text { max-width: 78ch; }
.card-media .table-scroll { margin-bottom: 0; }
.paper-fig { background: var(--paper); border-radius: 8px; padding: 0.6rem; box-shadow: inset 0 0 0 1px var(--paper-ring); }
.paper-fig img { width: 100%; }
.results th { font-weight: 500; }

/* ------------------------------------------------------------ people */
.people { list-style: none; margin: 0 0 1rem; padding: 0; columns: 2; column-gap: 1.5rem; }
.people li { margin-bottom: 0.3rem; break-inside: avoid; }
.orcid {
  display: inline-block; margin-left: 0.25rem; padding: 0 0.3rem;
  font: 700 0.62rem/1.45 var(--sans); color: #0b0b0b; background: #a6ce39;
  border-radius: 999px; text-decoration: none; vertical-align: 0.12em;
}
.orcid:hover { background: #bfe05a; }

/* ------------------------------------------------------------ footer */
.site-footer { margin-top: clamp(3rem, 6vw, 4.5rem); padding: 1.75rem 0 2.25rem; border-top: 1px solid var(--rule); font-size: 0.84rem; color: var(--ink-2); }
.site-footer p { margin-bottom: 0.4rem; max-width: 90ch; }

@media print {
  .topbar, .layers, .copy { display: none; }
  body { background: #fff; }
}

/* ------------------------------------------------------------ narrow screens */
.systems { min-width: 560px; }
@media (max-width: 520px) {
  .env-photos { grid-template-columns: 1fr; }
  .env-photos figcaption { font-size: 0.86rem; }
}
@media (max-width: 600px) {
  .code-block pre { padding-top: 2.4rem; }
  .people { columns: 1; }
}
