/* Tag wall: the pill strip right after the hero.
   Uses only the site palette (cream / orange / yellow / lilac / outline), with orange as the one accent
   plus dark icon chips that echo the header pill and the room cards. */

.ref-ctf-field {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding-top: clamp(56px, 6vw, 92px);
}

.ref-tagwall {
  --tag-font: clamp(26px, 3vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 1.5vw, 22px);
  padding: clamp(40px, 5vw, 72px) clamp(20px, 4vw, 64px);
}

.ref-tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.4vw, 22px);
  max-width: 100%;
}

.ref-tag {
  --tag-bg: var(--ref-ink);
  --tag-fg: #111216;
  --chip-bg: #111216;
  --chip-fg: var(--ref-orange);
  display: inline-flex;
  min-height: 1.75em;
  align-items: center;
  gap: 0.36em;
  padding: 0.2em 0.7em 0.2em 0.2em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-fg);
  font-family: var(--ref-display);
  font-size: var(--tag-font);
  font-weight: 750;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transition: scale 220ms cubic-bezier(0.2, 0.8, 0.25, 1.1);
}

.ref-tag-chip {
  display: grid;
  flex: 0 0 auto;
  width: 1.35em;
  height: 1.35em;
  place-items: center;
  border-radius: 50%;
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-size: 1em;
}

.ref-tag-chip i {
  font-size: 0.46em;
}

.ref-tag-orange { --tag-bg: var(--ref-orange); --tag-fg: #fff; }
.ref-tag-yellow { --tag-bg: var(--ref-yellow); }
.ref-tag-lilac  { --tag-bg: var(--ref-lilac); }

.ref-tag-outline {
  --tag-bg: transparent;
  --tag-fg: var(--ref-ink);
  --chip-bg: rgba(244, 241, 237, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Slight sticker tilt, alternating per pill. */
.ref-tag-row .ref-tag:nth-of-type(odd)  { rotate: -1.2deg; }
.ref-tag-row .ref-tag:nth-of-type(even) { rotate: 1deg; }
.ref-tag-row-two   { translate: -1.5% 0; }
.ref-tag-row-three { translate: 1.5% 0; }

/* ---------- Motion ---------- */

.ref-tagwall.has-motion:not(.is-visible) .ref-tag {
  opacity: 0;
}

.ref-tagwall.is-visible .ref-tag {
  animation:
    ref-tag-in 640ms cubic-bezier(0.2, 0.8, 0.25, 1.1) both,
    ref-tag-float 6s ease-in-out infinite;
  animation-delay: var(--tag-delay, 0ms), calc(var(--tag-delay, 0ms) + 700ms);
}

.ref-tag-row-one   > :nth-child(1) { --tag-delay: 0ms; }
.ref-tag-row-one   > :nth-child(2) { --tag-delay: 90ms; }
.ref-tag-row-two   > :nth-child(1) { --tag-delay: 160ms; }
.ref-tag-row-two   > :nth-child(2) { --tag-delay: 230ms; }
.ref-tag-row-two   > :nth-child(3) { --tag-delay: 300ms; }
.ref-tag-row-three > :nth-child(1) { --tag-delay: 370ms; }
.ref-tag-row-three > :nth-child(2) { --tag-delay: 440ms; }

.ref-tag:hover {
  scale: 1.04;
  animation-play-state: paused;
}

@keyframes ref-tag-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ref-tag-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

/* ---------- Responsive ---------- */

@media (max-width: 999px) {
  .ref-ctf-field {
    width: calc(100% - 2 * var(--ref-gutter));
  }

  .ref-tagwall {
    --tag-font: clamp(22px, 3.6vw, 36px);
  }
}

@media (max-width: 767px) {
  .ref-ctf-field {
    width: calc(100% - 48px);
    padding-top: 40px;
    container-type: inline-size;
  }

  /* Always three lines: the font scales so the longest row
     (Hackers / Capture the flag / Talks, ~17.6em + 2 gaps) fits the width. */
  .ref-tagwall {
    --tag-font: min(26px, calc((100cqi - 20px) / 17.6));
    gap: 10px;
    padding: 32px 0 16px;
  }

  .ref-tag-row {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .ref-tag {
    gap: 0.3em;
    padding-right: 0.6em;
  }

  .ref-tag-chip {
    width: 1.25em;
    height: 1.25em;
  }

  .ref-tag-row-two,
  .ref-tag-row-three {
    translate: none;
  }
}


@media (prefers-reduced-motion: reduce) {
  .ref-tagwall.has-motion:not(.is-visible) .ref-tag {
    opacity: 1;
  }

  .ref-tagwall.is-visible .ref-tag {
    animation: none;
  }

  .ref-tag {
    transition: none;
  }
}

.ref-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ref-registration-copy a {
  color: var(--ref-orange);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.ref-registration-copy a:hover {
  color: var(--ref-ink);
}

.ref-registration-copy .ref-registration-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  gap: 0.6em;
  margin-top: 30px;
  padding: 0 24px;
  border: 1px solid var(--ref-orange);
  border-radius: 999px;
  background: var(--ref-orange);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.ref-registration-copy .ref-registration-button:hover {
  background: transparent;
  color: var(--ref-orange);
  transform: translateY(-2px);
}
