.mi-skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  border-radius: 0.35rem;
  padding: 0.7rem 1rem;
  background: #56d8ff;
  color: #071018;
  font: 700 0.9rem/1 Arial, Helvetica, sans-serif;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 140ms ease;
}

.mi-skip-link:focus {
  transform: translateY(0);
}

.mi-header {
  position: relative;
  z-index: 50;
  width: 100%;
  min-height: 5rem;
  border-bottom: 1px solid #2b303a;
  background: #101114;
  color: #f3f5f8;
  font-family: Arial, Helvetica, sans-serif;
}

.mi-header *, .mi-header *::before, .mi-header *::after { box-sizing: border-box; }

.mi-header__inner {
  position: relative;
  display: flex;
  width: calc(100% - 4rem);
  min-height: 5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-inline: auto;
}

.mi-brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 1rem;
  color: inherit;
  text-decoration: none;
}

.mi-brand__seal {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  flex: none;
  place-content: center;
  border: 2px solid #06b6d4;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgb(40 187 236 / 12%), transparent 50%),
    #0b1119;
  box-shadow: 0 0 15px rgb(6 182 212 / 60%);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 0.88;
  text-align: center;
}

.mi-brand__seal::before {
  color: #56d8ff;
  content: "Math";
  font-size: 0.7rem;
}

.mi-brand__seal::after {
  color: #f8c248;
  content: "Infinitum";
  font-size: 0.63rem;
}

@keyframes blueYellowShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.mi-brand__wordmark {
  background: linear-gradient(to right, #28bbec, #f8b620, #4454c4, #f8b620, #28bbec);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  white-space: nowrap;
  animation: blueYellowShift 5s linear infinite;
}

.mi-nav {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateX(-50%);
}

.mi-nav__search {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  margin-right: 0.25rem;
  color: #aab1c1;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  cursor: pointer;
}
.mi-nav__search:hover { color: #78dbf5; background: #1a2844; }

.mi-nav__search svg, .mi-header__moon svg, .mi-account__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.mi-nav__link {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.55rem;
  padding: 0.55rem 1rem;
  color: #aeb3c0;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
}

.mi-nav__link:hover, .mi-nav__link:focus-visible {
  background: #1a2844;
  color: #f5c447;
}

.mi-nav__link--active {
  background: #1a2844;
  color: #f5c447;
}

.mi-header__actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-left: auto;
}

.mi-header__moon {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  color: #aeb3c0;
}

.mi-account { position: relative; }
.mi-account > summary {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #384253;
  border-radius: 50%;
  color: #d3d8e2;
  cursor: pointer;
  list-style: none;
}
.mi-account > summary::-webkit-details-marker { display: none; }
.mi-account > summary:hover, .mi-account[open] > summary { background: #1a2844; }
.mi-account__panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  display: grid;
  min-width: 11rem;
  gap: 0.25rem;
  border: 1px solid #384253;
  border-radius: 0.75rem;
  padding: 0.5rem;
  background: #151b26;
  box-shadow: 0 1rem 2.5rem rgb(0 0 0 / 35%);
}
.mi-account__panel a, .mi-account__panel button {
  display: block;
  width: 100%;
  min-height: 2.5rem;
  border: 0;
  border-radius: 0.4rem;
  padding: 0.6rem 0.75rem;
  background: transparent;
  color: #e3e9f2;
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.mi-account__panel a:hover, .mi-account__panel button:hover { background: #1a2844; }

.mi-mobile { display: none; }

.mi-header a:focus-visible, .mi-header button:focus-visible, .mi-header summary:focus-visible {
  outline: 3px solid #8ce8ff;
  outline-offset: 3px;
}

.mi-brand--footer .mi-brand__seal { width: 2.25rem; height: 2.25rem; }
.mi-brand--footer .mi-brand__seal::before { font-size: 0.48rem; }
.mi-brand--footer .mi-brand__seal::after { font-size: 0.43rem; }
.mi-brand--footer .mi-brand__wordmark { font-size: 1rem; }

@media (max-width: 70rem) {
  .mi-nav, .mi-header__actions { display: none; }
  .mi-mobile { display: block; margin-left: auto; }
  .mi-mobile__toggle {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #384253;
    border-radius: 0.6rem;
    background: #182130;
    color: #e5edf6;
    cursor: pointer;
  }
  .mi-mobile__toggle svg { width: 1.4rem; height: 1.4rem; }
  .mi-mobile > summary { list-style: none; }
  .mi-mobile > summary::-webkit-details-marker { display: none; }
  .mi-mobile__panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: 0;
    z-index: 5;
    border: 1px solid #384253;
    border-radius: 0.75rem;
    padding: 0.6rem;
    background: #151b26;
    box-shadow: 0 1rem 2.5rem rgb(0 0 0 / 35%);
  }
  .mi-mobile__links { display: grid; gap: 0.2rem; }
  .mi-mobile__link, .mi-mobile__utility a, .mi-mobile__utility button {
    display: flex;
    min-height: 3rem;
    align-items: center;
    border: 0;
    border-radius: 0.5rem;
    padding: 0.6rem 0.875rem;
    background: transparent;
    color: #d2d9e4;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
  }
  .mi-mobile__link--active { background: #1a2844; color: #f5c447; }
  .mi-mobile__utility {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.4rem;
    border-top: 1px solid #384253;
    padding-top: 0.4rem;
  }
}

@media (max-width: 32rem) {
  .mi-header__inner { width: calc(100% - 2rem); }
  .mi-brand { gap: 0.65rem; }
  .mi-brand__seal { width: 2.8rem; height: 2.8rem; }
  .mi-brand__seal::before { font-size: 0.63rem; }
  .mi-brand__seal::after { font-size: 0.47rem; }
  .mi-brand__wordmark { font-size: clamp(1rem, 5vw, 1.25rem); }
}

@media (prefers-reduced-motion: reduce) {
  .mi-header *, .mi-header *::before, .mi-header *::after { transition-duration: 0.01ms !important; }
  .mi-brand__wordmark { animation: none; background-position: 50% 50%; }
}
