/* ==========================================================================
   Sections — traced from the four frames (1280 x 832)
   1 hero · 2 gallery · 3 crew · 4 download
   gallery cards 367x359 rx19.5 · crew cards 273x252 · pill 320x112 rx56
   ========================================================================== */

/* ==========================================================================
   1 — HERO
   design frame 1: logo 595x369 at (83,146) · character 466x652 at (813,85)
   both are animated WebP cropped to content, scaled from the 1280 frame
   cue text 70x17 at (605,745), arrow at (633,783)
   ========================================================================== */

.hero {
  position: relative;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
}

.hero__stage {
  position: relative;
  height: 100%;
}

.hero__logo {
  position: absolute;
  left: 6.48%; /* 83 / 1280 */
  top: 17.55%; /* 146 / 832 */
  width: 46.48%; /* 595 / 1280 */
  max-width: 595px;
  height: auto;
  animation: hero-in 1.05s var(--ease) both;
}

.hero__char {
  position: absolute;
  right: 0; /* 813 + 466 = 1279: flush to the frame edge */
  bottom: 11.42%;
  width: 36.41%; /* 466 / 1280 */
  max-width: 466px;
  height: auto;
  animation: hero-in 1.25s var(--ease) 0.08s both;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero__cue {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-synthesis: none;
  font-size: var(--px-label);
  line-height: 1;
  -webkit-font-smoothing: none;
  color: var(--ink);
  opacity: 0;
  animation: cue-in 0.8s var(--ease) 0.9s forwards;
  transition: opacity 0.3s;
}

.hero__cue:hover {
  opacity: 0.7;
}

@keyframes cue-in {
  to {
    opacity: 1;
  }
}

.hero__cue svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: cue-bob 2s ease-in-out infinite;
}

@keyframes cue-bob {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: translateY(3px);
    opacity: 1;
  }
}

@media (max-width: 860px), (max-aspect-ratio: 1/1) {
  .hero__logo {
    left: 50%;
    top: 9%;
    width: 78%;
    max-width: 430px;
    transform: translateX(-50%);
  }
  .hero__char {
    right: auto;
    left: 50%;
    bottom: 12%;
    width: 52%;
    max-width: 280px;
    transform: translateX(-50%);
  }
  .hero__cue {
    bottom: 22px;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__logo,
  .hero__char,
  .hero__cue {
    animation: none;
    opacity: 1;
  }
  .hero__cue svg {
    animation: none;
  }
}

/* ==========================================================================
   2 — GALLERY   title ink y=139..199 · cards y=288.5
   ========================================================================== */

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
  margin-top: 88px;
}

.gallery__card {
  position: relative;
  aspect-ratio: 367 / 359;
  border-radius: var(--r-gallery);
  background: var(--card-gallery);
  border: 1px solid var(--card-gallery-line);
  overflow: hidden;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease),
    background-color 0.4s var(--ease);
}

.gallery__card:hover {
  transform: translateY(-4px);
  border-color: #45454f;
  background: #1f1f24;
}

.gallery__card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.022) 0 1px,
    transparent 1px 11px
  );
  transition: opacity 0.45s var(--ease);
}

.gallery__card:hover::before {
  opacity: 0.4;
}

/* label ink: x=94 (30 from card edge) baseline ink bottom y=623 (26 from floor) */
.gallery__label {
  position: absolute;
  left: 29px;
  bottom: 25px;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-synthesis: none;
  font-size: var(--px-label);
  line-height: 1;
  -webkit-font-smoothing: none;
  color: #fff;
  opacity: 0.56;
  transition: opacity 0.35s var(--ease);
}

.gallery__card:hover .gallery__label {
  opacity: 0.86;
}

@media (max-width: 980px) {
  .gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: clamp(32px, 6vw, 80px);
  }
}

@media (max-width: 600px) {
  .gallery__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .gallery__label {
    left: 22px;
    bottom: 20px;
  }
}

/* ==========================================================================
   3 — CREW   cards 273x252 at (205.5,271) · avatar 108 at inset (23.6,21.4)
   ========================================================================== */

.crew__grid {
  display: grid;
  grid-template-columns: repeat(3, 273px);
  gap: 24px 20px;
  justify-content: center;
  margin-top: 70px;
}

.crew__card {
  position: relative;
  height: 252px;
  border-radius: var(--r-crew);
  background: var(--card-crew);
  text-align: left;
  transition: transform 0.4s var(--ease), background-color 0.4s var(--ease);
}

.crew__card:hover {
  transform: translateY(-4px);
  background: #454545;
}

