/* /launch — print a card. The form is the blank card. Measures inside the card are in cqw of the card body. */

.launch {
  padding: 8px 0 40px;
}
.launch__head {
  margin: 6px 0 22px;
}
.launch__title {
  margin: 0;
}
.launch__sub {
  margin: 10px 0 0;
  font-size: clamp(20px, 5.6vw, 34px);
  color: var(--yellow);
}

.launch__bench {
  display: grid;
  gap: 28px;
  align-items: start;
}
.launch__slot {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
}
@media (min-width: 1100px) {
  .launch__bench {
    grid-template-columns: minmax(720px, 800px) minmax(260px, 1fr);
    gap: 56px;
  }
  .launch__slot {
    max-width: none;
    margin: 0;
    transform: rotate(-1.6deg);
  }
  .launch__side {
    padding-top: 28px;
  }
}

/* ── what is printed / typed on the card ─────────────────────────────────── */
.launch__card .card__face {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3.4cqw;
  height: 100%;
  -webkit-user-select: text;
  user-select: text;
}
.launch__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 3cqw;
}
.launch__no {
  font-size: 3.5cqw;
  white-space: nowrap;
}
.launch__buys {
  font-family: var(--f-display);
  font-size: 3.5cqw;
  letter-spacing: 0.03em;
  text-align: right;
  text-transform: uppercase;
}

.launch__id {
  display: flex;
  align-items: center;
  gap: 4cqw;
}
.launch__pic {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 25cqw;
  height: 25cqw;
  min-width: 72px;
  min-height: 72px;
  border-radius: 50%;
  border: 2px dashed var(--ink);
  background-color: var(--cream-2);
  background-image: var(--tex-grain);
  cursor: pointer;
  transform: rotate(-5deg);
}
.launch__pic-hint {
  font-family: var(--f-display);
  font-size: 4cqw;
  line-height: 1;
  text-align: center;
  white-space: pre-line;
  text-transform: uppercase;
}
.launch__pic.has-pic {
  border: 1.3cqw solid var(--core);
  box-shadow: 3px 4px 0 var(--ink), 0 0 0 1px rgba(17, 17, 17, 0.35);
  background: var(--core);
}
.launch__pic-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
#launch-pic:focus-visible + .launch__names,
.launch__pic:focus-within {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.launch__names {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.6cqw;
}
.launch__tick-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.6cqw;
  border-bottom: 2px dashed rgba(17, 17, 17, 0.55);
}
.launch__dollar,
.launch__ticker {
  font-family: var(--f-display);
  font-size: 13cqw;
  line-height: 1;
  color: var(--ink);
}
.launch__ticker,
.launch__name,
.launch__desc {
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  caret-color: var(--orange);
  -webkit-user-select: text;
  user-select: text;
}
.launch__ticker {
  text-transform: uppercase;
  letter-spacing: 0.01em;
  min-height: 44px;
}
.launch__name {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: max(16px, 4.2cqw); /* 16 px keeps iOS from zooming in */
  letter-spacing: 0.02em;
  text-transform: uppercase;
  min-height: 44px;
  border-bottom: 2px dashed rgba(17, 17, 17, 0.55);
}
.launch__ticker::placeholder,
.launch__name::placeholder,
.launch__desc::placeholder {
  color: rgba(17, 17, 17, 0.34);
  opacity: 1;
}
.launch__ticker:focus-visible,
.launch__name:focus-visible,
.launch__desc:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

/* the empty numeral: a fresh card, nothing loaded yet */
.launch__num {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-height: 0;
  font-family: var(--f-display);
  font-size: 44cqw;
  line-height: 0.86;
  color: transparent;
  -webkit-text-stroke: 0.9cqw var(--ink);
  letter-spacing: -0.01em;
  pointer-events: none;
}

.launch__band {
  border-top: 2px solid var(--ink);
  padding-top: 2.4cqw;
}
.launch__desc {
  display: block;
  resize: none;
  font-family: var(--f-mono);
  font-size: max(16px, 3.6cqw);
  line-height: 1.35;
  text-transform: uppercase;
}

/* landscape card: the numeral moves to the right half */
@container card (min-width: 600px) {
  .launch__card .card__face {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    grid-template-rows: auto auto 1fr auto;
    column-gap: 3cqw;
    row-gap: 2.2cqw;
  }
  .launch__top {
    grid-column: 1 / -1;
  }
  .launch__no,
  .launch__buys {
    font-size: 2.1cqw;
  }
  .launch__id {
    grid-column: 1;
    grid-row: 2;
  }
  .launch__pic {
    width: 15cqw;
    height: 15cqw;
  }
  .launch__pic-hint {
    font-size: 2.3cqw;
  }
  .launch__dollar,
  .launch__ticker {
    font-size: 7.4cqw;
  }
  .launch__name {
    font-size: max(16px, 2.3cqw);
  }
  .launch__num {
    grid-column: 2;
    grid-row: 2 / 4;
    font-size: 27cqw;
    -webkit-text-stroke-width: 0.55cqw;
  }
  .launch__band {
    grid-column: 1;
    grid-row: 3 / 5;
    align-self: end;
  }
  .launch__desc {
    font-size: max(16px, 2cqw);
  }
}

/* stamps slam on the card */
.launch__stamps {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 4;
}
.launch__stamp {
  font-size: clamp(22px, 9cqw, 64px);
  transform: rotate(-8deg);
  animation: launch-slam 180ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes launch-slam {
  from {
    transform: rotate(-8deg) scale(1.7);
  }
  to {
    transform: rotate(-8deg) scale(1);
  }
}

/* printing: the card feeds in steps under a print head */
.launch__feed {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2.2cqw;
  background: var(--ink);
  display: none;
  z-index: 3;
}
.launch__card.is-printing .launch__feed {
  display: block;
  animation: launch-head 700ms steps(14) infinite;
}
.launch__card.is-printing {
  animation: launch-jog 240ms steps(2) infinite;
}
@keyframes launch-head {
  from {
    top: 0;
  }
  to {
    top: 100%;
  }
}
@keyframes launch-jog {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .launch__card.is-printing,
  .launch__card.is-printing .launch__feed,
  .launch__stamp {
    animation: none;
  }
}

/* ── next to the card ────────────────────────────────────────────────────── */
.launch__rule {
  margin: 0 0 6px;
  font-size: clamp(23px, 6.4vw, 44px);
}
.launch__action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 22px;
  min-height: 150px;
  margin: 22px 0 14px;
}
.launch__who {
  --rot: 3deg;
}
.launch__printing {
  color: var(--yellow);
  animation: launch-blink 500ms steps(2) infinite;
}
@keyframes launch-blink {
  50% {
    opacity: 0.35;
  }
}
.launch__fine {
  max-width: 44ch;
}
.launch__get {
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
}

/* the description is two printed lines, never a scroll box */
.launch__desc {
  overflow: hidden;
  scrollbar-width: none;
}
.launch__desc::-webkit-scrollbar {
  display: none;
}
