@use "~styles/mixins" as *;

/*
  Design tokens for Analingua, taken from design_handoff_analingua_redesign/tokens.json.
  A rebrand edits THIS file and nothing else.
*/

:root {
  // ---- z-index scale (use these, never magic numbers) ----
  --theme-z-base: 1;
  --theme-z-header: 10;
  --theme-z-overlay: 100;
  --theme-z-modal: 1000;
  --theme-base-header-index: var(--theme-z-header); // legacy alias — kept for BC

  // ---- Fluid typography ----
  // clamp(mobile-min, ramp, desktop-max): max = the design's value, reached at
  // the lg breakpoint (992px); below that sizes scale down smoothly.
  --theme-base-fs: clamp(1rem, 0.986rem + 0.063vw, 1.0625rem); // 16px -> 17px (body)

  // Onest carries the interface and every Russian/Ukrainian word; Literata is
  // for German ONLY — the studied language is set apart on purpose, which is
  // the design's central device. Headings are Onest too: the serif marks the
  // subject matter, not the hierarchy.
  --theme-text-ff: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", sans-serif;
  --theme-heading-ff: var(--theme-text-ff);
  --theme-de-ff: "Literata", Georgia, "Times New Roman", serif;

  // Heading scale. h1 is the PAGE title (38px); the hero's 62px is its own role
  // rather than an h1 size, because a hero appears once and every other page
  // title would otherwise inherit a display size it was never designed for.
  --theme-hero-fs: clamp(2.125rem, 1.129rem + 4.43vw, 3.875rem); // 34px -> 62px
  --theme-h1-fs: clamp(1.625rem, 1.198rem + 1.899vw, 2.375rem); // 26px -> 38px
  --theme-h2-fs: clamp(1.5rem, 1.216rem + 1.266vw, 2rem); // 24px -> 32px
  --theme-h3-fs: clamp(1.25rem, 1.108rem + 0.633vw, 1.5rem); // 20px -> 24px
  --theme-h4-fs: clamp(1.125rem, 1.054rem + 0.316vw, 1.25rem); // 18px -> 20px
  --theme-h5-fs: clamp(1rem, 0.986rem + 0.063vw, 1.0625rem); // 16px -> 17px

  // The German word on a game card — the largest thing on the screen after the
  // hero, and always Literata.
  --theme-word-fs: clamp(1.75rem, 1.324rem + 1.899vw, 2.75rem); // 28px -> 44px

  // Small interface text (labels, meta, card footers) and the uppercase eyebrow.
  --theme-ui-fs: #{toRem(14.5px)};
  --theme-eyebrow-fs: #{toRem(12.5px)};
  --theme-eyebrow-ls: 1.4px;

  // Headings are heavy and optically tightened; the larger the size, the more
  // negative the tracking, straight from the design's type roles.
  --theme-heading-fw: 800;
  --theme-hero-ls: -1.6px;
  --theme-h1-ls: -0.8px;
  --theme-h2-ls: -0.7px;

  // ---- Spacing scale (mobile-first paddings/gaps; use instead of magic rem/px) ----
  --theme-space-1: #{toRem(4px)};
  --theme-space-2: #{toRem(8px)};
  --theme-space-3: #{toRem(12px)};
  --theme-space-4: #{toRem(16px)};
  --theme-space-5: #{toRem(24px)};
  --theme-space-6: #{toRem(32px)};
  --theme-space-7: #{toRem(48px)};
  --theme-space-8: #{toRem(64px)};

  --theme-heading-lh: 1.2;
  --theme-text-lh: 1.55;

  // ---- Palette ----
  // primary   = the blue everything actionable is built from
  // secondary = the green that means «знаю / пройдено»
  // alternative = the terracotta that means «пора повторить»
  // These are SEMANTIC in this product, not decorative: a learner reads the
  // colour before the label, so they must not be swapped casually.
  --theme-primary-color: #125a8f;
  --theme-primary-hover: #0d4670;
  --theme-primary-link: #0f5182;
  --theme-primary-soft: #e0ecf7;
  --theme-primary-on-dark: #3f8ec4;

  --theme-secondary-color: #12866b;
  --theme-secondary-strong: #0f6c56;
  --theme-secondary-soft: #e0f1ec;

  --theme-alternative-color: #a9552d;
  --theme-alternative-soft: #faf1ea;
  --theme-alternative-border: #dbb29c;
  // The design draws no destructive button, so it has no hover for one. Derived
  // by the same darkening the other two carry (#125a8f→#0d4670, #12866b→#0d6c56).
  --theme-alternative-hover: #844223;

  --theme-amber-color: #ffd980;
  --theme-amber-soft: #fdefd6;
  --theme-amber-text: #8a5a12;

  --theme-base-dark: #0f2436;
  --theme-base-dark-2: #1b2b3d;
  --theme-base-dark-3: #22364b;
  --theme-base-dark-4: #2a3d52;
  --theme-base-soft: #f6f9fc;
  --theme-base-light: #fff;
  --theme-bg-page: #eef2f6;
  --theme-base-neutral: #e9eef4;
  --theme-dark-grey-color: #2a3b4a;
  --theme-grey-color: #5f6f7c;
  --theme-error-color: #a9552d;
  --theme-success-color: #12866b;

  --theme-heading-color: #111e2b;
  --theme-text-color-default: #4a5a6a;
  --theme-text-color-alternative: #5f6f7c;
  --theme-text-on-dark: #9fb2c4;
  --theme-text-on-dark-dim: #93a8bb;
  // `--text-ghost` of the design tokens: em dashes and placeholders — the ink of
  // a thing that is deliberately absent. Lighter than the interactive border it
  // used to borrow, so an empty slot reads as empty and not as a hairline.
  --theme-text-ghost: #b6c0c9;

  --theme-border-color: #dfe6ee;
  --theme-border-interactive: #d3dce6;
  --theme-border-nested: #e4eaf1;

  // ---- Semantic surfaces (section backgrounds) with paired text colors ----
  // The section-bg--* classes in sections/_all-section.scss consume these, so a
  // rebrand edits ONLY this file. Each surface has an --on-* companion for text.
  --theme-surface-base: var(--theme-base-light);
  --on-surface-base: var(--theme-text-color-default);
  --theme-surface-muted: var(--theme-base-soft);
  --on-surface-muted: var(--theme-text-color-default);
  --theme-surface-brand: var(--theme-base-dark);
  --on-surface-brand: var(--theme-text-on-dark);
  --theme-surface-accent: var(--theme-primary-color);
  --on-surface-accent: var(--theme-base-light);

  // ---- Keyboard focus ring (used by :focus-visible styles) ----
  --theme-focus-ring: 2px solid var(--theme-primary-color);
  --theme-focus-ring-offset: 2px;

  // The design has no gradient backgrounds — the dark sections are flat. Kept
  // as solid colours so anything still referencing these tokens degrades to a
  // real surface rather than to a stray gradient.
  --theme-bg-color-alternative: var(--theme-base-dark);
  --theme-bg-color-alternative-hover: var(--theme-base-dark-2);

  // ---- Radius ----
  --theme-radius-xs: #{toRem(4px)};
  --theme-radius-sm: #{toRem(8px)};
  --theme-radius-md: #{toRem(11px)};
  --theme-radius-lg: #{toRem(16px)};
  --theme-radius-xl: #{toRem(20px)};
  --theme-radius-xxl: #{toRem(22px)};
  --theme-radius-pill: 999px;
  --theme-radius: var(--theme-radius-lg); // default for cards and panels

  --theme-button-fs: #{toRem(16.5px)};
  --theme-button-lh: 1.3;
  --theme-button-fw: 800;
  --theme-button-radius: #{toRem(11px)};

  // ---- Shadows ----
  --theme-xs-shadow: 0 1px 2px rgba(20, 40, 60, 0.1); // header
  --theme-sm-shadow: 0 8px 24px rgba(20, 40, 60, 0.09); // card
  --theme-md-shadow: 0 12px 34px rgba(20, 40, 60, 0.14); // raised
  --theme-panel-shadow: 0 10px 32px rgba(20, 40, 60, 0.07);
  --theme-card-shadow: 0 8px 26px rgba(20, 40, 60, 0.06); // verb card, справочник
  --theme-hero-shadow: 0 18px 44px rgba(20, 40, 60, 0.13);
  --theme-modal-shadow: 0 24px 60px rgba(10, 25, 40, 0.28);
  --theme-button-shadow: 0 6px 16px rgba(18, 90, 143, 0.2);
  --theme-button-shadow-hover: 0 10px 24px rgba(18, 90, 143, 0.26);

  --theme-transition: var(--theme-transition-duration) var(--theme-easing-function);
  --theme-transition-duration: 0.2s;
  --theme-easing-function: ease;

  // Motion the games depend on — a flip that is not felt reads as a redraw.
  --theme-flip-transition: transform 0.55s cubic-bezier(0.3, 0.8, 0.25, 1);
  --theme-wheel-transition: transform 3s cubic-bezier(0.2, 0.75, 0.15, 1);
  --theme-progress-transition: width 0.3s;

  --theme-border: 1px solid;
}
