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

/* Full-screen academy roster. All original site styles remain separate. */
html:has(.academy-home) { overflow:hidden; }
.academy-home { height:100vh; height:100dvh; overflow:hidden; display:flex; flex-direction:column; background:#050305; color:#f8eee1; }
.academy-home > header { flex:none; }
.academy-showcase { flex:1 1 0; min-height:0; display:grid; grid-template-rows:auto minmax(0,1fr) auto; align-items:center; padding:clamp(8px,1.4vh,16px) 3% clamp(8px,1.8vh,18px); position:relative; isolation:isolate; overflow:hidden; background:radial-gradient(ellipse at 50% 48%,#230b13 0%,#0c0509 42%,#030203 78%); }
.academy-showcase::before { content:""; position:absolute; inset:8px 12px 12px; border:1px solid #bc8c5740; pointer-events:none; z-index:-1; }
.academy-showcase::after { content:""; position:absolute; inset:0; background:repeating-linear-gradient(128deg,transparent 0 100px,#c57e7210 101px,transparent 102px 200px); mask-image:linear-gradient(90deg,#000,transparent 28%,transparent 72%,#000); pointer-events:none; z-index:-1; }

/* Keep the card silhouettes in the margins of the roster. */
.roster-card-background {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  user-select: none;
  mask-image: linear-gradient(90deg, #000 13%, transparent 30% 70%, #000 87%);
}

.roster-card-fan {
  position: absolute;
  width: clamp(88px, 15vmin, 156px);
  aspect-ratio: 5 / 7;
  color: #ad805d;
}

.roster-card-fan-left { left: 6%; bottom: 23%; transform: rotate(-13deg); }
.roster-card-fan-right { right: 6%; top: 22%; transform: rotate(12deg); }

.roster-background-card {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 8%;
  border: 1px solid currentColor;
  border-radius: 8%;
  background: radial-gradient(ellipse at 50% 42%, #251018, #0d060b 78%);
  opacity: .25;
  font: 14px/1 Georgia, serif;
}

.roster-background-card::before {
  content: "";
  position: absolute;
  inset: 6%;
  border: 1px solid currentColor;
  border-radius: 5%;
  opacity: .48;
}

.roster-background-card > span:nth-child(2) {
  place-self: center;
  font-size: clamp(32px, 6.5vmin, 67px);
  opacity: .68;
}

.roster-background-card > span:last-child {
  justify-self: end;
  transform: rotate(180deg);
}

.roster-card-fan-left > :first-child { transform: translate(33%, -10%) rotate(22deg); }
.roster-card-fan-right > :first-child { transform: translate(-33%, 9%) rotate(-23deg); }
.roster-card-fan-left > :first-child,
.roster-card-fan-right > :last-child { color: #ab525f; }

@media (max-width: 700px) {
  .roster-card-fan-left { left: -6%; bottom: 19%; }
  .roster-card-fan-right { right: -6%; top: 18%; }
  .roster-background-card { opacity: .18; }
}

/* Academy title: a restrained gold-and-crimson masthead. */
.showcase-heading { text-align:center; position:relative; padding:5px 12px 7px; width:100%; }
.showcase-heading p { display:flex; align-items:center; justify-content:center; gap:.65em; font-size:clamp(.55rem,1.2vh,.675rem); font-weight:500; letter-spacing:.24em; color:#d7b88f; margin:0; line-height:1.4; }
.showcase-heading p::before,.showcase-heading p::after { content:""; display:block; height:1px; width:clamp(14px,4vw,55px); flex-shrink:0; background:linear-gradient(90deg,transparent,#a7744a); }
.showcase-heading p::after { transform:rotate(180deg); }
.showcase-heading p span { color:#b8475a; font-size:.75em; }
.showcase-heading h1 { font-size:clamp(27px,5.5vh,52px); line-height:1.05; letter-spacing:.018em; margin:.13em 0 0; font-weight:normal; color:#fff1df; text-shadow:0 2px 20px #a33b3940; }
.showcase-heading h1 em { color:#e7bb86; font-weight:normal; text-shadow:0 2px 20px #c27b4438; }
.showcase-heading::after { content:""; display:block; width:clamp(80px,15vw,200px); height:1px; margin:6px auto 0; background:linear-gradient(90deg,transparent,#903b49 32%,#d4a36f 50%,#903b49 68%,transparent); }
.formation { width:100%; height:100%; min-height:0; position:relative; }
.academy-board { display:block; position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.academy-portrait { cursor:pointer; outline:none; opacity:1; animation:portrait-arrive .72s cubic-bezier(.2,.7,.3,1) backwards; animation-delay:var(--delay); transition:opacity .25s; }
.portrait-panel { transform-box:fill-box; transform-origin:center; transition:transform .28s ease,filter .28s ease; pointer-events:none; }
.portrait-image { pointer-events:none; transition:filter .28s ease; }
.portrait-hit { fill:transparent; pointer-events:all; }
.portrait-light { fill:transparent; stroke:#e0a17a; stroke-width:1; stroke-opacity:.38; pointer-events:none; transition:fill .25s,stroke .25s,stroke-width .25s,stroke-opacity .25s; }
.academy-board:has(.academy-portrait:is(:hover,:focus-visible)) .academy-portrait:not(:is(:hover,:focus-visible)) { opacity:.62; }
.academy-portrait:is(:hover,:focus-visible) .portrait-panel { transform:scale(1.025); filter:drop-shadow(0 0 6px #ffc06c) drop-shadow(0 0 15px #f32252); }
.academy-portrait:is(:hover,:focus-visible) .portrait-image { filter:brightness(1.13) saturate(1.08); }
.academy-portrait:is(:hover,:focus-visible) .portrait-light { fill:#ffe9b00a; stroke:#ffdda0; stroke-width:2; stroke-opacity:1; }
.selection { display:grid; justify-items:center; text-align:center; gap:1px; min-height:0; padding:0 8px; }
.selection-index { color:#ffdda8; font-size:clamp(.7rem,1.6vh,.875rem); font-weight:700; letter-spacing:.12em; line-height:1.3; text-transform:uppercase; }
.selection p { font:normal clamp(17px,3vh,29px)/1.12 Georgia,serif; margin:0; color:#fff4e4; }
.selection-hint { font-size:clamp(9px,1.5vh,13px); letter-spacing:.035em; color:#c2aeb0; line-height:1.3; }
@keyframes portrait-arrive { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@media(max-width:600px) { .academy-showcase { padding-left:1%; padding-right:1%; } .academy-showcase::before { inset:6px; } .showcase-heading p { letter-spacing:.1em; gap:.4em; } .showcase-heading h1 { font-size:clamp(25px,7.5vw,39px); } .showcase-heading p::before,.showcase-heading p::after { width:12px; } }
@media(max-height:420px) { .showcase-heading p,.selection-hint { display:none; } .showcase-heading h1 { font-size:22px; } .showcase-heading { padding:4px 8px 3px; } .showcase-heading::after { margin-top:3px; } .selection p { font-size:16px; } .academy-showcase { padding-top:4px; padding-bottom:4px; } }
@media(prefers-reduced-motion:reduce) { .academy-portrait { animation:none; } .portrait-panel,.portrait-image,.portrait-light,.academy-portrait { transition:none; } .academy-portrait:is(:hover,:focus-visible) .portrait-panel { transform:none; } }

/* A manga-style portrait cut-in followed by a diagonal curtain. */
.profile-reveal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  background: #070307df;
  animation: profile-dim .16s ease-out both;
}

.profile-reveal[hidden] { display: none; }

.profile-reveal-frame {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 5vw, 88px);
  width: 100%;
  padding: 0 clamp(20px, 10vw, 180px);
  animation: profile-cut-in .48s cubic-bezier(.18,.78,.25,1) both;
}

.profile-reveal-frame::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 16% -10vw;
  transform: skewY(-8deg);
  border-block: 2px solid #e9b87d;
  background:
    repeating-linear-gradient(171deg, transparent 0 18px, #ffd29d21 19px 20px, transparent 21px 44px),
    linear-gradient(100deg, #22060e 3%, #8d0e2c 46%, #390916 82%, #1a050d);
  box-shadow: 0 0 64px #a41e3c66;
}

.profile-reveal-art {
  height: min(65vh, 590px);
  height: min(65dvh, 590px);
  min-width: 0;
  filter: drop-shadow(0 0 1px #f5cd9c) drop-shadow(0 12px 18px #100308);
  animation: profile-portrait-in .48s cubic-bezier(.14,.75,.25,1) both;
}

.profile-reveal-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.profile-reveal-caption {
  position: relative;
  padding: 12px 0 14px;
  animation: profile-caption-in .34s .15s ease-out both;
}

.profile-reveal-name {
  max-width: 16ch;
  margin: .24em 0 0;
  font: normal clamp(1.4rem, 4.25vw, 4.75rem)/1 Georgia, serif;
  color: #fff1e2;
  text-shadow: 0 3px 18px #24040f;
  overflow-wrap: anywhere;
}

.profile-reveal::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: -15vh calc(-20vw - 15vh);
  background: #080407;
  border-left: 2px solid #e5ae74;
  transform: translateX(110%) skewX(-16deg);
  animation: profile-curtain .32s .53s cubic-bezier(.61,.02,.3,1) both;
}

@keyframes profile-dim {
  from { background-color: #07030700; }
}

@keyframes profile-cut-in {
  from { clip-path: polygon(0 41%, 100% 27%, 100% 29%, 0 43%); }
  to { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

@keyframes profile-portrait-in {
  from { transform: translateX(-16vw) scale(.9); }
  to { transform: translateX(0) scale(1); }
}

@keyframes profile-caption-in {
  from { opacity: 0; transform: translateX(25px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@media (max-width: 600px) {
  .profile-reveal-frame { padding-inline: 6vw; gap: 5vw; }
  .profile-reveal-art { height: min(55dvh, 82vw); }
  .profile-reveal-name { font-size: clamp(1rem, 5.1vw, 1.75rem); }
}

@media (prefers-reduced-motion: reduce) {
  .profile-reveal, .profile-reveal-frame, .profile-reveal-art,
  .profile-reveal-caption, .profile-reveal::after { animation: none; }
}

/* Ink overlays follow the original portrait silhouettes. */
.portrait-ink, .portrait-halftone, .portrait-sweep, .portrait-suit {
  pointer-events: none;
}

.portrait-ink { fill: url(#roster-ink); }
.portrait-halftone { fill: url(#roster-halftone); opacity: .22; }
.portrait-sweep rect { fill: url(#roster-sweep); opacity: 0; }

.portrait-suit {
  font-family: Georgia, serif;
  fill: #f4d3a5;
  stroke: #1b0810;
  stroke-width: 5;
  paint-order: stroke fill;
  opacity: .82;
}

.academy-board:has(.academy-portrait:is(:hover,:focus-visible))
  .academy-portrait:not(:is(:hover,:focus-visible)) { opacity: .39; }

.academy-portrait:is(:hover,:focus-visible) .portrait-suit { opacity: 1; }

.selection-plate {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1px;
  width: min(27rem, 100%);
  padding: clamp(4px, .8vh, 9px) clamp(20px, 6vw, 44px);
  border-block: 1px solid #b78c5b9e;
  background:
    linear-gradient(90deg, #1b0710, #4a1424 50%, #1b0710);
  box-shadow: inset 0 0 24px #06010580;
}

.selection-plate::before, .selection-plate::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  aspect-ratio: 1;
  border: 1px solid #e5b783;
  background: #721e32;
  transform: translateY(-50%) rotate(45deg);
}

.selection-plate::before { left: 12px; }
.selection-plate::after { right: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .academy-portrait:is(:hover,:focus-visible) .portrait-sweep rect {
    transform-box: fill-box;
    animation: roster-spotlight .52s cubic-bezier(.22,.7,.4,1) both;
  }
}

@keyframes roster-spotlight {
  0% { transform: translateX(-105%) skewX(-12deg); opacity: 0; }
  24% { opacity: .8; }
  100% { transform: translateX(100%) skewX(-12deg); opacity: 0; }
}
