:root {
  --brand: #39ff14;
}

* {
  box-sizing: border-box;
}

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

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

/* Header shell */

.header {
  position: relative;
  border-bottom: 1px solid #e5e5e5;
  background: #ffffff;
}

.header__inner {
  max-width: 80rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  height: 4.5rem;
  padding: 0 1rem;
}

.header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  grid-column-start: 1;
  justify-self: start;
}

.header__mark {
  height: 1.625rem;
  width: auto;
  display: block;
}

.header__wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: #000000;
}

/* Center nav */

.header__nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  grid-column-start: 2;
  justify-self: center;
}

.header__link {
  position: relative;
  display: inline-flex;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #404040;
  transition: color 150ms ease;
}

.header__link::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: -0.0625rem;
  height: 1px;
  background: var(--brand);
  transform-origin: left;
  transform: scaleX(0);
}

.header__link:hover {
  color: #000000;
}

.header__link:hover::after,
.header__link:focus-visible::after {
  transform: scaleX(1);
}

.header__link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 0.375rem;
}

@media (prefers-reduced-motion: no-preference) {
  .header__link::after {
    transition: transform 200ms ease;
  }
}

/* Actions */

/* `grid-column-start: 3` is required, not decorative: CSS Grid
   auto-placement skips `display:none` items entirely (`.header__nav` above
   isn't a grid item below the `min-width: 1024px` breakpoint), so without
   an explicit column this element would auto-place into column 2 instead
   of 3 — landing near the middle of the row instead of flush right. */
.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  grid-column-start: 3;
  justify-self: end;
}

.header__link--signin {
  display: none;
}

.header__cta {
  display: none;
  align-items: center;
  border-radius: 999px;
  background: #000000;
  color: #ffffff;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 150ms ease;
}

.header__cta:hover {
  background: #262626;
}

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

.header__menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: none;
  background: none;
  color: #171717;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.header__menu-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.header__menu-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

.icon-close {
  display: none;
}

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

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

/* Mobile panel */

.header__mobile-panel {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  z-index: 20;
  border-bottom: 1px solid #e5e5e5;
  background: #ffffff;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.18);
}

@media (prefers-reduced-motion: no-preference) {
  .header__mobile-panel {
    animation: header01-panel 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes header01-panel {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header__mobile-nav {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
}

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

.header__mobile-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

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

.header__mobile-divider {
  margin: 0.25rem 0;
  border-top: 1px solid #e5e5e5;
}

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

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

/* Reveal on load */

@media (prefers-reduced-motion: no-preference) {
  .header__brand {
    animation: header01-reveal 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .header__nav {
    animation: header01-reveal 320ms cubic-bezier(0.16, 1, 0.3, 1) 60ms both;
  }

  .header__actions {
    animation: header01-reveal 320ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
  }
}

@keyframes header01-reveal {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Breakpoints */

@media (min-width: 1024px) {
  .header__nav {
    display: flex;
  }

  .header__link--signin {
    display: inline-flex;
  }

  .header__cta {
    display: inline-flex;
  }

  .header__menu-btn {
    display: none;
  }

  .header__mobile-panel {
    display: none !important;
  }
}

@media (min-width: 640px) {
  .header__inner,
  .header__mobile-nav {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .header__inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
