/* ============================================
   CSS RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ============================================
   THEME VARIABLES
   ============================================ */
:root {
  --bg-primary: #fafafa;
  --bg-card: #ffffff;
  --border-subtle: #e5e7eb;
  --border-hover: #d1d5db;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --source-wirecutter: #2563eb;
  --source-bytebytego: #7c3aed;
  --source-bon-appetit: #dc2626;
  --diagram-bg: #ffffff;
  --diagram-border: #7c3aed;
  --diagram-text: #5b21b6;
  --diagram-arrow: #7c3aed;
}

[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-card: #1a1a1a;
  --border-subtle: #2a2a2a;
  --border-hover: #404040;
  --text-primary: #f5f5f5;
  --text-secondary: #e0e0e0;
  --text-muted: #a0a0a0;
  --text-light: #808080;
  --accent-blue: #60a5fa;
  --accent-blue-hover: #93c5fd;
  --source-wirecutter: #60a5fa;
  --source-bytebytego: #a78bfa;
  --source-bon-appetit: #f87171;
  --diagram-bg: #2d2640;
  --diagram-border: #8b5cf6;
  --diagram-text: #c4b5fd;
  --diagram-arrow: #8b5cf6;
}

/* ============================================
   LAYOUT
   ============================================ */
.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

/* Focus styles for keyboard navigation */
.theme-toggle:focus-visible,
.header-cta:focus-visible,
.hero-cta:focus-visible,
.read-more:focus-visible,
.footer-links a:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

.header-cta {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.header-cta:hover {
  color: var(--accent-blue);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 80px 0 64px;
  text-align: center;
}

.hero-headline {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 48px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  letter-spacing: -0.02em;
}

.hero-subhead {
  font-size: 20px;
  color: var(--text-secondary);
  margin: 0 0 40px 0;
  line-height: 1.5;
}

.hero-cta {
  display: inline-block;
  background: var(--accent-blue);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.hero-cta:hover {
  background: var(--accent-blue-hover);
}

.hero-cta:active {
  transform: scale(0.98);
}

/* ============================================
   DEMO SECTION
   ============================================ */
.demo-section {
  padding: 0 0 80px;
}

.demo-label {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.demo-digest {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.demo-date {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.01em;
}

.demo-count {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ============================================
   NEWSLETTER CARDS
   ============================================ */
.newsletter-card {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.newsletter-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.newsletter-card:first-child {
  padding-top: 0;
}

.card-image-placeholder {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Wirecutter-style placeholder */
.card-image-placeholder.wirecutter {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

[data-theme="dark"] .card-image-placeholder.wirecutter {
  background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
}

.card-image-placeholder.wirecutter span {
  font-size: 40px;
  letter-spacing: 16px;
  opacity: 0.7;
}

/* ByteByteGo-style placeholder */
.card-image-placeholder.bytebytego {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px;
}

[data-theme="dark"] .card-image-placeholder.bytebytego {
  background: linear-gradient(135deg, #1a1625 0%, #221d2e 100%);
}

.diagram-box {
  background: var(--diagram-bg);
  border: 2px solid var(--diagram-border);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--diagram-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.diagram-arrow {
  color: var(--diagram-arrow);
  font-size: 20px;
}

.newsletter-source {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.newsletter-source.wirecutter {
  color: var(--source-wirecutter);
}

.newsletter-source.bytebytego {
  color: var(--source-bytebytego);
}

.newsletter-source.bon-appetit {
  color: var(--source-bon-appetit);
}

.newsletter-headline {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.01em;
}

.newsletter-meta {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.newsletter-summary {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

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

.newsletter-usefulness {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 12px;
  font-style: italic;
}

.read-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-blue);
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}

/* ============================================
   BOTTOM CTA
   ============================================ */
.bottom-cta {
  padding: 64px 0 80px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

.bottom-cta-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  color: var(--text-primary);
  margin: 0 0 24px 0;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .hero {
    padding: 48px 0 40px;
  }

  .hero-headline {
    font-size: 32px;
  }

  .hero-subhead {
    font-size: 17px;
  }

  .demo-digest {
    padding: 24px 20px;
  }

  .demo-date {
    font-size: 24px;
  }

  .newsletter-headline {
    font-size: 19px;
  }

  .card-image-placeholder {
    height: 140px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* ============================================
   NOTIFICATION ANIMATIONS
   ============================================ */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}
