@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/pixelify-sans-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F;
}

@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/pixelify-sans-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF;
}

:root {
  color-scheme: light;
  --pink: #ff5fb0;
  --pink-soft: #ffd3ea;
  --pink-pale: #fff0f8;
  --magenta: #b3125f;
  --magenta-dark: #6e0a3a;
  --sky: #cfeaff;
  --lilac: #e4d8ff;
  --blue: #2450d3;
  --paper: #ffffff;
  --ink: #2a1836;
  --muted: #5b4763;
  --field: #8d6f98;
  --bevel-light: #ffffff;
  --bevel-dark: #6b5a76;
  --disabled-bg: #e9e2ec;
  --disabled-ink: #574b5c;
  --error: #a30f2d;
  --font: Verdana, Tahoma, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Pixelify Sans", Verdana, Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background-color: var(--pink);
  background-image:
    linear-gradient(rgb(255 255 255 / 24%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 24%) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.55;
}

.shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 16px 16px calc(12px + env(safe-area-inset-bottom));
}

.deco {
  position: absolute;
  z-index: 0;
  height: auto;
  pointer-events: none;
  user-select: none;
  transition: transform 200ms ease;
}

.deco-star {
  top: 6px;
  right: 10px;
  width: 58px;
}

.deco-butterfly {
  top: 10px;
  right: 72px;
  width: 54px;
  transform: rotate(-14deg);
}

.deco-cd,
.deco-phone,
.deco-star-2 {
  display: none;
}

body[data-mood="1"] .deco-star {
  transform: rotate(18deg) scale(0.85);
}

body[data-mood="1"] .deco-butterfly {
  transform: rotate(12deg) scale(1.1);
}

body[data-mood="2"] .deco-star {
  transform: rotate(-12deg) scale(1.1);
}

body[data-mood="2"] .deco-butterfly {
  transform: rotate(-30deg) scale(0.9);
}

.top {
  position: relative;
  z-index: 1;
  padding-bottom: 14px;
}

.brand {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  text-shadow:
    2px 0 0 var(--paper),
    -2px 0 0 var(--paper),
    0 2px 0 var(--paper),
    0 -2px 0 var(--paper),
    3px 4px 0 var(--magenta);
  transform: rotate(-2deg);
  transform-origin: left center;
}

progress {
  display: block;
  width: 100%;
  height: 16px;
  overflow: hidden;
  border: 2px solid;
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
  background: var(--paper);
  appearance: none;
  -webkit-appearance: none;
}

progress::-webkit-progress-bar {
  background: var(--paper);
}

progress::-webkit-progress-value {
  background: repeating-linear-gradient(90deg, var(--magenta) 0 10px, var(--paper) 10px 13px);
}

progress::-moz-progress-bar {
  background: repeating-linear-gradient(90deg, var(--magenta) 0 10px, var(--paper) 10px 13px);
}

.progress-label {
  width: fit-content;
  margin: 8px 0 0;
  padding: 3px 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.tray {
  display: flex;
  gap: 2px;
  margin-top: 6px;
}

.tray-slot {
  flex: 1;
  min-width: 0;
  max-width: 26px;
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 70%);
  background: rgb(255 255 255 / 25%);
}

.tray-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.answer-field {
  position: relative;
}

.voice-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 6px;
  overflow: hidden;
  background: rgb(255 240 248 / 92%);
}

.voice-loading-box {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 300px;
  padding: 10px;
  border: 2px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.3;
}

.voice-loading-title {
  font-family: var(--font-display);
  font-weight: 700;
}

.voice-loading-bar {
  display: block;
  height: 16px;
  border: 2px solid;
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
  background: repeating-linear-gradient(90deg, var(--magenta) 0 10px, var(--paper) 10px 13px);
}

.voice-tip {
  margin-bottom: 12px;
  border: 2px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--pink-pale);
  box-shadow: 3px 3px 0 rgb(42 24 54 / 30%);
}

.voice-tip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0 10px;
  background: linear-gradient(90deg, var(--blue), var(--magenta));
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
}

.voice button.voice-tip-close {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  font-size: 1.5rem;
  line-height: 1;
}

.voice-tip p {
  margin: 0;
  padding: 10px 12px 12px;
}

.album-title {
  position: relative;
  margin: 30px 0 0;
  padding: 30px 14px 8px;
  border: 4px solid var(--magenta);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: var(--magenta);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  text-align: center;
}

