/* The home page, on top of site.css. */

/* hero: the headline across the page, the offer and its actions on one line, then the product at full size:
   the system on a computer and the app on a phone standing over its right edge. --s scales the composition. */
/* Clipped at the page edge, not at the hero's: a clip on the hero cut the shadows of the window and phone. */
body { overflow-x: clip; }
.hero { display: grid; gap: 32px; padding-block: 32px 56px; }
.hero__text { gap: 20px; }
.hero h1 { max-width: 1100px; font-size: clamp(40px, 5.2vw, 72px); line-height: .99; letter-spacing: -.05em; }
.hero__side { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 48px; width: 100%; }
.art { --s: 1; position: relative; width: calc(1080px * var(--s)); height: calc(576px * var(--s)); margin-inline: auto; }
.window { position: absolute; left: 0; top: 0; width: 880px; height: 560px; scale: var(--s); transform-origin: 0 0; overflow: hidden; border-radius: var(--radius-card); background: var(--card); font-size: 14px; box-shadow: 0 0 0 1px var(--hairline-strong), 0 2px 6px var(--shadow-near), 0 28px 64px var(--shadow-window); animation: enter 500ms var(--ease-out) backwards; }
.window .ds-app { display: flex; flex-direction: row; height: 100%; border-radius: 0; }
.window .ds-sd { flex: 0 0 176px; }
.window .ds-flex { gap: 8px; }
.window .ds-nvd a.on { background: var(--card); }
.window .ds-av.sm { width: 22px; height: 22px; font-size: 10px; }
/* Four columns that stay clear of the phone standing over the right edge. */
.window .ds-board { grid-template-columns: repeat(4, 150px); gap: 8px; padding-inline: 14px; }
.window .ds-col { padding-inline: 8px; }
.window .ds-pc { padding-inline: 8px; }
.window .ds-pc .top { gap: 6px; font-size: 13px; white-space: nowrap; }
.window__title { font-size: 16px; font-weight: 600; }
.window .ds-pc.is-moving { position: relative; z-index: 2; box-shadow: 0 0 0 2px var(--ink), 0 12px 24px var(--shadow-window); }
.window .ds-pc { transition: box-shadow 280ms var(--ease-out); }
.phone { position: absolute; right: 0; bottom: 0; width: calc(250px * var(--s)); padding: calc(8px * var(--s)); border-radius: calc(42px * var(--s)); background: var(--ink); box-shadow: 0 4px 12px var(--shadow-near), calc(-14px * var(--s)) calc(36px * var(--s)) calc(72px * var(--s)) var(--shadow-phone); animation: rise 700ms var(--ease-out) 150ms backwards; }
.phone img { display: block; width: 100%; height: auto; border-radius: calc(34px * var(--s)); }
@keyframes enter { from { opacity: 0; transform: translateY(16px); } }
/* The phone only travels, never fades: it is the first large picture and should paint at once. */
@keyframes rise { from { transform: translateY(56px); } }

