/* ==========================================================================
   Home — Showcase (coda: afterring / 余韵)
   The night continues under the brand. Behind it, every cover in the
   catalogue drifts on a tilted wall; the covers whose strings you played in
   the hero keep ringing in firefly gold (memory only; showcase.js keeps the
   latest few ringing and older ones as a faint echo) while the rest sit back
   at .16. If nothing was played, the wall is a uniform .22.
   Scoped to html[data-page="home"] .showcase.
   ========================================================================== */

html[data-page="home"] .showcase {
  --bone: #f7f1f3;
  --firefly: #e9c452;
  --glass: #7bd8fd;
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: clamp(112px, 13vw, 220px);
  overflow: hidden;
  isolation: isolate;
}

/* --- The wall --------------------------------------------------------------------
   Three nested layers, so the masks simply multiply: the outer box is upright
   with soft top and bottom edges (the wall rises out of the contact night with
   no seam); inside it a small clear centre is kept for the brand, so the covers
   come right up to the words; inside that, the plane is tilted −8° and scaled
   1.15. */
html[data-page="home"] .showcase__wall {
  --rest: 0.22;
  --gap: clamp(8px, 1vw, 14px);
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgb(0 0 0 / 0.4) 10%, #000 26%, #000 72%, rgb(0 0 0 / 0.4) 88%, transparent 98%);
  mask-image: linear-gradient(180deg, transparent 0, rgb(0 0 0 / 0.4) 10%, #000 26%, #000 72%, rgb(0 0 0 / 0.4) 88%, transparent 98%);
}

html[data-page="home"] .showcase .wall__clear {
  position: absolute;
  inset: 0;
  -webkit-mask-image: radial-gradient(38% 30% at 50% 50%, transparent 42%, rgb(0 0 0 / 0.5) 74%, #000 100%);
  mask-image: radial-gradient(38% 30% at 50% 50%, transparent 42%, rgb(0 0 0 / 0.5) 74%, #000 100%);
}

html[data-page="home"] .showcase__wall.has-played {
  --rest: 0.16;
}

html[data-page="home"] .showcase .wall__plane {
  position: absolute;
  inset: -14% -6%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gap);
  transform: rotate(-8deg) scale(1.15);
}

html[data-page="home"] .showcase .wall__col {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
  /* Still until the section is entered; showcase.js eases it into the drift. */
  animation: showcase-drift 90s linear infinite alternate paused;
}

html[data-page="home"] .showcase .wall__col:nth-child(even) {
  animation-direction: alternate-reverse;
}

html[data-page="home"] .showcase .wall__col img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
  background: rgb(247 241 243 / 0.04);
  opacity: var(--rest);
  transition:
    opacity 1200ms var(--ease-settle),
    box-shadow 1200ms var(--ease-settle);
}

/* AFTERRING: the covers you played keep glowing. A state, not a motion. */
html[data-page="home"] .showcase .wall__col img.is-played {
  opacity: 1;
  box-shadow:
    0 0 0 2px var(--firefly),
    0 0 26px 4px rgb(233 196 82 / 0.42),
    0 0 90px 22px rgb(233 196 82 / 0.16);
}

/* Older plays keep a faint echo: brighter than the rest, without the ring. */
html[data-page="home"] .showcase .wall__col img.is-echo {
  opacity: 0.36;
  box-shadow: 0 0 0 1px rgb(233 196 82 / 0.32);
}

/* A cover played while you are here (or since you last were) blooms once. */
html[data-page="home"] .showcase .wall__col img.is-fresh {
  animation: showcase-bloom 1800ms var(--ease-settle) both;
}

@keyframes showcase-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, -50%, 0);
  }
}

@keyframes showcase-bloom {
  0% {
    box-shadow:
      0 0 0 2px rgb(233 196 82 / 0),
      0 0 0 0 rgb(233 196 82 / 0),
      0 0 0 0 rgb(233 196 82 / 0);
  }
  35% {
    box-shadow:
      0 0 0 3px var(--firefly),
      0 0 60px 18px rgb(233 196 82 / 0.6),
      0 0 160px 50px rgb(233 196 82 / 0.24);
  }
  100% {
    box-shadow:
      0 0 0 2px var(--firefly),
      0 0 26px 4px rgb(233 196 82 / 0.42),
      0 0 90px 22px rgb(233 196 82 / 0.16);
  }
}

/* --- The brand, the last line, the ways to write and follow ------------------------ */
html[data-page="home"] .showcase__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(36px, 4.4vw, 64px);
  text-align: center;
}

/* A small pool of night behind the words. The logotype, the last line and the
   addresses also carry a halo of the same night, close around their own shapes,
   so a glowing cover can pass right beside them and they stay legible. */
html[data-page="home"] .showcase__inner::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: min(760px, 92%);
  height: 104%;
  translate: -50% -50%;
  background: radial-gradient(closest-side, rgb(20 24 66 / 0.88), rgb(20 24 66 / 0.62) 54%, rgb(20 24 66 / 0) 100%);
  pointer-events: none;
}

html[data-page="home"] .showcase__mark {
  display: inline-block;
  padding: 6px;
  border-radius: 4px;
}

