/* ==========================================================================
   CERAK Vranje — design tokens
   "Precision in glass, aluminium and steel"
   Colours sampled from the official logo. Do not alter brand values.
   ========================================================================== */

:root{
  /* ---- Brand red (logo swoosh) ---- */
  --red-500:#E4202A;
  --red-600:#C81B24;
  --red-800:#A2161B;
  --red-300:#FD8A92;

  /* ---- Chrome / steel (logo lettering gradient) ---- */
  --steel-100:#ECEDEC;
  --steel-200:#ACAEAC;
  --steel-400:#6B6D69;
  --steel-700:#31322F;
  --steel-900:#1E1E1C;

  /* ---- Neutrals ---- */
  --ink:#0B0B0C;
  --paper:#FFFFFF;
  --mist:#F4F5F5;
  --line:rgba(11,11,12,.10);
  --line-strong:rgba(11,11,12,.20);
  --line-ink:rgba(255,255,255,.14);

  --chrome-gradient:linear-gradient(180deg,#ECEDEC 0%,#ACAEAC 28%,#31322F 52%,#1E1E1C 100%);
  --red-gradient:linear-gradient(180deg,#FD8A92 0%,#E4202A 30%,#E4202A 80%,#A2161B 100%);

  /* ---- Semantic ---- */
  --bg:var(--paper);
  --bg-alt:var(--mist);
  --fg:var(--ink);
  --fg-muted:var(--steel-400);
  --accent:var(--red-500);

  /* ---- Type families (self-hosted, latin-ext for čćšžđ) ---- */
  --font-display:"Archivo","Arial Narrow",system-ui,-apple-system,sans-serif;
  --font-body:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --font-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Consolas,monospace;

  /* ---- Fluid type scale (re-tuned in v2 — G4) ----
     The v1 display sizes were roughly a step too large: the home intro
     statement wrapped to six lines at 1440px. Headline steps now top out
     lower and the statement step is separated out so it can be tuned
     independently of section headings. */
  --fs-mono:clamp(.6875rem,.65rem + .18vw,.78125rem);
  --fs-xs:clamp(.75rem,.72rem + .15vw,.8125rem);
  --fs-sm:clamp(.8125rem,.78rem + .2vw,.9375rem);
  --fs-base:clamp(.9375rem,.9rem + .25vw,1.0625rem);
  --fs-lg:clamp(1.0625rem,1rem + .4vw,1.25rem);
  --fs-xl:clamp(1.25rem,1.1rem + .7vw,1.625rem);
  --fs-2xl:clamp(1.4rem,1.2rem + 1vw,2.1rem);
  --fs-3xl:clamp(1.9rem,1.45rem + 1.9vw,3.4rem);    /* section H2 */
  --fs-4xl:clamp(2.1rem,1.6rem + 2.6vw,4rem);       /* inner-page H1 */
  --fs-5xl:clamp(2.4rem,1.7rem + 3.6vw,5.5rem);     /* home hero H1 */
  --fs-statement:clamp(1.5rem,1.15rem + 1.6vw,2.5rem);

  --lh-tight:1.04;
  --lh-snug:1.18;
  --lh-normal:1.62;
  --ls-tight:-.02em;
  --ls-tighter:-.035em;
  --ls-mono:.12em;

  /* ---- Spacing scale ---- */
  --space-1:.25rem;  --space-2:.5rem;   --space-3:.75rem;  --space-4:1rem;
  --space-5:1.5rem;  --space-6:2rem;    --space-7:3rem;    --space-8:4rem;
  --space-9:6rem;    --space-10:8rem;
  --section-y:clamp(4rem,2.2rem + 6.4vw,7rem);
  /* 20px at 360 -> 64px on wide desktop */
  --gutter:clamp(1.25rem,.78rem + 2.3vw,4rem);
  /* One container system (G5). Content width is min(1320px, 100% - 2*gutter);
     max-width carries the gutters so every element that uses --maxw with
     padding-inline:var(--gutter) — container, header inner, mega inner —
     lines up on exactly the same rails. */
  --content:1320px;
  --maxw:calc(var(--content) + 2 * var(--gutter));
  --maxw-text:68ch;

  /* ---- Radii: small and precise ---- */
  --r-xs:4px; --r-sm:6px; --r-md:10px; --r-lg:14px; --r-pill:999px;

  /* ---- Elevation (restrained) ---- */
  --sh-1:0 1px 2px rgba(11,11,12,.06),0 1px 1px rgba(11,11,12,.04);
  --sh-2:0 4px 16px rgba(11,11,12,.08),0 1px 3px rgba(11,11,12,.05);
  --sh-3:0 12px 40px rgba(11,11,12,.14),0 2px 8px rgba(11,11,12,.06);
  --sh-fab:0 6px 24px rgba(11,11,12,.22),0 2px 6px rgba(11,11,12,.14);

  /* ---- Motion: mechanical, never bouncy ---- */
  --e-out:cubic-bezier(.22,.61,.36,1);
  --e-inout:cubic-bezier(.65,.05,.36,1);
  --e-mech:cubic-bezier(.16,.84,.44,1);
  /* v3 C2 — ONE curve for every layer of a slide transition (image, copy),
     so nothing can drift out of sync and expose an undarkened frame. */
  --e-hero:cubic-bezier(.65,0,.35,1);
  --t-fast:160ms; --t-med:320ms; --t-slow:620ms; --t-slat:900ms;

  /* ---- Chrome metrics ---- */
  --header-h:72px;
  --header-h-condensed:58px;
  --tabbar-h:0px;                       /* becomes real height on mobile */
  --safe-top:env(safe-area-inset-top,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);

  /* ---- FABs: both buttons share these (brief §8.4) ---- */
  --fab-size:56px;
  --fab-gap:16px;
  --fab-bottom:calc(var(--fab-gap) + var(--safe-bottom));

  --z-base:1; --z-sticky:100; --z-header:200; --z-tabbar:250;
  --z-fab:300; --z-sheet:400; --z-lightbox:500; --z-preloader:900;

  /* viewport unit fallback, set by js/core.js for old mobile browsers */
  --vh:1vh;
}

/* Mobile: the tab bar exists, so FABs must clear it. Both buttons read the
   same variable, which is what keeps their centres identical. */
@media (max-width:899px){
  :root{
    --tabbar-h:64px;
    --fab-bottom:calc(var(--tabbar-h) + var(--fab-gap) + var(--safe-bottom));
    --header-h:56px;
    --header-h-condensed:56px;
  }
}

/* Dark sections opt in explicitly rather than following the OS, because the
   logo is dark-on-transparent and must always sit on a light plate. */
.section--ink{
  --bg:var(--ink);
  --fg:var(--paper);
  --fg-muted:var(--steel-200);
  --line:var(--line-ink);
  --line-strong:rgba(255,255,255,.26);
  background:var(--ink);
  color:var(--paper);
}
.section--mist{ --bg:var(--mist); background:var(--mist); }
