/* ================================================================
   theme.css — Design tokens, reset, typography, accessibility
   ================================================================ */

:root {
  --bg-primary: #F8F6F3;
  --bg-secondary: #FFFFFF;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --border: #E8E4DF;
  --border-strong: #D1CBC4;

  --accent-primary: #4A90D9;
  --accent-success: #5CB85C;
  --accent-warning: #F0AD4E;
  --accent-danger: #D9534F;

  --text-primary: #2D2D2D;
  --text-secondary: #6B6B6B;
  --text-on-accent: #FFFFFF;

  --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-base: 17px;
  --font-size-sm: 0.85rem;
  --font-size-lg: 1.2rem;
  --font-size-xl: 1.4rem;
  --font-size-2xl: 1.8rem;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --touch-min: 48px;
  --touch-comfortable: 64px;
  --touch-large: 80px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  --app-header-h: 56px;
}

@media (max-width: 768px) {
  :root { --app-header-h: 48px; }
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }

p + p { margin-top: 0.5em; }

/* --- Focus visible --- */
:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

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

/* --- Utility --- */
.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;
}
