/*
 * as201687.net – Datenblatt eines Netzes. Dokumentation: DESIGN.md.
 * Aufbau: 1 Schriften, 2 Tokens, 3 Grundlagen, 4 Rahmen (Kopf, Fuss), 5 Platte und Hinweis, 6 Abschnitte und Daten,
 * 7 Tabellen und RPKI, 8 Pfad, 9 Looking Glass und Verweise, 10 Rechtsseite und 404, 11 Bewegung, 12 Barrierefreiheit, 13 Druck.
 * Farben nur ueber die Tokens in :root. Kein JavaScript, keine Inline-Stile (CSP style-src 'self').
 */

/* ------------------------------------------------------------------ 1 Schriften (nur lokal, OFL) */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------ 2 Tokens */

:root {
  /* Farbe – Werte wie darkmatter-it.de, Kontraste in DESIGN.md */
  --grund: #000000;
  --flaeche: #0c0b13;
  --flaeche-hoch: #15131f;
  --text: #f3f2f8;
  --leise: #aba8bb;
  --regel: #26243a;
  --rand: #6f6c85;
  --violett: #8b5cf6;
  --blau: #3b82f6;
  --violett-hell: #b9a3ff;
  --blau-hell: #8bb8ff;
  --ok: #86e3b1;
  --warn: #ffd28a;
  --fehler: #ff9d9d;
  --fokus: #ffffff;
  --tinte: #07060c;

  /* Rollen */
  --link: var(--blau-hell);
  --verlauf: linear-gradient(100deg, var(--violett), var(--blau));
  --rpki-valid: var(--ok);
  --rpki-unknown: var(--warn);
  --rpki-invalid: var(--fehler);
  --rpki-none: var(--leise);

  /* Schrift */
  --font-sans: "Geist", ui-sans-serif, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --size-asn: clamp(3.25rem, 1.6rem + 7.2vw, 7.5rem);
  --size-h1: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --size-h2: 1.25rem;
  --size-lead: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --size-text: 1.0625rem;
  --size-mono: 0.9375rem;
  --size-klein: 0.875rem;
  --size-mini: 0.8125rem;

  /* Raum (4er-Raster) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --width: 72rem;
  --gutter: clamp(1rem, 0.6rem + 2.4vw, 3rem);
  --label: 11rem;

  /* Form */
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-pill: 999px;
  --tap: 44px;

  /* Bewegung */
  --dur: 140ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ------------------------------------------------------------------ 3 Grundlagen */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--size-text);
  line-height: 1.6;
  font-synthesis: none;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
dl,
dd,
ul,
figure {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--text);
  text-decoration-thickness: 2px;
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: var(--size-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

abbr[title] {
  text-decoration: none;
}

.wrap {
  width: 100%;
  max-width: var(--width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.leise {
  color: var(--leise);
}

.klein {
  font-size: var(--size-klein);
}

.umbruch {
  overflow-wrap: anywhere;
}

.nur-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ 4 Rahmen: Kopf, Fuss, Knopf */

.skip {
  position: absolute;
  left: var(--space-4);
  top: -10rem;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--text);
  color: var(--tinte);
  border-radius: var(--radius-m);
  font-weight: 600;
}

.skip:focus {
  top: var(--space-4);
}

.kopf {
  border-bottom: 1px solid var(--regel);
}

.kopf__zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 4.5rem;
}

.marke {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap);
  color: var(--text);
  text-decoration: none;
}

.marke:hover {
  color: var(--text);
}

.marke__bild {
  width: 28px;
  height: 28px;
}

.marke__text {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
}

.sprache__liste {
  display: flex;
  gap: var(--space-1);
  padding: 0;
  list-style: none;
}

.sprache__punkt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: var(--tap);
  padding-inline: var(--space-2);
  border-radius: var(--radius-m);
  font-family: var(--font-mono);
  font-size: var(--size-klein);
  color: var(--leise);
  text-decoration: none;
}

a.sprache__punkt:hover {
  color: var(--text);
  background: var(--flaeche-hoch);
}

.sprache__punkt[aria-current] {
  color: var(--text);
  background: var(--flaeche-hoch);
  box-shadow: inset 0 0 0 1px var(--rand);
}

.sprung {
  padding-bottom: var(--space-2);
}

.sprung__liste {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-1);
  margin-inline: calc(var(--space-3) * -1);
  padding: 0;
  list-style: none;
}

