/* Design tokens. Each tool sets <body data-tool="slug"> and gets its own look. */
:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.25rem; --fs-xl: 1.75rem;

  --bg: #0f1115; --bg-image: none;
  --surface: #171a21; --surface2: #1f2430;
  --text: #e8eaf0; --muted: #a3a9b8; --border: #6b7385;
  --accent: #7aa2ff; --accent-ink: #0b1020;
  --danger: #ff8a8a; --ok: #6fdc9a; --warn: #ffd166;

  --card-bg: var(--surface); --card-border: var(--border); --card-shadow: none; --card-filter: none;
  --ctl-bg: var(--surface2); --ctl-border: var(--border); --ctl-shadow: none; --input-shadow: none;
}

/* Hub (glass over aurora) */
body[data-tool="hub"] {
  --bg: #05070f; --text: #eef1f8; --muted: #b3bad0; --border: rgba(255,255,255,.45);
  --accent: #7cf2ff; --accent-ink: #04141a;
}

/* Python: IDE dark */
body[data-tool="python-compiler"] {
  --bg: #0d1117; --surface: #161b22; --surface2: #21262d; --text: #e6edf3; --muted: #9ba6b4;
  --border: #6e7681; --accent: #58a6ff; --accent-ink: #04101f; --danger: #ff9492; --ok: #7ee787;
}

/* Metadata viewer: glassmorphism */
body[data-tool="metadata-viewer"] {
  --bg: #0e1a3a;
  --bg-image: radial-gradient(60% 55% at 12% 8%, #5b3fd1 0%, transparent 60%), radial-gradient(55% 50% at 90% 15%, #0f86a8 0%, transparent 60%), radial-gradient(60% 60% at 60% 100%, #a8325e 0%, transparent 60%);
  --surface: rgba(255,255,255,.12); --surface2: rgba(255,255,255,.18);
  --text: #ffffff; --muted: #dfe4f7; --border: rgba(255,255,255,.62);
  --accent: #9be4ff; --accent-ink: #06121f;
  --card-bg: rgba(12,10,38,.58); --card-border: rgba(255,255,255,.4); --card-filter: blur(18px) saturate(140%);
  --card-shadow: 0 10px 40px rgba(0,0,0,.28);
  --ctl-bg: rgba(255,255,255,.16);
}

/* JSON: neumorphic dark */
body[data-tool="json"] {
  --bg: #23272f; --surface: #23272f; --surface2: #23272f;
  --text: #e9ecf2; --muted: #b8bec9; --border: #6b7385;
  --accent: #ffb454; --accent-ink: #231a05;
  --card-bg: #23272f; --card-border: transparent; --card-shadow: 9px 9px 18px #181b21, -9px -9px 18px #2e333d;
  --ctl-bg: #23272f; --ctl-border: #6b7385; --ctl-shadow: 4px 4px 8px #181b21, -4px -4px 8px #2e333d;
  --input-shadow: inset 3px 3px 6px #181b21, inset -3px -3px 6px #2e333d;
}

/* Regex: terminal lime */
body[data-tool="regex"] {
  --bg: #10130f; --surface: #181c16; --surface2: #20261d; --text: #e7efe0; --muted: #a8b5a0;
  --border: #6d7a66; --accent: #b6f35a; --accent-ink: #10130f; --danger: #ff9a8a;
}

/* Sample size: neumorphic light */
body[data-tool="sample-size"] {
  --bg: #e6e9ef; --surface: #e6e9ef; --surface2: #e6e9ef;
  --text: #1f2937; --muted: #4b5563; --border: #6b7280;
  --accent: #3b5bdb; --accent-ink: #ffffff; --danger: #b42318; --ok: #146c43;
  --card-bg: #e6e9ef; --card-border: transparent; --card-shadow: 9px 9px 18px #c3c8d2, -9px -9px 18px #ffffff;
  --ctl-bg: #e6e9ef; --ctl-border: #6b7280; --ctl-shadow: 4px 4px 8px #c3c8d2, -4px -4px 8px #ffffff;
  --input-shadow: inset 3px 3px 6px #c3c8d2, inset -3px -3px 6px #ffffff;
}

/* Invisible text: glass, warm */
body[data-tool="ai-text-remover"] {
  --bg: #2a1747;
  --bg-image: radial-gradient(55% 55% at 10% 10%, #8a2a78 0%, transparent 60%), radial-gradient(50% 50% at 92% 18%, #3b3fb0 0%, transparent 60%), radial-gradient(60% 60% at 50% 105%, #b2492f 0%, transparent 60%);
  --surface: rgba(255,255,255,.12); --surface2: rgba(255,255,255,.18);
  --text: #ffffff; --muted: #f1e3f5; --border: rgba(255,255,255,.62);
  --accent: #ffd1f0; --accent-ink: #2a0f26;
  --card-bg: rgba(12,10,38,.58); --card-border: rgba(255,255,255,.4); --card-filter: blur(18px) saturate(140%);
  --card-shadow: 0 10px 40px rgba(0,0,0,.28); --ctl-bg: rgba(255,255,255,.16);
}

/* Plotter: clean light */
body[data-tool="plotter"] {
  --bg: #f5f7fa; --surface: #ffffff; --surface2: #eef1f5;
  --text: #1f2328; --muted: #4a5561; --border: #8a949f;
  --accent: #2d70b3; --accent-ink: #ffffff; --danger: #b42318; --ok: #146c43;
  --grid: #e1e4e8; --axis: #6b7580;
}

/* Admin */
body[data-tool="admin"] {
  --bg: #0f1218; --surface: #171b24; --surface2: #202633; --text: #e8ebf2; --muted: #a6aebf;
  --border: #6b7487; --accent: #7cf2ff; --accent-ink: #04141a;
}

@media (prefers-reduced-transparency: reduce) {
  body[data-tool="metadata-viewer"], body[data-tool="ai-text-remover"] { --card-bg: rgba(20,16,50,.92); --card-filter: none; }
}
