/* Bagman Apps — charcoal ink, warm greige paper, one brass accent.
   Palette and scale follow the original studio template; system fonts only
   (no third-party requests). Light/dark follows the visitor's OS. */
:root {
  color-scheme: light dark;
  --ink:          light-dark(#17181d, #ece9e1);
  --ink-soft:     light-dark(#3a3c44, #b6b3a9);
  --paper:        light-dark(#efeee8, #15161a);
  --paper-raised: light-dark(#fbfaf6, #1e2026);
  --muted:        light-dark(#5f6169, #9a9ca3);
  --line:         light-dark(#dad8cf, #2d2f37);
  --brass:        light-dark(#8a6414, #d9a236);
  --brass-bg:     light-dark(#b9871f, #d9a236);
  --slab-bg:      light-dark(#17181d, #0f1013);
  --slab-fg:      light-dark(#efeee8, #ece9e1);
  --font-display: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --step--1: clamp(0.83rem, 0.78rem + 0.2vw, 0.92rem);
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.12rem);
  --step-1: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --step-3: clamp(2.1rem, 1.5rem + 2.8vw, 3.6rem);
  --gutter: clamp(1rem, 0.6rem + 2.2vw, 2.5rem);
  --measure: 65ch;
  --radius: 14px;
}
@supports not (color: light-dark(#000, #fff)) {
  :root { --ink:#17181d; --ink-soft:#3a3c44; --paper:#efeee8; --paper-raised:#fbfaf6; --muted:#5f6169; --line:#dad8cf; --brass:#8a6414; --brass-bg:#b9871f; }
  @media (prefers-color-scheme: dark) {
    :root { --ink:#ece9e1; --ink-soft:#b6b3a9; --paper:#15161a; --paper-raised:#1e2026; --muted:#9a9ca3; --line:#2d2f37; --brass:#d9a236; --brass-bg:#d9a236; }
  }
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body); font-size: var(--step-0); line-height: 1.6;
  color: var(--ink); background: var(--paper);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; text-decoration-color: var(--brass-bg); text-underline-offset: 0.2em; }
a:hover { color: var(--brass); }
:focus-visible { outline: 2px solid var(--brass-bg); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper-raised); padding: 0.5rem 1rem; z-index: 10; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }

header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.1rem; padding-bottom: 1.1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); text-decoration: none; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; }
nav.site ul { display: flex; gap: 1.25rem; list-style: none; padding: 0; flex-wrap: wrap; }
nav.site a { text-decoration: none; font-size: var(--step--1); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--brass); }

main { flex: 1; }
.hero { padding: clamp(3rem, 2rem + 6vw, 7rem) 0 clamp(2rem, 1.5rem + 3vw, 4rem); }
.eyebrow { font-family: var(--font-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; color: var(--brass); margin-bottom: 1rem; }
h1 { font-family: var(--font-display); font-size: var(--step-3); line-height: 1.08; letter-spacing: -0.02em; font-weight: 800; max-width: 18ch; }
.lede { margin-top: 1.25rem; font-size: var(--step-1); color: var(--ink-soft); max-width: 40ch; line-height: 1.45; }
h2 { font-family: var(--font-display); font-size: var(--step-2); letter-spacing: -0.015em; line-height: 1.15; margin-bottom: 1.5rem; }

.apps { padding-bottom: clamp(3rem, 2rem + 4vw, 6rem); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1.25rem; list-style: none; padding: 0; }
.card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.card h3 { font-family: var(--font-display); font-size: var(--step-1); letter-spacing: -0.01em; }
.card p { color: var(--ink-soft); }
.meta { display: flex; gap: 0.5rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.6rem; color: var(--muted); }
.tag.open { border-color: var(--brass-bg); color: var(--brass); }
.card .go { margin-top: auto; font-weight: 600; }

.prose { padding: clamp(2.5rem, 2rem + 3vw, 5rem) 0; max-width: var(--measure); }
.prose h1 { font-size: var(--step-2); max-width: none; margin-bottom: 0.5rem; }
.prose .updated { color: var(--muted); font-size: var(--step--1); margin-bottom: 2rem; }
.prose h2 { font-size: var(--step-1); margin: 2rem 0 0.75rem; }
.prose p, .prose ul { margin-bottom: 1rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4rem; }

footer.site { background: var(--slab-bg); color: var(--slab-fg); margin-top: auto; }
footer.site .wrap { padding-top: 2rem; padding-bottom: 2rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; font-size: var(--step--1); }
footer.site ul { display: flex; gap: 1.25rem; list-style: none; padding: 0; flex-wrap: wrap; }
footer.site a:hover { color: #e8c77a; }
