/* =========================
   PetDentify · base.css
   Purpose: tokens, reset, typography, layout primitives, a11y, utilities
   ========================= */

/* ---------- Design tokens ---------- */
:root {
  /* Colors */
  --green: #07C067;
  --orange: #FF9A3E;
  --fg: #0b0b0b;
  --muted: #667085;
  --line: #e5e7eb;
  --bg: #ffffff;

  /* Typography */
  --font-sans: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --h2: 2rem;            /* 32px */
  --h1: 3rem;            /* 48px */
  --leading-tight: 1.15;
  --leading-normal: 1.6;

  /* Layout */
  --container: 1180px;
  --radius: 12px;

  /* Spacing scale (for consistent vertical rhythm) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 36px;
  --space-9: 54px;
  --space-10: 72px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 30px rgba(2,6,12,.08);  /* used by components (hero images, etc.) */
}

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

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

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

/* Focus ring (visible by default) */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Links inherit color by default; components.css styles CTAs */
a { color: inherit; text-decoration: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { margin: 0 0 0.5rem; line-height: var(--leading-tight); }
h1 { font-size: var(--h1); letter-spacing: -.01em; font-weight: 800; }
h2 { font-size: var(--h2); letter-spacing: -.005em; font-weight: 800; }
p  { margin: 0 0 1rem; }

.lead { color: var(--muted); font-size: var(--text-lg); }
.muted { color: var(--muted); }   /* utility */

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

/* Generic grid helpers (specialized grids live in components.css) */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.125rem; }

@media (max-width: 1024px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Section rhythm (components/pages can override) */
section { padding: 80px 0; border-top: 1px solid var(--line); }

/* ---------- Accessibility helpers ---------- */
.sr-only {
  position: absolute !important;
  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: -9999px; top: 0;
}
.skip-link:focus-visible {
  left: 8px; top: 8px; z-index: 1000;
  background: #fff; color: var(--fg);
  border: 2px solid var(--green);
  border-radius: 999px; padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Lightweight utilities ---------- */
/* Spacing (y-axis margin) */
.my-0 { margin-block: 0 !important; }
.my-1 { margin-block: .25rem !important; }
.my-2 { margin-block: .5rem !important; }
.my-3 { margin-block: .75rem !important; }
.my-4 { margin-block: 1rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: .75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: .75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }

/* Width helper */
.w-full { width: 100% !important; }

/* Text size */
.text-sm   { font-size: var(--text-sm) !important; }
.text-base { font-size: var(--text-base) !important; }
.text-lg   { font-size: var(--text-lg) !important; }

/* Borders / radius */
.border  { border: 1px solid var(--line) !important; }
.rounded { border-radius: var(--radius) !important; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }