/* The welcome (js/panels/welcome.js): a stage where the interface performs
   what the site is for, one line of display type, one paragraph, and the way
   on. The scenes are small real markup sized in container units of the stage,
   so the same choreography fits a desktop sheet and a phone. */

/* The home scrolls inside .lib, independently of the body. CSS releases both
   locks as soon as the dialog closes. The gutter stays so the page does not shift. */
body:has(> dialog.welcome[open]),
body:has(> dialog.welcome[open]) .lib {
  overflow: hidden;
  overscroll-behavior: none;
  scrollbar-gutter: stable;
}

.dialog.welcome::backdrop {
  position: fixed;
  inset: 0;
}

.dialog.welcome {
  --wl-ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* never taller than the window: the stage is as wide as the height left for it allows */
  width: min(900px, calc(100vw - 28px), calc((100dvh - 330px) * 16 / 9));
  min-width: min(560px, calc(100vw - 28px));
  max-width: none;
  outline: 0;
  padding: 0;
  overflow: hidden;
}

.welcome .dialog-body {
  padding: 0;
  overflow: hidden auto;
}

.wl {
  display: grid;
}

/* the display values below would otherwise show what is switched off */
.welcome [hidden] {
  display: none !important;
}

/* ---------- the stage ---------- */

.wl-stage {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  margin: 14px 14px 0;
  border-radius: 22px;
  overflow: hidden;
  /* a small room of its own: the ground and the light of the real pages, so
     the trays and covers read here as they do on a board */
  background:
    radial-gradient(85% 120% at 12% 0%, rgba(64, 84, 150, 0.4), transparent 62%),
    radial-gradient(80% 110% at 100% 100%, rgba(120, 62, 118, 0.3), transparent 64%),
    #06070b;
  box-shadow: inset 0 0 0 1px var(--rim-soft, var(--line));
  touch-action: pan-y;
  user-select: none;
}

[data-appearance='light'] .wl-stage {
  background:
    radial-gradient(85% 120% at 12% 0%, rgba(160, 184, 236, 0.85), transparent 62%),
    radial-gradient(80% 110% at 100% 100%, rgba(230, 180, 222, 0.75), transparent 64%),
    #eef0f6;
  box-shadow: inset 0 0 0 1px rgb(var(--shade, 20 24 40) / 0.08);
}

/* the tray every scene sets its things on: the board's own glass, rim and shadow */
.wl-tier,
.wl-chart,
.wl-feed,
.wl-award {
  background: var(--glass-tray, var(--bg-2));
  box-shadow: inset 0 1px 0 var(--rim-soft, var(--line)), inset 0 0 0 1px var(--rim-soft, var(--line)), 0 2.6cqw 4.4cqw -3.4cqw rgb(var(--shade, 0 0 0) / 0.7);
}

