/* ==========================================================================
   miniwest.dev
   Alles lokal: keine externen Fonts, Bilder oder Skripte.
   ========================================================================== */

@font-face {
  font-family: "Departure Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/departure-mono-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/geist-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/geist-mono-latin-600-normal.woff2") format("woff2");
}

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

:root {
  color-scheme: dark;

  --bg: #0b0a0e;
  --panel: rgba(12, 10, 16, 0.86);
  --line: rgba(235, 225, 255, 0.1);
  --line-strong: rgba(235, 225, 255, 0.2);

  --text: #ece8f2;
  --text-muted: #a39cb2;

  /* Dunkles MiniWest-Lila: nur für Flächen (weiße Schrift darauf: 9:1). */
  --accent: #5b21b6;
  --accent-hover: #6d28d9;
  --accent-soft: rgba(91, 33, 182, 0.2);
  /* Lesbarer Lila-Ton für Schrift und Linien auf dunklem Grund (6,9:1). */
  --accent-text: #a78bfa;

  /* Departure Mono ist ein Pixel-Font mit 11px-Raster: Größen als Vielfache davon. */
  --pixel: "Departure Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --body: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --body-size: 0.95rem;

  --column: 1000px;
  --gutter: 16px;
  --head-col: 290px;
}

/* --- Base --------------------------------------------------------------- */

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

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

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--body-size);
  line-height: 1.65;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: #fff;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  font-size: 44px;
}

h2 {
  font-size: 33px;
}

h3 {
  font-size: 22px;
}

@media (min-width: 760px) {
  h1 {
    font-size: 66px;
  }
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: rgba(167, 139, 250, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease, background-color 0.2s ease;
}

a:hover {
  color: var(--text);
  text-decoration-color: var(--accent-text);
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}

strong {
  font-weight: 600;
}

code,
pre {
  font-family: var(--pixel);
}

img {
  max-width: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-family: var(--pixel);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.label {
  font-family: var(--pixel);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lead {
  color: var(--text-muted);
  font-size: 1.1em;
}

/* --- Layout ------------------------------------------------------------- */

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Header / Navigation ----------------------------------------------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-family: var(--pixel);
  font-size: 22px;
  text-decoration: none;
}

.brand::before {
  content: "";
  width: 11px;
  height: 11px;
  margin-right: 10px;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-text);
}

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

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--text-muted);
  font-family: var(--pixel);
  font-size: 16.5px;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent-text);
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}

