/* GrowthMotif v4 — module "type" (paper look, Fraunces). All rules scoped to [data-gm] mounts / gm-type-* classes.
   Defaults use :where() (zero specificity) so the integrator's sizing wins. */

/* ---------- 1. wordmark ---------- */
:where([data-gm="wordmark"]) {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 600;
  font-variation-settings: 'SOFT' 20, 'WONK' 0;
  font-optical-sizing: auto;
  line-height: 0.86;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.gm-type-wm { position: relative; }
.gm-type-wm-inner {
  display: inline-block;
  vertical-align: top;
  white-space: nowrap;
}
.gm-type-wm-seg {
  display: inline-block;
  padding-bottom: 0.02em;
}
.gm-type-wm--stack .gm-type-wm-inner { white-space: normal; }
.gm-type-wm--stack .gm-type-wm-seg { display: block; white-space: nowrap; }
.gm-type-wm--clip .gm-type-wm-seg { clip-path: inset(-0.6em -0.5em 0 -0.5em); }
.gm-type-wm-ch {
  display: inline-block;
  will-change: transform;
}
.gm-type-wm-ch--accent { color: var(--accent); }
.gm-type-wm-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* ---------- shared: marker stroke + baseline probe ---------- */
.gm-type-bl {
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: baseline;
  pointer-events: none;
}
.gm-type-mk {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 0;
}

/* ---------- 2. scramble ---------- */
.gm-type-sc-w { white-space: nowrap; }
.gm-type-sc-c { position: relative; }
.gm-type-sc-c.is-x { color: transparent; }
.gm-type-sc-c.is-x::after {
  content: attr(data-g);
  position: absolute;
  left: 0; right: 0; top: 0;
  text-align: center;
  color: var(--muted);
  font-family: var(--f-mono);
  font-weight: 400;
  font-style: normal;
  font-variation-settings: normal;
  pointer-events: none;
}
.gm-type-sc-c.is-s::after { color: var(--ink); }

/* ---------- 3. scrub ---------- */
:where([data-gm="scrub"]) {
  margin: 0;
  font-family: var(--f-display);
  font-size: var(--fs-display, clamp(2.2rem, 5.6vw, 5.4rem));
  font-weight: 580;
  font-optical-sizing: auto;
  font-variation-settings: 'SOFT' 20, 'WONK' 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
[data-gm="scrub"] { position: relative; isolation: isolate; }
/* no-JS fallback: a plain yellow underline; JS swaps it for the hand-drawn stroke */
[data-gm="scrub"] .accent {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.02em;
  text-decoration-skip-ink: none;
}
.gm-type-scrub--split .accent { text-decoration: none; }
.gm-type-sw { display: inline-block; white-space: nowrap; }
.gm-type-scrub--on .gm-type-sw {
  color: var(--glyph);
  font-weight: 400;
}
.gm-type-scrub-ink {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: -1;
}

/* ---------- 4. marquee ---------- */
:where([data-gm="marquee"]) {
  position: relative;
  max-width: 100%;
  font-family: var(--f-display);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 420;
  font-optical-sizing: auto;
  font-variation-settings: 'SOFT' 20, 'WONK' 0;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
}
[data-gm="marquee"] {
  overflow: hidden;
  overflow: clip;
  padding-block: 0.06em 0.14em;
}
[data-gm="marquee"] > ul,
[data-gm="marquee"] > ol,
.gm-type-mq-group {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
[data-gm="marquee"] li,
.gm-type-mq-item {
  display: flex;
  align-items: center;
  gap: 0.34em;
  padding-right: 0.34em;
  white-space: nowrap;
}
[data-gm="marquee"] li:nth-child(even),
.gm-type-mq-item--it { font-style: italic; }
[data-gm="marquee"] .gm-type-mq-item:not(.gm-type-mq-item--it) { font-style: normal; }
.gm-type-mq-word {
  position: relative;
  isolation: isolate;
  display: inline-block;
}
.gm-type-mq-ul {
  position: absolute;
  height: 0.32em;
  overflow: visible;
  pointer-events: none;
  z-index: -1;
}
.gm-type-mq-ul .gm-type-mk {
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .28s cubic-bezier(.4, 0, .6, 1);
}
.gm-type-mq-ul .gm-type-mk--b { transition-delay: 0s; }
@media (hover: hover) {
  .gm-type-mq-word:hover .gm-type-mq-ul .gm-type-mk {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset .55s cubic-bezier(.25, .7, .3, 1);
  }
  .gm-type-mq-word:hover .gm-type-mq-ul .gm-type-mk--b { transition-delay: .12s; }
}
.gm-type-mq-seed {
  width: 0.4em;
  height: 0.4em;
  flex: none;
  overflow: visible;
  transform: translateY(0.04em) rotate(var(--gm-mq-rot, 0deg));
}
.gm-type-mq-seed-core { fill: var(--ink); }
.gm-type-mq-seed-bloom { fill: var(--ink); opacity: .2; }
.gm-type-mq-seed-core.is-key,
.gm-type-mq-seed-bloom.is-key { fill: var(--accent); }
.gm-type-mq-seed-bloom.is-key { opacity: .35; }

/* static row (reduced motion / no JS): smaller, so it reads as one wrapped row, not a wall */
[data-gm="marquee"]:not(.gm-type-mq--on) > ul,
[data-gm="marquee"]:not(.gm-type-mq--on) > ol { font-size: 0.5em; row-gap: 0.04em; }
.gm-type-mq--static li:last-child .gm-type-mq-seed { display: none; }

.gm-type-mq-track {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  will-change: transform;
  transform-origin: 50% 50%;
}
.gm-type-mq--on .gm-type-mq-group { flex-wrap: nowrap; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .gm-type-mq-track { transform: none !important; }
  .gm-type-mq-ul .gm-type-mk { transition: none !important; }
}