[data-appearance='light'] :is(.wl-tier, .wl-chart, .wl-feed, .wl-award) {
  box-shadow: inset 0 1px 0 var(--rim, #fff), 0 0 0 1px rgb(var(--shade, 20 24 40) / 0.07), 0 2.6cqw 4.4cqw -3.2cqw rgb(var(--shade, 20 24 40) / 0.45);
}

.wl-scene {
  position: absolute;
  inset: 0;
  padding: 3cqw 3.4cqw;
  transition: opacity 0.3s, transform 0.5s var(--wl-ease);
}

/* a slide arrives from the side it was asked from, and leaves by fading */
.wl-scene.from-right {
  opacity: 0;
  transform: translateX(28px);
}

.wl-scene.from-left {
  opacity: 0;
  transform: translateX(-28px);
}

.wl-scene.is-leaving {
  opacity: 0;
  transition-duration: 0.2s;
}

/* between two runs of a scene everything goes dim for a moment, then starts over */
.wl-scene > * {
  transition: opacity 0.4s;
}

.wl-stage .wl-scene.is-out > * {
  opacity: 0;
}

/* shared pieces */
.wl-plan-search { display: flex; align-items: center; gap: 2cqw; min-height: 7cqw; padding: 1.4cqw 2.4cqw; border-radius: 12px; color: var(--ink-2); background: var(--glass-tray, var(--bg-2)); }
.wl-plan-search > svg { width: 20px; height: 20px; flex: none; }
.wl-plan-query { max-width: 80%; overflow: hidden; white-space: nowrap; font: 500 max(13px, 2.5cqw)/1.3 var(--font-ui); transition: opacity .5s var(--wl-ease); opacity: .55; }
.wl-plan.is-found .wl-plan-query { opacity: 1; }
.wl-plan-body { display: grid; grid-template-columns: 24cqw minmax(0, 1fr); gap: 5cqw; align-items: center; margin: 4cqw 5cqw 0; }
.wl-plan-cover .wl-cover { width: 24cqw; height: 32cqw; border-radius: 9px; }
.wl-plan-detail { min-width: 0; }
.wl-plan-name { display: block; font: 650 clamp(15px, 3.6cqw, 28px)/1.12 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.wl-plan-detail > p { margin: 1.4cqw 0 2.6cqw; color: var(--ink-2); font-size: max(13px, 2.4cqw); }
.wl-plan-choices { display: flex; flex-wrap: wrap; gap: 1cqw; }
.wl-plan-status { padding: 1.2cqw 1.8cqw; border-radius: 8px; font: 500 max(12px, 2.3cqw)/1.2 var(--font-ui); color: var(--ink-2); background: color-mix(in srgb, var(--ink) 5%, transparent); transition: background .4s var(--wl-ease), color .4s var(--wl-ease); }
.wl-plan-status.is-chosen { color: var(--ink); background: color-mix(in srgb, var(--ink) 16%, transparent); }
.wl-plan-saved { display: flex; align-items: center; gap: 1.2cqw; margin-top: 2.4cqw; color: var(--ink-2); font-size: max(13px, 2.4cqw); opacity: 0; transform: translateY(8px); transition: opacity .45s var(--wl-ease), transform .65s var(--wl-ease); }
.wl-plan-saved svg { width: 18px; height: 18px; }
.wl-plan.is-saved .wl-plan-saved { opacity: 1; transform: none; }
@media (max-width: 620px) {
  .wl-plan-body { margin: 4cqw 0 0; grid-template-columns: 28cqw minmax(0, 1fr); gap: 4cqw; }
  .wl-plan-cover .wl-cover { width: 28cqw; height: 38cqw; }
  .wl-plan-choices { display: grid; gap: 6px; }
  .wl-plan-status { padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .wl-plan-query, .wl-plan-status, .wl-plan-saved { transition: none; }
}
.wl-cover {
  position: relative;
  display: block;
  flex: none;
  border-radius: 0.35cqw;
  overflow: hidden;
  background: linear-gradient(160deg, hsl(var(--hue, 220) 46% 30%), hsl(var(--hue, 220) 48% 14%));
  box-shadow: 0 0.8cqw 1.6cqw -0.9cqw rgb(var(--shade, 0 0 0) / 0.9);
}

.wl-cover.is-poster {
  aspect-ratio: 2 / 3;
}

.wl-cover.is-square {
  aspect-ratio: 1;
}

.wl-cover b {
  display: block;
  padding: 10% 10% 0;
  color: #f2f4f2;
  font: 650 clamp(5px, 1cqw, 9px) / 1.1 var(--font-display);
  overflow-wrap: anywhere;
}

.wl-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s;
}

.wl-cover img.is-loaded {
  opacity: 1;
}

.wl-chip {
  display: grid;
  place-items: center;
  flex: none;
  width: 4.4cqw;
  aspect-ratio: 1;
  border-radius: 30%;
  font: 650 clamp(9px, 2cqw, 17px) / 1 var(--font-display);
}

.wl-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 5.6cqw;
  aspect-ratio: 1;
  border-radius: 32%;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  box-shadow: inset 0 0 0 1px var(--rim-soft, var(--line));
  color: var(--ink);
  font: 600 clamp(9px, 2.2cqw, 19px) / 1 var(--font-display);
}

.wl-bar {
  display: block;
  height: max(3px, 0.45cqw);
  border-radius: 99px;
  overflow: hidden;
  background: color-mix(in srgb, var(--ink) 14%, transparent);
}

.wl-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- scene: the mark opens into a shelf ---------- */

/* The greeting: the site's mark with its name, then the mark's tiles turn round and are covers, and more are
   dealt out beside them. The board is laid out as it stands when open; until then it is drawn smaller and aside
   (--hx, measured by the scene), with the name beside it. */
.wl-hello {
  display: grid;
  place-content: center;
  padding-bottom: 8.6cqw;
}

.wl-hello-board {
  position: relative;
  display: grid;
  gap: 2.4cqw;
  transform-origin: 0 50%;
  transform: translateX(var(--hx, 0px)) scale(0.62);
  transition: opacity 0.4s, transform 0.95s var(--wl-ease);
}

.wl-hello.is-open .wl-hello-board {
  transform: none;
}

.wl-hello-row {
  display: flex;
  align-items: center;
  gap: 1.8cqw;
}

/* Rank is brightness; the covers bring the colour in either theme. */
.wl-hello-label {
  display: grid;
  place-items: center;
  flex: none;
  width: 15cqw;
  aspect-ratio: 1;
  margin-right: 0.6cqw;
  border-radius: 29%;
  background: var(--ink);
  color: var(--bg);
}

/* the mark has no letters (they sent the eye looking for them in the name); the board it opens into has its own */
.wl-hello-label b {
  color: inherit;
  font: 650 6.6cqw / 1 var(--font-display);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.5s 0.3s, transform 0.7s 0.3s var(--wl-ease);
}

.wl-hello.is-open .wl-hello-label b {
  opacity: 0.94;
  transform: none;
}

.wl-hello-row + .wl-hello-row .wl-hello-label {
  background: color-mix(in srgb, var(--ink) 72%, var(--bg));
}

.wl-hello-tile {
  position: relative;
  flex: none;
  height: 15cqw;
  perspective: 70cqw;
}

.wl-hello-tile.is-poster {
  aspect-ratio: 2 / 3;
}

.wl-hello-tile.is-square {
  aspect-ratio: 1;
}

.wl-hello-tile .wl-cover {
  width: 100%;
  height: 100%;
  border-radius: 0.9cqw;
}

/* a tile of the mark: grey on its face, a cover on its back */
.wl-hello-card {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.85s var(--wl-ease);
}

.wl-hello-card > * {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.wl-hello-card > .wl-cover {
  transform: rotateY(180deg);
}

.wl-hello-tile.is-turned .wl-hello-card {
  transform: rotateY(180deg);
}

/* The mark's tiles stay neutral until their covers turn into view. */
.wl-hello-blank {
  border-radius: 3cqw;
  background: color-mix(in srgb, var(--ink) 44%, transparent);
}

.wl-hello-row + .wl-hello-row .wl-hello-blank {
  background: color-mix(in srgb, var(--ink) 26%, transparent);
}

/* the ones dealt out afterwards */
.wl-hello-tile.is-late {
  opacity: 0;
  transform: translateX(-2.4cqw) scale(0.94);
  transition: opacity 0.4s, transform 0.65s var(--wl-ease);
}

.wl-hello-tile.is-late.is-dealt {
  opacity: 1;
  transform: none;
}

.wl-hello-name {
  position: absolute;
  top: var(--ny, 50%);
  left: var(--nx, 50%);
  color: var(--ink-2);
  font: 650 7.4cqw / 1 var(--font-display);
  letter-spacing: -0.04em;
  white-space: nowrap;
  translate: 0 -50%;
  transition: opacity 0.35s, transform 0.7s var(--wl-ease);
}

.wl-hello-name b {
  color: var(--ink);
  font-weight: inherit;
}

.wl-hello.is-open .wl-hello-name {
  opacity: 0;
  transform: translateX(3cqw);
}

/* what stands on the shelf, said under it */
.wl-hello-kinds {
  position: absolute;
  right: 0;
  bottom: 4.8cqw;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 2.6cqw;
  margin: 0;
  color: var(--ink-2);
  font: 500 clamp(9px, 1.95cqw, 16px) / 1.3 var(--font-display);
}

.wl-hello-kinds span {
  opacity: 0;
  transform: translateY(0.9cqw);
  transition: opacity 0.45s, transform 0.6s var(--wl-ease);
  transition-delay: calc(var(--i) * 70ms);
}

.wl-hello.is-said .wl-hello-kinds span {
  opacity: 1;
  transform: none;
}

/* put back to the beginning at once, between two runs */
.wl-hello.is-instant,
.wl-hello.is-instant * {
  transition: none;
}

/* ---------- scene: ranking ---------- */

.wl-rank {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 1.6cqw;
}

.wl-board {
  display: grid;
  align-content: start;
  gap: 1.2cqw;
}

.wl-tier,
.wl-pool {
  display: grid;
  grid-template-columns: 7cqw minmax(0, 1fr);
  align-items: center;
  padding: 0.8cqw 1.6cqw;
  border-radius: 1.8cqw;
}

.wl-tier {
  transition: background-color 0.6s;
}

.wl-tier.is-lit {
  background: color-mix(in srgb, var(--ink) 13%, transparent);
  transition-duration: 0.12s;
}

.wl-pool {
  outline: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent);
  outline-offset: -1px;
}

.wl-pool-name {
  color: var(--ink-3);
  font: 500 clamp(6px, 1.25cqw, 11.5px) / 1.1 var(--font-mono, ui-monospace, monospace);
  overflow: hidden;
  text-overflow: ellipsis;
}

.wl-row {
  display: flex;
  gap: 1.6cqw;
}

.wl-slot {
  flex: none;
  width: 6.4cqw;
  aspect-ratio: 2 / 3;
}

/* the tiers stop short of the right edge, where a closer look opens */
.wl-rank .wl-board {
  padding-right: 0;
}

/* the covers travel in a layer of their own, placed over the slots */
.wl-layer {
  position: absolute;
  inset: 0;
  padding: 0;
  pointer-events: none;
}

.wl-layer .wl-cover {
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.62s var(--wl-ease), scale 0.22s var(--wl-ease), box-shadow 0.22s;
}

.wl-layer.is-instant .wl-cover {
  transition: none;
}

/* picked up: nearer, with a longer shadow */
.wl-layer .wl-cover.is-held {
  z-index: 2;
  scale: 1.1;
  box-shadow: 0 2.4cqw 3cqw -1.4cqw rgb(var(--shade, 0 0 0) / 0.95);
}

/* a legend: the gilded edge of the real board, and the light that crosses it once */
.wl-layer .wl-cover.is-legend {
  outline: max(1.5px, 0.22cqw) solid #e3b54a;
  outline-offset: 0;
  box-shadow: 0 0 0 1px rgba(60, 40, 0, 0.4), 0 1.6cqw 3cqw -1.4cqw rgba(233, 189, 79, 0.7);
}

.wl-layer .wl-cover.is-legend::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 244, 200, 0.75) 50%, transparent 65%);
  transform: translateX(-120%);
}