.sprung__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding-inline: var(--space-3);
  border-radius: var(--radius-m);
  color: var(--leise);
  font-size: var(--size-klein);
  text-decoration: none;
}

.sprung__link:hover {
  color: var(--text);
  background: var(--flaeche);
}

.knopf {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding-inline: var(--space-5);
  border-radius: var(--radius-m);
  background: var(--text);
  color: var(--tinte);
  font-weight: 600;
  text-decoration: none;
}

.knopf:hover {
  background: var(--violett-hell);
  color: var(--tinte);
}

.fuss {
  margin-top: var(--space-8);
  border-top: 1px solid var(--regel);
  padding-block: var(--space-6) var(--space-7);
  color: var(--leise);
  font-size: var(--size-klein);
}

.fuss__raster {
  display: grid;
  gap: var(--space-4) var(--space-6);
}

.fuss__stand {
  display: grid;
  gap: var(--space-1);
}

.fuss__stand .hinweis {
  margin-top: var(--space-3);
}

.fuss__recht ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  padding: 0;
  list-style: none;
}

.fuss__recht a,
.fuss__betrieb a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

.fuss a[aria-current] {
  color: var(--text);
}

@media (min-width: 48rem) {
  .fuss__raster {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .fuss__stand {
    grid-column: 1 / -1;
  }

  .fuss__recht {
    justify-self: end;
  }
}

/* ------------------------------------------------------------------ 5 Platte (Kopf der Startseite) und Hinweis */

.platte {
  padding-block: clamp(2.5rem, 1.5rem + 5vw, 5.5rem) var(--space-6);
}

.platte__titel {
  font-weight: 400;
}

.platte__asn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--size-asn);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  padding-bottom: var(--space-4);
  background: var(--verlauf) no-repeat left bottom / 100% 3px;
}

.platte__name {
  display: block;
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  font-weight: 400;
  color: var(--violett-hell);
}

.platte__lead {
  max-width: 38em;
  margin-top: var(--space-5);
  font-size: var(--size-lead);
  line-height: 1.5;
  text-wrap: pretty;
}

.hinweis {
  max-width: 48rem;
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--blau-hell);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  background: var(--flaeche);
}

.hinweis--info {
  margin-bottom: var(--space-7);
}

.hinweis--warn {
  border-left-color: var(--warn);
  color: var(--text);
}

.hinweis__titel {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

/* ------------------------------------------------------------------ 6 Abschnitte und Datenzeilen */

.abschnitt {
  display: grid;
  gap: var(--space-4) var(--space-6);
  padding-block: var(--space-6) var(--space-7);
  border-top: 1px solid var(--regel);
  scroll-margin-top: var(--space-4);
}

.abschnitt__titel {
  font-size: var(--size-h2);
  font-weight: 600;
  line-height: 1.3;
}

.abschnitt__inhalt {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  max-width: 52rem;
}

.abschnitt__intro {
  max-width: 62ch;
  color: var(--leise);
}

@media (min-width: 56rem) {
  .abschnitt {
    grid-template-columns: var(--label) minmax(0, 1fr);
  }
}

.unter {
  margin-top: var(--space-4);
  font-size: 1rem;
  font-weight: 600;
}

.unter--klein {
  font-size: var(--size-klein);
  color: var(--leise);
  font-weight: 500;
}

.leer {
  padding: var(--space-3) var(--space-4);
  border: 1px dashed var(--rand);
  border-radius: var(--radius-m);
  color: var(--leise);
  max-width: 62ch;
}

.daten {
  display: grid;
}

.daten__zeile {
  display: grid;
  gap: 0 var(--space-5);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--regel);
}

.daten__zeile:first-child {
  border-top: 1px solid var(--regel);
}

.daten dt {
  color: var(--leise);
  font-size: var(--size-klein);
}

.daten dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.daten__notiz {
  display: block;
  color: var(--leise);
  font-size: var(--size-klein);
}

@media (min-width: 36rem) {
  .daten__zeile {
    grid-template-columns: 10rem minmax(0, 1fr);
    align-items: baseline;
  }

  .daten dt {
    font-size: var(--size-text);
  }
}

.inline-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.stapel-liste {
  padding: 0;
  list-style: none;
}

.anschrift {
  font-style: normal;
}

/* ------------------------------------------------------------------ 7 Tabellen und RPKI-Marken */

