/* ═══════════ THEME VARIABLES ═══════════ */
  [data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-card: #111;
    --bg-card-hover: #1a1a1a;
    --bg-surface: #161616;
    --bg-ticker: #050505;
    --text-primary: #f0f0f0;
    --text-secondary: #999;
    --text-muted: #555;
    --border: #1e1e1e;
    --border-light: #2a2a2a;
    --accent: #fff;
    --accent-hover: #ddd;
    --accent-bg: #fff;
    --accent-fg: #000;
    --overlay-bg: rgba(0,0,0,0.8);
    --nav-bg: rgba(10,10,10,0.92);
    --gradient-hero: rgba(0,0,0,0.92);
    --cta-bg: linear-gradient(135deg, #151515, #0e0e0e);
    --cta-border: #333;
    --logo-invert: 0;
    --gain: #22c55e;
    --loss: #ef4444;
    --gain-bg: rgba(34,197,94,0.12);
    --loss-bg: rgba(239,68,68,0.12);
  }
  [data-theme="light"] {
    --bg-primary: #f5f5f0;
    --bg-card: #fff;
    --bg-card-hover: #f0efe8;
    --bg-surface: #eae9e3;
    --bg-ticker: #fff;
    --text-primary: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #888;
    --border: #ddd;
    --border-light: #ccc;
    --accent: #1a1a1a;
    --accent-hover: #333;
    --accent-bg: #1a1a1a;
    --accent-fg: #fff;
    --overlay-bg: rgba(255,255,255,0.85);
    --nav-bg: rgba(245,245,240,0.94);
    --gradient-hero: rgba(0,0,0,0.75);
    --cta-bg: linear-gradient(135deg, #f0efe8, #e8e7e0);
    --cta-border: #ccc;
    --logo-invert: 1;
    --gain: #16a34a;
    --loss: #dc2626;
    --gain-bg: rgba(22,163,74,0.1);
    --loss-bg: rgba(220,38,38,0.1);
  }

  /* ═══════════ BASE ═══════════ */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
  }
  a { color: inherit; text-decoration: none; }
  a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
  .sr-only.focusable:focus { position: static; width: auto; height: auto; margin: 8px; padding: 8px 12px; background: var(--bg-card); color: var(--text-primary); border-radius: 6px; z-index: 300; }
  .article-thumb img, .featured-card img, .video-thumb img { filter: grayscale(100%) contrast(1.1); transition: filter 0.3s; }
  .article-row:hover .article-thumb img, .featured-card:hover img, .video-card:hover .video-thumb img { filter: grayscale(50%); }

  /* ═══════════ TICKER ═══════════ */
  .ticker-bar { background: var(--bg-ticker); border-bottom: 1px solid var(--border); overflow: hidden; height: 38px; }
  .ticker-track { display: flex; white-space: nowrap; height: 100%; align-items: center; animation: scroll-ticker 40s linear infinite; }
  .ticker-bar:hover .ticker-track { animation-play-state: paused; }
  @keyframes scroll-ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
  .ticker-item { display: inline-flex; align-items: center; gap: 8px; padding: 0 24px; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500; }
  .ticker-item .symbol { color: var(--text-primary); letter-spacing: 0.5px; }
  .ticker-item .price { color: var(--text-secondary); }
  .ticker-item .change.up { color: var(--gain); }
  .ticker-item .change.down { color: var(--loss); }
  .ticker-item .change.flat { color: var(--text-muted); }
  .ticker-loading { padding: 0 24px; color: var(--text-muted); font-size: 12px; font-family: 'JetBrains Mono', monospace; }

  /* ═══════════ NAV ═══════════ */
  header[role="banner"] { position: sticky; top: 0; z-index: 100; background: var(--nav-bg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); transition: background 0.3s; }
  .nav { display: flex; align-items: center; justify-content: space-between; padding: 0 40px; height: 64px; max-width: 1400px; margin: 0 auto; }
  .nav-logo { font-family: 'DM Serif Display', Georgia, serif; font-size: 22px; color: var(--accent); display: flex; align-items: center; gap: 10px; }
  .nav-logo .logo-icon { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; filter: invert(var(--logo-invert)); }
  .nav-links { display: flex; gap: 28px; align-items: center; }
  .nav-links a { font-size: 13.5px; font-weight: 500; color: var(--text-secondary); transition: color 0.2s; letter-spacing: 0.2px; }
  .nav-links a:hover { color: var(--text-primary); }
  .nav-links a[aria-current="page"] { color: var(--accent); }
  .nav-actions { display: flex; gap: 10px; align-items: center; }
  .btn-icon { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 18px; padding: 8px; border-radius: 6px; transition: background 0.15s, color 0.15s, transform 0.1s; }
  .btn-icon:hover { background: var(--bg-card-hover); color: var(--text-primary); }
  .btn-icon:active { transform: scale(0.95); }
  .btn-subscribe { background: var(--accent-bg); color: var(--accent-fg); border: none; padding: 8px 20px; border-radius: 5px; font-weight: 700; font-size: 13px; cursor: pointer; transition: background 0.2s, transform 0.1s; font-family: inherit; }
  .btn-subscribe:hover { background: var(--accent-hover); transform: scale(1.03); }
  .btn-subscribe:active { transform: scale(0.97); }

  /* Theme toggle */
  .theme-toggle { position: relative; width: 20px; height: 20px; }
  .theme-toggle .icon-sun, .theme-toggle .icon-moon { position: absolute; inset: 0; transition: opacity 0.3s, transform 0.3s; display: flex; align-items: center; justify-content: center; font-size: 16px; }
  [data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0deg); }
  [data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg); }
  [data-theme="light"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg); }
  [data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg); }

  /* Mobile nav */
  .nav-toggle { display: none; }
  .mobile-nav-close { display: none; }
  @media (max-width: 900px) {
    .nav-toggle { display: block; }
    .nav-links {
      display: none; position: absolute; top: 64px; left: 0; right: 0;
      background: var(--bg-primary); flex-direction: column; padding: 16px 24px 12px; gap: 12px;
      border-bottom: 1px solid var(--border); z-index: 99;
    }
    .nav-links.open { display: flex; }
    .mobile-nav-close {
      display: block; align-self: flex-end;
      background: none; border: 1px solid var(--border); color: var(--text-secondary);
      font-size: 12px; padding: 6px 14px; border-radius: 5px; cursor: pointer;
      font-family: inherit; margin-bottom: 4px; transition: background 0.15s, color 0.15s;
    }
    .mobile-nav-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }
  }

  /* ═══════════ SEARCH MODAL ═══════════ */
  .search-overlay { position: fixed; inset: 0; background: var(--overlay-bg); backdrop-filter: blur(6px); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding-top: 100px; }
  .search-overlay.open { display: flex; }
  .search-container { width: 90%; max-width: 600px; animation: slideDown 0.2s ease-out; }
  .search-box { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px; padding: 6px; display: flex; align-items: center; }
  @keyframes slideDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
  .search-box input { flex: 1; background: none; border: none; color: var(--text-primary); font-size: 18px; font-family: inherit; padding: 12px 16px; outline: none; }
  .search-box input::placeholder { color: var(--text-muted); }
  .search-hint { color: var(--text-muted); font-size: 11px; font-family: 'JetBrains Mono', monospace; padding: 0 8px; white-space: nowrap; }
  .search-close { background: none; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; padding: 12px 16px; transition: color 0.15s; }
  .search-close:hover { color: var(--text-primary); }
  /* Search results */
  .search-results { margin-top: 8px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 10px; max-height: 360px; overflow-y: auto; display: none; }
  .search-results.has-results { display: block; }
  .search-result-item { padding: 12px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; }
  .search-result-item:last-child { border-bottom: none; }
  .search-result-item:hover { background: var(--bg-card-hover); }
  .search-result-item .sr-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); font-weight: 600; }
  .search-result-item .sr-title { font-size: 14px; font-weight: 600; margin-top: 2px; }
  .search-no-results { padding: 20px 18px; color: var(--text-muted); font-size: 13px; text-align: center; }

  /* ═══════════ CATEGORY TABS ═══════════ */
  .cat-bar { display: flex; gap: 0; border-bottom: 1px solid var(--border); padding: 0 40px; background: var(--bg-card); overflow-x: auto; scrollbar-width: none; transition: background 0.3s; }
  .cat-bar::-webkit-scrollbar { display: none; }
  .cat-tab { padding: 12px 20px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; border: none; background: none; border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.2s; white-space: nowrap; font-family: inherit; }
  .cat-tab:hover { color: var(--text-secondary); }
  .cat-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

  /* ═══════════ LAYOUT ═══════════ */
  .main-grid { display: grid; grid-template-columns: 1fr 360px; gap: 0; max-width: 1320px; margin: 0 auto; min-height: 100vh; }
  .content-col { padding: 28px 32px; border-right: 1px solid var(--border); }
  .sidebar-col { padding: 28px 24px; }

  /* ═══════════ FEATURED ═══════════ */
  .featured { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 36px; }
  .featured-main { position: relative; border-radius: 10px; overflow: hidden; cursor: pointer; }
  .featured-main img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s; filter: grayscale(100%) contrast(1.1); }
  .featured-main:hover img { transform: scale(1.03); filter: grayscale(60%); }
  .featured-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 28px; background: linear-gradient(transparent, var(--gradient-hero)); }
  .featured-overlay .tag { display: inline-block; background: var(--accent-bg); color: var(--accent-fg); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; padding: 4px 10px; border-radius: 3px; margin-bottom: 10px; }
  .featured-overlay h2 { font-family: 'DM Serif Display', Georgia, serif; font-size: 24px; line-height: 1.3; margin-bottom: 8px; color: #fff; }
  .featured-overlay .meta { font-size: 12px; color: rgba(255,255,255,0.6); }
  .featured-side { display: flex; flex-direction: column; gap: 16px; }
  .featured-card { flex: 1; border-radius: 10px; overflow: hidden; position: relative; cursor: pointer; }
  .featured-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
  .featured-card:hover img { transform: scale(1.03); }
  .featured-card .featured-overlay { padding: 16px; }
  .featured-card .featured-overlay h2 { font-size: 16px; }

  /* ═══════════ SECTION TITLE ═══════════ */
  .section-title { font-family: 'DM Serif Display', Georgia, serif; font-size: 20px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--accent); display: flex; align-items: center; justify-content: space-between; }
  .section-title .see-all { font-family: inherit; font-size: 12px; font-weight: 600; color: var(--accent); }

  /* ═══════════ ARTICLES ═══════════ */
  .article-list { display: flex; flex-direction: column; }
  .article-row { display: grid; grid-template-columns: 160px 1fr; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
  .article-row:hover { background: var(--bg-card); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 8px; }
  .article-thumb { width: 160px; height: 100px; border-radius: 6px; overflow: hidden; }
  .article-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .article-info { display: flex; flex-direction: column; justify-content: center; }
  .article-info .tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--accent); margin-bottom: 6px; }
  .article-info h3 { font-family: 'DM Serif Display', Georgia, serif; font-size: 17px; line-height: 1.35; margin-bottom: 6px; }
  .article-info p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .article-info .meta { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 12px; }
  .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }

  /* ═══════════ VIDEO GRID ═══════════ */
  .video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 36px; }
  .video-card { border-radius: 8px; overflow: hidden; background: var(--bg-card); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; border: 1px solid var(--border); }
  .video-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
  .video-thumb { position: relative; width: 100%; aspect-ratio: 16/9; background: var(--bg-surface); overflow: hidden; }
  .video-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 48px; height: 48px; background: rgba(0,0,0,0.7); border-radius: 50%; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); transition: background 0.2s, transform 0.15s; }
  .video-card:hover .play-btn { background: var(--accent-bg); transform: translate(-50%,-50%) scale(1.1); }
  .play-btn::after { content: ''; width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 14px; border-color: transparent transparent transparent #fff; margin-left: 3px; transition: border-color 0.2s; }
  .video-card:hover .play-btn::after { border-color: transparent transparent transparent var(--accent-fg); }
  .video-duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.85); color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 2px 6px; border-radius: 3px; }
  [data-theme="light"] .video-duration { background: rgba(0,0,0,0.75); }
  .search-result-item:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
  .video-card-info { padding: 14px 16px; }
  .video-card-info h3 { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
  .video-card-info .meta { font-size: 11.5px; color: var(--text-muted); }

  /* ═══════════ SIDEBAR ═══════════ */
  .sidebar-widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; transition: background 0.3s, border-color 0.3s; }
  .widget-title { font-family: 'DM Serif Display', Georgia, serif; font-size: 16px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
  .mover-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-family: 'JetBrains Mono', monospace; font-size: 13px; }
  .mover-row:last-child { border-bottom: none; }
  .mover-symbol { font-weight: 600; color: var(--text-primary); }
  .mover-name { font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; color: var(--text-muted); }
  .mover-price { color: var(--text-secondary); }
  .mover-change { padding: 3px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600; }
  .mover-change.up { background: var(--gain-bg); color: var(--gain); }
  .mover-change.down { background: var(--loss-bg); color: var(--loss); }
  #market-movers-list .loading-placeholder { color: var(--text-muted); font-size: 13px; padding: 16px 0; text-align: center; }
  .trending-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; border-radius: 4px; }
  .trending-item:hover { background: var(--bg-card-hover); }
  .trending-item:last-child { border-bottom: none; }
  .trending-num { font-family: 'DM Serif Display', Georgia, serif; font-size: 22px; color: var(--text-muted); line-height: 1; min-width: 28px; }
  .trending-text h4 { font-size: 13.5px; font-weight: 600; line-height: 1.35; margin-bottom: 3px; }
  .trending-text .meta { font-size: 11px; color: var(--text-muted); }
  .cta-widget { background: var(--cta-bg); border-color: var(--cta-border); text-align: center; }
  .cta-widget .yt-icon { font-size: 40px; margin-bottom: 12px; }
  .cta-widget h3 { font-family: 'DM Serif Display', Georgia, serif; font-size: 19px; margin-bottom: 8px; }
  .cta-widget p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
  .cta-btn { display: inline-block; background: var(--accent-bg); color: var(--accent-fg); padding: 10px 28px; border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; transition: background 0.2s, transform 0.1s; border: none; font-family: inherit; }
  .cta-btn:hover { background: var(--accent-hover); transform: scale(1.04); }
  .cta-btn:active { transform: scale(0.97); }
  .sub-count { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-muted); margin-top: 10px; }

  /* Newsletter */
  .newsletter-form { display: flex; gap: 8px; margin-top: 12px; }
  .newsletter-form input { flex: 1; background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: 5px; padding: 10px 14px; color: var(--text-primary); font-size: 13px; font-family: inherit; outline: none; transition: border-color 0.2s; }
  .newsletter-form input::placeholder { color: var(--text-muted); }
  .newsletter-form input:focus { border-color: var(--accent); }
  .newsletter-form input[aria-invalid="true"] { border-color: var(--loss); }
  .newsletter-form button { background: var(--accent-bg); color: var(--accent-fg); border: none; padding: 10px 16px; border-radius: 5px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; transition: background 0.15s, transform 0.1s; min-width: 56px; display: flex; align-items: center; justify-content: center; gap: 6px; }
  .newsletter-form button:hover { background: var(--accent-hover); transform: scale(1.04); }
  .newsletter-form button:active { transform: scale(0.97); }
  .newsletter-form button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
  /* Spinner */
  @keyframes spin { to { transform: rotate(360deg); } }
  .btn-spinner { width: 14px; height: 14px; border: 2px solid var(--accent-fg); border-top-color: transparent; border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }
  .newsletter-msg { font-size: 12px; margin-top: 8px; min-height: 18px; }
  .newsletter-msg.success { color: var(--gain); }
  .newsletter-msg.error { color: var(--loss); }

  /* ═══════════ FOOTER ═══════════ */
  footer[role="contentinfo"] { background: var(--bg-card); border-top: 1px solid var(--border); padding: 48px 40px 28px; margin-top: 40px; transition: background 0.3s; }
  .footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 40px; max-width: 1320px; margin: 0 auto 32px; }
  .footer-brand .nav-logo { margin-bottom: 12px; }
  .footer-brand p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; max-width: 300px; }
  .footer-col h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); margin-bottom: 14px; font-weight: 600; }
  .footer-col a { display: block; font-size: 13px; color: var(--text-secondary); padding: 4px 0; transition: color 0.2s; }
  .footer-col a:hover { color: var(--accent); }
  .footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; max-width: 1320px; margin: 0 auto; display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

  /* ═══════════ ANIMATIONS ═══════════ */
  @keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
  .content-col > * { animation: fadeUp 0.5s ease-out both; }
  .content-col > *:nth-child(1) { animation-delay: 0s; }
  .content-col > *:nth-child(2) { animation-delay: 0.07s; }
  .content-col > *:nth-child(3) { animation-delay: 0.14s; }
  .content-col > *:nth-child(4) { animation-delay: 0.21s; }
  .sidebar-widget { animation: fadeUp 0.5s ease-out both; }
  .sidebar-widget:nth-child(1) { animation-delay: 0.1s; }
  .sidebar-widget:nth-child(2) { animation-delay: 0.18s; }
  .sidebar-widget:nth-child(3) { animation-delay: 0.26s; }
  .sidebar-widget:nth-child(4) { animation-delay: 0.34s; }

  /* ═══════════ RESPONSIVE ═══════════ */
  @media (max-width: 1024px) {
    .main-grid { grid-template-columns: 1fr; }
    .sidebar-col { border-top: 1px solid var(--border); }
    .content-col, .sidebar-col { padding: 20px; }
    .nav { padding: 0 20px; }
    .cat-bar { padding: 0 20px; }
    .featured { grid-template-columns: 1fr; }
    footer[role="contentinfo"] { padding: 32px 20px 24px; }
  }
  @media (max-width: 640px) {
    .video-grid { grid-template-columns: 1fr; }
    .article-row { grid-template-columns: 1fr; }
    .article-thumb { width: 100%; height: 180px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; gap: 8px; }
  }

  /* ═══════════ THEME-EXPLICIT OVERRIDES ═══════════ */
  .featured-overlay h2, .featured-overlay .meta { color: #fff; }
  [data-theme="light"] .featured-overlay h2 { color: #fff; }
  [data-theme="light"] .featured-overlay .meta { color: rgba(255,255,255,0.7); }

  /* ═══════════ ACCESSIBILITY: REDUCED MOTION ═══════════ */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
    .ticker-track {
      animation: none !important;
      transform: none !important;
      overflow-x: auto;
    }
  }
