@import url("profile-badges.css");

/* Playing-card scene for the member profile banners. */
.card-scene {
  --card-width: clamp(8.75rem, 22vw, 17.5rem);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  overflow: hidden;
  padding: clamp(2.75rem, 7vw, 5.5rem) clamp(1.35rem, 6vw, 5rem);
  color: #f9ebd8;
  background: #060305;
  border-block: 1px solid #805340;
}

.card-scene::before {
  content: "";
  position: absolute;
  z-index: -2;
  top: 58%;
  bottom: -1px;
  left: -76%;
  width: 252%;
  background:
    linear-gradient(#060305, #06030536 36%, transparent),
    repeating-conic-gradient(#780711 0% 25%, #160407 0% 50%) 50% 0 / 6.5% 23%;
  transform: perspective(280px) rotateX(52deg) scaleY(1.4);
  transform-origin: top center;
}

.card-scene-deck {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.card-scene-deck span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  place-items: center;
  width: clamp(1.15rem, 4vw, 3.25rem);
  aspect-ratio: 5 / 7;
  border: 1px solid #e5c5a3;
  border-radius: .2rem;
  background: #d8c0a3;
  box-shadow: inset 0 0 0 2px #8f635751;
  color: #21161a;
  opacity: var(--opacity, .27);
  font: clamp(.7rem, 2vw, 1.6rem)/1 Georgia, serif;
  transform: rotate(var(--turn)) skewY(var(--skew, 0deg)) scaleY(var(--squash, 1));
}

.card-scene-deck span:nth-child(1) { --x: 4%; --y: 13%; --turn: -77deg; --squash: .75; }
.card-scene-deck span:nth-child(2) { --x: 38%; --y: 4%; --turn: 26deg; --squash: .82; }
.card-scene-deck span:nth-child(3) { --x: 49%; --y: 27%; --turn: -26deg; }
.card-scene-deck span:nth-child(4) { --x: 80%; --y: 75%; --turn: 62deg; --squash: .7; }
.card-scene-deck span:nth-child(5) { --x: 6%; --y: 64%; --turn: 67deg; --squash: .8; }
.card-scene-deck span:nth-child(6) { --x: 46%; --y: 84%; --turn: -34deg; --skew: -13deg; --opacity: .43; }
.card-scene-deck span:nth-child(7) { --x: 87%; --y: 15%; --turn: -72deg; --squash: .5; }
.card-scene-deck span:nth-child(8) { --x: 30%; --y: 97%; --turn: 42deg; --opacity: .48; }
.card-scene-deck span:is(:nth-child(2), :nth-child(3), :nth-child(6), :nth-child(7)) { color: #7f1627; }

.card-scene-ace {
  --card-tilt: 15deg;
  position: relative;
  justify-self: center;
  width: var(--card-width);
  aspect-ratio: 5 / 7.4;
  border-radius: 6%;
  border: 1px solid #dbbb89;
  color: #131416;
  background:
    radial-gradient(circle at 24% 18%, #fff8e4, transparent 58%),
    repeating-linear-gradient(125deg, #734b2a0a 0 1px, transparent 1px 4px),
    #f1e2c6;
  box-shadow: inset 0 0 18px #a7764a57, 0 1rem 2.4rem #000b;
  transform: rotate(var(--card-tilt));
}

.card-scene-ace[data-suit="♥"],
.card-scene-ace[data-suit="♦"] { color: #7c1328; }

.card-scene-portrait {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 78%;
  aspect-ratio: 593 / 1018;
  overflow: hidden;
  border-radius: 50%;
  background: #000;
  transform: translate(-50%, -50%) rotate(calc(-1 * var(--card-tilt)));
}

.card-scene-portrait img {
  /* The supplied cards share a 2048px canvas. Show only the inner oval. */
  position: absolute;
  width: calc(100% * 2048 / 593);
  height: calc(100% * 2048 / 1018);
  max-width: none;
  left: calc(-100% * 621.5 / 593);
  top: calc(-100% * 521 / 1018);
}

.card-scene-corner {
  position: absolute;
  z-index: 1;
  inset: 4% auto auto 5%;
  text-align: center;
  font: bold calc(var(--card-width) / 12)/.95 Georgia, serif;
}

.card-scene-corner:nth-child(2) { inset: 4% 5% auto auto; }
.card-scene-corner:nth-child(3) { inset: auto auto 4% 5%; transform: rotate(180deg); }
.card-scene-corner:nth-child(4) { inset: auto 5% 4% auto; transform: rotate(180deg); }

.profile-title { margin: 1rem 0 1.75rem; }
.profile-title:has(+ .member-topics) { margin: 0; }

.profile-title-copy {
  position: relative;
  min-width: 0;
  text-shadow: 0 4px 18px #000;
}

.card-scene h1 {
  margin: .24em 0 0;
  max-width: 15ch;
  text-wrap: balance;
  color: #fff1de;
  font: 400 clamp(1.85rem, 4.7vw, 4.75rem)/.99 Georgia, serif;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

@media (max-width: 35rem) and (orientation: portrait) {
  .card-scene {
    --card-width: clamp(8.5rem, 46vw, 14rem);
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 2rem;
    text-align: center;
  }
  .card-scene h1 { max-width: 17ch; }
  .profile-title-role { margin-inline: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .profile-arriving::after {
    content: "";
    position: fixed;
    z-index: 100;
    inset: -15vh calc(-20vw - 15vh);
    pointer-events: none;
    background: #080407;
    border-right: 2px solid #e5ae74;
    animation: profile-arrival-curtain .34s cubic-bezier(.61, .02, .3, 1) both;
  }

  .profile-arriving .card-scene-ace {
    animation: profile-card-arrival .38s .1s cubic-bezier(.2, .75, .25, 1) both;
  }

  .profile-arriving .profile-title-rank,
  .profile-arriving .profile-title-role {
    animation: profile-gold-glint .46s .25s ease-out;
  }

  @keyframes profile-arrival-curtain {
    from { transform: translateX(0) skewX(-16deg); }
    to { transform: translateX(-110%) skewX(-16deg); }
  }

  @keyframes profile-card-arrival {
    from { transform: translateX(-1rem) rotate(calc(var(--card-tilt) - 7deg)); }
    to { transform: rotate(var(--card-tilt)); }
  }

  @keyframes profile-gold-glint {
    45% { filter: drop-shadow(0 0 .35rem #edb877b3) brightness(1.2); }
  }
}

.member-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.4rem, 2vw, 1rem);
  padding: clamp(.6rem, 2.8vw, 1.35rem);
  border: 0;
  border-top: 1px solid #8a6152;
  background: #241019;
}

.member-nav .member-nav-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.35rem, 1.3vw, .75rem);
  min-width: 0;
  padding: clamp(.38rem, 1.3vw, .65rem);
  border: 1px solid #9b705b;
  background: linear-gradient(120deg, #3d1723, #2b111b);
  color: #f8e6cd;
}

.member-nav .member-nav-link:not(.member-nav-next) {
  grid-template-columns: auto auto minmax(0, 1fr);
}

.member-nav-link:not(.member-nav-next) .member-nav-arrow {
  grid-column: 1;
  grid-row: 1;
}

.member-nav .member-nav-link:hover,
.member-nav .member-nav-link:focus-visible {
  border-color: #e5b780;
  background: #542136;
  outline-offset: 2px;
}

.member-nav-card {
  --card-tilt: 0deg;
  position: relative;
  width: clamp(1.75rem, 6vw, 2.8rem);
  aspect-ratio: 5 / 7;
  border: 1px solid #e7c791;
  border-radius: .14rem;
  background: #f2e3c5;
  color: #351622;
}

.member-nav-suit {
  position: absolute;
  right: .08rem;
  bottom: .02rem;
  font: 700 .54rem/1 Georgia, serif;
}

.member-nav-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.member-nav-direction {
  display: block;
  margin-bottom: .15rem;
  color: #dfb98c;
  font: 600 clamp(.58rem, 1.7vw, .72rem)/1.25 system-ui, sans-serif;
}

.member-nav-name {
  display: block;
  font: 500 clamp(.76rem, 2.9vw, 1.14rem)/1.15 Georgia, serif;
}

.member-nav-arrow {
  color: #e5b780;
  font-size: clamp(.72rem, 2vw, 1rem);
}
