/* invite.html. The ticket is the invite: the code resolves onto it character
   by character, its seats are the code's real seats, and it gets stamped when
   Gleam takes it or when it's full. */

.i-hero { position: relative; overflow: hidden; isolation: isolate; }

.i-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 75% 50%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 75% 50%, #000, transparent 75%);
}

.i-hero-in { display: grid; gap: 40px; padding-top: clamp(28px, 7vh, 88px); padding-bottom: 32px; }

.i-stack.beam { width: 120px; height: 10px; flex-direction: column; margin: 0 0 28px; }
.i-title { font-size: clamp(3.25rem, 13vw, 8rem); line-height: .92; letter-spacing: -0.06em; }
.i-hero .line { max-width: 28em; }
.i-cta { margin: 32px 0 0; }
.i-cta.i-open-app { margin-top: 16px; }
/* Second to Get Gleam: the same size, without the fill */
.ink .i-cta .button-quiet { background: transparent; color: var(--on-ink); }
.ink .i-cta .button-quiet:hover { background: rgba(255, 255, 255, .08); }
/* A tap leaves :hover stuck on a phone, which read as a pressed button */
@media (hover: none) {
  .ink .i-cta .button:hover { background: var(--on-ink); transform: none; }
  .ink .i-cta .button-quiet:hover { background: transparent; }
}
.ink .i-bonus { margin: 24px 0 0; color: var(--on-ink); font-weight: 600; }
.i-hero .invite-sub { margin-top: 36px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.03em; }
.i-hero .small strong { color: var(--on-ink); font-family: var(--mono); letter-spacing: .04em; }
.i-notfound { color: var(--beam-red) !important; font-weight: 600; }
/* pages.js still fills these for the ticket to read (the code, the seats),
   but the ticket shows both, so the page doesn't repeat them */
.i-hero [data-invite-code], .i-hero [data-seats] { display: none !important; }

.i-hero .invite-meta { margin: 0; padding-bottom: clamp(40px, 8vh, 80px); }
.i-hero .vision-count { border-color: var(--ink-line); background: var(--ink-2); color: var(--on-ink-muted); }
.i-hero .vision-count strong { color: var(--on-ink); font-family: var(--mono); }

/* The ticket */

.ticket {
  --notch: 14px;
  position: relative;
  isolation: isolate;
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 26px 26px 34px;
  border-radius: 18px;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .7));
  transform: rotate(-3deg);
}

/* Only the card is notched, so the stamp and the burst can spill past it */
.ticket::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(160deg, #1B1B1B, #0F0F0F 60%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  -webkit-mask: radial-gradient(circle var(--notch) at 0 62%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--notch) at 100% 62%, transparent 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle var(--notch) at 0 62%, transparent 98%, #000) left / 51% 100% no-repeat,
        radial-gradient(circle var(--notch) at 100% 62%, transparent 98%, #000) right / 51% 100% no-repeat;
}
html:not(.js) .ticket { display: none; }

/* A ticket with a code on it copies the code when tapped */
.ticket[role="button"] { cursor: pointer; transition: translate .25s var(--ease-out); -webkit-tap-highlight-color: transparent; }
.ticket[role="button"]:hover { translate: 0 -4px; }
.ticket[role="button"]:active { translate: 0 1px; transition-duration: .08s; }
.ticket[role="button"]:focus-visible { outline: 2px solid var(--beam-sky); outline-offset: 6px; }
.ticket.nudge { animation: tk-nudge .7s .15s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes tk-nudge { 40% { translate: 0 -8px; } }

.ticket-top { display: flex; align-items: center; justify-content: space-between; }
.ticket-kicker { font: 600 .75rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--on-ink-muted); }
.ticket-mark img { display: block; }

.ticket-code {
  display: flex;
  flex-wrap: wrap;
  gap: .08em;
  min-height: 1.2em;
  margin: 36px 0 30px;
  font: 700 clamp(2rem, 9.5vw, 3.75rem)/1.2 var(--mono);
  letter-spacing: .02em;
  color: var(--on-ink);
}
.ticket-code span { display: inline-block; min-width: .62em; text-align: center; }
.ticket-code span.spin { color: var(--on-ink-muted); opacity: .6; }
.ticket-code span.lock { animation: tk-lock .38s cubic-bezier(.2, .8, .2, 1); }
.ticket-code.empty span { color: #3A3A3A; }
.ticket-code.void { text-decoration: line-through 3px var(--beam-red); }

@keyframes tk-lock {
  0% { color: var(--hit); transform: translateY(-.25em) scale(1.25); text-shadow: -.05em 0 var(--beam-red), .05em 0 var(--beam-sky); }
  60% { color: var(--hit); transform: none; text-shadow: none; }
  100% { color: var(--on-ink); }
}

/* Above the notch line: a perforation, then the seats */
.ticket-seats { display: flex; flex-wrap: wrap; gap: 10px; min-height: 22px; padding-top: 22px; border-top: 2px dashed rgba(255, 255, 255, .12); }
/* No seats to show (a drop code, or no answer yet): the ticket ends at the code */
.ticket-seats:empty { display: none; }
.ticket:has(.ticket-seats:empty) .ticket-code { margin-bottom: 8px; }
.ticket-seats i { position: relative; width: 22px; height: 22px; border-radius: 6px 6px 3px 3px; border: 2px solid #3A3A3A; }
.ticket-seats i::after { content: ""; position: absolute; left: 3px; right: 3px; bottom: -6px; height: 3px; border-radius: 2px; background: #3A3A3A; }
.ticket-seats i.open { border-color: var(--c); box-shadow: 0 0 14px -2px var(--c); }
.ticket-seats i.open::after { background: var(--c); }
.ticket-seats i.open { animation: tk-seat .5s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: calc(var(--i) * 90ms + .2s); }
@keyframes tk-seat { from { transform: scale(0); } }

.ticket-beam { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; height: 10px; overflow: hidden; border-radius: 0 0 18px 18px; }
.ticket-beam span { flex: 1; }
.ticket-beam span:nth-child(1) { background: var(--beam-red); }
.ticket-beam span:nth-child(2) { background: var(--beam-purple); }
.ticket-beam span:nth-child(3) { background: var(--beam-sky); }
.ticket-beam span:nth-child(4) { background: var(--beam-yellow); }
.ticket-beam span:nth-child(5) { background: var(--beam-green); }

.ticket-stamp {
  position: absolute;
  right: 18px;
  top: 58px;
  padding: 6px 12px;
  border: 3px solid currentColor;
  border-radius: 8px;
  font: 800 1.125rem/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--beam-green);
  opacity: 0;
  transform: rotate(-12deg);
  pointer-events: none;
}
.ticket-stamp:empty { display: none; }
.ticket.stamped .ticket-stamp { opacity: 1; animation: tk-stamp .5s cubic-bezier(.2, 1.4, .4, 1); }
.ticket[data-look="full"] .ticket-stamp, .ticket[data-look="void"] .ticket-stamp { color: var(--beam-red); }
.ticket[data-look="full"], .ticket[data-look="void"] { filter: saturate(.4); }
.ticket[data-look="empty"] .ticket-beam { opacity: .35; }

@keyframes tk-stamp {
  0% { opacity: 0; transform: rotate(-24deg) scale(2.6); }
  60% { opacity: 1; transform: rotate(-10deg) scale(.92); }
  100% { transform: rotate(-12deg) scale(1); }
}

/* Gleam took the code: a shockwave off the ticket */
.ticket::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 2px var(--beam-green);
  opacity: 0;
  pointer-events: none;
}
.ticket.burst::after { animation: tk-burst .8s ease-out; }
@keyframes tk-burst { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.18); } }