/* The hang hole of a toy blister pack. */
.album-title::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 40px;
  height: 14px;
  border-radius: 7px;
  background: var(--paper);
  transform: translateX(-50%);
}

.album {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 6px;
  padding: 12px;
  border: 4px solid var(--magenta);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background:
    radial-gradient(circle, rgb(255 255 255 / 80%) 1px, transparent 1.5px) 0 0 / 14px 14px,
    var(--pink-soft);
  outline: 2px dashed var(--magenta);
  outline-offset: -9px;
}

.album img {
  width: 100%;
  height: auto;
}

.window {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 4px solid transparent;
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    repeating-linear-gradient(
      -45deg,
      var(--magenta) 0 3px,
      #ff9ccf 3px 6px,
      var(--paper) 6px 8px,
      var(--lilac) 8px 11px
    ) border-box;
  box-shadow: 6px 6px 0 rgb(42 24 54 / 35%);
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 4px 10px;
  background: linear-gradient(90deg, var(--magenta), #d11f85 55%, #7b2bc9);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
}

.titlebar-buttons {
  display: flex;
  gap: 3px;
}

.titlebar-buttons span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 22px;
  border: 2px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--lilac);
  color: var(--ink);
  line-height: 1;
}

main {
  flex: 1;
  padding: 18px 16px 20px;
}

main:focus,
h1:focus {
  outline: none;
}

h1 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

h2 {
  margin: 32px 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.art {
  position: relative;
  margin: 0 0 18px;
  transform: rotate(-1.2deg);
}

body[data-mood="1"] .art {
  transform: rotate(1.4deg);
}

body[data-mood="2"] .art {
  transform: rotate(-0.6deg);
}

.art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  object-position: center 25%;
  border: 6px solid var(--paper);
  outline: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--pink);
}

.art::after {
  content: "";
  position: absolute;
  top: -16px;
  right: -8px;
  width: 52px;
  height: 52px;
  background: url("/img/star.webp") center / contain no-repeat;
}

body[data-mood="1"] .art::after {
  right: auto;
  left: -10px;
  background-image: url("/img/butterfly.webp");
}

body[data-mood="2"] .art::after {
  top: auto;
  bottom: -14px;
  background-image: url("/img/cd.webp");
}

.art-sticker {
  width: 190px;
  margin: 0 auto 10px;
  transform: rotate(-3deg);
}

body[data-mood] .art-sticker::after {
  display: none;
}

.art-sticker img {
  aspect-ratio: 1;
  object-fit: contain;
  border: 0;
  outline: 0;
  box-shadow: none;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p,
.prose ul {
  margin: 0 0 16px;
}

.prose ul {
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 8px;
}

.prose a {
  display: inline-block;
  min-width: 44px;
  min-height: 44px;
  padding-block: 8px;
}

a {
  color: var(--magenta);
  text-underline-offset: 2px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--magenta);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
}

.hint {
  margin: 0 0 14px;
  color: var(--muted);
}

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

legend {
  padding: 0;
}

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

.option,
.consent {
  display: flex;
  gap: 12px;
  border: 2px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--pink-pale);
  cursor: pointer;
}

.option {
  align-items: center;
  min-height: 56px;
  padding: 12px 14px;
}

.consent {
  align-items: flex-start;
  min-height: 44px;
  padding: 14px;
}

.option:has(input:checked),
.consent:has(input:checked) {
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
  outline: 2px solid var(--magenta);
  background: var(--pink-soft);
}

.option input,
.consent input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--magenta);
}

textarea {
  display: block;
  width: 100%;
  min-height: 8em;
  padding: 12px 14px;
  border: 2px solid;
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
  outline: 1px solid var(--field);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.voice {
  margin-top: 12px;
}

.voice button {
  width: 100%;
}

.support {
  margin-top: 16px;
  padding: 14px;
  border: 2px dashed var(--magenta);
  background: var(--pink-pale);
}

.support p {
  margin: 0 0 12px;
}

.support .button {
  width: 100%;
}

.button-help {
  width: 100%;
  margin-top: 12px;
}

.notice {
  margin: 16px 0 0;
  color: var(--muted);
}

.notice.is-error {
  color: var(--error);
}

.notice:empty {
  display: none;
}

.turnstile:empty {
  display: none;
}

.turnstile {
  margin-top: 16px;
}

.nav {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.nav [data-forward] {
  flex: 1;
}

.button,
.voice button {
  min-height: 52px;
  padding: 10px 18px;
  border: 2px solid;
  border-color: #ff9ccf var(--magenta-dark) var(--magenta-dark) #ff9ccf;
  background: var(--magenta);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  cursor: pointer;
}

.button:active,
.voice button:active {
  border-color: var(--magenta-dark) #ff9ccf #ff9ccf var(--magenta-dark);
}

.button-secondary {
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--pink-soft);
  color: var(--ink);
}

.voice button {
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--sky);
  color: var(--ink);
}

