/* Smeekraft – v3: Pixel-Visitenkarte auf nordhessischem Fachwerk.
   Reines CSS, kein JavaScript, nichts von außen geladen.
   Alte Fassungen: _archiv/v1/, _archiv/v2/ (werden nicht ausgeliefert).

   Raster: 1 Kunstpixel = 2 px. Schrift „Smeekraft Pixel“ (1 em = 10 Kunstpixel)
   nur in 20 px (2×) und 40 px (4×) – dann liegt jede Pixelkante auf ganzen px.
   Abstände: φ-Reihe 8 · 13 · 21 · 34 · 55 · 89. Karte: 1 : 1,618.
   v3.1: Fachwerk mit Blumen (288×128), Waldsaum fest am unteren Rand.
   v3.2: Waldsaum dreireihig und 3× so hoch; die Karte darf davor stehen.       */

@font-face {
  font-family: "Smeekraft Pixel";
  src: url("/assets/fonts/smeekraft-pixel.woff2") format("woff2");
  font-display: swap;
}

:root {
  --s1: 8px;  --s2: 13px;  --s3: 21px;  --s4: 34px;  --s5: 55px;  --s6: 89px;
  --k: 2px;                       /* Kunstpixel                                */

  /* Schrift: genau zwei Größen */
  --t: 20px;   --zh: 30px;        /* Text 2×, Zeilenhöhe 15 Kunstpixel        */
  --t-gross: 40px;                /* Titel 4×                                 */

  /* Waldsaum (v3.2): wald.png 640×148 Kunstpixel, 3 Reihen, 2× = 1280×296 px */
  --wald-b: 1280px;
  --wald-h: 296px;

  /* Farben – Kontraste gegen --karte (#14110f), WCAG 2.1 */
  --karte: #14110f;
  --karte-rand: #0b0908;
  --text: #e8e0d0;                /* 14.3 : 1                                 */
  --leise: #a99f8e;               /*  7.2 : 1                                 */
  --amber: #ffaa00;               /*  9.9 : 1; --karte auf Amber 9.9 : 1      */
  --amber-tief: #8a5c00;          /* Knopf-Unterkante, nur Deko               */

  --schrift: "Smeekraft Pixel", ui-monospace, monospace;
  --schrift-ja: "Smeekraft Pixel", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
                "Noto Sans CJK JP", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--text);
  font: var(--t) / var(--zh) var(--schrift);
  font-synthesis: none;           /* kein Kunst-Fett/-Kursiv: bliebe nicht scharf */
  -webkit-font-smoothing: none;
  /* Fachwerk, 4× vergrößert (288×128 → 1152×512), um 42 % abgedunkelt, damit die Karte vorne bleibt */
  background-color: #88827a;
  background-image:
    linear-gradient(rgb(20 17 15 / .42), rgb(20 17 15 / .42)),
    url("/assets/img/fachwerk.png");
  background-size: auto, 1152px 512px;
  background-position: center top;
  image-rendering: pixelated;
}
:lang(ja) body, body:lang(ja) { font-family: var(--schrift-ja); }

img { image-rendering: pixelated; display: block; }
p, h1, h2, ul, figure, address { margin: 0; }
ul { padding: 0; list-style: none; }
strong, b, em, i { font-weight: inherit; font-style: inherit; }
address { font-style: normal; }

a { color: var(--amber); text-decoration: underline; text-decoration-thickness: var(--k);
    text-underline-offset: 4px; }
a:hover { color: var(--text); }
:focus-visible { outline: var(--k) solid var(--text); outline-offset: 4px; }

.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.springen {
  position: absolute; left: var(--s2); top: var(--s2); z-index: 9;
  padding: var(--s1) var(--s2); background: var(--karte); transform: translateY(-200%);
}
.springen:focus { transform: none; }

/* ---------- Bühne + Karte ---------- */
.buehne {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  /* Unterseiten: unten Platz in voller Waldhöhe – ganz nach unten gescrollt
     endet die Karte über dem Wald */
  padding: var(--s6) 16px calc(var(--wald-h) + var(--s3));
}
/* Startseite: die Karte steht VOR dem Wald (Wald liegt dahinter, z-index -2) und darf
   ihn überlappen; so passt alles ohne Scrollen auf einen Bildschirm. */
.start .buehne { padding-bottom: calc(var(--s6) + var(--s4)); }

/* Waldsaum: fest am unteren Rand des Fensters, über die volle Breite wiederholt,
   hinter der Karte, fängt keine Klicks. */
.wald {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  height: var(--wald-h);
  background: url("/assets/img/wald.png") repeat-x left bottom / var(--wald-b) var(--wald-h);
  image-rendering: pixelated;
  pointer-events: none;
}

/* Pixelrahmen: 2 Kunstpixel Amber, außen 2 Kunstpixel fast schwarz,
   Ecken treppenförmig ausgespart, dazu harter Pixel-Schatten. */
