/* Hien Labs — modern blog styles (mtlblog-inspired, dark-mode aware) */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f4;
  --text: #141416;
  --muted: #6b6b70;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --cat: #dc2626;
  --border: #e6e6e3;
  --card: #ffffff;
  --topbar: #0d0d10;
  --topbar-text: #f4f4f5;
  --max-width: 46rem;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101013;
    --bg-soft: #17171b;
    --text: #ececef;
    --muted: #9a9aa2;
    --accent: #818cf8;
    --accent-strong: #a5b4fc;
    --cat: #f87171;
    --border: #26262c;
    --card: #17171b;
    --topbar: #0a0a0c;
    --topbar-text: #f4f4f5;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar);
  color: var(--topbar-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--topbar-text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin-right: auto;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
}

.topnav {
  display: flex;
  gap: 1.1rem;
}

.topnav a {
  color: rgba(244, 244, 245, 0.75);
  text-decoration: none;
  font-size: 0.95rem;
}

.topnav a:hover { color: #fff; }

.btn-subscribe {
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.btn-subscribe:hover { background: var(--accent-strong); }

/* ---------- layout ---------- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

/* ---------- hero ---------- */
.hero { text-align: center; padding: 2.5rem 0 1.5rem; }

.hero h1 {
  font-size: clamp(2rem, 6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 0.75rem;
}

.hero .lede {
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0 auto;
  max-width: 34rem;
}

/* ---------- category chips ---------- */
.chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.25rem 0 0.5rem;
}

.chips a {
  text-decoration: none;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.chips a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- feed cards ---------- */
.feed-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 2.25rem 0 1.25rem;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.card {
  display: grid;
  grid-template-columns: 13rem 1fr;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.card-cover {
  display: grid;
  place-items: center;
  min-height: 9.5rem;
  font-size: 3.2rem;
}

.cover-rocket { background: linear-gradient(135deg, #4f46e5, #9333ea); }
.cover-money  { background: linear-gradient(135deg, #d97706, #f59e0b); }
.cover-trophy { background: linear-gradient(135deg, #059669, #14b8a6); }
.cover-robot  { background: linear-gradient(135deg, #0284c7, #06b6d4); }
.cover-wave   { background: linear-gradient(135deg, #475569, #64748b); }

.card-body { padding: 1rem 1.25rem 1.1rem; }

.card-cat {
  color: var(--cat);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card h3 {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.card-dek {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.card-meta {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .card { grid-template-columns: 1fr; }
  .card-cover { min-height: 7.5rem; }
}

/* ---------- article pages ---------- */
article h1 {
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 1rem 0 0.4rem;
}

.post-cat {
  color: var(--cat);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1.5rem 0 0;
}

.post-meta { color: var(--muted); margin: 0.25rem 0 1.75rem; }

article h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2.25rem;
}

article a { color: var(--accent); }

.src-note {
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 2.5rem;
}

.back-link { margin-top: 2rem; font-size: 0.95rem; }

/* ---------- generic ---------- */
a { color: var(--accent); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

pre {
  overflow-x: auto;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
}

pre code { background: none; border: none; padding: 0; }

.ad-slot { margin: 1.25rem 0 0; min-height: 0; }
.ad-slot:empty { display: none; }
/* Collapse slots Google hasn't filled yet (pre-approval) — no blank gap */
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }

/* ---------- newsletter ---------- */
.newsletter {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  margin: 3rem 0 1rem;
}

.newsletter h2 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.newsletter p { color: var(--muted); margin: 0 0 1.1rem; }

.btn-rss {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 0.65rem 1.6rem;
  border-radius: 999px;
}

.btn-rss:hover { background: var(--accent-strong); }

/* ---------- footer ---------- */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

footer a { color: var(--muted); }
footer p { margin: 0; }
