/* The OEM homepage on main's design. styles.css carries every section's look; this file adds only what
   main never had: the problem forms in the ledger, the two
   handover scenes, the comparison, a single-audience Who it's for, the pilot's times and keep line,
   and the demo offer's email fallback. Tokens are main's. */

.hero-proof {
  margin-top: -0.75rem;
  font: 500 var(--fs-small)/1.45 var(--sans);
  color: var(--ink);
}

/* The handover, before and after. In the hero's frame: the two pictures alone, under a Today / With OTTO
   toggle drawn as a track with the chosen side in ink, like the language switch. In the enlarged view: the
   same toggle, then the chosen side's title, picture, labels and words. */

.hero-toggle {
  display: inline-flex;
  gap: 2px;
  width: fit-content;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg);
  overflow: visible;
}

.bezel-head .hero-toggle {
  margin-bottom: 0;
}

.hero-toggle .chip {
  min-height: 2.5rem;
  padding: 0 1.25rem;
}

/* Both pictures share one frame, the wider one's, so the frame never jumps as the toggle switches. */
.bezel-handover .hand-view img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 974 / 863;
  object-fit: contain;
  object-position: center;
  background: transparent;
  mix-blend-mode: lighten;
}

/* On desktop the pictures are nearly square: a fixed height keeps the frame inside the first screen. */
@media (min-width: 64rem) {
  .bezel-handover .hand-view img {
    height: clamp(20rem, 50svh, 32rem);
    aspect-ratio: auto;
  }
}

.handover-viewer {
  width: min(64rem, calc(100vw - 2 * var(--gutter)));
}

.flowmodal-top .hv-toggle {
  margin: 0;
  background: var(--surface);
}

.hv-scene {
  display: grid;
  grid-row: auto;
  grid-template-rows: none;
  gap: 1rem;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.hv-scene[hidden] {
  display: none;
}

.hv-scene h2 {
  font: 600 var(--fs-lead)/1.3 var(--display);
  letter-spacing: -0.012em;
  margin-bottom: -0.35rem;
}

.hv-scene .scene-frame {
  width: fit-content;
  max-width: 100%;
}

.hv-scene .scene-frame img {
  width: auto;
  max-width: 100%;
  max-height: min(62dvh, 863px);
}

.hv-scene p {
  max-width: 56ch;
}

/* The handover scenes' shared parts. */

.scene-otto h2 {
  color: var(--amber);
}

.scene-frame {
  position: relative;
}

/* The picture's ground is a shade darker than the page; lighten lets the page show through. */
.scene-frame img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: lighten;
}

/* The labels sit in the picture's empty ground once it is large enough, and run as a list below it until then. */
.scene-key {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
  margin-top: 1rem;
  font: 500 0.9375rem/1.35 var(--sans);
}

.key-approve {
  color: var(--teal);
}

.key-otto {
  color: var(--amber);
}

