/*
 * The made-for-you page (made-for-you.html), on top of styles.css. It shows the work, not the app.
 * The memorable thing: an idea someone sent, and a spectrum line running from it into the film it became.
 * Everything else is the home page's parts, kept quiet.
 */

.sprite {
  position: absolute;
}

/* Hero: the offer in words, then the first idea and its film. */

.made-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: clamp(120px, 16vh, 168px) var(--gutter) 0;
  text-align: center;
}

.made-hero h1 {
  max-width: 1180px;
  font-size: clamp(40px, 6vw, 88px);
}

.made-lede {
  max-width: 620px;
  margin-top: 22px;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.42;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.made-hero .actions {
  margin-top: 30px;
}

.idea-to-film {
  width: 100%;
  margin: clamp(56px, 7vw, 96px) 0 0;
}

.idea {
  position: relative;
  max-width: 760px;
  margin: 0 auto 56px;
  padding: 18px 24px 20px;
  border-radius: 24px;
  background: var(--surface-2);
  text-align: left;
}

/* The line from the idea into the film. */
.idea::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  height: 56px;
  border-radius: 2px;
  background: linear-gradient(var(--pink), var(--yellow) 40%, var(--mint) 72%, var(--blue));
  transform: translateX(-50%);
}

.idea-who {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.idea p {
  margin-top: 4px;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.38;
  letter-spacing: -0.012em;
}

.film-says {
  max-width: 680px;
  margin: 18px auto 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}

.film-says strong {
  font-weight: 500;
  color: var(--ink);
}

/* A film: its still until someone presses play, then the film in the same place. Nothing loads before that. */

.film {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: clamp(14px, 1.8vw, 24px);
  background: #000;
}

.is-tall .film {
  aspect-ratio: 9 / 16;
}

.film img,
.film video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film video {
  object-fit: contain;
  background: #000;
}

.film-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.film .play-disc {
  width: clamp(56px, 6vw, 80px);
  height: clamp(56px, 6vw, 80px);
}

.film-play:hover .play-disc {
  transform: scale(1.06);
}

.film-play:focus-visible {
  outline-offset: -4px;
}

/* Work: each idea beside what it became. */

.work {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: var(--section) var(--gutter) 0;
}

.work h2 {
  max-width: 760px;
  margin-bottom: clamp(40px, 5vw, 72px);
}

.pair {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}

.pair + .pair-tall,
.pair-tall + .pair {
  margin-top: clamp(56px, 7vw, 104px);
}

.pair.is-flipped {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.pair.is-flipped .pair-say {
  order: 1;
}

.pair-say h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.pair-idea {
  margin-top: 10px;
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 500;
  letter-spacing: -0.028em;
  line-height: 1.18;
  text-wrap: pretty;
}

.pair-meta {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.pair-tall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
}

.pair.is-tall {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 2.4vw, 32px);
  align-items: end;
}

.is-tall .pair-idea {
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.22;
}

.work-note {
  margin-top: 40px;
  font-size: 13px;
  color: var(--muted);
}

/* How it works: three steps, in order. */

.how {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: var(--section) var(--gutter) 0;
}

.how h2 {
  margin-bottom: clamp(32px, 4vw, 56px);
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 48px);
}