/* Phone: copy, ticket, button in one column, kept close */
@media (max-width: 899px) {
  .i-hero-in { gap: 28px; padding-bottom: 16px; }
  .i-cta { margin-top: 16px; }
  .i-cta .button { display: flex; width: 100%; justify-content: center; }
  /* Inside the side margins even with the tilt */
  .ticket { width: min(92%, 420px); }
  /* The meta row holds only the drop countdown now, so it keeps little room */
  .i-hero .invite-meta { padding-bottom: 24px; }
}

@media (min-width: 900px) {
  /* Sized to its content: the promise on the left, the invite level with it
     on the right */
  .i-hero-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 56px; row-gap: 0; align-items: start; padding-top: clamp(48px, 9vh, 112px); }
  .i-copy { grid-column: 1; grid-row: 1; }
  .i-states { grid-column: 1; grid-row: 2; }
  .ticket { grid-column: 2; grid-row: 1; align-self: center; width: min(100%, 500px); margin-right: 0; transform: rotate(-5deg); }
}

/* Below the cut */

.i-band { padding: clamp(40px, 7vh, 80px) 0 clamp(48px, 8vh, 96px); background: var(--paper); color: var(--fg); }
/* Spaced, not ruled: the two facts need no lines between them */
.i .invite-facts { display: grid; gap: clamp(36px, 6vh, 56px); margin-top: 0; max-width: none; }
.i .invite-facts li { padding: 0; border: 0; font-size: clamp(1.125rem, 2.2vw, 1.625rem); line-height: 1.3; letter-spacing: -0.015em; }
.i .invite-facts strong { display: block; margin-bottom: 8px; font-size: clamp(2rem, 6vw, 3.75rem); line-height: 1; letter-spacing: -0.045em; }

/* The close: the beam runs in from off the left edge and points at GLEAM.
   The word is the link to gleam.html, and tapping it launches the beam off
   the right edge so gleam.html can open on it arriving from the left. */

.i-cut { background: linear-gradient(var(--paper) calc(100% - 3px), var(--ink) calc(100% - 3px)); }

.i-launch { position: relative; overflow: hidden; padding: clamp(72px, 11vw, 150px) 0 clamp(88px, 13vw, 170px); }
.i-launch-sparks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
html:not(.motion) .i-launch-sparks { display: none; }

