:root{
  --bg: #ffffff;
  --fg: #0f172a;          /* slate-900 */
  --muted: #64748b;       /* slate-500 */
  --border: #e2e8f0;      /* slate-200 */
  --card: #ffffff;
  --primary: #0d6efd;     /* bootstrap-like blue */
  --primary-contrast: #ffffff;
  --ring: rgba(13,110,253,0.25);
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.05);
  --radius: 14px;
  --space: 18px;
  --space-lg: 28px;
  --space-xl: 46px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

/* Layout */
.app-shell { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.container { width: 100%; max-width: 1024px; margin-inline: auto; padding-inline: 20px; }
.container-narrow { max-width: 720px; }

/* Header */
header.site { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 12px; }
.brand { font-weight: 700; text-decoration: none; color: var(--fg); font-size: 18px; }

/* Stacks / spacing */
.stack { display: grid; gap: var(--space); }
.stack-lg { display: grid; gap: var(--space-lg); }
.stack-xl { display: grid; gap: var(--space-xl); }

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}

/* Hero */
.hero { text-align: center; padding: var(--space-xl) 0; }
.hero h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.015em; }
.muted { color: var(--muted); }

/* Actions */
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: #f8fafc;
  color: var(--fg);
  transition: transform .02s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.btn:focus { outline: 3px solid var(--ring); outline-offset: 2px; }

.btn-primary { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.btn-primary:hover { filter: brightness(0.96); }

.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: #f8fafc; }

/* Forms */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.label { font-weight: 600; }
.input, .select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.hint { font-size: 12px; color: var(--muted); }

/* Grid helpers */
.grid-2 { display: grid; gap: var(--space); grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 720px){ .grid-2 { grid-template-columns: 1fr; } }

/* Footer */
footer.site { border-top: 1px solid var(--border); padding: 16px 0; color: var(--muted); font-size: 14px; }

/* === Header (scoped, high-specificity) === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.site-header .wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px var(--space);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--fg);
  line-height: 1; /* prevent image/text misalignment */
}
.site-header .brand .logo {
  height: 28px;
  width: auto;
  display: block;
}
.site-header .nav {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
.site-header .nav a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1.2;
}
.site-header .nav a:hover {
  background: rgba(0,0,0,0.04);
}

/* Dark variant */
.site-header.dark { background: #0f172a; border-bottom-color: transparent; }
.site-header.dark .brand,
.site-header.dark .nav a { color: #fff; }
.site-header.dark .nav a:hover { background: rgba(255,255,255,0.08); }

/* CTA button in header */
.site-header .nav .btn.cta {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  background: var(--primary);
  color: var(--primary-contrast);
}
.site-header .nav .btn.cta:hover { filter: brightness(0.95); }
