/* Modern Editorial & Developer Theme with Dark/Light Support */
:root {
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent-gold: #f59e0b;
  --header-bg: rgba(255, 255, 255, 0.85);
  --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-canvas: #090d16;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #1f293d;
  --border-focus: #60a5fa;
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-light: rgba(56, 189, 248, 0.12);
  --accent-gold: #fbbf24;
  --header-bg: rgba(9, 13, 22, 0.85);
  --hero-gradient: linear-gradient(135deg, #090d16 0%, #172554 100%);
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  --card-shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-canvas);
  line-height: 1.65;
  font-size: 15.5px;
  transition: background-color 0.25s, color 0.25s;
}

/* Header */
.modern-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.25s, border-color 0.25s;
}

.header-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo-container {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(252, 194, 27, 0.2) 0%, rgba(252, 194, 27, 0.05) 100%);
  border: 1px solid rgba(252, 194, 27, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(252, 194, 27, 0.2);
}

.brand-logo {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.nav-cluster {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-item a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.nav-item a:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.nav-item a.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

/* Theme Switcher Button */
.theme-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-btn:hover {
  border-color: var(--border-focus);
  transform: scale(1.05);
}

.theme-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.mobile-nav-toggle {
  display: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
}

/* Modern Hero */
.modern-hero {
  position: relative;
  background: var(--hero-gradient);
  color: #ffffff;
  padding: 96px 24px 80px 24px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}

.hero-quote {
  font-size: 38px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.6px;
  margin-bottom: 18px;
}

.hero-quote span {
  background: linear-gradient(135deg, #ffffff 30%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-author {
  font-size: 16px;
  color: #94a3b8;
  font-style: italic;
}

/* Home Quick Links Showcase */
.showcase-section {
  max-width: 1140px;
  margin: 40px auto 80px auto;
  padding: 0 24px;
}

.showcase-header {
  text-align: center;
  margin-bottom: 36px;
}

.showcase-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}

.showcase-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.showcase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none !important;
  color: inherit !important;
  box-shadow: var(--card-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.showcase-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--card-shadow-hover);
}

.showcase-card-icon {
  font-size: 28px;
  margin-bottom: 14px;
}

.showcase-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.showcase-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 18px;
  flex-grow: 1;
}

.showcase-card-arrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Interior Pages Main Layout */
.main-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 44px 24px 88px 24px;
}

.content-section h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--text-main);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.content-section h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-main);
  margin-top: 40px;
  margin-bottom: 16px;
  scroll-margin-top: 90px;
}

.content-section p {
  margin-bottom: 18px;
  color: var(--text-secondary);
}

.content-section a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed var(--primary);
  transition: border-bottom 0.15s;
}

.content-section a:hover {
  border-bottom: 1px solid var(--primary);
}

.content-section ul, .content-section ol {
  margin: 0 0 20px 24px;
}

.content-section li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* Quick Jump Pill Navigation */
.quick-jump-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 32px;
  box-shadow: var(--card-shadow);
}

.quick-jump-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  margin-right: 6px;
}

.quick-jump-link {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 16px;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  border-bottom: none !important;
  transition: all 0.2s;
}

.quick-jump-link:hover {
  background: var(--primary-light);
  color: var(--primary) !important;
}

/* Modern Embed Container */
.embed-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  margin: 28px 0 44px 0;
  box-shadow: var(--card-shadow);
}

.embed-bar {
  background: var(--bg-surface-elevated);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.embed-open-btn {
  color: var(--primary) !important;
  text-decoration: none !important;
  font-weight: 600;
  border-bottom: none !important;
  font-size: 13px;
}

.embed-iframe-wrap {
  position: relative;
  width: 100%;
  height: 560px;
  background: #000000;
}

.embed-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Modern Media Cards */
.media-card-wrapper {
  margin: 28px 0;
}

.media-card {
  display: inline-flex;
  flex-direction: column;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none !important;
  color: inherit !important;
  border-bottom: none !important;
  box-shadow: var(--card-shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.media-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--card-shadow-hover);
}

.media-card-img-wrap {
  width: 100%;
  height: 260px;
  overflow: hidden;
  background: var(--bg-surface-elevated);
}

.media-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.media-card:hover .media-card-img {
  transform: scale(1.03);
}

.media-card-info {
  padding: 18px 20px;
}

.media-card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.media-card-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.media-card-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Github Card */
.github-card {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 560px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  text-decoration: none !important;
  color: inherit !important;
  border-bottom: none !important;
  box-shadow: var(--card-shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.github-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--card-shadow-hover);
}

.github-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  object-fit: cover;
}

.github-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.github-card-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 6px 0 10px 0;
  line-height: 1.5;
}

.github-card-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* Modern Comparison Tables */
.price-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.comparison-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.comparison-header {
  background: var(--bg-surface-elevated);
  padding: 12px 18px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table td {
  padding: 12px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.highlight-warn {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.highlight-best {
  background: rgba(16, 185, 129, 0.12);
}

.highlight-good {
  background: rgba(16, 185, 129, 0.06);
}

.text-success {
  color: #10b981;
}

.font-bold {
  font-weight: 600;
  color: var(--text-main);
}

/* Callout and Protocol Boxes */
.protocol-box, .tldr-box, .tip-card, .technical-note {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px 24px;
  margin: 24px 0;
  box-shadow: var(--card-shadow);
}

.protocol-box {
  border-left: 4px solid var(--primary);
}

.tip-card {
  border-left: 4px solid var(--accent-gold);
}

.technical-note {
  border-left: 4px solid #8b5cf6;
  font-size: 14.5px;
}

.protocol-title, .tldr-header, .tip-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin: 24px 0;
}

.card-list .card-item {
  background: var(--bg-surface);
  padding: 16px 20px;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  margin-bottom: 14px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.eclipse-links-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--card-shadow);
}

.eclipse-links-box h2 {
  margin: 10px 0;
  font-size: 17px;
}

/* Footer */
.modern-footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--bg-surface);
}

.modern-footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.modern-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.modern-footer-links a:hover {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 860px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  }

  .nav-links.show {
    display: flex;
  }

  .mobile-nav-toggle {
    display: block;
  }

  .hero-quote {
    font-size: 28px;
  }

  .embed-iframe-wrap {
    height: 400px;
  }
}