.i-launch-link { display: flex; align-items: center; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.i-launch-link:focus-visible { outline: none; }
.i-launch-link:focus-visible .i-launch-word { outline: 2px solid var(--beam-sky); outline-offset: 10px; border-radius: 8px; }

.i-launch-beam,
.i-launch-streak { display: flex; flex-direction: column; height: 10px; }
.i-launch-beam { position: relative; flex: 1; min-width: 40px; margin-left: calc(50% - 50vw); }
.i-launch-beam span,
.i-launch-streak span { flex: 1; }
.i-launch-beam span:nth-child(1), .i-launch-streak span:nth-child(1) { background: var(--beam-red); }
.i-launch-beam span:nth-child(2), .i-launch-streak span:nth-child(2) { background: var(--beam-purple); }
.i-launch-beam span:nth-child(3), .i-launch-streak span:nth-child(3) { background: var(--beam-sky); }
.i-launch-beam span:nth-child(4), .i-launch-streak span:nth-child(4) { background: var(--beam-yellow); }
.i-launch-beam span:nth-child(5), .i-launch-streak span:nth-child(5) { background: var(--beam-green); }

/* A point riding the beam into the word: gleam.html's gate pulse */
.i-launch-beam i {
  position: absolute;
  top: 50%;
  left: 0;
  width: 160px;
  height: 4px;
  margin: -2px 0 0 -160px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #fff);
  box-shadow: 0 0 14px 2px rgba(255, 255, 255, .5);
  opacity: 0;
}

.i-launch-tip { flex: none; width: 26px; height: 34px; margin-left: -23px; }
.i-launch-tip svg { display: block; width: 100%; height: 100%; overflow: visible; }


.i-launch-word {
  display: block;
  margin-left: clamp(10px, 1.5vw, 22px);
  padding: .05em .08em .05em .02em;
  font-size: clamp(76px, 21vw, 280px);
  font-weight: 900;
  line-height: .8;
  letter-spacing: -0.065em;
  white-space: nowrap;
}
.i-launch-word i { font-style: normal; }
/* Each letter clips its own glint, so the wave can scale the letter around it.
   The glint crosses them one after another, so it still reads as one sweep. */
.i-launch-word b {
  /* The tight tracking pulls each glyph past its box, and the clipped glint
     only paints inside the box: widen it, and give the room back */
  padding: 0 .12em;
  margin: 0 -.12em;
  font-weight: inherit;
  background: linear-gradient(100deg,
      var(--on-ink) 38%,
      color-mix(in oklab, var(--beam-purple) 18%, var(--on-ink)) 44%,
      #fff 48%, #fff 52%,
      color-mix(in oklab, var(--beam-sky) 20%, var(--on-ink)) 56%,
      var(--on-ink) 62%) 100% 0 / 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html:not(.js) .i-launch-word b { background: none; color: var(--on-ink); }
.i-launch-word.glint b { animation: il-glint .7s calc(var(--n, 0) * 80ms) ease-in-out both; }
@keyframes il-glint { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Wind-up: a wave of size runs through the letters, G to M, the way the
   beam is about to go */
.i-launch-word i { display: inline-block; transform-origin: 50% 90%; }
.i-launch-word i:nth-child(2) { --n: 1; }
.i-launch-word i:nth-child(3) { --n: 2; }
.i-launch-word i:nth-child(4) { --n: 3; }
.i-launch-word i:nth-child(5) { --n: 4; }
.i-launch-link.armed .i-launch-word i { animation: il-wave 1.4s calc(var(--n, 0) * 90ms) cubic-bezier(.4, 0, .3, 1) infinite; }
@keyframes il-wave {
  0%, 45%, 100% { scale: 1; }
  18% { scale: 1.06; }
}
/* The swelling letter takes its beam colour, G to M in beam order, the way
   gleam.html lights GLEAM */
.i-launch-word i:nth-child(1) { --c: var(--beam-red); }
.i-launch-word i:nth-child(2) { --c: var(--beam-purple); }
.i-launch-word i:nth-child(3) { --c: var(--beam-sky); }
.i-launch-word i:nth-child(4) { --c: var(--beam-yellow); }
.i-launch-word i:nth-child(5) { --c: var(--beam-green); }
.i-launch-link.armed .i-launch-word b { animation: il-tint 1.4s calc(var(--n, 0) * 90ms) cubic-bezier(.4, 0, .3, 1) infinite; }
@keyframes il-tint {
  0%, 50%, 100% { color: transparent; }
  18% { color: var(--c); }
}
.i-launch-link.armed .i-launch-beam,
.i-launch-link.armed .i-launch-tip { filter: drop-shadow(0 0 8px rgba(115, 201, 232, .7)); }

.i-launch-streak {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, .5));
}
.i-launch-black { position: fixed; inset: 0; z-index: 50; background: var(--ink); opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .ticket-code span.lock, .ticket-seats i.open, .ticket.stamped .ticket-stamp, .ticket.burst::after, .ticket.nudge { animation: none; }
  .i-launch-word b, .i-launch-word i, .i-launch-link.armed .i-launch-word i, .i-launch-link.armed .i-launch-word b { animation: none; }
}

/* Leaving for gleam.html: the browser holds this page until that one paints,
   so the black after the launch runs straight into the gate */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
