/* Mac-Grind – dunkel, monospace-gepraegt.
   Schriften lokal: fonts/ mit IBMPlexMono-{Regular,Medium}.woff2
   und IBMPlexSans-{Regular,Medium}.woff2 befuellen. Faellt sonst
   sauber auf System-Fonts zurueck. */

@font-face {
  font-family: "Plex Mono";
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("fonts/IBMPlexSans-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #060708;
  --flaeche: #08090b;
  --linie: #16181b;
  --linie-hell: #1c1f23;
  --ink: #f4f6f8;
  --ink-2: #dfe2e5;
  --ink-3: #9aa0a7;
  --ink-4: #7e838a;
  --ink-5: #5c6066;
  --ink-6: #3f4348;
  --akzent: oklch(0.80 0.11 232);
  --akzent-hell: oklch(0.90 0.07 232);
  --akzent-dunkel: oklch(0.50 0.08 232);
  --warn: oklch(0.78 0.10 85);
  --minus: oklch(0.74 0.12 25);
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(130% 80% at 50% -10%, #0e1114 0%, var(--bg) 60%) no-repeat, var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

/* Vollbild ohne Scrollen: die Seite ist genau eine Bildschirmhoehe hoch und
   verteilt den Platz per Hoehenbudget. Alle Abstaende haengen darum an vh,
   nicht an festen Pixeln - sonst laeuft der Inhalt auf flachen Fenstern raus. */
body { overflow: hidden; }

.seite {
  max-width: 860px; margin: 0 auto;
  height: 100dvh;
  padding: clamp(12px, 2.2vh, 44px) clamp(18px, 4vw, 38px) clamp(12px, 2.2vh, 32px);
  display: flex; flex-direction: column; gap: clamp(8px, 1.4vh, 22px);
}

#inhalt {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: clamp(8px, 1.4vh, 22px);
}

@keyframes grise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes gbreath { 0%, 100% { opacity: .45; transform: scale(1); } 50% { opacity: 1; transform: scale(1.25); } }
@keyframes gdraw { from { stroke-dashoffset: 1200; } to { stroke-dashoffset: 0; } }
@keyframes gsweep { 0% { transform: translateX(-140%); } 55%, 100% { transform: translateX(420%); } }
@keyframes gtick { from { opacity: 0; transform: scaleY(.2); } to { opacity: 1; transform: none; } }

.kopf, .hero-text, .hero-bild, .fortschritt, .verlauf, .kennzahlen, .konfig {
  animation: grise .8s cubic-bezier(.16, 1, .3, 1) both;
}
.hero-text { animation-delay: .08s; }
.hero-bild { animation-delay: .16s; }
.fortschritt { animation-delay: .24s; }
.verlauf { animation-delay: .3s; }
.kennzahlen { animation-delay: .38s; }
.konfig { animation-delay: .44s; }

.kopf {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  padding-bottom: clamp(8px, 1.4vh, 18px); border-bottom: 1px solid var(--linie);
}
.wortmarke {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  letter-spacing: .26em; text-transform: uppercase; color: #eef0f2;
}
.quellen { display: flex; align-items: center; gap: 14px; }
.quellen-punkte { display: flex; align-items: center; gap: 6px; }
.punkt {
  width: 7px; height: 7px; border-radius: 999px;
  animation: gbreath 2.6s ease-in-out infinite;
}
.punkt.ok { background: var(--akzent); box-shadow: 0 0 8px oklch(0.80 0.11 232 / .7); }
.punkt.veraltet { background: var(--warn); box-shadow: 0 0 8px oklch(0.78 0.10 85 / .6); }
.punkt.fehler { background: var(--minus); box-shadow: 0 0 8px oklch(0.74 0.12 25 / .7); }
.quellen-label {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em;
  color: var(--ink-5); white-space: nowrap;
}

.fehler { margin-top: 32px; color: #d98c8c; font-family: var(--mono); font-size: 14px; }

.hero {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(16px, 3vw, 44px); align-items: center;
  /* Nur das Bild darf schrumpfen: ohne min-content quetscht Flex den Text
     zusammen und schneidet Unterlaengen der grossen Zahl ab. */
  flex: 1 1 auto; min-height: min-content;
  padding: clamp(6px, 1.2vh, 20px) 0;
}
.label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-5);
}
.hero-text .label { font-size: 11px; letter-spacing: .2em; margin-bottom: clamp(6px, 1.4vh, 16px); }
.betrag {
  font-family: var(--mono); font-size: clamp(34px, min(8vw, 9vh), 68px); line-height: 1.12;
  font-weight: 500; letter-spacing: -.035em; font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.betrag .einheit { color: #585d63; font-weight: 400; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: clamp(8px, 1.6vh, 18px); }
.chip {
  font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  transition: color .4s ease, background .4s ease, border-color .4s ease;
}
.chip-up { color: var(--akzent-hell); background: oklch(0.84 0.10 232 / .10); border: 1px solid oklch(0.84 0.10 232 / .28); }
.chip-down { color: var(--minus); background: oklch(0.74 0.12 25 / .10); border: 1px solid oklch(0.74 0.12 25 / .28); }
.ziel { font-size: 13.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; white-space: nowrap; }

.hero-bild { display: flex; flex-direction: column; min-height: 0; }
.bild-halter { position: relative; overflow: hidden; min-height: 0; }
.spiegel-blende {
  position: absolute; left: 0; right: 0; bottom: 0; height: 52%;
  background: linear-gradient(to bottom, rgba(6, 7, 8, 0) 0%, rgba(6, 7, 8, .75) 45%, var(--bg) 100%);
  pointer-events: none;
}
#mac-shot {
  display: block; width: 100%; height: auto;
  max-height: min(30vh, 220px); object-fit: contain; object-position: bottom;
  filter: grayscale(.2) drop-shadow(0 22px 34px rgba(0, 0, 0, .72));
}
/* Spiegelung ist Deko: schrumpft zuerst, wenn die Hoehe knapp wird. */
.spiegel {
  display: block; width: 100%; height: auto;
  max-height: min(11vh, 90px); object-fit: contain; object-position: top;
  transform: scaleY(-1); opacity: .1;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .9), transparent 58%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .9), transparent 58%);
}
#toggle-view {
  margin-top: clamp(4px, .8vh, 6px); width: 100%; flex: none;
  background: #0c0e11; color: var(--ink-3);
  border: 1px solid var(--linie-hell); border-radius: 8px; padding: clamp(5px, 1vh, 9px) 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  cursor: pointer; transition: border-color .35s ease, color .35s ease, background .35s ease;
}
#toggle-view:hover { border-color: oklch(0.80 0.11 232 / .55); color: #eef0f2; background: #101317; }

