/**
 * Global / base styles — Whylet Design System.
 * Design tokens, reset, base typography and shared utilities.
 * Loaded render-blocking on every page (see functions.php) so the very first
 * paint is already fully styled — no FOUC, no unstyled skip link.
 */
:root {
  /* Surfaces */
  --paper: #f3f0e8;
  --paper2: #e8e2d6;
  --paper3: #d7cfbf;
  --dark: #111b18;
  --dark-2: #0c1411;
  --dark-3: #0b1210;
  --light: #f5f1e7;

  /* Ink */
  --ink: #111713;
  --muted: #5d605a;              /* AA on --paper and --paper2 */
  --line: rgba(17, 23, 19, 0.14);
  --line-dark: rgba(245, 241, 231, 0.15);

  /* Accent scale.
     --accent        brand orange. Decorative use + LARGE display text only
                     (3.36:1 on paper = WCAG AA Large).
     --accent-strong AA-compliant for small text on light surfaces (4.69:1)
                     and as the primary button background (5.35:1 vs white).
     --accent-hover  darker press/hover state for the above.
     --accent-light  the accent for DARK surfaces only (5.7:1 on --dark). */
  --accent: #d95b2b;
  --accent-strong: #b84619;
  --accent-hover: #9c3a14;
  --accent-light: #ef7a45;
  --accent-wash: rgba(184, 70, 25, 0.06);

  /* Typography */
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;


  /* Spacing scale — 4px rhythm. Every margin, padding and gap in the theme
     resolves to one of these steps so vertical rhythm stays consistent. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 40px;
  --space-10: 48px;
  --space-11: 64px;
  --space-12: 80px;

  /* Typography rhythm */
  --tracking-display: -0.05em;   /* large display headings */
  --tracking-heading: -0.035em;  /* card + component headings */
  --tracking-mono: 0.1em;        /* all uppercase mono labels */
  --lh-body: 1.6;                /* all prose */
  --lh-tight: 1.05;              /* headings */
  --lh-heading: 1.1;             /* card headings */

  /* Heading scale — one clamp per role, shared by every section */
  --fs-hero: clamp(46px, 6.4vw, 88px);
  --fs-section: clamp(38px, 4.6vw, 62px);

  /* Layout & Spacing */
  --max: 1240px;
  --nav-height: 78px;
  --section-pad: 96px;   /* 8px progression: 96 / 72 / 56 */

  /* Motion */
  --ease: cubic-bezier(.2, .72, .2, 1);
  --dur-fast: 150ms;
  --dur-base: 300ms;
  --dur-slow: 450ms;
  --dur-reveal: 620ms;

  /* Radii & Shadows */
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-sm: 0 4px 12px rgba(17, 23, 19, 0.05);
  --shadow-md: 0 12px 30px rgba(17, 23, 19, 0.08);
  --shadow-lg: 0 22px 45px rgba(17, 23, 19, 0.13);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* No overflow-x here: `hidden` on html or body creates a scroll container,
   which silently disables `position: sticky` on the header in Chrome/Safari.
   Horizontal containment is handled on body with `clip`, which does not. */
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

/* Subtle paper grain. Pointer-events none so it never blocks interaction. */
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.015;
  background-image: radial-gradient(var(--ink) 1px, transparent 0);
  background-size: 8px 8px;
}

::selection { background: var(--accent-strong); color: #fff; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }

/* Layout utilities */
.container { width: min(var(--max), calc(100% - 48px)); margin-inline: auto; }
.section { padding: var(--section-pad) 0; }
.mono { font: 500 11px/1.3 var(--font-mono); letter-spacing: var(--tracking-mono); text-transform: uppercase; }
.display { font-family: var(--font-display); letter-spacing: var(--tracking-display); }
.accent { color: var(--accent); }

/* Screen-reader-only. Defined here (render-blocking) so it is never briefly visible. */
.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. Off-canvas until focused. This rule is render-blocking, which is
   why the link no longer appears on a hard reload. */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: var(--light);
  padding: var(--space-3) var(--space-4);
  font: 500 11px var(--font-mono);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: 16px; outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* Heading foundation */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); line-height: var(--lh-tight); letter-spacing: var(--tracking-heading); }
h1, h2 { font-weight: 700; }
h3, h4, h5 { font-weight: 600; }
h4 { font-size: 20px; }
h5 { font-size: 17px; }
h6 { font-weight: 600; font-size: 15px; }

@media (max-width: 1080px) {
  :root { --section-pad: 72px; }
}

@media (max-width: 760px) {
  :root { --nav-height: 68px; --section-pad: 56px; }
  .container { width: calc(100% - 32px); }
}

@media (max-width: 350px) {
  .container { width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body:before { display: none; }
}
