/* The home page after the trace demo: what Dockmule is bad at, the pilot, the
   founder note and the footer (DESIGN.md, marketing layer). Tokens come from
   styles.css. Each section has one arrival, written as a transition on the
   parts marked data-reveal (DESIGN.md, "Motion"): motion.js puts "moves" on
   the page when the visitor allows motion and "in" on each part as it comes
   into view. Without them, and under reduced motion, every part rests at its
   finished state. */

/* ---------- parts that arrive: the finished state, and where each starts ---------- */
[data-reveal] {
  transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--r, 0deg)) scale(var(--k, 1));
}

@media (prefers-reduced-motion: no-preference) {
  /* The transition belongs to the arrival alone: a part is put in its starting
     place at once, and only moves when "in" is set. */
  html.moves [data-reveal].in {
    transition:
      transform 340ms var(--out-expo) var(--d, 0ms),
      opacity 160ms linear var(--d, 0ms),
      filter 240ms linear var(--d, 0ms);
  }

  html.moves [data-reveal]:not(.in) {
    --y: 28px;
  }

  html.moves .bad-at li[data-reveal]:not(.in) {
    --x: -28px;
    --y: 0px;
  }

  html.moves .bad-at-mule[data-reveal]:not(.in),
  html.moves .pilot-art[data-reveal]:not(.in) {
    --y: 32px;
    --r: 3deg;
  }

  html.moves .note-stamp[data-reveal]:not(.in) {
    --y: 0px;
    --k: 1.6;
    --r: -14deg;
    opacity: 0;
    filter: blur(2px);
  }

  html.moves .footer-mule[data-reveal]:not(.in) {
    --y: 44px;
  }

  html.moves .footer-mule[data-reveal].in {
    transition-timing-function: var(--out-back-soft);
  }

  html.moves .note-stamp[data-reveal].in {
    transition-timing-function: var(--ease-stamp);
  }
}

/* ---------- shared: tape, perforation, headings on these sections ---------- */
main {
  overflow-x: clip;
}

.tape {
  height: 16px;
  background: url("/img/dock-stripes.svg") repeat-x 0 0 / 16px 16px;
}

.perf-dock {
  background: radial-gradient(circle at 7px 14px, var(--stock) 5px, var(--dock) 5.5px) repeat-x 0 0 / 14px 14px;
}

.bad-at .section-heading,
.pilot .section-heading,
.founder .section-heading {
  margin-bottom: 28px;
  font: var(--section-title);
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- the quieter poses: a mule on the paper with one line beside it ---------- */
.mule-aside {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  max-width: 520px;
  margin: 0;
}

.mule-aside img {
  flex: none;
  width: 200px;
  height: auto;
}

.mule-aside figcaption {
  color: var(--ink-2);
  font: var(--body-sm);
}

.mule-aside-end {
  margin: 40px 0 0 auto;
}

.how-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
  margin-bottom: 40px;
}

#how-it-works .how-head .section-heading {
  margin-bottom: 0;
}

.bad-at .mule-aside {
  margin-top: 28px;
}

/* ---------- what Dockmule is bad at: tickets in a list, and a mule that has read it ---------- */
.bad-at {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: end;
  gap: 0 var(--section);
  max-width: 1280px;
  padding: 72px var(--gutter) 96px;
}

.bad-at ul {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bad-at li {
  --r: -0.35deg;
  position: relative;
  max-width: 62ch;
  padding: 16px 22px 16px 70px;
  background: var(--coupon);
  box-shadow: var(--sheet-1);
  outline: 1.5px solid var(--ink);
  outline-offset: -1.5px;
  font: var(--lede);
}

.bad-at li:nth-child(even) {
  --r: 0.3deg;
  margin-left: 18px;
}

/* A crossed box in ink, drawn: this is a thing Dockmule does not do. */
.bad-at li::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 48px;
  background:
    linear-gradient(45deg, transparent 44%, var(--dock) 44% 56%, transparent 56%) 50% 50% / 20px 20px no-repeat,
    linear-gradient(-45deg, transparent 44%, var(--dock) 44% 56%, transparent 56%) 50% 50% / 20px 20px no-repeat,
    var(--ink);
}

.bad-at li strong {
  font-weight: 600;
}

.bad-at li:nth-child(2) {
  --d: 70ms;
}

.bad-at li:nth-child(3) {
  --d: 140ms;
}

.bad-at li:nth-child(4) {
  --d: 210ms;
}

/* The mule sits on a dock-yellow card with its caption on an ink strip. */
.bad-at-mule {
  --r: 1.2deg;
  margin: 0;
  background: var(--dock);
  box-shadow: var(--sheet-2);
  outline: 1.5px solid var(--ink);
  outline-offset: -1.5px;
}

.bad-at-mule img {
  display: block;
  width: 100%;
  height: auto;
  padding: 16px 16px 0;
}

.bad-at-mule figcaption {
  padding: 10px 18px 12px;
  background: var(--ink);
  color: var(--on-ink);
  font: var(--body-sm);
}

