/* Home page only. Shared styles are in site.css, the phone frame in phone.css,
   the sample deck in deck.css, and the sample sites inside it in samples.css. */

/* Rotated cards and phones must never make the page scroll sideways */
main {
  overflow-x: clip;
}

/* Price tags under the headline: they swing in once, like tags on a nail */
.tags {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18))
    drop-shadow(0 6px 8px rgba(80, 0, 12, 0.16));
  display: flex;
  flex-wrap: wrap;
  gap: 12px 10px;
  list-style: none;
  margin: 24px 0 12px;
  padding: 0 0 0 2px;
}
.tag {
  --r: -2deg;
  padding: 9px 12px 10px 27px;
  background: var(--red);
  color: #fff;
  line-height: 1.05;
  white-space: nowrap;
  clip-path: polygon(15px 0, 100% 0, 100% 100%, 15px 100%, 0 50%);
  -webkit-mask: radial-gradient(
    circle at 14px 50%,
    transparent 4px,
    #000 4.5px
  );
  mask: radial-gradient(circle at 14px 50%, transparent 4px, #000 4.5px);
  transform: rotate(var(--r));
  transform-origin: 14px 50%;
}
.tag:nth-child(2) {
  --r: 1.5deg;
}
.tag:nth-child(3) {
  --r: -1deg;
}
.tag b {
  display: block;
  font-size: 1.875rem;
  font-weight: 900;
}
.tag span {
  display: block;
  margin-top: 2px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.sign > .tags-note {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 1rem;
}
.hero > p:not([class]) {
  margin-top: 28px;
  font-size: 1.125rem;
}
.hero > .disclosure {
  font-size: 1rem;
  font-weight: 700;
}
.sign > .reply {
  max-width: none;
  margin: 28px 0 0;
  padding: 14px 16px;
  background: var(--fog);
  border-left: 6px solid var(--red);
  font-size: 1.125rem;
}

/* Before and after: drag the line across the made-up plumber's old and new site.
   A black stage, so the phone is the only lit thing. */
.ba-sec {
  background: var(--ink);
  color: #fff;
}
.ba-sec h2 {
  max-width: 14ch;
}
.ba-sec p {
  max-width: 30em;
  font-size: 1.25rem;
}
.ba-points {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}
.ba-points li {
  padding: 14px 0 16px;
  border-top: 3px solid #fff;
}
.ba-points strong {
  display: block;
  font-size: 1.25rem;
}
.ba-fig {
  margin: 40px 0 0;
}
.ba {
  --p: 50;
  position: relative;
  width: min(250px, 66vw);
  margin: 0 auto;
}
.ba:has(.ba-range:focus-visible) .device {
  outline: 3px solid #fff;
  outline-offset: 6px;
}
.ba-view {
  position: relative;
  flex: none;
  overflow: hidden;
}
.ba-old {
  filter: grayscale(1);
}
.ba-new,
.ba-new-in,
.ba-line {
  position: absolute;
  inset: 0;
}
.ba-new {
  overflow: hidden;
  transform: translateX(calc(var(--p) * 1%));
}
.ba-new-in {
  transform: translateX(calc(var(--p) * -1%));
}
.ba-line {
  pointer-events: none;
  transform: translateX(calc(var(--p) * 1%));
}
.ba-line::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  width: 4px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.ba-line::after {
  content: "";
  position: absolute;
  top: 46%;
  left: -22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cpath d='M17 15l-7 7 7 7M27 15l7 7-7 7' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / 100% no-repeat,
    #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.ba-tag {
  position: absolute;
  top: 10px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-weight: 800;
  font-size: 0.8125rem;
  pointer-events: none;
}
.ba-tag-old {
  left: 10px;
}
.ba-tag-new {
  right: 10px;
  background: var(--red);
}
.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
}
.ba-fig > figcaption {
  margin-top: 20px;
  color: #c9c9c4;
  font-size: 1rem;
  text-align: center;
  text-wrap: balance;
}

/* Promises */
.promises {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
}
.promises li {
  padding: 16px 0 18px;
  border-top: 3px solid var(--ink);
}
.promises strong {
  display: block;
  font-size: 1.25rem;
}

/* Trade pages row */
.for-trade {
  margin-top: 56px;
}
.for-trade ul {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.for-trade .btn {
  width: 100%;
}

.who p {
  max-width: 36em;
  font-size: 1.25rem;
}

/* Free redesign form in the hero (assets/redesign.js, functions/redesign/index.js).
   A heavy rule above it, like the price steps: this is where you act. */
.redesign {
  max-width: 34rem;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 6px solid var(--ink);
  scroll-margin-top: 16px;
}
.redesign h2 {
  margin-bottom: 16px;
  font-size: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
}
#redesign-mail {
  font-size: 1.1875rem;
}
.ask {
  display: grid;
  gap: 16px;
}
.ask[hidden],
.ask-done[hidden],
#redesign-mail[hidden] {
  display: none;
}
.ask p,
.ask-done p {
  margin: 0;
}
.ask label {
  display: block;
  font-weight: 800;
}
.ask input {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 56px;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
.ask input::placeholder {
  color: var(--muted);
}
.cf-turnstile {
  min-height: 65px;
}
.ask .btn {
  width: 100%;
  font-family: inherit;
  cursor: pointer;
}
.ask .btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.ask-status {
  font-weight: 700;
}
.ask-status:empty {
  display: none;
}
.ask .promise {
  color: var(--muted);
  font-size: 1rem;
}
.ask-done {
  font-size: 1.1875rem;
  overflow-wrap: anywhere;
}
.ask-done strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.75rem;
  line-height: 1.2;
}
.ask-done:focus {
  outline: none;
}
/* Once sent, "Check your email" leads, not the ask */
.redesign:has(> .ask-done:not([hidden])) h2 {
  display: none;
}
.redesign .no-site {
  margin: 20px 0 0;
  font-size: 1rem;
}

