@import "tailwindcss";

:root {
  /* Light mode tokens */
  --background: #fbfbfb; /* off-white to reduce glare */
  --surface: #ffffff33;     /* card/background surface */
  --foreground: #0f1720;  /* readable body text */
  --muted: rgba(15, 23, 32, 0.55);
  --accent: #0f1720;      /* link/accent (monochrome) */
  --dot-color: rgba(120, 120, 120, 0.576);
  --card-shadow: 0 6px 20px rgba(16, 24, 40, 0.06);
  --radius: 10px;
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: "Cabin", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: var(--font-geist-mono);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0a0a0a;
    --foreground: #ededed;
    --accent: #ededed; /* keep links readable in dark mode */
    --surface: #69696900; /* dark surfaces for cards */
  }

  a {
    border-bottom-color: rgba(237, 237, 237, 0.25);
  }
}

body {
  background: linear-gradient(180deg, var(--background), color-mix(in srgb, var(--background) 85%, rgb(6, 6, 6) 15%) 60%);
  color: var(--foreground);
  font-family: "Cabin", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
}

/* Link styling */
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 23, 32, 0.18);
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
a:hover {
  color: color-mix(in srgb, var(--accent) 80%, black 20%);
  border-bottom-color: transparent;
  text-decoration: underline;
}

/* Visited links keep same color (no blue/purple) */
a:visited {
  color: var(--accent);
}

/* Spotify card wrapper */
.spotify-card {
  display: inline-block;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 14px;
}

/* Small, muted text */
.footer-small {
  color: var(--muted);
  font-size: 12px;
}

/* Prose typography for blog posts */
.prose {
  max-width: 65ch;
  margin: 0 auto;
  color: var(--foreground);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--foreground);
  line-height: 1.25;
  margin-top: 1.75em;
  margin-bottom: 0.6em;
}

.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }

.prose p {
  margin: 1em 0;
  font-size: 1.05rem;
  line-height: 1.8;
  color: color-mix(in srgb, var(--foreground) 90%, transparent 10%);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  border-bottom: none;
}

.prose blockquote {
  margin: 1.5em 0;
  padding-left: 1em;
  border-left: 3px solid rgba(15, 23, 32, 0.18);
  color: var(--muted);
  font-style: italic;
}

@media (prefers-color-scheme: dark) {
  .prose blockquote { border-left-color: rgba(237, 237, 237, 0.18); }
}

.prose hr {
  border: 0;
  border-top: 1px solid rgba(15, 23, 32, 0.12);
  margin: 2rem 0;
}

@media (prefers-color-scheme: dark) {
  .prose hr { border-top-color: rgba(237, 237, 237, 0.12); }
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
  margin: 1em 0;
}
.prose li { margin: 0.35em 0; }

.prose code {
  background: rgba(15, 23, 32, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
}

@media (prefers-color-scheme: dark) {
  .prose code { background: rgba(237, 237, 237, 0.08); }
}

.prose pre {
  background: rgba(15, 23, 32, 0.85);
  color: #f1f5f9;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  box-shadow: var(--card-shadow);
  margin: 1.25rem 0;
}

@media (prefers-color-scheme: dark) {
  .prose pre { background: rgba(255, 255, 255, 0.06); }
}

.prose pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.prose img { border-radius: 10px; }

.prose figure { margin: 1.25rem 0; text-align: center; }
.prose figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.6rem; }

/* Heading anchor link emitted by CustomMDX */
.prose .anchor {
  float: left;
  margin-left: -0.9ch;
  padding-right: 0.5ch;
  opacity: 0;
  text-decoration: none;
  border: none;
}
.prose .anchor::after {
  content: '#';
  color: var(--muted);
}
.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose h4:hover .anchor {
  opacity: 0.6;
}
