/*
 * Design tokens - every visual value of the site lives here.
 * Source of truth: Figma screens MENU_640x800-1, INSPIRACE_640x800-2, INSPIRACE_640x800-3
 * and the INSPIRACE_<CATEGORY>_<n> frames. Sizes are taken from the 640x800 artboard.
 *
 * --u is "1 artboard pixel": 1px on a 640px wide viewport (and wider), proportionally
 * smaller on narrow screens. Use calc(<artboard px> * var(--u)).
 */

/*
 * Font: Inter (SIL OFL), self-hosted. One variable TTF in ../assets/fonts/ (wght 100-900), no external request.
 * License: docs/OFL.txt (not deployed). font-display: swap. No local() so every visitor gets the same shapes.
 */
@font-face {
  font-family: "Inter";
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  src: url("../assets/fonts/inter.ttf") format("truetype-variations");
}

:root {
  --u: min(0.15625vw, 1px);

  /* Colours (sampled from the Figma exports) */
  --c-bg: #F5F0F6;
  --c-bg-mid: #EDECEA;
  --c-bg-mint: #E4EFE9;
  --c-blob-teal: #3F968A;
  --c-blob-teal-soft: #7CC4AE;
  --c-blob-green: #A9D9B2;
  --c-blob-yellow: #C9D6A0;
  --c-brand: #0F6D67;          /* headline, CTA text, links */
  --c-panel-text: #06564D;     /* title + text in the inspiration panel */
  --c-divider: #13736D;
  --c-white: #FFFFFF;
  --c-glow: #489F94;
  --c-glow-blue: rgba(80, 80, 170, 0.35);
  --c-panel-from: rgba(234, 236, 231, 0.97);
  --c-panel-to: rgba(238, 245, 244, 0.97);
  --c-tile-strip-from: #87BC97;
  --c-tile-strip-mid: #BFE0C8;
  --c-tile-strip-to: #8CBE9B;
  --c-frame-empty-from: #A1D4C3;
  --c-frame-empty-mid: #DBEDE1;
  --c-frame-empty-to: #F5F0F6;

  /* Typography (@font-face rules at the top of this file). No external CDNs. */
  --font-sans: "Inter", Arial, sans-serif;
  --font-tile: var(--font-sans);
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;
  --fs-heading: max(calc(41 * var(--u)), 22px);
  --lh-heading: 1.146;           /* 47 / 41 */
  --ls-normal: 0;
  /* CTA Bold 24: measured on the Figma screens (text "INSPIROVAT SE DÁL" is 234px wide = Bold 24, Bold 28 would be 275px
     and not fit the 281px button). The brief said 28; change here if 28 is really wanted. */
  --fs-cta: max(calc(24 * var(--u)), 17px);
  --fs-link: max(calc(24 * var(--u)), 16px);
  --fs-panel-title: max(calc(32 * var(--u)), 21px);   /* Medium 32/36 */
  --lh-panel-title: 1.125;                            /* 36 / 32 */
  --fs-panel-text: max(calc(17 * var(--u)), 15px);
  --lh-panel-text: 1.28;

  /* Layout */
  --page-max: 640px;
  --page-pad-x: 16px;
  --stage-pad-top: calc(62 * var(--u));
  --stage-pad-top-menu: calc(118 * var(--u));
  --stage-pad-bottom: calc(48 * var(--u));
  --heading-max-w: 8.05em;       /* ~330 artboard px at 41px: breaks lines like Figma ("VYBER SI SVOU / INSPIRACI") */
  --gap-heading-frame: calc(42 * var(--u));
  --gap-frame-cta: calc(65 * var(--u));
  --gap-cta-link: calc(120 * var(--u));
  --gap-heading-menu: calc(40 * var(--u));

  /* Photo frame */
  --frame-w: calc(182 * var(--u));
  --frame-ratio: 342 / 484;       /* ratio of the cropped photos */
  --frame-radius: calc(var(--frame-w) * 0.055);
  --frame-border: var(--frame-border-w);
  --frame-glow: 0 0 calc(40 * var(--u)) calc(14 * var(--u)) rgba(72, 159, 148, 0.55);
  --frame-shadow: 0 calc(6 * var(--u)) calc(10 * var(--u)) var(--c-glow-blue);

  /* CTA button */
  --btn-w: max(calc(281 * var(--u)), 230px);
  --btn-h: max(calc(49 * var(--u)), 48px);
  --btn-radius: 999px;
  --btn-shadow: 0 calc(7 * var(--u)) calc(13 * var(--u)) rgba(15, 109, 103, 0.42);

  /* Menu tiles */
  --tile-w: calc(113 * var(--u));
  --tile-gap: calc(7 * var(--u));
  --tile-row-gap: calc(10 * var(--u));
  --tile-radius: calc(var(--tile-w) * 0.163);
  --tile-photo-ratio: 337 / 314;
  --tile-strip-h: calc(var(--tile-w) * 0.377);
  --tile-label-fs: calc(var(--tile-w) * 0.165);       /* tile label (Figma DIN Condensed 20 on a 113 tile ~0.177; Inter is wider, so 0.165) */
  --tile-label-lh: calc(var(--tile-w) * 0.416);       /* 47 / 113 */
  --tile-label-ls: -0.03em;                           /* -3% (max allowed); Inter is wider and not condensed */
  --fw-tile: 500;                                     /* Inter Medium: closest to the bold-ish condensed labels in Figma */
  --tile-glow: 0 0 calc(14 * var(--u)) calc(4 * var(--u)) rgba(72, 159, 148, 0.6);
  --tile-shadow: 0 calc(5 * var(--u)) calc(9 * var(--u)) var(--c-glow-blue);

  /* Inspiration panel */
  --panel-w: 78.6%;               /* 503 / 640 */
  --panel-radius: calc(40 * var(--u));
  --panel-pad-l: calc(154 * var(--u));
  --panel-pad-r: calc(30 * var(--u));
  --panel-pad-t: calc(40 * var(--u));
  --panel-pad-b: calc(36 * var(--u));
  --panel-shadow: calc(5 * var(--u)) calc(3 * var(--u)) calc(16 * var(--u)) rgba(60, 80, 80, 0.2);
  --divider-w: calc(115 * var(--u));
  --divider-h: 2px;
  --gap-cta-panel: calc(46 * var(--u));

  --space-xs: 4px;
  --space-sm: 12px;
  --space-md: 16px;
  --touch-min: 44px;
  --footer-pad-y: calc(10 * var(--u));
  --fs-footer: max(calc(16 * var(--u)), 14px);

  /* Mobile-only gate (black screen on desktop) */
  --gate-bg: #000000;
  --gate-fg: #FFFFFF;
  --gate-fs: 22px;
  --gate-lh: 1.4;
  --gate-pad: 24px;
  --gate-z: 2147483647;
  --focus-w: 3px;
  --focus-offset: 3px;
  --lift: -3px;
  --press-scale: 0.97;
  --panel-shift: 24px;
  --frame-border-w: 1.5px;

  /* Motion */
  --t-fast: 160ms;
  --t-panel: 380ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Auto-scroll after the spin (read by js/inspirace.js scrollResultIntoView()): space kept above the
     photo frame so it is not pinned flush to the very top of the (collapsed-toolbar) viewport. */
  --result-scroll-offset: 24px;

  /* Slot-machine reel (read by js/inspirace.js). The strip scrolls upwards over --reel-slides photos,
     decelerates with --reel-ease, overshoots by --reel-bounce and settles back. Total time is
     --reel-duration + --reel-settle-duration. The blur fades from --reel-blur-max to 0 while it slows down. */
  --reel-slides: 11;                                      /* photos scrolled past, incl. the result */
  --reel-duration: 2000ms;
  --reel-ease: cubic-bezier(0.16, 0.7, 0.2, 1);           /* fast start, long smooth ease-out */
  --reel-blur-max: 3px;
  --reel-blur-ease: cubic-bezier(0.1, 0.6, 0.3, 1);       /* blur fades out earlier than the motion */
  --reel-bounce: 7px;
  --reel-settle-duration: 320ms;
  --reel-settle-ease: cubic-bezier(0.3, 0.1, 0.3, 1);
}

/* Narrow screens: keep Figma proportions, but make the hero elements big enough to enjoy and tap. */
@media (max-width: 599px) {
  :root {
    --frame-w: min(58vw, 270px);
    --tile-w: 28vw;
    --tile-gap: 2vw;
    --tile-row-gap: 2.6vw;
    --panel-w: 90%;
    --panel-pad-l: 8vw;
    --panel-pad-r: 6vw;
    --gap-heading-frame: 20px;    /* was 26px: slightly tighter gap between the headline and the photo frame */
    --gap-frame-cta: 34px;
    --gap-cta-panel: 28px;
    --gap-cta-link: 36px;
    --stage-pad-top: 40px;
    --stage-pad-top-menu: 64px;
    --gap-heading-menu: 26px;
  }
}
