/* ============================================================
   DAILYPILLS — style.css
   Dark theme · Syne + DM Sans · Bento grid layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── RESET & VARIABLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #080808;
  --bg2:         #0e0e0e;
  --card:        #111111;
  --card2:       #141414;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.12);
  --text:        #e4e4e4;
  --muted:       #555;
  --muted2:      #888;
  --accent:      #00ff88;
  --accent-dim:  #00ff8820;

  /* Category colors */
  --c-res:  #7c3aed;
  --c-tool: #0891b2;
  --c-ind:  #d97706;
  --c-pol:  #dc2626;
  --c-oss:  #059669;

  /* Typography */
  --font-d: 'Syne', sans-serif;
  --font-b: 'DM Sans', sans-serif;
  --font-m: 'JetBrains Mono', monospace;

  /* Layout */
  --r:    10px;
  --r-lg: 16px;
  --max-w: 1280px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: .6;
}

/* ── TICKER BAR ── */
.ticker-bar {
  position: relative; z-index: 10;
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-m);
  font-size: 11px;
  color: var(--muted2);
  overflow: hidden;
}
.ticker-left {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 #00ff8866; }
  50%       { opacity: .7; box-shadow: 0 0 0 4px #00ff8800; }
}
.ticker-scroll {
  flex: 1; overflow: hidden;
  mask: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}
.ticker-inner {
  display: flex; gap: 48px;
  animation: ticker 40s linear infinite;
  white-space: nowrap;
}
.ticker-inner:hover { animation-play-state: paused; }
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.tick-item {
  display: flex; align-items: center; gap: 6px; color: var(--muted);
}
.tick-item b { color: var(--text); font-weight: 500; }
.tick-cat {
  font-size: 9px; padding: 1px 5px;
  border-radius: 3px; font-family: var(--font-m);
}
.ticker-right { flex-shrink: 0; font-size: 10px; }

/* ── HEADER ── */
header {
  position: relative; z-index: 10;
  padding: 20px 40px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: var(--font-d);
  font-size: 22px; font-weight: 800;
  letter-spacing: -.03em; color: #fff;
  text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.logo-dot {
  width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
}
.logo-tag {
  font-family: var(--font-b);
  font-size: 11px; font-weight: 400; color: var(--muted);
  letter-spacing: .04em;
  border-left: 1px solid var(--border2);
  padding-left: 12px; margin-left: 4px;
}
nav { display: flex; align-items: center; gap: 6px; }
.nav-item {
  font-family: var(--font-m); font-size: 11px; color: var(--muted2);
  padding: 5px 10px; border-radius: 6px;
  cursor: pointer; transition: all .15s;
  border: 1px solid transparent; text-decoration: none;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-item.active {
  color: var(--accent);
  border-color: rgba(0,255,136,.2);
  background: rgba(0,255,136,.05);
}
.btn-subscribe {
  font-family: var(--font-m); font-size: 11px; font-weight: 500;
  padding: 7px 16px; border-radius: 7px;
  border: 1px solid var(--accent);
  background: rgba(0,255,136,.08); color: var(--accent);
  cursor: pointer; transition: all .15s; letter-spacing: .03em;
}
.btn-subscribe:hover {
  background: rgba(0,255,136,.15);
  box-shadow: 0 0 16px rgba(0,255,136,.15);
}

/* ── MAIN ── */
main {
  position: relative; z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* ── SECTION LABELS ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-label {
  font-family: var(--font-m); font-size: 11px; color: var(--muted);
  letter-spacing: .1em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.section-label::before {
  content: ''; width: 20px; height: 1px;
  background: var(--muted); display: block;
}
.section-link {
  font-family: var(--font-m); font-size: 11px; color: var(--muted);
  text-decoration: none; transition: color .15s;
}
.section-link:hover { color: var(--text); }

/* ── STATS ROW ── */
.stats-row {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 10px; margin-bottom: 32px;
  animation: fadeUp .6s ease .05s both;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 20px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-val {
  font-family: var(--font-d); font-size: 28px; font-weight: 700;
  letter-spacing: -.03em; color: #fff; line-height: 1;
}
.stat-accent { color: var(--accent); }
.stat-label {
  font-family: var(--font-m); font-size: 10px; color: var(--muted);
  letter-spacing: .05em;
}
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── HERO PILL ── */
.hero-pill {
  display: grid; grid-template-columns: 1fr 420px;
  border: 1px solid var(--border2);
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--card); min-height: 400px;
  transition: border-color .2s;
  animation: fadeUp .6s ease both;
}
.hero-pill:hover { border-color: rgba(124,58,237,.4); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-content {
  padding: 40px 44px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.hero-content::before {
  content: ''; position: absolute;
  top: 0; left: 0; width: 3px; height: 100%;
  background: var(--c-res); opacity: .8;
}

/* ── CATEGORY BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-m); font-size: 10px; font-weight: 500;
  padding: 4px 10px; border-radius: 5px; border: 1px solid;
  letter-spacing: .05em; text-transform: uppercase; width: fit-content;
}
.badge-res  { color: #a78bfa; border-color: rgba(124,58,237,.3); background: rgba(124,58,237,.1); }
.badge-tool { color: #38bdf8; border-color: rgba(8,145,178,.3);  background: rgba(8,145,178,.1); }
.badge-ind  { color: #fbbf24; border-color: rgba(217,119,6,.3);  background: rgba(217,119,6,.1); }
.badge-pol  { color: #f87171; border-color: rgba(220,38,38,.3);  background: rgba(220,38,38,.1); }
.badge-oss  { color: #34d399; border-color: rgba(5,150,105,.3);  background: rgba(5,150,105,.1); }

.hero-title {
  font-family: var(--font-d); font-size: 36px; font-weight: 700;
  line-height: 1.12; letter-spacing: -.025em; color: #fff;
  margin: 20px 0 16px;
}
.hero-hook {
  font-size: 16px; color: var(--accent); font-weight: 300;
  font-style: italic; line-height: 1.5; margin-bottom: 20px;
  border-left: 2px solid var(--accent); padding-left: 14px;
}
.hero-body {
  font-size: 14px; color: var(--muted2); line-height: 1.7; margin-bottom: 28px;
}
.hero-body strong { color: var(--text); }
.hero-meta {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px;
}
.meta-item {
  font-family: var(--font-m); font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 5px;
}
.meta-sep { color: var(--border2); }
.hero-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-m); font-size: 12px; color: #fff;
  background: rgba(255,255,255,.07); border: 1px solid var(--border2);
  padding: 9px 18px; border-radius: 8px;
  cursor: pointer; transition: all .15s; text-decoration: none;
}
.hero-cta:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.2); }
.hero-cta-arr { font-size: 14px; transition: transform .15s; }
.hero-cta:hover .hero-cta-arr { transform: translateX(3px); }

/* ── SLIDE PREVIEW ── */
.hero-slide {
  display: flex; flex-direction: column;
  background: #090909;
  border-left: 1px solid var(--border);
  overflow: hidden;
}
.slide-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  padding: 0 20px; background: #0a0a0a;
}
.slide-tab {
  font-family: var(--font-m); font-size: 10px; color: var(--muted);
  padding: 10px 14px; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .15s;
}
.slide-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.slide-preview {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.slide-card {
  width: 100%; max-width: 340px; aspect-ratio: 1;
  background: linear-gradient(135deg, #0a0a0a 0%, #111 100%);
  border-radius: 12px; border: 1px solid rgba(124,58,237,.25);
  padding: 28px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
  box-shadow: 0 0 60px rgba(124,58,237,.08), inset 0 1px 0 rgba(255,255,255,.04);
}
.slide-card::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(124,58,237,.15) 0%, transparent 70%);
  pointer-events: none;
}
.slide-badge {
  font-family: var(--font-m); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; color: #a78bfa;
  background: rgba(124,58,237,.15); border: 1px solid rgba(124,58,237,.3);
  padding: 3px 8px; border-radius: 4px; width: fit-content;
}
.slide-main { flex: 1; padding: 16px 0; }
.slide-title {
  font-family: var(--font-d); font-size: 20px; font-weight: 700;
  color: #fff; line-height: 1.2; letter-spacing: -.02em; margin-bottom: 10px;
}
.slide-hook-text { font-size: 12px; color: var(--accent); line-height: 1.5; font-style: italic; }
.slide-footer { display: flex; align-items: center; justify-content: space-between; }
.slide-logo {
  font-family: var(--font-d); font-size: 11px; font-weight: 700;
  color: var(--muted); letter-spacing: .03em;
  display: flex; align-items: center; gap: 4px;
}
.slide-logo-dot { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; }
.slide-ig { font-family: var(--font-m); font-size: 9px; color: var(--muted); }
.slide-actions {
  display: flex; gap: 8px; padding: 16px 20px;
  border-top: 1px solid var(--border); background: #0a0a0a;
}
.slide-btn {
  flex: 1; font-family: var(--font-m); font-size: 10px; color: var(--muted2);
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px; text-align: center;
  cursor: pointer; transition: all .15s;
}
.slide-btn:hover { background: rgba(255,255,255,.08); color: var(--text); }
.slide-btn.primary {
  color: var(--accent); border-color: rgba(0,255,136,.25); background: rgba(0,255,136,.06);
}
.slide-btn.primary:hover { background: rgba(0,255,136,.12); }

/* ── BENTO GRID ── */
.bento {
  display: grid; grid-template-columns: repeat(12,1fr);
  gap: 12px; margin-bottom: 16px;
}
.span-3  { grid-column: span 3; }
.span-4  { grid-column: span 4; }
.span-5  { grid-column: span 5; }
.span-6  { grid-column: span 6; }
.span-7  { grid-column: span 7; }
.span-12 { grid-column: span 12; }

.pill-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px;
  display: flex; flex-direction: column;
  cursor: pointer; transition: all .2s;
  position: relative; overflow: hidden;
  text-decoration: none; color: inherit;
  animation: fadeUp .6s ease both;
}
.pill-card:hover {
  border-color: var(--border2);
  background: var(--card2);
  transform: translateY(-2px);
}

/* Category hover glow */
.pill-card.cat-res:hover { border-color: rgba(124,58,237,.35); box-shadow: 0 4px 24px rgba(124,58,237,.08); }
.pill-card.cat-tool:hover { border-color: rgba(8,145,178,.35); box-shadow: 0 4px 24px rgba(8,145,178,.08); }
.pill-card.cat-ind:hover  { border-color: rgba(217,119,6,.35); box-shadow: 0 4px 24px rgba(217,119,6,.08); }
.pill-card.cat-pol:hover  { border-color: rgba(220,38,38,.35); box-shadow: 0 4px 24px rgba(220,38,38,.08); }
.pill-card.cat-oss:hover  { border-color: rgba(5,150,105,.35); box-shadow: 0 4px 24px rgba(5,150,105,.08); }

/* Category left border */
.pill-card.cat-res::after  { content: ''; position: absolute; top: 0; left: 0; width: 2px; height: 100%; background: var(--c-res); opacity: .6; }
.pill-card.cat-tool::after { content: ''; position: absolute; top: 0; left: 0; width: 2px; height: 100%; background: var(--c-tool); opacity: .6; }
.pill-card.cat-ind::after  { content: ''; position: absolute; top: 0; left: 0; width: 2px; height: 100%; background: var(--c-ind); opacity: .6; }
.pill-card.cat-pol::after  { content: ''; position: absolute; top: 0; left: 0; width: 2px; height: 100%; background: var(--c-pol); opacity: .6; }
.pill-card.cat-oss::after  { content: ''; position: absolute; top: 0; left: 0; width: 2px; height: 100%; background: var(--c-oss); opacity: .6; }

.pill-card .badge { margin-bottom: 14px; }
.card-title {
  font-family: var(--font-d); font-size: 18px; font-weight: 600;
  line-height: 1.25; letter-spacing: -.02em; color: #fff; margin-bottom: 10px;
}
.span-4 .card-title,
.span-3 .card-title { font-size: 15px; }
.card-hook { font-size: 13px; color: var(--muted2); line-height: 1.6; flex: 1; }
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.card-source { font-family: var(--font-m); font-size: 10px; color: var(--muted); }
.card-date   { font-family: var(--font-m); font-size: 10px; color: var(--muted); }
.card-read   { font-family: var(--font-m); font-size: 10px; color: var(--muted2); transition: color .15s; }
.pill-card:hover .card-read { color: var(--text); }
.rank-num {
  position: absolute; top: 20px; right: 20px;
  font-family: var(--font-d); font-size: 48px; font-weight: 800;
  color: rgba(255,255,255,.04); line-height: 1; letter-spacing: -.04em;
  pointer-events: none;
}
.pill-card.compact { padding: 18px 20px; }
.compact .card-title { font-size: 14px; margin-bottom: 6px; }
.compact .card-hook  { font-size: 12px; }
.compact .badge      { margin-bottom: 10px; font-size: 9px; padding: 2px 7px; }

/* ── BOTTOM ROW ── */
.bottom-row {
  display: grid; grid-template-columns: 1fr 300px;
  gap: 12px;
}
.archive-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}

/* ── SIDEBAR ── */
.sidebar { display: flex; flex-direction: column; gap: 10px; }
.sidebar-widget {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px;
  animation: fadeUp .6s ease both;
}
.widget-title {
  font-family: var(--font-m); font-size: 10px; color: var(--muted);
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px;
}
.cat-list { display: flex; flex-direction: column; gap: 4px; }
.cat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: 7px;
  cursor: pointer; transition: background .15s;
}
.cat-row:hover { background: rgba(255,255,255,.04); }
.cat-row-left { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.cat-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cat-count {
  font-family: var(--font-m); font-size: 10px; color: var(--muted);
  background: rgba(255,255,255,.05); padding: 1px 6px; border-radius: 4px;
}
.trending-list { display: flex; flex-direction: column; }
.trend-item {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer; align-items: flex-start;
}
.trend-item:last-child { border-bottom: none; }
.trend-num { font-family: var(--font-m); font-size: 11px; color: var(--muted); width: 16px; flex-shrink: 0; line-height: 1.5; }
.trend-text { font-size: 12px; color: var(--muted2); line-height: 1.45; transition: color .15s; }
.trend-item:hover .trend-text { color: var(--text); }

/* Newsletter CTA widget */
.widget-newsletter {
  background: linear-gradient(135deg,#0f1a12 0%,#0e0e0e 100%);
  border-color: rgba(0,255,136,.15);
}
.newsletter-desc { font-size: 13px; color: var(--muted2); margin-bottom: 14px; line-height: 1.55; }
.newsletter-input {
  width: 100%; background: rgba(0,0,0,.4);
  border: 1px solid rgba(0,255,136,.2); border-radius: 7px;
  padding: 9px 12px; font-family: var(--font-m); font-size: 12px;
  color: var(--text); margin-bottom: 8px; outline: none;
  transition: border-color .15s;
}
.newsletter-input:focus { border-color: rgba(0,255,136,.4); }
.newsletter-btn {
  width: 100%;
  background: rgba(0,255,136,.1); border: 1px solid rgba(0,255,136,.3);
  border-radius: 7px; padding: 9px;
  font-family: var(--font-m); font-size: 11px; color: var(--accent);
  cursor: pointer; transition: all .15s;
}
.newsletter-btn:hover { background: rgba(0,255,136,.18); }

/* ── FOOTER ── */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 32px 40px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-m); font-size: 11px; color: var(--muted);
}
.footer-left { display: flex; align-items: center; gap: 20px; }
.footer-logo {
  font-family: var(--font-d); font-size: 14px; font-weight: 700;
  color: var(--muted);
  display: flex; align-items: center; gap: 5px;
}
.footer-links { display: flex; gap: 16px; }
.footer-link { color: var(--muted); text-decoration: none; transition: color .15s; }
.footer-link:hover { color: var(--text); }
.footer-right { color: rgba(255,255,255,.15); }

/* ── SINGLE PILL PAGE ── */
.pill-single { max-width: 760px; margin: 0 auto; padding: 48px 40px 80px; }
.pill-single .pill-title {
  font-family: var(--font-d); font-size: 42px; font-weight: 700;
  line-height: 1.1; letter-spacing: -.03em; color: #fff; margin: 24px 0 16px;
}
.pill-single .pill-hook {
  font-size: 18px; color: var(--accent); font-style: italic;
  border-left: 3px solid var(--accent); padding-left: 16px;
  margin-bottom: 32px; line-height: 1.5;
}
.pill-single .pill-body { font-size: 16px; color: var(--text); line-height: 1.8; margin-bottom: 28px; }
.pill-single .pill-takeaway {
  background: var(--card2); border: 1px solid var(--border2);
  border-left: 3px solid var(--accent); border-radius: var(--r);
  padding: 20px 24px; margin-bottom: 32px;
}
.pill-single .pill-takeaway strong { color: var(--accent); font-family: var(--font-m); font-size: 11px; letter-spacing: .08em; }

/* ── ANIMATIONS — STAGGER ── */
.bento .pill-card:nth-child(1) { animation-delay: .08s; }
.bento .pill-card:nth-child(2) { animation-delay: .14s; }
.bento .pill-card:nth-child(3) { animation-delay: .20s; }
.bento .pill-card:nth-child(4) { animation-delay: .26s; }
.bento .pill-card:nth-child(5) { animation-delay: .32s; }
.sidebar-widget:nth-child(1)   { animation-delay: .18s; }
.sidebar-widget:nth-child(2)   { animation-delay: .26s; }
.sidebar-widget:nth-child(3)   { animation-delay: .34s; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .hero-pill { grid-template-columns: 1fr; }
  .hero-slide { border-left: none; border-top: 1px solid var(--border); min-height: 380px; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .span-5, .span-7 { grid-column: span 6; }
  .span-3, .span-4 { grid-column: span 6; }
}
@media (max-width: 768px) {
  header { padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
  .logo-tag { display: none; }
  nav { display: none; }
  main { padding: 24px 20px 60px; }
  .hero-pill { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .bento [class*="span-"] { grid-column: span 12; }
  .bottom-row { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  footer { flex-direction: column; gap: 16px; text-align: center; }
  .footer-left { flex-direction: column; gap: 12px; }
}
