:root {
  --bg: #070812;
  --bg-soft: #0c0e1c;
  --panel: rgba(16, 18, 35, .78);
  --panel-solid: #111425;
  --panel-2: #171a2f;
  --text: #f5f7ff;
  --muted: #9ca3bd;
  --line: rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.17);
  --violet: #8b5cf6;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --green: #34d399;
  --shadow: 0 30px 80px rgba(0,0,0,.35);
  --radius: 24px;
  --container: 1220px;
}

html[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #edf0f7;
  --panel: rgba(255,255,255,.86);
  --panel-solid: #fff;
  --panel-2: #f0f2f8;
  --text: #111525;
  --muted: #687087;
  --line: rgba(17,21,37,.10);
  --line-strong: rgba(17,21,37,.18);
  --shadow: 0 30px 80px rgba(38,45,73,.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -10%, rgba(139,92,246,.22), transparent 35%),
    radial-gradient(circle at 88% 8%, rgba(34,211,238,.13), transparent 28%),
    var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }
.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 99; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(20px);
}
.header-inner { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: max-content; }
.brand-mark { width: 38px; height: 38px; position: relative; display: grid; place-items: center; }
.brand-mark::before { content:""; position:absolute; inset:2px; border-radius: 12px; background: linear-gradient(135deg, var(--violet), var(--blue) 55%, var(--cyan)); box-shadow: 0 8px 24px rgba(99,102,241,.38); transform: rotate(10deg); }
.brand-mark i { position: absolute; width: 4px; border-radius: 999px; background: white; z-index: 1; transform: rotate(10deg); }
.brand-mark i:nth-child(1){ height: 12px; left: 12px; top: 15px; }
.brand-mark i:nth-child(2){ height: 20px; left: 18px; top: 10px; }
.brand-mark i:nth-child(3){ height: 15px; left: 24px; top: 13px; }
.brand-copy { display:flex; flex-direction:column; line-height:1; gap:5px; }
.brand-copy strong { font-size: 14px; letter-spacing: -.02em; }
.brand-copy span { font-size: 10px; font-weight: 800; letter-spacing: .24em; color: var(--cyan); }
.desktop-nav { display:flex; align-items:center; gap:30px; margin-left:auto; }
.desktop-nav a { color:var(--muted); font-size:14px; transition:.2s; }
.desktop-nav a:hover { color:var(--text); }
.header-actions { display:flex; align-items:center; gap:10px; }
.icon-button, .refresh-button {
  border:1px solid var(--line); background:var(--panel); border-radius:14px; cursor:pointer;
  transition:.2s ease; display:inline-flex; align-items:center; justify-content:center;
}
.icon-button { width:42px; height:42px; }
.refresh-button { min-height:42px; padding:0 16px; gap:9px; font-size:13px; font-weight:750; background:linear-gradient(135deg, rgba(139,92,246,.18), rgba(59,130,246,.18)); }
.icon-button:hover, .refresh-button:hover { transform:translateY(-1px); border-color:var(--line-strong); }
.refresh-button.is-loading .refresh-icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