/* scrollytelling: the steps and the screen are pinned side by side; scrolling or a press changes both */
.headline { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: 12px 40px; }
/* Sized by the height too, so the heading stays in view while the block is pinned. */
.headline h2 { max-width: 720px; font-size: clamp(32px, min(4.4vw, 6.4svh), 60px); }
.pin { display: flex; flex-direction: column; gap: 32px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
.is-pinned .pin { position: sticky; }
.stage { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.screen { position: relative; aspect-ratio: 1080 / 778; overflow: hidden; border-radius: var(--radius-card); background: var(--clip-ground); cursor: pointer; }
.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transform: translateY(24px) scale(.97); transition: opacity 280ms var(--ease-out), transform 280ms var(--ease-out); }
/* Steps already passed leave upwards, steps to come wait below: the direction of the scroll. */
.shot[data-past="true"] { transform: translateY(-24px) scale(.97); }
.shot[data-on="true"] { opacity: 1; transform: none; }
.screen::before, .screen::after { content: ""; position: absolute; left: 50%; top: 50%; z-index: 1; translate: -50% -50%; opacity: 0; pointer-events: none; transition: opacity var(--duration-fast) var(--ease-out); }
.screen::before { width: 72px; height: 72px; border-radius: var(--radius-pill); background: var(--ink); }
.screen::after { width: 22px; height: 24px; margin-left: 3px; background: var(--on-primary); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.story[data-paused="true"] .screen::before, .story[data-paused="true"] .screen::after { opacity: 1; }
.controls { display: flex; align-items: center; gap: 16px; min-height: var(--size-touch); }
.progress { display: flex; flex: 1; gap: 6px; }
.progress__seg { display: flex; flex: 1; align-items: center; height: var(--size-touch); padding: 0; border: 0; background: transparent; cursor: pointer; }
.progress__seg span { display: block; width: 100%; height: 6px; overflow: hidden; border-radius: var(--radius-pill); background: var(--inset); transition: transform var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out); }
.progress__seg[data-on="true"] span { background: var(--data-muted); }
.progress__seg:active span { transform: scaleY(1.8); }
/* The active segment fills with the clip's own time, so pausing visibly stops something. */
.progress i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.progress__seg[data-on="true"] i { transition: transform 250ms linear; }
.toggle { min-width: 148px; gap: 8px; }
.toggle__icon { width: 12px; height: 12px; border-inline: 4px solid currentColor; }
.toggle[data-paused="true"] .toggle__icon { border: 0; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }

/* Without the script the segments would do nothing. */
.story:not(.is-pinned) .progress { visibility: hidden; }
.rail { position: relative; }
.rail__mark { display: none; }
.beats { display: grid; gap: 32px; margin: 0; padding: 0; list-style: none; }
.beat { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-content: center; gap: 8px 12px; }
.beat__n { grid-row: span 2; font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -.06em; }
.beat h3 { font-size: clamp(20px, 1.9vw, 26px); line-height: 1.15; letter-spacing: -.025em; }
.beat .lead { font-size: 15px; }
.beat__go { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; text-wrap: balance; cursor: pointer; }
/* Narrow or tall screens show one step at a time under the clip. */
.is-pinned .beat { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(16px); transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out), visibility 0s 140ms; }
.is-pinned .beat[data-on="true"] { opacity: 1; visibility: visible; transform: none; transition-delay: 140ms; }

/* Landscape desktops: step and clip side by side. The clip takes the height left under the menu and the
   heading (300px with the controls). */
@media (min-width: 821px) and (min-aspect-ratio: 6/5) {
  .row { grid-template-columns: minmax(260px, 1fr) minmax(0, calc(max(300px, 100svh - 300px) * 1.388)); column-gap: 32px; align-items: center; }
  .stage { grid-column: 2; grid-row: 1; }
  .rail { grid-column: 1; grid-row: 1; }
}
/* With room to spare, all four steps stay in view, aligned in equal rows, and one marker slides between them. */
@media (min-width: 1101px) and (min-aspect-ratio: 6/5) and (min-height: 640px) {
  .row { grid-template-columns: minmax(300px, 1fr) minmax(0, calc(max(300px, 100svh - 300px) * 1.388)); align-items: stretch; }
  .rail { display: flex; margin-bottom: 52px; }
  .beats { flex: 1; grid-auto-rows: 1fr; gap: 0; }
  .beat, .is-pinned .beat { grid-area: auto; padding: 8px 16px; opacity: 1; visibility: visible; transform: none; transition: none; }
  .beat + .beat { border-top: 1px solid var(--hairline); }
  .beat h3, .beat__n { color: var(--ink-faint); transition: color 200ms ease; }
  .beat[data-on="true"] h3, .beat[data-on="true"] .beat__n { color: var(--ink); }
  .beat__go::after { content: ""; position: absolute; inset: 0; }
  .beat__go:focus-visible { outline: 0; }
  .beat:has(.beat__go:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-card); }
  .is-pinned .rail__mark { display: block; position: absolute; left: 0; top: 0; width: 100%; height: 25%; border-radius: var(--radius-card); background: var(--page); transition: transform 280ms var(--ease-in-out); }
  .beats { position: relative; }
}

