@import "tailwindcss";

:root {
  --background: #ffffff;
  --foreground: #1a1a1a;
  --accent: #8b7355;
  --muted: #6b6b6b;
  --border: #e5e5e5;
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-sans), system-ui, sans-serif;
  --font-serif: var(--font-serif), Georgia, serif;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.6;
}

/* Typography */
.font-serif {
  font-family: var(--font-serif), Georgia, "Times New Roman", serif;
}

.font-sans {
  font-family: var(--font-sans), system-ui, -apple-system, sans-serif;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Better image rendering */
img {
  image-rendering: -webkit-optimize-contrast;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Link styles for navigation only */
nav a {
  transition: opacity 0.2s ease;
}

nav a:hover {
  opacity: 0.7;
}

/* Book-page constraint for poem and TOC content */
.book-page {
  max-width: 36rem; /* ~576px for book-page feel */
  margin-left: auto;
  margin-right: auto;
}

/* Section numbers in small-caps */
.section-number {
  font-variant: small-caps;
  letter-spacing: 0.1em;
}

/* Decorative separator — thin rule with fleuron */
.separator {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #a8a29e; /* stone-400 */
}

.separator::before,
.separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #d6d3d1; /* stone-300 */
}

.separator-simple {
  border: none;
  height: 1px;
  background: #e7e5e4; /* stone-200 */
  margin: 2rem 0;
}

/* Poem content formatting */
.poem-content {
  white-space: pre-line;
  line-height: 1.8;
}

/* TOC styles */
.toc-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  margin: 0 -0.75rem;
  color: #57534e; /* stone-600 */
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
  font-family: var(--font-serif);
  border-radius: 0.25rem;
}

.toc-entry::after {
  content: '→';
  font-family: system-ui, sans-serif;
  font-size: 0.8em;
  color: transparent;
  transition: color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.toc-entry:hover {
  color: #1c1917; /* stone-900 */
  background-color: #fafaf9; /* stone-50 */
}

.toc-entry:hover::after {
  color: #a8a29e; /* stone-400 */
  transform: translateX(2px);
}

/* Sequential poem navigation */
.poem-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid #e7e5e4;
}

.poem-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
  color: #78716c; /* stone-500 */
  transition: color 0.15s ease;
  max-width: 45%;
}

.poem-nav a:hover {
  color: #1c1917;
}

.poem-nav .nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.poem-nav .nav-title {
  font-family: var(--font-serif);
  font-size: 1rem;
}

.poem-nav .nav-next {
  text-align: right;
  margin-left: auto;
}

/* Prose styles for essay/bio content */
.prose {
  max-width: 65ch;
}

.prose h1,
.prose h2,
.prose h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.prose h1 {
  font-size: 2.5rem;
}

.prose h2 {
  font-size: 1.875rem;
}

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

.prose p {
  margin-bottom: 1.5em;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}
