/* Self-hosted fonts — replaces the Google Fonts CDN (removes third-party
   origin + the German Google-Fonts DSGVO liability). woff2 only; modern
   browsers all support it. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("../assets/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 500;
  font-display: swap; src: url("../assets/fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("../assets/fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 500;
  font-display: swap; src: url("../assets/fonts/space-grotesk-500.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("../assets/fonts/space-grotesk-600.woff2") format("woff2");
}

/* =============================================================
   PALARY — BASE
   Reset, fonts, typographic primitives, grid container, the
   FOUC guard + nav-scroll-state CSS ported from motion/1-HEAD.html.
   ============================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;   /* sticky nav (64px) + breathing room, so anchor
                                 jumps don't hide section tops under the bar */
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-weight: 500;                 /* Inter Medium — body/UI per §2.2 */
  font-size: var(--fs-text);
  line-height: var(--lh-text);
  color: var(--color-text-inverse-primary);
  background: var(--color-bg-light-pure);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body { overflow-x: hidden; }           /* fallback: old browsers */
@supports (overflow-x: clip) {
  html, body { overflow-x: clip; }          /* clip without creating a scroll container — preserves position:sticky */
}

img, svg, picture { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; padding: 0; }

/* ---------- Type primitives ----------
   Headlines: Space Grotesk 600. Body: Inter 500. Labels: Inter 600 upper. */
.h0, .h1, .h2, .h3, .h4 {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;               /* premium: avoids orphan words in headlines */
}
.h0 { font-size: var(--fs-h0); line-height: var(--lh-h0); letter-spacing: var(--ls-h0); }
.h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--ls-h1); }
.h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-h2); }
.h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); }
.h4 { font-size: var(--fs-h4); line-height: var(--lh-h4); letter-spacing: var(--ls-h4); }

.text-xl { font-size: var(--fs-xl); line-height: var(--lh-xl); letter-spacing: var(--ls-xl); }
.text    { font-size: var(--fs-text); line-height: var(--lh-text); }
.text-sm { font-size: var(--fs-sm); line-height: var(--lh-sm); }
.text-secondary { font-weight: 400; }   /* Inter Regular — captions */

/* Controlled headline break — forced at desktop, suppressed on mobile/tablet
   so headlines reflow naturally at smaller sizes. Used on h1/h2 elements with
   the two-color payoff treatment where a bad wrap breaks the color split. */
@media (max-width: 1023px) {
  br.headline-break { display: none; }
}

/* Eyebrow / label — Inter 600, uppercase, +0.072em (§2.2, §2.7)
   Soft Pill: inline-block pill with a section-adaptive transparent fill.
   Default bg = light sections; sections.css overrides per .bg-* context. */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-eyebrow);
  line-height: var(--lh-eyebrow);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  display: inline-block;
  align-self: flex-start;
  width: fit-content;
  padding: 4px 10px;
  border-radius: var(--rd-6);
  background: var(--eyebrow-bg-light);
}

/* ---------- Layout container (grid.tokens.json) ----------
   Uses the exact --side-padding token at each breakpoint so container edges
   match the design spec at every width. Same formula mirrored in .herofan. */
.container {
  width: calc(100% - 2 * var(--side-padding));
  max-width: var(--container);
  margin-inline: auto;
}

/* Section vertical rhythm — single token per breakpoint (§3.3) */
.section { padding-block: var(--section-pad); }

/* 20-unit span lattice — the content layout grid (no longer a visible wallpaper).
   Content positions via .col-N (span N of 20); the 40/60 split sections use
   col-8 / col-12. minmax(0,1fr) floors each track so no-wrap / wide children
   can't blow a column past its width. */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-units), minmax(0, 1fr));
  gap: var(--grid-gutter);
}
.col-4  { grid-column: span 4;  }   /* 20%                */
.col-8  { grid-column: span 8;  }   /* 40% (split rail)   */
.col-10 { grid-column: span 10; }   /* half               */
.col-12 { grid-column: span 12; }   /* 60% (split content)*/
.col-16 { grid-column: span 16; }   /* 80%                */
.col-20 { grid-column: span 20; }   /* full width         */
/* Tablet + mobile: lattice content stacks full-width. */
@media (max-width: 1023px) {
  .grid > [class*="col-"] { grid-column: 1 / -1; }
}

/* ---------- FOUC guard (ported from motion/1-HEAD.html) ----------
   Hides entrance targets only while motion is armed, so they don't
   flash visible → hidden → fade. A 2.5s failsafe in motion.js
   removes the armed class if the script never runs. */
html.palary-motion-armed [data-reveal],
html.palary-motion-armed [data-reveal-group] > *,
html.palary-motion-armed [data-hero-item] { visibility: hidden; }

/* Accessibility: visually-hidden but screen-reader available */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--color-bg-primary); color: var(--color-text-primary);
  padding: var(--pd-12) var(--pd-20); border-radius: 0 0 var(--rd-8) 0;
}
.skip-link:focus { left: 0; }
