/*
 * The site. The look follows nibras.co: one grotesque sans, a quiet page, amber as the one
 * accent, light and dark through light-dark(). The mascot is the only loud thing on the page.
 */
@font-face {
  font-family: "Timeless Sans";
  src: url("/fonts/timeless-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: light-dark(#fbfaf7, #17181c);
  --fg: light-dark(#18181b, #ececf1);
  --soft: light-dark(#5b5b66, #a1a1ad);
  --line: light-dark(#e7e5e0, #2b2d34);
  --card: light-dark(#ffffff, #1e2025);
  --sunk: light-dark(#f2f0eb, #121316);
  --accent: light-dark(#eab308, #facc15);
  --accent-ink: light-dark(#8a5a00, #facc15);
  --dither: light-dark(rgb(234 179 8 / 0.55), rgb(250 204 21 / 0.38));
  --bad: light-dark(#a3302c, #f08a84);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  /* The height of the small bar of the mascot, when it shows at the top of a narrow screen. */
  --bar: 0px;
  background: var(--bg);
  color: var(--fg);
  font-family: "Timeless Sans", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

::selection {
  background: color-mix(in oklab, var(--accent) 45%, transparent);
}

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* `hidden` must win over a rule that sets `display`, such as the one of a button. */
[hidden] {
  display: none !important;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.top,
main,
.foot {
  width: min(100% - 2rem, 62rem);
  margin-inline: auto;
}

.top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-block: 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.beta {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  border: 1px solid color-mix(in oklab, var(--accent) 60%, transparent);
  border-radius: 99px;
  padding: 0.05rem 0.45rem;
}

.nav {
  display: flex;
  gap: 1.1rem;
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--soft);
}

.nav a {
  padding-block: 0.4rem;
  text-decoration: none;
}

.nav a:hover {
  color: var(--fg);
}

/* On a narrow screen the name of the site and the sections do not fit in one line. */
@media (max-width: 30rem) {
  .nav a:not(:first-child) {
    display: none;
  }
}

h1 {
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 650;
  margin: 0.5rem 0 0.6rem;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 34rem;
  color: var(--soft);
  font-size: 1.05rem;
  text-wrap: pretty;
}

.note {
  margin: 0.75rem 0 0;
  max-width: 34rem;
  color: var(--soft);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.photo,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s var(--ease),
    border-color 0.15s var(--ease);
}

.button:hover {
  border-color: color-mix(in oklab, var(--fg) 35%, var(--line));
}

.button:active {
  transform: scale(0.97);
}

.button.primary {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.button:has(:focus-visible) {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
}

.button[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

/*
 * The check that a visitor is a person. It shows nothing unless it has a question, and then it
 * is under the line that says "Check that you are a person", clear of every button.
 */
.check[data-asking] {
  margin-top: 0.7rem;
}

/* Out of sight, but not "display: none": the widget must still run, and then ask. */
.check:not([data-asking]) {
  height: 0;
  overflow: hidden;
}

.status {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
  font-weight: 550;
}

/* The line is in the page all the time, so a screen reader hears it change. */
.status:empty {
  margin: 0;
}

.status[data-kind="error"] {
  color: var(--bad);
}

.button.big {
  min-height: 3.4rem;
  padding-inline: 1.6rem;
  font-size: 1.05rem;
}

/* The offer of the pack has the amber of the lock, so the dark button stays the next step. */
.button.pack {
  background: var(--accent);
  border-color: var(--accent);
  color: #18181b;
}

/*
 * The first screen: the pitch, an example of a photo and its mascot, and the faces to start
 * from. On a narrow screen it is one column, with the example above the buttons.
 */
.start {
  display: flex;
  flex-direction: column;
  width: min(100% - 2rem, 62rem);
  margin-inline: auto;
}

.start > *,
.pitch > * {
  min-width: 0;
}

.pitch {
  display: contents;
}

.start h1 {
  order: 1;
  font-size: clamp(2.1rem, 8.5vw, 3.25rem);
}

/*
 * A title that moves does so behind the edge of its box: text is never see-through. The space
 * under the last line keeps the tails of the letters inside that edge.
 */
.start h1,
.result h1 {
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: calc(0.6rem - 0.12em);
}

.start h1 span,
.result h1 span {
  display: block;
}

/* The title of the first screen rises one time, when the page loads. */
.start:not([data-entered]) h1 span {
  animation: rise 0.52s var(--ease) backwards;
}

@keyframes rise {
  from {
    transform: translateY(110%);
  }
}

.start .lede {
  order: 2;
}

.demo {
  order: 3;
  margin-top: 1.75rem;
}

.problem {
  order: 4;
}

.start .photo {
  order: 5;
}

.start .pitch > .note {
  order: 6;
}

.faces {
  order: 7;
}

/* On a narrow screen each way to begin is a button across the page. */
.start .photo .button {
  flex: 1 1 100%;
}

/* A photo that did not become a mascot: the words, the photo, and the button to send it again. */
.problem {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 0.9rem;
  margin-top: 1.25rem;
  padding: 0.85rem;
  border: 1px solid color-mix(in oklab, var(--bad) 30%, var(--line));
  border-radius: 18px;
  background: color-mix(in oklab, var(--bad) 9%, var(--card));
  font-size: 0.925rem;
  line-height: 1.4;
}

.problem img {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 22%;
  object-fit: cover;
  filter: grayscale(0.6);
}

.problem p {
  flex: 1 1 12rem;
  margin: 0;
  color: var(--bad);
  font-weight: 550;
}

/* The example: a photo at the left and its mascot at the right, each a little off the line. */
.pair {
  position: relative;
  aspect-ratio: 494 / 344;
}

.pair figure {
  position: absolute;
  margin: 0;
}

.pair img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22%;
  object-fit: cover;
  background: var(--sunk);
}

/* Until the pictures of the first example are there, the example does not show: it arrives. */
.pair[data-enter] figure,
.pair[data-enter] .pair-arrow {
  opacity: 0;
}

/* The picture of the example of before: it stays over the new one while it leaves. */
.pair .ghost {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pair-photo {
  left: 1.2%;
  top: 15.7%;
  width: 43.3%;
  rotate: -4deg;
}

.pair-photo img {
  box-shadow:
    0 0 0 6px var(--card),
    0 10px 30px rgb(0 0 0 / 0.14);
}

.pair-mascot {
  right: 3.2%;
  top: 12.8%;
  width: 57%;
  rotate: 2deg;
}

.pair-mascot::before {
  content: "";
  position: absolute;
  inset: 0;
  translate: 7% 7%;
  border-radius: 22%;
  background: radial-gradient(circle, var(--dither) 1.3px, transparent 1.6px) 0 0 / 7px 7px;
}

.pair-mascot img {
  position: relative;
}

.pair figcaption {
  position: absolute;
  top: -0.6rem;
  left: 7%;
  z-index: 1;
  padding: 0.1rem 0.6rem;
  border-radius: 99px;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
}

.pair-mascot figcaption {
  left: auto;
  right: 7%;
  background: var(--accent);
  color: #18181b;
}

.pair-arrow {
  position: absolute;
  left: 28%;
  top: -4%;
  z-index: 1;
  width: 20%;
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The other examples. On a narrow screen there is no row: the example changes by itself. */
.pairs {
  display: none;
  gap: 0.75rem;
  margin-top: 1.4rem;
  padding-left: 0.4rem;
}

.pairs button {
  display: inline-flex;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.7;
  outline: 2.5px solid transparent;
  outline-offset: 3px;
  transition:
    opacity 0.15s var(--ease),
    outline-color 0.15s var(--ease);
}

.pairs button:hover,
.pairs button[aria-pressed="true"] {
  opacity: 1;
}

.pairs button[aria-pressed="true"] {
  outline-color: var(--fg);
}

.pairs button:focus-visible {
  outline-color: var(--accent-ink);
}

.pairs img {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
}

.demo .note {
  margin-top: 0.9rem;
  padding-left: 0.4rem;
}

/* Faces to start from: a row of small pictures, each on a background of its own. */
.faces {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
  margin-top: 1.75rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.faces h2 {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--soft);
}

.faces .note {
  margin: 0;
}

/* On a narrow screen the row scrolls to the side, with pictures large enough for a thumb. */
.starter-row {
  flex: 1 1 100%;
  display: flex;
  gap: 0.5rem;
  margin-inline: -1rem;
  padding: 3px 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.starter-row::-webkit-scrollbar {
  display: none;
}

.starter-row button {
  flex: none;
  width: 3.25rem;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 26%;
  background: var(--sunk);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s var(--ease);
}

.starter-row button:hover {
  transform: translateY(-2px) rotate(-3deg);
}

.starter-row button:active {
  transform: scale(0.95);
}

.starter-row img {
  display: block;
  width: 100%;
  height: 100%;
}

@media (min-width: 54rem) {
  .start {
    display: grid;
    grid-template-columns: minmax(0, 27rem) minmax(0, 1fr);
    column-gap: 2.75rem;
    align-items: center;
    margin-top: 2rem;
  }

  .pitch {
    display: block;
  }

  .demo {
    margin-top: 0;
  }

  .start .photo .button {
    flex: none;
  }

  .pairs {
    display: flex;
  }

  .faces {
    grid-column: 1 / -1;
    margin-top: 2.25rem;
    padding: 1rem 1.25rem;
  }

  .faces h2,
  .starter-row {
    flex: none;
  }

  .starter-row {
    margin-inline: 0;
    padding: 0;
    overflow: visible;
  }

  .starter-row button {
    width: 2.9rem;
  }

  .faces .note {
    margin-left: auto;
  }
}

/* A photo over the page: the place to drop it. */
.drop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  pointer-events: none;
}

.drop p {
  margin: 0;
  padding: 1.5rem 2.5rem;
  border: 2px dashed var(--accent-ink);
  border-radius: 28px;
  background: var(--card);
  font-size: 1.3rem;
  font-weight: 650;
}

/*
 * The studio: the mascot, and everything that changes it. The picture is large. On a narrow
 * screen it scrolls away with the page, and a small bar at the top then holds it (`.mini`).
 */
.result {
  text-align: center;
}

.result h1 {
  font-size: clamp(1.75rem, 7.5vw, 2.6rem);
  margin-bottom: calc(0.4rem - 0.12em);
}

.result .lede {
  margin-inline: auto;
  font-size: 0.95rem;
}

.side {
  margin-top: 1.4rem;
}

.plate {
  position: relative;
  width: min(56vw, 13.5rem);
  aspect-ratio: 1;
  margin-inline: auto;
}

/* The buttons under the mascot: the dark one across, the others in one row. */
.side .actions {
  gap: 0.5rem;
  margin-top: 2.1rem;
}

.side .actions .button {
  flex: 1 1 0;
  padding-inline: 0.6rem;
  white-space: nowrap;
}

.side .actions .primary {
  order: -1;
  flex-basis: 100%;
  min-height: 3.4rem;
  font-size: 1.05rem;
}

.side .status {
  text-align: center;
}

/* The box of the check is under the status line, and as that line is: centered here. */
.side .check {
  display: flex;
  justify-content: center;
}

/* The small bar of a narrow screen: the mascot, its mood and the download. */
.mini {
  position: fixed;
  inset: 0 0 auto;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 4rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

:root[data-mini] {
  --bar: 4rem;
}

.mini button {
  flex: none;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 24%;
  background: var(--accent);
  overflow: hidden;
  cursor: pointer;
}

.mini img {
  display: block;
  width: 100%;
  height: 100%;
}

.mini .button {
  min-height: 2.5rem;
  margin-left: auto;
  padding-inline: 0.9rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.now-mood {
  margin: 0;
  color: var(--soft);
  font-size: 0.8125rem;
}

.now-mood b {
  display: block;
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 650;
}

/* The skin tone: the one choice that a model never makes. Each tone shows on the mascot. */
.skin {
  margin-top: 1.6rem;
}

.skin-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 3.9rem));
  gap: 0.55rem;
}

.tone {
  cursor: pointer;
}

.tone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22%;
  background: var(--accent);
  outline: 2.5px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s var(--ease);
}

.tone:hover img {
  outline-color: var(--line);
}

.tone input:checked ~ img {
  outline-color: var(--fg);
}

.tone input:focus-visible ~ img {
  outline-color: var(--accent-ink);
}

/* The photo of the visitor: over the whole picture while the model works, then small at a corner. */
.shot {
  position: absolute;
  left: -8%;
  bottom: -6%;
  z-index: 1;
  width: 32%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22%;
  object-fit: cover;
  rotate: -6deg;
  background: var(--sunk);
  box-shadow:
    0 0 0 4px var(--card),
    0 6px 16px rgb(0 0 0 / 0.18);
  transition:
    left 0.45s var(--ease),
    bottom 0.45s var(--ease),
    width 0.45s var(--ease),
    rotate 0.45s var(--ease);
}

.shot[data-as="full"] {
  left: 0;
  bottom: 0;
  width: 100%;
  rotate: 0deg;
  box-shadow: none;
}

/* While the model works: a ring round the photo, a light that moves over it, and no control. */
.plate[data-busy] {
  border-radius: 24%;
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

.plate[data-busy]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 22%;
  background: linear-gradient(
      115deg,
      transparent 35%,
      color-mix(in oklab, var(--accent) 60%, transparent) 50%,
      transparent 65%
    )
    0 0 / 300% 100%;
  animation: sweep 1.4s linear infinite;
}

@keyframes sweep {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: 0 0;
  }
}

/*
 * The wait for a photo. The buttons, the moods and the parts are of the mascot of before, so
 * they are not there: the studio shows the photo, the steps of the wait, and the skin tone,
 * which the visitor can choose now.
 */
.studio[data-wait] :is(.actions, .moods, .editor, .locked, .mini) {
  display: none;
}

/* The steps say the rest. The line still speaks to a screen reader, and shows a question. */
.studio[data-wait]:not([data-asking]) .side .status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:root {
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2318181b' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' d='M3.6 8.6l2.9 2.900 5.900-6.800'/%3E%3C/svg%3E");
}

.stages {
  display: grid;
  gap: 0.6rem;
  width: fit-content;
  margin: 2.1rem auto 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  text-align: left;
}

.stages li {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  color: var(--soft);
}

/* The mark of a step: a ring for one that comes, a ring that turns for the one of now. */
.stages li::before {
  content: "";
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.stages li[data-state="now"] {
  color: var(--fg);
  font-weight: 600;
}

.stages li[data-state="now"]::before {
  border-color: color-mix(in oklab, var(--accent) 28%, transparent);
  border-top-color: var(--accent);
  animation: turn 0.8s linear infinite;
}

/* A step that is done: the amber of the site, with a tick that lands one time. */
.stages li[data-state="done"]::before {
  border-color: var(--accent);
  background: var(--accent) var(--tick) center / 78% no-repeat;
  animation: land 0.32s cubic-bezier(0.2, 1.3, 0.35, 1);
}

@keyframes turn {
  to {
    rotate: 1turn;
  }
}

@keyframes land {
  from {
    scale: 0.6;
  }
}

/* The words of a wait, in a line of status: the same ring turns before them. */
.status[data-kind="wait"]::before,
.button[aria-busy="true"]::before {
  content: "";
  flex: none;
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-right: 0.55em;
  border: 2px solid color-mix(in oklab, currentColor 28%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  vertical-align: -0.12em;
  animation: turn 0.8s linear infinite;
}

/* A button that waits for an answer says so, and takes no click. */
.button[aria-busy="true"] {
  cursor: progress;
}

/*
 * After the wait, the buttons, the moods and the parts come back one time, each from behind an
 * edge that cuts it. A browser that cannot move `--cut` shows them at once.
 */
@property --cut {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.studio[data-arrive] :is(.actions, .moods, .editor) {
  animation: unroll 0.55s var(--ease) backwards;
}

.studio[data-arrive] .moods {
  animation-delay: 0.08s;
}

.studio[data-arrive] .editor {
  animation-delay: 0.16s;
}

@keyframes unroll {
  from {
    --cut: 0px;
    clip-path: inset(0 0 calc(100% - var(--cut)) 0);
    translate: 0 -0.5rem;
  }

  to {
    --cut: 44rem;
    clip-path: inset(0 0 calc(100% - var(--cut)) 0);
  }
}

/* An address with a mascot opens the studio: the first screen does not show before it. */
[data-boot="studio"] #start {
  display: none;
}

/* A block of dots behind the picture, a step down and to the right: the dither of the site. */
.plate::before {
  content: "";
  position: absolute;
  inset: 0;
  translate: 7% 7%;
  border-radius: 22%;
  background: radial-gradient(circle, var(--dither) 1.3px, transparent 1.6px) 0 0 / 7px 7px;
}

#face {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 22%;
  background: var(--accent);
}

/* A change of a part, a color or a mood: the mascot nods. */
.plate[data-swap] #face {
  animation: nod 0.36s var(--ease);
}

/*
 * The result of a photo comes out of dots, the dither of the site: a mask of dots that grow
 * until they are one picture. A browser that cannot move `--dot` shows the picture at once.
 */
@property --dot {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

#face.develop {
  -webkit-mask: radial-gradient(circle, #000 var(--dot), transparent calc(var(--dot) + 0.7px)) 0 0 /
    8px 8px;
  mask: radial-gradient(circle, #000 var(--dot), transparent calc(var(--dot) + 0.7px)) 0 0 / 8px 8px;
  animation: develop 0.8s cubic-bezier(0.3, 0, 0.25, 1) forwards;
}

@keyframes develop {
  to {
    --dot: 6.2px;
  }
}

/* A face of the first screen on its way to the picture of the studio (`grow`). */
.fly {
  position: fixed;
  z-index: 10;
  border-radius: 22%;
  transform-origin: 0 0;
  pointer-events: none;
}

@keyframes nod {
  from {
    transform: rotate(-6deg) scale(0.94);
  }

  55% {
    transform: rotate(2deg) scale(1.015);
  }
}

/*
 * The lock: the sign of a choice that comes with the pack. It sits on a picture, so its colors
 * are the ink and the paper of the drawings, in the light and in the dark.
 */
:root {
  --lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fbfaf7' d='M5 7V5.2a3 3 0 0 1 6 0V7h.4c.6 0 1.1.5 1.1 1.1v4.3c0 .6-.5 1.1-1.1 1.1H4.6c-.6 0-1.1-.5-1.1-1.1V8.100c0-.6.5-1.1 1.1-1.1zm1.500 0h3V5.200a1.500 1.500 0 0 0-3 0z'/%3E%3C/svg%3E");
}

.locked {
  margin: 0.9rem 0 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid color-mix(in oklab, var(--accent) 55%, var(--line));
  border-radius: 12px;
  background: color-mix(in oklab, var(--accent) 12%, var(--card));
  font-size: 0.8125rem;
  line-height: 1.45;
}

.locked b {
  font-weight: 650;
}

.locked b::before {
  content: "";
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.35em;
  vertical-align: -0.16em;
  border-radius: 50%;
  background: #18181b var(--lock) center / 72% no-repeat;
}

/* The moods, with the offer of the pack: one card. */
.moods {
  margin-top: 1.4rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.moods > h2 {
  margin: 0 0 0.35rem;
}

.moods > .note {
  margin-top: 0.5rem;
}

/* A small label with the lock, at the end of a heading. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin-left: auto;
  color: var(--soft);
  font-size: 0.75rem;
  font-weight: 550;
}

.tag::before {
  content: "";
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: #18181b var(--lock) center / 70% no-repeat;
}

h2,
legend {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 650;
}

h2 span,
legend span {
  font-weight: 400;
  color: var(--soft);
  font-size: 0.875rem;
}

/* On a narrow screen: one row that scrolls to the side, with pictures large enough for a thumb. */
.mood-grid {
  display: flex;
  gap: 0.5rem;
  margin-inline: -1rem;
  padding: 5px 1rem 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 1rem;
  scrollbar-width: none;
}

.mood-grid::-webkit-scrollbar {
  display: none;
}

.mood-grid button {
  flex: none;
  width: 3.5rem;
  scroll-snap-align: start;
  padding: 0;
  border: 0;
  border-radius: 24%;
  background: var(--accent);
  aspect-ratio: 1;
  cursor: pointer;
  overflow: hidden;
  outline: 2.5px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s var(--ease);
}

.mood-grid img {
  display: block;
  width: 100%;
  height: 100%;
}

.tile[data-pack] .pic::after,
.swatch[data-pack]::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #18181b var(--lock) center / 70% no-repeat;
  box-shadow: 0 0 0 1.5px var(--bg);
}

.mood-grid button[aria-pressed="true"] {
  outline-color: var(--fg);
}

.mood-grid button:focus-visible {
  outline-color: var(--accent-ink);
}

/* The parts. Each kind is a group of radio buttons that look like tiles or swatches. */
.editor {
  margin-top: 1rem;
}

/*
 * The kinds of parts: one row of tabs. On a narrow screen the row scrolls to the side, and stays
 * at the top, under the small bar of the mascot, while its parts scroll.
 */
.tabs {
  position: sticky;
  top: var(--bar);
  z-index: 2;
  display: flex;
  gap: 0.35rem;
  margin-inline: -1rem;
  padding: 0.5rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  transition: top 0.15s var(--ease);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.panel {
  padding-top: 0.5rem;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  padding: 0 0.95rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  cursor: pointer;
  transition:
    color 0.15s var(--ease),
    border-color 0.15s var(--ease);
}

.tabs button:hover {
  color: var(--fg);
  border-color: color-mix(in oklab, var(--fg) 35%, var(--line));
}

.tabs button[aria-selected="true"] {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.tabs button[data-pack]::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #18181b var(--lock) center / 70% no-repeat;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--bg) 40%, transparent);
}

.panel {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset[hidden] {
  display: none;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.4rem, 1fr));
  gap: 0.55rem 0.5rem;
}

.tile {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--soft);
  text-align: center;
  cursor: pointer;
}

.tile .pic {
  position: relative;
  display: block;
  width: 100%;
}

.tile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22%;
  background: var(--accent);
  outline: 2.5px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s var(--ease);
}

.tile:hover img {
  outline-color: var(--line);
}

.tile input:checked ~ .pic img {
  outline-color: var(--fg);
}

.tile input:checked ~ span {
  color: var(--fg);
  font-weight: 600;
}

.tile input:focus-visible ~ .pic img {
  outline-color: var(--accent-ink);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.swatch {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
}

.swatch i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color);
  border: 1px solid color-mix(in oklab, var(--fg) 22%, transparent);
  outline: 2.5px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s var(--ease);
}

.swatch input:checked ~ i {
  outline-color: var(--fg);
}

.swatch input:focus-visible ~ i {
  outline-color: var(--accent-ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/*
 * The paid option at the top of the hair tab: hair that a model draws from the photo. A card
 * with a switch. With the switch on, it has the amber of a choice of the pack.
 */
.drawn {
  padding: 0.8rem 0.95rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.drawn[data-on] {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line));
  background: color-mix(in oklab, var(--accent) 10%, var(--card));
}

.drawn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.drawn h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}

.drawn .note {
  margin-top: 0.4rem;
}

.drawn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.drawn .status {
  margin-top: 0.6rem;
}

/* The time of a drawing: a bar that fills one time, in about the time that a drawing takes. */
.meter {
  height: 6px;
  margin-top: 0.9rem;
  border-radius: 99px;
  background: var(--sunk);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: 0 50%;
  animation: fill 26s cubic-bezier(0.25, 0.6, 0.45, 1) forwards;
}

@keyframes fill {
  from {
    transform: scaleX(0.02);
  }

  to {
    transform: scaleX(0.95);
  }
}

.switch {
  flex: none;
  position: relative;
  width: 2.9rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--sunk);
  cursor: pointer;
  transition: background 160ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}

/* The place to press is larger than the switch: a finger needs 44 px. */
.switch::before {
  content: "";
  position: absolute;
  inset: -0.6rem -0.4rem;
}

.switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.2rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--fg);
  translate: 0 -50%;
  transition: translate 160ms var(--ease);
}

.switch[aria-checked="true"] {
  border-color: var(--fg);
  background: var(--fg);
}

.switch[aria-checked="true"]::after {
  background: var(--bg);
  translate: 1.2rem -50%;
}

.switch:disabled {
  opacity: 0.55;
  cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
  .switch,
  .switch::after {
    transition: none;
  }
}

.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  font-size: 0.9rem;
  font-weight: 550;
  cursor: pointer;
}

.chip input:checked ~ span {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.chip input:focus-visible ~ span {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
}

.foot {
  margin-top: 4rem;
  padding-block: 1.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.8125rem;
}

.foot p {
  margin: 0;
}

/*
 * A narrow screen: one column. The words, the mascot with its buttons, the skin tone, the moods,
 * and then the parts.
 */
.studio {
  display: flex;
  flex-direction: column;
}

/* A part of the column can be wider than the screen, such as the row of tabs: it scrolls. */
.studio > * {
  min-width: 0;
}

.result {
  order: 1;
}

.side {
  order: 2;
}

.skin {
  order: 3;
}

.moods {
  order: 4;
}

.editor {
  order: 5;
}

/*
 * A wide screen: the picture stays at the left while the page scrolls. The words, the skin tone,
 * the moods and the parts are at the right.
 */
@media (min-width: 54rem) {
  .studio {
    display: grid;
    grid-template-columns: minmax(0, 23rem) minmax(0, 1fr);
    grid-template-areas:
      "side result"
      "side skin"
      "side moods"
      "side editor";
    grid-template-rows: auto auto auto 1fr;
    column-gap: 4rem;
    align-items: start;
    margin-top: 1.5rem;
  }

  .result {
    grid-area: result;
    text-align: left;
  }

  .result .lede {
    margin-inline: 0;
    font-size: 1.05rem;
  }

  .skin {
    grid-area: skin;
  }

  .moods {
    grid-area: moods;
    margin-top: 1.5rem;
    padding: 1rem 1.1rem 1.1rem;
  }

  .moods > h2 {
    margin: 0 0 0.7rem;
  }

  .editor {
    grid-area: editor;
    margin-top: 1.5rem;
  }

  .tabs {
    position: static;
    margin-inline: 0;
    padding: 0.25rem 0 0.75rem;
    flex-wrap: wrap;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0;
  }

  .panel {
    padding-top: 0;
  }

  .side {
    grid-area: side;
    position: sticky;
    top: 1.5rem;
    margin-top: 0;
  }

  .plate {
    width: 100%;
  }

  .side .actions {
    margin-top: 2.5rem;
  }

  .side .actions .button {
    flex: none;
    padding-inline: 0.85rem;
    font-size: 0.9rem;
  }

  /* After a photo the download and the two other buttons are one row. */
  .side .actions .primary {
    flex: 1 1 auto;
    min-height: 2.9rem;
    font-size: 0.95rem;
  }

  .studio[data-from="hand"] .side .actions .primary {
    flex-basis: 100%;
  }

  .studio[data-from="hand"] .side .actions .button:not(.primary) {
    flex: 1 1 0;
  }

  .side .status {
    text-align: left;
  }

  .side .stages {
    margin: 2.5rem 0 0;
  }

  .side .check {
    justify-content: flex-start;
  }

  .mini {
    display: none;
  }

  .mood-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.45rem;
    margin-inline: 0;
    padding: 0;
    overflow: visible;
  }

  .mood-grid button {
    width: auto;
  }

  h1 {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .plate[data-swap] #face,
  .plate[data-busy]::after,
  .start h1 span,
  .stages li::before,
  .status[data-kind="wait"]::before,
  .button[aria-busy="true"]::before,
  .studio[data-arrive] :is(.actions, .moods, .editor) {
    animation: none;
  }

  /* A ring that does not turn: whole, in the amber of the site. */
  .stages li[data-state="now"]::before {
    border-color: var(--accent);
  }

  /* The words say how long a drawing takes. */
  .meter {
    display: none;
  }

  #face.develop {
    animation: none;
    -webkit-mask: none;
    mask: none;
  }

  .button,
  .starter-row button,
  .wall img,
  .shot,
  .tabs,
  .pairs button {
    transition: none;
  }
}

/* The paid pack in the editor. */
.unlock {
  margin-top: 0.9rem;
}

.unlock .button {
  width: 100%;
}

/* A page with one column: the pack of a buyer, the terms, the privacy page. */
.page {
  display: block;
  margin-top: 1.5rem;
}

/* The column is narrow, and starts under the name of the site. */
.page > * {
  max-width: 44rem;
}

.page .actions {
  align-items: center;
}

/* The page of a pack: its pictures use the full width. */
.pack-page > #pack,
.pack-page #pack > .pack-grid,
.pack-page #pack > .actions {
  max-width: none;
}

.pack-page #pack > * {
  max-width: 44rem;
}

/* The picture next to the title. On a narrow screen the words under them use the full width. */
.pack-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem 1rem;
}

.pack-head img {
  width: 4.5rem;
  height: auto;
  border-radius: 22%;
  rotate: -3deg;
}

/* While the pack opens, a block of dots holds the place of its mascot, so the words do not move. */
.pack-head:has(#hero[hidden])::before {
  content: "";
  width: 4.5rem;
  aspect-ratio: 1;
  border-radius: 22%;
  rotate: -3deg;
  background:
    radial-gradient(circle, var(--dither) 1.3px, transparent 1.6px) 0 0 / 7px 7px,
    var(--sunk);
}

.pack-head h1 {
  margin: 0;
}

.pack-head .lede {
  grid-column: 1 / -1;
}

/* On a narrow screen the buttons of a pack are two in a row, with the download across. */
.pack-page .actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.pack-page .actions .button {
  padding-inline: 0.6rem;
  font-size: 0.9rem;
  text-align: center;
}

.pack-page .actions #zip,
.pack-page .actions #edit {
  grid-column: 1 / -1;
}

@media (min-width: 40rem) {
  .pack-head {
    gap: 0.25rem 1.25rem;
  }

  .pack-head img {
    grid-row: span 2;
    width: 7rem;
  }

  .pack-head .lede {
    grid-column: 2;
  }

  .pack-page .actions {
    display: flex;
    gap: 0.6rem;
  }

  .pack-page .actions .button {
    padding-inline: 1.1rem;
    font-size: 0.95rem;
  }
}

.pack-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.75rem;
}

