/* The Kollection — shared navigation, theme and component overrides */

html {
  color-scheme: dark;
}

body {
  transition: background-color .22s ease, color .22s ease;
}

/* Keep the navigation dock dark in both modes so the existing white logo remains readable. */
#site-nav {
  position: relative;
  z-index: 60;
}

.nav {
  width: 100% !important;
  height: 70px !important;
  min-height: 70px !important;
  max-height: 70px !important;
  padding: 8px 14px 8px 20px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 999px !important;
  background: rgba(18,18,20,.90) !important;
  color: #f4f4f6 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 18px 60px rgba(0,0,0,.22) !important;
  backdrop-filter: blur(22px) saturate(1.22) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.22) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  margin: 0 !important;
  overflow: visible !important;
}

.nav .brand {
  display: inline-flex !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 100% !important;
  margin-right: auto !important;
  overflow: hidden !important;
  gap: 0 !important;
}

.nav .brand img {
  display: block !important;
  width: auto !important;
  height: 28px !important;
  max-height: 28px !important;
  max-width: min(68vw, 620px) !important;
  object-fit: contain !important;
  object-position: left center !important;
  background: transparent !important;
  filter: none !important;
}

.nav .brand-play,
.nav .brand-text,
.nav .brand-mark {
  display: none !important;
}

.desktop-nav {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
}

.desktop-nav .wide-link {
  min-height: 42px !important;
  padding: 0 13px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  color: #b9b9c0 !important;
  background: transparent !important;
  border: 0 !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  letter-spacing: -.01em !important;
  white-space: nowrap !important;
  transition: color .18s ease, background .18s ease, transform .18s ease !important;
}

.desktop-nav .wide-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,.07) !important;
}

.desktop-nav .wide-link.active {
  color: #151518 !important;
  background: #f4f4f6 !important;
  box-shadow: 0 8px 26px rgba(255,255,255,.035) !important;
}

.desktop-nav .wide-link.github,
.desktop-nav .wide-link.coffee {
  color: #818cf8 !important;
}

.desktop-nav .wide-link.github:hover,
.desktop-nav .wide-link.coffee:hover {
  color: #a5b4fc !important;
  background: rgba(99,102,241,.10) !important;
}

.desktop-nav .wide-link svg {
  width: 17px !important;
  height: 17px !important;
  flex: 0 0 17px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.desktop-nav .wide-link.github svg {
  fill: currentColor !important;
  stroke: none !important;
}

.desktop-nav-divider {
  width: 1px !important;
  height: 24px !important;
  margin: 0 5px !important;
  background: rgba(255,255,255,.09) !important;
  flex: 0 0 1px !important;
}

.nav-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  position: static !important;
  inset: auto !important;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
  transform: none !important;
}

.nav-actions > * {
  flex-shrink: 0 !important;
}

/* Theme control */
.theme-toggle {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  float: none !important;
  align-self: center !important;
  margin: 0 !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #f5f5f6 !important;
  display: inline-grid !important;
  place-items: center !important;
  cursor: pointer !important;
  flex: 0 0 42px !important;
  box-shadow: none !important;
  transform: none !important;
  transition: background .18s ease, transform .18s ease !important;
}

.theme-toggle:hover {
  background: rgba(255,255,255,.075) !important;
  transform: translateY(-1px) !important;
}

.theme-toggle:focus-visible,
.menu:focus-visible,
.menu-dropdown a:focus-visible {
  outline: 2px solid #a5b4fc !important;
  outline-offset: 2px !important;
}

.theme-icon {
  width: 22px !important;
  height: 22px !important;
  display: block;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.theme-toggle .icon-moon { display: none !important; }
body.light .theme-toggle .icon-sun { display: none !important; }
body.light .theme-toggle .icon-moon { display: block !important; }

.desktop-theme-toggle { display: none !important; }
.mobile-theme-toggle { display: inline-grid !important; }

/* Mobile menu: fixed square geometry keeps the open-state circle centered on the X. */
.menu-wrap {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  float: none !important;
  align-self: center !important;
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

.menu {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  float: none !important;
  align-self: center !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #f5f5f6 !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  opacity: 1 !important;
  box-shadow: none !important;
  transform: none !important;
  transition: background .18s ease, transform .18s ease !important;
}

.menu:hover {
  background: rgba(255,255,255,.055) !important;
  transform: none !important;
}

.menu-wrap.open .menu {
  /* Match the closed button geometry so the X/circle cannot jump or overflow. */
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  background: rgba(255,255,255,.115) !important;
}

.menu .menu-glyph {
  /* Reset the older inline .menu span rules completely.
     Those rules set top/left:50%, which pushed the hamburger down/right. */
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 18px !important;
  height: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
  line-height: 0 !important;
  font-size: 0 !important;
}

.menu .menu-glyph::before,
.menu .menu-glyph::after {
  content: none !important;
  display: none !important;
}

.menu .menu-line {
  position: absolute !important;
  left: 0 !important;
  width: 18px !important;
  height: 2px !important;
  border-radius: 999px !important;
  background: #f4f4f6 !important;
  transform-origin: center !important;
  transition: top .18s ease, transform .18s ease, opacity .14s ease !important;
}

.menu .menu-line:nth-child(1) { top: 0 !important; }
.menu .menu-line:nth-child(2) { top: 6px !important; }
.menu .menu-line:nth-child(3) { top: 12px !important; }

.menu-wrap.open .menu-line:nth-child(1) {
  top: 6px !important;
  transform: rotate(45deg) !important;
}
.menu-wrap.open .menu-line:nth-child(2) {
  opacity: 0 !important;
}
.menu-wrap.open .menu-line:nth-child(3) {
  top: 6px !important;
  transform: rotate(-45deg) !important;
}

.menu-dropdown {
  position: absolute !important;
  right: 0 !important;
  left: auto !important;
  top: calc(100% + 12px) !important;
  width: min(270px, calc(100vw - 28px)) !important;
  margin: 0 !important;
  padding: 9px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  border-radius: 22px !important;
  background: rgba(18,18,20,.98) !important;
  color: #f5f5f6 !important;
  box-shadow: 0 26px 70px rgba(0,0,0,.52) !important;
  backdrop-filter: blur(22px) saturate(1.18) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.18) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-7px) scale(.985) !important;
  transform-origin: top right !important;
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease !important;
  z-index: 80 !important;
  overflow: hidden !important;
}

