/* ============================================================
   AAP · Webfonts
   Josefin Sans  → headers / display (variable, 100–700)
   Bitter        → body text (variable, 100–900) + italic
   Brother 1816 (logo wordmark) is NOT webfont-licensed here;
   it lives only in the locked logo artwork.
   ============================================================ */

@font-face {
  font-family: "Josefin Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("../fonts/JosefinSans.woff2") format("woff2");
}

@font-face {
  font-family: "Bitter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Bitter.woff2") format("woff2");
}

@font-face {
  font-family: "Bitter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Bitter-Italic.woff2") format("woff2");
}

/* ============================================================
   AAP · Color tokens
   Blues lead. Everything else is an accent.
   Source: AAP Identity Guidelines (Color Palette & Breakdowns)
   ============================================================ */

:root {
  /* ---- Brand primaries (the blues) ---- */
  --aap-deep-sea-blue: #004464; /* primary brand color */
  --aap-aqua:          #65c8d0; /* secondary / highlight */

  /* ---- Accent palette (use sparingly) ---- */
  --aap-sand:        #e2dcd2;
  --aap-sea-salt:    #508393;
  --aap-sea-kelp:    #4d5621;
  --aap-coral:       #f47a5e;
  --aap-green-algae: #c1d95e;

  /* ---- Blue tonal ramp (built around Deep Sea Blue + Aqua) ---- */
  --aap-blue-900: #002d42;
  --aap-blue-800: #004464; /* Deep Sea Blue */
  --aap-blue-700: #0a5577;
  --aap-blue-600: #18688b;
  --aap-blue-500: #2f829c;
  --aap-blue-400: #508393; /* Sea Salt */
  --aap-blue-300: #65c8d0; /* Aqua */
  --aap-blue-200: #9adde2;
  --aap-blue-100: #c8ecef;
  --aap-blue-50:  #e9f7f8;

  /* ---- Neutrals (cool, sand-tinted) ---- */
  --aap-ink:      #16242c; /* near-black text on light */
  --aap-slate:    #4a5b63;
  --aap-stone:    #7b8a90;
  --aap-mist:     #b4c0c4;
  --aap-cloud:    #d8e0e2;
  --aap-fog:      #eef2f3;
  --aap-paper:    #f7f9f9;
  --aap-white:    #ffffff;
  --aap-sand-50:  #f3f0ea; /* warm paper, from Sand */

  /* ---- Semantic: text ---- */
  --text-strong:  var(--aap-deep-sea-blue);
  --text-body:    var(--aap-ink);
  --text-muted:   var(--aap-slate);
  --text-subtle:  var(--aap-stone);
  --text-on-dark: var(--aap-white);
  --text-on-dark-muted: var(--aap-blue-200);
  --text-link:    var(--aap-blue-600);

  /* ---- Semantic: surfaces ---- */
  --surface-page:     var(--aap-paper);
  --surface-card:     var(--aap-white);
  --surface-sunken:   var(--aap-fog);
  --surface-warm:     var(--aap-sand-50);
  --surface-brand:    var(--aap-deep-sea-blue);
  --surface-brand-2:  var(--aap-blue-900);
  --surface-accent:   var(--aap-blue-50);

  /* ---- Semantic: borders & lines ---- */
  --border-subtle:  var(--aap-cloud);
  --border-default: var(--aap-mist);
  --border-strong:  var(--aap-slate);
  --border-brand:   var(--aap-aqua);

  /* ---- Semantic: interactive ---- */
  --action:         var(--aap-deep-sea-blue);
  --action-hover:   var(--aap-blue-900);
  --action-active:  #001f2e;
  --accent:         var(--aap-aqua);
  --accent-hover:   #4fb6bf;
  --focus-ring:     var(--aap-aqua);

  /* ---- Semantic: status (mapped to brand-adjacent accents) ---- */
  --status-positive: var(--aap-sea-kelp);
  --status-warning:  var(--aap-coral);
  --status-info:     var(--aap-sea-salt);
  --status-fresh:    var(--aap-green-algae);
}

/* ============================================================
   AAP · Typography tokens
   Josefin Sans → headers (geometric, airy, wide tracking).
   Bitter       → body (slab serif, sturdy, readable).
   System fallback for sharing: Montserrat (titles) / Lato (text)
   per the brand guide, then platform sans.
   ============================================================ */

