/* ============================================================
   Brand: Farangur (farangur.com — packing app, formerly Kufrant)
   Source: ~/projects/weby/farangur/public/assets/theme.css (the app's own
           SSoT palette, v2 "pastelové plochy, syté atramenty" / "pastel
           surfaces, saturated inks", 2026-08-28) + brand/mark.svg +
           brand/logo.svg (the wordmark, hand-drawn monoline paths — see the
           type note at the end of this file).
   Font:   Mulish (body) + Baloo 2 (display) — named TWICE: the headmatter
           `fonts:` block downloads them, the variables below apply them.
           Change both or neither. Verified 2026-09-03: both families return
           200 for the combined weight list 400,500,600,700,800 (curl against
           fonts.googleapis.com/css2, one request for both families — the
           way Slidev actually builds the URL). Neither font is used by the
           app itself, which is deliberately system-font-only to keep the PWA
           shell light; a slide deck carries no such payload constraint.

   SHAPE. The app's own theme.css is explicit that this palette is a rewrite
   aimed at "veselosť" (cheerfulness) carried by colour and by RADIUS, not by
   font: v2 grew every radius by 2px over v1 specifically for a softer, more
   contemporary feel. This brand carries that instinct into the deck rather
   than reusing the engine's sharper Innovatrics-shaped defaults — see the
   shape block below and NOTES.md.

   TWO-SURFACE INVERSION. Unlike digitalsymbio (white PAGE, warm-tinted
   CARDS) this app has it the other way round: --bg is the warm cream PAGE
   and --surface is plain white, used for CARDS on top of it. This file keeps
   that inversion rather than flattening it to match another brand's shape —
   see the surfaces block.

   BAKED LOGO ASSETS. logo.png / logo-white.png are NOT transparent. They are
   flat PNGs pre-rendered by the app's own brand/deck tooling with a SOLID
   background already baked in: logo.png on #FFF5EF (the cream --page-bg
   below), logo-white.png on #231C19 (the warm-black --base below). That is
   why --page-bg and --base in this file are pinned to those EXACT hex values
   — change either one without re-exporting the logo from brand/logo.svg and
   a visible rectangle will appear behind the wordmark. See NOTES.md.

   THREE LAYERS (brands/README.md). Layer 1 is the ramp: the fonts, the
   colours and the shape. Layer 2 is the web roles, which the app paints with.
   Layer 3 is the deck surfaces. Layer 2 was added on 2026-10-29. It is the
   palette of the app's public/assets/theme.css in v1.13.1, value for value,
   under the family role names of ~/fleet/guides/dark-light.md. The app reads
   a vendored copy of this file, so a design change of the app is made HERE.

   HOW THE THEME SWITCHES (layer 2). Each role holds both of its values in one
   `light-dark()` call, light value first. This profile owns ONE rule: the
   `color-scheme: light dark` below. The APPLICATION owns the two rules that
   force a theme, `:root[data-theme="light"|"dark"]`, and a test guards them.
   Do not move either side: brands/README.md, rule 2, says why.
   A deck pins `color-scheme: light` after the import. Layers 1 and 3 are
   static hex, so a deck renders as before.
   ============================================================ */