.voice button[data-state="recording"] {
  border-color: #ff9ccf var(--magenta-dark) var(--magenta-dark) #ff9ccf;
  background: var(--magenta);
  color: var(--paper);
}

.button-quiet {
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--lilac);
  color: var(--ink);
}

.button[aria-disabled="true"],
.voice button[aria-disabled="true"] {
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  cursor: default;
}

.share {
  margin: 22px 0 0;
  padding: 14px;
  border: 2px dashed var(--magenta);
  background: var(--pink-pale);
}

.share p:last-child {
  margin-bottom: 0;
}

.share + .button {
  width: 100%;
  margin-top: 12px;
}

.strip {
  height: 12px;
  margin-top: 14px;
  border: 2px solid var(--ink);
  background: repeating-conic-gradient(var(--ink) 0 25%, var(--paper) 0 50%) 0 0 / 12px 12px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 6px;
  border: 2px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--lilac);
}

.link {
  min-height: 44px;
  padding: 4px 12px;
  border: 2px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--pink-pale);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

dialog {
  width: 100%;
  max-width: 640px;
  height: 100%;
  max-height: 100%;
  margin: auto;
  padding: 0 18px calc(24px + env(safe-area-inset-bottom));
  border: 2px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--paper);
  color: var(--ink);
}

dialog::backdrop {
  background: rgb(42 24 54 / 50%);
}

.overlay-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -18px 16px;
  padding: 6px 8px 6px 14px;
  background: linear-gradient(90deg, var(--blue), var(--magenta));
}

.overlay-head h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--font-display);
}

.overlay-head .button {
  flex: none;
  min-height: 44px;
  padding: 6px 14px;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  background: var(--lilac);
  color: var(--ink);
}

@media (min-width: 700px) {
  .shell {
    padding-top: 32px;
  }

  .brand {
    font-size: 3rem;
  }

  .deco-star {
    top: 16px;
    right: -44px;
    width: 96px;
  }

  .deco-butterfly {
    top: 24px;
    right: 64px;
    width: 76px;
  }

  dialog {
    height: auto;
    max-height: 85vh;
  }
}

/* Only with real room beside the 640 px window, side stickers never touch the text. */
@media (min-width: 1120px) {
  .deco-cd,
  .deco-phone,
  .deco-star-2 {
    display: block;
  }

  .deco-cd {
    top: 200px;
    left: -170px;
    width: 130px;
  }

  .deco-phone {
    right: -140px;
    bottom: 110px;
    width: 130px;
    transform: rotate(10deg);
  }

  .deco-star-2 {
    bottom: 60px;
    left: -90px;
    width: 72px;
  }

  body[data-mood="1"] .deco-cd {
    transform: translateY(120px) rotate(40deg);
  }

  body[data-mood="1"] .deco-phone {
    transform: translateY(-140px) rotate(-8deg);
  }

  body[data-mood="2"] .deco-cd {
    transform: translateY(240px) rotate(-20deg);
  }

  body[data-mood="2"] .deco-phone {
    transform: translateY(-260px) rotate(16deg);
  }
}

@media (prefers-reduced-motion: no-preference) {
  progress::-webkit-progress-value {
    transition: width 200ms ease;
  }

  .tray-slot.is-new img {
    animation: tray-settle 900ms ease both;
  }

  .voice-loading-bar {
    animation: chunks 900ms linear infinite;
  }
}

@keyframes tray-settle {
  from {
    transform: translateY(-18px) scale(2);
    opacity: 0;
  }
}

@keyframes chunks {
  to {
    background-position-x: 39px;
  }
}

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

/* The logo takes the full header width on phones. */
@media (max-width: 479px) {
  .deco-butterfly {
    display: none;
  }
}
