/* landing/showcase.css — the "your page" template showcase (#page): the introduction, the
   template picker, the three-card stage with its arrows, and the live profile card (#pcard)
   with its themes, portrait ring, username effects, effect layers, socials, Discord invite,
   audio player and meta line. The hidden control lab that drives the card's state lives at
   the end. */

/* ── Section ── */
#page.template-showcase {
  width: 100%;
  max-width: 1520px;
  margin-inline: auto;
  padding: clamp(32px, 5vw, 72px) var(--gutter);
  scroll-margin-top: 110px;
}

.stage__grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 10px;
}

/* ── Layout: picker on the left, stage on the right, introduction across the top ── */
.template-layout {
  position: relative;
  display: grid;
  grid-template-columns: clamp(100px, 9vw, 132px) minmax(0, 1fr);
  gap: 24px clamp(16px, 2vw, 32px);
  align-items: center;
  min-width: 0;
}

.template-layout > .profile__head {
  grid-column: 1 / -1;
  z-index: 3;
  width: 100%;
  max-width: 660px;
  margin: 0;
  text-align: left;
}

/* #page keeps these three ahead of the shared `.landing-atmosphere .section` type rules. */
#page .profile__head .eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 23px;
  margin: 0 0 8px;
}

/* A small crimson cross, the note's mark, before the eyebrow. */
#page .profile__head .eyebrow::before {
  content: "";
  display: block;
  flex: none;
  width: 26px;
  height: 39px;
  background: #f00646;
  clip-path: polygon(38% 0, 62% 0, 62% 26%, 100% 26%, 100% 47%, 62% 47%, 62% 100%, 38% 100%, 38% 47%, 0 47%, 0 26%, 38% 26%);
  transform: rotate(-6deg);
}

#page .profile__head h2 {
  font-size: clamp(28px, 2.7vw, 42px);
  line-height: 1.12;
  margin: 0;
  letter-spacing: -.035em;
}

#page .profile__head .sub {
  font-size: 14px;
  line-height: 1.5;
  margin: 12px 0 0;
  max-width: 100%;
}

/* ── Template picker ── */
.template-sidebar {
  min-width: 0;
  align-self: center;
  padding: 0;
}

.template-thumbs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 100%;
  padding: 4px;
}

.template-thumb {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid #ffffff20;
  border-radius: 12px;
  overflow: hidden;
  background: #10101390;
  color: #ddd;
  text-align: left;
  cursor: pointer;
  transition: border-color .25s, transform .25s;
}

.template-thumb img {
  width: 32px;
  height: 44px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 7px;
}

.template-thumb span {
  font-size: 12px;
}

.template-thumb[aria-pressed="true"] {
  border-color: #ff245880;
  box-shadow: 0 0 0 2px #ff245820;
  background: #241119;
  color: white;
}

.template-thumb:focus-visible,
.template-side:focus-visible {
  outline: 2px solid #ff3765;
  outline-offset: 3px;
}

/* ── Stage: previous card, live card, next card ── */
.template-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px) minmax(0, 1fr);
  gap: clamp(10px, 1.5vw, 22px);
  align-items: center;
  padding: 12px 24px 18px;
  min-width: 0;
  touch-action: pan-y;
  isolation: isolate;
  /* Entering and leaving slides are contained without a scroll container. */
  overflow: hidden;
  overflow: clip;
}

/* Pointer input is held while the carousel animates. */
.template-stage[aria-busy="true"] > .pcard-wrap {
  pointer-events: none;
}

/* The frozen snapshots that travel during a transition. */
.template-motion-card {
  contain: layout style;
  backface-visibility: hidden;
}

.template-side {
  display: block;
  position: relative;
  height: clamp(280px, 28vw, 360px);
  padding: 0;
  border: 1px solid #ffffff18;
  border-radius: 22px;
  overflow: hidden;
  background: #101013;
  color: white;
  text-align: center;
  cursor: pointer;
  opacity: .62;
  transform: scale(.9);
  transform-origin: center;
  transition: opacity .25s;
}

.template-side:hover {
  transform: scale(.9);
  opacity: .85;
}

.template-side-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.52);
}

.template-side-profile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.template-side-profile img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 50%;
}

.template-side-profile strong {
  font-size: 17px;
}

.template-side-profile > span {
  display: none;
  font-size: 14px;
  color: #ddd;
}

/* Arrows are created by showcase.js and appended to the stage. */
.template-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #ffffff2b;
  border-radius: 50%;
  background: #101013ed;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 20px #0008;
  transition: background .2s, border-color .2s;
}

