/* AREtrend. Farben, Typografie und Abstände als Tokens. Keine externen Ressourcen. */
:root {
  --paper: #eef3f4;
  --surface: #ffffff;
  --ink: #12272f;
  --muted: #4d6169;
  --line: #c9d7db;
  --water: #136f8a;

  --low: #2f9e6e;
  --mid: #e0a21b;
  --high: #d1453b;
  --low-ink: #1b6a47;
  --mid-ink: #7d5600;
  --high-ink: #a22a21;

  --serif: "Iowan Old Style", "Charter", "Sitka Text", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1b20;
    --surface: #142830;
    --ink: #e6eef0;
    --muted: #9fb2b9;
    --line: #2b434c;
    --water: #5cc0dd;
    --low-ink: #6fd1a1;
    --mid-ink: #f0c25a;
    --high-ink: #ff8f84;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; }

a { color: var(--water); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--water); outline-offset: 2px; border-radius: 3px; }
code { font: 0.9em ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface); padding: 0.1em 0.35em; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; display: flex; align-items: center; gap: 0.65rem; }
.logo { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; }
h2 { font-size: 1.35rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }
p { margin: 0 0 0.9rem; max-width: 40rem; }
section { margin-top: 2.5rem; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; }
.stand { margin: 0; color: var(--muted); }

.lead { color: var(--muted); }

/* Gesamtskala */
.hero {
  margin-top: 1.25rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.status { margin: 0; font-family: var(--serif); font-size: 1.15rem; display: flex; align-items: center; gap: 0.4rem; }
.status.big { font-size: clamp(2.5rem, 9vw, 3.75rem); line-height: 1.05; letter-spacing: -0.01em; }
.cat-niedrig { color: var(--low-ink); }
.cat-mittel  { color: var(--mid-ink); }
.cat-hoch    { color: var(--high-ink); }
.cat-unbekannt { color: var(--muted); }

/* Skala */
.scale { position: relative; margin: 1.1rem 0 0.35rem; }
.track {
  height: 0.9rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--low), var(--mid) 50%, var(--high));
}
.scale.big .track { height: 1.6rem; }
.marker {
  position: absolute;
  left: clamp(0.3rem, var(--pos, 0%), calc(100% - 0.3rem));
  top: -0.35rem;
  bottom: -0.35rem;
  width: 0.4rem;
  margin-left: -0.2rem;
  background: var(--ink);
  border: 2px solid var(--surface);
  border-radius: 0.3rem;
  animation: arrive 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes arrive { from { left: 0%; } }
.scale-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.9rem; }
.detail { color: var(--ink); }

/* Viren */
.viren { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.virus {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1.5rem;
  padding: 1.1rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
}
.virus-head h3 { margin: 0 0 0.15rem; }
.virus-scale .scale { margin-top: 0.8rem; }
.virus-foot { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.92rem; max-width: none; }
.history { grid-column: 1 / -1; }
@media (min-width: 40rem) {
  .virus { grid-template-columns: 13rem 1fr; }
}
.trend { flex: none; }
.trend-steigend { transform: rotate(-45deg); }
.trend-fallend  { transform: rotate(45deg); }

.verlauf { font-weight: 600; white-space: nowrap; }

/* Verlauf */
.history {
  margin-top: 0.9rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  position: relative;
}
.hero .history { background: var(--paper); }
.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 0.5rem; padding: 0; list-style: none; font-size: 0.88rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 0.4rem; }
.legend .sw { width: 1.3rem; height: 0; border-top: 3px solid; }
.legend .sw.dash { border-top-style: dashed; border-top-width: 2px; }
.legend .sw.thin { border-top-width: 1.5px; }
.legend .sw.dotted { border-top-style: dotted; border-top-width: 3px; }
.chart-box { position: relative; }
.chart { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart text { font: 12px var(--sans); fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; }
.chart .s-main { fill: none; stroke: var(--water); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .s-second { fill: none; stroke: var(--mid-ink); stroke-width: 1.75; stroke-linejoin: round; }
.chart .s-raw { fill: none; stroke: var(--muted); stroke-width: 1; opacity: 0.55; }
.chart .dot { fill: var(--muted); opacity: 0.8; }
.chart .s-median { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .ref-low  { stroke: var(--low); stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart .ref-high { stroke: var(--high); stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart .guide { stroke: var(--ink); stroke-width: 1; opacity: 0.5; }
.chart .hit { fill: var(--water); stroke: var(--surface); stroke-width: 2; }
.tip {
  position: absolute; top: 0; left: 0;
  min-width: 10rem; max-width: 16rem;
  padding: 0.5rem 0.65rem;
  background: var(--ink); color: var(--paper);
  border-radius: 8px; font-size: 0.85rem; line-height: 1.4;
  pointer-events: none;
}
.tip[hidden] { display: none; }
.tip strong { display: block; }
.unit { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--muted); }
details.table { margin-top: 0.6rem; font-size: 0.9rem; }
details.table summary { cursor: pointer; color: var(--water); font-weight: 600; }
.table-scroll { max-height: 22rem; overflow: auto; margin-top: 0.5rem; border: 1px solid var(--line); border-radius: 8px; }
details.table table { border-collapse: collapse; width: 100%; }
details.table th, details.table td { text-align: right; padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
details.table th:first-child, details.table td:first-child { text-align: left; }
details.table thead th { position: sticky; top: 0; background: var(--surface); border-bottom: 2px solid var(--line); z-index: 1; }
.hero details.table thead th { background: var(--paper); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.err { color: var(--high-ink); margin: 0; }

/* Datenstand */
.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.facts dt { font-weight: 600; margin-top: 0.7rem; }
.facts dd { margin: 0; color: var(--muted); }
@media (min-width: 40rem) {
  .facts { grid-template-columns: 14rem 1fr; }
  .facts dt, .facts dd { padding: 0.5rem 0; border-top: 1px solid var(--line); margin: 0; }
}

/* Fuß und Rechtliches */
.foot { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.foot nav { display: flex; gap: 1.25rem; }
.legal { color: var(--muted); font-size: 0.92rem; }
.legal h2 { font-size: 1.1rem; color: var(--ink); }
.warn { padding: 0.6rem 0.8rem; border: 1px solid var(--high-ink); border-radius: 8px; color: var(--high-ink); }
address { font-style: normal; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marker { animation: none; }
}
