/* bios — biographical media platform */
/* Premium editorial design for biographical content */

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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  --color-bg: #faf9f6;
  --color-surface: #ffffff;
  --color-text: #111111;
  --color-text-secondary: #4a4a4a;
  --color-text-muted: #8a8a8a;
  --color-border: #e8e6e1;
  --color-border-light: #f0eeea;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.06), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 24px 48px rgba(0,0,0,0.08);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --max-width: 720px;
  --max-width-wide: 1200px;

  --cat-actors: #dc2626;
  --cat-athletes: #2563eb;
  --cat-business: #059669;
  --cat-companies: #7c3aed;
  --cat-fictional: #ea580c;
  --cat-historical: #0d9488;
  --cat-musicians: #d97706;
  --cat-sports-teams: #475569;
}

html {
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

/* ========================================
   HEADER
   ======================================== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}

.site-header-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-logo span {
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 100px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

/* ========================================
   LAYOUT
   ======================================== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 2.5rem 1.5rem; }
.container-wide { max-width: var(--max-width-wide); margin: 0 auto; padding: 2.5rem 1.5rem; }

/* ========================================
   HERO — Person Pages
   ======================================== */
.hero {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 3rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--hero-accent, var(--color-accent));
}

.hero-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.hero-category {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-subcategory {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1.5px solid;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.hero-dates {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  font-weight: 500;
}

.hero-summary {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  line-height: 1.75;
  max-width: 600px;
}

/* ========================================
   TABLE OF CONTENTS
   ======================================== */
.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-xs);
}

.toc h2 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 0.9rem;
}

.toc-list { list-style: none; counter-reset: toc; }
.toc-list li {
  margin-bottom: 0.4rem;
  counter-increment: toc;
}
.toc-list li::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-right: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.toc-list a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s;
}
.toc-list a:hover { color: var(--color-accent); }

/* ========================================
   CHAPTER CONTENT
   ======================================== */
.chapter {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 2.5rem 3rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border-light);
}

.chapter h1, .chapter h2 {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.chapter h1:first-child, .chapter h2:first-child { margin-top: 0; }

.chapter h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.chapter h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
  color: var(--color-text-secondary);
}

.chapter p {
  margin-bottom: 1.1rem;
  line-height: 1.8;
  color: var(--color-text);
}

.chapter ul, .chapter ol {
  margin: 0.75rem 0 1.25rem 1.25rem;
  line-height: 1.8;
}
.chapter li {
  margin-bottom: 0.4rem;
  padding-left: 0.25rem;
}
.chapter li::marker {
  color: var(--color-text-muted);
}

.chapter strong { font-weight: 600; }

.chapter em { font-style: italic; }

.chapter blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--color-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-secondary);
  font-style: italic;
}
.chapter blockquote p { margin-bottom: 0; }

.chapter a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}
.chapter a:hover {
  color: var(--color-accent-hover);
}

.chapter hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 2rem 0;
}

.chapter code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--color-text-secondary);
}

/* Tables — biographical data */
.chapter table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.92rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.chapter thead th {
  background: var(--color-bg);
  font-weight: 600;
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 2px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chapter tbody td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}

.chapter tbody tr:last-child td {
  border-bottom: none;
}

.chapter tbody tr:hover {
  background: var(--color-bg);
}

.chapter tbody td:first-child {
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* ========================================
   RELATED PEOPLE
   ======================================== */
.related {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--color-border);
}

.related h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.related-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.related-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.related-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.related-card .related-dates {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ========================================
   SUBCATEGORY NAVIGATION
   ======================================== */
.subcategory-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.subcategory-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.95rem;
  border: 1.5px solid;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.subcategory-pill:hover {
  color: #fff !important;
  transform: translateY(-1px);
}

.pill-count {
  font-size: 0.72rem;
  opacity: 0.6;
  font-weight: 500;
}

/* ========================================
   CARD SYSTEM
   ======================================== */
.card-subcat {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.person-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.person-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--color-border));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.person-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.person-card:hover::before {
  opacity: 1;
}

