/* NexusAPK — public site */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #12151b;
  --muted: #5b6372;
  --line: #e3e6ec;
  --accent: #ff3d57;
  --ink: #0e1116;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Charter", "Iowan Old Style", Georgia, Cambria, "Times New Roman", serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b0d12; --surface: #141821; --surface-2: #1b2030; --text: #e9ecf2; --muted: #9aa3b4; --line: #252b39;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12; --surface: #141821; --surface-2: #1b2030; --text: #e9ecf2; --muted: #9aa3b4; --line: #252b39;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -.015em; }
.wrap { width: min(1240px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.topbar { background: var(--ink); color: #c9cfda; font-size: 12.5px; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 61, 87, .6); } 70% { box-shadow: 0 0 0 8px rgba(255, 61, 87, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 61, 87, 0); } }

.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.brand-row { display: flex; align-items: center; gap: 20px; height: 78px; }
.logo { font-weight: 900; font-size: 32px; letter-spacing: -.04em; line-height: 1; color: var(--text); }
.logo { display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; }
.logo b { font-weight: inherit; }
.logo span { color: var(--accent); }
.logo-mark { width: 1.05em; height: 1.05em; flex: none; color: var(--text); }
.logo-mark .logo-n { fill: var(--bg); }
.logo:hover { color: var(--text); }
.logo-sm { font-size: 26px; }
.search { margin-left: auto; display: flex; align-items: center; background: var(--surface-2); border-radius: 999px; padding: 4px 6px 4px 16px; width: min(340px, 40vw); border: 1px solid transparent; }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; outline: none; min-width: 0; }
.search button, .theme-toggle { border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.search button:hover, .theme-toggle:hover { color: var(--accent); background: var(--surface-2); }

.catnav { border-top: 1px solid var(--line); }
.catnav-in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catnav-in::-webkit-scrollbar { display: none; }
.catnav a { white-space: nowrap; padding: 13px 12px; font-size: 13.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 3px solid transparent; }
.catnav a:hover { color: var(--text); }
.catnav a.on { color: var(--text); border-bottom-color: var(--accent); }

.ticker { background: var(--ink); color: #fff; }
.ticker-in { display: flex; align-items: center; height: 40px; gap: 14px; overflow: hidden; }
.ticker-label { flex: none; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 4px; }
.ticker-track { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-move { display: inline-flex; gap: 40px; white-space: nowrap; animation: ticker 90s linear infinite; }
.ticker-move a { font-size: 13.5px; color: #dfe3ea; position: relative; }
.ticker-move a::before { content: "●"; color: var(--accent); font-size: 8px; position: absolute; left: -22px; top: 4px; }
.ticker-move a:hover { color: #fff; text-decoration: underline; }
.ticker:hover .ticker-move { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Media placeholders ---------- */
.media { position: relative; display: block; overflow: hidden; background: var(--surface-2); }
.media .ph, .media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.media img { object-fit: cover; transition: transform .5s ease; }
.ph { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, hsl(var(--h) 75% 52%), hsl(calc(var(--h) + 45) 70% 30%)); }
.ph span { color: rgba(255, 255, 255, .9); font-weight: 800; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; padding: 0 10px; text-align: center; }

/* ---------- Layout ---------- */
.main { padding: 28px 0 56px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.sidebar { position: sticky; top: 20px; display: grid; gap: 22px; }
.section-title { display: flex; align-items: center; justify-content: space-between; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; border-bottom: 2px solid var(--text); padding-bottom: 10px; margin: 0 0 20px; }
.section-title span { display: inline-flex; align-items: center; gap: 10px; }
.section-title span::before { content: ""; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; }
.section-title a { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.cat-section { margin-top: 44px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 28px; margin-bottom: 44px; }
.hero-lead { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 470px; display: flex; align-items: flex-end; background: var(--ink); box-shadow: var(--shadow); }
.hero-img { position: absolute; inset: 0; }
.hero-lead::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 25%, rgba(5, 7, 12, .92) 100%); pointer-events: none; }
.hero-lead:hover .hero-img img { transform: scale(1.03); }
.hero-text { position: relative; z-index: 1; padding: 32px; color: #fff; }
.hero-text h1 { font-size: clamp(26px, 3.2vw, 40px); font-weight: 850; margin: 12px 0 10px; letter-spacing: -.025em; }
.hero-text h1 a:hover { color: #fff; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.hero-text p { margin: 0 0 12px; color: #d6dae2; font-size: 16.5px; max-width: 640px; }
.hero-text .meta { color: #aab2c0; }
.hero-side { display: grid; gap: 16px; align-content: start; }
.side-item { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.side-item:last-child { border-bottom: 0; }
.side-item .thumb { aspect-ratio: 4 / 3; border-radius: 10px; }
.side-item h3 { font-size: 16px; font-weight: 750; margin: 5px 0 6px; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(16, 24, 40, .12); }
.card:hover .card-img img { transform: scale(1.04); }
.card-img { aspect-ratio: 16 / 9; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 18px; font-weight: 750; letter-spacing: -.015em; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.card .meta { margin-top: auto; }
.card-compact h3 { font-size: 16px; }
.card-compact .card-body { padding: 13px 15px 15px; }
.chip { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.chip-solid { background: var(--accent); color: #fff; padding: 4px 10px; border-radius: 4px; display: inline-block; }
.chip-solid:hover { color: #fff; filter: brightness(1.1); }
.meta { font-size: 12.5px; color: var(--muted); }

/* ---------- Sidebar ---------- */
.widget { background: var(--surface); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.widget-title { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; margin-bottom: 14px; }
.rank { list-style: none; counter-reset: r; margin: 0; padding: 0; }
.rank li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.rank li:first-child { border-top: 0; padding-top: 0; }
.rank li::before { content: counter(r); grid-row: span 2; font-size: 28px; font-weight: 900; color: var(--accent); line-height: 1; opacity: .9; }
.rank a { font-weight: 700; font-size: 15px; line-height: 1.35; }
.widget-about p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.btn-rss, .btn { display: inline-block; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 10px; }
.btn-rss:hover, .btn:hover { color: #fff; filter: brightness(1.08); }
.ad-slot { text-align: center; overflow: hidden; }
.ad-slot:empty { display: none; }

/* ---------- Article ---------- */
.article { min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs span { margin: 0 6px; opacity: .5; }
.crumbs a:last-child { color: var(--accent); font-weight: 700; }
.article h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 850; letter-spacing: -.03em; line-height: 1.12; }
.dek { font-size: 20px; line-height: 1.5; color: var(--muted); margin: 16px 0 22px; }
.byline { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.byline strong { display: block; font-size: 14.5px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 900; box-shadow: inset 0 -3px 0 var(--accent); }
.article-figure { margin: 0 0 28px; }
.article-img { aspect-ratio: 16 / 9; border-radius: var(--radius); }
.article-figure figcaption { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.article-body { font-family: var(--serif); font-size: 19.5px; line-height: 1.75; }
.article-body > p:first-child { font-size: 1.12em; }
.article-body p { margin: 0 0 1.15em; }
.article-body h2, .article-body h3 { font-family: var(--font); margin: 1.6em 0 .55em; font-weight: 800; }
.article-body h2 { font-size: 26px; }
.article-body h3 { font-size: 21px; }
.article-body ul, .article-body ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.article-body li { margin-bottom: .45em; }
.article-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--accent); font-style: italic; color: var(--muted); }
.article-body a { color: var(--accent); text-decoration: underline; }
.draft-banner { background: #fff4d6; color: #6b4e00; border: 1px solid #f2d98b; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; font-size: 14px; }
.sources { margin: 36px 0 24px; padding: 20px 22px; background: var(--surface); border-radius: var(--radius); border-left: 4px solid var(--accent); box-shadow: var(--shadow); }
.sources h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.sources ul { margin: 0; padding-left: 18px; }
.sources li { margin: 6px 0; font-size: 15px; }
.sources a { font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.sources span { color: var(--muted); font-size: 13.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.tags a { background: var(--surface-2); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tags a:hover { background: var(--accent); color: #fff; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.share span { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-right: 6px; }
.share a, .share button { font: inherit; font-size: 13.5px; font-weight: 650; padding: 7px 13px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Lists, empty, 404 ---------- */
.list-head { margin-bottom: 28px; padding-bottom: 18px; border-bottom: 2px solid var(--text); }
.list-head h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 900; letter-spacing: -.03em; }
.list-head p { margin: 8px 0 0; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; }
.pager a { background: var(--surface); border: 1px solid var(--line); padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.pager a:hover { border-color: var(--accent); }
.pager-info { color: var(--muted); font-size: 14px; }
.empty-state { text-align: center; padding: 90px 20px; max-width: 560px; margin: 0 auto; }
.empty-state h1 { font-size: 34px; margin: 26px 0 12px; }
.empty-state p { color: var(--muted); font-size: 17px; }
.empty-state .pulse { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); margin: 0 auto; animation: pulse 1.6s infinite; }
.empty-inline { background: var(--surface); padding: 30px; border-radius: var(--radius); color: var(--muted); text-align: center; }
.notfound { text-align: center; padding: 50px 20px 40px; }
.notfound .big { font-size: 120px; font-weight: 900; letter-spacing: -.05em; color: var(--accent); line-height: 1; }
.notfound h1 { font-size: 32px; margin: 10px 0; }
.notfound p { color: var(--muted); margin-bottom: 22px; }
.notfound + .grid { margin-top: 20px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #b7bfcc; padding: 50px 0 0; font-size: 14.5px; }
.footer .logo, .footer .logo-mark { color: #fff; }
.footer .logo-mark .logo-n { fill: var(--ink); }
.footer-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 36px; }
.footer-brand p { margin: 12px 0 0; max-width: 460px; }
.footer .muted { color: #7f8898; font-size: 13.5px; }
.footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; columns: 2; }
.footer li { margin-bottom: 8px; }
.footer a:hover { color: #fff; }
.footer ul.one-col { columns: 1; }
.also-read { font-family: var(--font); font-size: 15.5px; background: var(--surface); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; margin: 0 0 1.3em; box-shadow: var(--shadow); }
.also-read strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; color: var(--muted); }
.also-read ul { margin: 0; padding-left: 18px; }
.also-read li { margin: 4px 0; }
.also-read a { color: var(--text); text-decoration: none; font-weight: 650; }
.also-read a:hover { color: var(--accent); }
.byline a { color: inherit; }
.byline a:hover { color: var(--accent); }
.static-page h1 { margin-bottom: 24px; }
.page-body > p:first-child::first-letter { float: none; font: inherit; padding: 0; color: inherit; }
.footer-bottom { border-top: 1px solid #222836; padding: 18px 0; font-size: 13px; color: #7f8898; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero { grid-template-columns: 1fr; }
  .hero-lead { min-height: 400px; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 28px); }
  .brand-row { height: auto; padding: 14px 0; flex-wrap: wrap; gap: 12px; }
  .logo { font-size: 27px; }
  .search { order: 3; width: 100%; }
  .theme-toggle { margin-left: auto; }
  .topbar-in > span:first-child { display: none; }
  .topbar-in { justify-content: flex-end; }
  .hero-lead { min-height: 360px; }
  .hero-text { padding: 22px; }
  .side-item { grid-template-columns: 100px 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .article-body { font-size: 18px; }
  .footer-in { grid-template-columns: 1fr; gap: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-move, .dot, .empty-state .pulse { animation: none; }
  .card, .media img { transition: none; }
}
