/* ============================================================
   1. CUSTOM PROPERTIES — Light Theme (default)
   ============================================================ */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-section: #fafafa;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.90);
  --fg: #0f1117;
  --fg-secondary: #4a4f5e;
  --fg-muted: #8b8fa3;
  --primary: #0f1117;
  --primary-foreground: #ffffff;
  --primary-hover: #2d3340;
  --accent: #3b82f6;
  --accent-soft: #eff6ff;
  --accent-glow: rgba(59, 130, 246, 0.12);
  --border: #f0f0f0;
  --border-strong: #e4e4e7;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.10);
  --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);
  --glass-bg: rgba(255, 255, 255, 0.80);
  --glass-border: rgba(255, 255, 255, 0.60);
  --glass-blur: blur(18px);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", SimSun, serif;
}

/* ============================================================
   1b. DARK THEME OVERRIDE
   ============================================================ */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;
  --bg-section: #0f0f12;
  --bg-card: #111114;
  --bg-card-glass: rgba(17, 17, 20, 0.90);
  --fg: #f4f2ec;
  --fg-secondary: #9ca3af;
  --fg-muted: #6b7280;
  --primary: #e2e897;
  --primary-foreground: #090b0f;
  --primary-hover: #d4db78;
  --accent: #9bbcff;
  --accent-soft: rgba(155, 188, 255, 0.08);
  --accent-glow: rgba(155, 188, 255, 0.10);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.20);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.40);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.50);
  --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.40), 0 2px 8px rgba(0, 0, 0, 0.20);
  --glass-bg: rgba(17, 17, 20, 0.80);
  --glass-border: rgba(255, 255, 255, 0.06);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 18% 0%, rgba(155, 188, 255, 0.08), transparent 28rem),
    radial-gradient(circle at 84% 4%, rgba(226, 232, 151, 0.05), transparent 24rem),
    linear-gradient(180deg, #09090b 0%, #0d0d10 48%, #09090b 100%);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

img { display: block; max-width: 100%; }

/* ============================================================
   3. NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color 240ms ease, background 240ms ease, box-shadow 240ms ease;
}

.navbar.scrolled {
  border-bottom-color: var(--border);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
}

:root[data-theme="dark"] .navbar {
  background: rgba(9, 9, 11, 0.80);
}
:root[data-theme="dark"] .navbar.scrolled {
  background: rgba(9, 9, 11, 0.95);
  border-bottom-color: var(--border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 40px);
  min-height: 64px;
  gap: 24px;
}

/* Brand */
.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 760;
  flex-shrink: 0;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #fff;
  background: var(--primary);
  font-size: 15px;
  font-weight: 800;
}

:root[data-theme="dark"] .brand-icon {
  background: #e2e897;
  color: #090b0f;
}

.brand-tagline {
  display: none;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
}
@media (min-width: 721px) {
  .brand-tagline { display: inline; }
}

/* Center nav links */
.navbar-links {
  display: none;
  align-items: center;
  gap: 4px;
}
@media (min-width: 721px) {
  .navbar-links { display: flex; }
}

.navbar-links a {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  color: var(--fg-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: color 160ms ease, background 160ms ease;
}
.navbar-links a:hover { color: var(--fg); background: rgba(0, 0, 0, 0.04); }
.navbar-links a.active {
  color: var(--fg);
  background: rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] .navbar-links a:hover { background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .navbar-links a.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
}

/* Right actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.navbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: var(--fg-secondary);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.navbar-icon-btn:hover { color: var(--fg); background: rgba(0, 0, 0, 0.05); }

:root[data-theme="dark"] .navbar-icon-btn:hover { background: rgba(255, 255, 255, 0.06); }

.navbar-icon-btn svg { width: 20px; height: 20px; }

.btn-subscribe {
  display: none;
  align-items: center;
  padding: 0 20px;
  height: 38px;
  border: none;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, transform 120ms ease;
  white-space: nowrap;
}
.btn-subscribe:hover { background: var(--primary-hover); }
.btn-subscribe:active { transform: scale(0.97); }

:root[data-theme="dark"] .btn-subscribe {
  background: #e2e897;
  color: #090b0f;
}
:root[data-theme="dark"] .btn-subscribe:hover { background: #d4db78; }

@media (min-width: 721px) {
  .btn-subscribe { display: inline-flex; }
}

/* Hamburger */
.navbar-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
@media (min-width: 721px) {
  .navbar-hamburger { display: none; }
}

.navbar-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--fg);
  transition: transform 200ms ease, opacity 200ms ease;
}
.navbar-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-hamburger.open span:nth-child(2) { opacity: 0; }
.navbar-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav overlay */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  top: 64px;
  z-index: 35;
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}
.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

