/* Release Achievements — "Meet the Party" landing page */

:root {
  --bg: #17110f;
  --bg-alt: #1c1512;
  --surface: #211a17;
  --surface-soft: rgba(243, 233, 216, 0.025);

  --text: #f3e9d8;
  --text-soft: #ddd0bc;
  --text-muted: #b8a893;

  --gold: #e2b65c;
  --gold-hover: #f3d48f;
  --gold-line: rgba(226, 182, 92, 0.4);
  --gold-line-hover: rgba(226, 182, 92, 0.55);

  --rarity-rare: #9fbfe8;

  --line: rgba(243, 233, 216, 0.1);

  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --gutter: clamp(20px, 4vw, 40px);
  --section-pad: clamp(56px, 7vw, 96px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  color: var(--gold-hover);
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  box-sizing: border-box;
}

.spark {
  flex: none;
}

/* Hero */

.hero {
  padding: var(--section-pad) 0 clamp(56px, 7vw, 88px);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero__head {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 64px;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(64px, 10vw, 148px);
  line-height: 0.9;
  text-transform: uppercase;
  color: var(--text);
}

.hero__title-accent {
  color: var(--gold);
}

.hero__lede {
  flex: 0 1 460px;
  margin: 0;
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-soft);
  text-wrap: pretty;
}

/* Roster tiles */

.roster {
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 12px;
}

.tile {
  height: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color 0.2s ease;
}

.tile:hover {
  border-color: var(--gold-line-hover);
}

.tile__img {
  flex: none;
  width: 52px;
  height: 52px;
}

/* roster.js swaps in a random sticker per tile; hide the icons until it has */
.roster-pending .tile__img {
  visibility: hidden;
}

.tile__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tile__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.tile__role {
  font-size: 13px;
  color: var(--text-muted);
}

/* Player sections */

.player {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: var(--section-pad) 0;
}

.player--alt {
  background: var(--bg-alt);
}

.player__inner {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 72px;
}

.player--alt .player__inner {
  flex-direction: row-reverse;
}

.feature {
  flex: 0 1 360px;
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.feature__img {
  --tilt: -4deg;
  width: 320px;
  max-width: 100%;
  height: auto;
  transform: rotate(var(--tilt));
  filter: drop-shadow(0 20px 32px rgba(0, 0, 0, 0.5));
  transition: transform 0.25s ease;
}

.player--alt .feature__img {
  --tilt: 4deg;
}

/* The featured sticker is a button that opens the enlarged view */
.feature__zoom {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: none;
  cursor: zoom-in;
}

.feature__zoom:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 8px;
}

:is(.feature__zoom:hover, .feature__zoom:focus-visible) .feature__img {
  transform: rotate(0deg) scale(1.03);
}

.feature__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 320px;
}

.feature__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  text-transform: uppercase;
  color: var(--gold);
}

.feature__title--rare {
  color: var(--rarity-rare);
}

.feature__desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}

.player__body {
  flex: 1 1 560px;
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow__sep {
  color: var(--text-muted);
}

.eyebrow__role {
  color: var(--text-soft);
}

/* Phones: the role gets its own line under "Player 01" / "Special Recognition" */
@media (max-width: 480px) {
  .eyebrow {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .eyebrow__sep {
    display: none;
  }

  .eyebrow__role {
    flex-basis: 100%;
    padding-left: 24px; /* line up with the text after the spark */
  }
}

.player__name {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 7vw, 104px);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--text);
}

.player__bio {
  margin: 22px 0 0;
  max-width: 40em;
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-soft);
  text-wrap: pretty;
}

/* Achievement list */

.achievements {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 10px;
}

.achievements > li {
  display: flex;
}

