@import "tailwindcss";
@import "tw-animate-css";
@plugin "@tailwindcss/typography";

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

:root {
  --background: oklch(0.973 0.0133 286.1503);
  --foreground: oklch(0.3015 0.0572 282.4176);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.3015 0.0572 282.4176);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.3015 0.0572 282.4176);
  --primary: oklch(0.5417 0.179 288.0332);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.9174 0.0435 292.6901);
  --secondary-foreground: oklch(0.4143 0.1039 288.1742);
  --muted: oklch(0.958 0.0133 286.1454);
  --muted-foreground: oklch(0.5426 0.0465 284.7435);
  --accent: oklch(0.9221 0.0373 262.141);
  --accent-foreground: oklch(0.3015 0.0572 282.4176);
  --destructive: oklch(0.6861 0.2061 14.9941);
  --destructive-foreground: oklch(1 0 0);
  --border: oklch(0.9115 0.0216 285.9625);
  --input: oklch(0.9115 0.0216 285.9625);
  --ring: oklch(0.5417 0.179 288.0332);
  --chart-1: oklch(0.5417 0.179 288.0332);
  --chart-2: oklch(0.7042 0.1602 288.988);
  --chart-3: oklch(0.5679 0.2113 276.7065);
  --chart-4: oklch(0.6356 0.1922 281.8054);
  --chart-5: oklch(0.4509 0.1758 279.3838);
  --sidebar: oklch(0.958 0.0133 286.1454);
  --sidebar-foreground: oklch(0.3015 0.0572 282.4176);
  --sidebar-primary: oklch(0.5417 0.179 288.0332);
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.9221 0.0373 262.141);
  --sidebar-accent-foreground: oklch(0.3015 0.0572 282.4176);
  --sidebar-border: oklch(0.9115 0.0216 285.9625);
  --sidebar-ring: oklch(0.5417 0.179 288.0332);
  --font-sans: Inter, sans-serif;
  --font-serif: Georgia, serif;
  --font-mono: JetBrains Mono, monospace;
  --radius: 0.5rem;
  --shadow-2xs: 0px 4px 10px 0px hsl(240 30% 25% / 0.06);
  --shadow-xs: 0px 4px 10px 0px hsl(240 30% 25% / 0.06);
  --shadow-sm: 0px 4px 10px 0px hsl(240 30% 25% / 0.12),
    0px 1px 2px -1px hsl(240 30% 25% / 0.12);
  --shadow: 0px 4px 10px 0px hsl(240 30% 25% / 0.12),
    0px 1px 2px -1px hsl(240 30% 25% / 0.12);
  --shadow-md: 0px 4px 10px 0px hsl(240 30% 25% / 0.12),
    0px 2px 4px -1px hsl(240 30% 25% / 0.12);
  --shadow-lg: 0px 4px 10px 0px hsl(240 30% 25% / 0.12),
    0px 4px 6px -1px hsl(240 30% 25% / 0.12);
  --shadow-xl: 0px 4px 10px 0px hsl(240 30% 25% / 0.12),
    0px 8px 10px -1px hsl(240 30% 25% / 0.12);
  --shadow-2xl: 0px 4px 10px 0px hsl(240 30% 25% / 0.3);
}

