/* Gleiche Farben und Schrift wie janbamba.ch, ohne Schriftdateien und Dunkelmodus folgt dem System oder der Wahl auf janbamba.ch (js/theme.js). */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --line-strong: #c2c2c2;
  --ui-border: #767676; /* Rand von Bedienelementen: mindestens 3:1 zum Hintergrund */
  --gap: clamp(32px, 6vw, 48px); /* Abstand zwischen grossen Bloecken, innerhalb einer Zeile gilt 1rem */
  --err: #b3261e;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0c0c0d;
  --fg: #f2f2f2;
  --muted: #9a9a9a;
  --line: #242427;
  --line-strong: #44444a;
  --ui-border: #7a7a80;
  --err: #ff8f86;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0c0c0d;
    --fg: #f2f2f2;
    --muted: #9a9a9a;
    --line: #242427;
    --line-strong: #44444a;
    --ui-border: #7a7a80;
    --err: #ff8f86;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 28px);
}

a { color: inherit; }

.top { padding: 22px 0 0; font-size: 0.92rem; }
.top a { color: var(--muted); text-decoration: none; }
.top a:hover { color: var(--fg); }

/* Der Name sieht aus wie ein Dateiname, und Dateinamen stehen in den Listen in Festbreite */
h1 {
  margin: clamp(36px, 9vw, 84px) 0 0.8rem;
  font: 500 clamp(1.9rem, 6.5vw, 2.7rem)/1.1 var(--mono);
  letter-spacing: -0.03em;
}

h2 { margin: 0 0 0.4rem; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.005em; }
h2:focus { outline: none; }

p { margin: 0 0 0.9rem; }
.lead { font-size: 1.1rem; line-height: 1.55; max-width: 34rem; }
.lead, .meta, .specs dd, .note { text-wrap: pretty; }
.meta, .muted { color: var(--muted); }
.fine { font-size: 0.85rem; color: var(--muted); }

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

[hidden] { display: none !important; }

.stage { margin-top: var(--gap); }

/* Ablegen: ein schlichter Rahmen mit scharfen Ecken, linksbuendig wie der Text darueber */
.drop {
  padding: clamp(22px, 5vw, 34px) clamp(18px, 4vw, 28px);
  border: 1px solid var(--ui-border);
}
.drop[data-over] {
  border-color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--fg);
  background: color-mix(in srgb, var(--fg) 5%, transparent);
}
.drop p:last-child { margin-bottom: 0; }
.big { font-size: 1.15rem; font-weight: 500; margin-bottom: 0.9rem; }
.drop .fine { max-width: 30rem; margin: 1.2rem 0 0; font-size: 0.88rem; }

/* Knoepfe: scharfe Ecken, beim Darueberfahren tauschen Fuellung und Schrift die Farbe */
.btn {
  appearance: none;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--fg);
  border-radius: 0;
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
}
.btn:hover { background: transparent; color: var(--fg); }
.btn.quiet { background: transparent; color: var(--fg); border-color: var(--ui-border); }
.btn.quiet:hover { border-color: var(--fg); background: var(--fg); color: var(--bg); }

.linkbtn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkbtn:hover { color: var(--fg); }

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

.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.7rem 1.3rem; margin-top: 1.3rem; }

/* Optionen */
.opts { margin: 1.3rem 0 0; padding: 0; border: 0; }
.opts label { display: flex; gap: 0.7rem; align-items: baseline; padding: 0.45rem 0; cursor: pointer; }
.opts input { flex: none; margin: 0; width: 1rem; height: 1rem; accent-color: var(--fg); transform: translateY(0.12rem); }
.opts small { display: block; color: var(--muted); font-size: 0.85rem; line-height: 1.45; }

/* Fortschritt */
progress {
  display: block; width: 100%; height: 3px; margin: 0.9rem 0 0.6rem;
  appearance: none; border: 0; border-radius: 0; background: var(--line); color: var(--fg);
}
progress::-webkit-progress-bar { background: var(--line); border-radius: 0; }
progress::-webkit-progress-value { background: var(--fg); border-radius: 0; }
progress::-moz-progress-bar { background: var(--fg); border-radius: 0; }

/* Ergebnis */
.note {
  margin: 1.1rem 0 0;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 2px solid var(--fg);
  font-size: 0.95rem;
}
.note p { margin: 0 0 0.5rem; }
.note p:last-child { margin: 0; }

.tip { margin: 0.9rem 0 0; }
#blocked { margin: 0 0 1.2rem; }

.group { margin-top: 1.5rem; border-top: 1px solid var(--line); }
.group > summary {
  list-style: none; cursor: pointer; padding: 0.7rem 0;
  font-size: 0.95rem; font-weight: 500;
  display: flex; justify-content: space-between; gap: 1rem;
}
.group > summary::-webkit-details-marker { display: none; }
.group > summary::after { content: '+'; color: var(--muted); font-weight: 400; }
.group[open] > summary::after { content: '\2212'; }
.group > summary span { color: var(--muted); font-weight: 400; margin-left: 0.4rem; }

.rows { list-style: none; margin: 0; padding: 0 0 0.6rem; font-size: 0.875rem; }
.rows li { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 0.1rem 1.1rem; padding: 0.28rem 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows b { font: 500 0.84rem/1.5 var(--mono); overflow-wrap: anywhere; }
.rows i { font-style: normal; color: var(--muted); overflow-wrap: anywhere; }
.rows .dir { color: var(--muted); font-weight: 400; }
.rows .err i { color: var(--err); }
.rows .more { display: block; color: var(--muted); }

@media (max-width: 34rem) {
  .rows li { grid-template-columns: minmax(0, 1fr); }
}

/* Einzelheiten: links die Stichworte in Festbreite, rechts der Text, wie auf einem Datenblatt */
.info { margin-top: var(--gap); }

.specs { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr); gap: 1rem 1.4rem; margin: 0; }
.specs dt { font: 500 0.8rem/1.85 var(--mono); color: var(--muted); }
.specs dd { margin: 0; max-width: 36rem; font-size: 0.92rem; }
.specs code { font: 0.86em var(--mono); }

@media (max-width: 34rem) {
  .specs { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .specs dd { margin-bottom: 1rem; }
}

/* Aufklapper im selben Stil wie die Gruppen im Ergebnis: Beschriftung links, + oder Minus rechts */
.fold { margin-top: var(--gap); border-top: 1px solid var(--line); }
.fold > summary {
  list-style: none; cursor: pointer; padding: 1rem 0;
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: 0.95rem; font-weight: 500;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: '+'; color: var(--muted); font-weight: 400; }
.fold[open] > summary::after { content: '\2212'; }
.fold > summary:hover::after { color: var(--fg); }
.fold[open] > .specs { padding: 0.2rem 0 1.6rem; }

/* Fussbereich: erst die Links in zwei Gruppen (Projekt links, Rechtliches rechts), dann der Hinweis auf derselben Achse wie die Einzelheiten, ganz unten die Widmung rechts */
.foot { padding: 1rem 0 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.foot .links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.foot .links span { display: inline-flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--fg); }
.foot .notice { margin-top: 1.75rem; }
.foot .notice dt { font-size: 0.74rem; line-height: 1.95; }
.foot .notice dd { font-size: 0.8rem; max-width: 34rem; }
.foot .notice p { margin: 0; }
.foot .notice p + p { margin-top: 0.75rem; }
.foot .for { margin: 1.75rem 0 0; font-size: 0.8rem; text-align: right; }