.pack-options .note {
  flex-basis: 100%;
  margin-top: 0;
}

.sizes {
  display: flex;
  gap: 0.35rem;
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 1.1rem 0.9rem;
  margin: 1.5rem 0;
}

.mood-card {
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.mood-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 18%;
  background: var(--accent);
}

/* With no background, a file is clear. A check pattern shows where it is clear. */
.pack-grid[data-clear] .mood-card img {
  background: repeating-conic-gradient(var(--sunk) 0% 25%, var(--card) 0% 50%) 0 0 / 18px 18px;
}

.mood-card figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.mood-card b {
  font-weight: 600;
}

.mood-card span {
  display: flex;
  gap: 0.6rem;
}

.mood-card a {
  display: inline-block;
  padding-block: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.prose h2 {
  margin: 2.2rem 0 0.5rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.prose p,
.prose ul {
  margin: 0.6rem 0;
  max-width: 38rem;
}

.prose ul {
  padding-left: 1.2rem;
}

.prose li {
  margin: 0.3rem 0;
}

.prose li::marker {
  color: var(--accent-ink);
}

/* Below the editor: what the pack holds, how the site works, and the questions. */
.more {
  width: min(100% - 2rem, 62rem);
  margin-inline: auto;
}

.band {
  margin-top: 3rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line);
  /* A link to a section stops a little above it. */
  scroll-margin-top: 1rem;
}

.band > h2 {
  display: block;
  max-width: 36rem;
  margin: 0 0 0.6rem;
  font-size: clamp(1.45rem, 4.2vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* The mascots that show the pack: a row of pictures, each a little off the line. */
.wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 2rem 0;
}

.wall img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22%;
  transition: rotate 0.2s var(--ease);
}

.wall img:nth-child(odd) {
  rotate: -2.5deg;
}

.wall img:nth-child(even) {
  rotate: 2deg;
}

.wall img:hover {
  rotate: 0deg;
}

.plans {
  display: grid;
  gap: 1rem;
}

.plan {
  position: relative;
  padding: 1.4rem 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

/* The pack has the block of dots of the picture behind it. */
.plan.featured {
  border-color: var(--fg);
}

.plan.featured::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  translate: 10px 10px;
  border-radius: 20px;
  background: radial-gradient(circle, var(--dither) 1.3px, transparent 1.6px) 0 0 / 7px 7px;
}

.plan h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.price {
  margin: 0.2rem 0 1rem;
  color: var(--soft);
  font-size: 0.9rem;
}

.price b {
  margin-right: 0.3rem;
  color: var(--fg);
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.plan ul {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.925rem;
}

.plan li {
  position: relative;
  padding-left: 1.5rem;
}

/* A check mark: two sides of a small box, turned. */
.plan li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.3em;
  width: 0.38rem;
  height: 0.7rem;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  rotate: 42deg;
}

.plan .button {
  width: 100%;
  margin-top: 1.4rem;
}

.steps {
  display: grid;
  gap: 1.5rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: #18181b;
  font-weight: 650;
  font-size: 0.95rem;
}

.steps h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 650;
}

