/* =====================================================================
   Layout — header, footer, hero and page structure
   Shared by every site.
   ===================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -.02em;
  flex: none;
}

.brand-mark {
  width: 20px; height: 20px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), #ffb703);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.brand-name { font-size: 1.06rem; }

.primary-nav { flex: 1; min-width: 0; overflow: hidden; }
.primary-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.primary-nav ul::-webkit-scrollbar { display: none; }
.primary-nav a {
  display: block;
  padding: 6px 11px;
  border-radius: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
}
.primary-nav a:hover { color: var(--text); background: var(--bg-raised); }
.primary-nav a.is-active { color: var(--accent-text); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }

/* The menu button only appears on narrow screens. */
.nav-toggle {
  display: none;
  place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--text-dim);
  cursor: pointer;
}
.nav-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.nav-toggle[aria-expanded="true"] { color: var(--accent-text); border-color: var(--accent); }

/* The mobile drawer. It sits below the header bar and lists the categories. */
.mobile-nav {
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  max-height: calc(100vh - 62px);
  overflow-y: auto;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0; padding: 8px 24px 14px;
  gap: 2px;
}
.mobile-nav a {
  display: block;
  padding: 11px 12px;
  border-radius: var(--radius-s);
  color: var(--text-dim);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 550;
}
.mobile-nav a:hover,
.mobile-nav a:focus-visible { background: var(--bg-input); color: var(--text); }

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 7px 10px 7px 11px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--text-dim);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text); }

.search-trigger-kbd {
  font-family: var(--font-mono);
  font-size: .72rem;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--text-faint);
  background: var(--bg-raised);
}

/* On narrow screens the horizontal category nav is replaced by a drawer, so
   the categories stay reachable instead of disappearing. */
@media (max-width: 860px) {
  .search-trigger-label, .search-trigger-kbd { display: none; }
  .primary-nav { display: none; }
  .nav-toggle { display: grid; }
}

@media (max-width: 420px) {
  .brand-name { display: none; }
}


.hero { padding: 72px 24px 44px; }

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5.2vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -.035em;
  font-weight: 800;
  max-width: 18ch;
}

.lede {
  margin: 0 0 28px;
  max-width: 62ch;
  font-size: 1.06rem;
  color: var(--text-dim);
}
.lede strong { color: var(--text); font-weight: 600; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font: inherit;
  font-size: .94rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border-strong);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); }

.btn-hint {
  font-family: var(--font-mono);
  font-size: .74rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .18);
}

.hero-stats {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-faint);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}


.section { padding: 34px 24px 12px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.section-head-meta { font-size: .82rem; color: var(--text-faint); font-family: var(--font-mono); }

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  overflow: hidden;
  transition: border-color .15s, transform .12s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.card-image { display: block; overflow: hidden; background: var(--bg-input); position: relative; z-index: 0; }
.card-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  /* The OG artwork carries its title on the left third. Anchoring the crop
     there keeps the text visible in a narrow card. */
  object-position: left center;
  transition: transform .3s ease;
}
.card:hover .card-image img { transform: scale(1.03); }

.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin: 0 18px;
}

.card-title {
  margin: 0 18px;
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.012em;
}
.card-title a { color: inherit; text-decoration: none; }
.card:hover .card-title { color: var(--accent-text); }

/* The title link is stretched over the whole card, so clicking the image,
   the excerpt, or any blank space in the card opens the article. The tag
   chips sit above it, so they keep their own action. */
.card { position: relative; }
.card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card-tags { position: relative; z-index: 2; }
.card-top { position: relative; z-index: 2; }

.card-excerpt {
  margin: 0 18px;
  font-size: .88rem;
  color: var(--text-dim);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: auto 18px 0; padding: 6px 0 18px; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .72rem;
  font-family: var(--font-mono);
  text-decoration: none;
}
.tag:hover { color: var(--accent-text); border-color: var(--accent); }

.tag.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}


.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--text-faint);
  font-size: .87rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-inner p { margin: 0; max-width: 62ch; }
.footer-meta { font-family: var(--font-mono); font-size: .78rem; }

.linklike {
  background: none; border: 0; padding: 0;
  color: var(--link);
  font: inherit;
  font-family: var(--font-mono);
  font-size: .78rem;
  cursor: pointer;
  text-decoration: underline;
}

/* =====================================================================
   GENERATED PAGES — article, listings, archives
   ===================================================================== */

.breadcrumbs { margin: 0 0 22px; font-size: .8rem; }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
  margin: 0; padding: 0;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.breadcrumbs li + li::before { content: "/"; margin-right: 7px; opacity: .5; }
.breadcrumbs a { color: var(--text-dim); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-text); }
.breadcrumbs li[aria-current] { color: var(--text-faint); }