.wl-layer .wl-cover.is-glinting::after {
  animation: wl-glint 1.3s cubic-bezier(0.45, 0, 0.2, 1) 0.25s;
}

@keyframes wl-glint {
  to {
    transform: translateX(120%);
  }
}

/* a closer listen: the sleeve and the record that comes out of it and turns,
   drawn the way the music room draws them */
.wl-album {
  position: absolute;
  top: 7.4cqw;
  right: 17cqw;
  display: grid;
  gap: 1.2cqw;
  width: 15cqw;
  opacity: 0;
  transform: translateY(1.4cqw) scale(0.97);
  transition: opacity 0.35s, transform 0.5s var(--wl-ease);
}

.wl-scene .wl-album {
  transition: opacity 0.35s, transform 0.5s var(--wl-ease);
}

.wl-album.is-open {
  opacity: 1;
  transform: none;
}

.wl-sleeve {
  position: relative;
  display: block;
}

.wl-sleeve .wl-cover {
  width: 100%;
  box-shadow: 0 1.6cqw 2.6cqw -1.4cqw rgb(var(--shade, 0 0 0) / 0.9);
}

.wl-disc {
  position: absolute;
  top: 3%;
  right: 3%;
  width: 94%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #e9e4da 0 2.2%, hsl(var(--hue, 20) 55% 48%) 2.6% 17%, #0b0b0c 17.5% 18.5%, transparent 19%),
    conic-gradient(from 200deg, transparent 0deg, rgba(255, 255, 255, 0.34) 25deg, transparent 50deg, transparent 180deg, rgba(255, 255, 255, 0.2) 205deg, transparent 230deg),
    repeating-radial-gradient(circle, #18181c 0 1.1px, #30303a 1.5px 2.3px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.26), 0 0.8cqw 1.6cqw -0.6cqw rgba(0, 0, 0, 0.6);
  transform: translateX(25%);
  transition: transform 0.6s var(--wl-ease);
}

.wl-album.is-playing .wl-disc {
  transform: translateX(72%) rotate(240deg);
  animation: wl-record-out 0.6s var(--wl-ease), wl-record-turn 2.4s linear 0.6s infinite;
}

@keyframes wl-record-out {
  from {
    transform: translateX(25%);
  }
  to {
    transform: translateX(72%) rotate(240deg);
  }
}

@keyframes wl-record-turn {
  from {
    transform: translateX(72%) rotate(240deg);
  }
  to {
    transform: translateX(72%) rotate(600deg);
  }
}

.wl-album-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink);
  font: 600 clamp(8px, 1.6cqw, 14.5px) / 1.2 var(--font-display);
  letter-spacing: -0.02em;
}

