/* The sample Blueprint — moshi.co/blueprint/
   Builds on ../styles.css (tokens, type, buttons, header, footer). Only what this page adds lives here. */

.wrap--doc {
  max-width: calc(920px + 2 * var(--gutter));
}

/* Cover */

.bp-cover {
  padding: clamp(48px, 6vw, 88px) 0 clamp(44px, 5vw, 72px);
}

.bp-cover .wrap {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.bp-cover h1 {
  font-size: clamp(38px, 6.4vw, 76px);
  line-height: 1;
}

.bp-cover .lead {
  max-width: 680px;
}

.bp-facts {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 32px;
}

.bp-facts div {
  border-top: 1px solid var(--ink);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bp-facts dt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.bp-facts dd {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.bp-contents {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 28px;
}

.bp-contents a,
.bp-print {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.bp-contents a .mono {
  font-weight: 400;
  color: var(--text-2);
}

.bp-contents a:hover,
.bp-print:hover {
  color: var(--accent);
}

.bp-print {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 5px;
  cursor: pointer;
}

/* A note about the sample itself, kept apart from the Blueprint's own words. */
.aside {
  max-width: 680px;
  padding-left: 18px;
  border-left: 2px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-2);
  text-wrap: pretty;
}

.aside .mono {
  font-size: 11px;
  font-weight: 400;
}

.aside a {
  color: var(--ink);
  text-underline-offset: 3px;
}

/* The document: four sheets of paper on the band. */

.bp-doc {
  padding: clamp(20px, 5vw, 72px) 0 var(--section);
  background: var(--band);
}

.bp-doc .wrap {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3.5vw, 44px);
}

.sheet {
  padding: clamp(22px, 5.4vw, 64px);
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 5vw, 56px);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(11, 11, 15, 0.06), 0 30px 44px -30px rgba(11, 11, 15, 0.32);
}

.sheet-top,
.sheet-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
}

