/*
 * Service sales pages, on top of the supplied `styles.css`.
 *
 * A service page is the Overview's markup with one service's words in it, driven by the
 * Overview's script, so almost everything it draws already has a rule in that file: the scroll
 * stage, the console, the orbit, the how-it-works panels and their windows, the process chart,
 * the promise cards, the accordion. What is here is only the four things the design has no rule
 * for, because the Overview has no reason to:
 *
 *   1. a hero that still reads with no JavaScript, since the scene cannot run without it;
 *   2. the buttons, a link back to the catalogue, and the line where the scene hands over;
 *   3. example cards, which carry a picture, a price and a list where the Overview's service
 *      row carries one line;
 *   4. two small extensions to its own stages: word tiles on the marquee, and the checklist.
 *
 * Nothing here redefines a vendored rule except under `.sg-sell`, which only a service page
 * carries. `styles.css` stays the file that was supplied.
 */

/* ---------- the hero, with and without the script ---------- */

/*
 * `.hero-stage` is 470vh of scroll driving a sticky stage, which is the right hero when
 * something is driving it and three empty storeys when nothing is. SellRuntime puts `.js` on the
 * wrapper as it loads the script, so the page is laid out for no JavaScript and switches to the
 * scene once there is some.
 */
.sg-sell .hero-stage {
  height: auto;
}

.sg-sell .hero-sticky {
  position: static;
  height: auto;
  overflow: visible;
  padding: 24px 0 40px;
}

.sg-sell .hero-copy {
  position: static;
  /* The design adds this gutter only below 810px, where its own two-word lines first need one.
     A service name is longer, so it is here at every width; the copy is centred and capped
     anyway, so a wide screen never notices. */
  padding: 0 20px;
}

.sg-sell .story {
  position: static;
  transform: none;
  width: min(760px, calc(100% - 32px));
  margin: 56px auto 0;
  pointer-events: auto;
}

.sg-sell .crew-row,
.sg-sell .console,
.sg-sell .orbit-stage {
  display: none;
}

.sg-sell.js .hero-stage {
  height: 470vh;
}

.sg-sell.js .hero-sticky {
  position: sticky;
  top: 0;
  height: var(--sg-pane, 100vh);
  overflow: hidden;
  padding: 0;
}

.sg-sell.js .hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  top: 190px;
}

/* The design's headline is two short lines ("Get Work Done"), so each takes its max-content
   width inside the centred column and never reaches the edge. A service's name is longer, and a
   flex item under `align-items: center` does not shrink on its own, so it ran off the side of a
   phone. This lets a line wrap instead. */
.sg-sell .hero-copy h1 .line {
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}

.sg-sell.js .story {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  pointer-events: none;
}

.sg-sell.js .crew-row {
  display: flex;
}

.sg-sell.js .console {
  display: block;
}

/* Back to the design's own value, not `block`: the stage centres its title and its orbit
   with `align-items`, and a block box leaves both pinned to its left padding edge. */
.sg-sell.js .orbit-stage {
  display: flex;
}

/* ---------- the parts a sales page has and the Overview does not ---------- */

.sg-sell .sell-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 30px;
}

/* Where the scene hands over to the page: the offer in one line, and the button. */
.sg-sell .sell-handover {
  padding: 90px 0 0;
  text-align: center;
}

.sg-sell .sell-handover .body {
  max-width: 44ch;
  margin: 0 auto;
  font-size: 18px;
}

/* ---------- examples ---------- */

/* The Overview's `.svc` row is a five-column grid built for a one-line service. An example has a
   picture, a price and a list, so these are cards. */
.sg-sell .sell-examples {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.sg-sell .sell-ex {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(15, 15, 15, 0.05);
}

.sg-sell .sell-ex .shot {
  aspect-ratio: 16 / 10;
  background: var(--tray);
  overflow: hidden;
}

.sg-sell .sell-ex .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sg-sell .sell-ex .in {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.sg-sell .sell-ex .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sg-sell .sell-ex .price {
  font-size: 20px;
  letter-spacing: -0.01em;
}

.sg-sell .sell-ex ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-60);
}

.sg-sell .sell-ex li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.sg-sell .sell-ex li svg {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 3px;
  color: var(--ink-35);
}

.sg-sell .sell-ex .go {
  margin-top: auto;
  padding-top: 6px;
}

/* ---------- two extensions to the design's own stages ---------- */

/* The marquee's tiles are 46px squares built for glyphs. These carry words. */
.sg-sell .integ-run span.word {
  width: auto;
  padding: 0 18px;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

/* The checklist stage, in the chrome the other three windows use. */
.sg-sell .win-body.checks {
  padding: 14px;
}

.sg-sell .check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.sg-sell .check-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  box-shadow: 0 0 0 1px var(--line);
  font-size: 13px;
  color: var(--ink-60);
  transition:
    color 0.3s,
    box-shadow 0.3s;
}

.sg-sell .check-list i {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--ink-10, rgba(15, 15, 15, 0.14));
  transition: background 0.3s;
}

.sg-sell .check-list li span {
  flex: 1;
  min-width: 0;
}

