/* Farhorn: die gemeinsame Grundlage aller Flaechen.
 *
 * Bis hierhin standen Tokens, Schriften und Bauteile dreimal kopiert in
 * landing/index.html, app/index.html und app/workspace.html. Sie stimmten
 * ueberein, aber aus Zufall: die naechste Farbaenderung haette eine Datei
 * getroffen und niemand haette es gemerkt.
 *
 * ZWEI THEMES, EIN SATZ NAMEN
 *
 * Die Oberflaeche ist dunkel, das Positionierungsdokument ist Papier. Das ist
 * Absicht: das Dokument ist kein Bildschirm, sondern ein Erzeugnis. Es wird
 * lang gelesen und an Leute geschickt, die Farhorn nicht kennen, und ein
 * dunkles Panel saehe nach App aus statt nach Ergebnis.
 *
 * Frueher lief das Papier unter eigenen Namen (--d-ink, --d-rule) und war
 * damit eine Parallelwelt statt ein Theme. Jetzt setzt `.paper` dieselben
 * Namen neu, und jedes Bauteil hier drunter funktioniert in beiden, ohne eine
 * einzige Sonderregel.
 *
 * Wo die beiden sich wirklich unterscheiden, steht das als eigenes Token
 * (--rule-bar, --btn-border, --accent-line) statt als Ausnahme im Bauteil.
 *
 * Flaechenspezifisches (Hero, Wochenentwuerfe, Dokumentraster) bleibt in der
 * jeweiligen Datei. Hier steht nur, was mehr als eine Flaeche braucht.
 */

/* --- Schriften --------------------------------------------------------- */