:root {
  color-scheme: light dark;

  /* fonts — the headmatter `fonts:` block downloads them; these apply them */
  --font-sans:       'Mulish', ui-sans-serif, system-ui, -apple-system, sans-serif;

  /* dark ground — the section (chapter break) and end slide, and dark cards.
     Taken straight from the app's own dark theme (--dk-bg family in
     theme.css), per the brief: no invented dark palette. */
  --base:            #231c19;   /* app --dk-bg: warm black, never blue-black */
  --base-deep:       #181412;   /* one step darker; not in the app, mixed 30% toward #000 */
  --base-soft:       #3b312d;   /* app --dk-surface2: pressed/nested plane in dark mode */
  --base-line:       #6e5e56;   /* app's LIGHT-mode --muted, reused here as the flow-arrow
                                    colour on a light content page — 5.76:1 on cream, 6.18:1 on white */

  /* accent — teal, the case colour of the mark and half its two-tone identity.
     The app's own two themes already hand us the exact two shades this
     engine wants, pre-validated: dark-mode accent is the BRIGHT one for
     fills/dark grounds, light-mode accent is the DEEP one for text on paper. */
  --accent:          #60c5cd;   /* app --dk-accent: bright teal, fills/ticks, 8.28:1 on --base */
  --accent-soft:     #88d8df;   /* mid step between --accent-tint and --accent, for chips/authors */
  --accent-deep:     #1a6a70;   /* app light-mode --accent: TEXT on paper, 6.29:1 white · 5.86:1 cream */
  --accent-tint:     #afecf1;   /* app light-mode --accent-soft: pastel card bg; accent-deep on it = 4.82:1 */

  /* secondary — amber, the other half of the mark's two-tone identity (the
     "nachystané"/ready phase in the app). Bright dark-mode shade, because its
     one engine job (section rail/accent) sits on a DARK ground here.
     ⚠️ Do not reach for --second as TEXT on a light card: only 2.02:1 on
     white. For amber text on paper, the app's own light-mode value is
     #954D17 — not carried into this file because the engine names no such
     slot; add a custom variable in a deck's own brand.css override if a
     slide truly needs it. */
  --second:          #eaa880;   /* app --dk-amber, 8.32:1 on --base */
  --green:           #1a6f2a;   /* app light-mode --green ("zbalené"/packed = done), 6.27:1 on --surface.
                                    Calibrated for LIGHT grounds only — 2.68:1 on --base, do not use on a dark card. */

  /* light ground — cards, on the cream page below */
  --surface:         #ffffff;   /* app --surface: plain white card, not the page */
  --surface-deep:    #ebd6c8;   /* app --line-soft: decorative hairline, no contrast duty by design */
  --muted:           #6e5e56;   /* app --muted: 6.18:1 on --surface, 5.76:1 on --page-bg */

  /* text on a light ground */
  --ink:             #2d231e;   /* app --text: 15.32:1 on --surface, 14.27:1 on --page-bg */
  --ink-soft:        #473b34;   /* mixed 40% toward --muted; 10.81:1 on --surface, 10.07:1 on --page-bg */

  /* text on a dark ground — three steps, most to least prominent */
  --on-dark:         #eee6e0;   /* app --dk-text: 13.61:1 on --base */
  --on-dark-soft:    #d7ccc5;   /* mixed 40% toward --on-dark-muted; 10.65:1 on --base */
  --on-dark-muted:   #b4a59c;   /* app --dk-muted: 7.03:1 on --base */

  /* ======================================================================
     Layer 2: the web roles — light value first, dark value second.
     A role reads a ramp token when the ramp holds its exact value.

     Every ratio is calculated, not estimated. A ratio on a foreground is the
     WORST of the three grounds in that theme (--bg, --bg-raised, --bg-sunken),
     light then dark. Text needs 4.5:1, a control edge and a focus ring 3:1.

     Pastel GROUNDS carry the colour in light, saturated INKS carry it in dark
     (the app's v2 palette, "pastelové plochy, syté atramenty"). A Farangur
     ink is symmetric: the same value is a foreground on a ground and a fill
     under --on-*. That is why each *-fg equals its *-fill here. They are two
     tokens so that a later design can split them without touching the app.
     ====================================================================== */

  /* grounds — warm apricot paper, a white card on it, a pressed plane */
  --bg:              light-dark(#fff5ef, var(--base));         /* the page. #fff5ef is the deck's
                                                                  --page-bg too: logo.png is baked on it */
  --bg-raised:       light-dark(var(--surface), #2d2522);      /* card, row, sheet */
  --bg-sunken:       light-dark(#f5e7dd, var(--base-soft));    /* pressed state, nested plane */

  /* text. The app has no middle step: --fg-soft is --fg-muted, so the kit
     switches keep the look they had. The deck's --ink-soft is not used here. */
  --fg:              light-dark(var(--ink), var(--on-dark));             /* 12.66:1 / 10.24:1 */
  --fg-soft:         light-dark(var(--muted), var(--on-dark-muted));     /*  5.11:1 /  5.29:1 */
  --fg-muted:        light-dark(var(--muted), var(--on-dark-muted));     /*  5.11:1 /  5.29:1 */

  /* lines. --line is the decorative hairline between rows (no contrast duty:
     a row is identified by its content). --line-strong is the edge of a
     control (input, chip, button) and holds 3:1 on all three grounds. */
  --line:            light-dark(var(--surface-deep), #4e403c);
  --line-strong:     light-dark(#8e7c73, #8b7c74);                       /*  3.29:1 /  3.15:1 */

  /* four semantic colours, FOUR, not five — there is no warn group.
     accent = "beriem" (taking it), second = amber, "nachystané" (staged),
     ok = "zbalené" (packed), danger = "chýba" (missing). */
  --accent-fg:       light-dark(var(--accent-deep), var(--accent));      /*  5.20:1 /  6.23:1 */
  --accent-fill:     light-dark(var(--accent-deep), var(--accent));
  --on-accent:       light-dark(#ffffff, var(--base));                   /*  6.29:1 /  8.28:1 on the fill */

  --second-fg:       light-dark(#954d17, var(--second));                 /*  5.18:1 /  6.26:1 */
  --second-fill:     light-dark(#954d17, var(--second));
  --on-second:       light-dark(#ffffff, var(--base));                   /*  6.27:1 /  8.32:1 on the fill */

  --ok-fg:           light-dark(var(--green), #8cc48f);                  /*  5.18:1 /  6.26:1 */
  --ok-fill:         light-dark(var(--green), #8cc48f);
  --on-ok:           light-dark(#ffffff, var(--base));                   /*  6.27:1 /  8.32:1 on the fill */

  --danger-fg:       light-dark(#ba213d, #f1a1a3);                       /*  5.15:1 /  6.23:1 */
  --danger-fill:     light-dark(#ba213d, #f1a1a3);
  --on-danger:       light-dark(#ffffff, var(--base));                   /*  6.23:1 /  8.28:1 on the fill */

  /* A FILL flips with the theme here, unlike in most brands, because the inks
     are symmetric. Measured, fill against the worst of the three grounds:
     accent 5.20 / 6.23, second 5.18 / 6.26, ok 5.18 / 6.26, danger 5.15 / 6.23.
     So the edge of a fill holds 3:1 in both themes. */

  /* washes — the pastel under a row, a badge or a card. This is where the
     cheerfulness lives. Put the matching *-fg on a wash, never --fg-muted.
     The ratio is that *-fg on that wash, light then dark. */
  --accent-wash:     light-dark(var(--accent-tint), #114044);            /*  4.82:1 /  5.63:1 */
  --second-wash:     light-dark(#ffdac5, #503322);                       /*  4.80:1 /  5.67:1 */
  --ok-wash:         light-dark(#c6ebc7, #274029);                       /*  4.81:1 /  5.62:1 */
  --danger-wash:     light-dark(#ffd8d8, #533031);                       /*  4.76:1 /  5.65:1 */

  /* focus — the outer ring of the app's two-colour focus ring. The app puts an
     inner halo of --on-accent between it and a fill, so each leg only has to
     hold against what it touches. */
  --focus:           light-dark(var(--ink), var(--on-dark));             /* 12.66:1 / 10.24:1 */

  /* shadow — warm and thin on apricot paper ("a grey shadow is dirty there").
     `light-dark()` takes a colour, not a shadow list: the tint flips, the
     geometry stays. */
  --shadow-tint-1:   light-dark(rgba(45, 35, 30, .06), rgba(0, 0, 0, .5));
  --shadow-tint-2:   light-dark(rgba(45, 35, 30, .09), rgba(0, 0, 0, .55));
  --shadow-1:        0 1px 2px var(--shadow-tint-1), 0 10px 28px var(--shadow-tint-2);

  /* ---- shape ------------------------------------------------------------ */

  --font-display:    'Baloo 2', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-text:       var(--font-sans);

  /* The app's own v2 rewrite grew every radius by 2px on purpose, for
     "mäkšie a súčasnejšie" (softer, more contemporary) — carried in here
     rather than the engine's sharper defaults. One extra step for cards vs.
     chips, same ladder logic as the app's own --radius / --radius-sm pair. */
  --radius:          20px;   /* app --radius */
  --radius-sm:       14px;   /* app --radius-sm */
  --radius-box:      16px;   /* between the two, for flow-boxes and rank items */
  --radius-pill:     999px;  /* chips stay pill-shaped: the app has no pill token to carry over */
  --radius-dot:      50%;

  /* Bullet and icon-tile: a ROUNDED SQUARE, not a full circle and not the
     engine's sharp square. This echoes the mark's own three cells, which are
     rounded rects (rx 30 on an 84x96 box, ~33%) — round enough to read as
     soft, square enough to still read as a "compartment", not a dot. */
  --bullet-w:        9px;
  --bullet-h:        9px;
  --bullet-radius:   2px;
  --bullet-clip:     none;

  --tile-radius:     12px;   /* ~33% of the default 34px tile, matching the mark cells' own proportion;
                                 the full 20px --radius would read as near-circular at this small a size */

  /* Warm-tinted collage shadow, reusing the app's own shadow recipe
     (rgba(45,35,30,…) — "grey is dirty on apricot paper") rather than the
     engine's neutral black. A small tilt, not zero: the app's mark itself is
     flat by written rule (brand/README.md §7 — no gradients, no shadows, no
     tilt on the MARK), but that rule is scoped to the mark, and the app's own
     UI does use a warm soft shadow elsewhere. A collage of screenshots is
     UI, not the mark, so it keeps a small human tilt. */
  --snap-tilt:       -1.5deg;
  --snap-shadow:     0 8px 22px rgba(45, 35, 30, 0.16);

  /* ---- surfaces --------------------------------------------------------- */

  /* Cream page, exact value of the app's own --bg. Pinned: logo.png's baked
     background depends on this exact hex — see the file header. */
  --page-bg:         #fff5ef;

  /* COVER is light, like digitalsymbio: dark is reserved for the one deep
     band at the chapter break. --cover-bg is the PAGE cream, not --surface
     (which is plain white here) — the inverse of digitalsymbio's own choice,
     because it is Farangur's page that carries the warmth, not its cards. */
  --cover-bg:            var(--page-bg);
  --cover-ink:           var(--ink);
  --cover-ink-soft:      var(--ink-soft);
  --cover-accent:        var(--accent-deep);
  --cover-mark-w:        700px;
  --cover-mark-right:    -160px;
  --cover-mark-bottom:   -60px;
  --cover-mark-opacity:  0.9;

  /* SECTION is the one dark band. Rail in --second (amber) with the heading
     accent in --accent (teal) puts the mark's own two-tone pairing directly
     on the chapter break. No ghost number: the giant translucent digit is
     the most recognisable tell of the template this engine came from, and
     both reference brands agree it should go. */
  --section-bg:            var(--base);
  --section-ink:           var(--on-dark);
  --section-ink-soft:      var(--on-dark-muted);
  --section-accent:        var(--accent);
  --section-rail-color:    var(--second);
  --section-number-color:  transparent;

  /* END stays dark — the deck closes on the same band it broke a chapter on. */
  --end-bg:          var(--base);
  --end-ink:         var(--on-dark);
  --end-ink-soft:    var(--on-dark-muted);
  --end-accent:      var(--accent);
}