/* Each card is a button that opens the enlarged view */
.achievement {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: zoom-in;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.achievement:hover {
  border-color: var(--gold-line-hover);
  background: rgba(243, 233, 216, 0.05);
}

.achievement:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Magnifier hint at the end of the card */
.achievement::after {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--text-muted);
  background: currentColor;
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.achievement:is(:hover, :focus-visible)::after {
  color: var(--gold);
  opacity: 1;
}

.achievement__img {
  flex: none;
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
  transition: scale 0.25s var(--ease-out);
}

.achievement:hover .achievement__img {
  scale: 1.08;
}

.achievement__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.achievement__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.achievement__desc {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* Enlarged sticker view (lightbox.js): just the sticker, side arrows and a close button */

html:has(.lightbox[open]) {
  overflow: hidden;
}

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

.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(12, 8, 7, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.lightbox__frame {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 56px);
  padding: 16px;
  cursor: zoom-out; /* a click on the empty area closes */
  touch-action: pan-y;
  --caption-room: 92px; /* space kept free under the sticker for the description */
}

/* The figure box is the sticker alone, so the arrows centre on it; the description hangs below */
.lightbox__figure {
  position: relative;
  flex: none;
  margin: 0 0 var(--caption-room);
}

.lightbox__img {
  display: block;
  width: min(720px, calc(84vh - var(--caption-room)), calc(100vw - 240px));
  width: min(720px, calc(84dvh - var(--caption-room)), calc(100vw - 240px));
  height: auto;
  filter: drop-shadow(0 32px 60px rgba(0, 0, 0, 0.6));
  cursor: default;
  user-select: none;
  -webkit-user-drag: none;
}

/* One quiet line: the description that used to be printed on the sticker */
.lightbox__caption {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%);
  width: min(30em, calc(100vw - 32px));
  margin: 0;
  font-size: 20px;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
  color: var(--text-soft);
  opacity: 0.8;
  cursor: default;
}

.lightbox__close,
.lightbox__arrow {
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 1px solid rgba(243, 233, 216, 0.16);
  border-radius: 999px;
  background: rgba(243, 233, 216, 0.06);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.lightbox__arrow {
  width: 56px;
  height: 56px;
  margin-bottom: var(--caption-room); /* matches the figure, so both centre on the sticker */
}

.lightbox__arrow[hidden] {
  display: none;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  width: 48px;
  height: 48px;
}

:is(.lightbox__close, .lightbox__arrow):hover {
  color: var(--text);
  border-color: var(--gold-line-hover);
  background: rgba(243, 233, 216, 0.12);
}

:is(.lightbox__close, .lightbox__arrow):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Phones: the sticker takes the full width and the arrows sit over its edges */
@media (max-width: 640px) {
  .lightbox__frame {
    --caption-room: 104px;
  }

  .lightbox__img {
    width: min(calc(100vw - 32px), calc(84vh - var(--caption-room)));
    width: min(calc(100vw - 32px), calc(84dvh - var(--caption-room)));
  }

  .lightbox__caption {
    font-size: 18px;
  }

  .lightbox__arrow {
    position: absolute;
    top: calc(50% - var(--caption-room) / 2); /* the sticker's centre, not the screen's */
    margin-bottom: 0;
    z-index: 1;
    width: 48px;
    height: 48px;
    translate: 0 -50%;
    background: rgba(23, 17, 15, 0.72);
  }

  .lightbox__arrow--prev {
    left: 10px;
  }

  .lightbox__arrow--next {
    right: 10px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .lightbox[open],
  .lightbox[open]::backdrop {
    animation: lightbox-fade 0.3s ease;
  }

  .lightbox__img.is-showing {
    animation: lightbox-pop 0.55s var(--ease-spring);
  }

  /* the description settles in a beat after the sticker */
  .lightbox__caption.is-showing {
    animation: lightbox-caption 0.5s var(--ease-out) 0.15s both;
  }
}

@keyframes lightbox-fade {
  from {
    opacity: 0;
  }
}

@keyframes lightbox-caption {
  from {
    opacity: 0;
    translate: 0 6px;
  }
}

/* --from-x is set by lightbox.js so the next sticker slides in from the side it came from */
@keyframes lightbox-pop {
  from {
    opacity: 0;
    scale: 0.88;
    translate: var(--from-x, 0) 0;
    rotate: var(--from-rotate, -6deg);
  }
}

/* Footer */

.site-footer {
  padding: 120px 0 104px;
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.flourish {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold);
}

.flourish__rule {
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--gold);
}

.gg {
  margin: 28px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--text);
}

/* Scroll reveal: motion.js adds .is-in. Keep the selector lists in sync with motion.js.
   :where() keeps these at low specificity so the .is-in rule below always wins. */

.motion :where(.pill, .hero__title, .hero__lede, .roster > li, .feature__caption, .eyebrow, .player__name, .player__bio, .achievement, .gg) {
  opacity: 0;
  translate: 0 28px;
  transition:
    opacity 0.7s var(--ease-out) var(--reveal-delay, 0ms),
    translate 0.9s var(--ease-out) var(--reveal-delay, 0ms);
}

/* "the party" rises a beat after "Meet" */
.motion .hero__title-accent {
  display: inline-block;
  opacity: 0;
  translate: 0 0.3em;
  transition:
    opacity 0.7s var(--ease-out) calc(var(--reveal-delay, 0ms) + 160ms),
    translate 0.9s var(--ease-out) calc(var(--reveal-delay, 0ms) + 160ms);
}

/* Stickers spin into their resting tilt with a little overshoot */
.motion :where(.feature__img) {
  opacity: 0;
  scale: 0.78;
  rotate: var(--spin, -14deg);
  transition:
    transform 0.25s ease,
    opacity 0.6s var(--ease-out) var(--reveal-delay, 0ms),
    scale 1s var(--ease-spring) var(--reveal-delay, 0ms),
    rotate 1s var(--ease-spring) var(--reveal-delay, 0ms);
}

.player--alt {
  --spin: 14deg;
}

/* Cards keep their hover transitions alongside the reveal */
.motion .achievement {
  transition:
    opacity 0.7s var(--ease-out) var(--reveal-delay, 0ms),
    translate 0.9s var(--ease-out) var(--reveal-delay, 0ms),
    border-color 0.2s ease,
    background-color 0.2s ease;
}

/* Footer flourish: rules draw outward from the spark */
.motion .flourish__rule {
  scale: 0 1;
  transition: scale 0.9s var(--ease-out) calc(var(--reveal-delay, 0ms) + 150ms);
}

.motion .flourish__rule:first-child {
  transform-origin: 100% 50%;
}

.motion .flourish__rule:last-child {
  transform-origin: 0 50%;
}

.motion .flourish .spark {
  opacity: 0;
  scale: 0.4;
  rotate: -90deg;
  transition:
    opacity 0.6s var(--ease-out) var(--reveal-delay, 0ms),
    scale 0.8s var(--ease-spring) var(--reveal-delay, 0ms),
    rotate 0.8s var(--ease-spring) var(--reveal-delay, 0ms);
}

.motion .is-in,
.motion .hero__title.is-in .hero__title-accent,
.motion .flourish.is-in :is(.flourish__rule, .spark) {
  opacity: 1;
  translate: none;
  scale: none;
  rotate: none;
}

/* Scroll-linked extras, where the browser supports scroll-driven animations */

.scroll-progress {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .scroll-progress {
      display: block;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 10;
      height: 3px;
      background: var(--gold);
      transform-origin: 0 50%;
      animation: scroll-progress linear both;
      animation-timeline: scroll(root);
    }

    /* Featured stickers drift slightly slower than the page */
    .feature__img {
      animation: sticker-drift linear both;
      animation-timeline: view();
      animation-range: cover;
    }
  }
}

@keyframes scroll-progress {
  from {
    scale: 0 1;
  }
  to {
    scale: 1 1;
  }
}

@keyframes sticker-drift {
  from {
    translate: 0 40px;
  }
  to {
    translate: 0 -40px;
  }
}

@media print {
  .motion * {
    opacity: 1 !important;
    translate: none !important;
    scale: none !important;
    rotate: none !important;
  }

  .scroll-progress {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tile,
  .feature__img,
  .achievement,
  .achievement__img {
    transition: none;
  }

  :is(.feature__zoom:hover, .feature__zoom:focus-visible) .feature__img {
    transform: rotate(var(--tilt));
  }

  .achievement:hover .achievement__img {
    scale: none;
  }
}