.template-arrow svg {
  width: 18px;
  height: 18px;
}

.template-arrow--prev {
  left: 0;
  right: auto;
}

.template-arrow--next {
  right: 0;
}

.template-arrow:hover {
  background: #271018;
  border-color: #f0064680;
}

.template-arrow:focus-visible {
  outline: 2px solid #ff3765;
  outline-offset: 3px;
}

/* ── The live card ── */
.pcard-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  justify-self: center;
  perspective: 1200px;
  width: 100%;
  max-width: 480px;
  min-width: 0;
}

#pcard {
  --rx: 0deg;
  --ry: 0deg;
  --profile-accent: #ff2448;
  --crimson: var(--profile-accent);
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 480px;
  min-width: 0;
  margin-inline: auto;
  border: 1px solid color-mix(in srgb, var(--profile-accent) 65%, #161616);
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #3a0012, #0a0506 62%);
  box-shadow: 0 0 0 2px #080808, 0 0 0 3px color-mix(in srgb, var(--profile-accent) 18%, transparent), 0 36px 70px -30px #000c;
  color: #fff;
  /* The tilt is eased frame by frame in showcase.js, so transform has no transition. */
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: border-color .35s, box-shadow .35s;
}

#pcard[data-theme="white"] {
  --profile-accent: #f3f3f5;
  background: #000;
}

#pcard[data-theme="green"] {
  --profile-accent: #72e8a1;
}

#pcard[data-theme="pink"] {
  --profile-accent: #ff8bd4;
  border-color: transparent;
  box-shadow: none;
}

/* Preview cursors: the libraries draw their own pointer, so the native one steps back. */
#pcard[data-cursor="blood-orb"],
#pcard[data-cursor="sleepy-cat"] {
  --preview-cursor: auto;
}

#pcard[data-cursor="frog"] {
  --preview-cursor: url("/assets/cursors/frog/lily-pad-cursor.svg") 12 12, auto;
}

#pcard[data-cursor]:not([data-cursor="default"]),
#pcard[data-cursor]:not([data-cursor="default"]) * {
  cursor: var(--preview-cursor);
}

/* ── Card background: still, effect layers, shade, glare ── */
.pcard__still {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .6s;
}

.pcard[data-bg="still"] .pcard__still {
  opacity: .9;
}

#pcard[data-theme="white"] .pcard__still {
  opacity: 1;
}

/* Rain refracts the still, so it sits with it behind the shade. */
.pcard__rain-layer {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}

.pcard__fireflies-layer,
.pcard__sakura-layer,
.pcard__snow-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}

.pcard__rain,
.pcard__fireflies,
.pcard__sakura,
.pcard__snow {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#pcard[data-background-effect="rain"].is-rain-ready .pcard__rain-layer,
#pcard[data-background-effect="fireflies"] .pcard__fireflies-layer,
#pcard[data-background-effect="sakura"] .pcard__sakura-layer,
#pcard[data-background-effect="snow"] .pcard__snow-layer {
  opacity: 1;
}

.pcard__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, rgba(5, 6, 6, .35), rgba(5, 6, 6, .25) 35%, rgba(5, 6, 6, .82));
}

/* A lighter shade lets the rain glass read. */
#pcard[data-background-effect="rain"].is-rain-ready .pcard__shade {
  background: linear-gradient(180deg, rgba(5, 6, 6, .18), rgba(5, 6, 6, .12) 35%, rgba(5, 6, 6, .62));
}

/* The glare layer is not shown on the landing (display: none). */
.pcard__glare {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(60% 50% at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .2), transparent 70%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity .3s;
}

.pcard:hover .pcard__glare {
  opacity: 1;
}

/* ── Card body ── */
.pcard__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: auto;
  min-height: 470px;
  gap: 12px;
  padding: clamp(16px, 2vw, 26px);
  text-align: center;
}

/* ── Portrait with its accent ring ── */
.pcard__avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: visible;
  background: transparent;
  box-shadow: 0 0 0 5px #080808;
  font-size: clamp(34px, 3vw, 52px);
  font-weight: 800;
  text-transform: lowercase;
  transition: box-shadow .3s;
}

.pcard__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

#pcard[data-theme="green"] .pcard__avatar img {
  object-fit: cover;
  object-position: 50% 42%;
}

#pcard[data-theme="pink"] .pcard__avatar img,
#pcard[data-theme="white"] .pcard__avatar img {
  object-fit: cover;
  object-position: center;
}

