/* Design tokens shared by all themes: spacing, type scale, layout sizes, motion, layers.
   Colours, fonts and shapes are per theme (css/themes/<name>.css); a theme may override anything here too.
   Components use only tokens, never literal colours, so a theme is one file of custom properties. */

:root {
  /* spacing: 4 px grid */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;

  /* type scale (px); headings are clamped between phone and desktop */
  --text-xs: 11px;      /* data attribution, photo credit */
  --text-sm: 13px;      /* labels, captions */
  --text-md: 15px;      /* body in cards, list rows */
  --text-lg: 17px;      /* lead text, buttons */
  --text-xl: 22px;      /* stats, small headings */
  --text-heading: clamp(28px, 0.6vw + 23px, 32px);   /* screen and dialog titles (Moje hry, Přátelé, Odznaky…) */
  --text-question: clamp(23px, 1.6vw + 14px, 34px);
  --text-title: clamp(34px, 3.4vw + 18px, 52px);
  --text-result: clamp(26px, 1.4vw + 18px, 36px);
  --leading-tight: 1.08;
  --leading-body: 1.5;
  --tracking-tight: -0.02em;
  --tracking-label: 0.09em;

  /* layout */
  --gutter: 16px;               /* distance of floating cards from the viewport edge */
  --card-w: 480px;              /* screen cards: intro, summary, profile */
  --card-w-narrow: 440px;       /* login */
  --card-w-wide: 520px;         /* profile, friends, a friend, invite */
  --card-w-xl: 720px;           /* Odznaky (two columns of badges) */
  --hud-w: 680px;               /* question card at the top */
  --dock-w: 780px;              /* result card at the bottom */
  --dock-photo-w: 300px;        /* photo column of the result card */
  --dock-gap: 44px;             /* result card and toast above the bottom edge, leaves two lines for the attribution */
  --control-h: 48px;            /* inputs, secondary buttons */
  --control-h-lg: 56px;         /* main buttons */
  --tool-size: 46px;            /* zoom buttons */

  /* motion */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-pop: cubic-bezier(.2, .9, .3, 1.35);
  --dur-fast: .15s;
  --dur: .3s;
  --dur-enter: .45s;

  /* layers */
  --z-stage: 0;
  --z-overlay: 10;              /* HUD, tools, attribution */
  --z-card: 20;                 /* screens and the result card */
  --z-menu: 30;
  --z-toast: 40;
}

@media (max-width: 640px), (orientation: landscape) and (max-height: 500px) {
  :root {
    --gutter: 10px;
    --text-md: 14.5px;
    --text-lg: 16px;
    --control-h-lg: 54px;
  }
}
/* phone in landscape: little height, the question must not take half of it */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --text-question: 20px; --text-result: 24px; }
}
