/* ==========================================================================
   Elevate Home Renovations — base.css
   Design tokens, reset, and base typography. Source of truth: design.md.
   ========================================================================== */

:root {
  /* --- Colour (design.md color) — "Editorial Neutral" base + a single pine accent ---
     The base stays warm monochrome. Exactly one chromatic token carries emphasis, so
     the accent reads as a deliberate signal (CTA, link, control) rather than decoration.
     Client-directed on 2026-08-03; supersedes the original no-accent mandate. */
  --ink: #1A1917;          /* warm near-black */
  --plaster: #F6F4F0;      /* warm off-white, default bg */
  --paper: #FCFBF8;        /* lighter card surface */
  --sand: #ECE8E1;         /* mid surface / separators */
  --stone: #6C665F;        /* muted taupe-grey secondary text — AA on every light surface */
  --stone-on-ink: #979086;  /* same hue, lifted so it clears AA against --ink instead */
  --line: #E2DDD4;         /* hairline */

  /* Pine accent. Measured against every surface it lands on (all AA or better):
     white on pine 10.02:1 · pine on plaster 9.13:1 · on sand 8.21:1 · on paper 9.69:1. */
  --accent: #1F4A38;        /* pine — solid buttons, links, controls, rules */
  --accent-strong: #16382A; /* button hover/pressed */
  --accent-soft: #E6EDE8;   /* palest sage wash — focus ring, success state, on-ink labels */
  --accent-on-ink: #9CC2AE; /* pine lifted for dark surfaces — 8.99:1 on --ink */
  --white: #FFFFFF;

  /* --- Type families (design.md typography) --- */
  --font-head: "Bricolage Grotesque", "Space Grotesk", system-ui, -apple-system,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;

  /* --- Type scale (fluid, clamp) --- */
  --fs-display: clamp(2.75rem, 6vw, 5rem);
  --fs-h1: clamp(2.25rem, 4.5vw, 3.5rem);
  --fs-h2: clamp(1.75rem, 3vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 2vw, 1.5rem);
  --fs-lead: clamp(1.125rem, 1.6vw, 1.375rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-eyebrow: 0.8125rem;

  /* --- Spacing (8px base) --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;
  --space-11: 160px;

  /* --- Layout --- */
  --container-max: 1240px;
  --container-gutter: clamp(20px, 5vw, 64px);

  /* --- Radii --- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* --- Shadows (soft, low) --- */
  --shadow-sm: 0 1px 2px rgba(20, 23, 26, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 23, 26, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 23, 26, 0.10);

  /* --- Motion --- */
  --dur-fast: 200ms;
  --dur-base: 400ms;
  --dur-slow: 700ms;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft-inout: cubic-bezier(0.65, 0, 0.35, 1);

  --header-h: 72px;
}

/* Secondary text and the accent both have to move in the opposite direction on dark
   surfaces. Rebinding the tokens on the dark containers means every rule that already
   says `color: var(--stone)` or `var(--accent)` stays correct on both, with no
   per-selector overrides.
   Measured: #6C665F is 4.64:1 on --sand (the darkest light surface) and #979086 is
   5.56:1 on --ink. The old single #8C857C was 2.98:1 on sand, i.e. below AA.
   Same trap on the accent: pine #1F4A38 on --ink is 1.75:1, which is how the process
   step numbers and their rules ended up invisible on the ink band. The lifted
   --accent-on-ink is 8.99:1 there. */
.section--ink,
.site-footer,
.mobile-menu,
.hero,
.signature {
  --stone: var(--stone-on-ink);
  --accent: var(--accent-on-ink);
}

/* --------------------------------------------------------------------------
   Reset — modern, minimal
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* Lenis sets scroll-behavior; keep native smooth off when JS smooth-scroll runs */
html.lenis { scroll-behavior: auto; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  color: var(--ink);
  background: var(--plaster);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* Pairs with the width/height attributes on every <img>: the attributes reserve
   space (no CLS), height:auto keeps them from overriding a CSS aspect-ratio. */
img { height: auto; }

input,
button,
textarea,
select { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

/* --------------------------------------------------------------------------
   Base typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); line-height: 1.06; }
h2 { font-size: var(--fs-h2); line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: var(--fs-h3); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }

p { text-wrap: pretty; }

strong { font-weight: 600; }

/* Comfortable measure for long body copy: 60–75 chars */
.measure { max-width: 66ch; }

/* --------------------------------------------------------------------------
   Accessibility helpers
   -------------------------------------------------------------------------- */
.sr-only {
  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 {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 1000;
  background: var(--accent);
  color: var(--white);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  transition: top var(--dur-fast) var(--ease-standard);
}
.skip-link:focus { top: var(--space-4); }

/* Visible focus ring everywhere, never removed */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.on-ink :focus-visible,
.on-ink:focus-visible { outline-color: var(--accent-soft); }