/* the two tools: the platform leads on ink, the app stands beside it with its own screen */
.products { padding-block: 72px 80px; background: var(--page); }
.products h2 { margin-bottom: 32px; }
.products__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; }
.product { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 40px; border-radius: var(--radius-sheet); background: var(--card); }
.product h3 { font-size: clamp(32px, 3.4vw, 48px); line-height: 1.05; letter-spacing: -.035em; }
.product--coach { background: var(--ink); color: var(--on-primary); }
.product--coach .lead { color: var(--on-ink-muted); }
.product--coach .ds-pl { background: var(--ink-2); color: var(--on-primary); }
.product--coach :focus-visible { outline-color: var(--on-primary); }
.product--coach a.ds-btn.pri { margin-top: auto; background: var(--card); color: var(--ink); }
.modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; width: 100%; margin: 16px 0 24px; padding: 0; list-style: none; }
.modules li { display: flex; align-items: center; min-height: 56px; border-top: 1px solid var(--ink-2); font-size: 17px; font-weight: 600; }
.product--app { padding-bottom: 0; overflow: hidden; }
.product__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.product__actions .ds-btn { padding-inline: 24px; background: var(--raised); }
.product__shot { align-self: center; width: min(100%, 280px); height: 260px; margin-top: auto; padding: 8px 8px 0; overflow: hidden; border-radius: 40px 40px 0 0; background: var(--ink); }
.product__shot img { display: block; width: 100%; height: auto; border-radius: 32px 32px 0 0; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .product--coach a.ds-btn.pri:hover { background: var(--inset); }
  .product__actions .ds-btn:hover { background: var(--inset); }
  .progress__seg:hover span { transform: scaleY(1.8); }
  .beat__go:hover { text-decoration: underline; text-underline-offset: 4px; }
  /* A look further down the app's home screen, for whoever points at it. */
  .product--app:hover .product__shot img { transform: translateY(-48px); }
}

/* The product's size follows the room: larger on tall screens, smaller so short ones still see it whole. */
@media (min-width: 1360px) and (min-height: 1000px) { .art { --s: 1.2; } }
@media (min-width: 1101px) and (max-height: 920px) { .art { --s: .92; } }
@media (min-width: 1101px) and (max-height: 820px) { .art { --s: .82; } }
@media (max-width: 1100px) { .art { --s: .74; } }
@media (max-width: 820px) {
  .hero { gap: 32px; padding-block: 24px 32px; }
  .products__grid { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(40px, 8vw, 60px); }
  .art { --s: .5; }
  .sec { padding-block: 24px 32px; }
  .headline { grid-template-columns: minmax(0, 1fr); }
  .pin { gap: 20px; }
  .headline .lead { font-size: 15px; }
  /* The cap leaves room for the step under the screen. */
  .screen { max-height: 45svh; }
  .products { padding-block: 48px; }
  .product { padding: 24px; }
  .product--app { padding-bottom: 0; }
}
@media (min-width: 750px) and (max-width: 820px) { .art { --s: .65; } }
/* Phones: the sidebar leaves the picture so the pipeline can be shown larger. */
@media (max-width: 580px) {
  .art { --s: .6; width: calc(660px * var(--s)); }
  .window { width: 560px; }
  .window .ds-sd { display: none; }
}
@media (max-width: 460px) { .art { --s: .51; } }
@media (max-width: 430px) { .hero .cta, .hero .cta__main { width: 100%; } }
@media (max-width: 374px) { .art { --s: .43; } }
/* Leaves each step's segment wide enough for a finger. */
@media (max-width: 460px) {
  .controls { gap: 8px; }
  .toggle { min-width: 112px; }
}
@media (max-width: 560px) { .modules { grid-template-columns: minmax(0, 1fr); } }
/* Tall windows: side by side the screen would leave most of the height empty, so it takes the full width. */
@media (min-width: 821px) and (max-aspect-ratio: 6/5) {
  .stage { width: min(100%, calc((100svh - 480px) * 1.388)); min-width: min(100%, 560px); margin-inline: auto; }
}
/* short landscape screens: side by side again, or the step would fall below the fold */
@media (max-height: 500px) and (orientation: landscape) {
  .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); column-gap: 24px; align-items: center; }
  .stage { grid-column: 2; grid-row: 1; }
  .rail { grid-column: 1; grid-row: 1; }
  .screen { max-height: 70svh; }
  .beat { grid-template-columns: minmax(0, 1fr); }
  .beat__n { grid-row: auto; font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .window, .phone { animation: none; }
  .shot, .shot[data-past="true"], .is-pinned .beat { transform: none; }
  .progress__seg span, .progress__seg[data-on="true"] i, .rail__mark, .is-pinned .rail__mark, .product__shot img, .window .ds-pc { transition: none; }
  .product--app:hover .product__shot img { transform: none; }
}