.hero { padding-top: 72px; padding-bottom: 56px; }
.hero-topline { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:30px; }
.live-pill { display:inline-flex; align-items:center; gap:8px; color:#d7dbea; font-weight:800; font-size:11px; letter-spacing:.17em; }
html[data-theme="light"] .live-pill { color:#3f465b; }
.live-pill i { width:7px; height:7px; border-radius:50%; background:var(--green); box-shadow:0 0 0 5px rgba(52,211,153,.12); animation:pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow:0 0 0 9px rgba(52,211,153,0); } }
.updated-text { color:var(--muted); font-size:12px; }
.hero-copy { max-width:920px; }
.eyebrow { margin:0 0 12px; color:var(--cyan); font-size:11px; font-weight:850; letter-spacing:.18em; }
.hero h1 { margin:0; font-size:clamp(48px, 7vw, 94px); line-height:.97; letter-spacing:-.065em; font-weight:840; }
.hero h1 em { font-style:normal; color:transparent; -webkit-text-stroke:1px rgba(255,255,255,.34); }
html[data-theme="light"] .hero h1 em { -webkit-text-stroke:1px rgba(17,21,37,.35); }
.hero-description { max-width:760px; margin:26px 0 0; color:var(--muted); font-size:17px; line-height:1.75; }

.lead-story { margin-top:54px; display:grid; grid-template-columns:minmax(0,1.4fr) minmax(330px,.85fr); min-height:470px; border:1px solid var(--line); border-radius:32px; overflow:hidden; background:var(--panel); box-shadow:var(--shadow); }
.lead-media, .card-media { position:relative; overflow:hidden; background:#101326; }
.lead-media img, .card-media img { width:100%; height:100%; object-fit:cover; transition:transform .55s ease; }
.lead-story:hover .lead-media img, .news-card:hover .card-media img { transform:scale(1.025); }
.lead-media::after, .card-media::after { content:""; position:absolute; inset:0; background:linear-gradient(to top, rgba(7,8,18,.52), transparent 55%); pointer-events:none; }
.media-fallback { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; background:
  radial-gradient(circle at 30% 20%, rgba(139,92,246,.62), transparent 40%),
  radial-gradient(circle at 80% 76%, rgba(34,211,238,.35), transparent 32%),
  linear-gradient(135deg, #11152c, #070812); }
.media-fallback::before { content:""; width:180px; height:180px; border:1px solid rgba(255,255,255,.13); border-radius:50%; position:absolute; box-shadow:0 0 0 28px rgba(255,255,255,.025), 0 0 0 58px rgba(255,255,255,.02); }
.media-fallback span { font-size:74px; font-weight:900; letter-spacing:-.08em; position:relative; color:white; text-shadow:0 12px 40px rgba(0,0,0,.35); }
.media-fallback small { position:relative; font-weight:700; color:rgba(255,255,255,.65); }
.lead-media img + .media-fallback, .card-media img + .media-fallback { display:none; }
.image-failed .media-fallback { display:flex !important; }
.lead-badge { position:absolute; z-index:2; left:22px; top:22px; border:1px solid rgba(255,255,255,.22); background:rgba(7,8,18,.6); color:white; backdrop-filter:blur(12px); border-radius:999px; padding:8px 12px; font-size:10px; font-weight:850; letter-spacing:.14em; }
.lead-content { padding:48px 44px; display:flex; flex-direction:column; justify-content:center; }
.story-meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px; color:var(--muted); font-size:11px; font-weight:700; letter-spacing:.02em; }
.source-dot { width:7px; height:7px; border-radius:50%; background:var(--violet); }
.meta-separator { opacity:.45; }
.ai-badge { padding:3px 7px; border-radius:6px; background:rgba(34,211,238,.12); color:var(--cyan); font-size:9px; font-weight:900; letter-spacing:.08em; }
.lead-content h2 { margin:18px 0; font-size:clamp(30px,3.3vw,47px); line-height:1.08; letter-spacing:-.045em; }
.lead-content h2 a:hover, .card-body h3 a:hover { color:#c4b5fd; }
.lead-content p { margin:0 0 30px; color:var(--muted); font-size:15px; line-height:1.8; }
.read-link { display:inline-flex; align-items:center; gap:9px; font-size:13px; font-weight:800; color:var(--text); }
.read-link span { color:var(--cyan); }
.empty-hero { margin-top:52px; min-height:260px; border:1px dashed var(--line-strong); border-radius:28px; display:flex; align-items:center; justify-content:center; gap:34px; background:var(--panel); padding:40px; }
.empty-hero h2 { margin:0 0 8px; }
.empty-hero p { margin:0; color:var(--muted); max-width:650px; }
.empty-orbit { width:90px; height:90px; border:1px solid rgba(139,92,246,.5); border-radius:50%; position:relative; box-shadow:0 0 0 17px rgba(139,92,246,.08), 0 0 0 34px rgba(59,130,246,.04); }
.empty-orbit::after { content:""; width:12px; height:12px; background:var(--cyan); border-radius:50%; position:absolute; left:2px; top:10px; box-shadow:0 0 18px var(--cyan); }

.dashboard-strip { border-block:1px solid var(--line); background:rgba(255,255,255,.018); }
.stats-grid { min-height:126px; display:grid; grid-template-columns:repeat(4,1fr); }
.stats-grid > div { display:flex; flex-direction:column; justify-content:center; padding:22px 34px; border-right:1px solid var(--line); }
.stats-grid > div:first-child { border-left:1px solid var(--line); }
.stats-grid strong { font-size:30px; line-height:1; letter-spacing:-.04em; }
.stats-grid span { color:var(--muted); font-size:12px; margin-top:8px; }

.news-section { padding-top:80px; padding-bottom:100px; }
.section-heading { display:flex; align-items:end; justify-content:space-between; gap:28px; margin-bottom:30px; }
.section-heading h2 { margin:0; font-size:clamp(32px,4vw,52px); line-height:1; letter-spacing:-.045em; }
.section-note { margin:0; max-width:500px; color:var(--muted); font-size:13px; line-height:1.7; text-align:right; }
.view-switch { display:flex; padding:4px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.view-switch button { width:36px; height:32px; border:0; border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; }
.view-switch button.active { background:var(--panel-2); color:var(--text); }
.filters { display:grid; grid-template-columns:minmax(260px,1fr) 190px 190px auto; gap:10px; margin-bottom:28px; }
.search-box, .filters select, .language-filter { min-height:48px; border:1px solid var(--line); border-radius:14px; background:var(--panel); }
.search-box { display:flex; align-items:center; gap:10px; padding:0 15px; }
.search-box span { color:var(--muted); font-size:21px; }
.search-box input { width:100%; border:0; outline:0; background:transparent; color:var(--text); }
.search-box input::placeholder { color:color-mix(in srgb, var(--muted) 72%, transparent); }
.filters select { padding:0 14px; color:var(--text); outline:none; }
.filters select option { background:var(--panel-solid); }
.language-filter { display:flex; align-items:center; padding:4px; }
.language-filter button { height:38px; padding:0 12px; border:0; border-radius:9px; background:transparent; color:var(--muted); font-size:11px; font-weight:800; cursor:pointer; }
.language-filter button.active { background:linear-gradient(135deg, rgba(139,92,246,.24), rgba(59,130,246,.18)); color:var(--text); }
.news-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.news-card { min-width:0; display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--line); border-radius:22px; background:var(--panel); transition:.25s ease; }
.news-card:hover { transform:translateY(-5px); border-color:var(--line-strong); box-shadow:0 24px 60px rgba(0,0,0,.22); }
.card-media { height:215px; }
.card-media .media-fallback span { font-size:44px; }
.card-media .media-fallback::before { width:110px; height:110px; box-shadow:0 0 0 18px rgba(255,255,255,.025),0 0 0 38px rgba(255,255,255,.018); }
.variant-2 { background:radial-gradient(circle at 25% 20%,rgba(34,211,238,.46),transparent 38%),linear-gradient(135deg,#121a2a,#090b16); }
.variant-3 { background:radial-gradient(circle at 80% 20%,rgba(236,72,153,.42),transparent 38%),linear-gradient(135deg,#1a1024,#090b16); }
.variant-4 { background:radial-gradient(circle at 30% 78%,rgba(52,211,153,.38),transparent 40%),linear-gradient(135deg,#0e211f,#090b16); }
.variant-5 { background:radial-gradient(circle at 70% 70%,rgba(245,158,11,.35),transparent 40%),linear-gradient(135deg,#21170e,#090b16); }
.category-chip { position:absolute; left:14px; bottom:14px; z-index:2; border:1px solid rgba(255,255,255,.18); background:rgba(7,8,18,.58); backdrop-filter:blur(12px); color:white; border-radius:999px; padding:6px 9px; font-size:9px; font-weight:850; letter-spacing:.04em; }
.card-body { padding:22px; display:flex; flex-direction:column; flex:1; }
.source-name { color:#c4b5fd; }
.card-body h3 { margin:13px 0 12px; font-size:20px; line-height:1.25; letter-spacing:-.025em; }
.card-body p { margin:0; color:var(--muted); font-size:13px; line-height:1.7; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.card-footer { display:flex; align-items:center; justify-content:space-between; margin-top:auto; padding-top:22px; }
.language-badge { color:var(--muted); border:1px solid var(--line); border-radius:7px; padding:4px 7px; font-size:9px; font-weight:850; letter-spacing:.08em; }
.card-footer a { width:34px; height:34px; display:grid; place-items:center; border:1px solid var(--line); border-radius:10px; color:var(--cyan); }
.news-grid.list-view { grid-template-columns:1fr; }
.news-grid.list-view .news-card { display:grid; grid-template-columns:240px 1fr; }
.news-grid.list-view .card-media { height:100%; min-height:210px; }
.no-results { min-height:220px; border:1px dashed var(--line); border-radius:20px; display:flex; flex-direction:column; align-items:center; justify-content:center; color:var(--muted); gap:7px; }
.no-results strong { color:var(--text); }

.sources-section { padding:88px 0; border-top:1px solid var(--line); background:var(--bg-soft); }
.source-groups { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.source-group { border:1px solid var(--line); border-radius:20px; padding:24px; background:var(--panel); }
.source-group h3 { margin:0 0 17px; font-size:15px; }
.source-pills { display:flex; flex-wrap:wrap; gap:8px; }
.source-pills span { padding:7px 9px; border:1px solid var(--line); border-radius:9px; color:var(--muted); font-size:11px; background:rgba(255,255,255,.018); }
.site-footer { padding:58px 0; border-top:1px solid var(--line); }
.footer-inner { display:flex; justify-content:space-between; gap:40px; }
.footer-brand { margin-bottom:18px; }
.footer-inner p { color:var(--muted); font-size:12px; }
.footer-links { display:flex; flex-wrap:wrap; align-items:center; gap:24px; color:var(--muted); font-size:12px; }
.footer-links a:hover { color:var(--text); }
.toast { position:fixed; right:24px; bottom:24px; z-index:100; max-width:380px; padding:14px 17px; border:1px solid var(--line-strong); border-radius:14px; background:var(--panel-solid); color:var(--text); box-shadow:var(--shadow); transform:translateY(25px); opacity:0; pointer-events:none; transition:.25s; font-size:13px; }
.toast.show { opacity:1; transform:translateY(0); }
.toast.error { border-color:rgba(248,113,113,.45); }

@media (max-width: 980px) {
  .desktop-nav { display:none; }
  .lead-story { grid-template-columns:1fr; }
  .lead-media { min-height:380px; }
  .news-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .filters { grid-template-columns:1fr 1fr; }
  .source-groups { grid-template-columns:1fr; }
}
@media (max-width: 700px) {
  .container { width:min(calc(100% - 28px),var(--container)); }
  .header-inner { height:68px; }
  .brand-copy strong { font-size:12px; }
  .brand-mark { width:34px; height:34px; }
  .icon-button { display:none; }
  .refresh-button { padding:0 12px; }
  .refresh-button span:last-child { display:none; }
  .hero { padding-top:48px; }
  .hero-topline { align-items:flex-start; flex-direction:column; gap:10px; }
  .hero h1 { font-size:clamp(45px,14vw,68px); }
  .hero-description { font-size:15px; }
  .lead-story { margin-top:36px; border-radius:23px; }
  .lead-media { min-height:250px; }
  .lead-content { padding:30px 24px; }
  .lead-content h2 { font-size:30px; }
  .empty-hero { flex-direction:column; text-align:center; }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
  .stats-grid > div, .stats-grid > div:first-child { border:0; border-bottom:1px solid var(--line); padding:22px; }
  .stats-grid > div:nth-child(odd) { border-right:1px solid var(--line); }
  .news-section { padding-top:60px; }
  .section-heading { align-items:flex-start; }
  .section-note { text-align:left; }
  .filters { grid-template-columns:1fr; }
  .news-grid { grid-template-columns:1fr; }
  .news-grid.list-view .news-card { display:flex; }
  .news-grid.list-view .card-media { min-height:auto; height:215px; }
  .source-groups { grid-template-columns:1fr; }
  .footer-inner { flex-direction:column; }
}

.generated-image-badge { position:absolute; z-index:3; right:18px; top:18px; border:1px solid rgba(255,255,255,.22); background:rgba(97,72,255,.72); color:#fff; backdrop-filter:blur(12px); border-radius:999px; padding:7px 10px; font-size:9px; font-weight:850; letter-spacing:.11em; }
.generated-image-badge.card-generated { right:12px; top:12px; }
