:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: rgba(255, 255, 255, .78);
  --solid: #ffffff;
  --raised: #eceef6;
  --line: rgba(20, 24, 50, .1);
  --fg: #0e1020;
  --muted: #565b74;
  --faint: #7c8199;
  --grad: linear-gradient(100deg, #5b3df5, #0ea5e9 55%, #10b981);
  --glow: rgba(91, 61, 245, .16);
  --up: #0a8f5b;
  --down: #d92d4a;
  --new: #5b3df5;
  --blob-a: rgba(124, 92, 255, .22);
  --blob-b: rgba(14, 165, 233, .2);
  --blob-c: rgba(236, 72, 153, .13);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #07080d;
    --surface: rgba(20, 22, 32, .72);
    --solid: #12141d;
    --raised: #1d2030;
    --line: rgba(255, 255, 255, .09);
    --fg: #f2f3fa;
    --muted: #a3a8bf;
    --faint: #7a7f98;
    --grad: linear-gradient(100deg, #a78bfa, #38bdf8 55%, #34d399);
    --glow: rgba(139, 112, 255, .22);
    --up: #3fdc9c;
    --down: #ff7b90;
    --new: #a78bfa;
    --blob-a: rgba(124, 92, 255, .3);
    --blob-b: rgba(14, 165, 233, .22);
    --blob-c: rgba(236, 72, 153, .16);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #07080d;
  --surface: rgba(20, 22, 32, .72);
  --solid: #12141d;
  --raised: #1d2030;
  --line: rgba(255, 255, 255, .09);
  --fg: #f2f3fa;
  --muted: #a3a8bf;
  --faint: #7a7f98;
  --grad: linear-gradient(100deg, #a78bfa, #38bdf8 55%, #34d399);
  --glow: rgba(139, 112, 255, .22);
  --up: #3fdc9c;
  --down: #ff7b90;
  --new: #a78bfa;
  --blob-a: rgba(124, 92, 255, .3);
  --blob-b: rgba(14, 165, 233, .22);
  --blob-c: rgba(236, 72, 153, .16);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--new); outline-offset: 2px; }
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}

