/* ---------- fixed nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 var(--gutter);
}

/* Crafted scrolled state: a hairline settles under the nav once past the hero. */
.nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--hairline);
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
}
.nav.is-scrolled::after {
  opacity: 1;
}

/* Scroll progress: a thin signal line tracking how far down the page you are. */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: calc(var(--z-nav) + 1);
  pointer-events: none;
}

.nav .blend {
  mix-blend-mode: difference;
  color: var(--paper);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-variation-settings: 'wdth' 125, 'wght' 900;
  font-stretch: 125%;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.nav-mark {
  width: 30px;
  height: 30px;
  flex: none;
  display: block;
}

/* The hummingbird is alive: a slow idle flutter, lively when you hover the logo. */
.nav-mark-wing {
  transform-box: fill-box;
  transform-origin: 88% 96%;
}

@media (prefers-reduced-motion: no-preference) {
  .nav-mark-wing {
    animation: wing-idle 3s ease-in-out infinite;
  }
  .nav-brand:hover .nav-mark-wing {
    animation: wing-flutter 0.16s ease-in-out infinite;
  }
}

@keyframes wing-idle {
  0%, 100% { transform: rotate(0deg) scaleX(1); }
  50% { transform: rotate(-7deg) scaleX(0.9); }
}

@keyframes wing-flutter {
  0%, 100% { transform: rotate(4deg) scaleX(1); }
  50% { transform: rotate(-18deg) scaleX(0.62); }
}

.nav-brand sup {
  font-size: 8px;
  font-variation-settings: 'wdth' 100, 'wght' 700;
  vertical-align: top;
  position: relative;
  top: -1px;
  left: 1px;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex: 1;
  margin-left: clamp(1rem, 6vw, 6rem);
}

.nav-status .mono-label {
  font-size: 10px;
  white-space: nowrap;
}

.nav-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  margin-right: 8px;
  vertical-align: 1px;
}

/* The availability dot breathes like the board's Live dot: one status
   language across the page. */
@media (prefers-reduced-motion: no-preference) {
  .nav-dot {
    animation: nav-dot-pulse 1.6s ease-in-out infinite;
  }
}

@keyframes nav-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.nav-links {
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-variation-settings: 'wdth' 105, 'wght' 600;
  font-stretch: 105%;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.nav-links a {
  padding: 4px 2px;
  transition: opacity 0.25s var(--ease-out);
}

.nav-links a:hover {
  opacity: 0.55;
}

.nav-links .slash {
  margin: 0 0.6em;
  opacity: 0.45;
  font-weight: 400;
}

@media (max-width: 767px) {
  .nav-status {
    display: none;
  }
  .nav-links {
    font-size: 11px;
  }
  .nav-links .slash {
    margin: 0 0.4em;
  }
}

@media (max-width: 480px) {
  .nav {
    padding: 0 1rem;
    gap: 0.75rem;
  }
  .nav-brand {
    font-size: 12px;
  }
  .nav-links {
    font-size: 10px;
    letter-spacing: 0.01em;
  }
  .nav-links .slash {
    margin: 0 0.3em;
  }
}

/* ---------- section rail ---------- */

/* A quiet vertical index on the right edge: where you are, in the slash
   language. Blend-difference so it reads over ink and the paper footer alike.
   Desktop only; text set by core.js. */
.rail {
  position: fixed;
  right: calc(var(--gutter) * 0.45);
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-nav);
  writing-mode: vertical-rl;
  mix-blend-mode: difference;
  color: var(--paper);
  pointer-events: none;
}

.rail-label {
  display: block;
  font-size: 10px;
  opacity: 0.75;
}

@media (max-width: 1023px) {
  .rail {
    display: none;
  }
}

/* ---------- flyby ---------- */

/* The easter egg: click the nav hummingbird and it takes off across the
   viewport. Spawned and choreographed by core.js, removed when it lands. */
.flyby {
  position: fixed;
  z-index: 250;
  width: clamp(30px, 3vw, 42px);
  color: var(--signal);
  pointer-events: none;
}

.flyby svg {
  display: block;
  width: 100%;
  height: auto;
}

.flyby-wing {
  transform-box: fill-box;
  transform-origin: 88% 96%;
}

@media (prefers-reduced-motion: no-preference) {
  .flyby-wing {
    animation: wing-flutter 0.14s ease-in-out infinite;
  }
}

/* ---------- preloader ---------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: var(--z-preloader);
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader.done {
  display: none;
}

.preloader-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.1rem, 3vh, 1.8rem);
}

/* The bird presides over the count, wings going, then darts off to pull the
   curtain (choreographed in core.js). */
.preloader-bird {
  width: clamp(40px, 6vw, 58px);
  height: auto;
  color: var(--paper);
  will-change: transform;
}

.preloader-wing {
  transform-box: fill-box;
  transform-origin: 88% 96%;
}

@media (prefers-reduced-motion: no-preference) {
  .preloader-wing {
    animation: wing-flutter 0.16s ease-in-out infinite;
  }
}

.preloader-mark {
  font-variation-settings: 'wdth' 125, 'wght' 900;
  font-stretch: 125%;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(1.5rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.02em;
  overflow: hidden;
}

.preloader-mark .line-inner {
  display: block;
}

.preloader-count {
  position: absolute;
  top: 1.4rem;
  right: var(--gutter);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--paper-dim);
}

.preloader-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left center;
}
