/* shadcn-style UI kit for everything outside the slides.
   Loaded on the deck page too, so nothing here styles bare elements: base page
   styles live under body.ui, components are class-only. */

:root {
  --background: #fafaf9;
  --foreground: #1c1917;
  --card: #ffffff;
  --card-foreground: #1c1917;
  --muted: #f1efec;
  --muted-foreground: #6b645e;
  --primary: #7c3aed;
  --primary-foreground: #ffffff;
  --border: #e4e0db;
  --input: #d6d1cb;
  --ring: #8b5cf6;
  --success: #166534;
  --destructive: #b91c1c;
  --grad-primary: linear-gradient(115deg, #7c3aed 0%, #db2777 52%, #ea580c 100%); /* decorative + gradient text, >= 3:1 on --background */
  --grad-button: linear-gradient(115deg, #6d28d9 0%, #be185d 52%, #c2410c 100%); /* white text on it is >= 4.5:1 */
  --radius: 1rem;
  --shadow-glow: 0 8px 28px -6px rgba(190, 24, 93, .5), 0 4px 14px -4px rgba(109, 40, 217, .45);
  --shadow-card: 0 1px 2px rgba(28, 25, 23, .05), 0 8px 24px -12px rgba(28, 25, 23, .12);
  --ui-sans: "Geist", "Inter Tight", system-ui, sans-serif;
  --ui-mono: "Geist Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ui-ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --background: #0c0a0f;
  --foreground: #f5f3f7;
  --card: #15121a;
  --card-foreground: #f5f3f7;
  --muted: #1e1a26;
  --muted-foreground: #a39bb0;
  --primary: #a78bfa;
  --primary-foreground: #120a24;
  --border: #2a2433;
  --input: #3a3246;
  --ring: #a78bfa;
  --success: #4ade80;
  --destructive: #f87171;
  --grad-primary: linear-gradient(115deg, #7c3aed 0%, #ec4899 52%, #f97316 100%);
  --shadow-glow: 0 8px 30px -6px rgba(190, 24, 93, .6), 0 4px 16px -4px rgba(109, 40, 217, .55);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #0c0a0f;
    --foreground: #f5f3f7;
    --card: #15121a;
    --card-foreground: #f5f3f7;
    --muted: #1e1a26;
    --muted-foreground: #a39bb0;
    --primary: #a78bfa;
    --primary-foreground: #120a24;
    --border: #2a2433;
    --input: #3a3246;
    --ring: #a78bfa;
    --success: #4ade80;
    --destructive: #f87171;
    --grad-primary: linear-gradient(115deg, #7c3aed 0%, #ec4899 52%, #f97316 100%);
    --shadow-glow: 0 8px 30px -6px rgba(190, 24, 93, .6), 0 4px 16px -4px rgba(109, 40, 217, .55);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* Cross-page transition (deck card -> deck page). */
@view-transition { navigation: auto; }

/* Page base: only for pages that opt in with <body class="ui">. */
body.ui {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--ui-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.ui *, body.ui *::before, body.ui *::after { box-sizing: border-box; }

/* Focus ring shared by every interactive component. */
.btn:focus-visible, .input:focus-visible, .theme-toggle:focus-visible, .card:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.input:focus-visible { outline-offset: 0; }

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.5rem; padding: 0 1.25rem;
  border: 1px solid transparent; border-radius: 999px;
  font: 600 .9375rem/1 var(--ui-sans);
  white-space: nowrap; text-decoration: none; cursor: pointer;
  background: transparent; color: var(--foreground);
  transition: transform .18s var(--ui-ease), box-shadow .25s var(--ui-ease), background-color .15s, border-color .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--grad-button); color: #fff; background-size: 140% 100%; background-position: 0 0; text-shadow: 0 1px 1px rgba(0, 0, 0, .15); }
.btn-primary:hover { box-shadow: var(--shadow-glow); background-position: 100% 0; transform: translateY(-1px); }
.btn-primary:active { transform: scale(.97); }
.btn-secondary { background: var(--muted); color: var(--foreground); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { border-color: var(--input); background: var(--card); color: var(--foreground); }
.btn-outline:hover { background: var(--muted); }
.btn-ghost:hover { background: var(--muted); }
.btn-lg { height: 3rem; padding: 0 1.75rem; font-size: 1rem; }
.btn-icon { width: 2.5rem; padding: 0; }
.btn-icon.btn-lg { width: 3rem; }

/* Card */
.card {
  display: block;
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: calc(var(--radius) + .25rem);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .65rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--muted); color: var(--muted-foreground);
  font: 500 .75rem/1.4 var(--ui-mono); letter-spacing: .02em;
}

/* Input */
.input {
  display: block; width: 100%; height: 2.75rem; padding: 0 1rem;
  border: 1px solid var(--input); border-radius: var(--radius);
  background: var(--card); color: var(--foreground);
  font: 400 1rem var(--ui-mono);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted-foreground); }
.input:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ring) 22%, transparent); }

/* Kbd */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.5rem; padding: .1rem .45rem; border-radius: .5rem;
  border: 1px solid var(--border); border-bottom-width: 2px; background: var(--muted); color: var(--muted-foreground);
  font: 500 .75rem/1.4 var(--ui-mono);
}

/* Theme toggle: shows the icon of the theme you would switch to. */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; padding: 0;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--foreground); cursor: pointer;
  transition: background-color .15s, transform .18s var(--ui-ease);
}
.theme-toggle:hover { background: var(--muted); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .theme-toggle, .input { transition: none; }
  .btn:active, .btn-primary:hover, .theme-toggle:active { transform: none; }
}
