/* ============================================================
   site.css — dark Inter system, squared.
   Per Inter_Typography.md: Inter + JetBrains Mono, 1280px
   container, 8px rhythm, tight tracking. No rounded corners,
   no glow, no lift/translate motion — color changes only.
   ============================================================ */

:root {
  --bg: #0a0a0b;
  --surface: #121214;
  --surface-2: #17171a;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(34, 211, 238, 0.25); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

a { color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; }

.mono { font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace; }
.muted { color: var(--muted); }

.container { max-width: 1280px; margin-inline: auto; padding-inline: 1.5rem; }
.section { margin-block: clamp(3rem, 6vw, 5rem); }
.section-title { font-size: 1.25rem; margin-bottom: 16px; }

.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 14px; height: 14px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px;
  background: var(--text); color: #0a0a0b;
  font: 700 10px/1 "JetBrains Mono", monospace; letter-spacing: 0.05em;
}
.brand-name { font-weight: 600; font-size: 0.9375rem; }
.site-nav { display: flex; gap: 2px; }
.site-nav a {
  text-decoration: none; color: var(--muted); font-size: 0.875rem; font-weight: 500;
  padding: 8px 12px;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--text); }
.site-nav a.active { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  max-width: 760px;
  margin-inline: auto;
  padding-block: clamp(4rem, 8vw, 6rem) 0;
  text-align: left;
}
.hero-eyebrow {
  font-family: "JetBrains Mono", monospace; font-size: 0.8125rem;
  color: var(--muted); margin-bottom: 14px;
}
.hero-title { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; letter-spacing: -0.035em; }
.hero-sub { margin-top: 14px; color: var(--muted); max-width: 58ch; }
.hero-actions { display: flex; gap: 10px; margin-top: 24px; }
.hero-meta { margin-top: 20px; color: var(--muted); font-size: 0.8125rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  font-weight: 600; font-size: 0.9375rem; text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--accent); color: #06202a; }
.btn-primary:hover { background: #1ab3cf; }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }

/* ---------- landing category cards (asymmetric 7/5) ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.cat-card {
  grid-column: span 6;
  display: flex; flex-direction: column; gap: 8px;
  padding: 24px;
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: border-color 0.15s ease;
}
.cat-card.span-7 { grid-column: span 7; }
.cat-card.span-5 { grid-column: span 5; }
.cat-card:hover { border-color: var(--border-strong); }
.cat-eyebrow {
  font-family: "JetBrains Mono", monospace; font-size: 0.75rem;
  color: var(--muted);
}
.cat-title { font-size: 1.375rem; }
.cat-desc { color: var(--muted); font-size: 0.9375rem; max-width: 52ch; }
.cat-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 16px; color: var(--muted); font-size: 0.8125rem;
}

/* ---------- recent rows ---------- */
.recent-list { display: grid; gap: 8px; }
.recent-row {
  display: grid; grid-template-columns: 92px 1fr auto;
  align-items: center; gap: 14px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.recent-row:hover { border-color: var(--border-strong); }
.recent-date { color: var(--muted); font-size: 0.8125rem; }
.recent-title { font-weight: 500; }

/* ---------- chips & tags ---------- */
.chip {
  font-size: 0.75rem; padding: 3px 8px;
  border: 1px solid var(--border); color: var(--muted); background: var(--surface-2);
  white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-size: 0.75rem; padding: 3px 9px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: var(--muted);
}

/* ---------- page intro band ---------- */
.page-intro { padding-block: clamp(3rem, 6vw, 4.5rem) 0; }
.page-intro h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
.page-intro .lede { color: var(--muted); margin-top: 12px; max-width: 68ch; }
.intro-meta { margin-top: 16px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.875rem; }
.back-home {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  color: var(--muted); font-size: 0.875rem; font-weight: 500;
  transition: color 0.15s ease;
}
.back-home:hover { color: var(--text); }

/* ---------- item cards: flat grid, 3 per row ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1000px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .card-grid { grid-template-columns: 1fr; } }
.item-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.15s ease;
}
.item-card:hover { border-color: var(--border-strong); }
.item-media {
  position: relative; display: block; aspect-ratio: 16 / 9;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.item-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.14); }
.media-fallback .icon { width: 40px; height: 40px; }
.item-body { display: flex; flex-direction: column; gap: 10px; padding: 18px; flex: 1; }
.item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.item-topic { font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; }
.item-top h3 { font-size: 1.0625rem; }
.item-top h3 a { text-decoration: none; }
.item-top h3 a:hover { color: var(--accent); }
.item-desc { color: var(--muted); font-size: 0.9rem; }
.item-actions { display: flex; align-items: center; gap: 16px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }

.usage summary { cursor: pointer; color: var(--muted); font-size: 0.875rem; font-weight: 500; list-style: none; }
.usage summary::-webkit-details-marker { display: none; }
.usage[open] summary { color: var(--text); }
.usage ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.9rem; display: grid; gap: 6px; }

/* ---------- personal page ---------- */
.groups-wrap { margin-top: clamp(2rem, 4vw, 3rem); padding-bottom: clamp(3rem, 6vw, 5rem); display: grid; gap: 2.5rem; }
.group-head h2 { font-size: 1.125rem; }
.group-head p { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.group-block { display: grid; gap: 10px; }
.file-row {
  display: grid; grid-template-columns: 20px 1fr auto;
  align-items: center; gap: 14px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; transition: border-color 0.15s ease;
}
.file-row:hover { border-color: var(--border-strong); }
.file-row .icon { color: var(--muted); }
.file-name { font-weight: 500; font-size: 0.9375rem; }
.file-row .mono { font-size: 0.8125rem; }

/* ---------- empty states ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 28px; border: 1px dashed var(--border-strong);
  color: var(--muted); font-size: 0.9rem;
}
.empty-state .icon { width: 24px; height: 24px; opacity: 0.5; }
.empty-state.small { padding: 20px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 28px; margin-top: 2rem; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-row, .footer-row .mono { font-size: 0.8125rem; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cat-card, .cat-card.span-7, .cat-card.span-5 { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .recent-row { grid-template-columns: 1fr; gap: 2px; }
  .recent-date { display: none; }
  .file-row { grid-template-columns: 20px 1fr; }
  .file-row .mono { display: none; }
  .brand-name { display: none; }
}