/* Slow-moving colour behind everything, plus a faint dot grid */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(180deg, #000, transparent 70%); }
.aurora i { position: absolute; width: 56vmax; height: 56vmax; border-radius: 50%; filter: blur(90px); animation: drift 26s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { top: -34vmax; left: -14vmax; background: var(--blob-a); }
.aurora i:nth-child(2) { top: -30vmax; right: -18vmax; background: var(--blob-b); animation-delay: -9s; }
.aurora i:nth-child(3) { top: 8vmax; left: 30vmax; width: 40vmax; height: 40vmax; background: var(--blob-c); animation-delay: -17s; }
@keyframes drift { to { transform: translate(7vmax, 5vmax) scale(1.14); } }

.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 14px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.02em; font-size: 17px; }
.logo { width: 30px; height: 30px; display: block; border-radius: 8px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: ping 2.4s infinite; }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.controls { display: flex; gap: 8px; margin-left: auto; flex: none; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border-radius: 12px; color: var(--fg); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.icon-btn:hover { border-color: var(--new); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-moon { display: none; }
:root[data-theme='dark'] .i-sun { display: none; }
:root[data-theme='dark'] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .i-sun { display: none; }
  :root:not([data-theme='light']) .i-moon { display: block; }
}

.intro { padding: 34px 0 18px; }
.intro h1 { margin: 0; font-size: clamp(34px, 6vw, 62px); line-height: 1.03; letter-spacing: -.045em; font-weight: 800; }
.intro h1 span { white-space: nowrap; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.stat { padding: 11px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.stat b { display: block; font-size: 23px; line-height: 1.2; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }

.toolbar { position: sticky; top: 60px; z-index: 20; isolation: isolate; display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.toolbar::before { content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.tabs { position: relative; display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tabs button { position: relative; z-index: 1; padding: 6px 14px; border: 0; background: none; border-radius: 10px; font-size: 13.5px; font-weight: 650; color: var(--muted); transition: color .2s; }
.tabs button[aria-pressed='true'] { color: #fff; }
.tab-pill { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 10px; background: linear-gradient(100deg, #5b3df5, #0e9fd8); box-shadow: 0 4px 14px -4px rgba(91, 61, 245, .7); transition: transform .28s cubic-bezier(.3, 1.3, .5, 1), width .28s; }
.search { flex: 1 1 auto; max-width: 340px; margin-left: auto; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: border-color .15s; }
.search:focus-within { border-color: var(--new); }
.search svg { width: 16px; height: 16px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--fg); font: inherit; font-size: 14px; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
kbd { padding: 0 6px; border-radius: 6px; border: 1px solid var(--line); font: 12px/1.5 inherit; color: var(--faint); }

/* One colour per topic, used on filters, tags and the radar */
.t-ai { --t: #8b5cf6; } .t-security { --t: #ef4444; } .t-apple { --t: #64748b; } .t-google { --t: #3b82f6; }
.t-chips { --t: #10b981; } .t-business { --t: #f59e0b; } .t-policy { --t: #ec4899; } .t-mobility { --t: #06b6d4; }
.t-space { --t: #6366f1; } .t-gaming { --t: #84cc16; } .t-social { --t: #f97316; } .outlet { --t: var(--new); }

.topics { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 14px; }
.topics::-webkit-scrollbar { display: none; }
.topics button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, color .15s; }
.topics button:hover { color: var(--fg); border-color: var(--t, var(--new)); }
.topics button[aria-pressed='true'] { color: #fff; background: var(--t, var(--fg)); border-color: var(--t, var(--fg)); }
.topics button:not(.t-ai):not([class*='t-'])[aria-pressed='true'] { color: var(--bg); }
.topics small { font-size: 11.5px; opacity: .75; font-variant-numeric: tabular-nums; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }

.glow { position: relative; }
.glow::before { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s; background: radial-gradient(280px circle at var(--x, 50%) var(--y, 50%), var(--glow), transparent 70%); }
.glow:hover::before { opacity: 1; }

.bento { display: grid; grid-template-columns: 1.65fr 1fr; grid-auto-rows: 214px; gap: 12px; }
.card { display: block; overflow: hidden; border-radius: 20px; background: var(--raised); border: 1px solid var(--line); color: #fff; animation: rise .5s both; transition: transform .25s, box-shadow .25s; isolation: isolate; }
.card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -24px rgba(60, 40, 200, .75); }
.card.lead { grid-row: span 2; }
.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .12s; }
.cover, .card .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.card:hover .cover { transform: scale(1.04); }
.shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 6, 14, .1) 20%, rgba(5, 6, 14, .9) 92%); }
.rank-badge { position: absolute; top: 12px; left: 12px; display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 11px; font-weight: 750; font-variant-numeric: tabular-nums; color: #fff; background: rgba(10, 10, 22, .5); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.card-body { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.card h2 { margin: 0; font-size: 18px; line-height: 1.22; letter-spacing: -.02em; font-weight: 700; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.card.lead h2 { font-size: clamp(24px, 3vw, 36px); line-height: 1.1; letter-spacing: -.03em; font-weight: 750; text-wrap: balance; }
.card.lead .card-body { padding: 22px; gap: 8px; }
.summary { color: rgba(255, 255, 255, .84); font-size: 15px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.card .meta, .card .meta b { color: rgba(255, 255, 255, .86); }
.card .move.up { color: #6ef0bd; } .card .move.down { color: #ff9dad; } .card .move.new { color: #d3c7ff; }
.card .signal i { background: rgba(255, 255, 255, .28); }
.card .signal b { color: rgba(255, 255, 255, .9); }
.card .signal.s1 i:nth-child(-n+1), .card .signal.s2 i:nth-child(-n+2), .card .signal.s3 i:nth-child(-n+3), .card .signal.s4 i:nth-child(-n+4), .card .signal.s5 i { background: #6ef0bd; }

.top-line { display: flex; align-items: center; gap: 8px; min-height: 18px; }
.tag { padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--t); }
.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.signal i { width: 3px; border-radius: 2px; background: var(--line); }
.signal i:nth-child(1) { height: 5px; } .signal i:nth-child(2) { height: 7px; } .signal i:nth-child(3) { height: 9px; } .signal i:nth-child(4) { height: 12px; } .signal i:nth-child(5) { height: 14px; }
.signal.s1 i:nth-child(-n+1), .signal.s2 i:nth-child(-n+2), .signal.s3 i:nth-child(-n+3), .signal.s4 i:nth-child(-n+4), .signal.s5 i { background: var(--up); }
.signal b { margin-left: 3px; font-size: 11.5px; line-height: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 12.5px; color: var(--faint); }
.meta b { color: var(--muted); font-weight: 650; }
.move { font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meta .move { margin-left: 3px; }
.move.up { color: var(--up); } .move.down { color: var(--down); } .move.new { color: var(--new); font-size: 11px; letter-spacing: .04em; }

/* Colour washes for stories without a picture */
.art { display: grid; place-items: center; overflow: hidden; color: rgba(255, 255, 255, .85); font-weight: 750; letter-spacing: -.02em; }
.card .art span { display: none; }
.art-0 { background: linear-gradient(135deg, #5b3df5, #ec4899); } .art-1 { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.art-2 { background: linear-gradient(135deg, #10b981, #0ea5e9); } .art-3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.art-4 { background: linear-gradient(135deg, #8b5cf6, #06b6d4); } .art-5 { background: linear-gradient(135deg, #ec4899, #f59e0b); }
.art-6 { background: linear-gradient(135deg, #1e3a8a, #10b981); } .art-7 { background: linear-gradient(135deg, #7c3aed, #1d4ed8); }

.rows { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 84px; gap: 10px; align-items: center; height: 100%; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .2s, border-color .2s; }
.row:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--new) 55%, var(--line)); }
.row-rank { font-size: 24px; font-weight: 800; letter-spacing: -.04em; text-align: center; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.row-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row h3 { margin: 0; font-size: 15px; line-height: 1.28; letter-spacing: -.012em; font-weight: 650; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.thumb, .row .art { width: 84px; height: 84px; object-fit: cover; border-radius: 11px; background: var(--raised); font-size: 11px; text-align: center; }

.rail { position: sticky; top: 124px; display: flex; flex-direction: column; gap: 12px; }
.panel { padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.panel h2 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.riser { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 6px; padding: 6px 0; font-size: 13.5px; line-height: 1.3; font-weight: 550; border-top: 1px solid var(--line); }
.riser:first-of-type { border-top: 0; }
.riser:hover span:last-child { text-decoration: underline; text-underline-offset: 2px; }
.riser span:last-child { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.bar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 22px; align-items: center; gap: 8px; width: 100%; padding: 4px 0; border: 0; background: none; font-size: 13px; text-align: left; }
.bar:disabled { cursor: default; color: var(--fg); }
.bar span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar:not(:disabled):hover span:first-child { text-decoration: underline; text-underline-offset: 2px; }
.track { height: 7px; border-radius: 99px; background: var(--raised); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 99px; background: var(--t); animation: grow .7s cubic-bezier(.2, .8, .2, 1); transform-origin: left; }
.bar b { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.empty { color: var(--muted); padding: 60px 0; text-align: center; }
footer { margin-top: 18px; padding: 16px 0 calc(32px + env(safe-area-inset-bottom)); color: var(--faint); font-size: 12.5px; border-top: 1px solid var(--line); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes grow { from { transform: scaleX(0); } }
@supports (animation-timeline: view()) {
  .row { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 30%; }
}

@media (max-width: 1040px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
}
@media (max-width: 760px) {
  .bento { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 200px; }
  .card.lead { grid-row: span 1; height: 320px; }
  .bento { grid-auto-rows: auto; }
  .card.side { height: 200px; }
  .rows { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(n+4) { display: none; }
  .search kbd { display: none; }
  .toolbar { flex-wrap: wrap; }
  .tabs { flex: 1 1 100%; }
  .tabs button { flex: 1; padding: 6px 4px; }
  .search { flex: 1 1 100%; max-width: none; margin-left: 0; }
  .toolbar { position: static; }
  .toolbar::before { display: none; }
  .live { display: none; }
  .intro { padding-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