.dark {
  --background: oklch(0.1743 0.0227 283.7998);
  --foreground: oklch(0.9185 0.0257 285.8834);
  --card: oklch(0.2284 0.0384 282.9324);
  --card-foreground: oklch(0.9185 0.0257 285.8834);
  --popover: oklch(0.2284 0.0384 282.9324);
  --popover-foreground: oklch(0.9185 0.0257 285.8834);
  --primary: oklch(0.7162 0.1597 290.3962);
  --primary-foreground: oklch(0.1743 0.0227 283.7998);
  --secondary: oklch(0.3139 0.0736 283.4591);
  --secondary-foreground: oklch(0.8367 0.0849 285.9111);
  --muted: oklch(0.271 0.0621 281.4377);
  --muted-foreground: oklch(0.7166 0.0462 285.1741);
  --accent: oklch(0.3354 0.0828 280.9705);
  --accent-foreground: oklch(0.9185 0.0257 285.8834);
  --destructive: oklch(0.6861 0.2061 14.9941);
  --destructive-foreground: oklch(1 0 0);
  --border: oklch(0.3261 0.0597 282.5832);
  --input: oklch(0.3261 0.0597 282.5832);
  --ring: oklch(0.7162 0.1597 290.3962);
  --chart-1: oklch(0.7162 0.1597 290.3962);
  --chart-2: oklch(0.6382 0.1047 274.9117);
  --chart-3: oklch(0.7482 0.1235 244.7492);
  --chart-4: oklch(0.7124 0.0977 186.6761);
  --chart-5: oklch(0.7546 0.1831 346.8124);
  --sidebar: oklch(0.2284 0.0384 282.9324);
  --sidebar-foreground: oklch(0.9185 0.0257 285.8834);
  --sidebar-primary: oklch(0.7162 0.1597 290.3962);
  --sidebar-primary-foreground: oklch(0.1743 0.0227 283.7998);
  --sidebar-accent: oklch(0.3354 0.0828 280.9705);
  --sidebar-accent-foreground: oklch(0.9185 0.0257 285.8834);
  --sidebar-border: oklch(0.3261 0.0597 282.5832);
  --sidebar-ring: oklch(0.7162 0.1597 290.3962);
  --font-sans: Inter, sans-serif;
  --font-serif: Georgia, serif;
  --font-mono: JetBrains Mono, monospace;
  --radius: 0.5rem;
  --shadow-2xs: 0px 4px 10px 0px hsl(240 30% 25% / 0.06);
  --shadow-xs: 0px 4px 10px 0px hsl(240 30% 25% / 0.06);
  --shadow-sm: 0px 4px 10px 0px hsl(240 30% 25% / 0.12),
    0px 1px 2px -1px hsl(240 30% 25% / 0.12);
  --shadow: 0px 4px 10px 0px hsl(240 30% 25% / 0.12),
    0px 1px 2px -1px hsl(240 30% 25% / 0.12);
  --shadow-md: 0px 4px 10px 0px hsl(240 30% 25% / 0.12),
    0px 2px 4px -1px hsl(240 30% 25% / 0.12);
  --shadow-lg: 0px 4px 10px 0px hsl(240 30% 25% / 0.12),
    0px 4px 6px -1px hsl(240 30% 25% / 0.12);
  --shadow-xl: 0px 4px 10px 0px hsl(240 30% 25% / 0.12),
    0px 8px 10px -1px hsl(240 30% 25% / 0.12);
  --shadow-2xl: 0px 4px 10px 0px hsl(240 30% 25% / 0.3);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);

  --font-sans: var(--font-sans);
  --font-mono: var(--font-mono);
  --font-serif: var(--font-serif);

  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  --shadow-2xs: var(--shadow-2xs);
  --shadow-xs: var(--shadow-xs);
  --shadow-sm: var(--shadow-sm);
  --shadow: var(--shadow);
  --shadow-md: var(--shadow-md);
  --shadow-lg: var(--shadow-lg);
  --shadow-xl: var(--shadow-xl);
  --shadow-2xl: var(--shadow-2xl);
}

@layer base {
  * {
    @apply border-border outline-ring/50 font-sans scroll-smooth;
  }
  body {
    @apply bg-background text-foreground;
  }

  /* Modern Scrollbar Styles */
  ::-webkit-scrollbar {
    @apply w-2;
  }

  ::-webkit-scrollbar-track {
    @apply bg-transparent rounded-full;
  }

  ::-webkit-scrollbar-thumb {
    @apply bg-muted-foreground/50 rounded-full hover:bg-muted-foreground/70 transition-colors;
  }

  /* Firefox */
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--muted-foreground) transparent;
  }
}

/* Pagefind Search Styles */
.pagefind-ui,
.pagefind-ui * {
  font-family: var(--font-sans) !important;
  box-shadow: none !important;
}

.pagefind-ui__search-input,
.pagefind-ui__form-input {
  width: 100% !important;
  padding: 0.75rem 1rem !important;
  padding-left: 2.5rem !important;
  border-radius: var(--radius) !important;
  border: 2px solid var(--input) !important;
  background: var(--background) !important;
  color: var(--foreground) !important;
  box-shadow: transparent !important;
  outline: none !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pagefind-ui__search-input:focus,
.pagefind-ui__form-input:focus {
  border-color: var(--ring) !important;
}

.pagefind-ui__results-area {
  margin-top: 1.5rem !important;
}

.pagefind-ui__results-list {
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 1rem;
}

.pagefind-ui__result {
  padding: 1.25rem !important;
  border-radius: var(--radius) !important;
  border: transparent !important;
  background: var(--background) !important;
  color: var(--foreground) !important;
  box-shadow: transparent !important;
  transition: box-shadow 0.2s;
}
.pagefind-ui__result:hover {
  box-shadow: transparent !important;
}

.pagefind-ui__result-title {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  color: var(--foreground) !important;
}

.pagefind-ui__result-excerpt {
  margin-top: 0.5rem !important;
  font-size: 0.95rem !important;
  color: var(--muted-foreground) !important;
}

.pagefind-ui__result-link {
  color: var(--foreground) !important;
  text-decoration: none !important;
  transition: color 0.2s;
}
.pagefind-ui__result-link:hover {
  color: color-mix(in oklab, var(--primary) 80%, black) !important;
}

.pagefind-ui__button,
.pagefind-ui__form-button {
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius) !important;
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
  border: none !important;
  cursor: pointer;
  transition: background 0.2s;
}
.pagefind-ui__button--reset {
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
}

.pagefind-ui__message {
  color: var(--muted-foreground) !important;
}

/* Highlighted search terms */
.pagefind-ui__result-highlight,
.pagefind-ui mark {
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
  border-radius: 0.25em;
  padding: 0.1em 0.3em;
}

/* Remove default hr and add custom border */
.pagefind-ui hr {
  border: none !important;
  border-top: 1px solid var(--border) !important;
  margin: 1.5rem 0 !important;
}
.pagefind-ui__search-clear {
  background: transparent !important;
  color: var(--muted-foreground) !important;
}