.steps p {
  margin: 0;
  color: var(--soft);
  font-size: 0.925rem;
  text-wrap: pretty;
}

.faq {
  max-width: 44rem;
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-block: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* A plus that turns to a cross when the answer is open. */
.faq summary::after {
  content: "+";
  flex: none;
  color: var(--accent-ink);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  transition: rotate 0.2s var(--ease);
}

.faq details[open] summary::after {
  rotate: 45deg;
}

.faq p {
  margin: 0 0 1.1rem;
  max-width: 38rem;
  color: var(--soft);
  font-size: 0.95rem;
  text-wrap: pretty;
}

@media (min-width: 40rem) {
  .band {
    margin-top: 4.5rem;
    padding-top: 3rem;
  }

  .wall {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
  }

  .plans {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
    gap: 1.5rem;
  }

  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq summary::after {
    transition: none;
  }
}

/* The page for an address with no page. */
.lost img {
  display: block;
  width: 7rem;
  height: auto;
  margin-bottom: 1.5rem;
  border-radius: 22%;
  rotate: -4deg;
}

/*
 * A choice of the pack is faded. The Worker draws its small picture with no color, so the fade
 * is in the file and not in a style that a visitor can turn off. A swatch is only a color, and
 * a color is no secret: it fades here.
 */
.swatch[data-pack] i {
  opacity: 0.7;
  transition: opacity 0.15s var(--ease);
}

.swatch[data-pack]:hover i,
.swatch[data-pack] input:checked ~ i {
  opacity: 1;
}

.tile[data-pack] img,
.mood-grid button[data-pack] {
  background: var(--sunk);
}

.unlock-dialog {
  width: min(100% - 2rem, 23rem);
  padding: 1.25rem 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.25);
}