.sg-sell .check-list em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green-2);
  opacity: 0;
  transition: opacity 0.3s;
}

.sg-sell .check-list li.on {
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(31, 184, 20, 0.35);
}

.sg-sell .check-list li.on i {
  background: var(--green-2);
  box-shadow: none;
}

.sg-sell .check-list li.on em {
  opacity: 1;
}

/* ---------- the process chart ---------- */

/* Two of the six rows are the customer's. The chart is on the dark ground, so "yours" reads as
   brighter rather than darker; the green is kept for the work we do. */
.sg-sell .g-phase .t span.yours {
  color: #fafafa;
}

/* The when, for the narrow layout below. The bars carry it everywhere else. The selector
   matches the design's own `.g-phase .t span`, which paints the step number green. */
.sg-sell .g-phase .t span.g-when {
  display: none;
}

/* ---------- why here ---------- */

/* `.head-center` centres but does not measure, and a 60px line across 1600px is a banner
   rather than a sentence. The design's own heading here is short enough not to need it. */
.sg-sell #quotes h2 {
  max-width: 22ch;
}

/* ---------- the last word ---------- */

/* The design's own closing panel, which the Overview uses to send you to the one thing it
   wants you to do. Here it is the only thing the page wants you to do. */
.sg-sell .sell-end {
  padding-bottom: 140px;
}

.sg-sell .sell-end .svc-cta h5 {
  max-width: 26ch;
}

.sg-sell .sell-end .svc-cta p {
  max-width: 54ch;
}

.sg-sell .sell-end .btn {
  flex: none;
}

/* The terms, read from the catalogue: the price band, the turnaround and the revision policy,
   set as three quiet chips rather than a sentence with dots in it. */
.sg-sell .sell-end .sell-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.sg-sell .sell-end .sell-terms span {
  border-radius: 999px;
  border: 1px solid #2f2f2f;
  padding: 5px 12px;
  font-size: 13px;
  color: #fafafa;
}

@media (max-width: 760px) {
  .sg-sell .sell-end .svc-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- narrow screens ---------- */

@media (max-width: 900px) {
  .sg-sell .sell-examples {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sg-sell .sell-handover {
    padding-top: 64px;
  }

  /* The design turns the chart into a sideways scroller at 760px, which on a phone hides five
     of its six columns behind a gesture nobody makes. The columns go instead, and each step
     says when it happens beside its own title. */
  .sg-sell .gantt {
    overflow-x: visible;
  }

  .sg-sell .g-row {
    display: block;
    min-width: 0;
  }

  .sg-sell .g-row.head,
  .sg-sell .g-cell,
  .sg-sell .g-head {
    display: none;
  }

  .sg-sell .g-phase {
    padding: 20px 0;
  }

  .sg-sell .g-phase .t {
    flex-wrap: wrap;
  }

  .sg-sell .g-phase .t span.g-when {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #3a3a3a;
    background: #2a2a2a;
    padding: 3px 10px;
    font-size: 12px;
    color: var(--light-60);
  }
}

/* ---------- a pane that is short rather than narrow ---------- */

/*
 * The same problem `host.css` fixes for the Overview, which a service page does not inherit.
 *
 * It cannot: the sales hero sets its own `top`, at a higher specificity, because the scene only
 * exists once the script has run. And it needs more than the Overview does anyway. Where the
 * Overview's hero is a headline and two lines of subtitle, this one carries a service name over
 * two lines of 104px type, a longer subtitle and a row of buttons - 382px of it - above a row of
 * crew cards pinned to the floor. On a wide laptop with little height (1512x700, 1366x640) the
 * cards climbed through the buttons and sat on the subtitle.
 *
 * Three numbers follow the pane's height, each clamped at the design's own value, so a tall
 * window gets exactly the supplied page and this does nothing at all: how far down the copy
 * starts, how big the headline is, and how wide a crew card is. Below 810px the design has its
 * own answers for all three - it is a phone by then, and the scene is laid out differently -
 * so this stays out of that entirely.
 */
@media (min-width: 810px) and (max-height: 880px) {
  .sg-sell.js .hero-copy {
    top: clamp(76px, calc(var(--sg-pane) - 600px), 190px);
  }

  .sg-sell.js .crew-row .spot {
    width: clamp(88px, calc((var(--sg-pane) - 440px) * 0.58), 236px);
  }
}

/* The headline, against the design's two width steps: 104px above 1100px and 80px below it.
   Shrinking type is how the supplied stylesheet makes room, and it is the biggest thing in the
   hero by some distance - two lines of it are more than half the copy's height. */
@media (min-width: 1101px) and (max-height: 880px) {
  .sg-sell.js .hero-copy h1 {
    font-size: clamp(56px, calc((var(--sg-pane) - 180px) * 0.155), 104px);
  }
}

@media (min-width: 810px) and (max-width: 1100px) and (max-height: 880px) {
  .sg-sell.js .hero-copy h1 {
    font-size: clamp(50px, calc((var(--sg-pane) - 180px) * 0.12), 80px);
  }
}
