/* Invite a writer: the invites left, what earns more, the form and the ones sent. */
.invites__earning { margin: 1rem 0 0; padding: 0; list-style: none; color: var(--sheet-soft); }
.invites__earning li + li { margin-top: 0.3rem; }
.invites__earned { color: inherit; }
.invites__form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-top: 1.25rem; }
.invites__form .flash { flex: 1 1 100%; margin: 0; }
.invites__form input[type="email"] { flex: 1 1 16rem; }
.invites__section { margin: 2rem 0 0.5rem; font-size: 1rem; }

/* The trial's end on the desk, a slip like the note to self (moments.css), said once and quietly. */
.trial { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1rem; margin: 0 auto 1.5rem; }
.trial__note { rotate: 0.8deg; }

/* The golden ticket (screenplays/_golden_ticket on the desk, large on Invite a writer): gold foil stock with a
   half-moon notch each side and a stub past a perforation. The notches are a mask on the stock, so the shadow is a
   drop-shadow on the ticket around it. The foil's glint crosses once on hover and settles. */
.golden-ticket {
  --foil-ink: #4a2f07;
  --foil-line: rgb(90 58 10 / 0.55);
  --notch: 0.6rem;
  display: inline-block;
  color: var(--foil-ink);
  text-decoration: none;
  filter: drop-shadow(0 3px 2px rgb(0 0 0 / 0.45)) drop-shadow(0 10px 14px rgb(0 0 0 / 0.35));
  rotate: -2.5deg;
  transition: rotate 0.25s ease, translate 0.25s ease;
}
a.golden-ticket:hover, a.golden-ticket:focus-visible { rotate: -1deg; translate: 0 -3px; color: var(--foil-ink); }
a.golden-ticket:focus-visible { outline: none; }
a.golden-ticket:focus-visible .golden-ticket__stock { outline: 2px solid var(--chrome); outline-offset: 3px; }