/* ---------- the pilot: a dock-yellow field, the ink button, the mule at its stamp ---------- */
#pilot {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: end;
  gap: 0 var(--section);
  max-width: none;
  margin: 0;
  padding: 80px max(var(--gutter), calc((100% - 1216px) / 2)) 104px;
  background: var(--dock);
}

.pilot-copy {
  align-self: center;
}

.pilot .prose {
  max-width: 56ch;
}

.pilot-cta {
  margin: 36px 0 0;
}

.pilot-cta .button {
  min-height: 60px;
  margin-top: 0;
  padding: 0 34px;
  font-size: 22px;
}

.pilot-art {
  position: relative;
  z-index: 4;
  padding-bottom: 38px;
}

.pilot-art img {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
  margin: 0 auto;
}

.pilot-cta[data-reveal] {
  --d: 120ms;
}

/* ---------- the founder note: a signed coupon with a stamp ---------- */
.founder {
  max-width: 1280px;
  padding: 72px var(--gutter) 150px;
}

.note {
  --r: -0.5deg;
  position: relative;
  max-width: 960px;
  background: var(--coupon);
  box-shadow: var(--sheet-3);
  outline: 1.5px solid var(--ink);
  outline-offset: -1.5px;
}

.note::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 7px;
  background: radial-gradient(circle at 7px 0, transparent 4px, var(--coupon) 4.5px) repeat-x 0 0 / 14px 7px;
}

.note-body {
  display: flex;
  align-items: stretch;
}

.note-initials {
  display: grid;
  flex: none;
  place-items: center;
  width: 64px;
  background: var(--ink);
  color: var(--dock);
  font: 700 24px / 1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.04em;
}

.note-text {
  min-width: 0;
  margin: 0;
  padding: 26px 30px;
  font: var(--lede);
  overflow-wrap: anywhere;
}

/* The stub: torn off along a dashed line with a punch at each end. */
.note-stub {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 6px;
  padding: 16px 30px 12px 94px;
  border-top: 2px dashed var(--ink-mute);
}

.note-stub::before,
.note-stub::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 14px;
  height: 14px;
  background: var(--stock);
  border-radius: 50%;
}

.note-stub::before {
  left: -7px;
}

.note-stub::after {
  right: -7px;
}

.signed {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0;
}

.signed-label {
  color: var(--ink-2);
  font: var(--label);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.signature {
  padding: 0 14px 3px 0;
  border-bottom: 1.5px solid var(--ink);
  font: 700 32px / 1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.01em;
}

.note-stamp {
  flex: none;
  width: 118px;
  height: auto;
  margin: -38px -8px -12px 0;
}

/* ---------- the footer: an ink band, the wordmark, the mule looking over its edge ---------- */
.footer {
  position: relative;
  margin-top: 0;
  padding: 56px max(var(--gutter), calc((100% - 1216px) / 2)) 48px;
  background: var(--ink);
  border-top: 0;
  color: var(--on-ink);
  font: var(--body-sm);
}

.footer :focus-visible {
  outline-color: var(--dock);
  outline-offset: 3px;
}

.footer-mule {
  position: absolute;
  top: -68px;
  right: max(48px, calc((100% - 1216px) / 2 + 48px));
  width: 96px;
  height: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px var(--section);
  align-items: start;
}

.footer-logo {
  display: block;
  width: 139px;
  height: auto;
  margin-bottom: 20px;
}

.footer p {
  max-width: 72ch;
  margin: 0 0 12px;
}

.footer .privacy {
  color: var(--ink-mute);
}

.footer a,
.footer .link-button {
  color: var(--on-ink);
  text-decoration-color: var(--dock);
}

.footer a:hover,
.footer .link-button:hover {
  color: var(--dock);
}

/* ---------- narrow screens ---------- */
@media (max-width: 960px) {
  .bad-at {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gutter);
    padding: 56px 20px 72px;
  }

  .bad-at-mule {
    max-width: 440px;
  }

  #pilot {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 56px 20px 96px;
  }

  .pilot-art {
    max-width: 360px;
  }

  .founder {
    padding: 56px 20px 130px;
  }

  .footer {
    padding: 48px 20px 36px;
  }

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

@media (max-width: 760px) {
  .mule-aside img {
    width: 140px;
  }

  .mule-aside-end {
    margin-left: 0;
  }

  .bad-at,
  .founder {
    padding-right: 16px;
    padding-left: 16px;
  }

  .bad-at li {
    padding: 14px 16px 14px 62px;
    font-size: 18px;
  }

  .bad-at li:nth-child(even) {
    margin-left: 0;
  }

  .bad-at li::before {
    width: 42px;
  }

  #pilot {
    padding-right: 16px;
    padding-left: 16px;
  }

  .pilot-cta .button {
    min-height: 56px;
    padding: 0 26px;
    font-size: 20px;
  }

  .note-text {
    padding: 20px 18px;
    font-size: 18px;
  }

  .note-initials {
    width: 44px;
    font-size: 20px;
  }

  .note-stub {
    padding: 14px 18px 10px 18px;
  }

  .note-stamp {
    width: 96px;
    margin-top: -26px;
  }

  .signature {
    font-size: 28px;
  }

  .footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .footer-mule {
    right: 24px;
  }
}
