/* Phone counterpart to We Are Brew. Load after saved desktop styles.
   !important only overrides saved inline design coordinates/typography. */
/* Narrow desktop windows also use the stacked layout. Do not let a long
   heading fill its last line right up to the viewport edges. */
@media (min-width: 600px) and (max-width: 767px) {
  :root { --narrow-title-width: calc(100vw - 112px); }
  main :is(.journey-heading, .narrative-inner) > h2 { text-wrap: balance; }
}
@media (max-width: 767px) {
  :root {
    --phone-copy-width: var(--brew-mobile-copy-width);
    --phone-title-width: var(--narrow-title-width, calc(100vw - 48px));
    --phone-paper-width: min(240px, 46.18vw);
    --phone-chapter-gap: 128px;
    --phone-content-gap: 64px;
  }
  main {
    width: 100%;
    min-width: 0;
  }
  .navigation-bar {
    padding-inline: max(18px, env(safe-area-inset-left))
      max(18px, env(safe-area-inset-right));
  }
  /* Same paper veil as We Are Brew, including when scrolling back upward. */
  .navigation::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      var(--paper) 0%,
      #fdfbf7e8 42%,
      #fdfbf700 100%
    );
  }
  .navigation nav {
    gap: 12px;
  }
  .navigation-bar :is(button, a) {
    min-height: 44px;
  }
  .navigation-bar button {
    min-width: 44px;
  }
  .back-to-top,
  .edge-stamps {
    display: none;
  }
  #top.stamp-story,
  #top .story-stage {
    height: 100svh;
    min-height: 0;
  }
  #top .story-stage {
    position: relative;
  }
  #top .hero-opening-logo {
    top: 48%;
  }
  #top .flying-stamp[data-phone-hidden="true"] {
    display: none;
  }
  #top h1 {
    line-height: 1.125 !important;
    -webkit-text-stroke: 2px #fff;
    paint-order: stroke fill;
    text-shadow: 1px 4px 0 #c88e4e14;
  }
  main > :is(.stamp-journey, .narrative-section) {
    margin: var(--phone-chapter-gap) 0 0;
    padding: 0;
    scroll-margin-top: 108px;
  }
  .journey-layout,
  .narrative-inner {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  main :is(.journey-heading, .narrative-inner) > h2 {
    position: relative;
    width: var(--phone-title-width) !important;
    max-width: none !important;
    margin: 0 auto 40px;
    font-size: clamp(28px, 7.8vw, 36px) !important;
    line-height: 1.125 !important;
    letter-spacing: 0.2px !important;
    text-align: center !important;
    transform: rotate(-2deg) !important;
    -webkit-text-stroke-width: 2px;
    overflow-wrap: break-word;
  }
  .journey-heading {
    margin: 0;
  }
  main :is(.journey-copy, .journey-bridge, .offer-copy, .contact-copy) {
    position: relative;
    width: var(--phone-copy-width) !important;
    max-width: none !important;
    margin-inline: auto;
    transform: none !important;
    text-align: center !important;
  }
  main
    :is(
      .journey-copy,
      .journey-bridge,
      .offer-copy p,
      .contact-copy p,
      .value-note p
    ) {
    width: 100% !important;
    max-width: none !important;
    transform: none !important;
    font-size: 18px !important;
    line-height: 25px !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    color: var(--ink) !important;
  }
  main .stamp-journey :is(.journey-copy, .journey-bridge) {
    width: var(--phone-copy-width) !important;
  }
  main .stamp-journey .journey-bridge {
    color: var(--gold) !important;
    margin-bottom: 24px;
  }
  .journey-cities {
    margin-top: var(--phone-content-gap);
  }
  .journey-city-list {
    width: var(--phone-copy-width);
    margin: auto;
    gap: 0 10px;
    align-items: center;
  }
  .journey-city-list .journey-city {
    width: auto !important;
    max-width: 100% !important;
    min-height: 44px;
    padding: 8px 0;
    font-size: 16px !important;
    line-height: 22px !important;
    letter-spacing: 0 !important;
    transform: none !important;
    text-align: center !important;
  }
  .journey-phone-preview {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    padding: 22px 0 24px;
    overflow-anchor: none;
  }
  .journey-phone-preview .journey-stamp-group {
    width: var(--preview-width);
    margin-left: var(--preview-left);
    padding-inline: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px 12px;
  }
  .journey-phone-preview .journey-city-stamp {
    position: relative;
    inset: auto !important;
    flex: 0 0 var(--brew-phone-stamp-size);
    width: var(--brew-phone-stamp-size) !important;
    height: var(--brew-phone-stamp-size) !important;
  }
  .journey-phone-preview .journey-stamp-breathe {
    width: 100%;
    aspect-ratio: 1;
    height: auto;
  }
  .journey-phone-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .collect-composition {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  .collect-visuals,
  .collect-captions {
    display: contents;
  }
  .collect-composition .collect-step {
    width: var(--phone-paper-width);
    margin: 0 auto 40px;
    translate: none !important;
  }
  .collect-composition .collect-step :is(img, video) {
    width: 100% !important;
    height: auto;
    max-width: none;
    border-radius: 20px !important;
    transform: rotate(-3deg) !important;
  }
  .collect-composition .phone-two img {
    transform: rotate(3deg) !important;
  }
  .collect-step.phone-one {
    order: 0;
  }
  .collect-captions li:nth-child(1) {
    order: 1;
  }
  .collect-step.phone-two {
    order: 2;
  }
  .collect-captions li:nth-child(2) {
    order: 3;
  }
  .collect-step.phone-three {
    order: 4;
  }
  .collect-captions li:nth-child(3) {
    order: 5;
    margin-bottom: 0;
  }
  .collect-captions li {
    width: var(--phone-copy-width);
    margin: 0 auto var(--phone-content-gap);
    list-style: none;
  }
  .collect-captions .collect-arrow {
    display: none;
  }
  .collect-captions h3[data-flow-align] {
    width: 100% !important;
    transform: none !important;
    text-align: center !important;
    font-size: 16px !important;
    line-height: 22px !important;
    letter-spacing: 0 !important;
  }
  .value-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: min(280px, 60vw);
    margin: 0 auto;
    gap: var(--phone-content-gap);
    padding: 0;
  }
  .value-note {
    min-height: 0;
    width: 100%;
    aspect-ratio: 1;
    padding: clamp(16px, 4.5vw, 22px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transform: rotate(-2deg);
  }
  .value-note:nth-child(2) {
    transform: rotate(2deg);
  }
  .value-note:nth-child(3) {
    transform: rotate(-1deg);
  }
  main :is(.value-note, .offer-copy) h3 {
    width: 100% !important;
    font-size: 24px !important;
    line-height: 30px !important;
    text-align: center !important;
    transform: none !important;
    margin: 0 0 20px;
    letter-spacing: 0 !important;
    color: var(--gold) !important;
  }
  main .value-columns .value-note h3 {
    min-height: 0;
    font-size: clamp(16px, 4.6vw, 20px) !important;
    line-height: 1.2 !important;
    margin-bottom: 10px;
  }
  main .value-columns .value-note p {
    font-size: clamp(13px, 3.6vw, 16px) !important;
    line-height: 1.35 !important;
  }
  .offer-composition,
  .contact-composition {
    display: flex;
    flex-direction: column;
    gap: var(--phone-content-gap);
    width: 100%;
  }
  .phone-pair.single-video {
    position: relative;
    inset: auto;
    margin: 0 auto;
    width: var(--phone-paper-width);
    height: auto;
  }
  .phone-pair.single-video .offer-demo {
    width: 100% !important;
    border-radius: 20px;
    transform: rotate(3deg);
  }
  .offer-copy {
    gap: var(--phone-content-gap);
  }
  main #join {
    padding-bottom: var(--phone-chapter-gap);
  }
  .contact-copy p + p {
    margin-top: 24px;
  }
  .contact-copy p.contact-closing {
    margin-top: 36px;
  }
  .contact-actions {
    gap: 48px;
    width: 100%;
  }
  .contact-section .join-heading {
    width: 220px !important;
    margin: 0 auto 48px;
    transform: rotate(-3deg) !important;
    --join-button-scale: 0.85 !important;
  }
  .contact-actions .download-note {
    width: 180px !important;
    transform: rotate(3deg) !important;
  }
  .download-note figcaption {
    font-size: 16px;
    line-height: 22px;
  }
  footer.site-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-inline: 24px;
    gap: 16px;
    font-size: 16px;
    line-height: 22px;
  }
  .site-footer .footer-links {
    gap: 0;
  }
  .site-footer .footer-links > :not(.footer-social) {
    display: none;
  }
  .site-footer .footer-social {
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
  }
}
