/* =============================================================
   Stack Cleaner — design system
   Warm ivory canvas · white surfaces · Claude-clay accent · Geist type.
   Light, clean, dev-tool surfaces. Class vocabulary is shared across the
   landing, setup, and inventory pages — keep names stable.
   ============================================================= */

:root {
  /* surfaces — warm ivory canvas, white panels */
  --bg:        #faf7f1;
  --bg-2:      #f3efe6;
  --panel:     #ffffff;
  --panel-2:   #f8f5ee;
  --elev:      #efe9dd;
  --line:      #ece5d8;
  --line-2:    #ddd3c2;

  /* ink — warm near-black (all AA on ivory/white) */
  --fg:        #28231d;
  --fg-soft:   #443d34;
  --dim:       #6a6052;
  --faint:     #7a6f5d;

  /* clay accent (Claude) — deepened so white-on-coral and coral-on-ivory both pass AA */
  --accent:        #c15a33;
  --accent-soft:   #b04e2a;
  --accent-ink:    #ffffff;
  --accent-tint:   rgba(193, 90, 51, 0.10);
  --accent-line:   rgba(193, 90, 51, 0.34);

  /* functional tones — deepened for AA on light tints */
  --good:   #3f8f46;   --good-tint:  rgba(63, 143, 70, 0.12);
  --warn:   #9a6a14;   --warn-tint:  rgba(154, 106, 20, 0.13);
  --bad:    #c33a2d;   --bad-tint:   rgba(195, 58, 45, 0.11);
  --info:   #2f6fb0;   --info-tint:  rgba(47, 111, 176, 0.11);
  --muted:  #6a6052;   --muted-tint: rgba(106, 96, 82, 0.10);

  /* scope coding */
  --global:  #7a4fc0;  --global-tint:  rgba(122, 79, 192, 0.11);
  --project: #2f8a82;  --project-tint: rgba(47, 138, 130, 0.12);

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  /* soft, warm-tinted shadows — no heavy black */
  --shadow:    0 1px 2px rgba(60,42,28,.05), 0 6px 18px rgba(60,42,28,.07);
  --shadow-lg: 0 2px 8px rgba(60,42,28,.08), 0 22px 50px rgba(60,42,28,.13);

  --mono: var(--font-geist-mono), ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: var(--font-geist-sans), -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background:
    radial-gradient(1100px 620px at 50% -8%, rgba(193,90,51,.06), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(122,79,192,.035), transparent 55%),
    var(--bg);
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 650; }
p { margin: 0; }
::selection { background: var(--accent-tint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; width: 100%; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 24px; width: 100%; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; }
.gap-4 { gap: 24px; } .gap-6 { gap: 40px; }
.grow { flex: 1; } .center { align-items: center; justify-content: center; }
.between { justify-content: space-between; }
.muted { color: var(--dim); } .faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 60px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.02em; }
.brand .glyph {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), #9c441f);
  color: #1a0f0a; box-shadow: var(--shadow);
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 7px 12px; border-radius: var(--radius-sm); color: var(--dim); font-size: 14px; font-weight: 500; transition: .15s; }
.nav-link:hover { color: var(--fg); background: var(--panel); }
.nav-link.active { color: var(--fg); background: var(--panel-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 580; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; transition: .15s; user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-primary:hover:not(:disabled) { background: var(--accent-soft); transform: translateY(-1px); }
.btn-secondary { background: var(--panel-2); color: var(--fg); border-color: var(--line-2); }
.btn-secondary:hover:not(:disabled) { background: var(--elev); border-color: var(--faint); }
.btn-ghost { background: transparent; color: var(--dim); }
.btn-ghost:hover:not(:disabled) { background: var(--panel); color: var(--fg); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }

/* ---------- cards / surfaces ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.card-2 { background: var(--panel-2); }
.card-pad-lg { padding: 32px; }
.hairline { border-top: 1px solid var(--line); }

/* ---------- badges / chips / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid var(--line-2); color: var(--dim); background: var(--panel-2);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.good    { color: var(--good);    background: var(--good-tint);    border-color: transparent; }
.badge.warn    { color: var(--warn);    background: var(--warn-tint);    border-color: transparent; }
.badge.bad     { color: var(--bad);     background: var(--bad-tint);     border-color: transparent; }
.badge.info    { color: var(--info);    background: var(--info-tint);    border-color: transparent; }
.badge.muted   { color: var(--muted);   background: var(--muted-tint);   border-color: transparent; }
.badge.global  { color: var(--global);  background: var(--global-tint);  border-color: transparent; }
.badge.project { color: var(--project); background: var(--project-tint); border-color: transparent; }
.badge.accent  { color: var(--accent-soft); background: var(--accent-tint); border-color: transparent; }

/* segmented control / filter chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 540; color: var(--dim);
  background: var(--panel-2); border: 1px solid var(--line); transition: .14s; white-space: nowrap;
}
.chip:hover { color: var(--fg); border-color: var(--line-2); }
.chip.active { color: var(--fg); background: var(--elev); border-color: var(--accent-line); }
.chip .count { font-variant-numeric: tabular-nums; color: var(--faint); font-size: 12px; }
.chip.active .count { color: var(--accent-soft); }

/* keyboard / inline code */
.kbd {
  font-family: var(--mono); font-size: 12px; padding: 2px 7px;
  background: var(--panel-2); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 6px; color: var(--fg-soft);
}
code.inline {
  font-family: var(--mono); font-size: 0.88em; padding: 1.5px 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 6px; color: var(--accent-soft);
}

/* ---------- code block ---------- */
/* A warm-dark terminal sitting on the light page — adds depth and reads as
   "a real command". Has its own light-on-dark colors, independent of tokens. */
.codeblock {
  position: relative; background: #221d18; border: 1px solid #322a22;
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: var(--mono); font-size: 13px; line-height: 1.65;
  color: #ece4d7; overflow-x: auto; white-space: pre;
  box-shadow: var(--shadow);
}
.codeblock code.inline,
.codeblock .inline { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #f0b59a; }
.codeblock .copy {
  position: absolute; top: 9px; right: 9px;
}
/* copy control sits on the dark block — keep it readable */
.codeblock .copy .btn,
.codeblock .copy button { color: #d8cfc0; }
.codeblock .copy .btn:hover,
.codeblock .copy button:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ---------- inputs ---------- */
.input {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--fg);
  font-size: 14px; font-family: inherit; transition: .14s;
}
.input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-tint); }
.input::placeholder { color: var(--faint); }
textarea.input { resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; }

/* ---------- stat ---------- */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .num { font-size: 30px; font-weight: 680; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.stat .lbl { font-size: 12.5px; color: var(--dim); font-weight: 500; }
/* clickable stat cells in the inventory strip — make the filter affordance visible */
.stat-cell { background: transparent; border: none; cursor: pointer; text-align: left; transition: background .14s; }
.stat-cell:hover, .stat-cell:focus-visible { background: var(--panel-2); }
.stat-cell:hover .lbl { color: var(--fg-soft); }
/* transcript-derived cells describe the scan, not a filter — no pointer affordance */
.stat-cell.static { cursor: default; }
.stat-cell.static:hover { background: transparent; }
.stat-cell.static:hover .lbl { color: var(--dim); }

/* ---------- usage (transcript signal) ---------- */
.usage-summary strong { font-weight: 650; }
.usage-summary .chip .count { color: var(--bad); font-weight: 700; }
/* subtle "last used Nd ago" hint on item rows */
.usage-last { font-size: 11.5px; opacity: .9; white-space: nowrap; }

/* ---------- section headings ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-soft);
}
.section { padding: 84px 0; }
.section-title { font-size: clamp(26px, 4vw, 38px); font-weight: 680; letter-spacing: -0.03em; }
.lead { font-size: 17px; color: var(--dim); line-height: 1.6; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 16px);
  background: var(--elev); color: var(--fg); border: 1px solid var(--line-2);
  padding: 11px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 540;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; z-index: 100;
  display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--dim); font-size: 13.5px; margin-top: 40px; }

/* ---------- responsive helpers ---------- */
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .section { padding: 56px 0; }
  .card-pad-lg { padding: 22px; }
}
@media (max-width: 480px) {
  .container, .container-narrow { padding-left: 16px; padding-right: 16px; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 7px 9px; font-size: 13.5px; }
  .stat .num { font-size: 26px; }
}

/* respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .btn-primary:hover:not(:disabled) { transform: none; }
  .lp-preview-card { transform: none !important; }
}