/* The ring is a conic gradient cut to a 3px band with a mask; it is static and 86px wide. */
.pcard__avatar::after {
  content: "";
  position: absolute;
  inset: -5px;
  padding: 3px;
  border-radius: inherit;
  background: conic-gradient(from 12deg, transparent 0deg, color-mix(in srgb, var(--profile-accent) 65%, #080808) 8deg, var(--profile-accent) 34deg, color-mix(in srgb, var(--profile-accent) 80%, #080808) 76deg, transparent 94deg 178deg, color-mix(in srgb, var(--profile-accent) 60%, #080808) 190deg, var(--profile-accent) 218deg, color-mix(in srgb, var(--profile-accent) 70%, #080808) 244deg, transparent 258deg 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

#pcard.no-border .pcard__avatar {
  box-shadow: none;
}

#pcard.no-border .pcard__avatar::after {
  display: none;
}

/* ── Name and username effects ── */
.pcard__name {
  margin: 6px 0 0;
  font-family: var(--font-ui);
  font-size: 32px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  max-width: 100%;
}

.ufx {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ufx span {
  display: inline-block;
}

/* Name changes cross-fade, or glitch when the glitch effect is on. */
#uname {
  transition: opacity .42s ease;
}

#uname.is-name-fading {
  opacity: 0;
}

#uname.ufx--glitch.is-name-glitching {
  animation: username-switch-glitch .57s steps(1, end) both;
}

@keyframes username-switch-glitch {
  0%, 100% {
    transform: none;
  }

  18% {
    transform: translate(-3px, 1px) skewX(-9deg);
  }

  35% {
    transform: translate(4px, -1px) skewX(7deg);
  }

  55% {
    transform: translate(-2px, 0) skewX(-4deg);
  }

  78% {
    transform: translate(1px, 0);
  }
}

.ufx--glitch {
  animation: glitch-skew 2.4s steps(1) infinite;
}

.ufx--glitch::before,
.ufx--glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ufx--glitch::before {
  color: var(--crimson);
  clip-path: inset(0 0 55% 0);
  transform: translate(-2px, -1px);
  animation: glitch-a 1.9s steps(2) infinite;
}

.ufx--glitch::after {
  color: #37e6ff;
  clip-path: inset(58% 0 0 0);
  transform: translate(2px, 1px);
  animation: glitch-b 2.3s steps(2) infinite;
}

@keyframes glitch-a {
  0% {
    transform: translate(-2px, -1px);
  }

  40% {
    transform: translate(3px, 1px);
  }

  60% {
    transform: translate(-4px, 0);
  }

  100% {
    transform: translate(-1px, 1px);
  }
}

@keyframes glitch-b {
  0% {
    transform: translate(2px, 1px);
  }

  30% {
    transform: translate(-3px, 0);
  }

  70% {
    transform: translate(4px, -1px);
  }

  100% {
    transform: translate(1px, 0);
  }
}

@keyframes glitch-skew {
  0%, 92%, 100% {
    transform: none;
  }

  94% {
    transform: skewX(8deg);
  }

  96% {
    transform: skewX(-6deg);
  }
}

.ufx--pulse {
  animation: profile-theme-pulse 1.6s ease-in-out infinite;
}

@keyframes profile-theme-pulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 0 transparent;
  }

  50% {
    transform: scale(1.06);
    text-shadow: 0 0 22px var(--profile-accent);
  }
}

.ufx--outline {
  color: transparent;
  -webkit-text-stroke: 1.2px var(--profile-accent);
}

.ufx--wave .ch {
  animation: name-wave 1.3s ease-in-out infinite;
  animation-delay: calc(var(--i) * .07s);
}

@keyframes name-wave {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

.ufx--shadow {
  text-shadow: 2px 2px 0 var(--profile-accent), 4px 4px 0 color-mix(in srgb, var(--profile-accent) 55%, transparent), 6px 6px 0 color-mix(in srgb, var(--profile-accent) 25%, transparent);
}

@keyframes profile-caret {
  0%, 49% {
    opacity: 1;
  }

  50%, 100% {
    opacity: 0;
  }
}

/* ── Bio line: typed, held, erased by showcase.js ── */
.pcard__bio {
  margin: 0;
  min-height: 1.5em;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .62);
  white-space: nowrap;
}

.pcard__bio [data-profile-bio]::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 3px;
  background: currentColor;
  vertical-align: -.12em;
  animation: profile-caret 1s step-end infinite;
  animation-play-state: paused;
}