@font-face { font-family: 'Archivo'; font-weight: 400 500; font-display: swap; src: url('/fonts/archivo-latin.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 400 500; font-display: swap; src: url('/fonts/archivo-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 400 700; font-display: swap; src: url('/fonts/bricolage-grotesque-latin.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 400 700; font-display: swap; src: url('/fonts/bricolage-grotesque-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400 500; font-display: swap; src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400 500; font-display: swap; src: url('/fonts/jetbrains-mono-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }

/* --- Tokens: dunkel ----------------------------------------------------- */

:root {
  --bg: #13110d;            /* warmes Fast-Schwarz */
  --bg-2: #0c0a07;          /* eingesenkte Flaeche */
  --bg-highlight: #191610;  /* aktive Zeile */

  --ink: #eae4d6;           /* Fliesstext */
  --ink-2: #a8a091;         /* zweite Ebene */
  --ink-3: #8d8574;         /* Meta */
  --ink-4: #5c5548;         /* gedaempfte Daten */

  --rule: #2c281f;          /* tragende Haarlinie */
  --rule-soft: #221f18;     /* Zeilentrenner */
  --rule-strong: #3c372c;   /* Eingabe-Unterstrich, Geisterknopf */
  --rule-bar: var(--rule);  /* Trennlinie unter der Kopfleiste */

  --accent: #e8a33d;        /* Messing, als Flaeche */
  --accent-line: var(--accent); /* Messing, als Linie und Fokus */
  --accent-ink: #1a1206;    /* Text auf Messing */
  --btn-border: var(--accent);

  --ok: #4cc38a;
  --warn: #b23a26;

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --text: Archivo, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  color-scheme: dark;
}

/* --- Tokens: Papier ----------------------------------------------------- */

.paper {
  --bg: #f4f0e6;
  --bg-2: #eeeade;
  --bg-highlight: #ece7d8;

  --ink: #17150f;
  --ink-2: #3b3628;
  --ink-3: #6b6455;
  --ink-4: #8a8272;

  --rule: #ddd7c6;
  --rule-soft: #e6e0d0;
  /* Auf Papier traegt die Tinte selbst die kraeftigen Linien: Eingabefelder,
     Geisterknopf und die Trennlinie der Kopfleiste. Im Dunklen waere das
     grell, dort bleiben sie zurueckhaltend. */
  --rule-strong: var(--ink);
  --rule-bar: var(--ink);

  --accent-line: #8f5712;   /* Messing auf hellem Grund waere zu blass */
  --btn-border: var(--ink);

  color-scheme: light;
  background: var(--bg);
  color: var(--ink);
}

/* --- Grundlage ---------------------------------------------------------- */

* { box-sizing: border-box; }

/* display:grid auf einem Bauteil schlaegt sonst das hidden-Attribut: eine
   Autorenregel gewinnt gegen das display:none des Browser-Stylesheets. Ohne
   diese Zeile sind zwei Angebote gleichzeitig sichtbar. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; cursor: pointer; border-radius: 0; }
input, textarea { font: inherit; border-radius: 0; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* --- Schriftbild -------------------------------------------------------- */

h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(40px, 6.5vw, 64px); line-height: 1.0;
  letter-spacing: -.035em; margin: 0 0 20px;
}

h2 {
  font-family: var(--display); font-weight: 600;
  font-size: 27px; line-height: 1.14;
  letter-spacing: -.025em; margin: 0 0 14px;
}

.lede { font-size: 18px; color: var(--ink-2); max-width: 54ch; margin: 0 0 36px; }
.label { font-family: var(--mono); font-size: 12px; color: var(--ink-3); letter-spacing: .04em; margin-bottom: 10px; }
.fine { font-size: 13.5px; color: var(--ink-3); margin-top: 18px; }
.err { color: var(--warn); font-size: 15px; margin-top: 16px; }
.note { color: var(--ink-3); font-size: 14px; }

.msg { font-size: 15px; margin-top: 14px; display: none; }
.msg.on { display: block; }
.msg.bad { color: var(--warn); }

/* --- Kopfleiste --------------------------------------------------------- */

.bar {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 13px 40px; border-bottom: 1px solid var(--rule-bar);
}
.brand { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
/* Kleinschreibung gehoert zur Meta-Behandlung, nicht zur Monospace-Klasse.
   Vorher hing sie an .mono und galt deshalb nur in der Diagnose-App, wo sie
   zufaellig hinzugefuegt worden war. Als Eigenschaft eines Werkzeugs waere
   sie eine Ueberraschung, als Eigenschaft der Kopfzeile ist sie eine
   Entscheidung. */
.bar .meta { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); text-transform: lowercase; }
.bar > span:last-child { display: flex; gap: 16px; align-items: baseline; }

.lang {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-3);
  text-decoration: underline; text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}
.lang:hover { color: var(--ink); }

/* --- Flaechen ----------------------------------------------------------- */

.wrap { max-width: 760px; margin: 0 auto; padding: 56px 40px 96px; }
.view { display: none; }
.view.on { display: block; }

/* --- Knoepfe ------------------------------------------------------------ */

.btn {
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--btn-border);
  padding: 11px 20px; font-weight: 500; font-size: 15px;
}
.btn:disabled { opacity: .45; cursor: default; }

.btn-ghost { background: none; color: var(--ink); border: 1px solid var(--rule-strong); }

.btn-tiny {
  background: none; color: var(--ink-3); border: 1px solid var(--rule);
  padding: 4px 10px; font-size: 12.5px; font-family: var(--mono);
}
.btn-tiny:hover { color: var(--ink); border-color: var(--rule-strong); }

.link {
  background: none; border: 0; color: var(--ink-2); padding: 0; font-size: 14.5px;
  text-decoration: underline; text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}

/* --- Eingaben ----------------------------------------------------------- */

.field { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.field input {
  flex: 1 1 320px; background: none; border: 0;
  border-bottom: 1px solid var(--rule-strong);
  color: var(--ink); padding: 10px 2px; font-size: 18px;
}
.field input:focus { outline: none; border-bottom-color: var(--accent-line); }

/* --- Schmale Schirme ---------------------------------------------------- */

@media (max-width: 860px) {
  .bar, .wrap { padding-left: 22px; padding-right: 22px; }
}
