/* ============================================================================
   ragazzi-tokens.css — CARRIED VERBATIM from the static site's css/tokens.css
   (ragazzi-site/css/tokens.css, stitched part1 + part2 + part3).

   Keep this file PRISTINE so it stays diffable against the static reference.
   Nothing Shopify-specific belongs here — Dawn reconciliation lives in the
   ADAPTATION block at the end of ragazzi-base.css and of each section's CSS.

   The static's own header comment is kept below, unedited.
============================================================================ */

/* ============================================================================
   tokens.css — ragazzs-home, STITCHED (part1 + part2 + part3)
   Generated by the stitcher. Do NOT edit here — edit the owning part and re-stitch.
   The part<N>/ folders remain the source of truth and the rollback.

   The three parts were built with NO shared foundation, so their token files
   diverge in NAMING SCHEME and in STRUCTURE:
     part1, part2 — DESKTOP-FIRST  (:root = desktop, @media max-767 = mobile,
                    @media 768-1023 = pseudo-tablet)
     part3        — MOBILE-FIRST   (:root = mobile, @media min-768 = tablet,
                    @media min-1024 = desktop)
   Both are kept AS WRITTEN. Merging them is only safe because every same-name
   collision was removed first — with no shared names left, source order can no
   longer decide a winner.
============================================================================ */

:root {
  /* ---- shared, identical in all parts that define them ---- */
  --vw-base: 1920px;
  --max-vw: min(100vw, calc(1920px + (1920px - var(--vw-base)) * 0.015));

  /* Fallback SUPERSET across the three parts. `--font-display` is the binding
     page-decisions substitution: Advercase has no web source, Playfair Display
     stands in for it. Every part already agreed on this one. */
  --font-body:    "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* INTER IS NO LONGER REQUESTED, and `--font-ui` is now the body face.

     The design names Inter for a handful of small labels — the breathe stats and
     CTA, the reviews flavour label, the widget's avatar initials — and it was
     loaded from Google Fonts to serve them. Measured on the home page that cost
     48KB from a THIRD origin (two extra handshakes, googleapis then gstatic) for
     type that first appears about 5,100px down: nothing above the fold uses it.

     AND IT WAS NOT EVEN RENDERING. Measured on the live page: the CTA label and
     a stat caption came out at 176.59px and 278.67px whether the stack began
     with Inter or with Onest — identical to the hundredth, which only happens
     when the first family never wins. So the face was being paid for and not
     shown, and dropping it changes no pixel.

     Written as an alias rather than a repeated stack so the two can never drift.
     The name stays because seven rules read it and the design's distinction is
     worth keeping legible — if a licensed Inter ever lands, this one line is the
     only place that has to change. */
  --font-ui:      var(--font-body);

  --color-black: #000000;
  --color-white: #ffffff;
  --color-text:  var(--color-black);
  --color-bg:    var(--color-white);

  --lh-120: 1.2;
  /* SITE BASE contract — ragazzi-base.css sets the body leading from this name. */
  --lh-body: var(--lh-120);

  /* SITE BASE contract — the leading the DOCUMENT falls back to. Separate from
     `--lh-body` (body-COPY leading) on purpose. */
  --lh-doc: var(--lh-120);

  /* SITE BASE contract — the two-tone focus ring. Black outline with a white
     halo: the only pair that stays visible both on the black hero and on the
     white product cards. */
  --color-focus-ring: var(--color-black);
  --color-focus-halo: var(--color-white);

  --radius-pill: 9999px;
}

/* ============================================================================
   part1 — hero, bestsellers   (DESKTOP-FIRST structure, as written)

   --vw-base = 1920px (the Figma desktop frame) == --max-vw cap, so every
   desktop-max EQUALS its desktop-base. That is arithmetically correct on this
   project and is NOT fluid-formulas.md "Common mistake #1" (which is about
   vw-base < 1920). DO NOT "fix" it.

   D-min = round(D-base * 1024 / 1920)      M-min = round(M-base * 320 / 375)
   D-max = D-base                            M-max = round(M-base * 767 / 375)
============================================================================ */

:root {
  /* ---------- Colour (brief §4.4) ---------- */
  --color-text-muted: #656565;

  /* ---------- DESKTOP (1024+) — clamp(D-min, D-base * (max-vw / vw-base), D-max) */
  --text-hero-sub:       clamp(11px, calc(20px * (var(--max-vw) / var(--vw-base))), 20px);
  --text-card-title:     clamp(13px, calc(25px * (var(--max-vw) / var(--vw-base))), 25px);

  /* Line-heights that differ per layer (the rest are 110% / 120% unitless) */
  --lh-tight: 1.1;
  --lh-hero-sub:  1.1; /* desktop 110% */
}

