/* ============================================================
   OCTANEWS — public site stylesheet.
   Dark, editorial, glassy: the same navy ground, radial glows and
   strings canvas as the /admin shell (and every Circloud app), so the
   public site and the dashboard read as one product. Brand tokens come
   from /assets/brand-colors.css; the header shell from app-header.css.
   Category colour flows through ONE custom property, --cat, set by the
   .cat-<slug> classes the page emits (see render.js categoryStyles).
   ============================================================ */

:root {
  --bg: #070b17;
  --bg-2: #0b1020;
  --bg-3: #0f1730;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f8;
  --text-dim: #a7b0d1;
  --text-faint: #8089a8;
  --cat: var(--octanews-brand-solid, #3b82f6);
  --grad: var(--octanews-brand-gradient, linear-gradient(100deg, #22d3ee, #3b82f6 50%, #a855f7 110%));
  --hot: var(--octanews-hot-gradient, linear-gradient(100deg, #f59e0b, #f97316));
  --glow: var(--octanews-brand-glow, rgba(59, 130, 246, 0.45));
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --font: var(--ui-font-family, 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --wrap: 1240px;
}

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body.site {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.site::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(34, 211, 238, 0.16) 0%, transparent 62%),
    radial-gradient(760px 480px at 92% 6%, rgba(168, 85, 247, 0.14) 0%, transparent 64%),
    radial-gradient(640px 420px at 50% 112%, rgba(249, 115, 22, 0.08) 0%, transparent 66%),
    linear-gradient(160deg, rgba(7, 10, 24, 0.98) 0%, rgba(11, 16, 36, 0.96) 45%, rgba(6, 9, 20, 0.99) 100%);
  pointer-events: none;
  z-index: 0;
}
body.site > * { position: relative; z-index: 1; }
#mycelium {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 30%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0) 85%);
          mask-image: linear-gradient(180deg, #000 0, #000 30%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0) 85%);
}
a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--octanews-cyan, #22d3ee); outline-offset: 2px; border-radius: 4px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  padding: 10px 14px; border-radius: 10px;
  background: var(--bg-3); color: #fff; font-weight: 600; border: 1px solid var(--border-strong);
  transition: top 0.15s var(--ease);
}
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-faint); font-size: 14px; }
.center { text-align: center; }
.sep { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; margin: 0 8px; vertical-align: middle; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cat); box-shadow: 0 0 10px var(--cat); flex: 0 0 auto; }

/* ── header (extends .ch from app-header.css) ── */
.site-header { gap: 14px; }
.site-header .ch-brand-link { flex: 0 0 auto; }
.site-nav { justify-content: flex-start; gap: 1px; padding: 4px 0; -webkit-overflow-scrolling: touch; }
/* when the sections overflow, the clipped edge(s) fade so it reads as scrollable */
.site-nav.is-overflow {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
}
.site-nav.is-overflow.at-start {
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent 100%);
          mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent 100%);
}
.site-nav.is-overflow.at-end {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 100%);
}
.site-nav.is-overflow.at-start.at-end { -webkit-mask-image: none; mask-image: none; }
.site-nav .ch-link { gap: 5px; padding: 6px 7px; font-size: 12.5px; }
.site-nav .ch-link .dot { width: 6px; height: 6px; opacity: 0.85; box-shadow: none; transition: box-shadow 0.2s, transform 0.2s; }
.site-nav .ch-link:hover .dot, .site-nav .ch-link.is-active .dot { box-shadow: 0 0 8px var(--cat); transform: scale(1.15); }
.site-nav .ch-link.is-active { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 -2px 0 var(--cat); border-radius: 8px 8px 4px 4px; }
.site-nav .ch-link-about { color: var(--text-faint); margin-left: 4px; }
.ch-search {
  position: relative; display: flex; align-items: center; flex: 0 0 auto; margin-left: auto;
}
.ch-search-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-faint); cursor: pointer; z-index: 1; display: flex;
}
.ch-search-icon .ch-icon { width: 16px; height: 16px; fill: currentColor; }
.ch-search-input {
  width: 180px; height: 34px; padding: 0 12px 0 32px;
  background: rgba(0, 0, 0, 0.32); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  font: 500 13px var(--font); outline: none;
  transition: width 0.25s var(--ease), border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.ch-search-input::placeholder { color: var(--text-faint); }
.ch-search-input::-webkit-search-decoration, .ch-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ch-search-input:focus { width: 260px; border-color: rgba(34, 211, 238, 0.55); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); background: rgba(0, 0, 0, 0.45); }
.ch-search:focus-within .ch-search-icon { color: var(--octanews-cyan, #22d3ee); }
.site-header.is-scrolled { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55); }

/* ── main ── */
.site-main { padding: 28px 0 72px; }
.sec { margin-top: 44px; }
.sec:first-child { margin-top: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sec-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text);
}
.sec-title::before { content: ''; width: 18px; height: 3px; border-radius: 2px; background: var(--grad); }
.rail .sec-title::before { background: var(--cat); box-shadow: 0 0 10px var(--cat); }
.sec-title .dot { display: none; }
.sec-title-sm { font-size: 12px; }
.sec-more { font-size: 13px; font-weight: 600; color: var(--text-dim); white-space: nowrap; transition: color 0.15s, transform 0.2s var(--ease); }
.sec-more:hover { color: #fff; transform: translateX(2px); }

/* ── chips / tags ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cat); line-height: 1;
  padding: 5px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  background: color-mix(in srgb, var(--cat) 14%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-color: color-mix(in srgb, var(--cat) 35%, transparent);
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover { color: var(--cat); background: color-mix(in srgb, var(--cat) 24%, transparent); border-color: var(--cat); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  padding: 6px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: all 0.15s var(--ease);
}
.tag:hover { color: #fff; border-color: var(--border-strong); transform: translateY(-1px); }
.tag-n { font-size: 10.5px; color: var(--text-faint); font-weight: 700; }
.tag-co { color: var(--octanews-amber, #f59e0b); }
.tag .dot { width: 6px; height: 6px; box-shadow: none; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font: 700 13.5px var(--font); letter-spacing: 0.02em; color: #fff; cursor: pointer;
  background: var(--grad); box-shadow: 0 8px 22px var(--glow);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, filter 0.2s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 12px 28px var(--glow); color: #fff; }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: var(--surface-2); border-color: var(--border); box-shadow: none; color: var(--text-dim);
}
.btn.ghost:hover { color: #fff; border-color: var(--border-strong); background: var(--surface-3); filter: none; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 12.5px; border-radius: 10px; }
.btn[disabled], .btn.is-busy { opacity: 0.6; pointer-events: none; }

/* ── hero ── */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px;
  margin-bottom: 44px; align-items: stretch;
}
.hero-card {
  position: relative; min-height: 480px; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-2);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.hero-media { position: absolute; inset: 0; display: block; }