html[data-page="home"] .showcase__mark img {
  display: block;
  width: clamp(220px, 30vw, 460px);
  height: auto;
  filter: drop-shadow(0 0 2px rgb(20 24 66 / 0.95)) drop-shadow(0 0 8px rgb(20 24 66 / 0.9)) drop-shadow(0 0 22px rgb(20 24 66 / 0.6));
}

html[data-page="home"] .showcase__title {
  max-width: 16em;
  margin: 0;
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.6vw, 4.75rem);
  line-height: 1.32;
  letter-spacing: 0;
  font-synthesis: none;
  color: var(--bone);
  text-shadow: 0 0 3px rgb(20 24 66 / 0.8), 0 0 18px rgb(20 24 66 / 0.75), 0 0 44px rgb(20 24 66 / 0.5);
}

/* Japanese display serif: the served Shippori Mincho subset has no palt
   metrics, so full-width kana are tightened with tracking instead (詰め組み). */
html[data-page="home"][lang="ja-JP"] .showcase__title {
  letter-spacing: -0.04em;
}

html[data-page="home"][lang="en"] .showcase__title {
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.012em;
  max-width: 14em;
}

html[data-page="home"] .showcase__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(22px, 2.6vw, 34px);
}

html[data-page="home"] .showcase__mails {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  font-family: var(--f-mono);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

html[data-page="home"] .showcase__mails a {
  color: var(--glass);
  text-shadow: 0 0 2px rgb(20 24 66 / 0.95), 0 0 8px rgb(20 24 66 / 0.9), 0 0 18px rgb(20 24 66 / 0.6);
}

/* A firefly between the two addresses. */
html[data-page="home"] .showcase__mails a + a::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 18px 0 0;
  border-radius: 50%;
  background: var(--firefly);
  vertical-align: middle;
  translate: 0 -1px;
}

html[data-page="home"] .showcase .socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 980px;
  margin: 0;
  padding: 0;
  list-style: none;
}

html[data-page="home"] .showcase .social {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  /* Solid enough on its own: no backdrop blur over a wall that drifts every frame. */
  background: rgb(20 24 66 / 0.82);
  font-size: 0.8125rem;
  line-height: 1.2;
  color: var(--fg-2);
  white-space: nowrap;
  transition:
    color var(--d-1),
    border-color var(--d-1),
    background-color var(--d-1);
}

html[data-page="home"] .showcase .social img {
  flex: none;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

html[data-page="home"] .showcase .social--bilibili img {
  filter: brightness(0) saturate(100%) invert(63%) sepia(53%) saturate(2860%) hue-rotate(160deg) brightness(97%) contrast(101%);
}

/* The Douyin glyph is dark: shown light on the night. */
html[data-page="home"] .showcase .social--tiktok img {
  filter: invert(1);
}

html[data-page="home"] .showcase .social:is(:hover, :focus-visible) {
  color: var(--bone);
  border-color: rgb(123 216 253 / 0.55);
  background: rgb(20 24 66 / 0.86);
}

/* --- Phones ------------------------------------------------------------------------ */
@media (max-width: 600px) {
  html[data-page="home"] .showcase .wall__plane {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    inset: -12% -14%;
  }
  html[data-page="home"] .showcase .wall__col:nth-child(n + 4) {
    display: none;
  }
  html[data-page="home"] .showcase .wall__clear {
    -webkit-mask-image: radial-gradient(72% 36% at 50% 46%, transparent 36%, rgb(0 0 0 / 0.5) 72%, #000 100%);
    mask-image: radial-gradient(72% 36% at 50% 46%, transparent 36%, rgb(0 0 0 / 0.5) 72%, #000 100%);
  }
  html[data-page="home"] .showcase__inner::before {
    width: 116%;
    height: 102%;
  }
  html[data-page="home"] .showcase__meta {
    width: 100%;
  }
  html[data-page="home"] .showcase .socials {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 380px;
  }
  html[data-page="home"] .showcase .social {
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    padding-block: 6px;
    border-radius: 22px;
    white-space: normal;
    text-align: left;
  }
  html[data-page="home"] .showcase__mails {
    flex-direction: column;
    align-items: center;
  }
  html[data-page="home"] .showcase__mails a + a::before {
    display: none;
  }
  /* ja: the 11-kana phrase keeps its line on a 343 px measure (no orphaned まだ). */
  html[data-page="home"][lang="ja-JP"] .showcase__title {
    font-size: clamp(1.5rem, 7.4vw, 1.875rem);
  }
}

/* Touch: comfortable targets for the small links. */
@media (pointer: coarse) {
  html[data-page="home"] .showcase :is(.showcase__mails a, .showcase__mark) {
    display: inline-block;
    padding-block: 10px;
  }
  html[data-page="home"] .showcase .social {
    min-height: 44px;
  }
}

/* --- Reduced motion and the low tier: the wall is still; the afterring stays ------ */
@media (prefers-reduced-motion: reduce) {
  html[data-page="home"] .showcase .wall__col,
  html[data-page="home"] .showcase .wall__col img.is-fresh {
    animation: none;
  }
}

html[data-page="home"][data-tier="low"] .showcase :is(.wall__col, .wall__col img.is-fresh) {
  animation: none;
}