.person-card h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.person-card .card-dates {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.person-card .card-summary {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   CATEGORY PAGE
   ======================================== */
.category-header {
  margin-bottom: 2.5rem;
}

.category-header h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0.75rem;
}

.category-header .count {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

/* ========================================
   HOMEPAGE
   ======================================== */
.home-hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.home-hero h1 {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.home-hero h1 span {
  color: var(--color-accent);
}

.home-hero p {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}

.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--card-color, var(--color-accent));
  border-radius: 4px 0 0 4px;
}

.category-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: transparent;
}

.category-card .cat-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.category-card h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.category-card .cat-count {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.home-section-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 3rem 0 1.25rem;
  color: var(--color-text);
}

/* ========================================
   DOORWAY PAGE (Tier 1 — Premium .bio)
   ======================================== */
.doorway-hero {
  text-align: center;
  padding: 5rem 2rem;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.doorway-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--doorway-accent, var(--color-accent));
}

.doorway-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at top, var(--doorway-glow, rgba(37,99,235,0.03)) 0%, transparent 70%);
  pointer-events: none;
}

.doorway-hero h1 {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  line-height: 1.1;
  position: relative;
}

.doorway-hero .dates {
  font-size: 1.3rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  font-weight: 500;
  position: relative;
}

.doorway-hero .summary {
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
  position: relative;
}

.doorway-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-accent);
  color: #fff;
  padding: 0.85rem 2.25rem;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
  position: relative;
}

.doorway-cta:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}

.doorway-cta::after {
  content: '\2192';
  transition: transform 0.2s ease;
}

.doorway-cta:hover::after {
  transform: translateX(3px);
}

.doorway-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.doorway-highlights .highlight {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.doorway-highlights .highlight:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.doorway-highlights .highlight h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.doorway-highlights .highlight p {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  margin-top: 5rem;
  padding: 2.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--color-border);
}
.site-footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer a:hover { color: var(--color-accent); }

/* ========================================
   BACK LINK
   ======================================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--color-accent); }
.back-link::before { content: '\2190'; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  html { font-size: 16px; }

  .container, .container-wide { padding: 1.5rem 1rem; }

  .site-header { padding: 0 1rem; }
  .site-header-inner { height: 52px; }
  .site-logo { font-size: 1.2rem; }
  .site-nav { gap: 0; }
  .site-nav a { font-size: 0.8rem; padding: 0.35rem 0.5rem; }

  .hero { padding: 2rem 1.5rem; border-radius: var(--radius-md); }
  .hero h1 { font-size: 2rem; }
  .hero-summary { font-size: 1rem; }

  .chapter { padding: 1.5rem; border-radius: var(--radius-sm); }
  .chapter h1, .chapter h2 { font-size: 1.35rem; }
  .chapter table { font-size: 0.85rem; }
  .chapter thead th, .chapter tbody td { padding: 0.5rem 0.7rem; }

  .doorway-hero { padding: 3rem 1.25rem; border-radius: var(--radius-lg); }
  .doorway-hero h1 { font-size: 2.5rem; }
  .doorway-hero .summary { font-size: 1.05rem; }

  .home-hero h1 { font-size: 2.5rem; }
  .home-hero p { font-size: 1rem; }

  .people-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .doorway-highlights { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }

  .category-header h1 { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .doorway-hero h1 { font-size: 2rem; }
  .hero h1 { font-size: 1.75rem; }
}

/* ========================================
   PRINT
   ======================================== */
@media print {
  .site-header, .site-footer, .toc, .related, .site-nav, .doorway-cta { display: none; }
  .chapter { border: none; box-shadow: none; padding: 0; margin-bottom: 1rem; border-radius: 0; }
  .hero { border: none; box-shadow: none; border-radius: 0; }
  .hero::before { display: none; }
  body { background: #fff; }
  .container { max-width: 100%; padding: 0; }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@media (prefers-reduced-motion: no-preference) {
  .person-card, .category-card, .related-card, .highlight, .doorway-cta {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
}
