@import "tailwindcss";
@import "@fontsource/space-mono";
@import "@fontsource/outfit";

@custom-variant dark (&:where(.dark, .dark *));

@theme {
  --color-canvas: #0A0A0B;
  --color-surface: #18181B;
  --color-surface-raised: #27272A;
  --color-border: #27272A;
  --color-border-hover: #3F3F46;
  --color-text: #FAFAFA;
  --color-text-muted: #A1A1AA;
  --color-accent: #2563EB;
  --color-accent-hover: #1D4ED8;
  --color-accent-muted: #60A5FA;
  --font-family-heading: "Space Mono", monospace;
  --font-family-sans: "Outfit", sans-serif;

  --animate-toolbar-pulse: toolbar-pulse 1.6s ease-in-out infinite;
  --animate-pending-ring: pending-ring 1.6s ease-in-out infinite;

  @keyframes toolbar-pulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.12; }
  }

  @keyframes pending-ring {
    0%, 100% { box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.9); }
    50% { box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.12); }
  }
}

:root {
  color-scheme: dark;
  /* Derive hover/muted from the runtime accent so a custom accent flows through */
  --color-accent-hover: color-mix(in srgb, var(--color-accent) 88%, black);
  --color-accent-muted: color-mix(in srgb, var(--color-accent) 70%, white);
}

/* Light theme overrides — the app is dark-first; `.light` is toggled on the root */
:root.light {
  --color-canvas: #FAFAFA;
  --color-surface: #FFFFFF;
  --color-surface-raised: #F4F4F5;
  --color-border: #E4E4E7;
  --color-border-hover: #D4D4D8;
  --color-text: #18181B;
  --color-text-muted: #71717A;
  color-scheme: light;
}

/* Font size scale — rem-based text sizes scale with html font-size */
:root[data-font-size="small"] { font-size: 15px; }
:root[data-font-size="large"] { font-size: 17px; }

html, body {
  background-color: var(--color-canvas);
  color: var(--color-text);
  font-family: var(--font-family-sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  overflow: hidden;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
}

@utility glass {
  background-color: color-mix(in srgb, var(--color-surface) 90%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
}