.unlock-dialog::backdrop {
  background: rgb(10 10 12 / 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.unlock-dialog[open] {
  animation: lift 0.22s var(--ease);
}

/* Its own name: frames with the name `rise` here took the place of those of the titles. */
@keyframes lift {
  from {
    opacity: 0;
    translate: 0 10px;
    scale: 0.97;
  }
}

.unlock-dialog form {
  display: flex;
  justify-content: flex-end;
  margin: -0.5rem -0.5rem 0.25rem 0;
}

.unlock-dialog .close {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.unlock-dialog .close:hover {
  background: var(--sunk);
  color: var(--fg);
}

.unlock-dialog img {
  display: block;
  width: min(100%, 13rem);
  height: auto;
  margin-inline: auto;
  border-radius: 22%;
  background: var(--sunk);
}

.unlock-dialog h2 {
  display: block;
  margin: 1.1rem 0 0.35rem;
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
}

.unlock-dialog p {
  margin: 0;
  color: var(--soft);
  font-size: 0.9rem;
  text-align: center;
  text-wrap: pretty;
}

.unlock-dialog .actions {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

@media (prefers-reduced-motion: reduce) {
  .unlock-dialog[open] {
    animation: none;
  }

  .swatch[data-pack] i {
    transition: none;
  }
}

/* A button that reads as a link, inside a sentence. */
button.link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* The packs that the browser remembers: a picture and a line for each. */
.packs-list {
  display: grid;
  gap: 0.6rem;
  margin: 0.8rem 0;
}

.packs-list:empty {
  display: none;
}

.packs-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  width: fit-content;
  font-weight: 600;
}

.packs-list img {
  width: 3rem;
  height: 3rem;
  border-radius: 24%;
  background: var(--sunk);
}

/* The link to a remembered pack, at the top of the home page: it is the one that matters. */
.nav #your-packs {
  color: var(--fg);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* The form that sends the address of a pack again. */
.find label {
  display: block;
  margin-bottom: 0.5rem;
}

.find-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.find input {
  flex: 1 1 14rem;
  min-width: 0;
  max-width: 22rem;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
}

.find input:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: 99px;
}

/* On a narrow screen the dialog of the pack comes up from the bottom, as a sheet. */
@media (max-width: 30rem) {
  .unlock-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 24px 24px 0 0;
  }

  .unlock-dialog[open] {
    animation: sheet 0.26s var(--ease);
  }

  .unlock-dialog img {
    width: min(100%, 11rem);
  }
}

@keyframes sheet {
  from {
    translate: 0 40%;
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .unlock-dialog[open] {
    animation: none;
  }
}

/*
 * Touch: a tap acts at once, with no wait for a second tap, and a control that shows its own
 * state does not flash the grey of the browser too.
 */
a,
button,
label,
summary,
input {
  touch-action: manipulation;
}

.tile,
.swatch,
.chip,
.button,
.tabs button,
.mood-grid button,
.starter-row button,
.tone,
.pairs button,
.mini button {
  -webkit-tap-highlight-color: transparent;
}
