/* ============ STORY PAGE — narrative layer ============ */

/* ---- Nav ---- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(8, 9, 13, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-back, .nav-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-back:hover, .nav-link:hover { color: var(--accent); }

/* ---- Story Hero ---- */
.story-hero {
  text-align: center;
  padding: 10rem 2rem 5rem;
  max-width: 700px;
  margin: 0 auto;
}

.story-hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.story-hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  font-family: 'Lora', serif;
  font-style: italic;
}

/* ---- Chapters ---- */
.chapter {
  max-width: 720px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.chapter-header {
  margin-bottom: 3rem;
}

.chapter-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.chapter-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.chapter-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Chapter body text ---- */
.chapter-body {
  font-family: 'Lora', 'Space Grotesk', serif;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

.chapter-body p {
  margin-bottom: 1.5rem;
}

.chapter-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.chapter-body em {
  color: var(--text-primary);
  font-style: italic;
}

.chapter-body code {
  font-size: 0.8em;
}

/* Drop cap */
.drop-cap::first-letter {
  font-family: var(--font-sans);
  font-size: 3.5em;
  float: left;
  line-height: 0.85;
  margin-right: 0.08em;
  margin-top: 0.05em;
  color: var(--accent);
  font-weight: 700;
}

/* ---- Separator ---- */
.separator {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 2.5rem auto;
}

/* ---- Blockquotes ---- */
.human-quote {
  position: relative;
  margin: 2.5rem 0;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.7;
}

.human-quote.large {
  font-size: 1.3rem;
  text-align: center;
  border-left: none;
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  padding: 2rem;
  background: var(--accent-soft);
}

.discovery {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--orange-soft);
  border: 1px solid rgba(210, 153, 34, 0.2);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-primary);
}

/* ---- Chapter Decisions ---- */
.chapter-decisions {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.chapter-decisions h3 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.chapter-decisions ul {
  list-style: none;
  padding: 0;
}

.chapter-decisions li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.chapter-decisions li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.chapter-decisions li strong {
  color: var(--text-primary);
}

/* ---- Pattern Grid ---- */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.pattern-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pattern-card code {
  font-size: 0.8rem;
  align-self: flex-start;
}

.pattern-card span {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Naming Table ---- */
.naming-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.naming-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  gap: 1rem;
}

.naming-row:last-child { border-bottom: none; }

.naming-concept {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.naming-solved {
  color: var(--text-muted);
  text-align: right;
  font-size: 0.85rem;
}

/* ---- Story Epilogue ---- */
.story-epilogue {
  padding: 6rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.story-epilogue-content {
  max-width: 680px;
  margin: 0 auto;
}

.final-quote {
  font-family: 'Lora', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 3rem;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  position: relative;
}

.final-quote::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--green));
}

.epilogue-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .story-hero { padding: 8rem 1.25rem 3rem; }
  .story-hero h1 { font-size: 2.5rem; }
  .chapter { padding: 4rem 1.25rem 3rem; }
  .chapter-header h2 { font-size: 1.5rem; }
  .human-quote.large { font-size: 1.1rem; }
  .pattern-grid { grid-template-columns: 1fr; }
  .naming-row { flex-direction: column; align-items: flex-start; }
  .naming-solved { text-align: left; }
}
