/* The tour: one pinned stage under the hero. Scrolling plays rendered frames of the cabinet (tools/tour), the way
   the surgical robot is shown on neuralink.com: the text changes on the left while the camera moves on the right.
   The film stops in front of the screen. The cabinet then fades from round it, the screen moves to first place
   among the three steps, and the view moves right to the console. tour.js drives it; this file is the layout. */

.tour {
  --tour-bg: var(--night);
  position: relative;
  background: var(--night);
  color: var(--night-ink);
}
/* The length of the scroll. One unit of the renders' clock takes --tour-unit of scrolling, and tour.js says how
   many units there are (--tour-len). */
.tour-live .tour {
  --tour-unit: 482vh;
  height: calc(100vh + var(--tour-unit) * var(--tour-len, 1.6));
}
.tour-live[data-variant="ute"] .tour {
  --tour-unit: 850vh;
}
.tour__stage {
  position: relative;
  overflow: hidden;
  background: var(--tour-bg);
}
.tour-live .tour__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
}
.tour__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
html:not(.tour-live) .tour__canvas,
html:not(.tour-live) .tour__ticks,
html:not(.tour-live) .tour__tags {
  display: none;
}
/* where a link to the three steps lands: tour.js puts it at the scroll position that shows them */
.tour__mark {
  position: absolute;
  top: calc((100% - 100vh) * var(--f, 0.8) + var(--nav-h));
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* ---- the text, one slide at a time ---- */
.tour__slides {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  margin: 0;
  padding: 0 0 0 calc(var(--gutter) + 1.75rem);
  list-style: none;
}
.tour-live .tour__slides {
  position: absolute;
  inset: 0 auto 0 0;
  width: min(38vw, 37rem);
  pointer-events: none;
}
.tour__slide {
  grid-area: 1 / 1;
}
.tour-live .tour__slide,
.tour-live .tour__panel--steps .tour__copy {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.3s ease-in, transform 0.3s ease-in;
}
.tour-live .tour__slide.is-on,
.tour-live .tour__panel--steps .tour__copy.is-on {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s 0.12s var(--ease), transform 0.6s 0.12s var(--ease);
}
.tour__title {
  font-size: clamp(2.25rem, 1rem + 3.4vw, 4.25rem);
}
.tour__text {
  max-width: 30rem;
  margin-top: clamp(0.875rem, 2vh, 1.375rem);
  font-size: clamp(1.0625rem, 0.9rem + 0.55vw, 1.5rem);
  line-height: 1.5;
  color: rgb(243 241 235 / 0.8);
}
/* a slide whose lines come in one after the other: the one the picture is showing is at full strength, the ones
   before it stay, a little fainter */
.tour__beats {
  display: grid;
  gap: 0.375em;
  max-width: 30rem;
  margin: clamp(0.875rem, 2vh, 1.375rem) 0 0;
  padding: 0;
  list-style: none;
  font-size: clamp(1.0625rem, 0.9rem + 0.55vw, 1.5rem);
  line-height: 1.4;
  color: rgb(243 241 235 / 0.8);
}
.tour__beats p {
  margin: 0;
}
.tour-live .tour__beats li {
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 0.3s ease-in, transform 0.3s ease-in;
}
.tour-live .tour__beats li.is-on {
  opacity: 0.6;
  transform: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.tour-live .tour__beats li.is-now {
  opacity: 1;
}
/* the roof reaches further left than any other picture, so its text keeps to short rows beside it */
.tour-live .tour__slide--tight .tour__text,
.tour-live .tour__slide--tight .tour__beats {
  max-width: 15em;
  text-wrap: balance;
}
/* in a squarer window the roof comes in under the text column, so this slide sits above it */
@media (min-width: 44.01rem) and (min-aspect-ratio: 1001/1000) and (max-aspect-ratio: 7/4) {
  .tour-live .tour__slide--tight {
    position: relative;
    top: -19vh;
  }
}
.tour__still {
  display: none;
}

/* ---- where you are: one line for each stop, down the left edge ---- */
.tour__ticks {
  position: absolute;
  z-index: 3;
  left: calc(var(--gutter) - 0.5rem);
  top: 50%;
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  transform: translateY(-50%);
  color: var(--night-ink);
  transition: color 0.4s ease-in-out, opacity 0.4s ease-in-out, visibility 0s;
}
.tour.is-day .tour__ticks {
  color: var(--day-ink);
}
/* once the view starts to move right, towards the console, the lines are gone */
.tour.is-console .tour__ticks {
  opacity: 0;
  visibility: hidden;
  transition: color 0.4s ease-in-out, opacity 0.4s ease-in-out, visibility 0s 0.4s;
}
.tour__tick {
  display: block;
  width: 1.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.tour__tick::before {
  content: "";
  display: block;
  width: 2px;
  height: 100%;
  margin-inline: auto;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.26;
  transition: opacity 0.3s ease-in-out;
}
.tour__tick:hover::before {
  opacity: 0.6;
}
.tour__tick[aria-current="step"]::before {
  opacity: 1;
}
.tour__tick:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* ---- the three labels on the close view of the screen ---- */
.tour__tags {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease-in-out;
}
.tour__tags.is-on {
  opacity: 1;
}
.tour__tag {
  --lead: 2.75rem;
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  font-size: clamp(0.875rem, 0.7rem + 0.3vw, 1.0625rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--night-ink);
  will-change: transform;
}
.tour__tag::before {
  content: "";
  position: absolute;
  left: -0.25rem;
  top: -0.25rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--night-ink);
  box-shadow: 0 0 0 0.25rem rgb(18 17 14 / 0.45);
}
.tour__tag::after {
  content: "";
  position: absolute;
  background: rgb(243 241 235 / 0.7);
}
.tour__tag span {
  position: absolute;
  padding: 0.375rem 0.5625rem;
  border-radius: 0.375rem;
  background: rgb(18 17 14 / 0.62);
}
.tour__tag--right::after {
  left: 0.5rem;
  top: -0.5px;
  width: var(--lead);
  height: 1px;
}
.tour__tag--right span {
  left: calc(var(--lead) + 0.75rem);
  top: 0;
  transform: translateY(-50%);
}
.tour__tag--down-left::after,
.tour__tag--down-right::after {
  left: -0.5px;
  top: 0.5rem;
  width: 1px;
  height: var(--lead);
}
.tour__tag--down-left span,
.tour__tag--down-right span {
  top: calc(var(--lead) + 0.75rem);
}
.tour__tag--down-left span {
  right: -0.75rem;
}
.tour__tag--down-right span {
  left: -0.75rem;
}

/* ---- after the film: two flat pictures side by side. The three steps first, the console to the right of them.
   Both stand on the pale background the kiosk's own screens have. ---- */
.tour__panel {
  color: var(--day-ink);
}
.tour__panel .tour__text {
  color: var(--day-ink-2);
}
.tour-live .tour__track {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  width: 200%;
  height: 100%;
  visibility: hidden;
  will-change: transform;
}
.tour-live .tour__track.is-on {
  visibility: visible;
}
.tour-live .tour__panel {
  position: relative;
  flex: 0 0 50%;
  min-width: 0;
}
.tour-live .tour__copy {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  align-content: center;
  width: min(38vw, 37rem);
  padding: 0 1.75rem 0 calc(var(--gutter) + 1.75rem);
}

/* the three steps: what each one is, in a numbered list under the headline. This column is the tallest text in
   the tour, so it follows the height of the window too and stands clear of the header. */
.tour-live .tour__panel--steps .tour__copy {
  padding-top: 2.5rem;
}
.tour__panel--steps .tour__title {
  font-size: min(clamp(2.25rem, 1rem + 3.4vw, 4.25rem), 7.6vh);
}
.tour__list {
  counter-reset: step;
  display: grid;
  gap: clamp(0.625rem, 1.6vh, 1rem);
  max-width: 30rem;
  margin: clamp(1.125rem, 3vh, 2rem) 0 0;
  padding: 0;
  list-style: none;
  font-size: clamp(1rem, 0.9rem + 0.3vw, 1.125rem);
  line-height: 1.45;
  color: var(--day-ink-2);
}
.tour__list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 1.625rem minmax(0, 1fr);
}
.tour__list li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 680;
  color: #ad3600;
}

