/* =========================================
   v18 Design Tokens (按 ui-design SKILL · 2026-06-27)
   ========================================= */
:root {
  /* === Type Scale (1.25 ratio, 16px base) === */
  --text-xs: 0.64rem;    /* 10px - captions */
  --text-sm: 0.8rem;     /* 13px - secondary */
  --text-base: 1rem;     /* 16px - body */
  --text-lg: 1.25rem;    /* 20px - lead */
  --text-xl: 1.563rem;   /* 25px - h4 */
  --text-2xl: 1.953rem;  /* 31px - h3 */
  --text-3xl: 2.441rem;  /* 39px - h2 */
  --text-4xl: 3.052rem;  /* 49px - h1 */
  --text-5xl: 3.815rem;  /* 61px - hero */

  /* === Spacing Scale (8px base) === */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* === Surface Layering (Dark Mode) === */
  --surface-0: var(--ink);          /* page */
  --surface-1: var(--canvas-soft);  /* card */
  --surface-2: var(--ink-mid);      /* raised */
  --surface-3: var(--surface-elevated); /* popover/modal */

  /* === Color Roles (5 functional) === */
  --color-primary: var(--grad-peach);     /* brand */
  --color-neutral: var(--text);          /* text + bg */
  --color-accent: var(--grad-sky);       /* secondary */
  --color-semantic-success: var(--accent-3);
  --color-semantic-warning: var(--warning);
  --color-semantic-error: var(--error);

  /* === Radius === */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  /* === Motion (per skill: communicate, not decorate) === */
  --motion-hover: 150ms ease-out;
  --motion-modal-open: 250ms ease-out;
  --motion-modal-close: 200ms ease-in;
  --motion-page: 300ms ease-in-out;
  --motion-stagger: 60ms;

  /* === Focus (WCAG 2.4.7) === */
  --focus-ring: 2px solid var(--grad-peach);
  --focus-offset: 2px;

  /* === Z-Index Scale === */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 1000;
  --z-toast: 2000;
  --z-tooltip: 3000;
}

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

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