/* ============================================================
   MOBILE (<=767) — clamp(M-min, M-base + (max-vw - 375px) * 0.015, M-max)
============================================================ */
@media (max-width: 767px) {
  :root {
    --text-hero-sub:       clamp(14px, calc(16px + (var(--max-vw) - 375px) * 0.015), 33px);
    --text-card-title:     clamp(15px, calc(18px + (var(--max-vw) - 375px) * 0.015), 37px);

    /* Per-layer line-heights: the mobile subtitle is an absolute 24px on a 16px
       face, and the mobile card description is 120%. */
    --lh-hero-sub:  1.5;
  }
}

/* ============================================================
   PSEUDO-TABLET (768–1023) — has-tablet-layer: false, so this band
   interpolates mobile→desktop: clamp(M-base, M-base + (max-vw - 768px) * 0.025, D-base).
   MANDATORY: without it the desktop formula would fire at 768px and return
   roughly half-size values.
============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --text-hero-sub:       clamp(16px, calc(16px + (var(--max-vw) - 768px) * 0.025), 20px);
    --text-card-title:     clamp(18px, calc(18px + (var(--max-vw) - 768px) * 0.025), 25px);

    --lh-hero-sub:  1.2;
  }
}

/* ============================================================================
   part3 — reviews, shop-banner, athletes, expert, blog, footer
   (MOBILE-FIRST structure, as written — this is the block that defines
    --container-pad, the ONE gutter of the page; part1/part2's `--sp-gutter`
    is an alias onto it, declared in each section's own token block.)
============================================================================ */

:root {
  /* --- Colors (brief §4.5) ----------------------------------------------- */
  --color-ink: #1a1a1a;   /* reviews heading / rating / author / quote */
  --color-muted: #5a4f47; /* warm brown secondary text */

  /* --- Typography (brief §4.3) — MOBILE BASE ----------------------------- */
  --text-h2: clamp(27px, calc(32px + (var(--max-vw) - 375px) * 0.015), 65px);
  --text-h3: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 41px);
  --text-body-lg: clamp(14px, calc(16px + (var(--max-vw) - 375px) * 0.015), 33px);
  --text-body: clamp(12px, calc(14px + (var(--max-vw) - 375px) * 0.015), 29px);
  --text-small: clamp(12px, calc(14px + (var(--max-vw) - 375px) * 0.015), 29px);
  --text-btn: clamp(12px, calc(14px + (var(--max-vw) - 375px) * 0.015), 29px);

  /* Per-layer WEIGHTS that actually change across layers. Measured, not drift. */
  --weight-btn: 700; /* -> 600 desktop */

  /* --- Spacing (brief §4.4) — MOBILE BASE -------------------------------- */
  --container-pad: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 41px);
  --section-py: clamp(34px, calc(40px + (var(--max-vw) - 375px) * 0.015), 82px);
  --gap-stack: clamp(9px, calc(10px + (var(--max-vw) - 375px) * 0.015), 20px);
}

@media (min-width: 768px) {
  :root {
    --text-h2: clamp(32px, calc(32px + (var(--max-vw) - 768px) * 0.025), 65px);
    --text-h3: clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 25px);
    --text-body-lg: clamp(16px, calc(16px + (var(--max-vw) - 768px) * 0.025), 20px);
    --text-body: clamp(14px, calc(14px + (var(--max-vw) - 768px) * 0.025), 18px);
    --text-small: clamp(14px, calc(14px + (var(--max-vw) - 768px) * 0.025), 16px);
    --text-btn: clamp(14px, calc(14px + (var(--max-vw) - 768px) * 0.025), 18px);

    --container-pad: clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 100px);
    --section-py: clamp(40px, calc(40px + (var(--max-vw) - 768px) * 0.025), 100px);
    --gap-stack: clamp(10px, calc(10px + (var(--max-vw) - 768px) * 0.025), 25px);
  }
}

