/* ===========================================================================
   Product pages (Mermaid Diagrams & Gantt, Recurring Requests, Issue
   Templates), layered on style.css.

   A heading block, then the product on a lit plate that bleeds off the right
   edge of the page, then the sections: heading on the left, text on the
   right on a wide screen, one column below 1000px. The stage placements are
   proportions of the stage, so the picture scales rather than rearranges;
   below 700px each stage has its own phone composition.
   =========================================================================== */

.page--product .shell > main {
  padding-top: clamp(28px, 4.4vw, 64px);
}

/* ------------------------------------------------------------------ hero */

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  column-gap: clamp(40px, 5vw, 88px);
  align-items: end;
}

.product-hero .app-icon {
  width: 48px;
  height: 48px;
  margin: 0 0 32px;
}

.product-hero h1 {
  max-width: 13em;
  margin: 0;
  font-size: clamp(40px, 5.6vw, 82px);
  line-height: 0.97;
  letter-spacing: -0.042em;
}

.product-hero .meta-line {
  margin: 22px 0 0;
}

.product-hero__side .lede {
  margin: 0;
  font-size: 17.5px;
  line-height: 1.55;
}

.product-hero .record__meta {
  margin-top: 20px;
}

.product-hero .actions {
  margin-top: 28px;
  gap: 14px 22px;
}

/* Where the app is on its way to: quiet, with the hollow dot the home page uses. */
.product-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 18px 0 0;
  font-size: 14.5px;
  line-height: 1.4;
}

.product-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.2px #8e959c;
  flex: none;
}

.product-status a {
  color: #c9cfd3;
  text-decoration-color: rgba(255, 255, 255, 0.22);
}

.product-status a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink-3);
}

/* ------------------------------------------------------------ the stage */

/* The plate bleeds off the right edge of the page, even past 1440px. */
.pstage {
  --bleed: calc(var(--gutter) + max(0px, (100vw - var(--max)) / 2));
  margin: clamp(44px, 5.6vw, 76px) calc(-1 * var(--bleed)) 0 0;
  border-radius: 24px 0 0 24px;
}

.pstage__win {
  position: absolute;
}

.pstage__dim img {
  filter: brightness(0.62) saturate(0.85);
}

/* Mermaid: two editors in a cascade, the lower one running off the edge. */
.pstage--mermaid {
  aspect-ratio: 1368 / 720;
}

.pstage--mermaid .pstage__back {
  left: 5.5%;
  top: 8.5%;
  width: 82%;
}

.pstage--mermaid .pstage__front {
  left: 16%;
  top: 37%;
  width: 98%;
}

/* Recurring Requests: the portal dialog at its first step, then scheduling. */
.pstage--rr {
  aspect-ratio: 1368 / 760;
}

.pstage--rr .pstage__back {
  left: 13%;
  top: 10%;
  width: 39%;
}