:root {
  /* ---- Families ---- */
  --font-display: "Josefin Sans", "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Bitter", "Lato", Georgia, "Times New Roman", serif;
  --font-mono:    ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;

  /* ---- Weights ---- */
  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* ---- Type scale (1.25 major-third-ish, tuned) ---- */
  --text-2xs: 0.6875rem; /* 11px */
  --text-xs:  0.75rem;   /* 12px */
  --text-sm:  0.875rem;  /* 14px */
  --text-md:  1rem;      /* 16px — base */
  --text-lg:  1.125rem;  /* 18px */
  --text-xl:  1.375rem;  /* 22px */
  --text-2xl: 1.75rem;   /* 28px */
  --text-3xl: 2.25rem;   /* 36px */
  --text-4xl: 3rem;      /* 48px */
  --text-5xl: 4rem;      /* 64px */
  --text-6xl: 5.25rem;   /* 84px */

  /* ---- Line heights ---- */
  --leading-tight:   1.08;
  --leading-snug:    1.25;
  --leading-normal:  1.5;
  --leading-relaxed: 1.7;

  /* ---- Letter spacing ----
     Josefin runs wide; display headings get positive tracking,
     and eyebrows/labels get pronounced uppercase tracking. */
  --tracking-tight:  -0.01em;
  --tracking-normal: 0;
  --tracking-wide:   0.04em;
  --tracking-wider:  0.12em;
  --tracking-eyebrow: 0.18em;

  /* ---- Semantic roles ---- */
  --display-font:   var(--font-display);
  --display-weight: var(--weight-bold);
  --heading-font:   var(--font-display);
  --heading-weight: var(--weight-semibold);
  --body-font:      var(--font-body);
  --body-weight:    var(--weight-regular);
  --eyebrow-font:   var(--font-display);
  --eyebrow-weight: var(--weight-semibold);
}

/* ============================================================
   AAP · Spacing, radii, shadows, motion
   8px base grid. Soft, sea-glass radii. Cool, low shadows.
   ============================================================ */

:root {
  /* ---- Spacing scale (8px base) ---- */
  --space-0:  0;
  --space-1:  0.25rem;  /* 4 */
  --space-2:  0.5rem;   /* 8 */
  --space-3:  0.75rem;  /* 12 */
  --space-4:  1rem;     /* 16 */
  --space-5:  1.5rem;   /* 24 */
  --space-6:  2rem;     /* 32 */
  --space-7:  2.5rem;   /* 40 */
  --space-8:  3rem;     /* 48 */
  --space-9:  4rem;     /* 64 */
  --space-10: 5rem;     /* 80 */
  --space-11: 6rem;     /* 96 */
  --space-12: 8rem;     /* 128 */

  /* ---- Container widths ---- */
  --container-sm:   640px;
  --container-md:   880px;
  --container-lg:   1120px;
  --container-xl:   1320px;
  --gutter:         var(--space-5);

  /* ---- Radii (soft, never pill on cards) ---- */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-pill: 999px;
  --radius-card: var(--radius-lg);

  /* ---- Border widths ---- */
  --border-hair: 1px;
  --border-thin: 1.5px;
  --border-thick: 2px;

  /* ---- Shadows (cool deep-sea cast, soft & low) ---- */
  --shadow-xs:  0 1px 2px rgba(0, 44, 66, 0.06);
  --shadow-sm:  0 1px 3px rgba(0, 44, 66, 0.08), 0 1px 2px rgba(0, 44, 66, 0.06);
  --shadow-md:  0 4px 12px rgba(0, 44, 66, 0.10), 0 2px 4px rgba(0, 44, 66, 0.06);
  --shadow-lg:  0 12px 28px rgba(0, 44, 66, 0.14), 0 4px 8px rgba(0, 44, 66, 0.06);
  --shadow-xl:  0 24px 56px rgba(0, 44, 66, 0.18);
  --shadow-focus: 0 0 0 3px rgba(101, 200, 208, 0.45); /* aqua focus ring */
  --shadow-inset: inset 0 1px 2px rgba(0, 44, 66, 0.08);

  /* ---- Motion ---- */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1); /* @kind other */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); /* @kind other */
  --duration-fast:   120ms; /* @kind other */
  --duration-normal: 200ms; /* @kind other */
  --duration-slow:   360ms; /* @kind other */

  /* ---- Z-index ---- */
  --z-base:    0;    /* @kind other */
  --z-raised:  10;   /* @kind other */
  --z-sticky:  100;  /* @kind other */
  --z-overlay: 1000; /* @kind other */
  --z-modal:   1100; /* @kind other */
  --z-toast:   1200; /* @kind other */
}

/* ============================================================
   AAP · Base element defaults
   Applies the brand type + color roles to raw HTML so specimen
   cards and consuming pages inherit the system automatically.
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: var(--body-weight);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  color: var(--text-strong);
  line-height: var(--leading-tight);
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: var(--text-4xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); letter-spacing: var(--tracking-wide); }

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: var(--text-link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* Eyebrow / kicker label — a recurring AAP motif */
.aap-eyebrow {
  font-family: var(--eyebrow-font);
  font-weight: var(--eyebrow-weight);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  font-size: var(--text-xs);
  color: var(--accent);
}

::selection {
  background: var(--aap-aqua);
  color: var(--aap-deep-sea-blue);
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

