/* Neo-Principia Discordia - Compiled Styles */
/* Run `npm run build:css` to regenerate from Tailwind source */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* === CSS Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Crimson Pro', Georgia, Cambria, serif;
  background-color: #f5f0e6;
  color: #1a1a1a;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: #fbbf24;
  color: #1a1a1a;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #6b21a8;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #ec4899;
}

/* === Color Variables === */
:root {
  --parchment: #f5f0e6;
  --parchment-dark: #e8e0d0;
  --parchment-darker: #d4c9b5;
  --chaos-black: #1a1a1a;
  --chaos-gray: #4a4a4a;
  --chaos-light: #6b6b6b;
  --discord-purple: #6b21a8;
  --discord-violet: #7c3aed;
  --golden-apple: #fbbf24;
  --golden-apple-dark: #d4a017;
  --golden-apple-light: #fcd34d;
  --eris-pink: #ec4899;
  --eris-rose: #f43f5e;
}

/* === Layout === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.min-h-screen {
  min-height: 100vh;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-grow {
  flex-grow: 1;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid {
  display: grid;
}

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* === Spacing === */
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

.pb-2 { padding-bottom: 0.5rem; }
.pb-8 { padding-bottom: 2rem; }
.pt-8 { padding-top: 2rem; }
.pl-4 { padding-left: 1rem; }

.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.my-8 { margin-top: 2rem; margin-bottom: 2rem; }

