.nav { gap: 16px; }
@media (min-width: 721px) {
  .nav { padding:12px clamp(20px,3vw,48px); background:var(--cream); border-bottom:1px solid var(--line); }
  .nav > .wordmark,.nav > .nav-actions { flex-shrink:0; }
}

.resource-popover {
  position: fixed;
  z-index: 20;
  top: var(--games-popover-top, 0);
  left: var(--games-popover-left, 50%);
  transform: translateX(-50%);
  width: min(330px, calc(100vw - 28px));
  max-height: calc(100dvh - var(--games-popover-top, 80px) - 16px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(32, 55, 44, .16);
  border-radius: 11px;
  background: #fffdf8;
  box-shadow: 0 15px 35px rgba(32, 55, 44, .16);
}
.resource-popover[hidden] { display: none; }
.resource-popover a { display: block; padding: 10px 12px; border-radius: 7px; color: inherit; text-decoration: none; font: 500 14px/1.3 'Inter', Arial, sans-serif; }
.resource-popover a:hover, .resource-popover a:focus-visible { background: var(--lime); }
.resource-menu-note { margin: 12px; color: #52635b; font: 400 12px/1.5 'Inter', Arial, sans-serif; }

.nav nav {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  overflow: visible;
  scrollbar-width: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-left: 0;
  white-space: nowrap;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.nav nav::-webkit-scrollbar { display: none; }
.nav nav > a,.nav nav > .menu-trigger { display:inline-flex; align-items:center; flex:0 0 auto; min-height:34px; line-height:1.35; }

.menu-trigger {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
}

.menu-trigger span { display: inline-block; margin-left: 3px; font-size: .75em; transition: transform .2s ease; }
.menu-trigger[aria-expanded="true"] span { transform: rotate(180deg); }

.games-popover,
.k12-education-popover,
.computer-science-popover,
.ai-skills-popover,
.coding-popover,
.enterprise-tools-popover {
  position: fixed;
  z-index: 20;
  top: var(--games-popover-top, 0);
  left: var(--games-popover-left, 50%);
  min-width: 184px;
  padding: 8px;
  border: 1px solid rgba(32, 55, 44, .16);
  border-radius: 11px;
  background: #fffdf8;
  box-shadow: 0 15px 35px rgba(32, 55, 44, .16);
  transform: translateX(-50%);
}

.games-popover[hidden], .k12-education-popover[hidden], .computer-science-popover[hidden], .ai-skills-popover[hidden], .coding-popover[hidden], .enterprise-tools-popover[hidden] { display: none; }
.games-popover a, .k12-education-popover a, .computer-science-popover a, .ai-skills-popover a, .coding-popover a, .enterprise-tools-popover a { display: block; padding: 10px 12px; border-radius: 7px; color: inherit; text-decoration: none; font: 500 14px/1.2 'Inter', Arial, sans-serif; }
.games-popover a:hover, .games-popover a:focus-visible, .k12-education-popover a:hover, .k12-education-popover a:focus-visible, .computer-science-popover a:hover, .computer-science-popover a:focus-visible, .ai-skills-popover a:hover, .ai-skills-popover a:focus-visible, .coding-popover a:hover, .coding-popover a:focus-visible, .enterprise-tools-popover a:hover, .enterprise-tools-popover a:focus-visible { background: var(--lime); }
.coding-popover { min-width: 216px; }
.k12-education-popover { max-height: calc(100dvh - 80px); overflow-y: auto; }
.ai-skills-popover { max-height: calc(100dvh - 80px); overflow-y: auto; }
.computer-science-popover { max-height: calc(100dvh - 80px); overflow-y: auto; }
.enterprise-tools-popover { max-height: calc(100dvh - 80px); overflow-y: auto; }
.menu-label { display: inline-flex; margin: 10px 10px 4px; padding: 4px 7px; border-radius: 999px; background: #edf2e3; color: var(--moss); font: 700 12px/1.2 'Inter', Arial, sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.menu-label:first-child { margin-top: 4px; }
.label-learning { color: #2f6de0; }
.label-languages { color: #8a4ec5; }
.label-frameworks { color: #b3532d; }
.label-databases { color: #167760; }
.label-tools { color: #9a6b00; }
.label-repository { color: #5a5a5a; }
.label-cloud { color: #126f9a; }
.label-models { color: #b04376; }
.label-foundation { color: #744b25; }
.label-infrastructure { color: #176c72; }
.label-research { color: #6a3c99; }
.label-mit { color: #a31f34; }
.label-stanford { color: #8c1515; }
.label-open-source { color: #4e596c; }
.label-networking { color: #176c72; }
.label-security { color: #b3532d; }
.label-cybersecurity { color: #8a4ec5; }
.label-productivity { color: #2f6de0; }
.label-crm { color: #b04376; }
.label-projects { color: #176c72; }
.label-documents { color: #b3532d; }
.label-operations { color: #6a3c99; }
.security-group { margin: 5px 8px; border-bottom: 1px solid #dce4dc; }
.security-group > summary { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:46px; padding:9px 8px; font:650 15px/1.3 'Inter',Arial,sans-serif; cursor:pointer; list-style:none; }
.security-group > summary::-webkit-details-marker { display:none; }
.security-group > summary > span:last-child { flex-shrink:0; transition:transform .2s ease; }
.security-group[open] > summary > span:last-child { transform:rotate(180deg); }
.security-network > summary { color:#235f91; }
.security-endpoint > summary { color:#496a32; }
.security-identity > summary { color:#774b91; }
.security-application > summary { color:#925321; }
.security-group > summary:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
.foundation-sources { margin: 9px 2px 2px; }
.foundation-sources > summary { cursor: pointer; list-style: none; }
.foundation-sources > summary::-webkit-details-marker { display: none; }
.foundation-sources > summary span:last-child { display: inline-block; margin-left: 5px; transition: transform .2s ease; }
.foundation-sources[open] > summary span:last-child { transform: rotate(180deg); }
.menu-sub-label { margin: 10px 10px 3px; font: 700 11px/1.2 'Inter', Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.mobile-menu-toggle,
.mobile-menu { display: none; }

@media (min-width: 721px) and (max-width: 1280px) {
  .nav { flex-wrap:wrap; row-gap:6px; }
  .nav > .nav-actions { margin-left:auto; }
  .nav nav { order:3; flex-basis:100%; justify-content:center; }
}

@media (max-width: 720px) {
  .nav {
    position: relative;
    inset: auto;
    flex-wrap: wrap;
    row-gap: 14px;
    background: var(--cream);
  }

  .nav nav {
    display: none;
  }

  .nav-actions { display: none; }

  .mobile-menu-toggle { display: grid; width: 42px; height: 42px; padding: 10px; border: 1px solid rgba(32, 55, 44, .2); border-radius: 50%; background: var(--cream); gap: 5px; place-content: center; cursor: pointer; }
  .mobile-menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
  body.mobile-menu-open .mobile-menu-toggle { border-color: transparent; background: transparent; }
  body.mobile-menu-open .mobile-menu-toggle span:first-child { transform: translateY(7px) rotate(45deg); }
  body.mobile-menu-open .mobile-menu-toggle span:nth-child(2) { opacity: 0; }
  body.mobile-menu-open .mobile-menu-toggle span:last-child { transform: translateY(-7px) rotate(-45deg); }

  /* Use the document as the only scroll container, including long submenus. */
  .mobile-menu { display: none; position: static; flex: 0 0 100%; width: 100%; min-width: 0; padding: 0 0 24px; color: var(--ink); }
  body.mobile-menu-open .mobile-menu { display: block; }
  body.mobile-menu-open > main,
  body.mobile-menu-open > footer { display: none; }
  .mobile-menu-head { display: none; }
  .mobile-menu-close { appearance: none; border: 0; padding: 0; width: 42px; height: 42px; background: transparent; color: var(--ink); font: 400 42px/1 Arial, sans-serif; cursor: pointer; }
  .mobile-menu-links { margin-top: 30px; border-top: 1px solid var(--line); }
  .mobile-menu-links > a, .mobile-menu-links summary { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 0; border-bottom: 1px solid var(--line); color: inherit; font: 700 20px/1.2 'Inter', Arial, sans-serif; letter-spacing: -.035em; text-decoration: none; cursor: pointer; }
  .mobile-menu-links summary { list-style: none; }
  .mobile-menu-links summary::-webkit-details-marker { display: none; }
  .mobile-menu-links summary span { font-size: 24px; font-weight: 400; transition: transform .2s ease; }
  .mobile-menu-links > details[open] > summary > span:last-child { transform: rotate(180deg); }
  .mobile-menu-links details > a { display: block; padding: 12px 0 12px 18px; color: var(--moss); font: 500 16px/1.3 'Inter', Arial, sans-serif; text-decoration: none; }
  .mobile-menu-links details > a:last-child { padding-bottom: 18px; }
  .mobile-menu-label { display: inline-flex; margin: 16px 0 3px 18px; padding: 5px 8px; border-radius: 999px; background: #edf2e3; font: 700 13px/1.2 'Inter', Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
  .mobile-menu-links .security-group { margin:4px 0 4px 18px; }
  .mobile-menu-links .security-group > summary { min-height:52px; padding:10px 6px; border-bottom:0; font-size:17px; color:inherit; letter-spacing:0; }
  .mobile-menu-links .security-group > summary > span:first-child { font-size:17px; font-weight:650; }
  .mobile-menu-links .security-group > a { padding-left:14px; }
  .mobile-menu-links .security-network > summary { color:#235f91; }
  .mobile-menu-links .security-endpoint > summary { color:#496a32; }
  .mobile-menu-links .security-identity > summary { color:#774b91; }
  .mobile-menu-links .security-application > summary { color:#925321; }
  .mobile-menu-links .foundation-sources { margin: 12px 0 0; border-top: 1px dashed var(--line); }
  .mobile-menu-links .foundation-sources > summary { min-height: 56px; padding: 0 0 0 18px; border-bottom: 0; }
  .mobile-menu-links .foundation-sources > summary .mobile-menu-label { margin: 0; }
  .mobile-menu-links .foundation-sources > summary .mobile-menu-label { transform: none; }
  .mobile-menu-links .foundation-sources > summary > span:last-child { margin-left: auto; margin-right: 2px; font-size: 22px; font-weight: 400; }
  .mobile-menu-github { display: flex; justify-content: center; align-items: center; min-height: 52px; margin-top: auto; border-radius: 999px; background: var(--ink); color: var(--cream); font: 700 16px/1 'Inter', Arial, sans-serif; text-decoration: none; }
  .mobile-menu-github span { margin-left: 7px; }

  .games-popover,
  .k12-education-popover,
.computer-science-popover,
  .ai-skills-popover,
  .coding-popover,
  .enterprise-tools-popover {
    max-width: calc(100vw - 28px);
  }

  .hero {
    padding-top: 72px;
    overflow: visible;
  }
}