@media (min-width: 1024px) {
  :root {
    --text-h2: clamp(35px, calc(65px * (var(--max-vw) / var(--vw-base))), 65px);
    --text-h3: clamp(13px, calc(25px * (var(--max-vw) / var(--vw-base))), 25px);
    --text-body-lg: clamp(11px, calc(20px * (var(--max-vw) / var(--vw-base))), 20px);
    --text-body: clamp(10px, calc(18px * (var(--max-vw) / var(--vw-base))), 18px);
    --text-small: clamp(9px, calc(16px * (var(--max-vw) / var(--vw-base))), 16px);
    --text-btn: clamp(10px, calc(18px * (var(--max-vw) / var(--vw-base))), 18px);

    --weight-btn: 600;

    --container-pad: clamp(53px, calc(100px * (var(--max-vw) / var(--vw-base))), 100px);
    --section-py: clamp(53px, calc(100px * (var(--max-vw) / var(--vw-base))), 100px);
    --gap-stack: clamp(13px, calc(25px * (var(--max-vw) / var(--vw-base))), 25px);
  }
}

/* ============================================================================
   --sp-nav-h LIVES HERE, and it has to.

   It is the header bar's height, and TWO things read it: the header itself, and
   the overlap that pulls the first section up under it
   (`body:has(.ragazzi-header--overlay) .hero--home` in ragazzi-header.css).

   It used to be declared on `.ragazzi-header` and, separately, on `.hero--home`.
   Custom properties inherit DOWNWARD only and the hero is the header's sibling,
   not its child - so the overlap rule was really reading the copy in
   `ragazzi-hero.css`, a body-linked section stylesheet. Until that file arrived
   the calc was invalid, the pull-up simply did not happen, and an 86.5px white
   band sat under the announcement bar on every load. Measured by disabling that
   one sheet on the live page: hero top 35.6 -> 122.1.

   Declared on :root, in a head-loaded file, both readers see it from the first
   paint. The section copies are left in place - identical values, so they only
   restate it - rather than editing two files that have been swap-tested.
============================================================================ */
:root {
  --sp-nav-h: clamp(59.2px, calc(111px * (var(--max-vw) / var(--vw-base))), 111px);
}

/* ============================================================================
   DAWN'S FONT FAMILIES POINT AT OURS — no Assistant anywhere.

   `theme.liquid` writes `--font-body-family` and `--font-heading-family` from
   `settings.type_body_font` / `type_header_font`, which on this store are both
   Assistant. `html body` in ragazzi-base.css already forced the BODY to Onest,
   so body copy looked right — but every HEADING kept Assistant, and that was
   invisible until measured: Dawn declares the family DIRECTLY on `h1`-`h6`, and
   a direct declaration beats an inherited one however low its specificity, so
   `.ragazzi-section { font-family }` never reached a heading. Measured on the
   PDP: 20 headings in Assistant, including the product `<h1>` and every
   `stats__*` title.

   Fixed at the source rather than per section: both Dawn variables now resolve
   to the theme's own self-hosted Onest, so ported sections, stock Dawn sections
   and anything added later all agree. Section rules that want the display face
   still set `--font-display` themselves and are unaffected.

   These are declared AFTER theme.liquid's inline `{% style %}` block (this file
   is linked at line ~437, that block ends at ~314), so equal `:root` specificity
   is decided by source order and this wins. The `font_face` calls and preloads
   for the Shopify fonts are removed there — nothing renders them now.
============================================================================ */
:root {
  --font-body-family: var(--font-body);
  --font-heading-family: var(--font-body);
}

/* ============================================================================
   --z-drawer, for the same reason as --sp-nav-h above: a second reader outside
   the element that declares it.

   It is declared on `.ragazzi-header` in ragazzi-header.css, which serves
   everything inside the header. The open drawer also has to raise the
   ANNOUNCEMENT TICKER above the panel, and that lives in a different section
   group — outside `.ragazzi-header` entirely. Custom properties inherit
   downward only, so read from there the variable is undefined,
   `calc(var(--z-drawer) + 1)` is invalid, and the whole `z-index` declaration
   is dropped in silence. That was measured once: the element stayed at
   `z-index: auto` and the black panel went on covering it.

   The copy in ragazzi-header.css is left in place — identical value, so it only
   restates it.
============================================================================ */
:root {
  --z-drawer: 200;
}


@media (max-width: 767px) {
  :root {
    --sp-nav-h: clamp(51.2px, calc(60px + (var(--max-vw) - 375px) * 0.015), 122.72px);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --sp-nav-h: clamp(60px, calc(60px + (var(--max-vw) - 768px) * 0.025), 111px);
  }
}
