/* ==========================================================================
   GRAND THEFT AMERICA — wordmarks
   --------------------------------------------------------------------------
   Two-line desk marks. The top word names the subject; the second line is a
   compact ink plaque that inherits the parent Grand Theft America mark.
   GRAB is knocked out of the plaque while each desk's material completes it:
   currency courses for Money, institutional bars for Power.

   Money's courses and Power's bars use the SAME thickness and the SAME
   period (--bar-thick / --bar-period). That shared rhythm is what makes the
   two desks read as siblings rather than two logos. Change it in tokens.css
   and both marks move together.
   ========================================================================== */

.wm {
  --wm-paper: var(--gta-paper, #f4f1e9);
  display: inline-grid;
  grid-template-columns: max-content minmax(.9em, 1fr);
  grid-template-rows: auto auto;
  align-items: stretch;
  column-gap: 0;
  row-gap: .065em;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--wm-size, 1rem);
  line-height: .8;
  letter-spacing: -.052em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  isolation: isolate;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* The top word fixes the width; the plaque below optically locks to its edge. */
.wm__top {
  grid-column: 1 / -1;
  grid-row: 1;
  padding-left: .012em;
  white-space: nowrap;
}

.wm__bot {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  padding: .095em .13em .055em .11em;
  background: var(--ink);
  color: var(--wm-paper);
  line-height: .74;
  white-space: nowrap;
}

/* The material field is part of the same plaque, not a decorative suffix. */
.wm__mat {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  min-width: .9em;
  overflow: hidden;
  background: var(--ink);
}

.wm__mat::before {
  content: "";
  position: absolute;
  inset: .12em .12em .105em .035em;
  transform-origin: left center;
}

/* Money — horizontal courses, bills accumulating */
.wm--money .wm__mat::before {
  background: repeating-linear-gradient(
    to bottom,
    var(--gold-bright) 0 var(--bar-thick),
    transparent var(--bar-thick) var(--bar-period)
  );
}

/* Power — vertical bars, columns closing */
.wm--power .wm__mat::before {
  background: repeating-linear-gradient(
    to right,
    var(--red-bright) 0 var(--bar-thick),
    transparent var(--bar-thick) var(--bar-period)
  );
  transform-origin: center top;
}

/* On tracker heroes, the material arrives once and then stays still. */
.trackerTitle.wm--money .wm__mat::before {
  animation: wm-money-build 620ms cubic-bezier(.16, 1, .3, 1) 120ms both;
}

.trackerTitle.wm--power .wm__mat::before {
  animation: wm-power-build 620ms cubic-bezier(.16, 1, .3, 1) 120ms both;
}

@keyframes wm-money-build {
  from { opacity: 0; transform: scaleX(0); }
  to { opacity: 1; transform: scaleX(1); }
}

@keyframes wm-power-build {
  from { opacity: 0; transform: scaleY(0); }
  to { opacity: 1; transform: scaleY(1); }
}

/* --- Grand Theft America ------------------------------------------------
   One related mark, every word at equal scale. Stacked for heroes, inline
   for the masthead. No word is larger than another; the split rule carries
   the thesis instead.
   --------------------------------------------------------------------- */

.wm-gta {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--wm-size, 1rem);
  line-height: .84;
  letter-spacing: -.045em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.wm-gta span { display: block; }
.wm-gta--inline span { display: inline; }
.wm-gta--inline span + span::before { content: " "; }

/* Hero-only master mark. The paper and imagery remain visible through each
   letter; a substantial ink contour supplies the faint GTA-family echo. The
   small masthead mark stays solid because outline type loses clarity there. */
.wm-gta--outline {
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: .052em var(--ink);
  paint-order: stroke fill;
  line-height: .88;
  letter-spacing: -.055em;
  animation: gta-outline-arrive 620ms cubic-bezier(.16,1,.3,1) both;
}

@supports not (-webkit-text-stroke: 1px black) {
  .wm-gta--outline {
    color: var(--ink);
    -webkit-text-fill-color: currentColor;
  }
}

@keyframes gta-outline-arrive {
  from { opacity: 0; transform: translateY(.08em); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .wm-gta--outline,
  .trackerTitle.wm--money .wm__mat::before,
  .trackerTitle.wm--power .wm__mat::before { animation: none; }
}

/* Retained for exported lockups only. Site mastheads use the plain mark. */
.wm-gta__rule {
  display: flex;
  height: var(--bar-thick);
  margin-top: .22em;
}
.wm-gta__rule i { flex: 1; background: var(--gold-bright); }
.wm-gta__rule b { flex: 1; background: var(--red-bright); }

.hero .wm,
.hero .wm-gta { --wm-size: var(--step-4); }

/* Reduced motion and print: the marks are static by design, nothing to do. */
