/* pbcv.dev design system: one typeface, one ground, one ink, one accent.
   No gradients, shadows at rest, eyebrow labels, index numbers or italic
   accents. Shared by the homepage, 404 and (later) blog/project pages. */

:root {
  --bg: #ffffff;
  --surface: #f4f4f5;
  --ink: #09090b;
  --muted: #52525b;
  --border: #e4e4e7;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-ink: #ffffff;
  --code-bg: #f4f4f5;

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --radius: 6px;
  --page: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-gap: clamp(80px, 12vw, 160px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --surface: #18181b; --ink: #fafafa; --muted: #a1a1aa;
    --border: #27272a; --accent: #60a5fa; --accent-hover: #93c5fd; --accent-ink: #09090b;
    --code-bg: #18181b;
  }
}
:root[data-theme="dark"], :root[data-theme="dim"] {
  --bg: #09090b; --surface: #18181b; --ink: #fafafa; --muted: #a1a1aa;
  --border: #27272a; --accent: #60a5fa; --accent-hover: #93c5fd; --accent-ink: #09090b;
  --code-bg: #18181b;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(44px, 7vw, 84px); line-height: 1; letter-spacing: -0.035em; }
h2 { font-size: clamp(28px, 3.2vw, 36px); line-height: 1.1; letter-spacing: -0.02em; }
h3 { font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }

/* ---------- Buttons (shadcn: default, outline, ghost) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: var(--radius);
  font: inherit; font-size: 16px; font-weight: 500; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-outline { background: var(--bg); color: var(--ink); border-color: var(--border); }
.btn-outline:hover { background: var(--surface); color: var(--ink); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.site-head { padding-top: 20px; padding-bottom: 20px; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wordmark { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) { padding: 8px 12px; border-radius: var(--radius); text-decoration: none; font-size: 16px; color: var(--muted); }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.site-nav .btn { margin-left: 8px; }

/* ---------- Sections ---------- */
.section { margin-top: var(--section-gap); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head a { font-size: 16px; }

/* ---------- Footer ---------- */
.site-foot { margin-top: var(--section-gap); padding: 48px 0 40px; background: var(--surface); }
.site-foot .name { font-size: clamp(40px, 8vw, 96px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.site-foot .meta { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: 15px; }
.site-foot .meta a { color: var(--muted); }
.site-foot .meta a:hover { color: var(--accent); }

/* ---------- Code ---------- */
pre, code { font-family: var(--font-code); font-size: 14px; }
pre { margin: 0; padding: 20px; background: var(--code-bg); border-radius: var(--radius); overflow-x: auto; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
