/* Schriften liegen im Repo, nicht bei Google.

   Eine Einbindung über fonts.googleapis.com überträgt beim Seitenaufruf die
   IP-Adresse des Besuchers an Google — ohne Einwilligung. Genau dafür hat das
   LG München I am 20.01.2022 (3 O 17493/20) Schadensersatz zugesprochen.
   Lokal gehostet entfällt der Drittkontakt vollständig.

   Es sind variable Schriften: eine Datei je Familie und Zeichenbereich deckt
   alle Gewichte ab. Nur latin und latin-ext — für Japanisch, Koreanisch und
   Chinesisch greift ohnehin die Systemschrift, keine der drei Familien deckt
   diese Zeichen ab. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/karla-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/karla-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* FILYXA — Blaupause auf mattiertem Papier.
   Referenz: „Ui — clinical blueprint on frosted paper" als Grundrichtung,
   Monospace-Disziplin aus „Vercel — typeset terminal", Weißraum aus
   „Apple (España)". Alle Fakten stehen im Monospace, alles Erklärende
   in der Serifenlosen, nichts Dekoratives dazwischen. */

:root {
  --paper:   #F4F6F8;   /* mattiertes Blaupausenpapier, kühl statt creme */
  --sheet:   #FFFFFF;
  --ink:     #101418;
  --muted:   #5D6672;
  --faint:   #8A939F;
  --rule:    #DCE1E7;   /* Haarlinie der Zeichnung */
  --rule-strong: #B9C2CC;
  --blue:    #0B5C86;   /* Blaupausenblau: nur Bestätigtes und Marken */
  --blue-wash: #E4EEF3;
  --amber:   #A6600F;   /* nur für „deine Entscheidung" */
  --amber-wash: #F8EFE2;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "Karla", "Helvetica Neue", Arial, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 36rem;
  --pad:     clamp(1.15rem, 4.5vw, 3.5rem);
  --gap-s:   clamp(3rem, 8vw, 5.5rem);
}

:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --paper:   #0E1216;
    --sheet:   #151A20;
    --ink:     #E7EBEF;
    --muted:   #98A2AE;
    --faint:   #6C7681;
    --rule:    #262D35;
    --rule-strong: #3A434E;
    --blue:    #6FB6D8;
    --blue-wash: #12262F;
    --amber:   #D9A05B;
    --amber-wash: #2B2114;
  }
}

:root[data-theme="dark"] {
  --paper:   #0E1216;
  --sheet:   #151A20;
  --ink:     #E7EBEF;
  --muted:   #98A2AE;
  --faint:   #6C7681;
  --rule:    #262D35;
  --rule-strong: #3A434E;
  --blue:    #6FB6D8;
  --blue-wash: #12262F;
  --amber:   #D9A05B;
  --amber-wash: #2B2114;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { width: 100%; max-width: 64rem; margin: 0 auto; padding-inline: var(--pad); }
.narrow { max-width: var(--measure); }

/* --- Kopf: nur Wortmarke und Sprache. Support und Datenschutz stehen
       im Fuß, wie gewünscht. ------------------------------------------ */

.top {
  display: flex; align-items: center; gap: 1rem;
  padding-block: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-family: var(--display); font-weight: 700;
  font-size: 1.1rem; letter-spacing: .2em;
  color: var(--ink); text-decoration: none;
}
.wordmark:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.langs { margin-left: auto; position: relative; }
.langs select {
  appearance: none; -webkit-appearance: none;
  font-family: var(--mono); font-size: .74rem;
  color: var(--muted); background: transparent;
  border: 1px solid var(--rule); border-radius: 2px;
  padding: .3rem 1.6rem .3rem .55rem; cursor: pointer;
}
.langs select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.langs::after {
  content: ""; position: absolute; right: .55rem; top: 50%;
  width: .3rem; height: .3rem; margin-top: -.25rem;
  border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint);
  transform: rotate(45deg); pointer-events: none;
}

/* --- Titelsatz ----------------------------------------------------- */

.lede { padding-block: clamp(3.5rem, 11vw, 7rem) clamp(2rem, 5vw, 3rem); }

.eyebrow {
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--blue); margin: 0 0 1.4rem;
}