.wl-album.is-playing .wl-bar i {
  animation: wl-fill 4.2s linear 0.4s forwards;
}

@keyframes wl-fill {
  to {
    transform: scaleX(1);
  }
}

/* ---------- scene: profile, achievement, friends ---------- */

.wl-social {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 3.4cqw;
  padding: 3cqw 4.4cqw;
}

.wl-me {
  display: grid;
  gap: 3cqw;
}

.wl-profile {
  display: flex;
  align-items: center;
  gap: 1.8cqw;
}

.wl-profile .wl-avatar {
  width: 10cqw;
  font-size: clamp(13px, 4cqw, 34px);
}

.wl-name {
  display: block;
  color: var(--ink);
  font: 650 clamp(13px, 3.8cqw, 32px) / 1.05 var(--font-display);
  letter-spacing: -0.03em;
}

.wl-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2cqw 1.4cqw;
  margin-top: 0.8cqw;
  color: var(--ink-3);
  font: 500 clamp(6px, 1.4cqw, 12.5px) / 1.3 var(--font-mono, ui-monospace, monospace);
}

.wl-count b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.wl-award,
.wl-feed {
  border-radius: 2cqw;
}

.wl-award {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.8cqw;
  padding: 2cqw 2.2cqw;
}

.wl-award-text {
  display: grid;
  gap: 0.6cqw;
  min-width: 0;
}

.wl-award-text small,
.wl-feed-what small {
  color: var(--ink-3);
  font-size: clamp(6px, 1.4cqw, 12.5px);
}

.wl-award-text b,
.wl-feed-who,
.wl-feed-what > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink);
  font: 600 clamp(7px, 1.85cqw, 16px) / 1.2 var(--font-ui);
}