.menu-wrap.open .menu-dropdown {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

.menu-dropdown .menu-link,
.menu-dropdown > a {
  min-height: 48px !important;
  padding: 0 13px !important;
  border-radius: 15px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  color: #c9c9ce !important;
  background: transparent !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  letter-spacing: -.01em !important;
  text-decoration: none !important;
}

.menu-dropdown .menu-link:hover,
.menu-dropdown .menu-link.active,
.menu-dropdown > a:hover,
.menu-dropdown > a.active {
  color: #fff !important;
  background: rgba(255,255,255,.075) !important;
}

.nav-item-icon,
.menu-community svg {
  width: 19px !important;
  height: 19px !important;
  flex: 0 0 19px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* GitHub + Buy me a coffee — side by side */
.menu-community {
  margin-top: 8px !important;
  padding: 13px 6px 5px !important;
  border-top: 1px solid rgba(255,255,255,.08) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 18px !important;
  width: 100% !important;
}

.menu-community a {
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  gap: 7px !important;
  color: #818cf8 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: -.01em !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  transition: color .18s ease, opacity .18s ease, transform .18s ease !important;
}

.menu-community a:hover {
  color: #a5b4fc !important;
  background: transparent !important;
  opacity: 1 !important;
  transform: translateY(-1px) !important;
}

.menu-community svg {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
}

.menu-community .github-icon {
  fill: currentColor !important;
  stroke: none !important;
}

/* -------------------- LIGHT MODE --------------------
   Dark is always the default. Light is applied only after the visitor taps the toggle.
*/
body.light {
  --bg: #f4f5f7 !important;
  --text: #17181c !important;
  --muted: #686b73 !important;
  --line: rgba(0,0,0,.12) !important;
  --line-soft: rgba(0,0,0,.075) !important;
  --button: #17181c !important;
  --button-text: #fff !important;
  background:
    radial-gradient(circle at 50% 22%, rgba(107,114,128,.10), transparent 34rem),
    radial-gradient(circle at 76% 74%, rgba(99,102,241,.08), transparent 32rem),
    #f4f5f7 !important;
  color: #17181c !important;
}

body.light::before {
  opacity: .11 !important;
  background-image:
    linear-gradient(rgba(0,0,0,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.055) 1px, transparent 1px) !important;
}

body.light .hero,
body.light .caption,
body.light .news-shell,
body.light .release {
  color: #17181c !important;
}

body.light h1,
body.light h2,
body.light .caption h2,
body.light .news-heading h1,
body.light .release h2 {
  color: #17181c !important;
}

body.light .hero p,
body.light .caption p,
body.light .news-heading p,
body.light .release-summary,
body.light .release-details {
  color: #686b73 !important;
}

body.light .eyebrow {
  color: #484b52 !important;
  border-color: rgba(0,0,0,.10) !important;
  background: rgba(255,255,255,.72) !important;
  box-shadow: 0 6px 24px rgba(17,24,39,.04) !important;
}

body.light .btn-primary,
body.light .btn.primary {
  color: #fff !important;
  background: #17181c !important;
  border-color: #17181c !important;
  box-shadow: 0 14px 36px rgba(17,24,39,.14) !important;
}

body.light .btn-secondary,
body.light .release-actions .btn:not(.primary) {
  color: #202126 !important;
  background: rgba(255,255,255,.78) !important;
  border-color: rgba(0,0,0,.11) !important;
  box-shadow: 0 10px 30px rgba(17,24,39,.045) !important;
}

body.light .microcopy,
body.light .release-meta,
body.light .loading,
body.light .latest-update-label {
  color: #767982 !important;
}

body.light .latest-update {
  border-color: rgba(0,0,0,.10) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.66)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 18px 46px rgba(17,24,39,.08) !important;
}

body.light .latest-update-title {
  color: #202126 !important;
}

body.light .latest-update-icon {
  color: #625df6 !important;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.10)) !important;
  border-color: rgba(99,102,241,.20) !important;
}

body.light .version-badge {
  color: #5148cf !important;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.10)) !important;
  border-color: rgba(99,102,241,.24) !important;
}

body.light .release,
body.light .news-heading {
  border-color: rgba(0,0,0,.08) !important;
}

body.light .release-tag {
  color: #62656d !important;
  border-color: rgba(0,0,0,.11) !important;
  background: rgba(255,255,255,.62) !important;
}

body.light .showcase-card img {
  filter: drop-shadow(0 26px 70px rgba(17,24,39,.18)) !important;
}

/* The footer stays dark in light mode so the existing white banner logo remains legible. */
.site-footer {
  position: relative !important;
  isolation: isolate !important;
}

body.light .site-footer::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: #111216;
}

