/* Chrome, pills, bubbles and the little bot */

/* Navigation */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  padding-top: calc(var(--shell) + 14px);
  pointer-events: none;
}

.nav::before {
  content: "";
  position: absolute;
  top: var(--shell);
  left: var(--shell);
  right: var(--shell);
  height: 96px;
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--paper) 88%, transparent), color-mix(in srgb, var(--paper) 0%, transparent));
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-soft);
}

.nav.is-scrolled::before {
  opacity: 1;
}

.nav__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(calc(100vw - (var(--shell) * 2) - (var(--gutter) * 2)), var(--max));
  margin-inline: auto;
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  border-radius: 8px;
}

.brand__mark {
  width: 25px;
  height: 25px;
  color: var(--ink);
}

.brand__word {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand__word span {
  font-family: var(--font-mono);
  font-size: 0.8em;
  font-weight: 500;
  letter-spacing: 0.01em;
  vertical-align: 0.04em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 1.7vw, 26px);
  margin-left: auto;
  margin-right: clamp(14px, 1.8vw, 26px);
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 450;
  letter-spacing: -0.008em;
  white-space: nowrap;
  transition: color var(--dur-2) ease;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-3) var(--ease-out);
}

.nav__link:hover {
  color: var(--ink);
}

.nav__link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 22%, transparent);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper-raised) 72%, transparent);
  color: var(--ink-soft);
  transition: border-color var(--dur-2) ease, color var(--dur-2) ease, transform var(--dur-2) var(--ease-out);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.icon-btn:hover {
  border-color: var(--faint);
  color: var(--ink);
  transform: translateY(-1px);
}

.nav__burger {
  display: none;
}

[data-theme="dark"] .icon-btn .icon-sun,
.icon-btn .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-btn .icon-moon {
  display: block;
}

/* Mobile sheet */

.mobile-menu {
  position: fixed;
  z-index: 290;
  top: calc(var(--shell) + 52px);
  left: calc(var(--shell) + 12px);
  right: calc(var(--shell) + 12px);
  padding: 10px;
  background: color-mix(in srgb, var(--paper-raised) 96%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px -30px rgba(24, 24, 27, 0.45);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.985);
  transform-origin: top center;
  transition: opacity var(--dur-2) ease, transform var(--dur-3) var(--ease-out), visibility var(--dur-2);
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.mobile-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 450;
}

.mobile-menu__link + .mobile-menu__link {
  border-top: 1px solid var(--line-soft);
}

.mobile-menu__link:hover {
  background: var(--paper);
  color: var(--ink);
}

.mobile-menu__meta {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Pills */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) ease, background var(--dur-2) ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -16px rgba(24, 24, 27, 0.55);
}

.btn:active {
  transform: translateY(0) scale(0.99);
}

.btn--dark {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
}

.btn--light {
  --btn-bg: var(--paper-raised);
  --btn-fg: var(--ink);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
}

.btn--light:hover {
  border-color: var(--faint);
}

.btn svg {
  width: 13px;
  height: 13px;
  opacity: 0.8;
}

/* Chat bubbles */

.bubble {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  transform: rotate(-3deg);
}

.bubble__inner {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px 7px 11px;
  border-radius: var(--radius-pill);
  background: var(--bubble-color, var(--blue));
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--bubble-color, var(--blue)) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  animation: bubble-float 3s var(--ease-soft) infinite;
  animation-delay: var(--float-delay, 0s);
}

.bubble__inner::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 17px;
  bottom: -3px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: inherit;
  transform: rotate(45deg);
}

.bubble--blue {
  --bubble-color: var(--blue);
}

.bubble--green {
  --bubble-color: var(--bubble-green);
}

.bubble--red {
  --bubble-color: var(--bubble-red);
}

.bubble--black {
  --bubble-color: var(--black);
}

.bubble--gold {
  --bubble-color: #8f641a;
}

@keyframes bubble-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bubble__inner {
    animation: none;
  }
}

/* Prequel bot (simple SVG/CSS build of the mascot) */

.prequel-bot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  --bot-size: 54px;
}

.prequel-bot__halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--bot-size) * 2.1);
  height: calc(var(--bot-size) * 2.1);
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  border-radius: 50%;
  transform: translate(-50%, -58%);
  pointer-events: none;
}

.prequel-bot__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: calc(var(--bot-size) * 1.55);
  height: calc(var(--bot-size) * 1.55);
  border-radius: 50%;
  background: #0d0d10;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 24px rgba(255, 255, 255, 0.08);
}

.prequel-bot__disc {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--bot-size) * 0.3);
  width: var(--bot-size);
  height: var(--bot-size);
  border-radius: 50%;
  background: #fff;
  transition: transform 220ms var(--ease-spring), gap 220ms var(--ease-spring);
}