.how-steps li {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.how-n {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 15px;
  font-weight: 600;
}

.how-steps h3 {
  margin-top: 18px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.how-steps p {
  max-width: 36ch;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.48;
}

/* Price and the form: the page turns white, as the home page does for pricing. */

.order {
  --ink: #000000;
  --muted: #6b6b6b;
  --line: rgba(0, 0, 0, 0.12);
  --surface-2: rgba(0, 0, 0, 0.055);
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
  margin: var(--section) 12px 0;
  padding: clamp(48px, 7vw, 104px) max(clamp(16px, 5vw, 80px), calc((100% - 1240px) / 2));
  border-radius: 32px;
  background: #fff;
  color: var(--ink);
  scroll-margin-top: 76px;
}

.order :focus-visible {
  outline-color: #000;
}

.order-lede {
  max-width: 50ch;
  margin-top: 18px;
  font-size: clamp(17px, 1.45vw, 19px);
  line-height: 1.45;
  color: var(--muted);
}

.order-list {
  margin-top: 30px;
}

.order-list li {
  font-size: 16px;
}

.order-list svg {
  color: #047a5c;
}

/* The one black thing on the white: the form. */
.brief {
  --ink: #ffffff;
  --muted: #a3a3a3;
  --line: rgba(255, 255, 255, 0.14);
  --surface-2: rgba(255, 255, 255, 0.09);
  padding: clamp(24px, 2.6vw, 36px);
  border-radius: 28px;
  background: #000;
  color: #fff;
  scroll-margin-top: 88px;
}

.brief :focus-visible {
  outline-color: #fff;
}

.brief h3 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.brief-form {
  display: grid;
  gap: 16px;
}

.brief-form[hidden] {
  display: none;
}

.brief-form h3 {
  margin-bottom: 4px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field > span,
.field legend {
  padding: 0;
  font-size: 13px;
  color: var(--muted);
}

.field legend {
  margin-bottom: 6px;
}

.field em {
  font-style: normal;
  opacity: 0.7;
}

.field input,
.field textarea {
  width: 100%;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: #fff;
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s linear;
}

.field input {
  height: 48px;
}

.field textarea {
  padding-top: 12px;
  padding-bottom: 12px;
  line-height: 1.42;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(255, 255, 255, 0.6);
  outline: none;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--pink);
}

/* Browsers paint autofilled fields their own colour. Keep ours. */
.field input:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 40px #1a1a1a inset;
  caret-color: #fff;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* How long: one choice, as capsules. */
.lengths {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lengths label {
  position: relative;
}

.lengths input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.lengths span {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  transition: background-color 0.2s linear, color 0.2s linear;
}

.lengths label:hover span {
  background: rgba(255, 255, 255, 0.16);
}

.lengths input:checked + span {
  background: #fff;
  color: #000;
}

.lengths input:focus-visible + span {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.brief-error {
  font-size: 14px;
  line-height: 1.4;
  color: #ff8fa8;
}

.brief-error[hidden] {
  display: none;
}

.brief-send {
  width: 100%;
  margin-top: 4px;
}

.brief-send[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.brief-note {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.brief-sent {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 8px 0;
}

.brief-sent[hidden] {
  display: none;
}

.brief-sent:focus {
  outline: none;
}

.brief-sent p {
  color: var(--muted);
}

.brief-sent strong {
  font-weight: 500;
  color: #fff;
}

.sent-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--mint);
  color: #000;
  animation: sent-in 0.42s var(--spring);
}

.sent-mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes sent-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

.made .foot-note a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Smaller screens. */

@media (max-width: 1080px) {
  .order {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .pair,
  .pair.is-flipped {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .pair .film {
    order: -1;
  }

  .pair.is-flipped .pair-say {
    order: 0;
  }

  .pair-tall {
    gap: 24px;
  }

  .pair.is-tall {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .how-steps p {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .made-hero .actions {
    flex-direction: column;
    align-items: stretch;
    width: min(320px, 100%);
  }

  .idea {
    margin-bottom: 40px;
    padding: 16px 18px 18px;
  }

  .idea::after {
    height: 40px;
  }

  .film-says {
    text-align: left;
  }

  /* Two tall films side by side would be too narrow, so each takes the width, and stays a sensible height. */
  .pair-tall {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }

  .is-tall .film {
    width: min(100%, 300px);
  }

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

  .order {
    margin-inline: 8px;
    border-radius: 24px;
  }

  .brief {
    padding: 20px 18px;
    border-radius: 22px;
  }

  /* On a phone the header keeps the logo and the one button. */
  .made .top-actions .btn {
    padding: 0 14px;
  }
}
