/* The story sections: manifesto, how it works, the tour and the ticker. Scroll choreography for
   each lives in js/motion.js. */

/* Lenis smooth scrolling (js/motion.js) needs these on the home page. */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

/* Manifesto: words light up one by one as you scroll (js splits them into .word spans). */
.manifesto {
  padding-block: clamp(140px, 26vh, 280px);
}

.manifesto-text,
.manifesto-answer {
  max-width: 1120px;
  font-size: clamp(1.9rem, 4.2vw, 3.8rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.14;
}

.manifesto-text .word {
  transition: color 0.2s;
}

.motion .manifesto-text .word {
  opacity: 0.13;
}

.manifesto-answer {
  margin-top: 0.9em;
  font-weight: 600;
}

/* How it works: three moves on a circuit line that draws itself. */
.how {
  padding-block: clamp(100px, 16vh, 200px);
}

.how h2 {
  max-width: 16ch;
  margin-top: 18px;
}

.circuit {
  position: relative;
  margin-top: clamp(56px, 9vh, 96px);
  container-type: inline-size;
}

.circuit-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  overflow: visible;
}

.circuit-line path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.circuit-track {
  stroke: var(--line-strong);
}

.circuit-glow {
  stroke: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.moves {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* No column gap, so each node sits exactly on the line's bends (1/6, 1/2 and 5/6 of the width). */
.move {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding-inline: 16px;
  text-align: center;
}

.move-node {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-top: calc(5cqw - 32px);
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--dim);
  transition: color 0.6s, border-color 0.6s, box-shadow 0.6s, transform 0.6s var(--ease-out);
}

.move-node .icon {
  width: 28px;
  height: 28px;
}

.move h3 {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  color: var(--muted);
  transition: color 0.6s;
}

.move p {
  max-width: 30ch;
  color: var(--muted);
}

.move.is-lit .move-node,
html:not(.motion) .move-node {
  border-color: rgb(108 240 200 / 0.6);
  color: var(--accent);
  box-shadow: 0 0 0 8px rgb(108 240 200 / 0.07), 0 0 40px var(--accent-glow);
  transform: scale(1.06);
}

.move.is-lit h3,
html:not(.motion) .move h3 {
  color: var(--text);
}

/* The tour: steps scroll on the left while the screen on the right stays put. Each slide is a shot
   of the office with its panel lifted out as a card, big enough to read. */
.tour {
  padding-block: clamp(60px, 10vh, 120px);
}

.tour-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(32px, 5vw, 80px);
}

.tour-steps {
  grid-column: 1;
  grid-row: 1;
}

.tour-screen {
  grid-column: 2;
  grid-row: 1;
  position: relative;
}

.tour-heading {
  margin-bottom: clamp(24px, 6vh, 64px);
}

.tour-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  min-height: 78vh;
  max-width: 28rem;
  transition: opacity 0.5s;
}

.motion .tour-step {
  opacity: 0.22;
}

.motion .tour-step.is-active {
  opacity: 1;
}

.tour-step h3 {
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.tour-step p {
  color: var(--muted);
  font-size: 1.12rem;
}

.step-label {
  color: var(--accent);
  text-transform: uppercase;
}

.step-label.wait {
  color: var(--wait);
}

.screen {
  position: sticky;
  top: max(110px, calc(50vh - 300px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 50px 120px -40px rgb(0 0 0 / 0.85), 0 0 100px -40px var(--accent-glow);
}

.screen-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.screen-url {
  margin-left: auto;
  color: var(--dim);
}

.screen-body {
  position: relative;
  aspect-ratio: 16 / 10;
}

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
}

.slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(0.8) brightness(0.62);
  transform: scale(1.06);
  transition: opacity 0.8s var(--ease-out), transform 1.6s var(--ease-out);
}

/* The panel card overhangs the screen a little, as if lifted off it. */
.slide-card {
  position: absolute;
  top: 9%;
  right: -3%;
  width: 46%;
  max-height: 104%;
  object-fit: cover;
  object-position: top;
  border: 1px solid rgb(255 255 255 / 0.5);
  border-radius: 14px;
  box-shadow: 0 40px 80px -20px rgb(0 0 0 / 0.75), 0 0 0 6px rgb(108 240 200 / 0.08);
  opacity: 0;
  transform: translate3d(40px, 30px, 0) rotate(1.5deg) scale(0.94);
  transition: opacity 0.6s var(--ease-out), transform 1s var(--ease-out);
  -webkit-mask-image: linear-gradient(180deg, #000 86%, transparent);
  mask-image: linear-gradient(180deg, #000 86%, transparent);
}

.slide.is-active .slide-bg {
  opacity: 1;
  transform: none;
}

.slide.is-active .slide-card {
  opacity: 1;
  transform: none;
  transition-delay: 0.12s;
}

.screen-body,
.screen-progress {
  border-radius: 0 0 var(--radius) var(--radius);
}

.screen-body {
  border-radius: 0;
}

.screen-progress {
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.screen-progress span {
  display: block;
  width: 16.7%;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.6s var(--ease-out);
}

/* Ticker: the page's one marquee, the demo crew's statuses rolling past. */
.ticker {
  overflow: hidden;
  padding-block: 28px;
  border-block: 1px solid var(--line);
  background: var(--bg-raised);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
}

.motion .ticker-track {
  animation: ticker 48s linear infinite;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-row {
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 0 14px 0 0;
  list-style: none;
}

.ticker-row li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.86rem;
  white-space: nowrap;
}

.ticker-row .icon {
  color: var(--accent);
}

.ticker-row li.wait {
  border-color: rgb(255 181 71 / 0.35);
  color: var(--wait);
}

.ticker-row li.wait .icon {
  color: var(--wait);
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide-bg,
  .slide-card {
    transition: none;
  }
}

@media (max-width: 900px) {
  .circuit-line {
    display: none;
  }

  /* A vertical rail replaces the circuit line on narrow screens. */
  .moves {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-left: 32px;
    border-left: 1px solid var(--line-strong);
  }

  .move {
    justify-items: start;
    gap: 10px;
    padding-inline: 0;
    text-align: left;
  }

  .move-node {
    width: 52px;
    height: 52px;
    margin: 0 0 6px -59px;
  }

  /* Phones: the screen sticks under the nav and the steps scroll up beneath it. */
  .tour-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tour-steps,
  .tour-screen {
    grid-column: 1;
    grid-row: auto;
  }

  .tour-screen {
    position: sticky;
    top: 12px;
    z-index: 5;
    order: 2;
    padding-bottom: 28px;
    background: linear-gradient(var(--bg) 85%, transparent);
  }

  .tour-steps {
    order: 3;
  }

  .screen {
    position: relative;
    top: 0;
  }

  .slide-card {
    right: 4%;
    width: 52%;
    top: 6%;
  }

  .tour-step {
    min-height: 56vh;
    justify-content: flex-start;
    padding-top: 24px;
  }
}
