:root {
  --bg: #0E0E11;
  --surface: #17171C;
  --surface-2: #101014;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.17);
  --text: #ECECEE;
  --text-2: #C6C6CC;
  --dim: #8C8C95;
  --accent: #5FB89A;
  --accent-soft: rgba(95,184,154,0.14);
  --danger: #D98C6A;
  --radius-lg: 14px;
  --font-head: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
:root.light {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-2: #F1F1EC;
  --border: rgba(22,22,28,0.11);
  --border-strong: rgba(22,22,28,0.22);
  --text: #191920;
  --text-2: #3A3A42;
  --dim: #6C6C76;
  --accent-soft: rgba(95,184,154,0.13);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}
button, input { font: inherit; }
a { color: inherit; }
.app-shell { position: relative; min-height: 100vh; isolation: isolate; overflow-x: clip; }
.grid-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: -2;
  background-image: linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(125% 95% at 50% 0%, #000 30%, transparent 88%);
}
.light .grid-bg { background-image: linear-gradient(rgba(22,22,28,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(22,22,28,0.05) 1px, transparent 1px); }
.glow {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 820px; max-width: 100vw; height: 340px; pointer-events: none; z-index: -1;
  background: radial-gradient(50% 100% at 50% 0%, rgba(95,184,154,0.22), transparent 72%);
}
.light .glow { background: radial-gradient(50% 100% at 50% 0%, rgba(95,184,154,0.14), transparent 72%); }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px;
  padding: 9px clamp(20px,5vw,56px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.logo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 26px; font-weight: 600; letter-spacing: .2em;
  color: var(--text);
}
.pill-button {
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  padding: 8px 14px;
  font-family: var(--font-head);
  font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.pill-button:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
main { max-width: 1320px; margin: 0 auto; padding: 0 clamp(16px,5vw,56px) 96px; }
.hero {
  min-height: calc(64vh - 52px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 70px 0 42px;
  gap: 28px;
}
.eyebrow, .section-label {
  font-family: var(--font-head);
  font-size: 11.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim);
}
.hero h1 {
  margin: 0;
  max-width: 17ch;
  font-family: var(--font-head);
  font-size: clamp(34px,8.4vw,60px);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.06;
  text-wrap: balance;
  animation: heroIn .7s ease both;
}
.hero p {
  margin: 0;
  max-width: 62ch;
  color: var(--dim);
  font-size: clamp(15px,1.5vw,18px);
  line-height: 1.6;
  text-wrap: pretty;
  animation: heroIn .7s ease .08s both;
}
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(28px,6vw,72px); margin-top: 10px; animation: heroIn .8s ease .16s both; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 120px; }
.stat__num { font-family: var(--font-head); font-size: clamp(38px,6.5vw,52px); font-weight: 500; letter-spacing: -.02em; line-height: 1; color: var(--accent); }
.stat__label { font-family: var(--font-head); font-size: 11.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.summary-panel {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: clamp(18px,4vw,52px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 26px 0;
  margin-bottom: 34px;
}
.summary-text { display: grid; gap: 12px; color: var(--text-2); line-height: 1.65; font-size: 15.5px; }
.summary-text p { margin: 0; max-width: 86ch; }
.workspace { margin-top: 0; }
.topics {
  display: flex; flex-wrap: nowrap; align-items: stretch;
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  background: var(--bg);
}
.topics::-webkit-scrollbar { display: none; }
.topic {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  border: 0; border-left: 1px solid var(--border);
  background: transparent; color: var(--text);
  padding: 14px clamp(16px,2vw,26px);
  white-space: nowrap; cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.topic:first-child { border-left: none; }
.topic:hover, .topic.active { background: var(--accent-soft); }
.topic.active { box-shadow: inset 0 -2px 0 var(--accent); }
.topic__name { font-family: var(--font-head); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: inherit; }
.topic.active .topic__name { color: var(--accent); }
.topic__count { font-family: var(--font-head); font-size: 12px; letter-spacing: .06em; color: var(--dim); }
.topic.active .topic__count { color: var(--accent); }
.reader-grid {
  display: grid;
  grid-template-columns: minmax(280px, 34%) 1fr;
  height: 640px;
  border: 1px solid var(--border-strong);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
}
.news-list-wrap { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.list-tools { padding: 15px; border-bottom: 1px solid var(--border); display: grid; gap: 13px; }
.list-title { font-family: var(--font-head); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.list-desc { margin-top: 5px; font-size: 12px; line-height: 1.4; color: var(--dim); }
.search {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text);
  padding: 10px 11px;
  outline: none;
  font-family: var(--font-head); font-size: 12px;
}
.search:focus { border-color: var(--accent); background: var(--accent-soft); }
.news-list { flex: 1; min-height: 0; overflow: auto; }
.news-item {
  width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--border); border-left: 3px solid transparent;
  background: transparent; color: var(--dim); cursor: pointer;
  padding: 13px 15px;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.news-item:hover { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); color: var(--text-2); }
.news-item.active { border-left-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.news-item__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-family: var(--font-head); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.news-item__source { color: var(--text); }
.news-item__time { color: var(--dim); }
.news-item__title { font-family: var(--font-head); font-size: 13.5px; font-weight: 500; line-height: 1.34; color: inherit; }
.badge-new { display: inline-flex; align-items: center; padding: 2px 6px; border: 1px solid var(--accent); color: var(--accent); font-size: 10px; line-height: 1; letter-spacing: .08em; }
.badge-tag { display: inline-flex; align-items: center; padding: 2px 6px; border: 1px solid var(--border); color: var(--dim); font-size: 10px; line-height: 1; letter-spacing: .08em; }
.article { overflow: auto; min-height: 0; background: var(--bg); padding: clamp(24px,4vw,46px); }
.article__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; font-family: var(--font-head); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.article h2 { margin: 0 0 18px; max-width: 24ch; font-family: var(--font-head); font-size: clamp(28px,4.4vw,52px); font-weight: 500; line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; }
.article__summary { margin: 0 0 28px; max-width: 68ch; color: var(--text-2); font-size: 17px; line-height: 1.65; }
.article__body { display: grid; gap: 15px; max-width: 76ch; color: var(--text-2); line-height: 1.72; }
.article__body p { margin: 0; }
.article__actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.article__link { display: inline-flex; text-decoration: none; border: 1px solid var(--border-strong); padding: 10px 14px; color: var(--text); font-family: var(--font-head); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; transition: background .2s ease, border-color .2s ease; }
.article__link:hover { background: var(--accent-soft); border-color: var(--accent); }
.empty-state { height: 100%; display: grid; place-items: center; color: var(--dim); font-family: var(--font-head); letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.error { color: var(--danger); }
@keyframes heroIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 860px) {
  .topbar { padding-inline: 16px; }
  .logo { font-size: 22px; }
  .hero { min-height: auto; padding: 58px 0 36px; }
  .summary-panel { grid-template-columns: 1fr; }
  .reader-grid { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .news-list-wrap { border-right: none; border-bottom: 1px solid var(--border); max-height: 420px; }
  .article { min-height: 420px; }
  .pill-button { padding: 7px 10px; font-size: 10px; }
}