@media (min-width: 1180px) {
  .scene-key {
    position: absolute;
    inset: 0;
    display: block;
    margin: 0;
    font-size: var(--fs-small);
    pointer-events: none;
  }

  .scene-key li {
    position: absolute;
  }

  .key-share {
    top: 30%;
    left: 2%;
  }

  .key-otto {
    top: 59%;
    right: 54%;
    white-space: nowrap;
  }

  .key-approve {
    top: 1.5%;
    left: 48%;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .key-learn {
    top: 83%;
    right: 0;
    width: 27%;
    text-align: right;
    text-wrap: balance;
  }
}

@media (max-width: 39.99rem) {
  .scene-key {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The comparison: each usual option and what goes wrong with it, answered on the same row by OTTO.
   On desktop OTTO's answers run as one amber-tinted column; on phones each answer sits under its option. */

.vs-option {
  font: 600 var(--fs-lead)/1.35 var(--sans);
  color: var(--ink);
}

.vs-wrong,
.vs-otto {
  display: grid;
  gap: 0.4rem;
}

.vs-line {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  column-gap: 0.7rem;
  max-width: 46ch;
}

.vs-line::before {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.22rem;
}

/* A drawn cross for what goes wrong, in the waiting gray; a drawn check for OTTO's answer, in amber. */
.vs-wrong .vs-line::before {
  background: var(--subtle);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='8.2'/%3E%3Cpath d='M7.2 7.2l5.6 5.6M12.8 7.2l-5.6 5.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='8.2'/%3E%3Cpath d='M7.2 7.2l5.6 5.6M12.8 7.2l-5.6 5.6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.vs-otto .vs-line::before {
  background: var(--amber);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='10' r='8.2'/%3E%3Cpath d='M6.4 10.3l2.4 2.4 4.8-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='10' r='8.2'/%3E%3Cpath d='M6.4 10.3l2.4 2.4 4.8-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.vs-otto {
  padding: 0.9rem 1rem 1rem;
  border-radius: var(--r);
  background: var(--amber-tint);
}

.vs-otto .m-label {
  color: var(--amber);
}

/* The long line is the description, so it runs with the comparison instead of the narrow lede measure. */
.compare .section-head {
  max-width: none;
}

.compare .lede {
  max-width: none;
}

.vs-head-otto {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--amber);
}

.vs-head-otto .logo {
  width: 1.15rem;
  height: auto;
  fill: var(--amber);
}

@media (min-width: 64rem) {
  /* Rows lose their own padding so OTTO's cells meet edge to edge and read as one column. */
  .ledger-vs {
    padding-block: 0.5rem;
  }

  .ledger-vs .ledger-row {
    grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 6fr);
    gap: 0;
    padding: 0;
  }

  .ledger-vs .ledger-row > * {
    padding: 1.5rem 1.75rem;
  }

  .ledger-vs .ledger-headrow > * {
    padding-block: 1.25rem 0.5rem;
  }

  .ledger-vs .m-label {
    display: none;
  }

  .ledger-vs .vs-otto,
  .ledger-vs .vs-head-otto {
    border-radius: 0;
    background: var(--amber-tint);
  }

  .ledger-vs .vs-head-otto {
    border-radius: var(--r) var(--r) 0 0;
  }

  .ledger-vs .ledger-row:last-child .vs-otto {
    border-radius: 0 0 var(--r) var(--r);
  }

  .ledger-vs .ledger-row:not(.ledger-headrow) > :first-child {
    padding-top: 1.4rem;
  }
}

.explore {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  margin-top: 1.75rem;
}

.explore a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink);
  font-weight: 600;
  text-underline-offset: 0.3em;
}

.explore a:hover {
  color: var(--amber);
}

.explore span {
  color: var(--muted);
  font-size: var(--fs-small);
}

/* Who it's for, with one audience: main's two halves without the audience tabs. A tag
   names the audience first, above the title on the graphite half. */

.who-head {
  grid-row: 1;
  display: grid;
  justify-items: start;
  gap: 1.25rem;
  padding: clamp(2.75rem, 8vw, 4rem) var(--gutter) 1.5rem;
}

.who-head .who-title {
  grid-area: auto;
  padding: 0;
}

.who-tag {
  padding: 0.35rem 0.7rem;
  border-radius: var(--r);
  background: var(--amber);
  color: var(--on-amber);
  font: 600 var(--fs-small)/1.2 var(--sans);
}

@media (min-width: 40rem) {
  .who-head {
    position: relative;
    z-index: 1;
    grid-column: 1;
    padding: clamp(2.75rem, 5vw, 4.25rem) var(--gutter) clamp(1.25rem, 0.5rem + 1.5vw, 2rem);
    padding-left: max(var(--gutter), (100vw - var(--page)) / 2);
  }
}

@media (min-width: 40rem) {
  .who-one .who-light {
    background-image: url("../delivery/equipment-manufacturers.jpg");
  }

  .who-one .who-light::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(to bottom, transparent 0 46%, rgb(237 239 242 / 0.4) 56%, rgb(237 239 242 / 0.9) 64%, #edeff2 72%);
    pointer-events: none;
  }

  .who-one .who-panels,
  .who-one .who-panel,
  .who-one .who-get {
    display: contents;
  }

  .who-one .who-bring {
    grid-row: 2 / span 2;
  }

  .who-one .who-get-copy {
    display: grid;
    align-content: start;
    gap: 0.6rem;
    grid-column: 2;
    grid-row: 3;
    position: relative;
    z-index: 1;
    align-self: end;
    padding-block: clamp(2rem, 1rem + 5vh, 5rem) clamp(2rem, 1rem + 3vw, 4rem);
    padding-left: clamp(1.5rem, 1rem + 3vw, 4rem);
    padding-right: var(--gutter);
  }

  /* OTTO in the middle of the photo, the photo's whole height. */
  .who-one .who-guide {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: center;
    justify-self: center;
    z-index: 2;
    width: max-content;
    max-width: calc(100% - 2 * var(--gutter));
    margin: 0;
  }
}

/* OTTO over the Deliver photo: the hero's kind of bubble, without a close button. On a phone the photo is the
   customers' panel, and OTTO sits in it under their goal. main.js brings it in from the left once 70% of the
   hero has scrolled away, and keeps a drag inside the photo. */
@media (max-width: 39.99rem) {
  .who-one .who-guide {
    margin-top: 1rem;
  }
}

/* One sentence on two lines, at the weight of the hero bubble's lines rather than its title. */
.who-guide .guide-say p {
  font-weight: 500;
}

.who-guide .guide-say p span {
  display: block;
}

/* No close button here, so the first line needs no room kept for one. */
.who-guide .guide-say p:first-child::before {
  content: none;
}

@media (prefers-reduced-motion: no-preference) {
  .who-guide.is-in .guide-say {
    animation: none;
  }

  .who-guide.is-in .guide-mark,
  .who-guide.is-in .guide-bubble {
    animation: guide-enter 0.9s var(--ease) backwards;
  }
}

@keyframes guide-enter {
  from {
    opacity: 0;
    transform: translateX(calc(-1 * var(--enter-from, 12rem)));
  }
}

/* Demo offer: the address after "Prefer to write?" is a full-height target. */

.demo-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.4em;
  margin-top: -0.5rem;
}

.demo-note a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  overflow-wrap: anywhere;
}

@media (forced-colors: active) {
  .scene-frame img,
  .bezel-handover .hand-view img {
    mix-blend-mode: normal;
  }

  .demo,
  .vs-otto {
    border: 1px solid CanvasText;
  }

  .vs-line::before {
    background: CanvasText;
  }
}

/* The How it works page: its title in the h1's face at display size, then main's four stages, then a way on. */

.how-head {
  padding-bottom: 0;
}

.how-head h1 {
  font: 600 var(--fs-display)/1.02 var(--sans);
  letter-spacing: -0.035em;
}

.how-next-in {
  display: grid;
  justify-items: start;
  gap: 1.75rem;
}

.how-next-in h2 {
  max-width: 22ch;
  text-wrap: balance;
}