.golden-ticket__stock {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  background:
    repeating-linear-gradient(115deg, rgb(255 255 255 / 0.05) 0 2px, transparent 2px 5px),
    linear-gradient(115deg, #b07f25 0%, #f3d27a 22%, #d6a540 42%, #fbe6a0 58%, #c3902f 78%, #e9c264 100%);
  border-radius: 4px;
  mask:
    radial-gradient(circle var(--notch) at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
/* The engraved border, inset inside the notches. */
.golden-ticket__stock::before {
  content: "";
  position: absolute;
  inset: 5px calc(var(--notch) + 4px);
  border: 1px solid var(--foil-line);
  outline: 1px dashed rgb(90 58 10 / 0.35);
  outline-offset: -4px;
  border-radius: 2px;
  pointer-events: none;
}
/* The glint: off to the left until hovered, then across once. */
.golden-ticket__stock::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgb(255 250 225 / 0.75) 50%, transparent 65%);
  translate: -110% 0;
  pointer-events: none;
}
a.golden-ticket:hover .golden-ticket__stock::after { translate: 110% 0; transition: translate 0.7s ease-out; }

.golden-ticket__face {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.7rem 1rem 0.75rem calc(var(--notch) + 1rem);
  text-align: center;
}
.golden-ticket__admit { margin: 0; font: 700 0.62rem/1 var(--font-typed); letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.8; }
.golden-ticket__words { margin: 0; font: 700 1.02rem/1.15 var(--font-typed); letter-spacing: 0.02em; text-shadow: 0 1px 0 rgb(255 245 200 / 0.6); }
.golden-ticket__free { margin: 0; font: 1.05rem/1.1 var(--font-hand); color: #7a2414; rotate: -3deg; }

.golden-ticket__stub {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 3.6rem;
  padding: 0.5rem calc(var(--notch) + 0.6rem) 0.5rem 0.6rem;
  border-left: 2px dotted rgb(90 58 10 / 0.5);
  background: linear-gradient(rgb(120 80 10 / 0.08), rgb(120 80 10 / 0.08));
}
.golden-ticket__count { font: 700 1.6rem/1 var(--font-typed); }
.golden-ticket__left { font: 700 0.6rem/1.1 var(--font-typed); letter-spacing: 0.12em; text-transform: uppercase; text-align: center; opacity: 0.8; }

@media (prefers-reduced-motion: reduce) {
  .desk-header .golden-ticket { animation: none; }
  .golden-ticket, a.golden-ticket:hover .golden-ticket__stock::after { transition: none; }
  a.golden-ticket:hover .golden-ticket__stock::after { translate: -110% 0; }
}

/* In the desk's header before New script (it's there only while Scrawl's invite-only): one line and the stub, about a button's height, pulsing twice as the
   desk opens to be seen, then still. */
.desk-header .golden-ticket { flex: none; --notch: 0.4rem; margin-right: 0.75rem; rotate: -2deg; animation: golden-ticket-pulse 0.9s ease-in-out 0.5s 2; }
.lights-up .desk-header .golden-ticket { animation-delay: 2.4s; }
.desk-header .golden-ticket__stock::before { inset: 3px calc(var(--notch) + 3px); outline: 0; }
.desk-header .golden-ticket__face { gap: 0; padding: 0.3rem 0.6rem 0.3rem calc(var(--notch) + 0.6rem); }
.desk-header .golden-ticket__admit { display: none; }
.desk-header .golden-ticket__words { font-size: 0.82rem; }
.desk-header .golden-ticket__free { font-size: 0.85rem; line-height: 1; }
.desk-header .golden-ticket__stub { min-width: 2.6rem; padding: 0.2rem calc(var(--notch) + 0.4rem) 0.2rem 0.4rem; }
.desk-header .golden-ticket__count { font-size: 1.15rem; }
.desk-header .golden-ticket__left { font-size: 0.5rem; }
.desk-header .golden-ticket__left--more { font-size: 0.68rem; line-height: 1.05; opacity: 1; }

@keyframes golden-ticket-pulse {
  0%, 100% { scale: 1; }
  45% { scale: 1.08; filter: drop-shadow(0 0 10px rgb(251 230 160 / 0.7)) drop-shadow(0 10px 14px rgb(0 0 0 / 0.35)); }
}

.golden-ticket__short { display: none; }
/* Smaller screens get the short ticket, Invite a writer, on two lines. */
@media (width < 46rem) {
  .desk-header .golden-ticket { margin-right: 0.25rem; }
  .desk-header .golden-ticket__long { display: none; }
  .desk-header .golden-ticket__short { display: block; width: 5.2em; }
  .desk-header .golden-ticket__words { font-size: 0.72rem; line-height: 1.1; }
  .desk-header .golden-ticket__free { font-size: 0.75rem; }
  .desk-header .golden-ticket__face { padding-inline: 0.4rem; padding-left: calc(var(--notch) + 0.4rem); }
  .desk-header .golden-ticket__stub { min-width: 2.2rem; }
}

/* Invite a writer: the ticket large, the form written on its face. */
.golden-ticket--large { --notch: 1.4rem; width: min(52rem, 100%); rotate: -1.2deg; margin-top: 1rem; }
.golden-ticket--large .golden-ticket__stock::before { inset: 9px calc(var(--notch) + 6px); outline-offset: -6px; }
.golden-ticket--large .golden-ticket__face { gap: 0.35rem; padding: 1.75rem 1.5rem 1.6rem calc(var(--notch) + 1.75rem); }
.golden-ticket--large .golden-ticket__admit { font-size: 0.8rem; }
.golden-ticket--large .golden-ticket__words { font-size: clamp(1.4rem, 3.4vw, 2.1rem); }
.golden-ticket--large .golden-ticket__free { font-size: 1.35rem; margin-bottom: 0.4rem; }
.golden-ticket--large .golden-ticket__stub { min-width: 7rem; padding-inline: 1rem calc(var(--notch) + 1rem); border-left-width: 3px; }
.golden-ticket--large .golden-ticket__count { font-size: 3.25rem; }
.golden-ticket--large .golden-ticket__left { font-size: 0.72rem; }
.golden-ticket--spent .golden-ticket__stock { filter: saturate(0.35) brightness(0.92); }

.golden-ticket .invites__form { justify-content: center; margin-top: 0.25rem; width: min(30rem, 100%); }
.golden-ticket .invites__form label { font: 700 0.85rem var(--font-typed); letter-spacing: 0.14em; text-transform: uppercase; }
.golden-ticket .invites__form input[type="email"] {
  flex: 1 1 12rem;
  border: 0;
  border-bottom: 2px solid var(--foil-line);
  border-radius: 0;
  background: rgb(255 250 230 / 0.45);
  color: var(--foil-ink);
  font: 1.25rem var(--font-hand);
}
.golden-ticket .invites__form input[type="email"]::placeholder { color: rgb(74 47 7 / 0.55); }
.golden-ticket .invites__form .button { background: var(--foil-ink); color: #fbe6a0; }

.golden-ticket__more { margin: 0.25rem 0 0; max-width: 30rem; font-size: 1rem; }
.golden-ticket__more a { color: var(--foil-ink); font-weight: 700; }

.invites__section--first { margin-top: 0; }
.invites__section + .invites__earning { margin-top: 0; }
.invites__reasons { display: grid; gap: 0.7rem; margin: 0.5rem 0 0; padding: 0; list-style: none; color: var(--sheet-soft); }
.invites__reasons li { padding-left: 1.6rem; position: relative; }
.invites__reasons li::before { content: "★"; position: absolute; left: 0; color: #b8862b; }
.invites__reasons strong { color: var(--sheet-ink); }
.invites__how { margin-top: 0.75rem; }

@media (max-width: 40rem) {
  .golden-ticket--large { --notch: 0.9rem; rotate: 0deg; }
  .golden-ticket--large .golden-ticket__face { padding: 1.25rem 0.75rem 1.25rem calc(var(--notch) + 0.75rem); }
  /* The stub tears off the bottom instead, its notches at the perforation's ends. */
  .golden-ticket--large .golden-ticket__stock {
    grid-template-columns: minmax(0, 1fr);
    mask:
      radial-gradient(circle var(--notch) at 0 calc(100% - 3.4rem), transparent 98%, #000) left / 51% 100% no-repeat,
      radial-gradient(circle var(--notch) at 100% calc(100% - 3.4rem), transparent 98%, #000) right / 51% 100% no-repeat;
  }
  .golden-ticket--large .golden-ticket__face { padding: 1.4rem 1.25rem 1.1rem; }
  .golden-ticket--large .golden-ticket__stub {
    display: flex; align-items: baseline; justify-content: center; gap: 0.6rem;
    height: 3.4rem; padding: 0; border-left: 0; border-top: 3px dotted rgb(90 58 10 / 0.5);
  }
  .golden-ticket--large .golden-ticket__count { font-size: 2rem; line-height: 3.2rem; }
  .golden-ticket--large .golden-ticket__words { font-size: 1.35rem; }
  .golden-ticket--large .golden-ticket__free { font-size: 1.2rem; }
}