.site-nav .nav-lang {
  margin-left: 6px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.site-nav .nav-lang:hover {
  border-color: var(--accent-text);
  background: var(--accent-soft);
}

/* --- Hero / Seitenkopf -------------------------------------------------- */

.hero {
  padding: 56px 0 44px;
}

.hero .label {
  display: block;
  margin-bottom: 14px;
  color: var(--accent-text);
}

.hero h1 {
  overflow-wrap: break-word;
  hyphens: auto;
}

.hero__sub {
  margin: 14px 0 0;
  max-width: 40em;
  color: var(--text-muted);
  font-size: 1.15em;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 36px 0 0;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.facts div {
  padding: 12px 14px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: var(--panel);
}

.facts dt {
  margin-bottom: 2px;
}

.facts dd {
  margin: 0;
}

@media (min-width: 760px) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero {
    padding: 88px 0 56px;
  }
}

/* --- Sections ----------------------------------------------------------- */

.section {
  display: grid;
  gap: 18px;
  padding: 36px 0;
  border-top: 1px solid var(--line-strong);
}

.section__head .num {
  display: block;
  margin-bottom: 8px;
  font-family: var(--pixel);
  font-size: 16.5px;
  color: var(--accent-text);
}

.section__head h2 {
  overflow-wrap: break-word;
}

.section__body {
  min-width: 0;
}

@media (min-width: 860px) {
  .section {
    grid-template-columns: var(--head-col) minmax(0, 1fr);
    gap: 40px;
    padding: 48px 0;
  }

  .section__head {
    position: sticky;
    top: 24px;
    align-self: start;
  }
}

/* --- Terminal ----------------------------------------------------------- */

.terminal {
  border: 1px solid var(--line-strong);
  background: var(--panel);
}

.terminal__bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.terminal__body {
  margin: 0;
  padding: 16px 14px;
  overflow-x: auto;
  font-family: var(--pixel);
  font-size: 16.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal__body .prompt {
  color: var(--accent-text);
  user-select: none;
}

.terminal__body .out {
  color: var(--text-muted);
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  vertical-align: -0.2em;
  background: var(--accent-text);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* --- Architektur-Kette -------------------------------------------------- */

.chain {
  display: grid;
  gap: 30px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.chain > li {
  position: relative;
}

.chain > li + li::before {
  content: "";
  position: absolute;
  top: -26px;
  left: 24px;
  width: 2px;
  height: 20px;
  background: var(--accent-text);
}

.chain > li + li::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 20px;
  border: 5px solid transparent;
  border-top: 6px solid var(--accent-text);
  border-bottom: 0;
}

.node {
  display: grid;
  gap: 2px 18px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}

.node--here {
  border-color: var(--accent-text);
  background: var(--accent-soft);
}

.node__name {
  font-family: var(--pixel);
  font-size: 22px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.node p {
  margin: 0;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 4px;
}

.chain__projects {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 620px) {
  .node {
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: baseline;
  }

  .node .label {
    grid-row: span 2;
  }

  .chain__projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chain__projects .node {
    grid-template-columns: 1fr;
  }
}

/* --- Timeline ----------------------------------------------------------- */

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  display: grid;
  gap: 2px 24px;
  padding: 0 0 22px 28px;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 4px;
  width: 1px;
  height: 100%;
  background: var(--line-strong);
}

.timeline li:last-child::before {
  display: none;
}

.timeline li::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 9px;
  height: 9px;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-text);
}

.timeline time {
  font-family: var(--pixel);
  font-size: 16.5px;
  line-height: 1.3;
  color: var(--accent-text);
}

.timeline p {
  margin: 0;
}

@media (min-width: 620px) {
  .timeline li {
    grid-template-columns: 60px minmax(0, 1fr);
  }
}

/* --- Kontakt-Zeilen ----------------------------------------------------- */

.rows {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-strong);
}

.row-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label arrow" "value arrow";
  gap: 0 18px;
  align-items: center;
  min-height: 60px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  text-decoration: none;
}

.row-link:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.row-link .label {
  grid-area: label;
}

.row-link__value {
  grid-area: value;
  overflow-wrap: anywhere;
}

.row-link__arrow {
  grid-area: arrow;
  font-family: var(--pixel);
  font-size: 22px;
  color: var(--accent-text);
  transition: transform 0.2s ease;
}

.row-link:hover .row-link__arrow {
  transform: translateX(4px);
}

@media (min-width: 620px) {
  .row-link {
    grid-template-columns: 110px minmax(0, 1fr) auto;
    grid-template-areas: "label value arrow";
  }
}

/* --- 88x31 -------------------------------------------------------------- */

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.buttons a {
  display: block;
  line-height: 0;
  transition: transform 0.15s ease;
}

.buttons a:hover {
  transform: translateY(-2px);
}

.buttons img {
  display: block;
  width: 88px;
  height: 31px;
  image-rendering: pixelated;
}

/* --- Datenblätter (Projekte) -------------------------------------------- */

.sheets {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

@media (min-width: 700px) {
  .sheets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sheet {
  position: relative;
  padding: 16px 16px 18px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}

/* Eckmarken wie in einer technischen Zeichnung. */
.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--accent-text);
}

.sheet::before {
  top: -4px;
  left: -4px;
}

