/* Tankstellen-Ampel – Basis: Tokens, Typografie, Header/Footer, Bedienelemente */

:root {
  color-scheme: light;
  --bg: #eeebe6;
  --surface: #fbfaf8;
  --raised: #ffffff;
  --sunken: #e6e2dc;
  --ink: #1c2024;
  --ink-2: #3a4046;
  --muted: #5c5f63;
  --line: #d9d4cc;
  --line-2: #c4beb4;
  --btn-bg: #23282d;
  --btn-fg: #f7f5f1;
  --sel: #f1ede6;
  --focus: #2456d6;
  --shadow: 0 1px 2px rgba(28, 32, 36, .06), 0 8px 24px -12px rgba(28, 32, 36, .18);

  /* Ampel: Grafik (Balken, Lampen), Text auf Fläche, Tönung */
  --g: #1a9e52;  --g-ink: #0f6b34;  --g-tint: #e0f1e7;
  --y: #d4a000;  --y-ink: #6f5000;  --y-tint: #f9eec8;
  --r: #c0392b;  --r-ink: #a52f1f;  --r-tint: #f8e2de;
  /* Marker-Pillen: Fläche + Text (AA) */
  --mk-g-bg: #15803f; --mk-g-fg: #ffffff;
  --mk-y-bg: #d4a000; --mk-y-fg: #231a00;
  --mk-r-bg: #c0392b; --mk-r-fg: #ffffff;
  --mk-edge: #ffffff;
  --housing: #23282d;
  --code-bg: #1d2125; --code-fg: #ece8e1;

  --font-text: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Syne', 'DM Sans', system-ui, sans-serif;
  --header-h: 60px;
  --radius: 14px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121416;
  --surface: #1a1d20;
  --raised: #22262a;
  --sunken: #0e1012;
  --ink: #eceae6;
  --ink-2: #cfcdc8;
  --muted: #a3a7ab;
  --line: #2f3439;
  --line-2: #444a50;
  --btn-bg: #eceae6;
  --btn-fg: #14171a;
  --sel: #23282c;
  --focus: #8db1ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px -14px rgba(0, 0, 0, .7);

  --g: #34c77b;  --g-ink: #62dc9b;  --g-tint: rgba(52, 199, 123, .15);
  --y: #f2c230;  --y-ink: #f6d25f;  --y-tint: rgba(242, 194, 48, .15);
  --r: #ff7262;  --r-ink: #ff9a8d;  --r-tint: rgba(255, 114, 98, .15);
  --mk-g-bg: #34c77b; --mk-g-fg: #05210f;
  --mk-y-bg: #f2c230; --mk-y-fg: #231a00;
  --mk-r-bg: #ff7262; --mk-r-fg: #2a0a05;
  --mk-edge: #121416;
  --housing: #0a0b0c;
  --code-bg: #0e1012; --code-fg: #ece8e1;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1 0 auto; outline: none; }
img, svg { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.12; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

.sr-only { 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; left: 12px; top: -60px; z-index: 100; background: var(--btn-bg); color: var(--btn-fg); padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 10px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
@media (max-width: 600px) { .wrap { padding-left: 16px; padding-right: 16px; } }

/* ---------- Header ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.hdr { height: var(--header-h); display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { display: block; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { padding: 8px 14px; border-radius: 10px; text-decoration: none; font-weight: 500; color: var(--ink-2); }
.nav a:hover { background: var(--sunken); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--sunken); font-weight: 600; }

.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); }
.icon-btn:hover { background: var(--sunken); }
.icon-btn-sm { width: 36px; height: 36px; }
.icon-btn.is-done { background: var(--g-tint); color: var(--g-ink); border-color: var(--g); }
.ico-sun { display: none; }
:root[data-theme="dark"] .ico-sun { display: block; }
:root[data-theme="dark"] .ico-moon { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 20px; border-radius: 12px; border: 1.5px solid transparent; font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap; line-height: 1; }
.btn-sm { height: 40px; padding: 0 14px; font-size: .92rem; border-radius: 10px; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { filter: brightness(1.18); }
:root[data-theme="dark"] .btn-primary:hover { filter: brightness(.9); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--sunken); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary[disabled] { filter: none; }

/* ---------- MTS-K-Logo (hell/dunkel) ---------- */
.mtsk-l, .mtsk-w { height: 24px; width: auto; flex: none; }
.mtsk-w { display: none; }
:root[data-theme="dark"] .mtsk-l { display: none; }
:root[data-theme="dark"] .mtsk-w { display: inline-block; }
.mtsk-xs { height: 15px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--surface); }
.foot { padding-top: 32px; padding-bottom: 32px; display: grid; gap: 20px; grid-template-columns: 1fr auto; align-items: start; }
.foot-mtsk { display: flex; align-items: center; gap: 14px; grid-column: 1; }
.foot-mtsk p { font-size: .9rem; color: var(--ink-2); max-width: 46ch; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; grid-column: 2; grid-row: 1; justify-content: flex-end; }
.foot-nav a { padding: 6px 0; font-weight: 500; }
.foot-copy { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
@media (max-width: 700px) {
  .foot { grid-template-columns: 1fr; }
  .foot-nav { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .hdr { gap: 8px; }
  .nav a { padding: 8px 10px; }
  .brand-name { font-size: .98rem; }
}
@media (max-width: 400px) { .nav a:first-child { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

.icon-btn { flex: none; }
.brand { min-width: 0; }
@media (max-width: 380px) {
  .hdr { gap: 2px; }
  .brand { gap: 7px; }
  .brand-name { font-size: .84rem; letter-spacing: -.02em; }
  .nav { margin-left: 2px; }
  .nav a { padding: 8px 7px; font-size: .92rem; }
}
