/*
 * qarap — design tokens.
 *   §1 colour + shape ← D3 (dark = prod canonical / light = R1, accepted 2026-07-21);
 *      the twelve tokens marked "D7 patch" were used by runs R2–R12 without ever
 *      being in the canon — folded in on D7 acceptance (07-motion.md §9).
 *   §2 motion ← D7 «Язык движения» V1, accepted 2026-08-06 (07-motion.md §4, §9).
 * Scope root: .lens-scene; light theme = override via [data-theme="light"] on the
 * same root (per 03-design-requirements §3 — scene-scoped coexistence with Aether Deck).
 *
 * Role contract (inherited by every subsequent run, 03 §2 D3):
 *   text    → tokens marked "text" only; teal text is ALWAYS --teal-deep
 *   graphic → strokes/lines; teal strokes use --teal
 *   glow    → fills/auras only; --teal-bright NEVER carries text or thin critical strokes
 * Contrast (light, measured vs --surface / --ground; AA text 4.5, graphic 3.0):
 *   structure 6.96/6.02 · text 12.9/11.2 · meta 5.34/4.62 · teal 4.30/3.72 ·
 *   teal-deep 5.38/4.65 · teal-bright 2.07/1.79 (fill-only) · purple 6.05/5.23
 *
 * Dead names — never reintroduce: --teal-text (drift, use --teal-deep),
 * --card-border (duplicate of --hair), --choreo-intensity (lost to --pi),
 * --flash-period / --tk-period / --feed-period / --period (demo-loop artefacts).
 */

.lens-scene {
  /* ---------------- §1 · colour + shape (D3) ---------------- */

  /* surfaces */
  --ground: #0D0E11;      /* void — фон за приложением */
  --surface: #121316;     /* поднятая панель / карточка */
  --surface-2: #17191D;   /* D7 patch: вторая поверхность — строка ленты, вложенная карточка */
  --well-core: #16403C;   /* зрачок ириса — teal-лужа */
  --well-edge: #0F2C29;   /* D7 patch: край колодца, парный к --well-core */

  /* apparatus (SILVER = structure, never life) */
  --structure: #C7CDD6;   /* скелет / линии / аппарат */
  --text: #C7CDD6;        /* первичный текст (в dark == structure) */
  --meta: #8A93A3;        /* метаданные */

  /* life (TEAL = event/touch, never structure) */
  --teal: #3FE0D0;        /* graphic: штрих / точка касания */
  --teal-deep: #3FE0D0;   /* text: заголовок, чип, ссылка (в dark == teal) */
  --teal-bright: #65FDEC; /* glow: аура / вспышка — только заливка */

  /* tier */
  --purple: #9C4BFF;      /* tier-цвет, secondary only */

  /* D7 patch: hairline, подложки, элевация, радиусы */
  --hair: rgba(199,205,214,.16);         /* волосяная линия 1px — единственное имя границы */
  --hair-strong: rgba(199,205,214,.34);
  --tint: rgba(199,205,214,.045);
  --tint-soft: rgba(199,205,214,.025);
  --tint-teal: rgba(63,224,208,.075);
  --tint-teal-soft: rgba(63,224,208,.04);
  --tint-purple: rgba(156,75,255,.08);
  --shadow: 0 6px 22px rgba(0,0,0,.42);  /* единственный токен элевации в системе (R6) */
  --radius: 14px;
  --radius-sm: 8px;

  /* Типографика 03 §1: Plus Jakarta Sans — тело, Space Mono — технические
     подписи и лейблы. Токеном заведена только моно-семья: sans приходит с
     body. Внесено при миграции «Мира» (07-motion.md §11) — на бордах моно
     стоял литералом в каждом правиле, и на первой же сцене это дало бы
     тридцать копий строки. */
  --font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ---------------- §2 · motion (D7 V1, темперамент Т3) ----------------
     silver щёлкает — teal затухает. Кривая выводится из того, кто движется
     (07-motion.md §4, правило М7), а не назначается на глаз. */

  --dur-instant: 140ms;   --ease-instant: linear;      /* аппарат: смена состояния */
  --dur-swap: 200ms;                                   /* подмена фрагмента */
  --dur-life: 1400ms;     --ease-life: ease-out;       /* жизнь: приход, оседание */
  --dur-flash: 2200ms;                                 /* вспышка узла — все три слоя */
  --dur-ambient: 3400ms;  --ease-ambient: ease-in-out; /* пульс, аккомодация:
                                                          единственная симметричная кривая */
  --toast-life: 3.78s;                                 /* 0.16 in / 3.4 hold / 0.22 out */

  /* печёт сервер (Choreography, 04 §1) — здесь только значения по умолчанию */
  --choreo-delay: 0ms;    /* разбег каскада; эталон — 90ms на узел */
  --rest-halo: 0;         /* уровень покоя ореола: 0 скелет · .10 тронут · .5 раскрыт */
  --pi: 0;                /* интенсивность пульса 0..1; носитель коалесценции */
}

.lens-scene[data-theme="light"] {
  --ground: #E8ECF1;
  --surface: #FBFCFE;
  --surface-2: #F1F4F8;
  --well-core: #CFEFEA;
  --well-edge: #A9DED6;

  --structure: #4E5765;   /* silver получает чернила: контраст вместо яркости */
  --text: #2B3038;        /* расходится со structure — иерархия сохранена */
  --meta: #626A78;

  --teal: #0C877A;
  --teal-deep: #0A7568;
  --teal-bright: #16C7B4; /* по-прежнему только заливка/аура */

  --purple: #7A34E0;

  --hair: rgba(78,87,101,.20);
  --hair-strong: rgba(78,87,101,.42);
  --tint: rgba(78,87,101,.055);
  --tint-soft: rgba(78,87,101,.03);
  --tint-teal: rgba(12,135,122,.085);
  --tint-teal-soft: rgba(12,135,122,.045);
  --tint-purple: rgba(122,52,224,.07);
  --shadow: 0 6px 22px rgba(43,48,56,.13);
}

/* Правило М9: reduced-motion гасит переходы, но не приход кадров и не данные
   хореографии. Базовое состояние в CSS обязано быть ОСЕВШИМ — тогда обнуление
   ниже само оставляет верную статику (07-motion.md §8). */
@media (prefers-reduced-motion: reduce) {
  .lens-scene {
    --dur-instant: 0ms; --dur-swap: 0ms; --dur-life: 0ms;
    --dur-flash: 0ms;   --dur-ambient: 0ms; --choreo-delay: 0ms;
  }
}
