/* Home composition only. Shared mechanical controls stay in ride-journal.css. */
.ride-journal-page .home-terrain { display: none; }

@media (min-width: 821px) {
  /* Existing rail/body insets produce about 90% document width. */
  .ride-journal-page .site-main {
    width: calc(100% - 4.1667vw);
    max-width: 1840px;
  }
  .ride-journal-page .home-hero {
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "copy terrain" "actions terrain";
    align-items: start;
    align-content: start;
    min-height: 0;
    height: auto;
    gap: 28px clamp(24px, 2vw, 40px);
    padding: 0 0 48px;
    overflow: visible;
  }
  .ride-journal-page .home-terrain {
    display: block;
    grid-area: terrain;
    position: relative;
    z-index: 0;
    inset: auto;
    width: 100%;
    min-width: 0;
    aspect-ratio: 673 / 402;
    overflow: hidden;
    pointer-events: none;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 96%, transparent), linear-gradient(0deg, transparent, #000 7%, #000 96%, transparent);
    mask-composite: intersect;
  }
  .ride-journal-page .home-terrain .journal-terrain {
    display: block;
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 673 / 402;
    object-fit: contain;
    mask-image: none;
    mix-blend-mode: multiply;
  }
  .ride-journal-page .home-copy {
    grid-area: copy;
    width: 100%;
    min-width: 0;
    max-width: none;
    align-self: start;
    padding: clamp(48px, 4.2vw, 88px) 0 0 2rem;
  }
  .ride-journal-page .home-copy h1 {
    margin: 0;
    max-width: 9.6em;
    font-size: clamp(2rem, 3.84vw, 4.25rem);
    line-height: 1.15;
    letter-spacing: -.035em;
    text-wrap: initial;
  }
  .ride-journal-page .home-copy .hero-proof {
    max-width: 28em;
    margin: 24px 0 0;
    font-size: clamp(1.25rem, 1.63vw, 1.75rem);
    line-height: 1.45;
    text-wrap: initial;
  }
  .ride-journal-page .home-copy .hero-support {
    max-width: 35em;
    margin: 16px 0 0;
    font-size: clamp(1.0625rem, 1.17vw, 1.25rem);
    line-height: 1.55;
    text-wrap: initial;
  }
  .ride-journal-page .action-dock {
    grid-area: actions;
    width: calc(100% - 2rem);
    min-width: 0;
    margin: 0 0 0 2rem;
    align-self: start;
  }
  .ride-journal-page .journal-panels {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1.12fr) minmax(0, 1fr);
    align-items: start;
    height: auto;
    gap: clamp(18px, 1.6vw, 32px);
    padding: 0 12px;
  }
  .ride-journal-page .journal-panels figure {
    min-width: 0;
    min-height: 0;
    height: auto;
    aspect-ratio: auto;
  }
  .ride-journal-page .journal-print {
    padding: clamp(10px, .8vw, 16px) clamp(10px, .8vw, 16px) 28px;
    border: 1px solid #d2c9b7;
    background: var(--grain), #f2eee3;
    box-shadow: 0 3px 7px #64553c38, inset 0 1px #fffef5;
  }
  .ride-journal-page .ride-print { transform: rotate(-.8deg); }
  .ride-journal-page .hardware-print { transform: rotate(.4deg); }
  .ride-journal-page .journal-panels img {
    display: block;
    width: 100%;
    min-width: 0;
    height: auto;
    object-fit: contain;
  }
  .ride-journal-page .ride-print img { aspect-ratio: 431 / 321; }
  .ride-journal-page .hardware-print img { aspect-ratio: 428 / 321; }
  .ride-journal-page .journal-app {
    align-self: start;
    padding: 8px 0 24px;
  }
  .ride-journal-page .journal-app img { aspect-ratio: 407 / 333; }
  .ride-journal-page .journal-panels figcaption {
    bottom: 6px;
    right: 14px;
    font-size: .75rem;
    line-height: 1.35;
  }
  .ride-journal-page .journal-app figcaption { bottom: 2px; }
  .ride-journal-page .journal-features {
    height: auto;
    min-height: 100px;
    margin-top: 32px;
    padding: 20px 0;
  }
  .ride-journal-page .journal-features li {
    flex: 1 1 0;
    min-width: 0;
    gap: 18px;
    padding-inline: 24px;
    font-size: clamp(1.125rem, 1.3vw, 1.375rem);
    line-height: 1.4;
    white-space: normal;
    letter-spacing: -.015em;
  }
}

@media (min-width: 821px) and (max-width: 1060px) {
  .ride-journal-page .home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas: "copy copy" "actions terrain";
    gap: 28px 24px;
    padding-bottom: 40px;
  }
  .ride-journal-page .home-copy { padding: 48px 24px 0; }
  .ride-journal-page .home-copy h1 { max-width: 9.6em; }
  .ride-journal-page .home-copy .hero-proof { max-width: 36em; }
  .ride-journal-page .home-copy .hero-support { max-width: 40em; }
  .ride-journal-page .action-dock {
    width: calc(100% - 24px);
    margin-left: 24px;
    align-self: center;
  }
  .ride-journal-page .journal-features li { gap: 12px; padding-inline: 16px; }
}

@media (max-width: 820px) {
  .ride-journal-page .home-hero { padding: 20px 0 40px; }
  /* Keep complete commands inside their faces when text grows independently. */
  .ride-journal-page .action-dock {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  }
  .ride-journal-page .home-copy { padding: 32px 3px; }
  .ride-journal-page .home-copy h1 {
    margin: 0;
    max-width: 9.6em;
    font-size: clamp(1.875rem, 8.1vw, 3.25rem);
    line-height: 1.15;
    letter-spacing: -.03em;
    text-wrap: initial;
  }
  .ride-journal-page .home-copy .hero-proof {
    margin: 20px 0 0;
    font-size: clamp(1.125rem, 4.6vw, 1.5rem);
    line-height: 1.45;
    text-wrap: initial;
  }
  .ride-journal-page .home-copy .hero-support {
    max-width: 38em;
    margin: 16px 0 0;
    font-size: 1.125rem;
    line-height: 1.55;
    text-wrap: initial;
  }
}

/* Keep the accepted gallery baseline; only the phone rises into the terrain art. */
@media (min-width: 821px) {
  .ride-journal-page .journal-app.app-fit-preview {
    isolation: isolate;
    z-index: 1;
  }
  .ride-journal-page .app-fit-preview .app-fit-reserve {
    display: block;
    width: 100%;
    aspect-ratio: 407 / 333;
  }
  .ride-journal-page .app-fit-preview .app-fit-phone {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: clamp(188px, 14vw, 216px);
    padding: 5px;
    transform: translateX(-50%);
    border: 1px solid #c5baa3;
    border-radius: 18px;
    background: #eee8da;
    box-shadow: 0 4px 12px #4b402c38, inset 0 1px #fffef4;
  }
  .ride-journal-page .app-fit-preview .app-fit-crop {
    overflow: hidden;
    aspect-ratio: 1320 / 2684;
    border-radius: 12px;
    background: #101419;
  }
  .ride-journal-page .app-fit-preview .app-fit-screenshot {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    aspect-ratio: auto;
    /* Original PNG is untouched. Hide only its 184px OS status strip. */
    transform: translateY(-6.415620642%);
  }
  .ride-journal-page .app-fit-preview figcaption {
    left: 0;
    right: 0;
    text-align: center;
  }
}