.fortschritt { flex: none; }
.balken {
  position: relative; height: 10px; border-radius: 3px;
  background: #0e1013; border: 1px solid #191c20; overflow: hidden;
}
.balken-fuellung {
  position: absolute; inset: 0; width: 0;
  background: linear-gradient(90deg, var(--akzent-dunkel) 0%, oklch(0.78 0.11 232) 78%, oklch(0.92 0.06 232) 100%);
  box-shadow: 0 0 22px oklch(0.74 0.12 232 / .55);
  transition: width 1.4s cubic-bezier(.16, 1, .3, 1);
  overflow: hidden;
}
.sweep {
  position: absolute; top: 0; bottom: 0; width: 22%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: gsweep 3.6s cubic-bezier(.4, 0, .2, 1) infinite;
}
.tage { display: grid; gap: 2px; margin-top: clamp(5px, 1vh, 9px); }
.tag {
  height: clamp(8px, 1.6vh, 15px); border-radius: 2px; background: #14171a; transform-origin: bottom;
  animation: gtick .5s cubic-bezier(.16, 1, .3, 1) both;
}
.tag.voll { background: oklch(0.74 0.12 232 / .85); }
.zeile-klein {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: clamp(6px, 1.2vh, 12px);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em;
  color: var(--ink-5); font-variant-numeric: tabular-nums;
}

.verlauf { margin-top: 0; min-height: 0; display: flex; flex-direction: column; }
.verlauf-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: clamp(6px, 1.2vh, 14px); }
.mono-klein { font-family: var(--mono); font-size: 11.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
#sparkline { display: block; width: 100%; height: clamp(48px, 11vh, 130px); min-height: 0; overflow: visible; }
.spark-line { animation: gdraw 1.8s cubic-bezier(.16, 1, .3, 1) .35s both; }
.spark-ring { animation: gbreath 2.6s ease-in-out infinite; }

.kennzahlen {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
  margin-top: 0; flex: none;
  background: var(--linie); border: 1px solid var(--linie);
  border-radius: 12px; overflow: hidden;
}
.zelle { background: var(--flaeche); padding: clamp(8px, 1.6vh, 17px) 19px; }
.zelle .label { font-size: 10.5px; letter-spacing: .16em; margin-bottom: clamp(4px, .8vh, 10px); }
.wert { font-family: var(--mono); font-size: clamp(15px, 2.2vh, 20px); font-variant-numeric: tabular-nums; color: #e7e9ec; }
.wert.positiv { color: var(--akzent-hell); }
.wert.negativ { color: var(--minus); }

.konfig { margin-top: 0; flex: none; border-top: 1px solid var(--linie); padding-top: clamp(8px, 1.6vh, 20px); }
.konfig > .label { margin-bottom: clamp(6px, 1.2vh, 15px); }
.konfig-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: clamp(3px, .7vh, 10px) 30px; }
.konfig-zeile {
  display: flex; justify-content: space-between; gap: 16px;
  font-family: var(--mono); font-size: clamp(11px, 1.7vh, 13px); font-variant-numeric: tabular-nums;
  border-bottom: 1px dotted #1a1d21; padding-bottom: clamp(3px, .7vh, 8px);
}
.konfig-zeile .k { color: var(--ink-5); }
.konfig-zeile .v { color: #c9ced4; }
.fuss { margin-top: clamp(6px, 1.4vh, 22px); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-6); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
