:root {
  --background: oklch(0.985 0.002 240);
  --foreground: oklch(0.18 0.02 240);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.18 0.02 240);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.18 0.02 240);
  --primary: oklch(0.45 0.12 240);
  --primary-foreground: oklch(0.99 0 0);
  --secondary: oklch(0.96 0.01 240);
  --secondary-foreground: oklch(0.25 0.02 240);
  --muted: oklch(0.94 0.01 240);
  --muted-foreground: oklch(0.5 0.02 240);
  --accent: oklch(0.55 0.1 240);
  --accent-foreground: oklch(0.99 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.99 0 0);
  --border: oklch(0.88 0.01 240);
  --input: oklch(0.92 0.01 240);
  --ring: oklch(0.55 0.1 240);
  --radius: 0.5rem;

  --font-serif: "Source Serif 4", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.dark {
  --background: oklch(0.15 0.02 240);
  --foreground: oklch(0.95 0.01 240);
  --card: oklch(0.18 0.02 240);
  --card-foreground: oklch(0.95 0.01 240);
  --popover: oklch(0.18 0.02 240);
  --popover-foreground: oklch(0.95 0.01 240);
  --primary: oklch(0.65 0.12 240);
  --primary-foreground: oklch(0.15 0.02 240);
  --secondary: oklch(0.25 0.02 240);
  --secondary-foreground: oklch(0.95 0.01 240);
  --muted: oklch(0.25 0.02 240);
  --muted-foreground: oklch(0.65 0.02 240);
  --accent: oklch(0.55 0.1 240);
  --accent-foreground: oklch(0.95 0.01 240);
  --destructive: oklch(0.396 0.141 25.723);
  --destructive-foreground: oklch(0.95 0.01 240);
  --border: oklch(0.3 0.02 240);
  --input: oklch(0.25 0.02 240);
  --ring: oklch(0.55 0.1 240);
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-serif);
}

/* Tailwind CDN defines .font-serif/.font-mono; override so it matches Next fonts */
.font-serif { font-family: var(--font-serif) !important; }
.font-mono { font-family: var(--font-mono) !important; }

pre,
code,
kbd,
samp {
  font-family: var(--font-mono);
}

/* Token-like utility classes used across the Next design */
.bg-background { background-color: var(--background); }
.text-foreground { color: var(--foreground); }
.bg-foreground { background-color: var(--foreground); }
.bg-card { background-color: var(--card); }
.text-card { color: var(--card); }
.bg-primary { background-color: var(--primary); }
.text-primary { color: var(--primary); }
.text-primary-foreground { color: var(--primary-foreground); }
.bg-secondary { background-color: var(--secondary); }
.text-secondary-foreground { color: var(--secondary-foreground); }
.bg-muted { background-color: var(--muted); }
.text-muted-foreground { color: var(--muted-foreground); }
.border-border { border-color: var(--border); }
.border-primary { border-color: var(--primary); }
.bg-destructive { background-color: var(--destructive); }
.text-destructive { color: var(--destructive); }
.text-destructive-foreground { color: var(--destructive-foreground); }

/* Opacity suffix helpers used by the Next UI (e.g. text-card/70, bg-card/10).
  Tailwind CDN can't generate these because card/foreground/primary are custom tokens. */
.text-card\/70 { color: color-mix(in oklch, var(--card) 70%, transparent); }
.text-card\/60 { color: color-mix(in oklch, var(--card) 60%, transparent); }
.bg-card\/10 { background-color: color-mix(in oklch, var(--card) 10%, transparent); }
.bg-card\/20 { background-color: color-mix(in oklch, var(--card) 20%, transparent); }
.border-card\/20 { border-color: color-mix(in oklch, var(--card) 20%, transparent); }

/* Variant helpers (hover:/group-hover:) for custom token utilities */
.hover\:text-card:hover { color: var(--card); }
.hover\:text-primary:hover { color: var(--primary); }
.hover\:text-foreground:hover { color: var(--foreground); }
.hover\:bg-secondary:hover { background-color: var(--secondary); }
.hover\:bg-card\/10:hover { background-color: color-mix(in oklch, var(--card) 10%, transparent); }
.hover\:bg-card\/20:hover { background-color: color-mix(in oklch, var(--card) 20%, transparent); }
.hover\:border-primary:hover { border-color: var(--primary); }

.group:hover .group-hover\:text-primary { color: var(--primary); }
.group:hover .group-hover\:border-primary { border-color: var(--primary); }

/* Small helpers that existed as Tailwind plugins in the Next version */
.text-balance { text-wrap: balance; }

.line-clamp-2,
.line-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }

/* Minimal prose styling to replace @tailwindcss/typography usage */
.prose {
  color: var(--foreground);
}
.prose p { margin: 0 0 1rem; line-height: 1.8; }
.prose img {
  max-width: 100%;
  height: auto;
  max-height: 480px;
  display: block;
  margin: 1.5rem auto;
}
.prose h2 { margin: 2rem 0 1rem; font-size: 1.5rem; font-weight: 700; }
.prose a { color: var(--primary); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--primary);
  background: var(--secondary);
  border-radius: 0.5rem;
  font-style: italic;
}