/* every element sits exactly where the frame puts it (insets in px) */
.crew__avatar {
  position: absolute;
  left: 23.6px;
  top: 21.4px;
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 5.4px;
  background: #2c2c2c;
}

.crew__side {
  position: absolute;
  left: 143.5px;
  right: 6px;
  top: 21px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

/* name: 6-glyph names run 111-118px in the frames · 17.5px weight 800 */
.crew__name {
  font-family: var(--font-sans);
  font-size: 17.5px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew__chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* chips: 32 tall, 6px apart, glyph ink 20px => 22px pixel size */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px 0 11px;
  max-width: 100%;
  border-radius: 16px;
  background: var(--ink-soft);
  color: #000;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-synthesis: none;
  font-size: var(--px-chip);
  line-height: 1;
  -webkit-font-smoothing: none;
  white-space: nowrap;
}

.chip svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* role runs the full card width (ink reaches 214px) — not confined to the avatar column */
.crew__role {
  position: absolute;
  left: 24.5px;
  right: 26px;
  top: 131px;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-synthesis: none;
  font-size: var(--px-meta);
  line-height: 1.18;
  -webkit-font-smoothing: none;
  color: #fff;
  word-break: break-word;
}

.crew__uid {
  position: absolute;
  left: 24.5px;
  bottom: 21px;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-synthesis: none;
  font-size: var(--px-meta);
  line-height: 1;
  -webkit-font-smoothing: none;
  color: #fff;
  letter-spacing: 0.015em;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.crew__uid:hover {
  opacity: 0.7;
}

@media (max-width: 940px) {
  .crew__grid {
    grid-template-columns: repeat(2, 273px);
    margin-top: clamp(30px, 5vw, 71px);
  }
}

@media (max-width: 640px) {
  .crew__grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 320px;
    margin-inline: auto;
  }
  /* stack: absolute insets no longer fit at this width */
  .crew__card {
    height: auto;
    padding: 18px;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 12px;
    row-gap: 12px;
  }
  .crew__avatar {
    position: static;
    width: 84px;
    height: 84px;
  }
  .crew__side {
    position: static;
  }
  .crew__role {
    position: static;
    grid-column: 1 / -1;
  }
  .crew__uid {
    position: static;
    grid-column: 1 / -1;
    font-size: 13px;
    letter-spacing: 0;
  }
}

@media (max-width: 380px) {
  .crew__grid {
    max-width: 290px;
  }
  .crew__name {
    font-size: 16px;
  }
  .chip {
    font-size: 18px;
    height: 28px;
    padding: 0 12px 0 10px;
  }
  .chip svg {
    width: 14px;
    height: 14px;
  }
}

/* ==========================================================================
   4 — DOWNLOAD   title ink y=338..404 · pill 320x112 at y=459
   ========================================================================== */

.download {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 40px;
  text-align: center;
}

.download__title {
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.006em;
}

.download__btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 320px;
  height: 112px;
  margin-top: 55px;
  border: 0;
  border-radius: 56px;
  background: #fff;
  color: #000;
  font: inherit;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.35s var(--ease),
    background-color 0.25s var(--ease), color 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.download__btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(255, 255, 255, 0.12);
}

.download__btn:active {
  transform: scale(0.976);
}

/* disabled — the MOD is not out yet: grey pill, no lift, no pointer */
.download__btn:disabled {
  background: #2e2e33;
  color: #8c8c95;
  box-shadow: none;
  cursor: not-allowed;
}

.download__btn:disabled:hover,
.download__btn:disabled:active {
  transform: none;
  box-shadow: none;
  background: #2e2e33;
}

.download__btn:disabled .download__ver {
  color: #67676f;
}

.download__btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(255, 255, 255, 0.12);
}

.download__btn:active {
  transform: scale(0.976);
}

/* 下载MOD ink 51px tall, Ver 15px */
.download__label {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-synthesis: none;
  font-size: 44px;
  line-height: 1;
  -webkit-font-smoothing: none;
  letter-spacing: 0.01em;
}

.download__ver {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-synthesis: none;
  font-size: var(--px-ver);
  line-height: 1;
  -webkit-font-smoothing: none;
  color: rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
  .download__title {
    font-size: clamp(38px, 11vw, 72px);
  }
  .download__btn {
    width: min(100%, 320px);
    height: 104px;
    margin-top: 38px;
  }
  .download__label {
    font-size: 34px;
  }
  .download__ver {
    font-size: 16px;
  }
}