.tabelle {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.tabelle th,
.tabelle td {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  text-align: left;
  vertical-align: baseline;
  border-bottom: 1px solid var(--regel);
}

.tabelle th:last-child,
.tabelle td:last-child {
  padding-right: 0;
}

.tabelle thead th {
  color: var(--leise);
  font-size: var(--size-klein);
  font-weight: 500;
  border-bottom-color: var(--rand);
}

.tabelle__schluessel {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.tabelle td.mono {
  overflow-wrap: anywhere;
}

/* ASN und Praefixe nie mitten im Wert umbrechen (Platz schaffen die wegfallenden Spalten unten). */
th.tabelle__schluessel.mono {
  white-space: nowrap;
}

/* Sehr schmal: Familie faellt weg (sie steht schon in der Schreibweise des Praefixes), Werte etwas kleiner. */
@media (max-width: 29.99rem) {
  .tabelle__schmal {
    display: none;
  }

  .tabelle .mono {
    font-size: var(--size-mini);
  }
}

/* Schmale Bildschirme: Nebenspalte (Quelle) faellt weg, die Angabe ist zweitrangig. */
@media (max-width: 39.99rem) {
  .tabelle__neben {
    display: none;
  }
}

.rpki {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.0625rem var(--space-2);
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--size-mini);
  line-height: 1.5;
  white-space: nowrap;
}

.rpki__zeichen {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
}

/* Form je Status – Bedeutung nie nur ueber Farbe: Punkt, Ring, Raute, Strich. */
.rpki--valid {
  color: var(--rpki-valid);
}

.rpki--valid .rpki__zeichen {
  border-radius: 50%;
  background: currentColor;
}

.rpki--unknown {
  color: var(--rpki-unknown);
}

.rpki--unknown .rpki__zeichen {
  border-radius: 50%;
  border: 1.5px solid currentColor;
}

.rpki--invalid {
  color: var(--rpki-invalid);
}

.rpki--invalid .rpki__zeichen {
  background: currentColor;
  transform: rotate(45deg) scale(0.85);
}

.rpki--none {
  color: var(--rpki-none);
}

.rpki--none .rpki__zeichen {
  height: 2px;
  background: currentColor;
}

.legende {
  display: grid;
  gap: var(--space-2);
}

.legende__zeile {
  display: grid;
  gap: var(--space-1) var(--space-4);
  color: var(--leise);
  font-size: var(--size-klein);
}

.legende__zeile dd {
  max-width: 62ch;
}

@media (min-width: 36rem) {
  .legende__zeile {
    grid-template-columns: 10rem minmax(0, 1fr);
    align-items: baseline;
  }
}

/* ------------------------------------------------------------------ 8 Pfad (Upstreams -> eigenes AS), nur Zierde, Daten stehen in der Tabelle */

.pfad {
  display: flex;
  align-items: center;
  margin-block: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--size-mono);
  font-variant-numeric: tabular-nums;
}

.pfad__oben {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.pfad__as,
.pfad__eigen {
  position: relative;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--rand);
  border-radius: var(--radius-s);
  line-height: 1.6;
}

.pfad__as {
  margin-right: 2.5rem;
  color: var(--leise);
}

/* waagerechter Strich vom Upstream zur Sammelleitung */
.pfad__as::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 1.25rem;
  border-top: 1px solid var(--rand);
}

/* senkrechte Sammelleitung: erstes Element ab Mitte, letztes bis Mitte, dazwischen ganz */
.pfad__as::before {
  content: "";
  position: absolute;
  left: calc(100% + 1.25rem);
  top: 0;
  bottom: calc(var(--space-2) * -1 - 1px);
  border-left: 1px solid var(--rand);
}

.pfad__as:first-child::before {
  top: 50%;
}

.pfad__as:last-child::before {
  bottom: 50%;
}

.pfad__as:only-child::before {
  display: none;
}

.pfad__eigen {
  border-color: var(--violett-hell);
  color: var(--text);
  font-weight: 600;
}

.pfad__eigen::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: 1.25rem;
  border-top: 1px solid var(--violett-hell);
}

/* ------------------------------------------------------------------ 9 Looking Glass (Kopierfelder) und Verweise */

.kopier {
  padding: 0.0625rem var(--space-2);
  border-radius: var(--radius-s);
  background: var(--flaeche-hoch);
  color: var(--text);
  -webkit-user-select: all;
  user-select: all;
  overflow-wrap: anywhere;
}