h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.15rem, 6.2vw, 3.9rem);
  line-height: 1.05; letter-spacing: -.03em;
  margin: 0 0 1.35rem; text-wrap: balance;
  max-width: 17ch;
}

.lede > p,
.lede-body > p {
  margin: 0; max-width: var(--measure);
  font-size: clamp(1.02rem, 1.9vw, 1.15rem);
  color: var(--muted); text-wrap: pretty;
}

/* Ein zweiter Absatz in der Einleitung trägt die Einschränkung — auf der
   Hilfeseite, wo die Automatik aufhört. Er braucht Luft und darf leiser
   sein als die Einleitung selbst, ohne im Kleingedruckten zu verschwinden. */
.lede-body > p + p {
  margin-top: 1.15rem;
  font-size: clamp(.92rem, 1.5vw, 1rem);
  color: var(--faint);
}

/* --- Die Zeichnung: Plantabelle mit Schriftkopf --------------------- */

.sheet {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  margin-bottom: var(--gap-s);
  position: relative;
}
/* Eckmarken wie auf einer technischen Zeichnung. */
.sheet::before, .sheet::after {
  content: ""; position: absolute; width: .5rem; height: .5rem;
  border-color: var(--rule-strong); border-style: solid; pointer-events: none;
}
.sheet::before { top: .3rem; left: .3rem; border-width: 1px 0 0 1px; }
.sheet::after  { bottom: .3rem; right: .3rem; border-width: 0 1px 1px 0; }

.sheet-head, .row {
  display: grid;
  grid-template-columns: 2.4rem minmax(0,1.5fr) minmax(0,1.55fr) minmax(0,.95fr);
  gap: 1rem; align-items: center;
  padding: .8rem clamp(.85rem, 2.2vw, 1.35rem);
}

.sheet-head {
  font-family: var(--mono); font-size: .64rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
  border-bottom: 1px solid var(--rule);
}

.row + .row { border-top: 1px solid var(--rule); }

.file { display: flex; flex-direction: column; gap: .05rem; min-width: 0; cursor: pointer; }
.file b {
  font-family: var(--mono); font-weight: 500; font-size: .82rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file span { font-size: .75rem; color: var(--faint); font-variant-numeric: tabular-nums; }

.why  { margin: 0; font-size: .86rem; color: var(--muted); text-wrap: pretty; }
.why em { font-style: normal; color: var(--ink); }
.dest { margin: 0; font-family: var(--mono); font-size: .76rem; color: var(--faint); text-align: right; }

.row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 1.05rem; height: 1.05rem; margin: 0; flex: none;
  border: 1.5px solid var(--rule-strong); border-radius: 2px;
  background: transparent; cursor: pointer; position: relative;
  transition: background 110ms ease, border-color 110ms ease;
}
.row input:checked { background: var(--blue); border-color: var(--blue); }
.row input:checked::after {
  content: ""; position: absolute; left: .31rem; top: .11rem;
  width: .24rem; height: .52rem;
  border: solid var(--sheet); border-width: 0 1.8px 1.8px 0;
  transform: rotate(42deg);
}
.row input:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.row.held { background: var(--amber-wash); }
.row.held .dest { color: var(--amber); }
.row.held input { border-color: var(--amber); }
.row.held input:checked { background: var(--amber); border-color: var(--amber); }

.tag {
  font-family: var(--mono); font-size: .62rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--amber); border: 1px solid var(--amber);
  border-radius: 2px; padding: .05em .35em; margin-left: .4em; white-space: nowrap;
}

/* Schriftkopf — der Kasten, der sagt, was das Blatt zeigt. */
.titleblock {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  border-top: 1px solid var(--rule-strong);
}
.titleblock div { padding: .75rem clamp(.85rem, 2.2vw, 1.35rem); }
.titleblock div + div { border-left: 1px solid var(--rule); }
.titleblock dt {
  font-family: var(--mono); font-size: .62rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
  margin: 0 0 .2rem;
}
.titleblock dd {
  margin: 0; font-family: var(--mono); font-size: .88rem;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.titleblock dd.on { color: var(--blue); }

/* --- Abschnitte ---------------------------------------------------- */

section { padding-block: var(--gap-s); border-top: 1px solid var(--rule); }

h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.45rem, 3.4vw, 2rem);
  line-height: 1.14; letter-spacing: -.02em;
  margin: 0 0 1.1rem; text-wrap: balance;
}
h3 { font-family: var(--body); font-weight: 700; font-size: .97rem; margin: 0 0 .25rem; }