.hero-media img, .hero-media .ph { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-media img { object-fit: cover; transition: transform 1.2s var(--ease); }
.hero-card:hover .hero-media img { transform: scale(1.04); }
.hero-card::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 11, 23, 0.05) 0%, rgba(7, 11, 23, 0.25) 40%, rgba(7, 11, 23, 0.92) 78%, #070b17 100%);
}
.hero-body {
  position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px;
  height: 100%; min-height: inherit; padding: 32px 32px 30px;
}
.hero-title {
  font-size: clamp(26px, 3.1vw, 40px); font-weight: 800; line-height: 1.08; letter-spacing: -0.025em; max-width: 20ch;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}
.hero-title a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--cat); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.hero-dek {
  font-size: 15.5px; color: var(--text-dim); max-width: 60ch;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-body .card-meta { color: var(--text-dim); }
.top { display: flex; flex-direction: column; min-width: 0; }
.top .sec-head { margin-bottom: 10px; }
.top-list { display: flex; flex-direction: column; flex: 1 1 auto; }
.top-item {
  display: grid; grid-template-columns: 30px 108px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--border);
  transition: transform 0.2s var(--ease);
}
.top-item:first-child { border-top: 0; padding-top: 4px; }
.top-item:hover { transform: translateX(3px); }
.top-n {
  font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -0.04em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.top-thumb {
  position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-2);
}
.top-thumb img, .top-thumb .ph { position: absolute; inset: 0; width: 100%; height: 100%; }
.top-thumb img { object-fit: cover; }
.top-thumb .ph-domain { display: none; }
.top-thumb .ph-letter { font-size: 26px; }
.top-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.top-title {
  font-size: 15px; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.top-title a:hover { text-decoration: underline; text-decoration-color: var(--cat); text-underline-offset: 3px; }
.top-empty { color: var(--text-faint); font-size: 13.5px; padding: 12px 0; }

/* ── layout ── */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 40px; align-items: start; }
.layout.no-side { grid-template-columns: minmax(0, 1fr); }
.main-col { min-width: 0; }
.side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ── cards ── */
.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: transform 0.28s var(--ease), border-color 0.28s, box-shadow 0.28s, background 0.28s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
  border-color: color-mix(in srgb, var(--cat) 45%, rgba(255, 255, 255, 0.12));
  background: var(--surface-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.card-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.card-media img, .card-media .ph { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-media img { object-fit: cover; transition: transform 0.7s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { display: flex; flex-direction: column; gap: 9px; padding: 16px 18px 18px; flex: 1 1 auto; }
.card-body .chip { align-self: flex-start; }
.card-title {
  font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -0.012em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-title a::after { content: ''; position: absolute; inset: 0; }
.card-title a:hover { color: #fff; }
.card-dek {
  font-size: 14px; color: var(--text-dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px 0;
  font-size: 12px; color: var(--text-faint); margin-top: auto; padding-top: 4px; line-height: 1.4;
}
.card-meta .m-src { color: var(--text-dim); font-weight: 600; }
.card-meta .m-cat { color: var(--cat); font-weight: 600; }
.card-sm .card-body { padding: 13px 14px 14px; gap: 7px; }
.card-sm .card-title { font-size: 14.5px; -webkit-line-clamp: 3; }
.card-sm .chip { font-size: 10px; padding: 4px 8px; }
.card-sm .ph-letter { font-size: 40px; }
.card-body .chip, .top-body .chip, .hero-body .chip { position: relative; z-index: 2; align-self: flex-start; }
.card-meta .m { display: inline-flex; align-items: center; white-space: nowrap; }

/* gradient placeholder: category colour → navy, big initial, domain.
   --ph-x/--ph-y/--ph-gx come from a hash of the story slug (render.js
   phStyle / site.js) so two placeholders for the same source never look
   like the same tile twice. */
.ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background:
    radial-gradient(120% 80% at var(--ph-x, 100%) var(--ph-y, 0%), rgba(255, 255, 255, 0.12), transparent 55%),
    linear-gradient(150deg, var(--cat) -60%, #0b1020 65%, #070b17 100%);
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}
.ph::before {
  content: ''; position: absolute; inset: -40% var(--ph-gx, -20%) auto auto; width: 70%; aspect-ratio: 1;
  border-radius: 50%; background: var(--cat); opacity: 0.22; filter: blur(50px);
}
.ph-letter {
  position: relative; font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.55));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ph-domain { position: relative; font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
/* Hero without a picture: a shorter card (no 480 px of empty navy) and the
   placeholder becomes a watermark confined to the top-right corner, out of
   the way of the headline and dek that sit bottom-left. */
.hero-media .ph { align-items: flex-end; justify-content: flex-start; padding: 18px 28px; }
.hero-media .ph-letter { font-size: 110px; opacity: 0.45; max-width: 28%; }
.hero-media .ph-domain { font-size: 13px; opacity: 0.75; }
.hero-card.no-img { min-height: 340px; }
.hero-card.no-img .hero-body { padding-right: 30%; }
.hero-card.no-img .hero-title { max-width: none; }
img.is-broken { display: none; }

/* ── rails ──
   Full width below the Latest + sidebar block; a rail with 2–3 stories
   keeps its cards at the normal size instead of stretching a short row
   across four columns. */
.rails { margin-top: 44px; }
.rail { padding-top: 26px; border-top: 1px solid var(--border); }
.rails .rail:first-child { margin-top: 0; }
.grid.cols-4.is-sparse.n-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: calc(50% - 8px); }
.grid.cols-4.is-sparse.n-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: calc(75% - 4px); }

/* ── load more / pager ── */
.load-more { display: flex; justify-content: center; margin-top: 28px; }
.load-more .btn { min-width: 220px; }
.load-more-msg { color: var(--text-faint); font-size: 13px; margin-top: 10px; text-align: center; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 32px; }
.pager > :last-child { justify-self: end; }
.pager-page { font-size: 13px; color: var(--text-faint); font-weight: 600; }

/* ── sidebar boxes ── */
.box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px 20px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.box-title {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
}
.box-title::before { content: ''; width: 14px; height: 3px; border-radius: 2px; background: var(--grad); }
.box-markets .box-title::before { background: var(--hot); }
.box-text { font-size: 13.5px; color: var(--text-dim); }
.box-text a { color: var(--octanews-cyan, #22d3ee); }
.box-more { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.box-more:hover { color: #fff; }
.trend-list { display: flex; flex-direction: column; }
.trend-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); align-items: start; }
.trend-item:first-child { border-top: 0; padding-top: 0; }
.trend-n {
  font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -0.04em; color: var(--text-faint);
  transition: color 0.2s;
}
.trend-item:hover .trend-n { color: var(--cat); }
.trend-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; margin-bottom: 3px; }
.trend-title:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--cat); }
.mini-list { display: flex; flex-direction: column; }
.mini-list li { padding: 10px 0; border-top: 1px solid var(--border); }
.mini-list li:first-child { border-top: 0; padding-top: 0; }
.mini-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; margin-bottom: 3px; }
.mini-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.tickers b { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--octanews-amber, #f59e0b); }

/* newsletter */
.box-news {
  border: 1px solid transparent;
  background: linear-gradient(var(--bg-3), var(--bg-3)) padding-box, var(--grad) border-box;
  box-shadow: 0 10px 40px rgba(59, 130, 246, 0.12);
}
.nl-form { position: relative; display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
/* honeypot: off-screen for people, a normal field for form-filling bots */
.nl-hp { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.nl-form input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.35); color: var(--text); border: 1px solid var(--border);
  font: 500 14px var(--font); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.nl-form input::placeholder { color: var(--text-faint); }
.nl-form input:focus { border-color: rgba(34, 211, 238, 0.55); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); }
.nl-form .btn { width: 100%; }
.nl-msg { font-size: 13px; color: var(--text-dim); min-height: 0; }
.nl-msg:empty { display: none; }
.nl-msg.is-ok { color: #34d399; }
.nl-msg.is-err { color: #f87171; }
.nl-fine { font-size: 11.5px; color: var(--text-faint); margin-top: 10px; }

/* ── empty / error states ── */
.empty {
  text-align: center; padding: 64px 24px; border-radius: 22px;
  border: 1px dashed var(--border-strong); background: var(--surface);
}
.empty-mark {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px;
  background: var(--grad); opacity: 0.9;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 2h9L22 7.5v9L16.5 22h-9L2 16.5v-9zm.83 2L4 8.33v7.34L8.33 20h7.34L20 15.67V8.33L15.67 4zM11 7h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 2h9L22 7.5v9L16.5 22h-9L2 16.5v-9zm.83 2L4 8.33v7.34L8.33 20h7.34L20 15.67V8.33L15.67 4zM11 7h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.empty h2 { font-size: 22px; margin-bottom: 8px; }
.empty p { color: var(--text-dim); max-width: 52ch; margin: 0 auto; }
.empty-links { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.error-page { text-align: center; padding: 70px 20px 40px; max-width: 640px; margin: 0 auto; }
.error-code {
  font-size: clamp(72px, 14vw, 128px); font-weight: 800; line-height: 1; letter-spacing: -0.06em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 8px;
}
.error-page h1 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 12px; }
.error-page .lede { color: var(--text-dim); }
.error-page .empty-links { margin-top: 26px; }

/* ── page heads (category / tag / search / about) ── */
.page-head { max-width: 820px; margin: 8px 0 32px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cat); margin-bottom: 12px;
}
.page-head h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.page-head .lede, .lede { font-size: 16.5px; color: var(--text-dim); margin-top: 14px; max-width: 66ch; }
.page-head .muted { margin-top: 12px; }
.page-category .page-head h1 {
  background: linear-gradient(100deg, #fff 30%, var(--cat) 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.search-form { display: flex; gap: 10px; margin-top: 22px; max-width: 640px; }
.search-form input {
  flex: 1 1 auto; height: 46px; padding: 0 16px; border-radius: 13px; min-width: 0;
  background: rgba(0, 0, 0, 0.35); color: var(--text); border: 1px solid var(--border);
  font: 500 15px var(--font); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.search-form input:focus { border-color: rgba(34, 211, 238, 0.55); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); }
.search-form .btn { height: 46px; }

/* ── article ── */
.article { max-width: var(--wrap); }
.article-head { max-width: 860px; margin: 6px auto 28px; text-align: center; }
.crumbs { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-faint); margin-bottom: 18px; }
.crumbs a:not(.chip):hover { color: #fff; }
.article-title { font-size: clamp(28px, 4.2vw, 46px); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; }
.article-dek { font-size: 18px; line-height: 1.5; color: var(--text-dim); margin-top: 16px; }
.article-meta {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 0;
  margin-top: 18px; font-size: 13px; color: var(--text-faint);
}
.article-meta a { color: var(--text-dim); font-weight: 600; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.article-meta a:hover { color: #fff; text-decoration-color: var(--cat); }
.article-hero { max-width: 1000px; margin: 0 auto 36px; }
.article-hero-media {
  position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-2); box-shadow: var(--shadow-lg);
}
.article-hero-media img, .article-hero-media .ph { position: absolute; inset: 0; width: 100%; height: 100%; }
.article-hero-media img { object-fit: cover; }
.article-hero-media .ph-letter { font-size: 120px; }
/* no picture: a slim gradient band instead of a 16:9 void */
.article-hero.no-img .article-hero-media { aspect-ratio: 21 / 7; border-radius: 18px; }
.article-hero.no-img .ph-letter { font-size: 84px; }
.article-hero figcaption { font-size: 12px; color: var(--text-faint); text-align: right; margin-top: 8px; }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.article-main { max-width: 740px; margin: 0 auto; width: 100%; }
.glance {
  position: relative; padding: 20px 22px 20px 26px; margin-bottom: 30px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border); overflow: hidden;
}
.glance::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cat); box-shadow: 0 0 16px var(--cat); }
.glance h2 { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cat); margin-bottom: 10px; }
.glance ul { display: flex; flex-direction: column; gap: 8px; }
.glance li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.5; color: var(--text); }
.glance li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: var(--cat); }
.article-body { font-size: 17px; line-height: 1.75; color: #dfe4f1; }
.article-body p { margin: 0 0 1.25em; }
.article-body p:first-child::first-letter { font-size: 1.15em; font-weight: 700; color: #fff; }
.sources { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border); }
.sources h2, .tags-row h2 { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.sources ol { display: flex; flex-direction: column; gap: 8px; counter-reset: src; }
.sources li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14.5px; counter-increment: src; }
.sources li::before { content: counter(src, decimal-leading-zero); font-size: 11px; font-weight: 800; color: var(--text-faint); letter-spacing: 0.08em; width: 22px; }
.sources a { font-weight: 600; color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.sources a:hover { text-decoration-color: var(--cat); }
.src-host { font-size: 12.5px; color: var(--text-faint); }
.src-primary { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cat); padding: 2px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); }
.tags-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 26px; }
.share { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.share-label { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-right: 4px; }
.share .btn.is-done { color: #34d399; border-color: rgba(52, 211, 153, 0.4); }
.ai-note { margin-top: 30px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--text-faint); line-height: 1.55; }
.ai-note a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.ai-note a:hover { color: #fff; }
.article .sec { margin-top: 56px; padding-top: 30px; border-top: 1px solid var(--border); }

/* ── about ── */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 40px; align-items: start; }
.prose { max-width: 720px; font-size: 16px; line-height: 1.7; color: #dfe4f1; }
.prose h2 { font-size: 20px; margin: 34px 0 12px; letter-spacing: -0.02em; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin-bottom: 1em; }
.prose a { color: var(--octanews-cyan, #22d3ee); text-decoration: underline; text-underline-offset: 3px; }
.steps { display: flex; flex-direction: column; gap: 12px; counter-reset: step; }
.steps li { position: relative; padding: 14px 16px 14px 58px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); counter-increment: step; }
.steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 16px; top: 13px;
  font-size: 20px; font-weight: 800; letter-spacing: -0.04em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.steps b { color: #fff; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.facts div { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.facts dt { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.facts dd { margin: 4px 0 0; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }

/* ── notices ── */
.notice { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; border: 1px solid; }
.notice.is-ok { color: #a7f3d0; border-color: rgba(52, 211, 153, 0.35); background: rgba(16, 185, 129, 0.1); }
.notice.is-err { color: #fecaca; border-color: rgba(248, 113, 113, 0.4); background: rgba(239, 68, 68, 0.1); }

/* ── footer ── */
.site-footer { border-top: 1px solid var(--border); background: rgba(7, 11, 23, 0.7); padding: 48px 0 28px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.footer-lockup { display: inline-flex; }
.footer-lockup .cr-brand { align-items: flex-start; }
.footer-lockup .cr-brand[data-size="md"] .cr-brand-logo { width: 64px; }
.footer-lockup .cr-brand[data-size="md"] .cr-brand-name { font-size: 1.5rem; }
.footer-lockup .cr-brand[data-size="md"] .cr-brand-sub { font-size: 0.98rem; }
.footer-blurb { font-size: 13.5px; color: var(--text-dim); max-width: 46ch; margin-top: 14px; }
.footer-ai { font-size: 12.5px; color: var(--text-faint); margin-top: 10px; }
.footer-col h2 { font-size: 11.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.footer-col a { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-dim); padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-col .dot { width: 6px; height: 6px; box-shadow: none; }
.footer-muted { font-size: 13px; color: var(--text-faint); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-faint); }

/* ── motion ──
   Entrance on load is pure CSS (no JS dependency, so nothing can stay
   hidden); .rv/.in is used only for cards the browser appends after
   "Load more". Both are switched off under prefers-reduced-motion. */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-card { animation: rise 0.7s var(--ease) both; }
.top { animation: rise 0.7s var(--ease) 0.12s both; }
.page-head, .article-head { animation: rise 0.6s var(--ease) both; }
.article-hero { animation: rise 0.7s var(--ease) 0.1s both; }
html.js .rv { opacity: 0; transform: translateY(12px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
html.js .rv.in { opacity: 1; transform: none; }

/* ── responsive ── */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-card { min-height: 420px; }
  .top-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .top-item { grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto auto; border-top: 0; padding: 0; }
  .top-item:hover { transform: none; }
  .top-n { grid-row: 1 / span 2; align-self: start; }
  .top-thumb { grid-column: 2; }
  .top-body { grid-column: 2; }
  .layout, .about-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .side .box-news { grid-column: 1 / -1; }
  .grid.cols-4, .grid.cols-4.is-sparse { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
  .hero-card.no-img .hero-body { padding-right: 24%; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-list { grid-template-columns: minmax(0, 1fr); }
  .top-item { grid-template-columns: 26px 108px minmax(0, 1fr); grid-template-rows: auto; }
  .top-n { grid-row: auto; }
  .top-thumb, .top-body { grid-column: auto; }
  .side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .site-main { padding-top: 18px; }
  /* header: brand + search icon on the first row, sections scroll on the second */
  .site-header, header.ch.site-header { height: auto; flex-wrap: wrap; padding: 6px 10px 4px; gap: 4px 8px; }
  .site-header .ch-brand-link { order: 1; height: 42px; }
  .ch-search { order: 2; }
  .site-nav { order: 3; flex: 1 1 100%; justify-content: flex-start; padding: 2px 0 6px; }
  .site-nav .ch-link { padding: 6px 9px; }
  .ch-search-input { width: 34px; padding-left: 34px; padding-right: 0; cursor: pointer; }
  .ch-search-input::placeholder { color: transparent; }
  .ch-search:focus-within .ch-search-input, .ch-search-input:focus, .ch-search.is-open .ch-search-input { width: 200px; padding-right: 12px; cursor: text; }
  .ch-search:focus-within .ch-search-input::placeholder { color: var(--text-faint); }
  .hero-card { min-height: 380px; border-radius: 18px; }
  .hero-card.no-img { min-height: 280px; }
  .hero-card.no-img .hero-body { padding-right: 20px; }
  .hero-body { padding: 22px 20px 20px; }
  .hero-title { max-width: none; }
  .hero-media .ph { padding: 14px 18px; }
  .hero-media .ph-letter { font-size: 84px; opacity: 0.22; }
  .hero-media .ph-domain { display: none; }
  .sec { margin-top: 36px; }
  .rails { margin-top: 36px; }
  /* section rails become one swipeable row each: ~10,000 px less page */
  .rails .rail .grid.cols-4 {
    display: flex; overflow-x: auto; gap: 12px; max-width: none;
    scroll-snap-type: x mandatory; padding: 2px 2px 8px; margin: 0 -2px;
    scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  }
  .rails .rail .card { flex: 0 0 72%; scroll-snap-align: start; }
  .rails .rail .card:hover { transform: none; }
  .article-head { text-align: left; }
  .article-meta { justify-content: flex-start; }
  .article-hero-media { border-radius: 16px; }
  .article-body { font-size: 16.5px; }
  .pager { grid-template-columns: 1fr auto 1fr; }
}
@media (max-width: 540px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .top-item { grid-template-columns: 22px 92px minmax(0, 1fr); gap: 10px; }
  .top-n { font-size: 20px; }
  .hero-card { min-height: 340px; }
  .hero-card.no-img { min-height: 260px; }
  .card-sm .card-media { aspect-ratio: 16 / 8; }
  .search-form { flex-direction: column; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .site-nav .ch-link { font-size: 12px; }
}

/* ── motion: respect the user ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html.js .rv { opacity: 1; transform: none; }
  .card:hover, .hero-card:hover .hero-media img, .card:hover .card-media img, .top-item:hover, .sec-more:hover, .tag:hover, .btn:hover { transform: none; }
}
@media (hover: none) {
  .card:hover, .top-item:hover { transform: none; }
}
