@import url("https://api.fontshare.com/v2/css?f[]=clash-display@600&display=swap");

:root {
  --bg: #fefefe;
  --bar: rgba(254, 254, 254, 0.8);
  --bar-border: rgba(229, 231, 235, 0.5);
  --text: #364153;
  --strong: #101828;
  --muted: #99a1af;
  --rule: #d1d5dc;
  --tile: #f3f4f6;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Clash Display", var(--font);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --bar: rgba(10, 10, 10, 0.8);
    --bar-border: rgba(55, 65, 81, 0.5);
    --text: #d1d5dc;
    --strong: #ffffff;
    --muted: #6a7282;
    --rule: #364153;
    --tile: #1e2939;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ---------- Header ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin-top: 32px;
  background: var(--bar);
  border-bottom: 1px solid var(--bar-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.bar-inner {
  max-width: 42rem;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.name {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  color: var(--strong);
  text-decoration: none;
}
.nav { display: flex; gap: 20px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--strong); }

/* ---------- Layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 24px 20px 32px;
}
.stack > * + * { margin-top: 40px; }

.intro { font-size: 18px; line-height: 1.7; }
.intro p + p { margin-top: 20px; }
.intro a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); transition: text-decoration-color .2s; }
.intro a:hover { text-decoration-color: currentColor; }

h3 { font-size: 18px; font-weight: 400; color: var(--strong); margin-bottom: 12px; }

/* ---------- Rows ---------- */
.list { border-top: 1px dashed var(--rule); }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--rule);
  text-decoration: none;
}
.row-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.row-id { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 24px; height: 24px; border-radius: 6px; flex: none;
  object-fit: cover; background: var(--tile);
}
.logo-pair { display: flex; flex: none; }
.logo-pair { gap: 4px; }
.mono {
  width: 24px; height: 24px; border-radius: 6px; flex: none;
  display: grid; place-items: center;
  font: 600 9px/1 var(--display); letter-spacing: .02em;
  color: #fff;
}
.mono.roc { background: #111827; }
.mono.tac { background: #1d3557; }
.org { font-size: 16px; line-height: 1.35; color: var(--text); }
.role { font-size: 14px; color: var(--muted); }
.when { font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
a.row .org { transition: color .2s; }
a.row:hover .org { color: var(--strong); }
.row-main.tall { flex-direction: column; align-items: flex-start; gap: 0; }
.row-main.tall .role { padding-left: 36px; }
.arrow { font-size: 12px; color: var(--muted); }
.pill {
  font-size: 11px; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 1px 7px; line-height: 16px;
}
.live { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #05df72; margin-right: 6px; vertical-align: middle; }

.rec .org { font-size: 15px; }

/* ---------- Writing ---------- */
.post-row .org { font-size: 16px; }
.article { font-size: 17px; line-height: 1.75; }
.article h1 { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.2; color: var(--strong); }
.article .meta { margin-top: 10px; font-size: 14px; color: var(--muted); }
.article h2 { font-size: 20px; font-weight: 600; color: var(--strong); margin-top: 44px; }
.article h4 { font-size: 16px; font-weight: 600; color: var(--strong); margin-top: 28px; }
.article p { margin-top: 18px; }
.article blockquote {
  margin-top: 18px; padding-left: 16px;
  border-left: 2px solid var(--rule); color: var(--muted); font-style: italic;
}
.article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85em; background: var(--tile); border-radius: 4px; padding: 1px 5px;
}
.article pre {
  margin-top: 18px; padding: 14px 16px; overflow-x: auto;
  background: var(--tile); border-radius: 8px; line-height: 1.6;
}
.article pre code { background: none; padding: 0; font-size: 13px; }
.back { display: inline-block; margin-bottom: 28px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--strong); }

footer {
  max-width: 42rem; width: 100%; margin: 0 auto;
  padding: 24px 20px 40px; font-size: 13px; color: var(--muted);
}

/* ---------- Motion ---------- */
.fade { animation: rise .7s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade { animation: none; } }

@media (max-width: 768px) {
  .bar { margin-top: 12px; }
  .intro, .article { font-size: 16px; }
  .article h1 { font-size: 26px; }
  .row { align-items: flex-start; }
  .row-main { flex-direction: column; align-items: flex-start; gap: 0; }
  .row-main .role { padding-left: 36px; }
  .row-main:has(.logo-pair) .role { padding-left: 64px; }
  .when { padding-top: 2px; }
}