/* Motion: one load moment (the tags) and two scroll-linked moments (deck.css moves the deck).
   Only transform and opacity move. */
@media (prefers-reduced-motion: no-preference) {
  .tag {
    animation: swing 1.2s cubic-bezier(0.3, 0.7, 0.4, 1) 0.1s both;
  }
  .tag:nth-child(2) {
    animation-delay: 0.22s;
  }
  .tag:nth-child(3) {
    animation-delay: 0.34s;
  }
  .wordmark:hover::before {
    transform-origin: 7px 50%;
    animation: nod 0.9s ease-out;
  }
  @supports (animation-timeline: view()) {
    .ba .phone {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 45%;
    }
    .demo {
      animation: deal linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }
    .demo:nth-child(1) {
      --fr: -8deg;
    }
    .demo:nth-child(3) {
      --fr: 8deg;
    }
  }
}
@keyframes swing {
  0% {
    transform: rotate(calc(var(--r) - 28deg));
  }
  25% {
    transform: rotate(calc(var(--r) + 12deg));
  }
  50% {
    transform: rotate(calc(var(--r) - 6deg));
  }
  72% {
    transform: rotate(calc(var(--r) + 3deg));
  }
  100% {
    transform: rotate(var(--r));
  }
}
@keyframes nod {
  30% {
    transform: rotate(-16deg);
  }
  60% {
    transform: rotate(8deg);
  }
  80% {
    transform: rotate(-3deg);
  }
}
@keyframes rise {
  from {
    opacity: 0.2;
    transform: translateY(70px) rotate(-8deg) scale(0.88);
  }
}
@keyframes deal {
  from {
    opacity: 0;
    transform: translateY(90px) rotate(var(--fr, 3deg));
  }
}

@media (min-width: 720px) {
  .for-trade ul {
    display: flex;
    flex-wrap: wrap;
  }
  .for-trade .btn {
    width: auto;
  }
  .ask .btn {
    width: auto;
    justify-self: start;
  }
  .promises {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 48px;
  }
  .ba {
    width: 290px;
  }
}
@media (min-width: 960px) {
  /* Words and the form on the left, the deck on the right, staying in view */
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-rows: repeat(7, auto) 1fr;
    grid-auto-flow: row dense;
    column-gap: 48px;
  }
  .hero > * {
    grid-column: 1;
  }
  .hero > .deck {
    position: sticky;
    top: 24px;
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
    margin: 0;
  }
  .hero > p:not([class]) {
    font-size: 1.1875rem;
  }
  .tag {
    padding: 10px 16px 12px 30px;
  }
  .tag b {
    font-size: 2.5rem;
  }
  .tag span {
    font-size: 1.0625rem;
  }
  .ba-sec .wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
  }
  .ba-fig {
    margin: 0;
  }
  .who .wrap {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 40px;
  }
}
