
/* ---------- 1. Header & Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgb(0 0 0 / 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  container-type: inline-size; /* enables container queries */
  transition: background-color var(--ease-1), border-color var(--ease-1);
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}
.logo .accent {
  color: var(--accent);
}

/* Primary nav list */
.nav-list {
  display: flex;
  gap: 2rem;
  align-items: center;
  font-weight: 500;
}

.nav-list a {
  position: relative;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25em;
  width: 0%;
  height: 2px;
  background: currentColor;
  transition: width var(--ease-1);
}
.nav-list a:hover::after,
.nav-list a:focus-visible::after {
  width: 100%;
}

/* Hamburger button hidden by default on wide view */
.hamburger {
  display: none;
  padding: 0.25rem;
  border-radius: 0.375rem;
  transition: background-color var(--ease-1);
}
.hamburger:hover,
.hamburger:focus-visible {
  background: rgb(0 0 0 / 0.05);
}

/* Hamburger animation when nav is open (aria-expanded="true") */
#nav-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
#nav-toggle[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}
#nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Theme toggle button */
.theme-toggle {
  margin-left: 1rem;
  display: grid;
  place-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  transition: background-color var(--ease-1);
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: rgb(0 0 0 / 0.05);
}

/* ---------- 2. Container Query: Collapse Nav < 600px ---------- */
@container (max-width: 600px) {
  .nav-list {
    position: absolute;
    right: 1rem;
    top: calc(100% + 0.5rem);
    flex-direction: column;
    gap: 1rem;
    background: var(--bg);
    padding: 1rem 1.25rem;
    border: 1px solid rgb(0 0 0 / 0.05);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 0.05);

    opacity: 0;
    transform: translateY(-0.5rem);
    pointer-events: none;
    transition:
      opacity var(--ease-1),
      transform var(--ease-1);
  }

  .nav-list.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Reveal hamburger in collapsed mode */
  .hamburger {
    display: grid;
  }
}

/* ---------- 3. Hero Section ---------- */
.hero {
  display: grid;
  place-content: center;
  min-height: calc(100vh - 4rem);
  padding: 2rem 1rem;
  text-align: center;
  gap: 1.5rem;
}
.hero h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  line-height: 1.1;
  max-width: 30ch;
  margin-inline: auto;
}
.hero .tagline {
  max-width: 45ch;
  margin-inline: auto;
  font-size: 1.125rem;
  color: rgb(var(--text) / 0.8);
}

/* ---------- 4. Call‑to‑Action Button ---------- */
.cta-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: transform var(--ease-1), box-shadow var(--ease-1);
}
.cta-button:hover,
.cta-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 0.15);
}