:root[data-theme="dark"] .mobile-nav-overlay { background: rgba(9, 9, 11, 0.98); }

.mobile-nav-overlay a {
  display: block;
  padding: 16px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--fg-secondary);
  font-size: 16px;
  font-weight: 600;
}
.mobile-nav-overlay a.active { color: var(--fg); }
.mobile-nav-overlay .btn-subscribe { display: inline-flex; margin-top: 20px; width: 100%; justify-content: center; height: 44px; }

/* ============================================================
   4. APP SHELL
   ============================================================ */
.app-shell {
  width: min(1240px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 0 0 80px;
}

.loading {
  padding: 64px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 15px;
}

/* ============================================================
   5. HERO SECTION
   ============================================================ */
.hero {
  padding: 0;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Full-width background image behind everything.
   cover + right center: fills the hero height without distortion,
   keeps the sphere fully visible on the right side.
   mask-image fades the left edge so it blends into the page bg naturally. */
.hero-bg-img {
  position: absolute;
  inset: 0;
  background-image: url('./public/hero-bg.png');
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  z-index: 0;
  /* Soft left-edge fade — no hard border, image dissolves into page bg */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    transparent 15%,
    rgba(0,0,0,0.15) 28%,
    rgba(0,0,0,0.55) 40%,
    black 58%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    transparent 15%,
    rgba(0,0,0,0.15) 28%,
    rgba(0,0,0,0.55) 40%,
    black 58%
  );
}

:root[data-theme="dark"] .hero-bg-img {
  opacity: 0.45;
  filter: brightness(0.65) contrast(1.1);
}

/* Remove the old pseudo-element gradient — mask-image handles the fade now */
.hero::after {
  display: none;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1fr;
  min-height: 420px;
  align-items: center;
  padding: clamp(48px, 7vw, 88px) 0 clamp(48px, 7vw, 88px);
}

.hero-copy {
  max-width: 580px;
}

.hero-title {
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: clamp(52px, 7vw, 96px);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.hero-title-dot {
  color: #f97316;
  font-style: normal;
}

.hero-headline {
  margin: 0 0 14px;
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 300;
  line-height: 1.35;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.hero-subtitle {
  margin: 0 0 20px;
  color: var(--fg-muted);
  font-size: clamp(13px, 1.4vw, 15px);
  font-weight: 400;
  line-height: 1.75;
}

/* Hero search — square style */
.hero-search {
  display: flex;
  gap: 0;
  margin-top: 28px;
  max-width: 520px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.hero-search:focus-within {
  border-color: var(--fg);
  box-shadow: 0 0 0 3px rgba(15, 17, 23, 0.08);
}

:root[data-theme="dark"] .hero-search:focus-within {
  border-color: #e2e897;
  box-shadow: 0 0 0 3px rgba(226, 232, 151, 0.10);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 6px 0 16px;
  border: none;
  background: transparent;
  color: var(--fg);
  font-size: 14px;
  outline: none;
}
.hero-search input::placeholder { color: var(--fg-muted); }

.hero-search .btn-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  color: #fff;
  background: var(--fg);
  cursor: pointer;
  transition: background 180ms ease;
  flex-shrink: 0;
}
.hero-search .btn-search:hover { background: #333; }
.hero-search .btn-search svg { width: 17px; height: 17px; }

:root[data-theme="dark"] .hero-search .btn-search {
  background: #e2e897;
  color: #090b0f;
}
:root[data-theme="dark"] .hero-search .btn-search:hover { background: #d4db78; }

/* Topic pills */
.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--fg-secondary);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
}
.topic-pill:hover {
  color: var(--fg);
  border-color: var(--fg);
  background: rgba(15, 17, 23, 0.04);
}
.topic-pill.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}
.pill-icon {
  font-size: 14px;
  line-height: 1;
}
.pill-chevron {
  font-size: 11px;
  opacity: 0.7;
}

:root[data-theme="dark"] .topic-pill:hover { background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .topic-pill.active {
  color: #090b0f;
  border-color: #e2e897;
  background: #e2e897;
}

/* Hero visual — empty placeholder column, bg is on .hero */
.hero-visual {
  min-height: 1px;
}

/* Stats card */
.hero-stats {
  position: absolute;
  bottom: 32px;
  right: 32px;
  z-index: 3;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.80);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

:root[data-theme="dark"] .hero-stats {
  background: rgba(17, 17, 20, 0.88);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.40);
}

.hero-stats-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Green circle icon */
.hero-stats-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  flex-shrink: 0;
}

:root[data-theme="dark"] .hero-stats-icon {
  background: rgba(22, 163, 74, 0.20);
  color: #4ade80;
}

.hero-stats-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hero-stats-item strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.hero-stats-item span {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--fg);
  line-height: 1.2;
}

