/* Rarityfolio design tokens · single source of truth. Documented in design/DESIGN-SYSTEM.md. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('/assets/fonts/dm-sans.ttf') format('truetype');
}

:root {
  color-scheme: light;

  /* Typography */
  --font: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: clamp(24px, 1.2vw + 18px, 30px);
  --fs-3xl: clamp(30px, 2.4vw + 18px, 44px);
  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh: 1.5;
  --fw-regular: 450;
  --fw-medium: 550;
  --fw-semibold: 650;
  --fw-bold: 750;
  --fw-black: 850;
  --tracking-tight: -0.022em;
  --tracking-caps: 0.07em;

  /* Spacing · 4px grid */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;
  --r-card-art: 7%; /* printed card corner, relative to width */

  /* Control sizes · one height per size, shared by every input and button */
  --h-sm: 36px;
  --h-md: 44px;
  --h-lg: 52px;

  /* Layout */
  --sidebar-w: 256px;
  --rail-w: 76px;
  --topbar-h: 64px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --content-max: 1320px;
  --gutter: 16px;

  /* Motion */
  --dur-1: 140ms;
  --dur-2: 240ms;
  --dur-3: 420ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Brand · Master Ball violet → magenta */
  --violet-300: #c4b5fd;
  --violet-400: #a78bfa;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
  --magenta-500: #e0338f;
  --grad: linear-gradient(135deg, #7c3aed 0%, #a23be6 48%, #e0338f 100%);
  --grad-hover: linear-gradient(135deg, #6d28d9 0%, #9330d8 48%, #cf2580 100%);
  --holo: linear-gradient(
    115deg,
    #7dd3fc 0%,
    #c4b5fd 22%,
    #f9a8d4 44%,
    #fde68a 66%,
    #86efac 84%,
    #7dd3fc 100%
  );
  --night: radial-gradient(120% 90% at 0% 0%, #3b1d78 0%, transparent 55%),
    radial-gradient(90% 80% at 100% 100%, #7a1d5c 0%, transparent 60%),
    linear-gradient(160deg, #150b2e 0%, #1d0f3a 50%, #120a22 100%);

  /* Rarity tiers · tile accents and rarity dots, never body text */
  --tier-common: #9a95a8;
  --tier-rare: #2f8fdb;
  --tier-ultra: #8b5cf6;
  --tier-promo: #ee6a2d;
  --tier-secret: #e0a91b;

  /* Chart series (validated for colour-vision deficiency per theme) */
  --series-1: #7c3aed;
  --series-2: #d6336c;

  /* Light theme surfaces */
  --bg: #f5f4fa;
  --surface: #ffffff;
  --surface-2: #f3f1f9;
  --surface-3: #e9e6f3;
  --border: #e5e1ef;
  --border-strong: #d2cce2;
  --text: #16122a;
  --text-2: #565169;
  --text-3: #858097;
  --accent: #7c3aed;
  --accent-strong: #6d28d9;
  --accent-soft: #f1eafe;
  --accent-text: #6a2bd4;
  --on-accent: #ffffff;
  --success: #058a5f;
  --success-soft: #e2f6ec;
  --warning: #b86200;
  --warning-soft: #fdf1d9;
  --danger: #d4163f;
  --danger-soft: #fde6eb;
  --scrim: rgba(14, 10, 28, 0.46);
  --glass: rgba(255, 255, 255, 0.78);
  /* Expansion symbols are drawn for light card frames; dark surfaces get a thin light halo. */
  --sym-filter: drop-shadow(0 1px 1px rgba(22, 18, 42, 0.18));
  --skeleton: #ebe8f3;

  --focus-ring: 0 0 0 3px rgba(124, 58, 237, 0.38);
  --e-1: 0 1px 2px rgba(22, 18, 42, 0.06), 0 1px 1px rgba(22, 18, 42, 0.03);
  --e-2: 0 10px 24px -12px rgba(22, 18, 42, 0.22), 0 2px 6px rgba(22, 18, 42, 0.05);
  --e-3: 0 28px 60px -18px rgba(22, 18, 42, 0.38), 0 6px 16px rgba(22, 18, 42, 0.08);
  --glow: 0 10px 26px -10px rgba(124, 58, 237, 0.7);
}

@media (min-width: 768px) {
  :root {
    --gutter: 24px;
  }
}
@media (min-width: 1100px) {
  :root {
    --gutter: 32px;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0c0a16;
  --surface: #15121f;
  --surface-2: #1c1829;
  --surface-3: #262037;
  --border: #2a253b;
  --border-strong: #3c3552;
  --text: #f3f1f9;
  --text-2: #b2acc5;
  --text-3: #7e7894;
  --accent: #9f6bff;
  --accent-strong: #b78cff;
  --accent-soft: rgba(159, 107, 255, 0.16);
  --accent-text: #c7a8ff;
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.14);
  --scrim: rgba(4, 2, 10, 0.66);
  --glass: rgba(21, 18, 31, 0.78);
  --sym-filter: drop-shadow(0 0 0.6px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 1.4px rgba(255, 255, 255, 0.4));
  --skeleton: #211c30;
  --focus-ring: 0 0 0 3px rgba(167, 123, 255, 0.5);
  --e-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --e-2: 0 12px 28px -12px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
  --e-3: 0 30px 70px -20px rgba(0, 0, 0, 0.85);
  --glow: 0 10px 30px -10px rgba(159, 107, 255, 0.8);
  --series-1: #9a6bff;
  --series-2: #e64b8a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0c0a16;
    --surface: #15121f;
    --surface-2: #1c1829;
    --surface-3: #262037;
    --border: #2a253b;
    --border-strong: #3c3552;
    --text: #f3f1f9;
    --text-2: #b2acc5;
    --text-3: #7e7894;
    --accent: #9f6bff;
    --accent-strong: #b78cff;
    --accent-soft: rgba(159, 107, 255, 0.16);
    --accent-text: #c7a8ff;
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.14);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.14);
    --danger: #fb7185;
    --danger-soft: rgba(251, 113, 133, 0.14);
    --scrim: rgba(4, 2, 10, 0.66);
    --glass: rgba(21, 18, 31, 0.78);
    --sym-filter: drop-shadow(0 0 0.6px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 1.4px rgba(255, 255, 255, 0.4));
    --skeleton: #211c30;
    --focus-ring: 0 0 0 3px rgba(167, 123, 255, 0.5);
    --e-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --e-2: 0 12px 28px -12px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
    --e-3: 0 30px 70px -20px rgba(0, 0, 0, 0.85);
    --glow: 0 10px 30px -10px rgba(159, 107, 255, 0.8);
    --series-1: #9a6bff;
    --series-2: #e64b8a;
  }
}

/* History timeline · era and lane colours for stripes, dots and chips, never body text
   (public/history.js, design/DESIGN-SYSTEM.md). Each era has its own hue around the wheel. */
:root {
  --era-jp96: #8f8a9e;
  --era-base: #d99a0b;
  --era-neo: #0f9d74;
  --era-ecard: #0891b2;
  --era-ex: #dc2626;
  --era-dp: #4f46e5;
  --era-hgss: #b45309;
  --era-bw: #475569;
  --era-xy: #2563eb;
  --era-sm: #ea580c;
  --era-swsh: #0d9488;
  --era-sv: #c026d3;
  --era-me: #7c3aed;
  --lane-set: #565169;
  --lane-mechanic: #7c3aed;
  --lane-rarity: #b07c05;
  --lane-print: #0891b2;
  --lane-product: #ea580c;
  --lane-rule: #475569;
  --lane-format: #2563eb;
  --lane-company: #858097;
}
:root[data-theme='dark'] {
  --era-jp96: #a39eb3;
  --era-base: #f5b82e;
  --era-neo: #34d399;
  --era-ecard: #22d3ee;
  --era-ex: #f87171;
  --era-dp: #818cf8;
  --era-hgss: #f59e0b;
  --era-bw: #94a3b8;
  --era-xy: #60a5fa;
  --era-sm: #fb923c;
  --era-swsh: #2dd4bf;
  --era-sv: #e879f9;
  --era-me: #a78bfa;
  --lane-set: #b2acc5;
  --lane-mechanic: #a78bfa;
  --lane-rarity: #fbbf24;
  --lane-print: #22d3ee;
  --lane-product: #fb923c;
  --lane-rule: #94a3b8;
  --lane-format: #60a5fa;
  --lane-company: #a39eb3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --era-jp96: #a39eb3;
    --era-base: #f5b82e;
    --era-neo: #34d399;
    --era-ecard: #22d3ee;
    --era-ex: #f87171;
    --era-dp: #818cf8;
    --era-hgss: #f59e0b;
    --era-bw: #94a3b8;
    --era-xy: #60a5fa;
    --era-sm: #fb923c;
    --era-swsh: #2dd4bf;
    --era-sv: #e879f9;
    --era-me: #a78bfa;
    --lane-set: #b2acc5;
    --lane-mechanic: #a78bfa;
    --lane-rarity: #fbbf24;
    --lane-print: #22d3ee;
    --lane-product: #fb923c;
    --lane-rule: #94a3b8;
    --lane-format: #60a5fa;
    --lane-company: #a39eb3;
  }
}
