/* Schriften: SIL Open Font License, lokal eingebunden (keine Dienste Dritter) */
@font-face {
  font-family: 'Bodoni Moda';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url('../assets/fonts/bodoni-moda-italic-400-900-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bodoni Moda';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url('../assets/fonts/bodoni-moda-italic-400-900-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: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../assets/fonts/bodoni-moda-normal-400-900-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../assets/fonts/bodoni-moda-normal-400-900-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: 'Atkinson Next';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/atkinson-hyperlegible-next-italic-200-800-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Next';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/atkinson-hyperlegible-next-italic-200-800-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: 'Atkinson Next';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/atkinson-hyperlegible-next-normal-200-800-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Next';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/atkinson-hyperlegible-next-normal-200-800-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: 'Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-mono-normal-400-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-mono-normal-400-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: 'Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-mono-normal-500-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-mono-normal-500-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: 'Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-mono-normal-600-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-mono-normal-600-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;
}

/* Ziffern aus Source Sans 3 (SIL OFL): Atkinson streicht die Null durch, das stört bei Jahreszahlen.
   Später deklariert, deshalb gewinnt diese Schrift für 0–9. */
@font-face {
  font-family: 'Atkinson Next';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../assets/fonts/source-sans-3-ziffern-normal.woff2') format('woff2');
  size-adjust: 107%;
  unicode-range: U+30-39;
}
@font-face {
  font-family: 'Atkinson Next';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('../assets/fonts/source-sans-3-ziffern-italic.woff2') format('woff2');
  size-adjust: 107%;
  unicode-range: U+30-39;
}

/* ------------------------------------------------------------------
   Fadenlauf · Gestaltungsgrundlage
   Leinen, Indigo, Krapprot, Wau: die vier Farben kommen aus der
   Färberei vor der Chemie. Titel in Bodoni (Musterbuch, Mode),
   Lesetext in Atkinson Hyperlegible Next (Lesbarkeit),
   Nummern und Codes in Plex Mono (Lochkarte, IBM).
   ------------------------------------------------------------------ */

:root {
  color-scheme: light;
  --leinen: #EEE7D8;
  --papier: #F8F4EA;
  --papier-2: #F2ECDF;
  --tinte: #1C1A24;
  --tinte-2: #4A4553;
  --leise: #5E5867;
  --linie: #D9CFBC;
  --linie-2: #BFB29A;
  --indigo: #26356E;
  --indigo-tief: #18224C;
  --indigo-flaeche: #E2E4EE;
  --auf-indigo: #F8F4EA;
  --krapp: #9E2F25;
  --wau: #C99A1E;
  --wau-flaeche: #F2E2AE;
  --wau-text: #7A580C;
  --wau-auf-indigo: #E8BE4F;
  --ok: #2E6B45;
  --fokus: #C99A1E;
  --textur: url('../assets/textur-leinen.png');
  --textur-deckkraft: 1;

  --schrift-text: 'Atkinson Next', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --schrift-titel: 'Bodoni Moda', 'Didot', 'Bodoni 72', Georgia, serif;
  --schrift-mono: 'Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --text-skala: 1;

  --r-gross: 18px;
  --r: 12px;
  --r-klein: 8px;
  --schatten: 0 1px 0 rgb(28 26 36 / .05), 0 10px 28px -16px rgb(28 26 36 / .35);
  --schatten-hoch: 0 1px 0 rgb(28 26 36 / .06), 0 22px 48px -22px rgb(28 26 36 / .45);
  --uebergang: 220ms cubic-bezier(.2, .7, .2, 1);
  --rand: max(16px, env(safe-area-inset-left));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-thema="tag"]) {
    color-scheme: dark;
    --leinen: #12152A;
    --papier: #1A1F3A;
    --papier-2: #20264A;
    --tinte: #F1EBDD;
    --tinte-2: #C9C2D4;
    --leise: #B9B2C4;
    --linie: #2E355C;
    --linie-2: #48507E;
    --indigo: #A9B8F2;
    --indigo-tief: #C8D2F8;
    --indigo-flaeche: #262E58;
    --auf-indigo: #12152A;
    --krapp: #F29482;
    --wau: #E8BE4F;
    --wau-flaeche: #3B3520;
    --wau-text: #E8BE4F;
    --wau-auf-indigo: #4A3506;
    --ok: #8FD3A6;
    --fokus: #E8BE4F;
    --textur: url('../assets/textur-nacht.png');
    --schatten: 0 1px 0 rgb(0 0 0 / .25), 0 12px 30px -16px rgb(0 0 0 / .7);
    --schatten-hoch: 0 1px 0 rgb(0 0 0 / .3), 0 24px 50px -22px rgb(0 0 0 / .8);
  }
}
:root[data-thema="nacht"] {
  color-scheme: dark;
  --leinen: #12152A;
  --papier: #1A1F3A;
  --papier-2: #20264A;
  --tinte: #F1EBDD;
  --tinte-2: #C9C2D4;
  --leise: #B9B2C4;
  --linie: #2E355C;
  --linie-2: #48507E;
  --indigo: #A9B8F2;
  --indigo-tief: #C8D2F8;
  --indigo-flaeche: #262E58;
  --auf-indigo: #12152A;
  --krapp: #F29482;
  --wau: #E8BE4F;
  --wau-flaeche: #3B3520;
  --wau-text: #E8BE4F;
  --wau-auf-indigo: #4A3506;
  --ok: #8FD3A6;
  --fokus: #E8BE4F;
  --textur: url('../assets/textur-nacht.png');
  --schatten: 0 1px 0 rgb(0 0 0 / .25), 0 12px 30px -16px rgb(0 0 0 / .7);
  --schatten-hoch: 0 1px 0 rgb(0 0 0 / .3), 0 24px 50px -22px rgb(0 0 0 / .8);
}
/* Hoher Kontrast: keine Struktur, reine Flächen, kräftige Linien */
:root[data-kontrast="hoch"] {
  --leinen: #FFFFFF;
  --papier: #FFFFFF;
  --papier-2: #F4F4F4;
  --tinte: #000000;
  --tinte-2: #1A1A1A;
  --leise: #2B2B2B;
  --linie: #3A3A3A;
  --linie-2: #000000;
  --indigo: #0B1A5C;
  --indigo-tief: #000B3D;
  --indigo-flaeche: #E6E9F7;
  --krapp: #8A1C12;
  --textur: none;
  --schatten: none;
  --schatten-hoch: none;
}
:root[data-kontrast="hoch"][data-thema="nacht"] {
  --leinen: #000000;
  --papier: #000000;
  --papier-2: #111111;
  --tinte: #FFFFFF;
  --tinte-2: #F0F0F0;
  --leise: #E6E6E6;
  --linie: #CFCFCF;
  --linie-2: #FFFFFF;
  --indigo: #C9D4FF;
  --indigo-tief: #E4E9FF;
  --indigo-flaeche: #1B2250;
  --auf-indigo: #000000;
  --krapp: #FFB3A3;
  --wau: #FFD866;
  --wau-auf-indigo: #3A2A04;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: calc(100% * var(--text-skala));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--leinen);
  background-image: var(--textur);
  background-size: 64px 64px;
  color: var(--tinte);
  font-family: var(--schrift-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  overflow-wrap: break-word;
  hyphens: auto;
}
img, svg, canvas, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--indigo); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.12; text-wrap: balance; }
h1, h2, .titel { font-family: var(--schrift-titel); letter-spacing: -.01em; }
h3 { font-family: var(--schrift-text); font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; }
:lang(pl), :lang(cs) { hyphens: manual; }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--fokus);
  outline-offset: 3px;
  border-radius: 6px;
}
/* Bei Audio liegt der Fokus im inneren Bedienfeld, sichtbar wird er am Element selbst */
audio:focus-within { outline: 3px solid var(--fokus); outline-offset: 3px; border-radius: 6px; }
button, .knopf, .chip, .marke, th, label, legend { hyphens: manual; }
.nur-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sprung {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--indigo); color: var(--auf-indigo); padding: .6rem 1rem; border-radius: var(--r-klein);
  text-decoration: none; font-weight: 700;
}
.sprung:focus { top: 12px; }

