/* AgentBrief — styled after the Chirpy Jekyll theme (szehoyeu.github.io)
   Fonts: Lato (headings) + Source Sans Pro (body)
   Light/dark auto via prefers-color-scheme; manual toggle sets html[data-theme]. */

:root {
  --main-bg: #ffffff;
  --text-color: #34343c;
  --heading-color: #2a2a2a;
  --muted: #757575;
  --accent: #0056b2;
  --accent-soft: #f6f8fa;
  --border: #f3f3f3;
  --border-strong: #e9ecef;
  --topbar-bg: rgba(255, 255, 255, 0.7);
  --shadow: rgb(104, 104, 104, 0.05) 0 2px 6px 0, rgba(211, 209, 209, 0.15) 0 0 0 1px;
  --radius: 0.375rem;
  --maxw: 930px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --main-bg: rgb(27, 27, 30);
    --text-color: rgb(175, 176, 177);
    --heading-color: #cccccc;
    --muted: #868686;
    --accent: rgb(138, 180, 248);
    --accent-soft: #1e1e1e;
    --border: rgb(44, 45, 45);
    --border-strong: rgb(44, 45, 45);
    --topbar-bg: rgba(27, 27, 30, 0.64);
    --shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05);
  }
}
html[data-theme="dark"] {
  --main-bg: rgb(27, 27, 30);
  --text-color: rgb(175, 176, 177);
  --heading-color: #cccccc;
  --muted: #868686;
  --accent: rgb(138, 180, 248);
  --accent-soft: #1e1e1e;
  --border: rgb(44, 45, 45);
  --border-strong: rgb(44, 45, 45);
  --topbar-bg: rgba(27, 27, 30, 0.64);
  --shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05);
}
html[data-theme="light"] {
  --main-bg: #ffffff;
  --text-color: #34343c;
  --heading-color: #2a2a2a;
  --muted: #757575;
  --accent: #0056b2;
  --accent-soft: #f6f8fa;
  --border: #f3f3f3;
  --border-strong: #e9ecef;
  --topbar-bg: rgba(255, 255, 255, 0.7);
  --shadow: rgb(104, 104, 104, 0.05) 0 2px 6px 0, rgba(211, 209, 209, 0.15) 0 0 0 1px;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--main-bg);
  color: var(--text-color);
  font: 400 1rem/1.75 "Source Sans Pro", -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6,
.brand, .tbl-title, .strip > h2 {
  font-family: Lato, "Source Sans Pro", sans-serif;
  color: var(--heading-color);
}
a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--accent); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.1rem; }

