:root {
  --al-h04-brand: #39ff14;
  --al-h04-border: #e5e5e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #ffffff;
  color: #000000;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
}

/* Sticky floating wrapper */

.header {
  position: sticky;
  top: 1rem;
  z-index: 30;
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 0 1rem;
}

/* Capsule */

.capsule {
  position: relative;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--al-h04-border);
  background: #ffffff;
  width: 7rem;
  max-height: 3.5rem;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.capsule.is-scrolled {
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.capsule.is-open {
  width: 18rem;
  max-height: 20rem;
  border-radius: 1.5rem;
}

.capsule__row {
  display: flex;
  width: 100%;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 0.875rem;
}

.capsule__brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
}

.capsule__mark {
  height: 1.5rem;
  width: auto;
  display: block;
}

.capsule__nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.capsule__link {
  border-radius: 999px;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #525252;
  transition: color 150ms ease;
}

.capsule__link:hover {
  color: #000000;
}

.capsule__link:focus-visible {
  outline: 2px solid var(--al-h04-brand);
  outline-offset: 2px;
}

.capsule__cta {
  display: none;
  flex-shrink: 0;
  align-items: center;
  border-radius: 999px;
  background: #171717;
  color: #ffffff;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform 150ms ease;
}

.capsule__cta:hover {
  transform: scale(1.03);
}

.capsule__cta:focus-visible {
  outline: 2px solid var(--al-h04-brand);
  outline-offset: 2px;
}

.capsule__toggle {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: none;
  background: none;
  color: #000000;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.capsule__toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}

.capsule__toggle:focus-visible {
  outline: 2px solid var(--al-h04-brand);
  outline-offset: 2px;
}

.icon-menu,
.icon-close {
  width: 1rem;
  height: 1rem;
}

.icon-close {
  display: none;
}

.capsule__toggle.is-open .icon-menu {
  display: none;
}

.capsule__toggle.is-open .icon-close {
  display: block;
}

/* Mobile stacked nav (revealed by the capsule's own max-height growth) */

.capsule__mobile-nav {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0 0.625rem 0.625rem;
}

.capsule__mobile-link {
  border-radius: 0.75rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #404040;
  transition: background-color 150ms ease;
}

.capsule__mobile-link:hover {
  background: rgba(0, 0, 0, 0.04);
}

.capsule__mobile-link:focus-visible {
  outline: 2px solid var(--al-h04-brand);
  outline-offset: 2px;
}

.capsule__mobile-cta {
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #171717;
  color: #ffffff;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.capsule__mobile-cta:focus-visible {
  outline: 2px solid var(--al-h04-brand);
  outline-offset: 2px;
}

/* Breakpoints */

@media (min-width: 1024px) {
  .capsule,
  .capsule.is-open {
    width: auto;
    max-height: none;
    border-radius: 999px;
  }

  .capsule__row {
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 0.5rem 1rem;
  }

  .capsule__nav {
    display: flex;
  }

  .capsule__cta {
    display: inline-flex;
    margin-left: 0.5rem;
  }

  .capsule__toggle {
    display: none;
  }

  .capsule__mobile-nav {
    display: none !important;
  }
}

/*
 * Header 04 — "floating elevation" animation identity. Same canonical
 * keyframes/transitions as `Header04.tailwind.css`. Scoped with a unique
 * `al-header04-*` prefix so this never collides with another Resource's
 * own animation layer. Entirely disabled under reduced motion: outside the
 * media query below, every element already renders in its final state, and
 * the capsule still expands/collapses functionally — just without the
 * transition.
 */
@keyframes al-header04-settle {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .al-header04-settle {
    animation: al-header04-settle 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .al-header04-capsule-transition {
    transition:
      width 300ms cubic-bezier(0.16, 1, 0.3, 1),
      max-height 300ms cubic-bezier(0.16, 1, 0.3, 1),
      border-radius 300ms cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 200ms ease;
  }
}
