*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: light;
  --cream: #FAF8F4;
  --ink: #1C1C1A;
  --ink-muted: #4E4B46;
  --ink-faint: #858280;
  --accent: #185FA5;
  --accent-light: #EBF3FC;
  --ring: rgba(24,95,165,0.5);
  --green: #2E5D3B;
  --green-light: #EAF1EB;
  --border: rgba(28,28,26,0.1);
  --shadow-sm: 0 2px 12px rgba(28,28,26,0.08);
  --shadow-md: 0 8px 40px rgba(28,28,26,0.12);
  --shadow-lg: 0 16px 64px rgba(28,28,26,0.18);
  --sans: 'Instrument Sans', sans-serif;
  --serif: 'Cormorant Garamond', serif;

  /* Site chrome heights — used to offset fixed/sticky elements below them */
  --site-header-h: 60px;
  --site-header-h-mobile: 52px;

  /* z-index map (documented, not all converted to vars — see each file for
     context). Lower → higher: 1-2 decorative, 10 raised controls,
     17 backdrop, 18 fixed panel, 19 sticky header inside panel,
     20 site header/nav, 25 mobile sheets, 30 side panels,
     100 cookie banner, 200 popovers/modals, 1000 topmost (search). */
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popCelebrate {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.copied { animation: popCelebrate 0.4s ease; }

/* Post-count badge shown next to filter options (graph/editor button groups
   and the posts-grid popovers) — smaller and in a light, subtle gray so it
   reads as a secondary detail, not part of the option's label. */
.filter-count {
  font-size: 0.78em;
  color: var(--ink-faint);
  font-weight: 400;
}

/* Solid-color buttons get a clean, offset focus ring instead of the
   browser default — which on a rounded pill of the same accent color
   looks like a smeared blue glow. */
.rf-clear-btn:focus,
.cookie-btn-accept:focus,
.publish-btn:focus,
.ef-save-btn:focus { outline: none; }
.rf-clear-btn:focus-visible,
.cookie-btn-accept:focus-visible,
.publish-btn:focus-visible,
.ef-save-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

html, body {
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Canvas-driven pages (graph/editor) own their own gestures — locking body
   scroll keeps the browser's pull-to-refresh from fighting with panning.
   Plain content pages (posts/kitchen) skip this so native scroll — and
   pull-to-refresh — works as expected. */
body.app-shell {
  height: 100dvh;
  overflow: hidden;
}