.sheet-top {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.sheet-foot {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sheet-title {
  font-size: clamp(30px, 4.8vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.sheet-title span {
  display: block;
  text-wrap: balance;
}

.block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.block > p,
.block > .aside {
  max-width: 640px;
}

.block > p {
  text-wrap: pretty;
}

.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* The sentence a block exists to say. */
.say {
  max-width: 700px;
  font-size: clamp(21px, 2.5vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
}

.muted {
  color: var(--text-2);
}

/* Rows: a name and what it means. */
.rows {
  border-top: 1px solid var(--ink);
}

.rows > div {
  padding: 15px 0;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 2px 32px;
  border-bottom: 1px solid var(--line-2);
}

.rows dt {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.rows dd {
  max-width: 520px;
  font-size: 16px;
  color: var(--text-2);
  text-wrap: pretty;
}

.rows--cut dt s {
  text-decoration-thickness: 1px;
  text-decoration-color: var(--text-2);
}

/* Plans */

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plans li {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
}

.plans .price {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.plans .price small {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-2);
}

.plans li p:last-child {
  margin-top: 4px;
  font-size: 15px;
  color: var(--text-2);
  text-wrap: pretty;
}

/* Key screens */

.screens {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 20px;
}

.screens li {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.phone {
  display: block;
  margin-bottom: 12px;
  padding: 5px;
  border-radius: 14% / 6.5%;
  background: var(--ink);
  box-shadow: 0 26px 36px -24px rgba(11, 11, 15, 0.5);
}

.phone img {
  width: 100%;
  height: auto;
  aspect-ratio: 780 / 1688;
  border-radius: 12.4% / 5.7%;
}

.screens .title {
  font-size: 17px;
}

.screens li p:last-child {
  font-size: 15px;
  color: var(--text-2);
  text-wrap: pretty;
}

.wide {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wide a {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(11, 11, 15, 0.1), 0 26px 36px -26px rgba(11, 11, 15, 0.4);
}

.wide img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
}

/* Technical plan: the app, its API and data on one line, the outside services hanging from the API. */

.arch {
  --gap: 20px;
  display: flex;
  flex-direction: column;
}

.arch-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.box {
  position: relative;
  min-height: 76px;
  padding: 14px 16px 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border: 1.2px solid var(--line-2);
  border-radius: 10px;
  background: #fff;
}

.box b {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.box span {
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text-2);
}

.box--ink {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.box--ink span {
  color: #c7c7cc;
}

/* The line from each box on the top row to the next one. */
.arch-row--main .box:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  width: var(--gap);
  height: 1px;
  margin-left: 1px;
  background: var(--text-3);
}

/* The drop from the API to a rail, and from the rail to each service. */
.arch-link {
  position: relative;
  height: 32px;
}

.arch-link::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 16px;
  background: var(--text-3);
}

.arch-link::after {
  content: '';
  position: absolute;
  left: calc((100% - 2 * var(--gap)) / 6);
  right: calc((100% - 2 * var(--gap)) / 6);
  top: 16px;
  height: 16px;
  border: 1px solid var(--text-3);
  border-bottom: 0;
}

.arch-row--services .box:nth-child(2)::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 1px;
  height: 16px;
  margin-bottom: 1px;
  background: var(--text-3);
}

/* Running cost */

.costs {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--ink);
  font-size: 16px;
}

.costs th,
.costs td {
  padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  vertical-align: top;
  font-weight: 400;
}

.costs td {
  padding-left: 20px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.costs th[scope='row'] b {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.costs th[scope='row'] span {
  display: block;
  max-width: 460px;
  font-size: 15px;
  color: var(--text-2);
  text-wrap: pretty;
}

.costs .group th {
  padding: 26px 0 10px;
  border-bottom-color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.costs .group:first-child th {
  padding-top: 14px;
}

.costs .total th,
.costs .total td {
  border-bottom-color: var(--ink);
  font-size: 17px;
  font-weight: 600;
}

/* Schedule and date */

.figure {
  font-size: clamp(60px, 13vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.055em;
  font-weight: 600;
}

.date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px 48px;
}

.date-row > div:first-child {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.date {
  font-size: clamp(30px, 4.8vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.date span {
  display: block;
}

.cal {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal ol {
  display: grid;
  grid-template-columns: repeat(7, 30px);
  gap: 4px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.cal li {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.cal .dow {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
}

.cal .is-launch {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 4px rgba(11, 11, 15, 0.1);
}

/* The three payments reuse the site's build line; here the big figure is an amount. */
.sheet .plan-track {
  padding-inline: 24px;
}

.sheet .plan-amount {
  font-size: clamp(30px, 3.6vw, 40px);
}

.weeks {
  border-top: 1px solid var(--ink);
}

.weeks li {
  padding: 13px 0;
  display: grid;
  grid-template-columns: 72px 96px minmax(0, 1fr);
  gap: 2px 20px;
  align-items: baseline;
  border-bottom: 1px solid var(--line-2);
  font-size: 16px;
  text-wrap: pretty;
}

.weeks .mono {
  font-weight: 400;
  color: var(--text-2);
}

.weeks .when {
  font-size: 15px;
  color: var(--text-2);
}

.weeks b {
  font-weight: 600;
}

.sheet .get-list {
  font-size: 16px;
}

.sheet .get-list li {
  padding: 14px 0;
  text-wrap: pretty;
}

.sheet .choice {
  padding: 20px 22px;
}

.sign {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  font-size: 16px;
}

.sign b {
  font-weight: 600;
}

.sign a {
  color: var(--text-2);
  text-underline-offset: 3px;
}

/* Smaller screens */

@media (max-width: 860px) {
  .bp-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bp-print {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .rows > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .plans {
    grid-template-columns: minmax(0, 1fr);
  }

  .screens {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weeks li {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .weeks li > :last-child {
    grid-column: 1 / -1;
  }

  .sheet .plan-track {
    padding-inline: 22px;
  }
}

@media (max-width: 520px) {
  .bp-doc .wrap {
    padding-inline: 12px;
  }

  .bp-contents {
    flex-direction: column;
    align-items: flex-start;
  }

  .screens {
    gap: 26px 14px;
  }

  .arch {
    --gap: 10px;
  }

  .box {
    padding: 12px 10px 13px;
  }

  .box b {
    font-size: 14.5px;
  }

  .box span {
    font-size: 12px;
  }

  .cal ol {
    grid-template-columns: repeat(7, 34px);
  }

  .cal li {
    height: 34px;
  }

}

/* Print: the cover, then the sheets. */

@media print {
  @page {
    margin: 16mm 15mm;
  }

  html {
    scroll-behavior: auto;
  }

  body {
    font-size: 11pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .skip,
  .site-header,
  .bp-contents,
  .book,
  .site-footer {
    display: none !important;
  }

  .wrap,
  .wrap--doc,
  .bp-doc .wrap {
    max-width: none;
    padding-inline: 0;
  }

  .bp-cover {
    padding: 0;
  }

  .bp-cover h1 {
    font-size: 46pt;
  }

  .bp-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bp-doc {
    padding: 0;
    background: none;
  }

  .bp-doc .wrap {
    display: block;
  }

  /* Plain blocks with margins, not flex with gaps: page breaks follow the rules below more reliably. */
  .sheet {
    display: block;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-top: 24pt;
  }

  /* The sample starts each part on a new page. The terms and the privacy note run on. */
  .bp-doc--paged .sheet {
    margin-top: 0;
    break-before: page;
  }

  .sheet > * + * {
    margin-top: 16pt;
  }

  .block {
    display: block;
  }

  .block > * + * {
    margin-top: 8pt;
  }

  /* Paper type: a size down from the screen, so each part fits in two pages. */
  .sheet-title {
    font-size: 26pt;
  }

  .date {
    font-size: 22pt;
  }

  .block > p:not(.say, .figure),
  .rows dd,
  .costs,
  .weeks li,
  .sheet .get-list,
  .sign,
  figcaption {
    font-size: 10pt;
  }

  .rows dt,
  .title,
  .screens .title,
  .box b,
  .costs th[scope='row'] b,
  .costs .total th,
  .costs .total td {
    font-size: 10.5pt;
  }

  .fine,
  .aside,
  .weeks .when,
  .plans li p:last-child,
  .screens li p:last-child,
  .choice p:last-child,
  .costs th[scope='row'] span,
  .plan-track li p:last-child {
    font-size: 9.5pt;
  }

  .box span {
    font-size: 9pt;
  }

  .label,
  .sheet-top,
  .sheet-foot,
  .aside .mono,
  .costs .group th,
  .plan-track .mono,
  .weeks .mono {
    font-size: 8pt;
  }

  .block > .say {
    font-size: 14pt;
  }

  .block > .figure {
    font-size: 54pt;
  }

  .rows > div,
  .weeks li,
  .sheet .get-list li {
    padding: 6pt 0;
  }

  .costs th,
  .costs td {
    padding: 5.5pt 0;
  }

  .costs .group th {
    padding: 11pt 0 5pt;
  }

  .plans li,
  .sheet .choice {
    padding: 11pt 13pt;
  }

  .plans .price {
    font-size: 18pt;
  }

  .box {
    min-height: 0;
    padding: 9pt 11pt;
  }

  .sheet .plan-track {
    padding-block: 18pt;
  }

  .sheet .plan-amount {
    font-size: 20pt;
  }

  .label,
  .sheet-title,
  .say {
    break-after: avoid;
  }

  /* A note, a signature or a footer never starts a page on its own. */
  .aside,
  .sign,
  .sheet-foot,
  .block > .fine {
    break-before: avoid;
  }

  .block,
  .rows > div,
  .plans li,
  .screens li,
  .wide,
  .arch,
  .costs tr,
  .date-row,
  .plan,
  .weeks li,
  .get-list li,
  .choices,
  .aside,
  .sign {
    break-inside: avoid;
  }

  /* Long blocks may run over a page, as long as no row is cut in two. */
  .block--long {
    break-inside: auto;
  }

  .rows > div {
    grid-template-columns: 150pt minmax(0, 1fr);
  }

  .plans,
  .choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .screens {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14pt;
  }

  .phone,
  .wide a {
    box-shadow: none;
  }

  .wide a {
    border: 1px solid var(--line-2);
  }

  .get-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  a {
    text-decoration: none;
  }
}