.hero-stats-divider {
  width: 1px;
  height: 30px;
  background: var(--border-strong);
  flex-shrink: 0;
}

/* ============================================================
   6. FEATURED SECTION
   ============================================================ */
.featured-section {
  margin: 0 0 64px;
  padding: clamp(32px, 5vw, 52px) 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.featured-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 18px;
}

.featured-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.2;
}

.featured-header h2::before {
  content: "✨ ";
}

.featured-header p {
  margin: 6px 0 0;
  color: var(--fg-muted);
  font-size: 13px;
}

.featured-header .view-all {
  flex-shrink: 0;
  color: var(--fg-secondary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.featured-header .view-all:hover {
  background: var(--fg);
  color: #fff;
  border-color: var(--fg);
}

:root[data-theme="dark"] .featured-header .view-all:hover {
  background: #e2e897;
  color: #090b0f;
  border-color: #e2e897;
}

.featured-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* ── Featured card: full-bleed image + glass panel ──────────────────────────
   Structure:
     .featured-card          — outer shell, position:relative, overflow:hidden
       .featured-card-media  — image wrapper, fixed aspect ratio
         img.featured-card-bg
         .featured-card-overlay  — gradient bridge (transparent → dark)
       .featured-card-glass  — text panel, normal flow below media,
                               semi-transparent so card bg bleeds through
   Why backdrop-filter is NOT used on .featured-card-glass:
     The glass panel is in normal flow BELOW the image, not visually overlapping
     it, so blur() has nothing to process. Instead we use:
     1. A gradient overlay on the image bottom half (visual bridge)
     2. A semi-transparent bg on the glass panel (tinted depth)
     3. An inset top highlight + border to separate the two zones
   ─────────────────────────────────────────────────────────────────────────── */

.featured-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;           /* clips image + overlay to rounded corners */
  cursor: pointer;
  background: #111116;        /* card base — shows through semi-transparent glass */
  display: flex;
  flex-direction: column;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

/* ── Media wrapper ── */
.featured-card-media {
  position: relative;         /* stacking context for overlay */
  flex-shrink: 0;
  overflow: hidden;           /* keeps scale(1.03) clipped to media area */
}

.featured-card-bg {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center top;
  transition: transform 400ms ease;
}
.featured-card:hover .featured-card-bg {
  transform: scale(1.04);
}

.featured-card-bg-fallback {
  width: 100%;
  height: 200px;
}
.featured-card:nth-child(1) .featured-card-bg-fallback { background: linear-gradient(135deg, #0f172a, #1e3a5f); }
.featured-card:nth-child(2) .featured-card-bg-fallback { background: linear-gradient(135deg, #052e16, #064e3b); }
.featured-card:nth-child(3) .featured-card-bg-fallback { background: linear-gradient(135deg, #451a03, #78350f); }

/* Gradient bridge — fades image bottom into the glass panel */
.featured-card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 70%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0)    0%,
    rgba(0, 0, 0, 0.20) 35%,
    rgba(0, 0, 0, 0.65) 70%,
    rgba(0, 0, 0, 0.88) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* ── Glass text panel ── */
.featured-card-glass {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 16px;
  /* Semi-transparent: card's #111116 base bleeds through, giving tinted depth */
  background: rgba(8, 8, 12, 0.68);
  /* Top edge highlight separates panel from image */
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Category tag — first item in normal flow, no absolute positioning ── */
.featured-card-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.featured-card:nth-child(1) .featured-card-tag { background: #3b82f6; }
.featured-card:nth-child(2) .featured-card-tag { background: #10b981; }
.featured-card:nth-child(3) .featured-card-tag { background: #f59e0b; }

/* ── Title — fixed 2-line height so cards align below ── */
.featured-card-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: #fff;
  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Reserve space for exactly 2 lines even when title is short */
  min-height: calc(1.45em * 2);
  flex-shrink: 0;
}
.featured-card-title a { color: inherit; text-decoration: none; }

/* ── Source + duration ── */
.featured-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.50);
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}
.meta-dot { opacity: 0.4; }

/* ── Key insight — flex:1 fills remaining space, pushes footer to bottom ── */
.featured-card-insight {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.insight-label {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.80);
}

/* ── Footer — always pinned to bottom ── */
.featured-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  flex-shrink: 0;
}

.featured-card-date {
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px;
}

/* ── Removed: .featured-card-content and .featured-card-top no longer used ── */
.featured-card-content { display: contents; }
.featured-card-top     { display: none; }

.fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.45);
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}
.fav-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.10); }
.fav-btn.favorited { color: #fbbf24; }
.fav-btn svg { width: 16px; height: 16px; }

/* ============================================================
   7. CONTENT LIBRARY (sidebar + grid)
   ============================================================ */
.content-library {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* Sidebar */
.content-sidebar {
  position: sticky;
  top: 84px;
}

.filter-group {
  margin-bottom: 28px;
}

.filter-group h4 {
  margin: 0 0 10px;
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 2px 0;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--fg-secondary);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.filter-option:hover {
  background: var(--bg-section);
  color: var(--fg);
}
.filter-option.active {
  color: var(--fg);
  background: var(--bg-section);
  border-left-color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

:root[data-theme="dark"] .filter-option:hover { background: rgba(255, 255, 255, 0.04); }
:root[data-theme="dark"] .filter-option.active {
  background: rgba(255, 255, 255, 0.06);
  border-left-color: #e2e897;
}

.filter-count {
  margin-left: auto;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
}

/* Content main area */
.content-main {
  min-width: 0;
}

.content-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.content-tab {
  padding: 10px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--fg-muted);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}
.content-tab:hover { color: var(--fg-secondary); }
.content-tab.active {
  color: var(--fg);
  border-bottom-color: var(--primary);
}

:root[data-theme="dark"] .content-tab.active {
  border-bottom-color: #e2e897;
  color: #e2e897;
}

.content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 14px;
}

.content-toolbar .count {
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 600;
}

.btn-filter-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--fg-secondary);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.btn-filter-toggle:hover { background: var(--bg-section); color: var(--fg); }

/* Content grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.content-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.content-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}

.content-card-cover {
  position: relative;
  display: block;
  overflow: hidden;
  height: 160px;
}

.content-card-cover img,
.content-card-cover .cover-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}
.content-card:hover .content-card-cover img,
.content-card:hover .content-card-cover .cover-fallback {
  transform: scale(1.04);
}

.content-card-cover .score-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
}

.content-card-body {
  padding: 16px 18px 18px;
}

.content-card-body h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-card-body h3 a { color: inherit; }
.content-card-body h3 a:hover { color: var(--accent); }

.content-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.content-card-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 10px;
  opacity: 0.5;
}

.content-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.content-card-actions .date {
  color: var(--fg-muted);
  font-size: 12px;
}

.card-action-icons {
  display: flex;
  gap: 2px;
}

.card-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 6px;
  color: var(--fg-muted);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.card-action-btn:hover { color: var(--fg); background: rgba(0, 0, 0, 0.04); }
.card-action-btn.favorited { color: #ef4444; }
.card-action-btn svg { width: 16px; height: 16px; }

:root[data-theme="dark"] .card-action-btn:hover { background: rgba(255, 255, 255, 0.06); }

/* ============================================================
   8. SCORE BADGE (shared)
   ============================================================ */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  background: #374151;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.score-badge.is-excellent { background: #059669; }
.score-badge.is-strong { background: #3b82f6; }
.score-badge.is-steady { background: #f59e0b; }

:root[data-theme="dark"] .score-badge.is-excellent { background: #34d399; color: #064e3b; }
:root[data-theme="dark"] .score-badge.is-strong { background: #60a5fa; color: #1e3a5f; }
:root[data-theme="dark"] .score-badge.is-steady { background: #fbbf24; color: #78350f; }

/* ============================================================
   9. COVER FALLBACKS
   ============================================================ */
.cover-fallback {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
}

/* Category-keyed gradient variants — applied via JS data attributes if present */
.cover-fallback[data-cat="AI Products"],
.cover-fallback[data-cat="AI Coding"] {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
}

.cover-fallback[data-cat="AI Business"],
.cover-fallback[data-cat="AI Organization"] {
  background: linear-gradient(135deg, #052e16, #14532d);
}

.cover-fallback[data-cat="Personal Productivity"] {
  background: linear-gradient(135deg, #451a03, #78350f);
}

.cover-fallback[data-cat="AI Principles"] {
  background: linear-gradient(135deg, #1e1b4b, #4c1d95);
}

:root[data-theme="dark"] .cover-fallback {
  background: linear-gradient(135deg, #0f0c29, #302b63);
}

/* ============================================================
   10. NOTICE / PREVIEW BANNER
   ============================================================ */
.notice {
  margin: 0 0 32px;
  padding: 14px 20px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius);
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 14px;
  line-height: 1.7;
}

:root[data-theme="dark"] .notice {
  border-color: rgba(226, 232, 151, 0.2);
  color: #d8ddb4;
  background: rgba(226, 232, 151, 0.06);
}

/* ============================================================
   11. EMPTY / LOADING
   ============================================================ */
.empty {
  padding: 64px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg-muted);
  background: var(--bg-section);
  text-align: center;
  font-size: 15px;
  line-height: 1.8;
}

.empty a {
  color: var(--fg);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   12. FOOTER
   ============================================================ */
.site-footer {
  margin-top: 80px;
  padding: 52px clamp(18px, 4vw, 56px) 36px;
  border-top: 1px solid var(--border);
  background: var(--bg-section);
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
}

.footer-brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 40px;
}

.footer-left .footer-brand {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--fg);
}

.footer-left .footer-slogan {
  margin: 0;
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.6;
}

.footer-right {
  display: flex;
  gap: 48px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--fg-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 140ms ease;
}
.footer-links a:hover { color: var(--fg); }

.footer-social {
  display: flex;
  gap: 12px;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border);
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}
.footer-social a:hover {
  color: var(--fg);
  background: var(--bg-card);
  border-color: var(--border-strong);
}
.footer-social a svg { width: 18px; height: 18px; }

:root[data-theme="dark"] .footer-social a:hover { background: rgba(255, 255, 255, 0.06); }

.footer-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 24px;
}

.footer-bottom {
  color: var(--fg-muted);
  font-size: 12px;
}

/* ============================================================
   13. GLASS UTILITIES
   ============================================================ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: var(--bg-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
}

/* ============================================================
   14. ARTICLE DETAIL READER
   ============================================================ */
.reader-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 780px);
  justify-content: center;
  gap: 52px;
  align-items: start;
  padding-top: 28px;
}

.reader-rail {
  position: sticky;
  top: 84px;
  padding-top: 10px;
}

.back {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--fg);
  font-weight: 760;
  transition: opacity 160ms ease;
}
.back:hover { opacity: 0.7; }

.rail-title {
  display: block;
  margin-bottom: 14px;
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reader-rail a:not(.back),
.reader-rail em {
  display: block;
  margin: 12px 0;
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.45;
  transition: color 140ms ease;
}
.reader-rail a:not(.back):hover { color: var(--fg); }

.reader-rail a.sub { padding-left: 12px; }

.reader {
  min-width: 0;
  padding-bottom: 84px;
}

.reader-header {
  padding: 0 0 24px;
}

.reader-header h1 {
  margin: 0 0 22px;
  font-family: var(--font-serif);
  font-size: clamp(42px, 6.2vw, 78px);
  font-weight: 700;
  line-height: 1.1;
}

.reader-header p {
  max-width: 720px;
  margin: 0;
  color: var(--fg-secondary);
  font-size: 18px;
  line-height: 1.88;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
}

.reader-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border: none;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, opacity 180ms ease;
}
.reader-actions .button:hover { background: var(--primary-hover); }

:root[data-theme="dark"] .reader-actions .button {
  background: #e2e897;
  color: #090b0f;
}
:root[data-theme="dark"] .reader-actions .button:hover { background: #d4db78; }

.reader-cover {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 10px 0 26px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}

.score-grid div {
  padding: 18px;
  background: var(--bg-card);
}

.score-grid strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-serif);
  font-size: 32px;
}

.score-grid span {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 700;
}

.editor-note,
.insights {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-section);
}

.editor-note {
  padding: 26px;
}

.editor-note span {
  display: block;
  margin-bottom: 12px;
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.editor-note p {
  margin: 0;
  color: var(--fg-secondary);
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-line;
}

.pull-quote {
  margin: 34px 0;
  padding: 28px 32px;
  border: none;
  border-left: 3px solid var(--fg);
  border-radius: 0;
  color: var(--fg);
  background: transparent;
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.8vw, 32px);
  line-height: 1.58;
}

:root[data-theme="dark"] .pull-quote {
  border-left-color: #e2e897;
  color: #e2e897;
}

.insights {
  padding: 28px;
}

.insights h2 {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: 28px;
}

.insights p {
  margin: 14px 0;
  padding-left: 16px;
  border-left: 2px solid var(--border-strong);
  color: var(--fg-secondary);
  font-size: 15px;
  line-height: 1.86;
}

.article-content {
  max-width: 720px;
  margin: 42px auto 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 2;
}

.article-content h1 { display: none; }

.article-content h2 {
  margin: 58px 0 18px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.24;
}

.article-content h3 {
  margin: 38px 0 14px;
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.3;
}

.article-content p,
.article-content li {
  color: var(--fg-secondary);
  font-weight: 400;
}

.article-content blockquote {
  margin: 30px 0;
  padding: 22px 26px;
  border-left: 3px solid var(--fg);
  border-radius: 0;
  color: var(--fg);
  background: var(--bg-section);
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.72;
}

:root[data-theme="dark"] .article-content blockquote {
  border-left-color: #e2e897;
  background: rgba(226, 232, 151, 0.04);
}

.article-content code {
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--fg);
  background: var(--bg-section);
  border: 1px solid var(--border);
  font-size: 0.88em;
}

:root[data-theme="dark"] .article-content code {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
}

/* Meta line (shared between featured + reader) */
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta-line span:not(:last-child)::after {
  content: "/";
  margin-left: 10px;
  opacity: 0.3;
}

/* ============================================================
   15. RESPONSIVE
   ============================================================ */

/* Tablet (<=1080px) */
@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-visual {
    height: 300px;
    order: -1;
  }

  .hero-orbits {
    width: 280px;
    height: 280px;
  }

  .hero-stats {
    position: static;
    margin-top: 20px;
  }

  .featured-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-library {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .content-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }

  .filter-group {
    margin-bottom: 0;
  }

  .filter-group h4 {
    display: none;
  }

  .filter-option {
    display: inline-flex;
    width: auto;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    border-left: 1px solid var(--border-strong);
  }

  .filter-option.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    border-left-color: var(--primary);
    box-shadow: none;
  }

  :root[data-theme="dark"] .filter-option.active {
    border-color: #e2e897;
    background: #e2e897;
    color: #090b0f;
  }

  .filter-count { display: none; }

  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reader-layout {
    grid-template-columns: 1fr;
  }

  .reader-rail {
    position: static;
    margin-bottom: 24px;
  }
}

