/* Sell or Scale. /product, "The app": the page's own stylesheet, loaded after site.css and kit.css.
   The screens are the kit's (every ui- class is kit.css's, used as it is). Here is only what stands around them:
   how the opening band meets the tour, a page of the tour (its screen, its name and caption, the link to the next
   page), the row of page names a phone gets, and the two phones on paper.
   Nothing here needs a script. tour.js turns the seven pages into one window. */

/* ---------- the opening band and the tour: one stretch of ink ----------
   The band keeps its own top and its two sentences and gives up its foot: the window follows the sentences as the
   home page's phone follows its words on a small screen. No rule, and one padding, between the two. */

.tour-intro .intro__in { padding-bottom: 0; }

.tour { --pad: clamp(72px, 9vw, 132px); --over: clamp(28px, 3.4vw, 48px); padding-block: var(--over) max(var(--pad), 120px); }
/* The window's light reaches a little way up over it, and the band would cut it off on a line where the opening band
   ends (a step of two to four levels of grey, right across the window). So the band's first stretch, the ink over
   the window, takes the light in from nothing, as the kit lets it out at the band's foot: the same ramp, turned over. */
.tour::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--over); z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, #0a0c10 0%, rgba(10, 12, 16, 0.883) 10%, rgba(10, 12, 16, 0.743) 20%, rgba(10, 12, 16, 0.466) 40%, rgba(10, 12, 16, 0.229) 60%, rgba(10, 12, 16, 0.064) 80%, rgba(10, 12, 16, 0) 100%);
}
/* The tour's furniture answers to the width its screens have, as the screens themselves do (kit.css): under 600
   everything is laid out for the phone app. The column is that width. */
.tour__in { container: tour / inline-size; scroll-margin-top: 30px; }

/* ---------- a page of the tour ----------
   At a desk: the screen, and under it, on one line, the page's name and caption at the left and the link to the next
   page at the right. Everything under the screen keeps to the caption's line: the link stands on its first, the one
   quiet note under the tour on its second. */

.tour__page {
  display: grid; grid-template-columns: minmax(0, 1fr) fit-content(26rem); grid-template-rows: auto auto auto 1fr; column-gap: 36px;
  scroll-margin-top: 30px;
}
.tour__page > .ui-screen { grid-area: 1 / 1 / 2 / -1; }
.tour__page + .tour__page { margin-top: calc(var(--pad) * 0.75); }

/* (with scripts the seven pages' words lie in this one place, the open page's showing: the longest keeps the room,
   so nothing under the window moves when a page opens) */
.tour__caption {
  grid-area: 2 / 1 / -1 / 2; display: grid; align-items: start; align-self: start; margin-top: 24px;
  font-size: 1.1875rem; line-height: 1.55;
}
.tour__words { grid-area: 1 / 1; max-width: 44em; text-wrap: pretty; scroll-margin-top: 30px; }
.tour__words[aria-hidden="true"] { visibility: hidden; }
.tour__name, .tour__say { display: inline; }
.tour__name { font: inherit; font-weight: 560; letter-spacing: -0.01em; text-wrap: inherit; }
.tour__name:focus { outline: none; }      /* (it takes the focus a pressed link leaves behind; it is not a control) */
.tour__say { color: var(--text-2); }
.on-ink .tour__say { color: var(--on-ink-2); }

.tour__next, .tour__back, .tour__note, .tour__all { font-size: 1.1875rem; line-height: 1.55; }
/* (the quiet link of site.css, at the caption's size) */
.tour__next, .tour__back {
  position: relative; display: flex; align-items: center; gap: 8px; width: fit-content;
  font-weight: 500; letter-spacing: -0.006em; white-space: nowrap;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: transparent;
  transition: text-decoration-color 0.2s var(--ease);
}
.tour__next { grid-area: 2 / 2; justify-self: end; margin-top: 24px; }
.tour__next::after, .tour__back::after { content: ""; position: absolute; inset: -8px 0; }      /* a 44px target, drawn as one line */
.tour__next:hover, .tour__back:hover { text-decoration-color: currentColor; }
.tour__next .arrow, .tour__back .arrow {
  flex: none; width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.25s var(--ease);
}
.tour__next:hover .arrow { transform: translateX(2px); }
/* (the last page's link goes back to the first: its arrow leads, and points that way) */
.tour__next.is-back { flex-direction: row-reverse; }
.tour__next.is-back .arrow { transform: scaleX(-1); }
.tour__next.is-back:hover .arrow { transform: scaleX(-1) translateX(2px); }
/* the way back to the page names: only where there is a row of them, on a phone without scripts */
.tour__back { display: none; }

/* the one quiet note under the tour, and the line a reader without scripts gets: small type on the caption's line */
.tour__note, .tour__all { justify-self: end; text-align: right; color: var(--on-ink-3); text-wrap: balance; }
.tour__note { grid-area: 3 / 2; }
.tour__all { grid-area: 4 / 2; }
.tour__note > span, .tour__all > span { font-size: 0.9375rem; }
.tour__all[aria-hidden="true"] { visibility: hidden; }      /* (with scripts it is not said; its line stays, so nothing under the window moves as the script lands) */

/* the row of page names: only as the phone app (below). Out of the way, not un-displayed, so its arrival never plays twice */
.tour__pages { position: absolute; width: 1px; height: 1px; overflow: hidden; visibility: hidden; pointer-events: none; }

/* a screen too narrow for the note in one line beside the caption: the note takes two */
@container tour (max-width: 899px) {
  .tour__page { grid-template-columns: minmax(0, 1fr) fit-content(16.5rem); column-gap: 30px; }
}