.pstage--rr .pstage__back::after {
  background: radial-gradient(120% 90% at 30% 10%, #eef2f1 0%, #dfe6e4 40%, #b9c4c1 100%);
}

.pstage--rr .pstage__front {
  z-index: 2;
  left: 48.5%;
  top: 17%;
  width: 34%;
}

/* Issue Templates: the template editor behind Jira's Create dialog, filled. */
.pstage--it {
  aspect-ratio: 1368 / 720;
}

.pstage--it .pstage__back {
  left: 5%;
  top: 9%;
  width: 58%;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.pstage--it .pstage__back img {
  display: block;
  width: 100%;
}

.pstage--it .pstage__front {
  z-index: 2;
  left: 42%;
  top: 19%;
  width: 60%;
  border-radius: 14px 0 0 0;
  container-type: inline-size;
}

.pstage--it .pstage__front::after {
  z-index: 1;
}

/*
  The app's note on the Summary field, cut from the same capture and laid
  exactly over itself above the shading: the same pixels, lit.
*/
.pstage--it .pstage__note {
  position: absolute;
  z-index: 2;
  left: 11.8125cqi;
  top: 12.4375cqi;
  width: 47cqi;
  border-radius: 1.1cqi;
  box-shadow: 0 18px 40px -14px rgba(0, 20, 18, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

@media (prefers-reduced-motion: no-preference) {
  .pstage__win {
    animation: pstage-rise 900ms var(--ease) both;
  }
  .pstage__front {
    animation-delay: 120ms;
  }
  @keyframes pstage-rise {
    from {
      opacity: 0;
      transform: translateY(24px);
    }
  }
}

/* -------------------------------------------------------------- sections */

.psec {
  display: grid;
  grid-template-columns: minmax(0, 17.5rem) minmax(0, 1fr);
  column-gap: clamp(40px, 6vw, 96px);
  margin-top: clamp(64px, 7.5vw, 104px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.pstage + .psec {
  margin-top: clamp(72px, 8.5vw, 120px);
}

.psec > .label {
  position: sticky;
  top: 28px;
  align-self: start;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: clamp(22px, 2vw, 26px);
}

.psec__body {
  min-width: 0;
}

.psec__body > .prose {
  max-width: 680px;
}

.psec__body > .prose:last-child > :last-child {
  margin-bottom: 0;
}

.psec__body > * + .prose {
  margin-top: 28px;
}

/* The heading sits on the section's own rule, so the spec row needs none. */
.psec__body > .facts:first-child {
  margin-top: -22px;
  border-top: 0;
}

.psec .shot {
  max-width: none;
  margin: 40px 0 0;
}

.psec .shot:last-child {
  margin-bottom: 0;
}

.psec__body > .shot:first-child {
  margin-top: 0;
}

.psec .shot + .prose {
  margin-top: 40px;
}

/*
  A dialog is shown near the size it has on screen, not stretched to the
  column; a 1x capture no larger than it was taken.
*/
.psec .shot--dialog {
  max-width: 680px;
}

.psec .shot--tall {
  max-width: 520px;
}

.psec .shot--1x {
  max-width: 732px;
}

/* ----------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .product-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .product-hero__side {
    max-width: 620px;
    margin-top: 30px;
  }
}

@media (max-width: 1000px) {
  .psec {
    display: block;
  }
  .psec > .label {
    position: static;
    margin: 0 0 18px;
  }
  .psec__body > .facts:first-child {
    margin-top: 0;
    border-top: 1px solid var(--line);
  }
}

/* On a tablet the two portal dialogs would shrink to thumbnails; they overlap more instead. */
@media (min-width: 701px) and (max-width: 1000px) {
  .pstage--rr {
    aspect-ratio: 730 / 560;
  }
  .pstage--rr .pstage__back {
    left: 5%;
    top: 7%;
    width: 52%;
  }
  .pstage--rr .pstage__front {
    left: 42%;
    top: 13%;
    width: 50%;
  }
}

@media (max-width: 700px) {
  .pstage {
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    border-radius: 0;
  }
  .pstage::before {
    box-shadow: none;
  }

  /* The editors at a size where the source can be read; the preview runs off the edge. */
  .pstage--mermaid {
    aspect-ratio: 375 / 400;
  }
  .pstage--mermaid .pstage__back {
    left: 5.5%;
    top: 6%;
    width: 175%;
  }
  .pstage--mermaid .pstage__front {
    left: 14%;
    top: 42%;
    width: 175%;
  }

  .pstage--rr {
    aspect-ratio: 375 / 470;
  }
  .pstage--rr .pstage__back {
    left: 5.5%;
    top: 5%;
    width: 78%;
  }
  .pstage--rr .pstage__front {
    left: 15%;
    top: 18%;
    width: 80%;
  }

  .pstage--it {
    aspect-ratio: 375 / 400;
  }
  .pstage--it .pstage__back {
    left: 5.5%;
    top: 6%;
    width: 118%;
  }
  .pstage--it .pstage__front {
    left: 16%;
    top: 30%;
    width: 110%;
  }
}

@media (max-width: 640px) {
  .product-hero .app-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 24px;
  }
  .psec {
    padding-top: 24px;
  }
}

@media print {
  .pstage,
  .psec--demo {
    display: none;
  }
  .psec {
    display: block;
    border-top-color: #bbb;
  }
  .psec > .label {
    position: static;
    margin: 0 0 12px;
  }
  .product-hero {
    display: block;
  }
  .product-hero .quiet {
    color: #000;
  }
}
