/* ============================================================
   tokens.css — design tokens for generated apps (v1)
   ------------------------------------------------------------
   Copy this file into the generated project and style with these
   custom properties. Values give the app a coherent, professional
   look out of the box; DESIGN.md explains when they may be tuned
   (e.g. the accent adapts to the client's brand — structure
   tokens: spacing, radii, type scale, do not change).

   Colors are oklch. Light is the default; dark ships via
   prefers-color-scheme AND an explicit [data-theme] override, so
   a theme toggle works without extra CSS.
   ============================================================ */

:root {
  /* --- Neutral ramp (hue-less) --- */
  --n-0:   oklch(1 0 0);          /* white */
  --n-50:  oklch(0.985 0 0);
  --n-100: oklch(0.955 0 0);
  --n-200: oklch(0.915 0 0);
  --n-300: oklch(0.845 0 0);
  --n-400: oklch(0.715 0 0);
  --n-500: oklch(0.585 0 0);
  --n-600: oklch(0.475 0 0);
  --n-700: oklch(0.375 0 0);
  --n-800: oklch(0.285 0 0);
  --n-900: oklch(0.215 0 0);
  --n-950: oklch(0.155 0 0);

  /* --- Accent (default: indigo; adapt hue/chroma to the client's
     brand when one is expressed — keep lightness steps intact) --- */
  --accent-100: oklch(0.94 0.03 274);
  --accent-300: oklch(0.78 0.10 274);
  --accent-500: oklch(0.585 0.178 274);
  --accent-600: oklch(0.52 0.18 274);
  --accent-700: oklch(0.455 0.165 274);

  /* --- Status --- */
  --success: oklch(0.64 0.15 150);
  --warning: oklch(0.76 0.15 75);
  --danger:  oklch(0.628 0.221 24);

  /* --- Semantic aliases (light) --- */
  --bg:            var(--n-50);
  --surface:       var(--n-0);
  --surface-2:     var(--n-100);
  --text:          var(--n-900);
  --text-muted:    var(--n-600);
  --border:        var(--n-200);
  --border-strong: var(--n-300);
  --accent:          var(--accent-500);
  --accent-hover:    var(--accent-600);
  --accent-contrast: var(--n-0);
  --focus-ring:      var(--accent-500);

  /* --- Typography --- */
  --font-sans: system-ui, -apple-system, "Segoe UI", "Hiragino Sans",
    "Noto Sans JP", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;
  --leading-tight: 1.15;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* --- Spacing (4px grid) --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  /* --- Radii --- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* --- Shadows (soft, low-contrast) --- */
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.06), 0 1px 2px oklch(0 0 0 / 0.04);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.12);

  color-scheme: light;
}

/* --- Dark (system preference) --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            var(--n-950);
    --surface:       var(--n-900);
    --surface-2:     var(--n-800);
    --text:          var(--n-100);
    --text-muted:    var(--n-400);
    --border:        oklch(0.32 0 0);
    --border-strong: oklch(0.40 0 0);
    --accent:          var(--accent-500);
    --accent-hover:    var(--accent-300);
    --accent-contrast: var(--n-0);
    color-scheme: dark;
  }
}

/* --- Dark (explicit toggle) --- */
:root[data-theme="dark"] {
  --bg:            var(--n-950);
  --surface:       var(--n-900);
  --surface-2:     var(--n-800);
  --text:          var(--n-100);
  --text-muted:    var(--n-400);
  --border:        oklch(0.32 0 0);
  --border-strong: oklch(0.40 0 0);
  --accent:          var(--accent-500);
  --accent-hover:    var(--accent-300);
  --accent-contrast: var(--n-0);
  color-scheme: dark;
}

/* --- Base + accessibility floor --- */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

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

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