/* Mobile (<=720px) */
@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 24px, 1240px);
  }

  .navbar-inner {
    padding: 0 16px;
    min-height: 56px;
  }

  .brand-tagline { display: none; }

  .hero {
    padding: 24px 0 32px;
  }

  .hero-title {
    font-size: 42px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .hero-search input {
    height: 46px;
    padding: 0 16px;
    font-size: 14px;
  }

  .hero-search .btn-search {
    height: 46px;
    padding: 0 20px;
    font-size: 14px;
  }

  .topic-pills {
    gap: 8px;
  }

  .topic-pill {
    padding: 6px 14px;
    font-size: 12px;
  }

  .hero-visual {
    height: 200px;
  }

  .hero-orbits {
    width: 200px;
    height: 200px;
  }

  .hero-stats-inner {
    gap: 14px;
  }

  .hero-stats strong {
    font-size: 22px;
  }

  .featured-section {
    padding: 24px 0;
  }

  .featured-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .featured-cards {
    grid-template-columns: 1fr;
  }

  .content-sidebar {
    display: none;
  }

  .btn-filter-toggle {
    display: inline-flex;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .content-tab {
    padding: 8px 14px;
    font-size: 13px;
  }

  .footer-brand-row {
    flex-direction: column;
    gap: 28px;
  }

  .footer-right {
    flex-direction: column;
    gap: 24px;
  }

  .reader-header h1 {
    font-size: 38px;
  }

  .reader-header p,
  .article-content {
    font-size: 16px;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile nav overlay — show sidebar filters as drawer */
.filter-drawer {
  display: none;
  position: fixed;
  inset: 0;
  top: 56px;
  z-index: 35;
  padding: 28px 20px;
  background: var(--bg);
  overflow-y: auto;
}
.filter-drawer.open { display: block; }

.filter-drawer .filter-option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  border-left: 2px solid transparent;
}

.filter-drawer .filter-option.active {
  border-left-color: var(--primary);
  background: var(--bg-section);
}

:root[data-theme="dark"] .filter-drawer .filter-option.active {
  border-left-color: #e2e897;
}

@media (min-width: 721px) {
  .filter-drawer { display: none !important; }
}
