/* Snippet Shelf — shared stylesheet */
:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f1f0ea;
  --text: #1f1f1c;
  --muted: #6b6a63;
  --border: #e3e1d8;
  --accent: #1d6f5f;
  --accent-soft: #d9eee8;
  --code-bg: #1e2227;
  --code-text: #e6e6e1;
  --code-key: #7fd1b9;
  --code-str: #f3c679;
  --code-cmt: #8a919a;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.12);
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416;
    --surface: #1a1d20;
    --surface-2: #22262a;
    --text: #e8e8e3;
    --muted: #9a9f96;
    --border: #2c3135;
    --accent: #6fcfb5;
    --accent-soft: #1b3a33;
    --code-bg: #0d0f11;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: var(--mono); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5rem; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: 1.5rem; margin-top: 0; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }

.container { max-width: 1040px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 1rem;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 700; font-size: 1.05rem; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: .85rem; font-weight: 700;
}
.nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.nav a {
  color: var(--muted); padding: .4rem .75rem; border-radius: 8px;
  font-size: .95rem; font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* Hero */
.hero { padding: 5rem 0 3.5rem; text-align: center; }
.hero .eyebrow {
  display: inline-block; font-family: var(--mono); font-size: .8rem;
  color: var(--accent); background: var(--accent-soft);
  padding: .25rem .7rem; border-radius: 999px; margin-bottom: 1.25rem;
}
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 560px; margin: 0 auto 2rem; }
.btn {
  display: inline-block; padding: .7rem 1.3rem; border-radius: 10px;
  font-weight: 600; background: var(--accent); color: #fff;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); opacity: .92; }
.btn.secondary { background: var(--surface-2); color: var(--text); margin-left: .5rem; }

/* Cards */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow); color: var(--text);
  display: flex; flex-direction: column; gap: .5rem;
  transition: transform .15s ease, border-color .15s ease;
}
a.card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--accent); }
.card .icon { font-size: 1.6rem; }
.card p { color: var(--muted); margin: 0; flex: 1; }
.card .more { color: var(--accent); font-weight: 600; font-size: .9rem; }

/* Sections */
section { padding: 2.5rem 0; }
.section-title { display: flex; align-items: baseline; gap: .75rem; margin-bottom: 1.25rem; }
.section-title h2 { margin: 0; }
.section-title .count { color: var(--muted); font-family: var(--mono); font-size: .85rem; }

/* Cheat sheet page */
.page-head { padding: 3rem 0 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.page-head p { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0; }
.sheet { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.block h3 {
  margin: 0; padding: .9rem 1.25rem; font-size: .95rem;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.block dl { margin: 0; }
.block .row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--border);
  align-items: center;
}
.block .row:last-child { border-bottom: 0; }
.block dt { margin: 0; }
.block dd { margin: 0; color: var(--muted); font-size: .9rem; }
.block dt code {
  display: inline-block; background: var(--code-bg); color: var(--code-text);
  font-size: .82rem; padding: .2rem .5rem; border-radius: 6px;
  word-break: break-all;
}
pre {
  margin: 0; background: var(--code-bg); color: var(--code-text);
  padding: 1.1rem 1.25rem; overflow-x: auto; font-size: .85rem; line-height: 1.65;
  border-radius: 0 0 var(--radius) var(--radius);
}
.k { color: var(--code-key); }
.s { color: var(--code-str); }
.c { color: var(--code-cmt); font-style: italic; }
.tip {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: .9rem 1.1rem; border-radius: 0 10px 10px 0; margin: 2rem 0;
}
.tip strong { color: var(--accent); }

/* Prose (about) */
.prose { max-width: 680px; }
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .35rem; }
kbd {
  font-size: .8em; padding: .1em .45em; border-radius: 5px;
  border: 1px solid var(--border); border-bottom-width: 2px; background: var(--surface-2);
}

/* Footer */
.site-footer {
  margin-top: 4rem; padding: 2rem 0; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .9rem;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

@media (max-width: 600px) {
  .site-header .container { height: auto; padding-top: .6rem; padding-bottom: .6rem; flex-direction: column; align-items: flex-start; }
  .hero { padding: 3rem 0 2rem; }
  .block .row { grid-template-columns: 1fr; gap: .3rem; }
  .btn.secondary { margin-left: 0; margin-top: .5rem; }
}
