:root {
  --blue:   #1d4ed8;   /* rating 0  */
  --purple: #6d28a8;   /* rating 5  */
  --red:    #c81e1e;   /* rating 10 */
  --bg: #0d0f14;
  --panel: #161a22;
  --text: #f4f5f8;
  --muted: #9aa3b2;
  --spectrum: linear-gradient(90deg, var(--blue) 0%, var(--purple) 50%, var(--red) 100%);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased;
}
body.lb-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* ---------- Header ---------- */
header.top { position: sticky; top: 0; z-index: 20; background: rgba(13,15,20,.85); backdrop-filter: blur(14px); border-bottom: 1px solid #232833; }
.top-inner { max-width: 1280px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 24px; }
.logo { font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-size: 1.7rem; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--spectrum); box-shadow: 0 4px 14px rgba(109,40,168,.5); }
.logo .grad, .grad { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav.links { display: flex; gap: 20px; margin-left: 12px; color: var(--muted); font-size: .92rem; font-weight: 500; }
nav.links a:hover, nav.links a.active { color: var(--text); }
.search { margin-left: auto; position: relative; width: min(340px, 40vw); }
.search input { width: 100%; padding: 10px 14px 10px 38px; border-radius: 999px; border: 1px solid #2a3040; background: var(--panel); color: var(--text); font: inherit; font-size: .92rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.search input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(109,40,168,.3); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--muted); }

/* ---------- Hero / spectrum ---------- */
.hero { max-width: 1280px; margin: 0 auto; padding: 48px 24px 12px; }
.hero h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.05; letter-spacing: -.025em; max-width: 18ch; }
.hero p.sub { color: var(--muted); margin-top: 14px; max-width: 60ch; font-size: 1.05rem; }
.status { margin-top: 14px; font-size: .84rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; display: inline-block; margin-right: 6px; box-shadow: 0 0 0 3px rgba(52,211,153,.2); }
.status.stale .dot { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251,191,36,.2); }
.spectrum { margin-top: 28px; }
.spectrum-label { display: flex; justify-content: space-between; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.spectrum-bar { display: grid; grid-template-columns: repeat(5, 1fr); height: 64px; border-radius: 16px; overflow: hidden; background: var(--spectrum); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.seg { border: 0; background: transparent; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-right: 1px solid rgba(255,255,255,.18); transition: background .15s, opacity .15s; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.seg:last-child { border-right: 0; }
.seg:hover { background: rgba(255,255,255,.12); }
.seg .name { font-weight: 700; font-size: .88rem; }
.seg .count { font-size: .74rem; opacity: .85; }
.spectrum-bar.filtering .seg:not(.active) { opacity: .45; }
.seg.active { background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 2px rgba(255,255,255,.85); }
.ticks { display: flex; justify-content: space-between; margin-top: 8px; font-size: .72rem; color: var(--muted); padding: 0 2px; }
.ticks b { font-weight: 600; }

/* ---------- Toolbar ---------- */
.toolbar { max-width: 1280px; margin: 0 auto; padding: 26px 24px 10px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.toolbar .results { color: var(--muted); font-size: .92rem; }
.toolbar .results strong { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid #2a3040; background: var(--panel); color: var(--muted); font-size: .84rem; font-weight: 500; cursor: pointer; transition: all .15s; }
.chip:hover { color: var(--text); border-color: #3b4357; }
.chip.active { background: var(--text); color: #0d0f14; border-color: var(--text); font-weight: 600; }
.chip.toggle.active { background: linear-gradient(90deg, #1d4ed8, #6d28a8, #c81e1e); color: #fff; border-color: transparent; }
.right-tools { display: flex; gap: 10px; align-items: center; }
select.sort { padding: 8px 12px; border-radius: 10px; border: 1px solid #2a3040; background: var(--panel); color: var(--text); font: inherit; font-size: .86rem; cursor: pointer; outline: none; }

/* ---------- Grid & tiles ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 8px 24px 64px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; margin-top: 12px; }
.tile { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; color: #fff; background: var(--tile-color); box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.08); transition: transform .18s ease, box-shadow .18s ease; position: relative; cursor: pointer; }
.tile:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.18); }
.tile:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: rgba(0,0,0,.25); overflow: hidden; }
.thumb img.photo { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.tile:hover .thumb img.photo { transform: scale(1.04); }
.thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.28)); pointer-events: none; }
.thumb .fallback { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; flex-direction: column; gap: 8px; background: repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 12px, rgba(255,255,255,0) 12px 24px), rgba(0,0,0,.2); font-family: 'Fraunces', Georgia, serif; font-size: 1.5rem; font-weight: 800; text-align: center; padding: 12px; opacity: .92; }
.thumb .fallback img { width: 36px; height: 36px; border-radius: 8px; background: #fff; padding: 4px; object-fit: contain; }
.thumb.noimg img.photo { display: none; }
.thumb.noimg .fallback { display: flex; }
.badge { position: absolute; top: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.badge.topic { left: 12px; }
.badge.count { right: 12px; letter-spacing: .02em; text-transform: none; font-size: .76rem; }
.body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.src { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; min-height: 22px; }
.favs { display: flex; }
.favs img { width: 20px; height: 20px; border-radius: 50%; background: #fff; padding: 2px; border: 2px solid var(--tile-color); margin-left: -6px; object-fit: contain; }
.favs img:first-child { margin-left: 0; }
.src .names { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src .when { margin-left: auto; font-weight: 500; opacity: .75; white-space: nowrap; }
h3.headline { font-size: 1.08rem; line-height: 1.28; font-weight: 700; letter-spacing: -.005em; text-wrap: balance; }
.foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.rating-row { display: flex; align-items: baseline; justify-content: space-between; font-size: .78rem; font-weight: 600; }
.rating-row .lean { opacity: .9; }
.rating-row .score { background: rgba(0,0,0,.28); padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.meter { position: relative; height: 6px; border-radius: 999px; background: var(--spectrum); box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.meter i { position: absolute; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.meter i.dot { width: 8px; height: 8px; background: rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.meter i.avg { width: 15px; height: 15px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.55); }
.empty { text-align: center; color: var(--muted); padding: 80px 0; display: none; }
.banner { display: none; max-width: 1280px; margin: 16px auto 0; padding: 12px 24px; }
.banner div { background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.4); color: #fde68a; padding: 10px 14px; border-radius: 12px; font-size: .88rem; }
footer { border-top: 1px solid #232833; color: var(--muted); font-size: .82rem; text-align: center; padding: 28px 24px 40px; }
footer p + p { margin-top: 6px; }
footer a { text-decoration: underline; text-underline-offset: 3px; }
footer a:hover { color: var(--text); }

/* ---------- Lightbox ---------- */
dialog.lb { border: 0; padding: 0; background: transparent; color: var(--text); width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 24px); margin: auto; overflow: visible; }
dialog.lb::backdrop { background: rgba(5,6,10,.78); backdrop-filter: blur(6px); }
.lb-inner { background: #12151c; border: 1px solid #262c3a; border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6); max-height: calc(100vh - 24px); overflow: auto; position: relative; animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.lb-close { position: sticky; top: 14px; float: right; margin: 14px 14px 0 0; z-index: 5; width: 38px; height: 38px; border-radius: 50%; border: 1px solid #343b4d; background: rgba(18,21,28,.9); cursor: pointer; font-size: 1.3rem; line-height: 1; }
.lb-close:hover { background: #1f2430; }
.lb-head { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 24px; padding: 28px 28px 8px; }
.lb-head .pic { aspect-ratio: 16/10; border-radius: 14px; overflow: hidden; background: var(--tile-color); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.lb-head .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-head .pic.noimg img { display: none; }
.lb-topic { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lb-head h2 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.15; letter-spacing: -.015em; margin: 6px 0 10px; text-wrap: balance; padding-right: 40px; }
.lb-meta { color: var(--muted); font-size: .86rem; }
.lb-cover { padding: 14px 28px 4px; }
.lb-cover .meter { height: 10px; }
.lb-cover .meter i.dot { width: 12px; height: 12px; background: #fff; }
.lb-cover .meter i.avg { width: 20px; height: 20px; border: 3px solid #12151c; }
.lb-cover .legend { display: flex; justify-content: space-between; margin-top: 10px; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.lb-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 18px 28px 28px; }
.lb-col h4 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.lb-col h4 span.sw { width: 10px; height: 10px; border-radius: 3px; background: var(--sw); }
.lb-col h4 em { font-style: normal; color: var(--muted); font-weight: 500; letter-spacing: 0; text-transform: none; }
.lb-col .none { border: 1px dashed #343b4d; border-radius: 14px; padding: 18px 14px; color: var(--muted); font-size: .84rem; text-align: center; }
.art { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px; margin-bottom: 10px; background: var(--c); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); transition: transform .15s, box-shadow .15s; position: relative; }
.art:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.28); }
.art:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.art .top { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; }
.art .top img { width: 18px; height: 18px; border-radius: 4px; background: #fff; padding: 1px; }
.art .top .score { margin-left: auto; background: rgba(0,0,0,.28); padding: 1px 8px; border-radius: 999px; font-weight: 600; font-variant-numeric: tabular-nums; }
.art .t { font-size: .94rem; line-height: 1.3; font-weight: 600; }
.art .bot { display: flex; align-items: center; justify-content: space-between; font-size: .74rem; opacity: .85; }
.art .tag { background: rgba(0,0,0,.35); padding: 1px 7px; border-radius: 999px; font-weight: 700; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }
.art .go { font-weight: 700; }

/* ---------- About page ---------- */
.prose { max-width: 820px; margin: 0 auto; padding: 48px 24px 64px; }
.prose h1 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.02em; margin-bottom: 14px; }
.prose h2 { font-family: 'Fraunces', Georgia, serif; font-size: 1.5rem; margin: 34px 0 10px; letter-spacing: -.01em; }
.prose p, .prose li { color: #cdd3de; margin-bottom: 12px; }
.prose ul { padding-left: 22px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose code { background: #1b2030; padding: 1px 6px; border-radius: 6px; font-size: .9em; }
table.outlets { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .9rem; }
table.outlets th, table.outlets td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #232833; }
table.outlets th { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
table.outlets .sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 8px; }

@media (max-width: 860px) {
  .lb-cols { grid-template-columns: 1fr; }
  .lb-head { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  nav.links { display: none; }
  .search { width: 100%; }
  .seg .name { font-size: .72rem; }
  .seg .count { font-size: .66rem; }
  .spectrum-bar { height: 56px; }
  .ticks span:nth-child(even) { display: none; }
}

/* ---------- Donate Button ---------- */
.donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.donate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(109,40,168,.4);
  color: #fff;
}
@media (max-width: 640px) {
  .donate-btn span { display: none; }
}
