/* ==========================================================================
   LAYER 200: Chrome (Nav, Footer, Controls)
   ========================================================================== */

/* Top Navigation */
.top-nav {
  position: relative;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 1;
}

.top-nav.has-overlap-backdrop {
  z-index: 260;
}

.top-nav.has-overlap-backdrop::before {
  content: "";
  position: absolute;
  inset: -10px -20px -12px;
  border: 1px solid rgba(95, 95, 95, 0.75);
  border-radius: 4px;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 14% 18%, rgba(175, 175, 175, 0.2) 0 1px, transparent 1.8px),
    radial-gradient(circle at 72% 24%, rgba(165, 165, 165, 0.18) 0 1px, transparent 1.8px),
    radial-gradient(circle at 40% 66%, rgba(185, 185, 185, 0.16) 0 1px, transparent 1.8px),
    radial-gradient(circle at 86% 78%, rgba(170, 170, 170, 0.2) 0 1px, transparent 1.8px),
    linear-gradient(rgba(58, 58, 58, 0.98), rgba(58, 58, 58, 0.98)),
    url('../paper-dark.png') center/220px 220px;
  background-size: 220px 220px, 220px 220px, 220px 220px, 220px 220px, auto, 220px 220px;
  background-repeat: repeat;
}

.menu-trigger {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
}

.menu-trigger-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.95);
  cursor: var(--cursor-light), pointer;
}

.menu-label {
  display: inline-block;
  font-family: var(--mono-font);
  font-size: var(--text-ui);
  line-height: var(--leading-ui);
  letter-spacing: 0;
  text-transform: uppercase;
  color: inherit;
  transition: color 0.2s ease;
}

.menu-trigger-toggle:hover {
  color: #fff;
}

body:not(.theme-night) .menu-trigger-toggle:hover,
body:not(.theme-night) .top-nav.is-open .menu-trigger-toggle {
  color: var(--color-text-day);
  text-shadow: none;
}

.menu-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.menu-links[hidden] {
  display: none;
}

.menu-link-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.menu-link-group--external {
  margin-top: 12px;
}

.nav-link {
  font-family: var(--mono-font);
  font-size: var(--text-ui);
  line-height: var(--leading-ui);
  text-transform: uppercase;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  text-shadow: none;
  transition: color 0.2s ease;
  cursor: var(--cursor-light), pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link::after {
  content: "";
  width: 15px;
  height: 15px;
  background: url('../cursor-light.svg') center/contain no-repeat;
  transform-origin: center;
  flex: 0 0 auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  color: #fff;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
  text-shadow: none;
  cursor: var(--cursor-dark), pointer;
}

body:not(.theme-night) .nav-link::after {
  background-image: url('../cursor-dark.svg');
}

.nav-link:hover::after {
  opacity: 1;
  animation: navLinkStarSpin 1.15s linear infinite;
}

@keyframes navLinkStarSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-link:hover::after,
  .page--values .disclosure-summary:is(:hover, :focus-visible)::after,
  .posts-list a:is(:hover, :focus-visible) .post-name::after {
    animation: none;
  }
}

.theme-night .nav-link,
.theme-night .menu-trigger-toggle {
  cursor: var(--cursor-dark), pointer;
}

.theme-night .nav-link:hover,
.theme-night .menu-trigger-toggle:hover {
  cursor: var(--cursor-light), pointer;
}

/* Footer */
#site-footer {
  position: relative;
  z-index: 200;
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--mono-font);
  font-size: var(--text-ui);
  line-height: var(--leading-ui);
}

/* Bottom Controls */
.bottom-controls {
  position: relative;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 16px;
}

#theme-toggle {
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--mono-font);
  font-size: var(--text-ui);
  line-height: var(--leading-ui);
  padding: 6px 10px;
  cursor: var(--cursor-light), pointer;
  transition: color 0.2s ease;
}

#theme-toggle:hover {
  color: #fff;
  cursor: var(--cursor-dark), pointer;
}

.theme-night #theme-toggle {
  cursor: var(--cursor-dark), pointer;
}

.theme-night #theme-toggle:hover {
  cursor: var(--cursor-light), pointer;
}

#theme-toggle .value {
  margin-inline-start: 0.15em;
}

#theme-toggle::after {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  background: url('../cursor-light.svg') center/contain no-repeat;
  transform-origin: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

body:not(.theme-night) #theme-toggle::after {
  background-image: url('../cursor-dark.svg');
}

#theme-toggle:hover::after,
#theme-toggle:focus-visible::after {
  opacity: 1;
  animation: navLinkStarSpin 1.15s linear infinite;
}

/* Language Picker */
.lang-picker {
  position: relative;
  z-index: 220;
  pointer-events: auto;
}

#lang-toggle {
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--mono-font);
  font-size: var(--text-ui);
  line-height: var(--leading-ui);
  padding: 6px 10px;
  cursor: var(--cursor-light), pointer;
  transition: color 0.2s ease;
  position: relative;
  z-index: 221;
  pointer-events: auto;
}

#lang-toggle .value {
  margin-inline-start: 0.15em;
}

#lang-toggle::after {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  background: url('../cursor-light.svg') center/contain no-repeat;
  transform-origin: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

body:not(.theme-night) #lang-toggle::after {
  background-image: url('../cursor-dark.svg');
}

#lang-toggle:hover::after,
#lang-toggle:focus-visible::after {
  opacity: 1;
  animation: navLinkStarSpin 1.15s linear infinite;
}

#lang-toggle:hover {
  color: #fff;
  cursor: var(--cursor-dark), pointer;
}

.theme-night #lang-toggle {
  cursor: var(--cursor-dark), pointer;
}

.theme-night #lang-toggle:hover {
  cursor: var(--cursor-light), pointer;
}

