/* =============================================================
   503.health — Design Tokens
   Single source of truth for color + type.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---------- Color: base ---------- */
  --bg:           #FFFFFF;
  --bg-alt:       #F7F7F5;
  --fg:           #0F0F0F;
  --fg-2:         #6B6B6B;
  --fg-3:         #A1A1A1;
  --border:       #E5E5E5;
  --border-strong:#D6D6D6;

  --navy:         #1E3A8A;
  --navy-press:   #172E6B;
  --navy-tint:    rgba(30, 58, 138, 0.08);

  --green:        #059669;

  /* ---------- Color: semantic ---------- */
  --color-text-primary:   var(--fg);
  --color-text-secondary: var(--fg-2);
  --color-text-meta:      var(--fg-3);
  --color-link:           var(--navy);
  --color-cta-bg:         var(--navy);
  --color-cta-fg:         #FFFFFF;
  --color-cta-bg-hover:   var(--navy-press);
  --color-section-alt:    var(--bg-alt);
  --color-divider:        var(--border);
  --color-check:          var(--green);

  /* ---------- Type: families ---------- */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* ---------- Type: scale (desktop) ---------- */
  --fs-hero:     80px;   --lh-hero:     1.0;    --tr-hero:    -0.04em;   --fw-hero:    800;
  --fs-display:  56px;   --lh-display:  1.05;   --tr-display: -0.035em;  --fw-display: 800;
  --fs-section:  36px;   --lh-section:  1.1;    --tr-section: -0.03em;   --fw-section: 700;
  --fs-subhead:  22px;   --lh-subhead:  1.35;   --tr-subhead: -0.015em;  --fw-subhead: 600;
  --fs-body-l:   18px;   --lh-body-l:   1.6;    --tr-body-l:  -0.005em;
  --fs-body:     17px;   --lh-body:     1.6;    --tr-body:    -0.005em;
  --fs-small:    14px;   --lh-small:    1.5;
  --fs-eyebrow:  11px;   --lh-eyebrow:  1;      --tr-eyebrow: 0.12em;
  --fs-mono:     14px;   --lh-mono:     1.5;

  /* ---------- Spacing scale ---------- */
  --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;

  --section-pad-y: 144px;
  --container-max: 1200px;
  --container-pad: 32px;
  --content-measure: 640px;

  /* ---------- Radii ---------- */
  --radius-0:    0;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-pill: 9999px;

  /* ---------- Borders ---------- */
  --hairline: 1px solid var(--border);

  /* ---------- Shadow ---------- */
  --shadow-soft:
    0 1px 2px rgba(15,15,15,0.04),
    0 8px 24px rgba(15,15,15,0.06);

  /* ---------- Motion ---------- */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --dur-micro:  150ms;
  --dur-base:   220ms;
  --dur-large:  320ms;

  /* ---------- Focus ---------- */
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--navy-tint);
}

/* =============================================================
   Semantic element styles
   ============================================================= */

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background: var(--bg);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  margin: 0;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--color-text-primary);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-hero);
  line-height: var(--lh-hero);
  letter-spacing: var(--tr-hero);
  font-weight: var(--fw-hero);
}
h2 {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
  font-weight: var(--fw-display);
}
h3 {
  font-size: var(--fs-section);
  line-height: var(--lh-section);
  letter-spacing: var(--tr-section);
  font-weight: var(--fw-section);
}
h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-subhead);
  line-height: var(--lh-subhead);
  letter-spacing: var(--tr-subhead);
  font-weight: 500;
  margin: 0;
  color: var(--color-text-primary);
}

p {
  margin: 0;
  color: var(--color-text-secondary);
  max-width: var(--content-measure);
  text-wrap: pretty;
}

img { max-width: 100%; height: auto; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  line-height: var(--lh-eyebrow);
  letter-spacing: var(--tr-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.body-l { font-size: var(--fs-body-l); line-height: var(--lh-body-l); }
.body   { font-size: var(--fs-body);   line-height: var(--lh-body);   }
.small  { font-size: var(--fs-small);  line-height: var(--lh-small);  color: var(--color-text-secondary); }
.meta   { font-size: var(--fs-small);  line-height: var(--lh-small);  color: var(--color-text-meta); }
.mono   { font-family: var(--font-mono); font-size: var(--fs-mono); line-height: var(--lh-mono); }

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--dur-micro) var(--ease-standard);
}
a:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 2px; }

hr { border: 0; border-top: var(--hairline); margin: 0; }

/* =============================================================
   Buttons
   ============================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-micro) var(--ease-standard),
              color var(--dur-micro) var(--ease-standard),
              transform 80ms var(--ease-standard);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--color-cta-bg);
  color: var(--color-cta-fg);
}
.btn-primary:hover { background: var(--color-cta-bg-hover); text-decoration: none; }

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-secondary:hover { background: var(--bg-alt); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--fg);
}
.btn-ghost:hover { background: var(--bg-alt); text-decoration: none; }

/* =============================================================
   Card primitive
   ============================================================= */

.card {
  background: var(--bg);
  border: var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: border-color var(--dur-micro) var(--ease-standard);
}
.card:hover { border-color: var(--border-strong); }

/* =============================================================
   Section + container
   ============================================================= */

.section {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}
.section-alt { background: var(--color-section-alt); }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* =============================================================
   Responsive utility classes (used in JSX inline styles too)
   ============================================================= */

/* Hide on mobile, show on desktop */
.desktop-only { display: block; }
.mobile-only { display: none; }

/* =============================================================
   Tablet breakpoint (max-width: 1024px)
   ============================================================= */

@media (max-width: 1024px) {
  :root {
    --fs-hero: 56px;
    --fs-display: 42px;
    --fs-section: 30px;
    --section-pad-y: 96px;
    --container-pad: 24px;
  }
}

/* =============================================================
   Mobile breakpoint (max-width: 768px)
   ============================================================= */

@media (max-width: 768px) {
  :root {
    --fs-hero: 36px;
    --fs-display: 28px;
    --fs-section: 24px;
    --fs-subhead: 18px;
    --fs-body-l: 16px;
    --fs-body: 15px;
    --section-pad-y: 64px;
    --container-pad: 16px;
  }

  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }

  h1 br, h2 br { display: none; }

  .btn {
    padding: 12px 20px;
    font-size: 14px;
    width: 100%;
  }
}

/* =============================================================
   Small mobile (max-width: 480px)
   ============================================================= */

@media (max-width: 480px) {
  :root {
    --fs-hero: 30px;
    --fs-display: 24px;
    --fs-section: 22px;
    --section-pad-y: 48px;
  }
}
