/* Hero and ticker. Depends on tokens.css.
 *
 * The comp is a 1440px artboard, so every measurement in it is absolute. The
 * numbers that carry meaning are kept (card 116, sprite 72, 55% opacity, 72s);
 * the ones that only existed because the artboard was 1440 wide - a 900px
 * hero, 236px of top padding, a 604px field - become minimums and clamps, so
 * the section holds together at 390px too.
 */

/* ---------------------------------------------------------------- ticker */

.pxl-ticker {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* One row above the headline and one below, per the handoff. The comp pins
   them at top:64 and top:728 of a 900px hero; expressed as a spaced pair they
   hold that relationship at any height, which matters because this hero is no
   longer a fixed 900. */
.pxl-ticker__tracks {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 58px 0;
  box-sizing: border-box;
}

.pxl-ticker__row { overflow: hidden; padding: 6px 0; }

.pxl-ticker__track {
  display: flex;
  width: max-content;
  gap: 0;
  animation: pxl-tick var(--duration, 72s) linear infinite;
}
.pxl-ticker__track[data-direction="right"] { animation-direction: reverse; }

/* One pair of keyframes, not two. The comp ships tickL and tickR, which are
   the same motion written twice; `animation-direction: reverse` is the same
   result and leaves one thing to tune. -50% is exactly one pass because the
   track holds the item list exactly twice - see ticker.js. */
@keyframes pxl-tick {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.pxl-ticker__card {
  width: var(--card, 116px);
  margin-right: var(--gap, 20px);
  flex-shrink: 0;
}

.pxl-ticker__frame {
  width: var(--card, 116px);
  height: var(--card, 116px);
  box-sizing: border-box;
  border: 1px solid var(--hairline);
  background: var(--checker);
  background-size: var(--checker-size);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pxl-ticker__frame.is-new { border-color: rgba(47, 125, 246, 0.45); }

/* Pixelated everywhere it is drawn, whether it arrived as a PNG or as a live
   canvas from the model. */
.pxl-ticker__art {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  display: block;
}

.pxl-ticker__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
}
.pxl-ticker__name { font-size: 10px; letter-spacing: 0.1em; color: var(--label); }
.pxl-ticker__note { font-size: 9px; letter-spacing: 0.1em; color: var(--dim); }
.pxl-ticker__name.is-new { color: var(--text); }
.pxl-ticker__note.is-new { color: var(--accent); }

/* The four scrim layers, in order. Each does one job: blur the cards under the
   page edge, fade them into the ground left and right, sit the headline on
   near-solid ground, and keep the rows off the nav and the section below. */
.pxl-ticker__scrim { position: absolute; inset: 0; pointer-events: none; }
.pxl-ticker__scrim > * { position: absolute; }

.pxl-ticker__edge-l,
.pxl-ticker__edge-r {
  top: 0;
  bottom: 0;
  width: clamp(80px, 22vw, 320px);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pxl-ticker__edge-l {
  left: 0;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 22%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 22%, rgba(0,0,0,0) 100%);
}
.pxl-ticker__edge-r {
  right: 0;
  -webkit-mask-image: linear-gradient(to left, #000 0%, #000 22%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to left, #000 0%, #000 22%, rgba(0,0,0,0) 100%);
}

.pxl-ticker__fade-x {
  inset: 0;
  background: linear-gradient(to right,
    var(--ground) 0%, rgba(8,8,10,0) 24%, rgba(8,8,10,0) 76%, var(--ground) 100%);
}
.pxl-ticker__glow {
  inset: 0;
  background: radial-gradient(ellipse 640px 340px at 50% 47%,
    rgba(8,8,10,0.97) 0%, rgba(8,8,10,0.88) 42%, rgba(8,8,10,0) 100%);
}
.pxl-ticker__fade-y {
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(8,8,10,0.6) 0%, rgba(8,8,10,0) 16%, rgba(8,8,10,0) 84%, rgba(8,8,10,0.85) 100%);
}

/* ------------------------------------------------------------------ hero */

.pxl-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* 960, not the comp's 900: the allowance meter under the chips adds a line,
     and at 900 the copy reached up into the top row's card labels and down
     onto the bottom row. Taller than a laptop viewport is fine - the ticker
     is the hero's frame, and a frame the copy overlaps is not one. */
  min-height: 960px;
  padding: 96px var(--gutter);
  box-sizing: border-box;
}

.pxl-hero__inner {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pxl-hero__eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--label);
  min-height: 14px;             /* the live count lands after first paint */
}