.pcard__bio.is-typing [data-profile-bio]::after {
  animation-play-state: running;
}

/* ── Socials ── */
.pcard__socials {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
  padding: 4px 0;
}

.pcard__social {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--profile-accent);
  transition: transform .25s ease;
}

.pcard__social svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--profile-accent) 60%, transparent)) drop-shadow(0 0 9px color-mix(in srgb, var(--profile-accent) 33%, transparent));
}

.pcard__social:hover svg,
.pcard__social:focus-visible svg {
  filter: drop-shadow(0 0 5px var(--profile-accent)) drop-shadow(0 0 12px color-mix(in srgb, var(--profile-accent) 55%, transparent));
}

.pcard__social:focus-visible {
  outline: 2px solid var(--profile-accent);
  outline-offset: 4px;
}

/* ── Discord invite ── */
.profile-discord-invite {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px;
  background: rgba(8, 5, 8, .55);
  color: #fff;
  text-align: left;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.profile-discord-invite:hover {
  background: rgba(18, 12, 18, .7);
  border-color: rgba(255, 255, 255, .3);
}

.profile-discord-invite:focus-visible {
  outline: 2px solid var(--profile-accent, #ff2448);
  outline-offset: 4px;
}

.profile-discord-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  object-fit: cover;
}

.profile-discord-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.profile-discord-copy strong {
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.profile-discord-copy > span {
  font-size: 12px;
  color: #a2a0a4;
}

/* ── Audio player ── */
.pcard__audio {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 0;
  padding: 14px 12px;
  border-width: 1px;
  border-style: solid;
  border-radius: 20px;
  text-align: left;
  backdrop-filter: blur(12px);
}

/* The theme tint keeps #pcard's specificity: it must outrank `html.gpu-lite .pcard__audio`. */
#pcard .pcard__audio {
  border-color: color-mix(in srgb, var(--profile-accent) 25%, transparent);
  background: color-mix(in srgb, var(--profile-accent) 6%, #08090a99);
  transition: border-color .35s, background .35s;
}

.audio-cover {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
}

.audio-track {
  flex: 1;
  min-width: 120px;
  font-size: 12px;
}

.audio-track b {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 500;
  color: #f4f0f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}

.audio-timeline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aaa4b1;
  font: 12px ui-monospace, monospace;
}

.audio-elapsed,
.audio-duration {
  flex: none;
}

.audio-seek {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  min-width: 25px;
  width: 100%;
  height: 5px;
  margin: 0;
  border-radius: 100px;
  background: #ffffff26;
  cursor: pointer;
}

.audio-seek::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 18px;
  border: 0;
  border-radius: 100px;
  background: #fff;
}

.audio-seek::-moz-range-thumb {
  width: 24px;
  height: 18px;
  border: 0;
  border-radius: 100px;
  background: #fff;
}

.audio-seek:focus-visible {
  outline: 2px solid var(--profile-accent);
  outline-offset: 6px;
}

.audio-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  width: 104px;
  margin: 0 auto;
  padding: 0;
  font-size: 12px;
}

.audio-controls svg {
  width: 19px;
  height: 19px;
  stroke: #aaa4b1;
  stroke-width: 1.5;
  fill: #aaa4b133;
  stroke-linejoin: round;
}

.audio-controls .audio-pause {
  width: 25px;
  height: 25px;
  fill: #eeeaf1;
  stroke: #eeeaf1;
}

.audio-play {
  display: grid;
  place-items: center;
  padding: 8px;
  margin: -8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.audio-skip {
  display: grid;
  place-items: center;
  padding: 6px;
  margin: -6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.audio-play:focus-visible,
.audio-skip:focus-visible {
  outline: 2px solid var(--profile-accent);
  outline-offset: 3px;
}

/* ── Meta line ── */
.pcard__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, .6);
}

.pcard__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pcard__meta .ic {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ── Parts switched off by the lab's toggles ── */
#pcard.no-audio .pcard__audio {
  display: none;
}

#pcard.no-audio .pcard__meta {
  margin-top: auto;
}

#pcard.no-views [data-part="views"],
#pcard.no-joined [data-part="joined"] {
  display: none;
}

