:root{
    --nav-bg: #ffffff;
    --nav-text: #111827;
    --nav-accent: #2563eb; /* blue */
    --nav-height: 64px;
    --nav-gap: 1rem;
    --max-width: 1100px;
    --transition-fast: 180ms ease;
    --shadow: 0 6px 18px rgba(16,24,40,0.06);
    --mobile-break: 800px;
  }


body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f4f4f9;
}

header {
    display: flex;
    justify-content: space-between;
}
.logo {
    size: 45px;
    
}

/* Basic reset for nav elements */
.site-nav {
    width: 100%;
    background: var(--nav-bg);
    color: var(--nav-text);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--nav-height);
  }

/* inner container centering */
.site-nav > .brand,
.site-nav .nav-list,
.site-nav .nav-toggle {
    box-sizing: border-box;
}

.site-nav {
  padding: 0 1rem;
}

.site-nav .brand {
  font-weight: 700;
  font-size: 1.05rem;
  margin-right: auto;
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

/* screen-reader only helper */
.sr-only{
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Desktop nav list */
.nav-list {
  list-style: none;
  display: flex;
  gap: var(--nav-gap);
  margin: 0;
  padding: 0;
  align-items: center;
  max-width: var(--max-width);
}

/* links */
.nav-list a {
  display: inline-block;
  padding: .5rem .6rem;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  position: relative;
  transition: color var(--transition-fast), background var(--transition-fast);
  font-weight: 500;
}

/* animated underline */
.nav-list a::after{
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  height: 2px;
  bottom: 8px;
  background: var(--nav-accent);
  transform-origin: center;
  transform: scaleX(0);
  transition: transform var(--transition-fast) cubic-bezier(.2,.9,.3,1);
}

/* hover / focus */
.nav-list a:hover,
.nav-list a:focus {
  color: var(--nav-accent);
  outline: none;
  background: rgba(37,99,235,0.06);
}

.nav-list a:hover::after,
.nav-list a:focus::after,
.nav-list a.active::after {
  transform: scaleX(1);
}

/* active link */
.nav-list a.active {
  color: var(--nav-accent);
  font-weight: 600;
}

/* keyboard focus visible */
.nav-list a:focus-visible {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* nav toggle (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  margin-left: 0.5rem;
  cursor: pointer;
  padding: .35rem .5rem;
}

/* Mobile styles */
@media (max-width: var(--mobile-break)) {
  .site-nav {
    height: auto;
    align-items: stretch;
    padding: .5rem;
  }

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

  /* stack header top row */
  .site-nav { flex-wrap: wrap; gap: .5rem; }

  .nav-list {
    width: 100%;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 220ms ease, opacity 180ms ease;
    opacity: 0;
    border-radius: 8px;
  }

  /* visible state controlled with aria-expanded on button via JS */
  .nav-list.open {
    max-height: 500px; /* large enough to show items; safe for typical navs */
    opacity: 1;
  }

  .nav-list a {
    padding: .75rem 1rem;
    border-bottom: 1px solid rgba(16,24,40,0.04);
  }

  .brand { margin-right: 0; }
}

/* small helper: visually separate brand when nav is open */
.nav-list.open + .brand {
  /* no-op; kept if you want different ordering */
}

/* optional utility: dark mode tweak */
@media (prefers-color-scheme: dark) {
  :root {
    --nav-bg: #0b1220;
    --nav-text: #e6eef8;
    --shadow: 0 6px 18px rgba(2,6,23,0.6);
  }
}