/* ==========================================================================
   Layout — base reset, page chrome, landing, workspace grid, responsive rules
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%;
  font: 400 var(--fs-base)/var(--lh) var(--font-sans);
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: var(--fs-2xl); letter-spacing: -0.025em; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-md); }
h4 { font-size: var(--fs-base); }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--font-mono); font-size: 0.92em; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, canvas { display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-1); }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s-4); top: -60px; z-index: 100; padding: var(--s-2) var(--s-3); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-1); }
.skip-link:focus { top: var(--s-2); }

/* --- top bar ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { max-width: var(--maxw); margin: 0 auto; height: 100%; padding: 0 var(--s-6); display: flex; align-items: center; gap: var(--s-4); }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; border-radius: 7px; }
.brand__tag { color: var(--text-3); font-weight: 400; font-size: var(--fs-sm); margin-left: var(--s-1); }
.topbar__spacer { flex: 1; }
.topbar nav { display: flex; align-items: center; gap: var(--s-1); }
.topbar nav a { white-space: nowrap; color: var(--text-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-1); }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); text-decoration: none; }

/* --- page ---------------------------------------------------------------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: var(--s-6); }
.page--narrow { max-width: 880px; }
.footer { max-width: var(--maxw); margin: 0 auto; padding: var(--s-8) var(--s-6) var(--s-10); color: var(--text-3); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); }
.footer a { color: var(--text-2); }

/* --- landing ------------------------------------------------------------- */
.hero { padding: var(--s-12) 0 var(--s-8); text-align: center; max-width: 820px; margin: 0 auto; }
.hero h1 { margin-bottom: var(--s-4); }
.hero__lede { color: var(--text-2); font-size: var(--fs-md); max-width: 640px; margin: 0 auto var(--s-8); }
.hero__samples { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--s-2); margin-top: var(--s-5); color: var(--text-3); font-size: var(--fs-sm); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin: var(--s-10) 0 var(--s-8); }
.feature { padding: var(--s-5); }
.feature h3 { margin: var(--s-3) 0 var(--s-2); }
.feature p { color: var(--text-2); font-size: var(--fs-sm); }
.feature__icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-2); background: var(--accent-soft); color: var(--accent-text); }

/* --- workspace ----------------------------------------------------------- */
.workspace { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: var(--s-4); position: sticky; top: calc(var(--topbar-h) + var(--s-6)); max-height: calc(100vh - var(--topbar-h) - var(--s-12)); }
.sidebar__scroll { overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: var(--s-4); padding-right: 2px; min-height: 0; }
.sidebar__actions { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-2); }
.main { min-width: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.results__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.results__head h2 { font-size: var(--fs-lg); margin-right: auto; }
.results__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

@media (max-width: 900px) {
  .page { padding: var(--s-4); }
  .topbar__inner { padding: 0 var(--s-4); }
  .brand__tag { display: none; }
  .features { grid-template-columns: 1fr; margin-top: var(--s-8); }
  .hero { padding-top: var(--s-8); }
  .workspace { grid-template-columns: 1fr; gap: var(--s-4); }
  .sidebar { position: static; max-height: none; }
  .sidebar__scroll { overflow: visible; }
  .results__head h2 { flex-basis: 100%; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.85rem; }
  .hero__lede { font-size: var(--fs-base); }
}
