.academy-club {
  --canvas: var(--bg);
  --ink: #faf7f2;
  --soft: #a8a19a;
  --peach: #ffad7d;
  display: grid;
  justify-items: center;
  padding: clamp(30px, 5vw, 56px) clamp(14px, 3vw, 32px) 22px;
  border: 1px solid #45342a;
  border-radius: 24px;
  background: radial-gradient(ellipse 560px 250px at 50% 30%, #2e2018, #1b1816);
  text-align: center;
  scroll-margin-top: 105px;

  > h2 { font-size: clamp(29px, 5vw, 49px); letter-spacing: -.045em; }
  > h2 span { color: var(--peach); font-size: .45em; vertical-align: middle; }
  > h2 a:hover { color: var(--peach); }
  .club-intro { max-width: 46ch; margin-top: 10px; color: var(--muted); font-size: 16px; }
  .icon-line {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  button, input { font: inherit; }
  .discord-avatars[hidden] { display: none; }

  .newsletter { width: min(100%, 496px); margin: 23px auto 0; scroll-margin-block: 24px; }
  .newsletter-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 6px;
    border: 1px solid #5b4638;
    border-radius: 16px;
    background: #1e1b19;
    box-shadow: 0 8px 22px #08070542;
  }
  .newsletter-fields:focus-within { border-color: #b1764e; }
  .email-field { display: flex; align-items: center; gap: 10px; padding: 0 9px 0 12px; color: #cb9777; }
  .email-field input { width: 100%; min-width: 0; min-height: 47px; padding: 0; border: 0; background: transparent; color: var(--ink); }
  .email-field input::placeholder { color: #bdb2a7; opacity: 1; }
  .email-field input:focus-visible { outline: none; }
  .email-field:has(input:focus-visible) { box-shadow: inset 0 0 0 1px #ee92618c; border-radius: 10px; }
  .subscribe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    min-height: 47px;
    border: 1px solid #ffb17d;
    border-radius: 10px;
    padding: 0 clamp(11px, 1.5vw, 20px);
    background: linear-gradient(167deg, #ffa666 0%, #ff7a30 47%, #fb691b 69%, #ff8d46 100%);
    box-shadow: inset 0 1px 1px #ffdebd80, 0 3px 12px #ff6a1540;
    color: #221006;
    font-weight: 700;
    white-space: nowrap;
  }
  .subscribe span { font-size: 20px; }
  .subscribe:hover { filter: brightness(1.09); }

  .discord { width: min(100%, 645px); margin-top: 9px; }
  .mascots-stage {
    position: relative;
    isolation: isolate;
    height: clamp(176px, 26vw, 242px);
    overflow: hidden;
    background: radial-gradient(ellipse 49% 47% at 50% 58%, #62331555, transparent);
  }
  .orbit {
    position: absolute;
    z-index: -1;
    top: 58%;
    left: 50%;
    width: 83%;
    height: 43%;
    border: 1px solid #e4945c34;
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(-9deg);
  }
  .orbit-inner { width: 67%; height: 31%; border-color: #e4945c29; }
  .orbit-star { position: absolute; z-index: -1; color: #dd976c; text-shadow: 0 0 12px #ec782e95; }
  .star-left { top: 27%; left: 16%; font-size: 19px; }
  .star-right { top: 22%; right: 17%; font-size: 14px; }

  .mascot {
    --shift: 0%;
    --scale: 1;
    --sprite-x: 0%;
    --sprite-y: 0%;
    --sole: 92.6%;
    position: absolute;
    bottom: 9%;
    left: 50%;
    width: clamp(129px, 41%, 221px);
    aspect-ratio: 1;
    opacity: 0;
    /* Place the scaling origin at the feet so every position shares a baseline. */
    transform-origin: 50% var(--sole);
    transform: translate(calc(-50% + var(--shift)), calc(100% - var(--sole))) scale(var(--scale));
    transition: transform .65s cubic-bezier(.23,.72,.27,1), opacity .45s ease, filter .5s ease;
    pointer-events: none;
  }
  .mascot-headphones, .mascot-notebook { --sprite-x: 50%; }
  .mascot-camera, .mascot-cheer { --sprite-x: 100%; }
  .mascot-laptop, .mascot-notebook, .mascot-cheer { --sprite-y: 100%; }
  .mascot-laptop { --sole: 85.9%; }
  .mascot-notebook { --sole: 86.7%; }
  .mascot-cheer { --sole: 85.2%; }
  .mascot span {
    display: block;
    width: 100%;
    height: 100%;
    background: url('/assets/studio/club/mini-mascottes.webp') var(--sprite-x) var(--sprite-y) / 300% 200% no-repeat;
  }
  .mascot[data-position='0'] { z-index: 2; opacity: 1; filter: drop-shadow(0 11px 12px #0006); }
  .mascot:is([data-position='-1'], [data-position='1']) { --scale: .68; z-index: 1; opacity: .86; filter: brightness(.77) drop-shadow(0 8px 8px #0008); }
  .mascot[data-position='-1'] { --shift: -65%; }
  .mascot[data-position='1'] { --shift: 65%; }
  .mascot:is([data-position='-2'], [data-position='2']) { --scale: .46; opacity: .66; filter: brightness(.68); }
  .mascot[data-position='-2'] { --shift: -112%; }
  .mascot[data-position='2'] { --shift: 112%; }
  .mascot[data-position='3'] { --scale: .35; }

  .discord-link { display: inline-grid; justify-items: center; width: min(100%, 570px); min-height: 95px; margin-top: clamp(12px, 1.2vw, 16px); padding: 0 0 6px; border-radius: 12px; }
  .discord-link h2 { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 36px; font-size: clamp(21px, 2.7vw, 28px); letter-spacing: -.045em; line-height: 1.1; }
  .discord-link h2 img { width: 34px; height: 34px; object-fit: contain; }
  .discord-link h2 span { margin-left: 2px; color: var(--peach); font-size: .68em; }
  .discord-link:hover h2 { color: var(--peach); }
  .discord-link p { color: var(--soft); font-size: 14px; }
  .discord-avatars {
    --avatar-size: 48px;
    --overlap: 13px;
    --avatars-per-row: 14;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: min(100%, calc((var(--avatar-size) - var(--overlap)) * var(--avatars-per-row) + var(--overlap)));
    min-height: var(--avatar-size);
    margin-top: 9px;
    padding-inline: calc(var(--overlap) / 2);
    row-gap: 3px;
  }
  .discord-avatar { position: relative; flex: none; width: var(--avatar-size); height: var(--avatar-size); margin-inline: calc(var(--overlap) / -2); overflow: hidden; border: 3px solid var(--canvas); border-radius: 50%; background: #342921; }
  .discord-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .discord-avatar img + img { animation: academy-discord-avatar-in .35s ease-in-out both; }
}

@keyframes academy-discord-avatar-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 550px) {
  .academy-club .discord-avatars { --avatar-size: 43px; --overlap: 10px; --avatars-per-row: 7; }
  .academy-club .mascot:is([data-position='-2'], [data-position='2']) { opacity: 0; }
}

@media (max-width: 365px) {
  .academy-club .email-field { padding: 0 3px 0 6px; }
  .academy-club .email-field .icon { display: none; }
  .academy-club .subscribe { gap: 7px; }
}

.academy-club-about {
  margin-top: clamp(24px, 5vw, 48px);

  .newsletter { scroll-margin-top: 105px; }
  .newsletter-fields {
    gap: 0;
    padding: 3px;
    border-color: #77736d;
    border-radius: 999px;
    background: #161615;
    box-shadow: none;
  }
  .newsletter-fields:has(input:focus-visible) { outline: 2px solid #ffa066; outline-offset: 2px; }
  .email-field:has(input:focus-visible) { box-shadow: none; }
  .email-field input { min-height: 44px; font-size: 16px; }
  .email-field input::placeholder { color: #aca9a4; }
  .subscribe {
    min-height: 44px;
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: inherit;
    background: var(--metal-face) padding-box, var(--metal-edge) border-box;
    color: var(--white);
    font-size: 14px;
    box-shadow: 0 2px 4px #0009, 0 7px 20px #0008;
  }
  .subscribe:is(:hover, :focus-visible) {
    box-shadow: 0 0 0 1px var(--metal-hover-ring), 0 0 20px var(--metal-glow), 0 4px 10px #0009;
    filter: none;
  }
}

@media (max-width: 365px) {
  .academy-club-about .email-field input { font-size: 14px; }
  .academy-club-about .subscribe { padding-inline: 12px; }
}
