/* ==========================================================================
   Quaintitative — Custom CSS
   Design system extracted from govern.simplyboring.ai (GOT)
   ========================================================================== */

/* --- Color System (CSS Custom Properties) --- */

:root {
  --background: #ffffff;
  --foreground: #1a1a1a;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --secondary: #f5f5f5;
  --muted: #f5f5f5;
  --muted-foreground: #737373;
  --yellow: #171717;
  --yellow-muted: #f5f5f5;
  --yellow-foreground: #fafafa;
  --border: #1f1f1f;
  --border-subtle: #e5e5e5;
}

.dark {
  --background: #1a1a1a;
  --foreground: #fafafa;
  --primary: #e5e5e5;
  --primary-foreground: #1a1a1a;
  --secondary: #2a2a2a;
  --muted: #2a2a2a;
  --muted-foreground: #a3a3a3;
  --yellow: #e5e5e5;
  --yellow-muted: #2a2a2a;
  --yellow-foreground: #1a1a1a;
  --border: rgba(255, 255, 255, 0.5);
  --border-subtle: rgba(255, 255, 255, 0.1);
}

/* --- Base Styles --- */

body {
  background-color: var(--background);
  color: var(--foreground);
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
}

/* --- Scroll Reveal Animation --- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Reading Progress Bar --- */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background-color: var(--yellow);
  z-index: 100;
  transition: width 0.1s linear;
}

/* --- Article Prose Styles --- */

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--foreground);
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.prose h2 {
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-size: 1.25rem;
}

.prose p {
  margin-bottom: 1.25em;
  line-height: 1.75;
}

.prose a {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--muted-foreground);
  transition: text-decoration-color 0.2s;
}

.prose a:hover {
  text-decoration-color: var(--foreground);
}

.prose blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  color: var(--muted-foreground);
  font-style: italic;
  margin: 1.5em 0;
}

.prose ul,
.prose ol {
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.prose li {
  margin-bottom: 0.5em;
  line-height: 1.75;
}

.prose code {
  background-color: var(--secondary);
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.875em;
}

.prose pre {
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5em 0;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

.prose img {
  border-radius: 0.5rem;
  margin: 1.5em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.875rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.prose th {
  background-color: var(--secondary);
  font-weight: 600;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

/* --- Syntax Highlighting (Rouge) --- */

.highlight {
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5em 0;
}

/* --- Dark Mode Overrides for Syntax --- */

.dark .highlight {
  background-color: #2a2a2a;
}

.dark .prose code {
  background-color: #2a2a2a;
}

.dark .prose pre {
  background-color: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.1);
}

.dark .prose th {
  background-color: #2a2a2a;
}