body.light .site-footer {
  border-top-color: rgba(255,255,255,.045) !important;
}

/* Desktop / mobile split */
@media (min-width: 900px) {
  .desktop-nav { display: flex !important; }
  .desktop-theme-toggle { display: inline-grid !important; }
  .nav-actions { display: none !important; }
  .menu-wrap { display: none !important; }
}

@media (min-width: 900px) and (max-width: 1180px) {
  .desktop-nav { gap: 0 !important; }
  .desktop-nav .wide-link {
    min-height: 40px !important;
    padding-inline: 10px !important;
    font-size: 13px !important;
  }
  .desktop-nav .wide-link.github,
  .desktop-nav .wide-link.coffee { padding-inline: 8px !important; }
  .theme-toggle {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    flex-basis: 38px !important;
  }
}

@media (max-width: 899px) {
  .desktop-nav { display: none !important; }
  .nav .brand {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
  }
  .nav-actions {
    display: flex !important;
    width: auto !important;
    margin-left: auto !important;
    justify-content: flex-end !important;
  }
  .menu-wrap { display: grid !important; }
  .desktop-theme-toggle { display: none !important; }
  .mobile-theme-toggle { display: inline-grid !important; }
}

@media (max-width: 700px) {
  .nav {
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    padding: 7px 9px 7px 14px !important;
    gap: 7px !important;
  }

  .nav .brand img {
    height: 22px !important;
    max-height: 22px !important;
    max-width: 64vw !important;
  }

  .theme-toggle {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    flex-basis: 40px !important;
  }

  .theme-icon {
    width: 21px !important;
    height: 21px !important;
  }

  .menu-wrap {
    width: 42px !important;
    height: 42px !important;
    flex-basis: 42px !important;
  }

  .menu {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }

  .menu-wrap.open .menu {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }

  .menu-dropdown {
    width: min(258px, calc(100vw - 20px)) !important;
    top: calc(100% + 10px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .theme-toggle,
  .menu,
  .menu-line,
  .menu-dropdown {
    transition: none !important;
  }
}

/* ============================================================
   FINAL NAV GEOMETRY — authoritative shared header sizing
   Matches the slimmer reference layout.
   ============================================================ */

.nav {
  height: 62px !important;
  min-height: 62px !important;
  max-height: 62px !important;
  padding: 5px 12px 5px 18px !important;
  gap: 9px !important;
}

.nav .brand {
  height: 100% !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  overflow: hidden !important;
}

.nav .brand img {
  display: block !important;
  width: auto !important;
  height: 22px !important;
  max-height: 22px !important;
  max-width: min(68vw, 520px) !important;
  object-fit: contain !important;
  object-position: left center !important;
}

.nav-actions {
  gap: 2px !important;
}

.theme-toggle {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  flex-basis: 38px !important;
}

.theme-icon {
  width: 20px !important;
  height: 20px !important;
}

.menu-wrap {
  width: 40px !important;
  height: 40px !important;
  flex: 0 0 40px !important;
}

.menu,
.menu-wrap.open .menu {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
}

/* Keep the two community links on one line. */
.menu-community {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 18px !important;
}

.menu-community a {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

@media (max-width: 899px) {
  .nav {
    height: 62px !important;
    min-height: 62px !important;
    max-height: 62px !important;
    padding: 5px 10px 5px 16px !important;
  }

  .nav .brand img {
    height: 22px !important;
    max-height: 22px !important;
  }

  .theme-toggle {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    flex-basis: 38px !important;
  }

  .menu-wrap {
    width: 40px !important;
    height: 40px !important;
    flex-basis: 40px !important;
  }

  .menu,
  .menu-wrap.open .menu {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
  }
}

@media (max-width: 700px) {
  .nav {
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 4px 8px 4px 14px !important;
    gap: 5px !important;
  }

  .nav .brand img {
    height: 18px !important;
    max-height: 18px !important;
    max-width: 72vw !important;
  }

  .theme-toggle {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    flex-basis: 34px !important;
  }

  .theme-icon {
    width: 18px !important;
    height: 18px !important;
  }

  .menu-wrap {
    width: 36px !important;
    height: 36px !important;
    flex-basis: 36px !important;
  }

  .menu,
  .menu-wrap.open .menu {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
  }
}