/* === Typography === */
.font-serif { font-family: 'Crimson Pro', Georgia, Cambria, serif; }
.font-sans { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
.font-display { font-family: 'Playfair Display', Georgia, serif; }
.font-mono { font-family: 'JetBrains Mono', Consolas, monospace; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }
.text-8xl { font-size: 6rem; }

.font-normal { font-weight: 400; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.italic { font-style: italic; }

.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.leading-relaxed { line-height: 1.625; }

.text-center { text-align: center; }
.text-left { text-align: left; }

/* === Colors === */
.text-white { color: #ffffff; }
.text-chaos-black { color: #1a1a1a; }
.text-chaos-gray { color: #4a4a4a; }
.text-chaos-light { color: #6b6b6b; }
.text-discord-purple { color: #6b21a8; }
.text-golden-apple { color: #fbbf24; }
.text-eris-pink { color: #ec4899; }
.text-parchment { color: #f5f0e6; }
.text-parchment-dark { color: #e8e0d0; }
.text-parchment-darker { color: #d4c9b5; }

.bg-white { background-color: #ffffff; }
.bg-parchment { background-color: #f5f0e6; }
.bg-parchment-dark { background-color: #e8e0d0; }
.bg-chaos-black { background-color: #1a1a1a; }
.bg-discord-purple { background-color: #6b21a8; }
.bg-golden-apple { background-color: #fbbf24; }

/* === Borders === */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-t-2 { border-top-width: 2px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-b-2 { border-bottom-width: 2px; border-bottom-style: solid; }
.border-l-4 { border-left-width: 4px; border-left-style: solid; }

.border-golden-apple { border-color: #fbbf24; }
.border-chaos-gray { border-color: #4a4a4a; }
.border-parchment-darker { border-color: #d4c9b5; }
.border-transparent { border-color: transparent; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* === Shadows === */
.shadow-md {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-xl {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* === Positioning === */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-4 { top: 1rem; }
.top-8 { top: 2rem; }
.top-24 { top: 6rem; }
.right-4 { right: 1rem; }
.right-8 { right: 2rem; }
.bottom-8 { bottom: 2rem; }
.bottom-10 { bottom: 2.5rem; }
.left-4 { left: 1rem; }

.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* === Display === */
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }

/* === Sizing === */
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-full { width: 100%; }

.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-auto { height: auto; }

.max-w-lg { max-width: 32rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-none { max-width: none; }

/* === Overflow === */
.overflow-hidden { overflow: hidden; }

/* === Transitions === */
.transition { transition-property: all; transition-timing-function: ease; transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: ease; transition-duration: 200ms; }
.transition-all { transition-property: all; transition-timing-function: ease; transition-duration: 300ms; }

/* === Cursor === */
.cursor-pointer { cursor: pointer; }

/* === Screen Reader === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* === Navigation === */
.nav-link {
  padding: 0.5rem 1rem;
  color: #4a4a4a;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #6b21a8;
  border-bottom-color: #fbbf24;
}

.nav-link.active {
  color: #6b21a8;
  border-bottom-color: #fbbf24;
}

/* === Book Cards === */
.book-card {
  background-color: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid #d4c9b5;
  transition: all 0.3s ease;
  display: block;
  text-decoration: none;
}

.book-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.book-card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background-color: #fbbf24;
  color: #1a1a1a;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* === Book Navigation Button === */
.book-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #6b21a8;
  color: #ffffff;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
  text-decoration: none;
}

.book-nav-btn:hover {
  background-color: #7c3aed;
  color: #ffffff;
}

/* === AI Image Figure === */
.ai-image-figure {
  margin: 2rem auto;
  max-width: 48rem;
}

.ai-image-figure img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.ai-image-figure figcaption {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background-color: #e8e0d0;
  border-radius: 0 0 0.5rem 0.5rem;
  font-size: 0.875rem;
  color: #4a4a4a;
  font-style: italic;
  border-left: 4px solid #fbbf24;
}

/* === Page Break === */
.page-break {
  margin: 3rem 0;
  border: none;
  border-top: 2px solid #fbbf24;
  position: relative;
}

.page-break::after {
  content: '\u2297'; /* ⊗ symbol */
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: #f5f0e6;
  padding: 0 1rem;
  color: #fbbf24;
  font-size: 1.5rem;
}

/* === Table of Contents === */
.toc h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: #fbbf24;
}

.toc-link {
  display: block;
  padding: 0.25rem 0;
  color: #4a4a4a;
  transition: color 0.2s ease;
  text-decoration: none;
  font-size: 0.875rem;
}

.toc-link:hover {
  color: #6b21a8;
}

.toc-link.level-2 { padding-left: 0; }
.toc-link.level-3 { padding-left: 1rem; font-size: 0.8rem; }
.toc-link.level-4 { padding-left: 2rem; font-size: 0.75rem; color: #6b6b6b; }

/* === Pope Card === */
.pope-card-container {
  background-color: #ffffff;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-width: 32rem;
  margin: 0 auto;
}

/* === Mobile Menu === */
.mobile-menu {
  position: fixed;
  inset: 0;
  background-color: rgba(26, 26, 26, 0.95);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-size: 1.5rem;
}

.mobile-menu.hidden {
  display: none !important;
}

.mobile-menu a {
  color: #f5f0e6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-menu a:hover {
  color: #fbbf24;
}

/* === Scroll to Top === */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background-color: #fbbf24;
  color: #1a1a1a;
  border-radius: 9999px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn:hover {
  background-color: #fcd34d;
}

/* === Prose (Typography for content) === */
.prose {
  color: #1a1a1a;
  max-width: 65ch;
  font-size: 1.125rem;
  line-height: 1.75;
}

.prose.max-w-none {
  max-width: none;
}

.prose h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.25rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.prose h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 1rem;
  padding-bottom: 0.5em;
  border-bottom: 2px solid #fbbf24;
  line-height: 1.3;
}

.prose h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.prose h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.25em;
  margin-bottom: 0.5rem;
}

.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose a {
  color: #6b21a8;
  text-decoration: none;
  border-bottom: 1px solid #6b21a8;
  transition: all 0.2s ease;
}

.prose a:hover {
  color: #ec4899;
  border-bottom-color: #ec4899;
}

.prose strong {
  color: #1a1a1a;
  font-weight: 600;
}

.prose em {
  color: #4a4a4a;
}

.prose blockquote {
  font-style: italic;
  border-left: 4px solid #fbbf24;
  background-color: #e8e0d0;
  padding: 1em;
  margin: 1.5em 0;
  border-radius: 0.25em;
}

.prose blockquote p {
  margin: 0;
}

.prose blockquote cite {
  display: block;
  margin-top: 0.5em;
  font-size: 0.875em;
  color: #6b6b6b;
}

.prose code {
  background-color: #e8e0d0;
  padding: 0.2em 0.4em;
  border-radius: 0.25em;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.875em;
}

.prose pre {
  background-color: #1a1a1a;
  color: #fbbf24;
  padding: 1em;
  border-radius: 0.5em;
  overflow-x: auto;
  margin: 1.5em 0;
}

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

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

.prose li {
  margin: 0.5em 0;
}

.prose ul > li::marker {
  color: #fbbf24;
}

.prose ol > li::marker {
  color: #fbbf24;
}

.prose hr {
  border: none;
  border-top: 2px solid #fbbf24;
  margin: 3em 0;
}

.prose img {
  margin: 2em auto;
  border-radius: 0.5rem;
}

.prose figure {
  margin: 2em 0;
}

.prose figcaption {
  text-align: center;
  font-size: 0.875em;
  color: #6b6b6b;
  margin-top: 0.75em;
}

/* === List Styles === */
.list-decimal {
  list-style-type: decimal;
}

.list-inside {
  list-style-position: inside;
}

/* === Gradients === */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-discord-purple\/10 {
  --tw-gradient-from: rgba(107, 33, 168, 0.1);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent);
}

.via-transparent {
  --tw-gradient-stops: var(--tw-gradient-from), transparent, var(--tw-gradient-to, transparent);
}

.to-eris-pink\/10 {
  --tw-gradient-to: rgba(236, 72, 153, 0.1);
}

.from-discord-purple {
  --tw-gradient-from: #6b21a8;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent);
}

.to-eris-pink {
  --tw-gradient-to: #ec4899;
}

/* === Responsive === */
@media (min-width: 640px) {
  .sm\:inline { display: inline; }
  .sm\:hidden { display: none; }
  .sm\:flex-row { flex-direction: row; }
}

@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:col-span-2 { grid-column: span 2 / span 2; }
}

@media (min-width: 1024px) {
  .lg\:block { display: block; }
  .lg\:hidden { display: none; }
  .lg\:grid { display: grid; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-1 { grid-column: span 1 / span 1; }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:col-span-9 { grid-column: span 9 / span 9; }
  .lg\:gap-8 { gap: 2rem; }
  .lg\:py-12 { padding-top: 3rem; padding-bottom: 3rem; }
  .lg\:py-32 { padding-top: 8rem; padding-bottom: 8rem; }
  .lg\:text-3xl { font-size: 1.875rem; }
  .lg\:text-5xl { font-size: 3rem; }
  .lg\:text-7xl { font-size: 4.5rem; }
  .lg\:text-8xl { font-size: 6rem; }
}

/* === Print === */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background-color: #ffffff;
  }

  .prose {
    max-width: none;
  }
}

/* === Animations === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

/* === Group Hover === */
.group:hover .group-hover\:text-discord-purple {
  color: #6b21a8;
}

/* === Details/Summary === */
details summary {
  cursor: pointer;
}

details summary::-webkit-details-marker {
  display: none;
}

details[open] summary {
  margin-bottom: 0.5rem;
}