/* Ziffern und Codes wie auf der Lochkarte */
.mono { font-family: var(--schrift-mono); font-feature-settings: "zero"; letter-spacing: .02em; }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .7rem 1.25rem;
  border-radius: 999px; border: 1.5px solid var(--indigo);
  background: var(--indigo); color: var(--auf-indigo);
  font-weight: 700; letter-spacing: .01em; text-decoration: none;
  transition: transform var(--uebergang), background var(--uebergang), box-shadow var(--uebergang);
}
.knopf:hover { background: var(--indigo-tief); border-color: var(--indigo-tief); }
.knopf:active { transform: translateY(1px) scale(.99); }
.knopf.leise { background: transparent; color: var(--indigo); }
.knopf.leise:hover { background: var(--indigo-flaeche); }
.knopf.klein { min-height: 40px; padding: .45rem .95rem; font-size: .95rem; }
.knopf[disabled], .knopf[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.knopf svg { width: 1.15em; height: 1.15em; flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: .4em;
  min-height: 36px; padding: .3rem .8rem;
  border-radius: 999px; border: 1.5px solid var(--linie-2);
  background: var(--papier); color: var(--tinte);
  font-size: .95rem; line-height: 1.2;
}
button.chip:hover { border-color: var(--indigo); color: var(--indigo); }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip.aktiv {
  background: var(--indigo); border-color: var(--indigo); color: var(--auf-indigo);
}

.marke {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .12rem .55rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--papier-2); color: var(--tinte-2); border: 1px solid var(--linie);
}
.marke.ki { background: var(--wau-flaeche); color: var(--wau-text); border-color: transparent; }
.marke.ok { color: var(--ok); }

/* Pflicht-Hinweis: Arbeitsprobe, kein Kundenprojekt */
.musterhinweis {
  font-size: .82rem; line-height: 1.4; color: var(--tinte-2);
  padding: .5rem var(--rand); border-bottom: 1px solid var(--linie);
  background: var(--papier-2);
}
.musterhinweis b { color: var(--tinte); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
:root[data-bewegung="reduziert"] *, :root[data-bewegung="reduziert"] *::before, :root[data-bewegung="reduziert"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important;
}