/* ── Tablet (≤1050px): the picker becomes a row above a narrower stage ── */
@media (max-width: 1050px) {
  .template-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The eyebrow mark is dropped with the single-column layout. */
  #page .profile__head .eyebrow {
    display: none !important;
  }

  .template-sidebar {
    grid-column: 1;
    width: 100%;
    max-width: 580px;
    margin-inline: auto;
  }

  .template-thumbs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
  }

  .template-thumb {
    min-width: 0;
  }

  .template-stage {
    grid-column: 1;
    grid-template-columns: minmax(16px, 1fr) minmax(0, 460px) minmax(16px, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 900px;
    margin-inline: auto;
    padding-inline: 12px;
  }

  .template-side-profile {
    display: none;
  }
}

/* ── ≤760px: picker tiles stack their image over the label ── */
@media (max-width: 760px) {
  .template-thumb {
    flex-direction: column;
    text-align: center;
  }
}

/* ── Phone (≤700px): the showcase is hidden on phones (first rule). The rules after it only
   keep the hidden subtree's computed styles as they were; none of them renders. ── */
@media (max-width: 700px) {
  #page.template-showcase {
    display: none !important;
    max-width: 540px;
    padding: 64px var(--gutter);
  }

  .template-layout {
    gap: 24px;
  }

  .template-layout > .profile__head {
    max-width: none;
  }

  #page .profile__head .eyebrow {
    font-size: 22px;
    margin-bottom: 14px;
  }

  #page .profile__head h2 {
    display: none;
    font-size: clamp(32px, 8.5vw, 43px);
    line-height: 1.13;
  }

  #page .profile__head .sub {
    font-size: 15px;
    line-height: 1.75;
  }

  .template-thumbs {
    gap: 5px;
    padding: 5px;
    border: 1px solid #ffffff0e;
    border-radius: 16px;
    background: #131014;
  }

  .template-thumb {
    flex-direction: row;
    justify-content: center;
    gap: 5px;
    min-height: 48px;
    padding: 8px 3px;
    border-color: transparent;
    border-radius: 11px;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .template-thumb img {
    width: 8px;
    height: 8px;
    border-radius: 50%;
  }

  .template-thumb span {
    font-size: 11px;
  }

  .template-thumb[aria-pressed="true"] {
    border-color: #f0064633;
    box-shadow: none;
    background: #2b1721;
    color: #fff;
  }

  /* One card at a time; the neighbours wait off-screen on either side. */
  .template-stage {
    display: block;
    gap: 7px;
    width: 100%;
    max-width: 480px;
    margin: auto;
    padding: 2px 0 66px;
  }

  .template-side {
    position: absolute;
    top: 2px;
    width: 100%;
    height: calc(100% - 68px);
    border-radius: 26px;
    transform: none;
  }

  .template-side--prev {
    left: -110%;
    right: auto;
  }

  .template-side--next {
    left: 110%;
    right: auto;
  }

  .template-side-profile {
    display: flex;
  }

  .template-arrow {
    top: auto;
    bottom: 8px;
    transform: none;
    width: 44px;
    height: 44px;
    background: #151117;
    border-color: #ffffff1c;
    box-shadow: none;
  }

  .template-arrow--prev {
    left: calc(50% - 52px);
    right: auto;
  }

  .template-arrow--next {
    right: calc(50% - 52px);
    left: auto;
  }

  .pcard-wrap,
  #pcard {
    max-width: none;
  }

  #pcard {
    border-radius: 26px;
  }

  .pcard__body {
    min-height: 0;
    padding: 24px 16px 18px;
  }

  .pcard__avatar {
    width: 80px;
    height: 80px;
  }

  .pcard__social {
    min-width: 44px;
    min-height: 44px;
  }

  .profile-discord-invite {
    min-height: 70px;
    border-radius: 16px;
  }

  .profile-discord-icon {
    border-radius: 12px;
  }

  .pcard__audio {
    padding: 12px;
    border-radius: 18px;
  }

  .audio-track {
    min-width: 0;
  }

  .audio-controls {
    justify-content: center;
    gap: 16px;
    width: 100%;
    margin: 0;
  }

  .audio-controls button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 10px;
  }

  .audio-seek {
    height: 24px;
    background: transparent;
  }

  .audio-seek::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 8px;
    background: #ffffff30;
  }

  .audio-seek::-webkit-slider-thumb {
    margin-top: -7px;
  }

  .pcard__meta {
    gap: 8px;
    font-size: 10px;
    line-height: 1.5;
  }
}

@media (max-width: 600px) {
  .template-stage {
    gap: 4px;
  }
}

@media (max-width: 360px) {
  .template-thumb img {
    display: none;
  }

  .template-thumb span {
    font-size: 10px;
  }
}

/* ── Motion ── */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pcard__social:hover {
    transform: translateY(-2px) scale(1.06);
  }
}