.kopier--gross {
  display: inline-block;
  min-height: var(--tap);
  padding: var(--space-2) var(--space-3);
  font-size: 1.0625rem;
  line-height: 1.7;
  box-shadow: inset 0 0 0 1px var(--rand);
  cursor: text;
}

.daten--kopier .daten__zeile {
  align-items: center;
}

.verweise {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0 var(--space-6);
  padding: 0;
  list-style: none;
}

.verweis {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3.5rem;
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--regel);
  text-decoration: none;
}

.verweis__name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.verweis:hover .verweis__name {
  text-decoration-thickness: 2px;
}

.verweis__host {
  color: var(--leise);
  font-size: var(--size-mini);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ 10 Rechtsseite und 404 */

.recht {
  padding-top: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
}

.recht__titel,
.prosa h1 {
  font-size: var(--size-h1);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-3);
}

.recht__stand {
  margin-bottom: var(--space-6);
  color: var(--leise);
}

.prosa {
  max-width: 72ch;
  line-height: 1.7;
}

.prosa h2 {
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
  font-size: var(--size-h2);
  font-weight: 600;
  line-height: 1.3;
}

.prosa h3 {
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
  font-size: 1rem;
  font-weight: 600;
}

.prosa p + p,
.prosa p + ul,
.prosa ul + p {
  margin-top: var(--space-3);
}

.prosa ul,
.prosa ol {
  padding-left: 1.25rem;
}

.prosa li + li {
  margin-top: var(--space-1);
}

.recht__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  margin-top: var(--space-7);
}

.recht__nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

.leerseite {
  padding-block: clamp(3rem, 2rem + 8vw, 8rem) var(--space-6);
}

.leerseite__code {
  display: inline-block;
  font-size: var(--size-asn);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.045em;
  padding-bottom: var(--space-4);
  background: var(--verlauf) no-repeat left bottom / 100% 3px;
}

.leerseite__titel {
  margin-top: var(--space-5);
  font-size: var(--size-h1);
  font-weight: 600;
  line-height: 1.2;
}

.leerseite__trenner {
  color: var(--leise);
  font-weight: 400;
}

.leerseite__spalten {
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-6);
  max-width: 52rem;
}

.leerseite__sprache {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}

@media (min-width: 48rem) {
  .leerseite__spalten {
    grid-template-columns: 1fr 1fr;
  }
}

/* ------------------------------------------------------------------ 11 Bewegung */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  a,
  .knopf,
  .sprache__punkt,
  .sprung__link {
    transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), text-decoration-thickness var(--dur) var(--ease);
  }
}

/* ------------------------------------------------------------------ 12 Fokus, hoher Kontrast */

:focus-visible {
  outline: 2px solid var(--fokus);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

main:focus {
  outline: none;
}

.kopier:focus-visible {
  outline-offset: 2px;
}

@media (forced-colors: active) {
  .rpki__zeichen,
  .rpki--valid .rpki__zeichen,
  .rpki--invalid .rpki__zeichen,
  .rpki--none .rpki__zeichen {
    background: CanvasText;
  }

  .rpki--unknown .rpki__zeichen {
    background: none;
    border-color: CanvasText;
  }

  .hinweis,
  .knopf,
  .kopier {
    border: 1px solid CanvasText;
  }

  .platte__asn,
  .leerseite__code {
    border-bottom: 3px solid CanvasText;
  }
}

/* ------------------------------------------------------------------ 13 Druck (Datenblatt auf Papier) */

@media print {
  :root {
    --grund: #ffffff;
    --flaeche: #ffffff;
    --flaeche-hoch: #f1f0f5;
    --text: #000000;
    --leise: #3d3b4a;
    --regel: #c9c7d4;
    --rand: #6f6c85;
    --link: #000000;
    --violett-hell: #4c2a9e;
    --rpki-valid: #0b6b3a;
    --rpki-unknown: #7a4a00;
    --rpki-invalid: #a11a1a;
  }

  body {
    font-size: 10.5pt;
  }

  .skip,
  .sprung,
  .sprache,
  .recht__nav {
    display: none;
  }

  .fuss {
    margin-top: var(--space-6);
  }

  .abschnitt,
  .daten__zeile,
  .tabelle tr {
    break-inside: avoid;
  }

  .platte {
    padding-top: var(--space-5);
  }

  .prosa a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }

  .tabelle__neben,
  .tabelle__schmal {
    display: table-cell;
  }
}
