:root {
  --header05-border: #e5e5e5;
  --header05-muted: #737373;
  --header05-subtle-bg: #fafafa;
  --header05-chip-bg: #f5f5f5;
  --header05-brand: #39ff14;
}

* {
  box-sizing: border-box;
}

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

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

button {
  font-family: inherit;
}

/* Header shell */

.header {
  position: relative;
  border-bottom: 1px solid var(--header05-border);
  background: #ffffff;
}

.header__inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.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;
}

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

.header__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #404040;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 150ms ease;
}

.header__link:hover {
  color: #000000;
}

.header__link:focus-visible,
.header__menu-btn:focus-visible,
.header__cta:focus-visible,
.accordion__trigger:focus-visible,
.mega__list a:focus-visible,
.mega__card:focus-visible,
.drawer__link:focus-visible {
  outline: 2px solid var(--header05-brand);
  outline-offset: 2px;
}

.header__chevron {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.header__trigger[aria-expanded="true"] .header__chevron,
.accordion__trigger[aria-expanded="true"] .header__chevron {
  transform: rotate(180deg);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.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--block {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
}

.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: #404040;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.header__menu-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

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

/* Mega menu */

.mega {
  position: relative;
}

.mega__panel {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 30;
  margin-top: 0.5rem;
  width: min(640px, calc(100vw - 2rem));
  border-radius: 1rem;
  border: 1px solid var(--header05-border);
  background: #ffffff;
  box-shadow: 0 20px 48px -20px rgba(0, 0, 0, 0.25);
  transform-origin: top;
}

@keyframes header05-panel-reveal {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes header05-group-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes header05-drawer-reveal {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .mega__panel {
    animation: header05-panel-reveal 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .mega__group,
  .mega__card {
    animation: header05-group-reveal 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .drawer {
    animation: header05-drawer-reveal 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .accordion {
    transition: grid-template-rows 260ms cubic-bezier(0.16, 1, 0.3, 1);
  }
}

.mega__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

.mega__heading {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--header05-muted);
}

.mega__list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mega__list a {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 -0.5rem;
  border-radius: 0.5rem;
  padding: 0.5rem;
  transition: background-color 150ms ease;
}

.mega__list a:hover,
.mega__list a:focus-visible {
  background: var(--header05-subtle-bg);
}

.mega__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
  border-radius: 0.5rem;
  background: var(--header05-chip-bg);
  color: #404040;
}

.mega__icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.mega__item-text {
  min-width: 0;
}

.mega__item-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #000000;
}

.mega__item-desc {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--header05-muted);
}

.mega__card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 0.75rem;
  border: 1px solid var(--header05-border);
  background: var(--header05-subtle-bg);
  padding: 1rem;
  transition: border-color 150ms ease;
}

.mega__card:hover {
  border-color: #d4d4d4;
}

.mega__card--stacked {
  align-items: flex-start;
  gap: 0;
}

.mega__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: var(--header05-brand);
  color: #000000;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mega__card-title {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #000000;
}

.mega__card--stacked .mega__card-title {
  display: block;
  margin-top: 0.5rem;
}

.mega__card-desc {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--header05-muted);
}

.mega__card--stacked .mega__card-desc {
  display: block;
}

.mega__card-cta {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #000000;
}

.mega__card-cta svg {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 200ms ease;
}

.mega__card:hover .mega__card-cta svg {
  transform: translateX(0.15rem);
}

/* Full-screen mobile drawer */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  flex-direction: column;
  background: #ffffff;
  /* `display: none` here (rather than relying on the `hidden` attribute's
     UA-default `display: none`) matters: an author rule setting `display`
     on this same selector would otherwise tie in specificity with
     `[hidden]` and win the cascade regardless of open/closed state,
     permanently showing the drawer at every breakpoint. Gating the `flex`
     display behind `:not([hidden])` keeps `[hidden]` authoritative. */
  display: none;
}

.drawer:not([hidden]) {
  display: flex;
}

.drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--header05-border);
  padding: 1rem;
}

.drawer__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
}

.accordion__trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border-radius: 0.5rem;
  border: none;
  background: none;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  color: #000000;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.accordion__trigger:hover {
  background: var(--header05-subtle-bg);
}

.accordion {
  display: grid;
  grid-template-rows: 0fr;
}

.accordion.is-open {
  grid-template-rows: 1fr;
}

.accordion__inner {
  overflow: hidden;
}

.accordion__list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.accordion__list a {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  transition: background-color 150ms ease;
}

.accordion__list a:hover {
  background: var(--header05-subtle-bg);
}

.drawer__links {
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-top: 1px solid var(--header05-border);
  padding-top: 0.75rem;
}

.drawer__link {
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  color: #000000;
  transition: background-color 150ms ease;
}

.drawer__link:hover {
  background: var(--header05-subtle-bg);
}

/* Breakpoints */

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

  .mega__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

  .header__cta {
    display: inline-flex;
  }

  .header__menu-btn {
    display: none;
  }

  .header__inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (max-width: 1023px) {
  .mega__panel {
    display: none !important;
  }
}