section p { margin: 0 0 .9rem; max-width: var(--measure); text-wrap: pretty; }
section p:last-child { margin-bottom: 0; }
.sub { color: var(--muted); }

/* Zwei Spalten, nicht auto-fit. Die Trennlinien und die Innenabstände
   hängen an nth-child(odd/even) — das trifft nur zu, solange es genau
   zwei Spalten gibt. Mit auto-fit wurden es bei breiten Fenstern drei:
   die Linie zwischen Spalte zwei und drei fehlte, der vierte Kasten
   stand eingerückt, und die Unterkante brach nach einer Spalte ab.
   Die vier Aussagen gehen als 2 × 2 ohnehin sauber auf. */
.grid {
  display: grid; gap: 0;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--rule); margin-top: 2rem;
}
.grid > div {
  padding: 1.35rem 0; border-bottom: 1px solid var(--rule);
}
@media (min-width: 46rem) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid > div { padding-inline: 1.6rem; }
  .grid > div:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--rule); }
  .grid > div:nth-child(even) { padding-right: 0; }
}
.grid p { margin: 0; color: var(--muted); font-size: .9rem; }

.qa { border-top: 1px solid var(--rule); margin-top: 2rem; }
.qa > div { padding-block: 1.6rem; border-bottom: 1px solid var(--rule); }
.qa h3 { font-family: var(--display); font-weight: 700; font-size: 1.08rem; margin-bottom: .5rem; letter-spacing: -.01em; }

pre {
  font-family: var(--mono); font-size: .74rem; line-height: 1.8;
  background: var(--sheet); border: 1px solid var(--rule);
  margin: 0 0 .9rem; padding: .85rem 1rem; overflow-x: auto;
  max-width: var(--measure);
}
code { font-family: var(--mono); font-size: .87em; }
p code, li code { background: var(--blue-wash); padding: .08em .32em; border-radius: 2px; }

a { color: var(--ink); text-decoration-color: var(--blue); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.mail { font-family: var(--mono); font-size: .93rem; text-decoration: none;
        border-bottom: 2px solid var(--blue); padding-bottom: 1px; }

/* --- Fuß: hier stehen Support und Datenschutz ---------------------- */

footer { border-top: 1px solid var(--rule-strong); padding-block: 2.25rem 3.5rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin: 0 0 1.4rem; padding: 0; list-style: none; }
.foot-links a {
  font-family: var(--display); font-weight: 700; font-size: .95rem;
  text-decoration: none; border-bottom: 1px solid var(--rule-strong); padding-bottom: 2px;
}
.foot-links a:hover { border-bottom-color: var(--blue); }
.foot-meta {
  display: flex; flex-wrap: wrap; gap: .4rem 1.4rem;
  font-family: var(--mono); font-size: .7rem; color: var(--faint);
}

/* --- Breite Fenster ------------------------------------------------ */

@media (min-width: 60rem) {
  .lede { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 3.5rem; align-items: end; }
  .lede .eyebrow { grid-column: 1 / -1; }
  h1 { margin-bottom: 0; }
}

/* --- Schmale Fenster ----------------------------------------------- */

@media (max-width: 44rem) {
  .sheet-head { display: none; }
  .row {
    grid-template-columns: 1.5rem 1fr;
    grid-template-areas: "box file" ".  why" ".  dest";
    gap: .3rem .85rem; padding-block: 1rem;
  }
  .row > input { grid-area: box; align-self: start; margin-top: .18rem; }
  .file { grid-area: file; }
  .why  { grid-area: why; }
  .dest { grid-area: dest; text-align: left; }
  .titleblock div + div { border-left: none; border-top: 1px solid var(--rule); }
}

@media (max-width: 30rem) {
  h1 { max-width: none; }
  .top { gap: .6rem; }
  .wordmark { font-size: 1rem; letter-spacing: .16em; }
}

/* --- Nachträge ------------------------------------------------------ */

.wordmark { display: inline-flex; align-items: center; gap: .55rem; }
.wordmark img { display: block; border-radius: 22%; }

/* Für Screenreader sichtbar, im Layout nicht. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
