/* KVARNER VILLA: tokenid. AINUS koht toorväärtustele (px, rem, vw, vh, em, hex).
   Kõik muu CSS (base.css, site.css, demod) kasutab ainult neid. Reeglid: DESIGN-SYSTEM.md. Kontroll: _demo/lint-tokens.py. */

@font-face { font-family: "KV Funkis"; font-weight: 400; font-display: block; src: url("../font/Funkis-Regular.woff2") format("woff2"); }
@font-face { font-family: "KV Folare"; font-weight: 400; font-display: swap; src: url("../font/Folare-Regular.woff2") format("woff2"); }

:root {
  /* ---------- Värv: B „Lubjakivi ja savi” ---------- */
  --ground: #F6F3F0;
  --surface: #E9E3DF;
  --ink: #393432;
  --accent: #805146;
  --accent-hover: #c4ac82;
  --on-accent: #FAF6F2;
  --rule: color-mix(in srgb, var(--ink) 20%, transparent);
  --overlay-scrim: color-mix(in srgb, var(--ink) 58%, transparent);

  /* ---------- Tüpograafia: perekonnad ---------- */
  --f-display: "KV Funkis", sans-serif;   /* nimi, pealkirjad, hind, arvud */
  --f-body: "KV Folare", sans-serif;      /* tekst, sildid, nupud */
  --w-regular: 400;

  /* ---------- Tüpograafia: suurused (7 rolli, vt DESIGN-SYSTEM.md) ---------- */
  --t-hero: clamp(72px, min(12vw, 19svh), 210px);   /* „Krk, / Kvarner” */
  --t-hero-sm: 21vw;                                /* sama roll telefonis */
  --t-hero-stacked: calc(.88 * var(--t-hero));
  --t-h2: clamp(40px, 4.6vw, 76px);                 /* sektsioonipealkiri, faktide numbrid */
  --t-h3: clamp(24px, 2.3vw, 34px);                 /* hind, alapealkiri */
  --t-lead: clamp(17px, 1.25vw, 19px);               /* sektsiooni sissejuhatav lõik */
  --t-body: clamp(16px, 1.1vw, 17px);              /* proosa, sildid, nupud */
  --t-small: 14px;                                  /* menüü, vormi sildid */
  --t-fine: 12px;                                   /* disclaimer */

  --lh-display: 1;
  --lh-h2: 1.05;
  --lh-h3: 1.15;
  --lh-lead: 1.45;
  --lh-body: 1.55;
  --lh-ui: 1.2;
  --ls-hero: -.035em;
  --ls-display: -.01em;
  --ls-0: 0;

  /* ---------- Paigutus ---------- */
  --edge: clamp(20px, 4.5vw, 72px);
  --content-max: 1440px;
  --pad-x: max(var(--edge), calc((100% - var(--content-max)) / 2));
  --measure: 60ch;
  --hair: 1px;

  /* ---------- Vahed (semantilised; sektsioon valib rolli, mitte numbri) ---------- */
  --sec: clamp(72px, 6vw + 7vh, 176px);                /* sektsioonide vahel */
  --head-gap: clamp(38px, 2.5vw + 2.5vh, 80px);         /* pealkiri → plokk; ploki rühmad omavahel */
  --title-lead: clamp(16px, 1.4vw, 24px);               /* pealkiri → oma lõik; number → silt */
  --row-gap: clamp(18px, 2.2vw, 32px);                  /* ühe ploki sees ridade vahel */
  --gap: clamp(20px, 3vw, 48px);                        /* veergude vahel */
  --stack: .8em;                                        /* lõikude vahel */

  /* ---------- Päis ---------- */
  --bar-top: clamp(20px, 1.8vw, 26px);
  --logo-h: clamp(34px, 3.6vw, 42px);
  --icon-w: 28px;
  --icon-h: 12px;
  --icon-line: 2px;
  --icon-gap: 12px;
  --gallery-arrow-width: 48px;
  --gallery-arrow-height: 16px;
  --dur-ui: .3s;
  --dur-logo: .6s;
  --ease-ui: cubic-bezier(.22, 1, .36, 1);
  --ease-entrance: cubic-bezier(.30, .78, .43, 1);
  --entrance-title-duration: 1000ms;
  --entrance-title-duration-stacked: 900ms;

  /* Facts entrance: one measured pass, with the lower rule following behind. */
  --facts-scan-duration: 1040ms;
  --facts-tail-delay: 120ms;
  --facts-tail-duration: calc(var(--facts-scan-duration) - var(--facts-tail-delay));

  /* Running entrance: the two lines lead the copy into view. */
  --runs-line-duration: 710ms;
  --runs-copy-duration: 480ms;
  --runs-copy-delay: 145ms;
  --runs-line-duration-stacked: 560ms;
  --runs-copy-duration-stacked: 390ms;
  --runs-copy-delay-stacked: 70ms;

  /* Film poster: starting crop and duration of the camera move. */
  --film-track-start: translateX(4%) scale(1.10);
  --film-track-start-stacked: translateX(2.5%) scale(1.07);
  --film-track-duration: 1250ms;
  --film-track-duration-stacked: 950ms;

  /* Getting here: map annotation sequence in road, air, sea order. */
  --getting-pin-duration: 190ms;
  --getting-label-duration: 380ms;
  --getting-air-delay: 150ms;
  --getting-sea-delay: 300ms;

  --spec-entry-duration: 410ms;
  --spec-entry-step: 70ms;

  --closing-entrance-duration: 950ms;

  /* ---------- Hero geomeetria ---------- */
  --hero-top: clamp(10px, 2vh, 26px);
  --hero-photo-min: 240px;
  --hero-photo-max: 560px;
  --hero-chrome: 190px;            /* päis + hero vahed, millest foto kõrgus arvutatakse */
  --hero-overhang: .2em;           /* „Krk,” koma ulatub veerust välja */
  --hero-side-min: 260px;          /* kasutusel ka varasemates demodes */
  --hero-side-width: clamp(var(--hero-side-min), 23vw, 390px);

  /* ---------- Nupp ---------- */
  --btn-py: 15px;
  --btn-px: 28px;

  /* ---------- Muu ---------- */
  --scrollbar-w: 10px;
  --scrollbar-border: 2px;
  --z-menu: 60;
  --z-lightbox-flight: 2;
  --z-lightbox-controls: 3;
  /* ---------- Pluss / miinus (crispEdges): ikoon − latt = paarisarv seadmepiksleid igal skaalal ---------- */
  --pm: 12px;
  --pm-bar: 2px;
  --spec-heading-size: clamp(21px, 1.8vw, 26px);

  /* Murdepunkt: üks, 760px (media query ei luba var()-i; lint kontrollib) */
}

/* Telefonis kasvab hero nimi laiuse järgi (sama roll, teine valem) */
@media (max-width: 760px) {
  :root { --t-hero: var(--t-hero-sm); }
}

/* Pluss / miinus teravaks ekraaniskaalal: ikoon täisarv CSS-px, 125 % → 15 / 3, 150 % → 18 / 2 seadmepikslit */
@media (min-resolution: 1.2dppx) and (max-resolution: 1.3dppx) {
  :root { --pm-bar: 2.4px; }
}
@media (min-resolution: 1.45dppx) and (max-resolution: 1.55dppx) {
  :root { --pm-bar: calc(4px / 3); }
}