.karte {
  position: relative;
  background: var(--karte);
  box-shadow:
    0 -4px 0 0 var(--amber), 0 4px 0 0 var(--amber),
    -4px 0 0 0 var(--amber), 4px 0 0 0 var(--amber),
    -4px -4px 0 0 var(--karte-rand), 4px -4px 0 0 var(--karte-rand),
    -4px 4px 0 0 var(--karte-rand), 4px 4px 0 0 var(--karte-rand),
    0 -8px 0 0 var(--karte-rand), 0 8px 0 0 var(--karte-rand),
    -8px 0 0 0 var(--karte-rand), 8px 0 0 0 var(--karte-rand),
    12px 16px 0 0 rgb(11 9 8 / .45);
}

/* Visitenkarte: hochkant 1 : 1,618 (Handy), ab 800 px quer 1,618 : 1 */
.visitenkarte {
  width: min(100%, 358px);
  aspect-ratio: 1 / 1.618;
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s2);
}

.kopf { display: flex; align-items: flex-end; gap: var(--s2); }
.titel {
  font-size: var(--t-gross);
  line-height: 40px;
  font-weight: inherit;
  color: var(--amber);
  margin-bottom: 4px;
}
.satz { color: var(--text); }
.mehr { white-space: nowrap; }

/* Drei Werkstätten: Knopf + X-Handle je Zeile (Handy) bzw. Spalte (quer) */
.werkstaetten { display: grid; gap: var(--s1); }
.werkstaetten li { display: flex; align-items: center; gap: var(--s2); }
.werkstaetten .knopf { flex: 0 0 144px; }

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;              /* ≥ 44 px Trefferfläche */
  padding: var(--s1) var(--s2);
  color: var(--amber);
  background: var(--karte);
  text-decoration: none;
  box-shadow:
    0 -2px 0 0 var(--amber), 0 2px 0 0 var(--amber),
    -2px 0 0 0 var(--amber), 2px 0 0 0 var(--amber),
    0 6px 0 0 var(--amber-tief);
}
.knopf:hover, .knopf:focus-visible { background: var(--amber); color: var(--karte); }
.knopf:active { transform: translateY(var(--k)); }

.x, .fuss a {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  min-height: 44px;
  color: var(--leise);
}
.x:hover, .fuss a:hover { color: var(--amber); }

/* Fußzeile */
.fuss { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s3); color: var(--leise); }
.recht { display: flex; align-items: center; gap: var(--s1); }
.punkt { color: var(--leise); }
.sprachen ul { display: flex; margin-inline-start: -12px; }
.sprachen a { justify-content: center; min-width: 44px; }
.sprachen a[aria-current="page"] { color: var(--amber); text-decoration: none; }
.wolf { flex-basis: 100%; }

/* Werwolf und Ahle Wurscht schauen über die Oberkante – nie über Text */
.spitzel { position: absolute; pointer-events: none; }
.spitzel-wolf { z-index: -1; right: var(--s5); top: -70px; }
.spitzel-wurscht { pointer-events: auto; left: var(--s4); top: -52px; }

@media (min-width: 800px) and (min-height: 560px) {
  .visitenkarte {
    width: 754px;
    aspect-ratio: 1.618 / 1;
    padding: var(--s4) var(--s5);
  }
  .werkstaetten { grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
  .werkstaetten li { flex-direction: column; align-items: stretch; gap: var(--s1); }
  .werkstaetten .knopf { flex: none; }
  .fuss { justify-content: space-between; }
  .sprachen ul { margin-inline: 0 -12px; }
  .wolf { flex-basis: auto; }
  .spitzel-wolf { right: var(--s6); }
  .spitzel-wurscht { left: var(--s5); }
}

/* ---------- Unterseiten: gleiche Karte, darf scrollen ---------- */
.seite {
  width: min(100%, 754px);
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.kopf.klein .marke {
  display: inline-flex; align-items: flex-end; gap: var(--s2);
  color: var(--amber); text-decoration: none; min-height: 44px;
}
.kopf.klein .rosa { width: 27px; height: 42px; }  /* 1× – klein im Kopf */
.inhalt > * + * { margin-top: var(--s3); }
.inhalt h1 { font-size: var(--t-gross); line-height: 40px; font-weight: inherit; color: var(--amber); }
.inhalt h2 { font-size: var(--t); font-weight: inherit; color: var(--amber); margin-top: var(--s4); }
.inhalt .absender + h1 { margin-top: var(--s1); }
.einstieg, .gude { color: var(--amber); }
.leise, .absender, .untertitel { color: var(--leise); }
.bild img { width: 136px; height: 84px; }
.werke li { display: grid; }
.werke li + li { margin-top: var(--s2); }
.werke strong { color: var(--amber); }
.status { color: var(--leise); }
.status::before { content: "· "; }
.knoepfe { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s2); }
.weiter { margin-top: var(--s4) !important; }
.entwurf { color: var(--leise); }
.platzhalter { color: var(--amber); }

@media (min-width: 800px) {
  .buehne:has(.seite) { place-items: start center; }
  .seite { padding: var(--s4) var(--s5); }
}

@media (prefers-reduced-motion: no-preference) {
  .knopf { transition: background-color .1s steps(2), color .1s steps(2); }
}