.wl-award .wl-bar {
  margin-top: 0.5cqw;
}

.wl-award .wl-bar i {
  transition: transform 0.9s var(--wl-ease);
}

.wl-award.is-earned .wl-bar i {
  transform: scaleX(0.66);
}

.wl-feed {
  display: grid;
  gap: 0.4cqw;
  padding: 1cqw;
}

.wl-feed-row {
  display: grid;
  grid-template-columns: auto 7.6cqw minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5cqw;
  min-height: 11cqw;
  padding: 1cqw 1.4cqw;
  border-radius: 1.4cqw;
  opacity: 0;
  transform: translateY(1.2cqw);
  transition: opacity 0.4s, transform 0.55s var(--wl-ease);
}

.wl-feed-row.is-in {
  opacity: 1;
  transform: none;
}

.wl-feed-what {
  display: grid;
  gap: 0.2cqw;
  min-width: 0;
}

.wl-thumbs {
  display: flex;
  gap: 0.5cqw;
}

.wl-thumbs .wl-cover {
  width: 3.8cqw;
  box-shadow: none;
}

/* ---------- scene: dots against the critics, then the picture ---------- */

.wl-taste {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 2.4cqw;
  padding: 3cqw 4.4cqw;
}

.wl-chart {
  display: grid;
  gap: 0.6cqw;
  width: 63%;
  padding: 2cqw 2.2cqw;
  border-radius: 2cqw;
}

.wl-lane {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2cqw;
}

.wl-lane .wl-chip {
  width: 4.4cqw;
  font-size: clamp(8px, 1.9cqw, 16px);
}

.wl-track {
  position: relative;
  height: 7.4cqw;
}

.wl-dot,
.wl-mean {
  position: absolute;
  left: calc(100% * var(--x));
  top: 50%;
}