/* The podium: the start screen in the middle and highest, the second step to its left a little lower, the third
   to its right lower still. The width also follows the height of the window, so all of it stays in view. */
.tour-live .tour__podium {
  position: absolute;
  inset: 0 var(--gutter) 0 calc(min(38vw, 37rem) + 1rem);
  display: grid;
  place-items: center;
  padding-top: 3rem;
}
.podium {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: clamp(0.625rem, 1.5vw, 1.625rem);
  align-items: start;
  width: min(100%, 58rem, (100vh - 12.5rem) * 1.75);
  margin: 0;
  padding: 0;
  list-style: none;
}
.podium__step {
  grid-row: 1;
  min-width: 0;
}
.podium__step--1 {
  position: relative;
  z-index: 1;
  grid-column: 2;
}
.podium__step--2 {
  grid-column: 1;
  margin-top: 8%;
}
.podium__step--3 {
  grid-column: 3;
  margin-top: 14%;
}
.tour-live .podium__step--2,
.tour-live .podium__step--3 {
  will-change: transform, opacity;
}
.screen {
  padding: clamp(0.375rem, 0.8vw, 0.75rem);
  border-radius: clamp(0.75rem, 1.4vw, 1.375rem);
  background: var(--cabinet);
}
.tour-live .screen[data-tour-screen] {
  transform-origin: 0 0;
  will-change: transform, opacity;
}
.screen img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(0.375rem, 0.75vw, 0.6875rem);
}
.podium__name {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  margin-top: clamp(0.625rem, 1.6vh, 1rem);
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 680;
  font-size: clamp(1.0625rem, 0.8rem + 0.8vw, 1.625rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.podium__num {
  color: #ad3600;
  font-variant-numeric: tabular-nums;
}

/* The console, to the right of the steps. It starts under the header and is larger than the room it has, so it
   runs off the right edge and the foot of the stage: the sidebar, the things to look at and the counts are what
   shows, at a size where the warnings can be read. */
.tour__console {
  margin: 0;
  border-radius: var(--r-m);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgb(21 20 15 / 0.12), 0 2.25rem 4.5rem -2rem rgb(21 20 15 / 0.34);
}
.tour__console img {
  display: block;
  width: 100%;
  height: auto;
}
.tour-live .tour__console {
  --in: 0vw;
  position: absolute;
  top: 6.5rem;
  left: 42%;
  width: clamp(60rem, 80vw, 104rem);
  border-radius: var(--r-m) 0 0 0;
  transform: translateX(var(--in));
  will-change: transform;
}

/* a squarer window: the list needs a wider column, and the podium takes what is left */
@media (min-width: 44.01rem) and (min-aspect-ratio: 1001/1000) and (max-aspect-ratio: 3/2) {
  .tour-live .tour__panel--steps .tour__copy {
    width: 45vw;
  }
  .tour-live .tour__panel--steps .tour__title {
    font-size: min(4vw, 7.6vh);
  }
  .tour-live .tour__podium {
    left: calc(45vw + 1rem);
  }
}

/* ---- upright screens: the picture on top, the text under it ---- */
@media (max-width: 44rem), (max-aspect-ratio: 1/1) {
  .tour-live .tour {
    --tour-unit: 396vh;
  }
  .tour-live[data-variant="ute"] .tour {
    --tour-unit: 703vh;
  }
  .tour {
    /* the picture starts under the header and is as tall as its width allows; the text follows it */
    --tour-top: clamp(3.75rem, 9svh, 6.5rem);
    --tour-pic: min(125vw, 58svh);
    /* the podium is lower than the film's picture, which leaves room for the three steps under it */
    --tour-podium: min(74vw, 39svh);
  }
  .tour__canvas {
    inset: var(--tour-top) 0 auto 0;
    height: var(--tour-pic);
    -webkit-mask-image: linear-gradient(transparent, #000 7%, #000 86%, transparent);
    mask-image: linear-gradient(transparent, #000 7%, #000 86%, transparent);
  }
  .tour-live .tour__slides,
  .tour-live .tour__copy {
    inset: calc(var(--tour-top) + var(--tour-pic)) 0 0 0;
    width: auto;
    align-content: start;
    padding: 0.75rem var(--gutter) 0 calc(var(--gutter) + 1.25rem);
  }
  .tour-live .tour__panel--steps .tour__copy {
    top: calc(var(--tour-top) + var(--tour-podium));
    width: auto;
    padding-top: 0.75rem;
  }
  .tour__title,
  .tour__panel--steps .tour__title,
  .tour-live .tour__panel--steps .tour__title {
    font-size: clamp(1.75rem, 7.4vw, 2.75rem);
  }
  .tour__text {
    margin-top: 0.625rem;
    font-size: 1.0625rem;
    line-height: 1.45;
  }
  .tour__beats {
    gap: 0.25rem;
    margin-top: 0.625rem;
    font-size: 1.0625rem;
    line-height: 1.45;
  }
  .tour-live .tour__slide--tight .tour__text,
  .tour-live .tour__slide--tight .tour__beats {
    max-width: 30rem;
  }
  .tour__list {
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.4;
  }
  .tour-live .tour__podium {
    inset: var(--tour-top) var(--gutter) auto;
    height: var(--tour-podium);
    padding-top: 0.5rem;
  }
  .tour-live .podium {
    width: min(100%, (var(--tour-podium) - 3rem) * 1.75);
  }
  .tour__ticks {
    left: calc(var(--gutter) - 0.5rem);
    top: calc(var(--tour-top) + var(--tour-pic) + 0.875rem);
    transform: none;
    gap: 0.125rem;
    transition: color 0.4s ease-in-out, opacity 0.4s ease-in-out, top 0.5s var(--ease);
  }
  .tour.is-steps .tour__ticks {
    top: calc(var(--tour-top) + var(--tour-podium) + 0.875rem);
  }
  .tour__tick {
    height: 1.375rem;
  }
  .tour__tag {
    --lead: 1.375rem;
    font-size: 0.75rem;
  }
  .tour__tag span {
    padding: 0.3125rem 0.4375rem;
  }
  .tour-live .tour__console {
    top: calc(var(--tour-top) + 0.25rem);
    left: var(--gutter);
    width: 165%;
    height: calc(var(--tour-pic) - 1.25rem);
    border-radius: var(--r-m);
  }
}

/* a short upright screen: the headline and the list of steps are set a size smaller, so the last row stays in view */
@media (max-width: 44rem) and (max-height: 44rem), (max-aspect-ratio: 1/1) and (max-height: 44rem) {
  .tour-live .tour__panel--steps .tour__title {
    font-size: clamp(1.5rem, 6.6vw, 2.25rem);
  }
  .tour-live .tour__list {
    gap: 0.375rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.36;
  }
}

/* a wide, very short window (a phone on its side): shorter leads, so the labels stay in the picture */
@media (min-width: 44rem) and (min-aspect-ratio: 1/1) and (max-height: 30rem) {
  .tour__tag {
    --lead: 0.875rem;
    font-size: 0.75rem;
  }
  .tour__title {
    font-size: clamp(1.75rem, 9vh, 2.5rem);
  }
  .tour__text {
    font-size: 1rem;
  }
  .tour-live .tour__panel--steps .tour__copy {
    padding-top: 4rem;
  }
  .tour-live .tour__panel--steps .tour__title {
    font-size: 1.375rem;
  }
  .tour__list {
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.3;
  }
  .tour-live .tour__podium {
    padding-top: 3.5rem;
  }
  .tour-live .podium {
    width: min(100%, (100vh - 7rem) * 1.75);
  }
  .tour-live .tour__console {
    top: 5.25rem;
    width: 52rem;
  }
  .podium__name {
    margin-top: 0.375rem;
    font-size: 0.9375rem;
  }
}

/* ---- no script, or motion turned down: the same story as still pictures with their text ---- */
html:not(.tour-live) .tour__slides {
  gap: clamp(3rem, 8vh, 6rem);
  padding: clamp(4rem, 10vh, 7rem) var(--gutter);
}
html:not(.tour-live) .tour__slide,
html:not(.tour-live) .tour__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  column-gap: clamp(1.5rem, 5vw, 4rem);
}
html:not(.tour-live) .tour__slide {
  grid-area: auto;
  grid-template-rows: 1fr auto auto 1fr;
}
html:not(.tour-live) .tour__slide .tour__title {
  grid-area: 2 / 1;
}
html:not(.tour-live) .tour__slide .tour__text {
  grid-area: 3 / 1;
}
html[data-variant="ute"]:not(.tour-live) .tour__slide[data-for="inne"],
html[data-variant="inne"]:not(.tour-live) .tour__slide[data-for="ute"] {
  display: none;
}
html:not(.tour-live) .tour__still {
  grid-area: 1 / 2 / 5 / 3;
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-m);
}
/* a slide of several lines: the headline, then each line beside its own picture */
html:not(.tour-live) .tour__slide--beats {
  display: block;
}
html:not(.tour-live) .tour__beats {
  gap: clamp(1.5rem, 4vh, 3rem);
  max-width: none;
  margin-top: clamp(1.5rem, 4vh, 3rem);
}
html:not(.tour-live) .tour__beats li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  column-gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}
html:not(.tour-live) .tour__beats .tour__still {
  grid-area: auto;
}
html:not(.tour-live) .tour__panel {
  align-items: center;
  padding: clamp(4rem, 10vh, 7rem) var(--gutter);
  background: var(--day);
}
html:not(.tour-live) .tour__panel--console {
  padding-top: 0;
}
html:not(.tour-live) .tour__podium {
  display: grid;
  justify-items: center;
}
@media (max-width: 44rem) {
  html:not(.tour-live) .tour__slide,
  html:not(.tour-live) .tour__panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    row-gap: 0;
  }
  html:not(.tour-live) .tour__slide .tour__title,
  html:not(.tour-live) .tour__slide .tour__text {
    grid-area: auto;
  }
  html:not(.tour-live) .tour__still {
    grid-area: auto;
    margin-top: 1.25rem;
  }
  html:not(.tour-live) .tour__beats li {
    grid-template-columns: minmax(0, 1fr);
  }
  html:not(.tour-live) .tour__beats .tour__still {
    margin-top: 0.75rem;
  }
  html:not(.tour-live) .tour__podium,
  html:not(.tour-live) .tour__console {
    margin-top: 1.75rem;
  }
}

/* the page fades in whatever changes with the choice of placement; the slides have their own way in and out */
.tour__slide {
  animation: none;
}