/* ---------- as the phone app (a screen under 600 wide) ----------
   The seven page names in a row that wraps; then the open page's name as a heading, its caption, the screen, and the
   link to the next page. The words stand on the screen: where another page's caption is a line longer, the room it
   keeps is over the heading, not between the caption and the screen. */

@container tour (max-width: 599px) {
  .tour__pages {
    position: static; width: auto; height: auto; overflow: visible; visibility: visible; pointer-events: auto;
    display: flex; flex-wrap: wrap; margin: -11px -10px 7px;
    font-size: 1rem; line-height: 1.375; font-weight: 450;
  }
  /* (each name is a 44px target, drawn as a word: 11px over and under it and 10px either side, so the names stand
     20px apart, their targets meet, and the first stands on the column's edge) */
  .tour__pages a { position: relative; padding: 11px 10px; color: var(--on-ink-2); white-space: nowrap; transition: color 0.2s var(--ease); }
  .tour__pages a:focus-visible { outline-offset: -5px; border-radius: 8px; }      /* (the ring round the word, inside its target, as on the window's own tabs) */
  .tour__pages a[aria-current] { color: var(--on-ink); }
  .tour__pages a[aria-current]::before { content: ""; position: absolute; left: 10px; right: 10px; bottom: 7px; border-top: 2px solid; }
  .tour__n { margin-left: 5px; font-weight: 400; }

  .tour__page { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .tour__caption { grid-area: 1 / 1; margin-top: 0; font-size: 1.0625rem; line-height: 1.5; }
  /* Here only the open page's words take room, on a floor of the heading and three lines of caption (two where the
     column is wide enough for every caption to fit two: 27.25em). Six of the seven captions fit the floor at every
     phone's width, so the screen stays where it is from page to page. The words stand on the screen: a shorter
     caption leaves its line over the heading. */
  .tour__words { display: flex; flex-direction: column; justify-content: flex-end; min-height: calc(1.575rem + 6px + 3 * 1.59375rem); }
  .tour__words[aria-hidden="true"] { display: none; }
  .tour__name { display: block; font-size: 1.3125rem; line-height: 1.2; letter-spacing: -0.018em; }
  .tour__stop { display: none; }
  .tour__say { display: block; margin-top: 6px; }
  .tour__page > .ui-screen { grid-area: 2 / 1; margin-top: 18px; }
  .tour__next, .tour__back, .tour__note, .tour__all { font-size: 1.0625rem; line-height: 1.5; }
  .tour__next { grid-area: 3 / 1; justify-self: start; margin-top: 18px; }
  /* (without scripts "Back to the pages" follows the link 18px under it: the two targets meet in that room and neither
     takes from the other, so each is 44px by hit test) */
  .tour__next::after { inset: -10px 0; }
  .tour__back::after { inset: -8px 0 -12px; }
  .tour__back { display: flex; grid-area: 4 / 1; margin-top: 18px; }
  .tour__note, .tour__all { justify-self: start; text-align: left; text-wrap: pretty; }
  .tour__note { grid-area: 5 / 1; margin-top: 18px; }
  .tour__all { grid-area: 6 / 1; }
}

@container tour (min-width: 27.25em) and (max-width: 599px) {
  .tour__words { min-height: calc(1.575rem + 6px + 2 * 1.59375rem); }
}

/* ---------- the six pages on paper (without scripts) ----------
   The section ends on a rule of its own, so the phones follow it as a ruled section would; with scripts the section
   is gone and its rule with it, and the phones follow the ink with none. */

.tour-rest { padding-bottom: 0; }
.tour-rest > .wrap::after { content: ""; display: block; border-top: 1px solid var(--rule); margin-top: var(--pad); }

/* ---------- arriving, and a page opening ----------
   What stands round the window comes with it (kit.css brings the window: ui-screen--arrive). Once, on the curve and
   the clock of the window's own arrival, and never under reduced motion. No class arms it: it only fills backwards.
   (The name is one site.js holds for a late font.) */

@keyframes appear { from { opacity: 0; } }
@keyframes tour-in { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .tour .tour__pages, .tour .tour__caption, .tour .tour__next, .tour .tour__note, .tour .tour__all { animation: appear 0.8s ease-out 0.45s backwards; }
  /* a page a reader opens comes up in the window, quickly */
  [data-tour-in] { animation: tour-in 0.2s ease-out; }
}

/* ---------- the two phones, flat on paper ----------
   Each under its line. The lines share a row and the phones share the next, so the phones stand level whatever the
   lines do. On the site's two columns from 900 wide; side by side down to 720; then one under the other. On a
   reader's own phone no phone is drawn (kit.css): each screen is a pane as wide as the column. */

.phones {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto auto; grid-auto-flow: column;
  column-gap: clamp(32px, 7vw, 104px); row-gap: 30px;
}
.phones__say { max-width: 24em; font-size: 1.1875rem; line-height: 1.55; color: var(--text-2); text-wrap: pretty; scroll-margin-top: 30px; }
.phones__say b { font-weight: 560; letter-spacing: -0.01em; color: var(--text); }
@media (max-width: 899px) {
  .phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 719px) {
  .phones { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .phones > .ui-screen + .phones__say { margin-top: 36px; }
}
@media (max-width: 599px) {
  .phones { row-gap: 18px; }
  .phones__say { font-size: 1.0625rem; line-height: 1.5; }
  .phones > .ui-screen + .phones__say { margin-top: 30px; }
  /* shared candidate: kit.css. Under a 600px window the drawn phone becomes a pane, and a screen with no button at
     its foot (the approval email) then ends on its last line with nothing under it: .ui-open has no bottom padding
     there, and only .ui-do brings any. Until the kit gives that pane a foot, the email's last paragraph carries
     one, under this page's own name (the one class this page adds to a screen's markup). */
  .phones__end { padding-bottom: 18px; }
}