.wl-dot {
  width: 1.8cqw;
  aspect-ratio: 1;
  margin: -0.9cqw 0 0 -0.9cqw;
  border-radius: 50%;
  box-shadow: 0 0 0 0.25cqw var(--wl-surface, #14151b);
  scale: 0;
  transition: scale 0.4s var(--wl-ease);
}

.wl-dot.is-in {
  scale: 1;
}

.wl-mean {
  width: max(1px, 0.2cqw);
  height: 4.8cqw;
  margin-top: -2.4cqw;
  border-radius: 1px;
  background: color-mix(in srgb, var(--ink) 46%, transparent);
  scale: 1 0;
  transition: scale 0.35s var(--wl-ease);
}

.wl-mean.is-in {
  scale: 1 1;
}

.wl-verdict {
  margin: 0;
  padding-left: 1.8cqw;
  color: var(--ink-2);
  font-size: clamp(8px, 1.8cqw, 15.5px);
  opacity: 0;
  transform: translateY(0.8cqw);
  transition: opacity 0.4s, transform 0.5s var(--wl-ease);
}

.wl-scene .wl-verdict {
  transition: opacity 0.4s, transform 0.5s var(--wl-ease);
}

.wl-verdict.is-in {
  opacity: 1;
  transform: none;
}

/* the board as the picture it exports to: it rises at the right and settles at a slight angle */
.wl-export {
  position: absolute;
  top: 8cqw;
  right: 4.4cqw;
  width: 27cqw;
  opacity: 0;
  transform: translateY(5cqw) rotate(0deg);
  transition: opacity 0.4s, transform 0.75s var(--wl-ease);
}

.wl-scene .wl-export {
  transition: opacity 0.4s, transform 0.75s var(--wl-ease);
}

.wl-export.is-open {
  opacity: 1;
  transform: rotate(-3deg);
}

/* the picture wears the appearance, as the export itself does */
.wl-picture {
  display: grid;
  gap: 1cqw;
  padding: 1.8cqw 1.8cqw 1.4cqw;
  border-radius: 1.4cqw;
  background: var(--bg, #0b0c12);
  box-shadow: inset 0 0 0 1px var(--rim-soft, rgba(255, 255, 255, 0.1)), 0 0 0 1px rgb(var(--shade, 0 0 0) / 0.12), 0 3.4cqw 5cqw -3cqw rgb(var(--shade, 0 0 0) / 0.95);
}

.wl-picture-title {
  color: var(--ink, #f5f6fa);
  font: 650 clamp(7px, 1.7cqw, 15px) / 1.1 var(--font-display);
  letter-spacing: -0.03em;
}

.wl-picture-tier {
  display: flex;
  align-items: center;
  gap: 0.8cqw;
  padding: 0.6cqw;
  border-radius: 0.9cqw;
  background: var(--glass-tray, rgba(255, 255, 255, 0.055));
  box-shadow: inset 0 0 0 1px rgb(var(--shade, 0 0 0) / 0.06);
}

.wl-picture-tier .wl-chip {
  width: 2.6cqw;
  font-size: clamp(6px, 1.2cqw, 11px);
}

.wl-picture-tier .wl-cover {
  width: 3.4cqw;
  box-shadow: none;
}

.wl-mark {
  justify-self: end;
  color: var(--ink-2, rgba(245, 246, 250, 0.6));
  font: 650 clamp(6px, 1.1cqw, 10px) / 1 var(--font-display);
  letter-spacing: -0.02em;
}

/* the tag sits on the upper corner: the wordmark at the foot stays in sight */
.wl-export-tag {
  position: absolute;
  z-index: 1;
  right: -1.4cqw;
  top: -1.5cqw;
  display: inline-flex;
  align-items: center;
  gap: 0.6cqw;
  padding: 0.8cqw 1.4cqw;
  border-radius: 99px;
  background: var(--ink);
  color: var(--bg);
  font: 650 clamp(7px, 1.3cqw, 12px) / 1 var(--font-ui);
  box-shadow: 0 1.4cqw 2.4cqw -1.4cqw rgb(var(--shade, 0 0 0) / 0.9);
  scale: 0;
  transition: scale 0.45s var(--wl-ease) 0.45s;
}

.wl-export.is-open .wl-export-tag {
  scale: 1;
}

.wl-export-tag svg {
  width: 1.5cqw;
  height: 1.5cqw;
  min-width: 9px;
  min-height: 9px;
}

/* ---------- the words and the way on ---------- */

.wl-copy {
  display: grid;
  gap: 8px;
  padding: 22px 30px 2px;
}

.wl-title {
  margin: 0;
  color: var(--ink);
  font: 650 clamp(25px, 3.4vw, 36px) / 1.06 var(--font-display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* three lines are kept, so the sheet does not change height between slides */
.wl-text {
  max-width: 64ch;
  min-height: 4.5em;
  margin: 0;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.5;
  text-wrap: pretty;
}

/* how it should look: offered on the last slide, where Skip stood */
.wl-look {
  grid-area: skip;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-2);
  font-size: 14px;
}

.wl-foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: 'skip dots actions';
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 16px 22px 20px 30px;
}

.wl-dots {
  grid-area: dots;
}

.wl-actions {
  grid-area: actions;
}

.wl-skip {
  grid-area: skip;
  justify-self: start;
  color: var(--ink-3);
  font-weight: 600;
}

.wl-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.wl-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wl-dots button {
  position: relative;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 26%, transparent);
  cursor: pointer;
  transition: width 0.35s var(--wl-ease), background-color 0.2s;
}

/* easier to press than an 8px mark */
.wl-dots button::before {
  content: '';
  position: absolute;
  inset: -10px -4px;
}

.wl-dots button[aria-current='true'] {
  width: 24px;
  background: var(--ink);
}

.wl-dots button:focus-visible {
  outline: 2px solid var(--focus, var(--ink));
  outline-offset: 4px;
}

[data-theme='aurora'][data-appearance='light'] .welcome {
  --wl-surface: #f4f5f9;
}

/* ---------- a phone: the sheet fills the screen, the stage is taller ---------- */

@media (max-width: 620px) {
  .dialog.welcome {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
  }

  .wl-stage {
    aspect-ratio: 4 / 3;
    margin: 10px 10px 0;
    border-radius: 18px;
  }

  .wl-scene {
    padding: 4cqw;
  }

  .wl-slot {
    width: 8.6cqw;
  }

  .wl-tier,
  .wl-pool {
    grid-template-columns: 9.5cqw minmax(0, 1fr);
    padding: 1cqw 2cqw;
  }

  .wl-chip {
    width: 6cqw;
  }

  .wl-album {
    top: 9cqw;
    right: 19cqw;
    width: 19cqw;
  }

  .wl-social {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 2.4cqw;
  }

  .wl-me {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
    align-items: center;
  }

  .wl-feed-row {
    min-height: 9.6cqw;
  }

  .wl-feed-row:nth-child(3) {
    display: none;
  }

  .wl-chart {
    width: 100%;
  }

  .wl-track {
    height: 7.4cqw;
  }

  .wl-dot {
    width: 2.2cqw;
    margin: -1.1cqw 0 0 -1.1cqw;
  }

  .wl-mean {
    height: 5cqw;
    margin-top: -2.5cqw;
  }

  .wl-export {
    top: auto;
    bottom: 5cqw;
    right: 5cqw;
    width: 36cqw;
  }

  .wl-copy {
    padding: 18px 20px 2px;
  }

  .wl-text {
    min-height: 6em;
    font-size: 15px;
  }

  .wl-foot {
    grid-template-columns: auto 1fr auto;
    padding: 12px 14px 18px 20px;
  }

  .dialog.welcome {
    min-width: 0;
  }

  /* the last slide: the choice of appearance gets a line of its own, Back gives way */
  .wl.is-last .wl-foot {
    grid-template-columns: auto 1fr;
    grid-template-areas: 'skip skip' 'dots actions';
    row-gap: 14px;
  }

  .wl.is-last .wl-actions .btn.ghost {
    display: none;
  }

  .wl-dots {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wl-scene,
  .wl-scene > *,
  .wl-layer .wl-cover,
  .wl-album,
  .wl-disc,
  .wl-export,
  .wl-export-tag,
  .wl-verdict,
  .wl-feed-row,
  .wl-dot,
  .wl-mean,
  .wl-award .wl-bar i,
  .wl-dots button {
    transition: none;
  }

  .wl-album.is-playing .wl-bar i,
  .wl-layer .wl-cover.is-glinting::after {
    animation: none;
  }

  .wl-album.is-playing .wl-bar i {
    transform: scaleX(0.4);
  }

  .wl-album.is-playing .wl-disc {
    animation: none;
    transform: translateX(72%) rotate(240deg);
  }
}

/* ---------- what is new: the scenes of the tour after a large update (public/js/panels/news.js) ---------- */

.wl-kicker {
  margin: 0 0 6px;
  color: var(--ink-3);
  font: 650 12px / 1 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wl-news {
  display: grid;
  place-items: center;
}

.wl-news.is-dim .wn-card {
  opacity: 0;
}

.wn-card {
  display: grid;
  gap: 1.8cqw;
  width: min(70cqw, 520px);
  padding: 2.4cqw 2.6cqw;
  border-radius: 2.6cqw;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -34px rgba(0, 0, 0, 0.7);
  transition: opacity 0.4s;
}

/* 1. the list is finished, and its places become numbers */
.wn-done {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: start;
  padding: 0.7cqw 1.6cqw 0.7cqw 1.1cqw;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink-3);
  font: 600 clamp(11px, 1.7cqw, 14px) / 1 var(--font-ui);
  transition: background-color 0.3s, color 0.3s;
}

.wn-done .i {
  width: 1.2em;
  height: 1.2em;
}

.wn-done.is-on {
  background: var(--ink);
  color: var(--bg);
}

.wn-scores .score-ladder {
  gap: 0.6cqw;
}

.wn-scores .sl-row {
  grid-template-columns: 6.4cqw minmax(0, 1fr) auto;
  gap: 1.4cqw;
  min-height: 0;
  padding: 0.6cqw 1.6cqw 0.6cqw 0.6cqw;
  border-radius: 1.6cqw;
}

.wn-scores .sl-tier {
  min-height: 4.8cqw;
  border-radius: 1.2cqw;
  font-size: clamp(11px, 2.1cqw, 16px);
}

.wn-scores .sl-scores {
  gap: 0.6cqw;
  flex-wrap: nowrap;
}

.wn-scores .sl-n {
  min-width: 5.4cqw;
  height: 3.9cqw;
  padding: 0 0.6cqw;
  border-radius: 1cqw;
  font-size: clamp(9px, 1.9cqw, 14px);
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.26s, transform 0.4s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.wn-scores .sl-n.is-in {
  opacity: 1;
  transform: none;
}

/* 2. a take, and what is said under it */
.wn-take {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: clamp(12px, 2cqw, 15px);
}

.wn-take .profile-avatar,
.wn-talk .talk-who .profile-avatar {
  width: clamp(22px, 4.2cqw, 34px);
  height: clamp(22px, 4.2cqw, 34px);
  border-radius: 30%;
  font-size: clamp(10px, 1.8cqw, 14px);
}

.wn-take small {
  color: var(--ink-3);
}

.wn-take .mark-score {
  margin-left: auto;
}

.wn-talk .talk {
  gap: 1.4cqw;
  margin: 0;
}

.wn-talk .talk-list {
  gap: 1.2cqw;
}

.wn-talk .talk-item {
  grid-template-columns: auto minmax(0, 1fr);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.wn-talk .talk-item.is-in {
  opacity: 1;
  transform: none;
}

.wn-talk :is(.talk-text, .talk-meta) {
  font-size: clamp(11px, 1.9cqw, 14.5px);
}

.wn-talk .talk-like {
  min-height: clamp(24px, 4.2cqw, 34px);
  font-size: clamp(11px, 1.8cqw, 13px);
}

.wn-field {
  display: flex;
  align-items: center;
  min-height: clamp(28px, 5cqw, 40px);
  font-size: clamp(11px, 1.9cqw, 14.5px);
}

.wn-typed::after {
  content: '';
  display: inline-block;
  width: 1px;
  height: 1.1em;
  margin-left: 1px;
  background: currentColor;
  vertical-align: -0.2em;
  animation: wn-caret 0.9s steps(2) infinite;
}

.wn-talk .talk-send {
  width: clamp(28px, 5cqw, 40px);
  height: clamp(28px, 5cqw, 40px);
}

@keyframes wn-caret {
  50% { opacity: 0; }
}

/* 3. the switch, the address, the page */
.wn-own .wn-card {
  justify-items: start;
}

.wn-switch {
  pointer-events: none;
  font-size: clamp(12px, 2cqw, 15px);
}

.wn-address,
.wn-page {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

:is(.wn-address, .wn-page).is-in {
  opacity: 1;
  transform: none;
}

.wn-address {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 0.9cqw 1.8cqw 0.9cqw 1.3cqw;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  font: 500 clamp(11px, 1.8cqw, 14px) / 1 var(--font-mono, monospace);
}

.wn-address .i {
  width: 1.1em;
  height: 1.1em;
  color: var(--ink-3);
}

.wn-page {
  display: grid;
  gap: 1.6cqw;
  justify-self: stretch;
  padding: 1.8cqw;
  border-radius: 1.8cqw;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.wn-lists {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2cqw;
}

.wn-list {
  display: flex;
  gap: 4%;
  align-items: flex-end;
  justify-content: center;
  aspect-ratio: 16 / 10;
  padding: 10% 8% 0;
  border-radius: 1.4cqw;
  background: color-mix(in srgb, hsl(var(--hue) 80% 60%) 20%, var(--bg-2));
  overflow: hidden;
}

.wn-list i {
  flex: 1;
  height: 86%;
  border-radius: 12% 12% 0 0;
  background: hsl(var(--hue) 70% 66% / 0.75);
}

.wn-list i:nth-child(2) {
  height: 100%;
  background: hsl(var(--hue) 80% 72%);
}

@media (prefers-reduced-motion: reduce) {
  .wn-scores .sl-n,
  .wn-talk .talk-item,
  .wn-address,
  .wn-page {
    transition: none;
  }

  .wn-typed::after {
    animation: none;
  }
}

/* 4. a poster fills in: tiles grey while waiting, in colour once done */
.wn-poster-head { display: flex; align-items: baseline; justify-content: space-between; gap: 2cqw; }
.wn-poster-head b { font: 650 clamp(22px, 6cqw, 52px)/1 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.wn-poster-head small { color: var(--ink-2); font-size: clamp(10px, 1.9cqw, 15px); }
.wn-tiles { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1cqw; }
.wn-tile { aspect-ratio: 2 / 3; border-radius: 0.5cqw; background: linear-gradient(160deg, hsl(var(--hue) 60% 62%), hsl(calc(var(--hue) + 30) 55% 32%)); filter: grayscale(1); opacity: 0.32; transition: filter 0.7s, opacity 0.7s, transform 0.7s; }
.wn-tile.is-done { filter: none; opacity: 1; transform: translateY(-0.3cqw); }

/* 5. the diary keeps the days */
.wn-month { margin: 0; font: 600 clamp(12px, 2.6cqw, 21px)/1.2 var(--font-display); }
.wn-days { display: grid; gap: 0.8cqw; margin: 0; padding: 0; list-style: none; }
.wn-day { display: grid; grid-template-columns: 5cqw 1fr auto; align-items: center; gap: 1.6cqw; padding: 1cqw 0; border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(0.8cqw); transition: opacity 0.45s, transform 0.45s; }
.wn-day.is-in { opacity: 1; transform: none; }
.wn-day b { font: 500 clamp(12px, 2.8cqw, 22px)/1 var(--font-mono); text-align: center; }
.wn-day span { font: 600 clamp(11px, 2.2cqw, 18px)/1.2 var(--font-display); }
.wn-day small { color: var(--ink-2); font-size: clamp(10px, 1.7cqw, 14px); }

/* 6. plans in one's own order, and a pick for tonight */
.wn-plans { display: grid; gap: 0.8cqw; margin: 0; padding: 0; list-style: none; }
.wn-plan { display: grid; grid-template-columns: 3cqw 1fr; align-items: center; gap: 1.4cqw; padding: 1.2cqw 1.6cqw; border-radius: 1.4cqw; background: color-mix(in srgb, var(--ink) 5%, transparent); transition: background 0.4s, box-shadow 0.4s; }
.wn-plan small { color: var(--ink-3); font: 500 clamp(10px, 1.9cqw, 15px)/1 var(--font-mono); }
.wn-plan span { font: 600 clamp(11px, 2.2cqw, 18px)/1.2 var(--font-display); }
.wn-plan.is-picked { background: color-mix(in srgb, var(--ink) 12%, transparent); box-shadow: inset 0 0 0 0.2cqw var(--ink); }
.wn-pick { justify-self: start; display: inline-flex; align-items: center; gap: 1cqw; padding: 1.2cqw 2.2cqw; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-2); font: 600 clamp(11px, 2cqw, 16px)/1 var(--font-ui); transition: background 0.4s, color 0.4s; }
.wn-pick.is-on { background: color-mix(in srgb, var(--ink) 16%, transparent); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.wn-pick .i svg { width: clamp(12px, 2.2cqw, 18px); height: clamp(12px, 2.2cqw, 18px); }
@media (prefers-reduced-motion: reduce) { .wn-tile, .wn-day, .wn-plan, .wn-pick { transition: none; } }
