/* Reset, typography and layout primitives. */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--f-sans);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--s-3);
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--s-3); }

a {
  color: var(--c-accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

code, pre, kbd {
  font-family: var(--f-mono);
  font-size: 0.92em;
}

code {
  padding: 2px 6px;
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
}

hr {
  height: 1px;
  margin: var(--s-5) 0;
  border: 0;
  background: var(--c-border);
}

/* One visible focus style for everything. :focus-visible so a mouse click
 * does not leave a ring behind, while keyboard navigation always does — the
 * ring is the only way a keyboard user knows where they are. */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Visually hidden but still announced by screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: var(--s-5) var(--s-4);
}

/* Layout helpers */
.stack     { display: flex; flex-direction: column; gap: var(--s-4); }
.stack-sm  { display: flex; flex-direction: column; gap: var(--s-2); }
.row       { display: flex; align-items: center; gap: var(--s-3); }
.row-wrap  { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row-end   { display: flex; align-items: center; gap: var(--s-3); justify-content: flex-end; }
.spacer    { flex: 1; }

.grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.text-soft { color: var(--c-text-soft); }
.text-mute { color: var(--c-text-mute); }
.text-sm   { font-size: var(--fs-sm); }
.text-xs   { font-size: var(--fs-xs); }

/* Section header used across panel pages */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}

.page-head__title { margin: 0; }

.page-head__sub {
  margin: var(--s-1) 0 0;
  color: var(--c-text-soft);
}

/* Legacy scaffold styles kept so the original /home page still renders. */
.navbar {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-3) var(--s-5);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.navbar .brand { font-weight: 700; color: var(--c-text); }

.navbar ul {
  display: flex;
  gap: var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero { padding: var(--s-7) 0; }

.demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
