/* ═══════════════════════════════════════════════════════════════════════════
   ВЕНДОРНАЯ КОПИЯ. Не редактировать здесь.
   Источник истины: design_handoff/portal_v1/project/tokens/colors.css
   (он, в свою очередь, собран из pa_tokens.css — DEC-запись через владельца).

   Зачем копия: rsync деплоит только powerarena-telecom/, а design_handoff/ на
   VPS не уезжает. Обновление — перекопировать файл из design_handoff целиком.
   [PATCH LANDING-CMS-Ф2: вендоринг токенов ДС в деплоируемую статику]
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   PowerArena — colour tokens.

   PRIMARY layer: pa_tokens.css v1.0 (PA_LANDING_DESIGN_SPEC v1, landing v9).
   That file is the declared single source of truth for portal + landing;
   values below are copied verbatim from it. Do not invent new hexes.

   Both themes are first class — the product ships a theme toggle:
       <html data-theme="dark">  ← portal default
       <html data-theme="light">
   Text scale toggle:  <html data-scale="1|2">

   LEGACY layer: the game client (game.css) still uses --card/--text2/--b0…
   Those names are re-declared inside each theme as aliases onto the primary
   palette, so a component written either way is correct in both themes.
   ═══════════════════════════════════════════════════════════════════ */

:root{ --scale:1; /* @kind other */ }
[data-scale="2"]{ --scale:1.15; /* @kind other */ }

/* ───────────────────────── DARK (portal default) ─────────────────────
   Contrast contract: --ink ≥ 16.9:1, --ink-soft ≥ 9:1, --label ≥ 7.8:1. */
:root,
[data-theme="dark"]{
  /* Surfaces */
  --bg:       #131318;
  --surface:  #1b1b23;
  --surface2: #22222c;

  /* Text */
  --ink:      #f5f4f0;   /* 17.4:1 */
  --ink-soft: #c9c9c2;   /* 10.3:1 */
  --label:    #b4b4ad;   /* 8.1:1  */

  /* Gold — two tokens, never interchangeable.
     --accent = fills only.  --accent-ink = text/icons only. */
  --accent:     #d9b95c;
  --accent-ink: #e6cd7f;  /* 10.6:1 on --bg */
  --on-accent:  #1a1508;
  --on-fill:    #1a1508;  /* ink on ANY coloured fill — dark theme fills are light */

  /* Lines */
  --line:      rgba(255,255,255,.14);
  --line-soft: rgba(255,255,255,.08);

  /* Semantics */
  --pos:  #7fd49a;
  --neg:  #e89b9b;
  --warn: #e0a878;
  --ok:   var(--pos);

  /* Depth & atmosphere */
  --shadow:    0 12px 40px rgba(0,0,0,.45);
  --overlay:   rgba(10,10,14,.6);
  --hero-glow: radial-gradient(900px 460px at 72% 0%, rgba(217,185,92,.10), transparent 65%); /* @kind other */
  --tree-link: rgba(217,185,92,.45);
  --tree-warn: rgba(224,138,102,.6);

  /* ── Legacy game-client aliases ── */
  --card:   var(--surface);
  --card2:  var(--surface2);
  --text:   var(--ink-soft);
  --text2:  var(--ink);
  --dim2:   var(--label);
  --dim:    rgba(180,180,173,.55);
  --b0:     var(--line-soft);
  --b1:     var(--line);
  --accent2:var(--accent-ink);
  --green:  var(--pos);
  --red:    var(--neg);
  --orange: var(--warn);
  --purple: #8ab4b8;
  --inv:    0; /* @kind other */
}

/* ───────────────────────── LIGHT (warm paper) ─────────────────────── */
[data-theme="light"]{
  --bg:       #f6f5f1;
  --surface:  #ffffff;
  --surface2: #f0efe9;

  --ink:      #1b1c22;   /* 16.9:1 */
  --ink-soft: #46474f;   /* 9.6:1  */
  --label:    #5a5b52;   /* 7.8:1  */

  --accent:     #b3922e;
  --accent-ink: #6e560d;  /* 7.9:1 on --bg */
  --on-accent:  #211a05;
  --on-fill:    #ffffff;  /* ink on ANY coloured fill — light theme fills are dark */

  --line:      #d9d7cc;
  --line-soft: #e6e4da;

  --pos:  #1f7a43;
  --neg:  #9d2b2b;
  --warn: #8f5714;
  --ok:   var(--pos);

  --shadow:    0 10px 34px rgba(30,28,18,.12);
  --overlay:   rgba(40,38,30,.45);
  --hero-glow: radial-gradient(900px 460px at 72% 0%, rgba(179,146,46,.10), transparent 65%); /* @kind other */
  --tree-link: rgba(140,112,30,.5);
  --tree-warn: rgba(170,80,40,.6);

  --card:   var(--surface);
  --card2:  var(--surface2);
  --text:   var(--ink-soft);
  --text2:  var(--ink);
  --dim2:   var(--label);
  --dim:    rgba(90,91,82,.68);
  --b0:     var(--line-soft);
  --b1:     var(--line);
  --accent2:var(--accent-ink);
  --green:  var(--pos);
  --red:    var(--neg);
  --orange: var(--warn);
  --purple: #4f7f85;
  --inv:    1; /* @kind other */
}

/* ───────── Decision-category colours (game client, five levers) ─────────
   Kept as one set across themes — they are identity, not contrast-bearing. */
:root{
  --cp: var(--accent);  /* Продукты · package    */
  --cm: var(--pos);     /* Рынок    · target     */
  --co: var(--warn);    /* Операции · settings-2 */
  --cf: var(--purple);  /* Финансы  · coins      */
  --cl: var(--neg);     /* Люди     · users      */
}

/* ───────── Washes: accent tints used for hero cells and states ───────── */
:root{
  --wash-gold:   color-mix(in srgb, var(--accent) 6%, transparent);
  --wash-gold-2: color-mix(in srgb, var(--accent) 12%, transparent);
  --wash-gold-3: color-mix(in srgb, var(--accent) 20%, transparent);
  --wash-pos:    color-mix(in srgb, var(--pos) 12%, transparent);
  --wash-neg:    color-mix(in srgb, var(--neg) 12%, transparent);
  --wash-warn:   color-mix(in srgb, var(--warn) 12%, transparent);
}

/* ───────── Semantic aliases (reach for these when authoring) ───────── */
:root{
  --surface-page:   var(--bg);
  --surface-card:   var(--surface);
  --surface-sunken: var(--surface2);
  --text-body:      var(--ink-soft);
  --text-strong:    var(--ink);
  --text-muted:     var(--label);
  --border-hairline:var(--line-soft);
  --border-solid:   var(--line);

  /* Rank / medal — identity colours, unchanged across themes.
     Declared in pa_tokens v1.1. */
  --rank-1: var(--accent);   /* @kind color */
  --rank-2: #94a3b8;         /* @kind color */
  --rank-3: #cd7f32;         /* @kind color */
}