.sheet::after {
  right: -4px;
  bottom: -4px;
}

.sheet__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--line-strong);
}

.sheet__model {
  margin: 0 0 12px;
  font-weight: 600;
}

.specs {
  display: grid;
  gap: 10px;
  margin: 0;
}

.specs dd {
  margin: 0;
}

.specs ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.note {
  color: var(--text-muted);
  font-size: 0.9em;
}

.entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.entry:first-child {
  padding-top: 0;
}

.entry:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.entry h3 {
  margin-bottom: 8px;
}

.links-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.ext::after {
  content: "\2197";
  display: inline-block;
  margin-left: 3px;
  font-size: 0.85em;
}

/* --- Tags --------------------------------------------------------------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.section__body > .tags:first-child {
  margin-top: 0;
}

.tags li {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  font-size: 0.9em;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.tags li:hover {
  border-color: var(--accent-text);
  background: var(--accent);
  color: #fff;
}

/* --- Prose (Rechtstexte) ------------------------------------------------ */

.prose {
  max-width: 46em;
}

.prose h2 {
  margin: 36px 0 12px;
  font-size: 22px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose ul {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 4px;
}

/* --- Buttons ------------------------------------------------------------ */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--accent-text);
  background: var(--accent);
  color: #fff;
  font-family: var(--pixel);
  font-size: 16.5px;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn--ghost {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent-text);
  background: var(--accent-soft);
}

.error-code {
  font-size: 88px;
  color: var(--accent-text);
}

@media (min-width: 760px) {
  .error-code {
    font-size: 132px;
  }
}

.snippet {
  margin: 24px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  font-size: 16.5px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  display: grid;
  gap: 16px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 0.9em;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer ul a {
  display: inline-block;
  padding: 8px 0;
  color: var(--text-muted);
}

.site-footer ul a:hover {
  color: var(--text);
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
}

.footer__row p {
  margin: 0;
}

.site-footer .brand {
  font-size: 16.5px;
}

/* ==========================================================================
   Hintergrund: Netz-Topologie
   Mit JS: site.js zeichnet ein SVG über die volle Seitenhöhe, passend zu den
   Abschnitten (data-topo). Ohne JS: statische Topologie als Fallback.
   ========================================================================== */

html:not(.topo-live) body::before {
  content: "";
  position: fixed;
  inset: -10% -5%;
  z-index: 0;
  pointer-events: none;
  background: url("/assets/img/bg/topology.svg") center / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.35) 22%, rgba(0, 0, 0, 0.35) 78%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.35) 22%, rgba(0, 0, 0, 0.35) 78%, #000 100%);
}

.topo {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}

.topo svg {
  display: block;
}

.topo__edge {
  fill: none;
  stroke: var(--accent-text);
  stroke-width: 1;
  stroke-opacity: 0.16;
}

.topo__edge--backbone {
  stroke-opacity: 0.26;
}

.topo__edge--dashed {
  stroke-dasharray: 4 5;
}

.topo__node {
  fill: var(--accent-text);
  fill-opacity: 0.3;
}

.topo__node--labeled {
  fill-opacity: 0.55;
}

.topo__node--hub {
  fill: var(--accent);
  fill-opacity: 1;
  stroke: var(--accent-text);
  stroke-width: 1;
}

.topo__label {
  fill: var(--accent-text);
  fill-opacity: 0.55;
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.topo__label--hub {
  fill-opacity: 0.9;
  font-size: 16.5px;
}

.topo__packet {
  fill: #ddd6fe;
}

/* Hinter der Textspalte blasser; die Ränder bleiben voll sichtbar. */
.topo__fade {
  fill-opacity: 0.72;
}

/* --- Motion ------------------------------------------------------------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .cursor {
    animation: none;
  }
}

@media print {
  .topo,
  .site-nav,
  .skip-link {
    display: none;
  }

  body::before,
  body::after {
    display: none !important;
  }
}
