/* ============================================================================
   LagerLos — canonical design-token schema (single source of truth).
   From the 2026-08-21 framework audit (35-agent council). Every surface — the
   Vite app (src/styles), the SEO pages (public/content.css), and the four inline
   templates (scratchpad/*) — draws its tokens from THIS set of names/values.
   Brand hexes are UNCHANGED. The only value deltas from the old ad-hoc systems
   are three deliberate accessibility fixes: --text-faint lightened, inputs 16px,
   tap targets 44px.

   The root problem this fixes: `--ink` meant the dark GROUND in the templates but
   LIGHT TEXT in content.css + the app — the same name, inverted roles. Here ground
   is always `--bg-*` and text is always `--text-*`; `--ink` is retired so the
   collision can never recur. Surfaces migrate one at a time; a per-surface compat shim (aliasing
   legacy names like --ink→var(--text), --panel→var(--bg-raised)) is added to each surface AT
   MIGRATION TIME and removed once that surface is converged. (No shim lives in this token file.)
   ============================================================================ */

:root {
  color-scheme: dark;

  /* --- Ground / surfaces (never a text value) --- */
  --bg-base:         #0d0e0b;  /* page ground (was the templates' --ink) */
  --bg-raised:       #17180f;  /* masthead, raised panel (was --panel) */
  --bg-paper:        #1e1f16;  /* card fill, nested (was --panel2) */
  --bg-sunken:       #0b0c08;  /* input wells */
  --bg-tint:         #14150e;
  --hairline:        #33342a;
  --hairline-strong: #45463a;

  /* --- Text (never a ground value); two-tier bone --- */
  --text:        #e9e5d4;  /* running copy everywhere */
  --text-bright: #f5f3ea;  /* headings / <strong> / emphasis only */
  --text-muted:  #9b9d8f;  /* secondary */
  --text-faint:  #8a8c80;  /* a11y delta: was #72746a (AA-fail 4.08:1) → ~5.2:1. Never below 16px text. */

  /* --- Accent (brand, unchanged) --- */
  --signal:      #e4ff1a;
  --signal-deep: #c6dd06;
  --on-signal:   #0d0e0b;  /* text/icon ON a signal fill */
  /* Das Rolltor (Startbereich, Katalogkarten und Galerie vor dem Start): Wellblech, Rille,
     Sockel, Griff, Schrift. Rat 17.09.2026, K3: vorher als Roh-Hex an zwei Stellen. */
  --tor-blech:      #34352d;
  --tor-blech-hell: #2c2d24;
  --tor-rille:      #24251d;
  --tor-sockel:     #0a0b06;
  --tor-griff:      #12130c;
  --tor-schrift:    #f6f2e4;

  /* --- Status (one name, one value) --- */
  --ok:   #5fd39a;
  --warn: #f3922b;
  --bad:  #ff6f61;

  /* --- Semantische Rollen (Design-Rat 09.09.2026, Schritt 1) ---
     EIN Name je Aufgabe, und die Aufgabe steht im Namen. Der Rat hat im gebauten Zustand
     elf verschiedene Bedeutungen von Signalgelb gezaehlt: Marke, Handlung, Preis,
     Sekundenanzeige, Zeitpille, Merken, Hinweis und weitere. Eine Signalfarbe, die alles
     bedeutet, bedeutet nichts mehr. Deshalb die vom Betreiber beschlossene Aufteilung:
     Gelb fuehrt zur HANDLUNG, Orange nennt den PREIS, Rot die LAUFENDE ZEIT.
     Es sind Aliasnamen auf die vorhandenen Statuswerte, keine neuen Farben. */
  --price:           var(--warn);
  --countdown-live:  var(--bad);   /* nur in der letzten Stunde (data-letzte-stunde), Marcel 23.09.2026 */
  --countdown-calm:  var(--text);  /* laufende Zeit mit mehr als einer Stunde Rest */
  --countdown-ended: var(--text-muted);

  /* --- Radii / elevation --- */
  --r-sm: 9px; --r-btn: 11px; --r-input: 11px; --r-card: 14px; --r-lg: 16px; --r-pill: 999px;
  --shadow-card: 0 12px 40px rgba(0,0,0,.28);
  --shadow-pop:  0 18px 50px rgba(0,0,0,.42);

  /* --- Helle Blätter der Startseite (Entwurf O9, Marcel 27.09.2026) ---
     Neutrales Hellgrau ohne Gelbstich als Grund, weiße Karten darauf. Bewusst KEIN Papier-/Beigeton
     (Entwurf E wurde genau daran verworfen). Nur für helle Flächen auf der öffentlichen Startseite. */
  --sheet-bg:      #f3f4f4;
  --sheet-card:    #ffffff;
  --sheet-text:    #23241e;
  --sheet-heading: #0d0e0b;
  --sheet-muted:   #4a4b42;
  --sheet-line:    #dfe0dc;
  --sheet-field:   #c9cbc4;  /* Feldrand auf Weiß (Entwurf W1), mindestens 1.5:1 gegen die Karte */
  --sheet-placeholder: #73756c; /* Platzhalter auf Weiß (V-4, 09.10.2026): sichtbar heller als Text, noch ~4.6:1 gegen die Karte */
  --sheet-bad:     #b3261e;  /* Fehlertext auf Weiß; --bad ist für dunklen Grund gebaut und auf Weiß zu blass */
  --sheet-shadow:  0 1px 2px rgba(13,14,11,.06), 0 10px 30px rgba(13,14,11,.08);
  /* Rat Optik 10.11.2026 (F-24): wiederkehrende Schatten der hellen Flaechen mit Namen statt als Rohwert. */
  --schatten-leiste:   0 -12px 16px -12px rgba(13,14,11,.18); /* feste Leiste unten (Fokusmodus, Gebotsblatt) */
  --schatten-plakette: 0 4px 12px rgba(13,14,11,.18);          /* schraeg gestellte Zeichen-Kachel (Leerzustand, Erfolg) */
  --schatten-knopf:    0 2px 8px rgba(13,14,11,.18);           /* runder Knopf auf einem Foto oder einer Karte */

  /* --- Charity-Lager (Aktion bis 27.12.2026): Bordeaux-Samt und Messing ---
     Fuer die Buehne der Startseite (.cb, Vorlage lagerlos-soon) und das Band auf den Landingpages (.kopf-leiste,
     kopf.css). Dieselben Werte wie die Charity-Seite. Standen bis zum 26.11.2026 nur oertlich in der Startseite. */
  --ch-samt:         #3d1a20;
  --ch-samt-mitte:   #2a1217;
  --ch-samt-tief:    #1c1013;
  --ch-messing:      #ad8955;
  --ch-messing-hell: #d7b57e;
  --ch-creme:        #f5f3ea;

  /* --- Type: one fluid modular scale, anchored on the universal 16px body --- */
  /* Ueberschriften: Barlow Condensed (Marcel 28.09.2026, Schriftvergleich D). Die Wortmarke LAGERLOS.
     bleibt in der Schablonenschrift und nutzt dafuer --font-marke. */
  --font-display: "Barlow Condensed", "Archivo", sans-serif;
  --font-marke:   "Stardos Stencil", "Archivo", serif;
  --font-body:    "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "Martian Mono", "Martian", ui-monospace, monospace;
  --lh-body:  1.6;
  --lh-tight: 1.05;
  --measure:  66ch;                                            /* running-copy max line length */
  --fs-caption: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);  /* 12–13px (not with --text-faint) */
  --fs-small:   clamp(0.8125rem, 0.79rem + 0.2vw, 0.875rem);  /* 13–14px */
  --fs-body:    1rem;                                          /* 16px flat — also the input minimum */
  --fs-lead:    clamp(1.0625rem, 1.02rem + 0.28vw, 1.1875rem);/* 17–19px */
  --fs-h3:      clamp(1.25rem, 1.16rem + 0.45vw, 1.5rem);     /* 20–24px */
  --fs-h2:      clamp(1.5rem, 1.34rem + 0.8vw, 2.125rem);     /* 24–34px */
  --fs-h1:      clamp(2rem, 1.5rem + 2.6vw, 3.2rem);          /* 32–51px */
  --fs-display: clamp(2.5rem, 1.9rem + 3.4vw, 4.4rem);        /* 40–70px — hero opt-in only */
  /* Der Hauptpreis im Gebotsbereich behaelt seine heutige Groesse, bekommt aber einen Namen.
     Die Fensterhoehe des Preisschlitzes MUSS dazu passen, sonst schneidet er die Ziffern ab. */
  --fs-bid-price: 2.3rem;
  --lh-bid-price: 2.6rem;
  /* Mindestbreite fuer die kurze Uhr (mm:ss), damit sie beim Ticken nicht wandert. Mindest-,
     nicht Hoechstbreite: ausgeschriebene Tages- und Stundenangaben duerfen wachsen. */
  --countdown-value-width: 5ch;
  /* Das Seitenverhaeltnis der Warenfotos. Galerie und Loskarte teilen es, damit derselbe
     Ausschnitt nicht zweimal anders beschnitten wird. */
  --ratio-lot-photo: 4 / 3;

  /* --- Spacing: value = index × 4px --- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-14: 56px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;
  --gutter: 20px; --gutter-lg: 40px;                          /* px, so they don't scale with text-zoom */
  --section-y: clamp(48px, 5vw + 1rem, 88px);
  --card-pad: 20px; --card-pad-lg: 24px;
  --field-gap: var(--sp-3);

  /* --- Containers --- */
  --container-max: 1200px;
  --container-narrow: 560px;                                  /* centered form archetype */

  /* --- Interaction primitives --- */
  --tap-min: 44px; --tap-comfortable: 48px;

  /* --- Bewegung: drei Dauern nach Aufgabe, eine Kurve (Design-Rat 09.09.2026) ---
     Nicht, um neue Bewegung einzufuehren, sondern damit vorhandene dieselbe Sprache
     sprechen. Eine Ruecktmeldung ist kurz, ein Zustandswechsel mittel, ein Blatt laenger. */
  --motion-feedback: 140ms;
  --motion-state: 200ms;
  --motion-sheet: 280ms;
  --ease-ui: cubic-bezier(.22, 1, .36, 1);
  --focus-ring: 2px solid var(--signal);
  --focus-offset: 2px;
  --masthead-h: var(--masthead-compact-h);                        /* Referenzblatt = App (DESIGN-08) */

  /* --- Huelle (Design-Rat 09.09.2026, Schritt 5) ---
     Kopf und untere Reiterleiste sind je 56 Pixel hoch, einschliesslich ihres Rahmens, plus die
     Sicherheitszone des Geraets. Das sind MINDESThoehen: bei vergroesserter Schrift wachsen beide
     mit, nichts wird abgeschnitten. Das Symbol in der Reiterleiste ist 24 Pixel, die Zeilenhoehe
     von Bedienelementen 1.2 (Fliesstext bleibt bei --lh-body). */
  --masthead-compact-h: var(--sp-14);
  --nav-compact-h: var(--sp-14);
  --icon-nav: var(--sp-6);
  --lh-control: 1.2;
}

/* Canonical breakpoints (documented; the stack is Tailwind so these mirror its defaults):
   --sm 640px  --md 768px  --lg 1024px  --xl 1280px.
   Migration map from the 15 legacy values: 560/620/640→sm · 720/760/767/768→md ·
   860/900/939/940/1024/1040→lg · 1200→xl. Nav flips at md; article/aside + SEO grid at lg. */

/* Accessibility floor shared by every surface: no interactive control smaller than the
   tap minimum, and one visible focus ring (bare :focus is forbidden). Inline in-sentence
   prose links are exempt (WCAG) and just get vertical hit-slop. */
a, button, summary, [role="button"], select, input:not([type="checkbox"]):not([type="radio"]), textarea {
  min-height: var(--tap-min);
}
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
