:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111111;
  --muted: #6b6b6b;
  --border: #e7e7e7;
  --border-strong: #d4d4d4;
  --accent: #0a66ff;
  --accent-soft: #e6efff;
  --live: #15803d;
  --live-soft: #dcfce7;
  --wip: #b45309;
  --wip-soft: #fef3c7;
  --idle: #6b7280;
  --idle-soft: #f1f3f5;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.06), 0 12px 28px rgba(0, 0, 0, 0.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #111;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}
.brand-name { font-size: 15px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a.active { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }

/* ===== Hero ===== */
.hero {
  padding: 36px 0 20px;
  max-width: 720px;
}
.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 12px;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

/* ===== Sections ===== */
.cards-section {
  margin-top: 48px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.section-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-head .more {
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s ease;
}
.section-head .more:hover { color: var(--accent); }

/* ===== Cards ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 14px;
}
.card {
  display: block;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}

.card-preview {
  position: relative;
  height: 72px;
  margin: -18px -18px 14px;
  background: linear-gradient(135deg, var(--tone-a, #6b7280), var(--tone-b, #94a3b8));
  overflow: hidden;
}
.card-preview::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -10%;
  width: 60%;
  height: 180%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.38), transparent 65%);
  filter: blur(2px);
}
.card-preview::after {
  content: "";
  position: absolute;
  bottom: -60%;
  right: -15%;
  width: 70%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.18), transparent 65%);
  filter: blur(2px);
}
.card-preview .glyph {
  position: absolute;
  right: 12px;
  bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
  z-index: 1;
}

.tone-indigo { --tone-a: #4338ca; --tone-b: #818cf8; }
.tone-green  { --tone-a: #15803d; --tone-b: #4ade80; }
.tone-amber  { --tone-a: #b45309; --tone-b: #fbbf24; }
.tone-violet { --tone-a: #6d28d9; --tone-b: #c084fc; }
.tone-orange { --tone-a: #c2410c; --tone-b: #fb923c; }
.tone-teal   { --tone-a: #0f766e; --tone-b: #5eead4; }
.tone-rose   { --tone-a: #be123c; --tone-b: #fb7185; }
.tone-cyan   { --tone-a: #0e7490; --tone-b: #67e8f9; }
.tone-slate  { --tone-a: #334155; --tone-b: #94a3b8; }
.tone-fuchsia{ --tone-a: #a21caf; --tone-b: #e879f9; }
.tone-sky    { --tone-a: #075985; --tone-b: #7dd3fc; }
.tone-lime   { --tone-a: #4d7c0f; --tone-b: #bef264; }
a.card { cursor: pointer; }
a.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--idle-soft);
  color: var(--idle);
  text-transform: lowercase;
}
.tag-live { background: var(--live-soft); color: var(--live); }
.tag-wip { background: var(--wip-soft); color: var(--wip); }
.tag-accent { background: var(--accent-soft); color: var(--accent); }
.card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.card-link {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

/* ===== Detail page (projects/tools) ===== */
.page-head {
  padding: 36px 0 12px;
  max-width: 720px;
}
.page-head h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.detail-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 24px;
}
.detail-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 22px;
  box-shadow: var(--shadow);
}
@media (max-width: 720px) {
  .detail-card { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
}
.detail-side h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.detail-side .detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.detail-side .detail-path {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.detail-body p {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}
.detail-body p:last-child { margin-bottom: 0; }
.detail-body .muted {
  color: var(--muted);
  font-size: 14px;
}
.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: #000; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.btn-ghost:hover { background: var(--surface); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}
