/* ============================================================
   Kin-Guard — Color & Type Foundations
   ------------------------------------------------------------
   The brand uses TWO families:
     - Charcoal (neutral, structural — body, surface, ink)
     - Amber (single accent — CTAs, key highlights, links on dark)
   Type pairs an editorial display serif (Fraunces) with a
   highly legible neutral sans (Inter). Base font-size is 18px
   (not 16px) — this is an accessibility decision tied to the
   older-eyes audience. Do not lower it without a reason.
   ============================================================ */

/* --- Fonts: Atkinson Hyperlegible (self-hosted) + Fraunces (CDN) ---
   Atkinson Hyperlegible is the brand sans. It is designed by the Braille
   Institute specifically to increase legibility for low-vision readers —
   exactly the accessibility-first decision Kin-Guard's audience needs.
   It ships in 400 / 700 only; treat any 500/600 in legacy markup as 700.
   Fraunces remains the editorial display serif, loaded via Google Fonts.
*/

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  /* ----- Palette: Charcoal (neutral scale) ----- */
  --charcoal-50:  #F5F6F7;   /* page surface, off-white */
  --charcoal-100: #E5E7EB;   /* hairline borders, muted fills */
  --charcoal-200: #D1D5DB;   /* dividers */
  --charcoal-300: #9CA3AF;   /* tertiary text, disabled */
  --charcoal-500: #4B5563;   /* secondary text */
  --charcoal-700: #1F2937;   /* body text on light bg (12.6:1) */
  --charcoal-900: #0B0F14;   /* headings, hero bg, deepest ink */

  /* ----- Palette: Amber (single accent) ----- */
  --amber-100: #FEF3C7;       /* soft amber wash, callout bg */
  --amber-300: #FCD34D;       /* highlight, on-dark accent text */
  --amber-400: #F59E0B;       /* primary CTA on dark bg */
  --amber-500: #D97706;       /* primary CTA on light bg (4.6:1 on white) */
  --amber-600: #B45309;       /* hover, focus ring, link hover */
  --amber-700: #92400E;       /* ink on amber-100 wash */

  /* ----- Semantic foreground/background ----- */
  --bg:            var(--charcoal-50);
  --bg-elevated:   #FFFFFF;
  --bg-dark:       var(--charcoal-900);
  --bg-wash:       var(--amber-100);

  --fg:            var(--charcoal-900);
  --fg-body:       var(--charcoal-700);
  --fg-muted:      var(--charcoal-500);
  --fg-subtle:     var(--charcoal-300);
  --fg-on-dark:    #FFFFFF;
  --fg-on-dark-muted: var(--charcoal-100);

  --accent:        var(--amber-500);   /* default on light */
  --accent-on-dark:var(--amber-400);   /* default on dark */
  --accent-hover:  var(--amber-600);
  --accent-ink:    var(--charcoal-900);/* text color of filled amber buttons */

  --border:        var(--charcoal-100);
  --border-strong: var(--charcoal-300);
  --border-on-dark:rgba(255,255,255,0.16);

  /* ----- Status (used sparingly — protective context) ----- */
  --ok:     #1F7A4D;
  --warn:   var(--amber-600);
  --danger: #B23A48;

  /* ----- Type families ----- */
  --font-sans: "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", "Georgia", "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, monospace;

  /* ----- Type scale (18px base, generous line-height) ----- */
  --fs-xs:   0.875rem;  /* 14px — captions, eyebrows */
  --fs-sm:   1rem;      /* 16px — small UI */
  --fs-base: 1.125rem;  /* 18px — body */
  --fs-lg:   1.25rem;   /* 20px — lead, large body */
  --fs-xl:   1.5rem;    /* 24px — small headings */
  --fs-2xl:  1.875rem;  /* 30px — section headings */
  --fs-3xl:  2.25rem;   /* 36px — page titles */
  --fs-4xl:  2.75rem;   /* 44px — display */
  --fs-5xl:  3.5rem;    /* 56px — hero display */
  --fs-6xl:  4.5rem;    /* 72px — oversize editorial */

  --lh-tight:  1.1;
  --lh-snug:   1.25;
  --lh-normal: 1.5;
  --lh-relaxed:1.65;
  --lh-loose:  1.75;

  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.04em;
  --tracking-eyebrow:0.08em;

  /* ----- Spacing (4px base, with 18/22/30 escape hatches) ----- */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-18: 4.5rem;
  --sp-22: 5.5rem;
  --sp-30: 7.5rem;

  /* ----- Radii ----- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-pill: 999px;

  /* ----- Elevation (soft, sparing) ----- */
  --shadow-sm: 0 1px 2px rgba(11,15,20,0.06);
  --shadow-md: 0 4px 14px -2px rgba(11,15,20,0.08), 0 2px 6px rgba(11,15,20,0.04);
  --shadow-lg: 0 18px 40px -12px rgba(11,15,20,0.18), 0 6px 14px rgba(11,15,20,0.06);
  --shadow-focus: 0 0 0 4px rgba(180,83,9,0.30);

  /* ----- Layout ----- */
  --maxw-prose:   65ch;
  --maxw-section: 72rem;   /* 1152px */
  --maxw-narrow:  44rem;   /* 704px — single column reading */

  /* ----- Motion (calm, never bouncy) ----- */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 140ms;
  --dur-base: 220ms;
  --dur-slow: 360ms;
}

/* ============================================================
   Semantic element defaults
   ============================================================ */

html {
  font-family: var(--font-sans);
  font-size: 18px;        /* base — do not reduce */
  color: var(--fg-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--fg);
  font-weight: 500;          /* Fraunces reads heavy at 500 */
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: var(--fs-5xl); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-3xl); line-height: var(--lh-snug); }
h3 { font-size: var(--fs-xl);  line-height: var(--lh-snug); font-weight: 700; }
h4 { font-size: var(--fs-lg);  line-height: var(--lh-snug); font-weight: 700; }

p {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--fg-body);
  text-wrap: pretty;
  margin: 0;
}

.lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--fg-body);
  max-width: var(--maxw-prose);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow--on-dark { color: var(--accent-on-dark); }

.muted   { color: var(--fg-muted); }
.subtle  { color: var(--fg-subtle); }
.display { font-family: var(--font-display); }
.mono    { font-family: var(--font-mono); }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

::selection { background: var(--amber-300); color: var(--charcoal-900); }
