/* Site chrome: header, navigation, main area, footer */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.12rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.nav-link {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  background: var(--accent);
  color: #04131f;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  padding: 0 9px;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.main-content {
  flex: 1;
  padding-block: 2rem 3.5rem;
}

.view {
  animation: fadeSlide 0.22s ease;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.25rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.footer-inner p {
  margin: 0;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: relative;
  }

  .nav-links {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.6rem);
    flex-direction: column;
    align-items: stretch;
    min-width: 190px;
    border-radius: var(--radius);
    padding: 0.45rem;
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }
}