@media (prefers-reduced-motion: no-preference) {
  /* Typewriter: letters appear one by one behind a blinking caret. */
  .ufx--typewriter .ch {
    position: relative;
    visibility: hidden;
  }

  .ufx--typewriter .ch.is-typed {
    visibility: visible;
  }

  .ufx--typewriter .ch.is-caret::after,
  .ufx--typewriter.is-typing-empty::after {
    content: "";
    position: absolute;
    top: .12em;
    left: 100%;
    width: 2px;
    height: .85em;
    margin-left: 2px;
    background: currentColor;
    animation: profile-caret 1s step-end infinite;
  }

  .ufx--typewriter.is-typing-empty::after {
    left: 0;
    margin-left: 0;
  }

  .ufx--typewriter.is-typewriter-paused::after,
  .ufx--typewriter.is-typewriter-paused .ch::after {
    animation-play-state: paused;
  }
}

@media (prefers-reduced-motion: reduce) {
  .template-thumb,
  #pcard,
  #pcard .pcard__audio,
  .pcard__social,
  .pcard__rain-layer,
  .pcard__fireflies-layer,
  .pcard__sakura-layer,
  .pcard__snow-layer,
  #uname {
    transition: none;
  }

  .pcard__bio [data-profile-bio]::after {
    display: none;
  }
}

/* ── The lab: the card's controls. It is hidden (`hidden` + display:none) and only drives
   state through showcase.js; its rules keep its computed styles as they were. ── */
.stage__lab {
  display: grid;
  min-width: 0;
  gap: 24px;
  padding: 24px;
  border: 0;
  border-top: 1px solid #ffffff12;
  border-radius: 0;
  background: transparent;
}

.stage__lab[hidden] {
  display: none !important;
}

.lab__row {
  display: grid;
  gap: 10px;
}

.lab__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute);
}

.picks,
.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pick {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(8, 9, 10, .7);
  font-size: 14px;
  font-weight: 600;
  color: var(--ash);
  transition: color .2s, border-color .2s, background .2s, transform .2s var(--ease);
}

.pick:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, .28);
}

.pick[aria-checked="true"] {
  color: #fff;
  background: var(--crimson);
  border-color: var(--crimson);
}

.pick:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.pick:focus-visible,
.toggle:focus-visible {
  outline: 2px solid var(--ivory);
  outline-offset: 3px;
}

.cursor-pick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cursor-pick[aria-checked="true"] {
  background: rgba(240, 6, 70, .12);
  border-color: #f00646;
}

.cursor-pick img,
.cursor-swatch {
  width: 24px;
  height: 24px;
  flex: none;
  display: inline-grid;
  place-items: center;
  font-size: 23px;
  line-height: 1;
}

.blood-orb-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: url("/assets/cursors/blood-orb/orb-frames.webp") 0 0 / 216px 72px no-repeat;
}

.frog-cursor-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: none;
  background: url("/assets/cursors/frog/frog-sprite.webp") 0 0 / 216px 24px no-repeat;
  image-rendering: pixelated;
}

.theme-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.theme-pick > span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px #ffffff30;
}

.theme-pick[aria-checked="true"] {
  color: var(--swatch);
  border-color: var(--swatch);
  background: color-mix(in srgb, var(--swatch) 10%, transparent);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px 12px 7px 7px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  font-size: clamp(14px, 1.2vw, 22px);
  font-weight: 600;
  color: var(--ash);
  transition: color .2s, border-color .2s;
}

.toggle i {
  position: relative;
  flex: none;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  transition: background .2s;
}

.toggle i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform .25s var(--ease);
}

.toggle[aria-checked="true"] {
  color: var(--text);
  border-color: rgba(240, 6, 70, .5);
}

.toggle[aria-checked="true"] i {
  background: var(--crimson);
}

.toggle[aria-checked="true"] i::after {
  transform: translateX(12px);
}

.stage__note {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 22px;
  font-weight: 600;
  color: var(--ash);
  transform: rotate(-1.5deg);
}

@media (max-width: 480px) {
  [data-picks="cursor"] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* No font-size here: `#page :is(.pick, .toggle)` kept every pick at 14px. */
  .cursor-pick {
    justify-content: center;
    gap: 5px;
    padding-inline: 8px;
  }

  .cursor-pick img,
  .cursor-swatch {
    width: 20px;
    height: 20px;
  }
}

@media (hover: none) {
  .stage__note {
    display: none;
  }
}