.pxl-hero__title {
  margin: 22px 0 0;
  font-family: var(--display);
  font-weight: 700;
  /* 76px at 1440, 38px on a phone - the comp's two fixed sizes, joined up. */
  font-size: clamp(38px, 5.3vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.032em;
  color: var(--text);
  text-wrap: balance;
}

.pxl-hero__body {
  margin: 24px 0 0;
  max-width: 680px;
  font-family: var(--display);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.62;
  color: var(--muted);
}

.pxl-hero__form { margin-top: 38px; width: 100%; }

.pxl-hero__field {
  display: flex;
  width: min(604px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
}
.pxl-hero__field:focus-within { border-color: var(--accent); }

.pxl-hero__input {
  flex-grow: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: 0.01em;
  padding: 0 22px;
  height: 60px;
}
.pxl-hero__input::placeholder { color: var(--dim); }

.pxl-hero__submit {
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 0 clamp(18px, 3vw, 30px);
  height: 60px;
  cursor: pointer;
}
.pxl-hero__submit:hover { color: var(--accent-lift); }

.pxl-hero__tries {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.pxl-hero__try-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--dim);
  margin-right: 2px;
}
.pxl-hero__chip {
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--hairline);
  background: transparent;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.pxl-hero__chip:hover {
  border-color: rgba(255, 255, 255, 0.34);
  color: var(--text);
}

/* Phone: one row of sprites, per the handoff. The second is hidden rather
   than not built, so the same markup serves both widths. */
@media (max-width: 760px) {
  /* Copy starts below the single ticker row instead of being centred: with
     the allowance meter the copy is taller than the space between the row and
     the fold, and centring pushed the eyebrow up onto the card labels. */
  .pxl-hero { padding: 196px var(--gutter) 64px; min-height: 0; justify-content: flex-start; }
  .pxl-ticker__row:nth-child(n + 2) { display: none; }
  /* With one row, space-between puts it at the top, and at 390px the hero's
     copy reaches further up - the card labels ended up sitting on the eyebrow.
     Less padding lifts the row clear rather than shrinking the text. */
  .pxl-ticker__tracks { padding: 30px 0; }
  .pxl-hero__input { font-size: 17px; padding: 0 16px; }
  /* Tighter rhythm, and the try-chips on one swipeable row instead of two,
     so the allowance meter lands above the fold on a 390 x 844 phone. */
  .pxl-hero__body { margin-top: 18px; }
  .pxl-hero__form { margin-top: 26px; }
  .pxl-hero__tries {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    /* Stretched, not centred: a centred flex child wider than its parent
       overflows both edges, and the row opened scrolled past its own label. */
    align-self: stretch;
    margin: 16px calc(var(--gutter) * -1) 0;
    padding: 0 var(--gutter);
    -webkit-overflow-scrolling: touch;
  }
  .pxl-hero__tries::-webkit-scrollbar { display: none; }
  .pxl-hero__chip { flex: none; height: 40px; }
}

/* DESIGN.md: "Honour prefers-reduced-motion when you build this for real - the
   ticker should hold still. The design does not depend on the movement."
   Holding still, not hiding: the cards are half the hero's composition. */
@media (prefers-reduced-motion: reduce) {
  .pxl-ticker__track { animation: none; }
}

/* Busy is a label, not a lock - the click is queued, so the control stays
   live and only reads as pending. */
.pxl-hero__form[data-busy="true"] .pxl-hero__submit { color: var(--dim); }
