/* The top bar: the FEELPIXELS wordmark on the left, the light/dark switch and the Shop link on
   the right. It stays at the top while scrolling. At the very top it is see-through; once you
   scroll it turns into frosted glass with a fine line under it, and a ice-blue line shows how far
   down the page you are (.is-scrolled and the progress line: js/features/nav-scroll.js). */

.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  height: var(--nav-height);
  border-bottom: 1px solid transparent;
  transition:
    background-color 400ms var(--ease-in-out),
    border-color 400ms var(--ease-in-out),
    backdrop-filter 400ms var(--ease-in-out);
}

.site-nav.is-scrolled {
  border-bottom-color: var(--color-line);
  background: var(--color-nav-fade);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.site-nav-progress {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

/* Full width: the wordmark near the left edge, the switch and the Shop link near the right. */
.site-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding-inline: var(--gutter);
}

/* ---------- Wordmark ---------- */

/* "F E E L P I X E L S" in spaced serif capitals, like a fashion or hotel brand. */
.site-nav-brand {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  transition: opacity 200ms var(--ease-in-out);
}

.site-nav-brand:hover {
  opacity: 0.75;
}

/* ---------- Links and buttons ---------- */

.site-nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-switch {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-inline: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
  transition:
    color 200ms var(--ease-in-out),
    background-color 200ms var(--ease-in-out);
}

.theme-switch:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.theme-switch svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The icon shows the mode you switch to: a sun in dark mode, a moon in light mode. */
.theme-switch-moon,
:root[data-theme="light"] .theme-switch-sun {
  display: none;
}

:root[data-theme="light"] .theme-switch-moon {
  display: block;
}

/* A plain text link in small spaced capitals, underlined in the accent colour (ice blue) on hover. */
.site-nav-shop {
  padding: 6px 4px;
  border-bottom: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: border-color 200ms var(--ease-in-out);
}

.site-nav-shop:hover {
  border-bottom-color: var(--color-accent);
}

/* ---------- Pixel transition ---------- */

/* Full-screen canvas used for a moment while the theme switches (js/features/theme-switch.js). */
.theme-transition {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