.prequel-bot__eye {
  width: calc(var(--bot-size) * 0.14);
  height: calc(var(--bot-size) * 0.32);
  border-radius: 999px;
  background: #0b0b0f;
  transform-origin: center;
  transition: width 160ms var(--ease-spring), height 160ms var(--ease-spring), border-radius 160ms var(--ease-spring), transform 180ms var(--ease-spring), opacity 120ms linear;
}

.prequel-bot__disc-dots {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: calc(var(--bot-size) * 0.2);
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  transition: opacity 120ms linear, transform 180ms var(--ease-spring);
}

.prequel-bot__disc-dot {
  width: calc(var(--bot-size) * 0.12);
  height: calc(var(--bot-size) * 0.12);
  border-radius: 50%;
  background: #8e8e93;
}

.prequel-bot__disc-dot--mid {
  width: calc(var(--bot-size) * 0.2);
  height: calc(var(--bot-size) * 0.2);
  background: #fff;
}

.prequel-bot__label {
  position: relative;
  padding: 4px 7px;
  border-radius: 5px;
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.18em;
  line-height: 1;
}

.prequel-bot[data-state="dots"] .prequel-bot__disc {
  gap: calc(var(--bot-size) * 0.3);
}

.prequel-bot[data-state="dots"] .prequel-bot__eye {
  width: calc(var(--bot-size) * 0.15);
  height: calc(var(--bot-size) * 0.15);
}

.prequel-bot[data-state="tilt"] .prequel-bot__eye {
  transform: rotate(-12deg);
}

.prequel-bot[data-state="look"] .prequel-bot__disc {
  gap: calc(var(--bot-size) * 0.22);
}

.prequel-bot[data-state="look"] .prequel-bot__eye {
  width: calc(var(--bot-size) * 0.1);
  height: calc(var(--bot-size) * 0.2);
  transform: rotate(-35deg) translateX(calc(var(--bot-size) * 0.12));
}

.prequel-bot[data-state="look"] .prequel-bot__eye--l {
  transform: rotate(-35deg) translateX(calc(var(--bot-size) * 0.12)) scale(0.85);
}

.prequel-bot[data-state="happy"] .prequel-bot__eye {
  width: calc(var(--bot-size) * 0.18);
  height: calc(var(--bot-size) * 0.09);
  border-radius: calc(var(--bot-size) * 0.09) calc(var(--bot-size) * 0.09) 2px 2px;
  background: #0b0b0f;
  transform: translateY(calc(var(--bot-size) * 0.06));
}

.prequel-bot[data-state="wink"] .prequel-bot__eye--l {
  width: calc(var(--bot-size) * 0.16);
  height: calc(var(--bot-size) * 0.045);
  transform: rotate(-8deg);
}

.prequel-bot[data-state="wink"] .prequel-bot__eye--r {
  width: calc(var(--bot-size) * 0.12);
  height: calc(var(--bot-size) * 0.12);
}

.prequel-bot[data-state="blink"] .prequel-bot__eye {
  transform: scaleY(0.12);
}

.prequel-bot[data-state="think"] .prequel-bot__eye {
  opacity: 0;
  transform: scale(0.8);
}

.prequel-bot[data-state="think"] .prequel-bot__disc {
  transform: scale(0.34);
}

.prequel-bot[data-state="think"] .prequel-bot__disc-dots {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.prequel-bot[data-state="think"] .prequel-bot__disc-dot--mid {
  animation: bot-pulse 700ms ease-in-out infinite;
}

.prequel-bot[data-state="think"] .prequel-bot__disc-dot:not(.prequel-bot__disc-dot--mid) {
  animation: bot-blink-dot 700ms ease-in-out infinite;
}

.prequel-bot[data-state="think"] .prequel-bot__disc-dot:last-child {
  animation-delay: 350ms;
}

@keyframes bot-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

@keyframes bot-blink-dot {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prequel-bot[data-state="think"] .prequel-bot__disc-dot {
    animation: none !important;
  }

  .prequel-bot * {
    transition-duration: 1ms !important;
  }
}

/* Round controls used by the scrolling scenes */

.round-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper-raised) 88%, transparent);
  color: var(--ink-soft);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
  transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2) ease, color var(--dur-2) ease, background var(--dur-2) ease;
}

.round-btn svg {
  width: 14px;
  height: 14px;
}

.round-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
}

.round-btn:active {
  transform: translateY(0) scale(0.96);
}

.round-btn--on-dark {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(13, 13, 16, 0.42);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.round-btn--on-dark:hover {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(13, 13, 16, 0.66);
  color: #fff;
}

