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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--fp-font-body);
  background: var(--fp-bg);
  color: var(--fp-text);
  line-height: 1.6;
  overflow-x: clip;
}

a { color: var(--fp-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--fp-font-display);
  font-weight: 600;
  line-height: 1.2;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: var(--fp-space-5) 0;
  max-width: 100%;
  min-width: 0;
}

.site-header {
  border-bottom: 1px solid var(--fp-border);
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fp-space-4);
  padding: var(--fp-space-3) 0;
}

.header-top {
  display: contents;
}

.brand {
  font-family: var(--fp-font-display);
  font-size: 1.25rem;
  color: var(--fp-accent);
  font-weight: 700;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--fp-border);
  border-radius: 8px;
  background: var(--fp-surface);
  color: var(--fp-text);
  cursor: pointer;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--fp-accent);
  outline-offset: 2px;
}

.nav-toggle-bar {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 160ms ease, opacity 160ms ease;
}

.site-header.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fp-space-3);
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--fp-text-muted);
  padding: var(--fp-space-1) var(--fp-space-2);
  border-radius: 8px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--fp-text);
  background: var(--fp-surface-2);
  text-decoration: none;
}

.nav-label-short { display: none; }

.site-footer {
  border-top: 1px solid var(--fp-border);
  margin-top: var(--fp-space-6);
  padding: var(--fp-space-5) 0;
  color: var(--fp-text-muted);
  font-size: 0.9rem;
}

.hero {
  padding: var(--fp-space-6) 0 var(--fp-space-4);
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 var(--fp-space-3);
}

.lead { color: var(--fp-text-muted); max-width: 65ch; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--fp-space-4);
}

.card {
  background: var(--fp-surface);
  border: 1px solid var(--fp-border);
  border-radius: var(--fp-radius);
  padding: var(--fp-space-4);
  box-shadow: var(--fp-shadow);
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fp-accent);
}

.muted { color: var(--fp-text-muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 760px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--fp-space-3);
  }

  .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    grid-column: 1 / -1;
    width: 100%;
  }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: var(--fp-space-1);
    padding: var(--fp-space-2) 0;
    border-top: 1px solid var(--fp-border);
  }

  .site-header.nav-open .site-nav { display: flex; }

  .site-nav a {
    padding: 0.65rem 0.75rem;
  }

  .nav-label-full { display: none; }
  .nav-label-short { display: inline; }

  .search-box {
    grid-column: 1 / -1;
    width: 100%;
  }
}