/* ---------- header (Chirpy topbar) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.1rem; height: 3.25rem; }
.brand {
  font-weight: 700; font-size: 1.15rem; color: var(--heading-color);
  letter-spacing: -.01em; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); margin-right: 2px; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted); font-size: .9rem; font-weight: 600;
  padding: .3rem .6rem; border-radius: var(--radius);
  white-space: nowrap; text-decoration: none;
}
.nav a:hover { color: var(--heading-color); background: var(--accent-soft); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.gh { color: var(--muted); display: flex; }
.gh:hover { color: var(--heading-color); }
.theme-toggle {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  width: 2rem; height: 2rem; cursor: pointer; font-size: .95rem;
}
.theme-toggle:hover { color: var(--heading-color); }

/* ---------- hero (featured card) ---------- */
.hero {
  margin: 1.6rem 0 .5rem; padding: 1.5rem 1.6rem;
  background: var(--main-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero h1 { margin: .35rem 0 .8rem; font-size: 1.7rem; line-height: 1.3; }
.hero h1 a { color: var(--heading-color); text-decoration: none; }
.hero h1 a:hover { color: var(--accent); }

/* ---------- sections ---------- */
.strip { margin: 2rem 0; }
.strip > h2 {
  font-size: 1.15rem; font-weight: 700; margin: 0 0 .9rem;
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: .45rem; border-bottom: 1px solid var(--border);
}
.strip > h2 .more { font-size: .82rem; font-weight: 600; text-decoration: none; }
.grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ---------- cards (Chirpy card) ---------- */
.card {
  background: var(--main-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
  transition: box-shadow .15s ease, transform .12s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px 0 rgba(104,104,104,.12), 0 0 0 1px rgba(211,209,209,.25); }
.card-link { color: inherit; display: block; text-decoration: none; }
.card h3 { margin: .2rem 0 .35rem; font-size: 1.02rem; line-height: 1.4; font-weight: 700; }
.card-link:hover h3 { color: var(--accent); }
.card p { margin: 0 0 .5rem; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.card-kicker {
  font-size: .78rem; color: var(--muted); font-weight: 600;
  text-transform: none; letter-spacing: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dot { opacity: .55; margin: 0 2px; }
.card-meta { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: auto; padding-top: .5rem; }

/* ---------- chips (Chirpy labels) ---------- */
.chip {
  font-size: .75rem; font-weight: 600; color: var(--muted);
  background: var(--accent-soft); border-radius: 3px; padding: .1rem .5rem;
  text-decoration: none;
}
.chip-up { color: var(--accent); }
.card.rec h3 { margin-top: .1rem; }

/* ---------- lede + table titles ---------- */
.lede { color: var(--muted); font-size: .98rem; margin: 1.2rem 0 .3rem; max-width: 68ch; }
.tbl-title {
  font-size: 1.15rem; font-weight: 700; margin: 2rem 0 .9rem;
  padding-bottom: .45rem; border-bottom: 1px solid var(--border);
}

/* ---------- ranking tables (Chirpy tables) ---------- */
.rank {
  width: 100%; border-collapse: collapse; background: var(--main-bg);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.rank th, .rank td { padding: .6rem .85rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .92rem; }
.rank th { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.rank tbody tr:nth-child(odd) { background: rgba(128, 128, 128, 0.03); }
.rank tr:last-child td { border-bottom: 0; }
.rank td.num { white-space: nowrap; color: var(--muted); font-weight: 600; }
.rank .sub { color: var(--muted); font-size: .84rem; line-height: 1.5; margin-top: 2px; font-weight: 400; }
.rank a { font-weight: 600; text-decoration: none; }
.rank a:hover { text-decoration: underline; }

/* ---------- blog list ---------- */
.bloglist { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.bloglist li {
  background: var(--main-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .6rem .9rem; display: flex; justify-content: space-between; gap: .8rem;
}
.bloglist a { font-weight: 600; text-decoration: none; }
.bloglist .when { color: var(--muted); font-size: .82rem; white-space: nowrap; }

/* ---------- video cards ---------- */
.video-card .video-thumb {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius);
  overflow: hidden; margin-bottom: .6rem; background: var(--accent-soft);
}
.video-card .video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card .play {
  position: absolute; inset: 0; margin: auto; width: 2.6rem; height: 2.6rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); color: #fff; border-radius: 50%;
  font-size: .9rem; padding-left: 3px; transition: transform .15s ease;
}
.video-card:hover .play { transform: scale(1.12); }

/* ---------- idea cards ---------- */
.idea-card { border-left: 3px solid var(--accent); }
.idea-card code {
  background: var(--accent-soft); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 5px; font-size: .85em;
}
.idea-card .sub { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.chip-idea { background: var(--accent); color: var(--main-bg); }

/* ---------- footer (Chirpy footer) ---------- */
.site-footer {
  margin-top: 3rem; border-top: 1px solid var(--border);
  padding: 1.6rem 0 2.6rem; color: var(--muted); font-size: .88rem;
}
.footer-inner { display: grid; gap: .6rem; }
.footer-links { display: flex; gap: 1.1rem; }
.footer-links a { text-decoration: none; font-weight: 600; }
.footer-built { font-size: .78rem; opacity: .85; }

@media (max-width: 640px) {
  .header-inner { gap: .6rem; }
  .hero { padding: 1.1rem 1.2rem; }
  .hero h1 { font-size: 1.35rem; }
  .rank th:nth-child(4), .rank td:nth-child(4) { display: none; }
}


/* ---------- post list (Chirpy post-list style) ---------- */
.post-list { display: flex; flex-direction: column; }
.post-item {
  display: flex; gap: .85rem; align-items: flex-start;
  padding: .85rem 0; border-bottom: 1px solid var(--border);
}
.post-item:last-child { border-bottom: 0; }
.post-thumb {
  flex: 0 0 42px; width: 42px; height: 42px;
  border-radius: var(--radius); background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border: 1px solid var(--border);
  text-decoration: none;
}
.post-thumb img { width: 24px; height: 24px; object-fit: contain; display: block; }
.post-thumb.round { border-radius: 50%; }
.post-thumb.round img { width: 100%; height: 100%; object-fit: cover; }
.post-content { flex: 1; min-width: 0; }
.post-title {
  font-family: Lato, "Source Sans Pro", sans-serif;
  font-weight: 700; font-size: 1.02rem; line-height: 1.4;
  color: var(--heading-color); text-decoration: none;
  display: block; margin: 0 0 .15rem;
}
.post-title:hover { color: var(--accent); }
.post-meta {
  font-size: .8rem; color: var(--muted); line-height: 1.5;
  display: flex; gap: .4rem; flex-wrap: wrap; align-items: center;
}
.post-excerpt {
  margin: .3rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.idea-item { border-left: 3px solid var(--accent); padding-left: .8rem; }
.row-fav.round { border-radius: 50%; }
.row-fav {
  width: 18px; height: 18px; vertical-align: -3px; margin-right: .4rem;
  border-radius: 3px;
}
.hero-head { display: flex; gap: 1rem; align-items: flex-start; }
/* hero favicon */
.hero .post-thumb { flex: 0 0 48px; width: 48px; height: 48px; }
