@font-face {
  font-family: Lato;
  src: url("/assets/lato-300.ttf");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: Lato;
  src: url("/assets/lato-400.ttf");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Lato;
  src: url("/assets/lato-700.ttf");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/cormorant-garamond-300.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/cormorant-garamond-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/cormorant-garamond-500-italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: Tangerine;
  src: url("/assets/tangerine.ttf");
  font-display: swap;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  background: #050b20;
  color: #f5f5f5;
  font:
    14px Lato,
    sans-serif;
  letter-spacing: 0.5px;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid #e2f986;
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.4;
  cursor: wait;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: #a9e0ee;
}
/* Playing surfaces should respond to gestures without iOS selection or callouts. */
#stage,
#compose-stage,
#play-controls {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}
#windows {
  position: fixed;
  top: var(--visible-viewport-top, 0px);
  right: 0;
  left: 0;
  bottom: auto;
  height: var(--visible-viewport-height, 100dvh);
  pointer-events: none;
  padding: 80px 16px 32px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
}
#windows:empty {
  display: none;
}
.window {
  pointer-events: auto;
  width: 100%;
  max-width: 460px;
  background: rgba(0, 0, 0, 0.58);
  border-radius: 4px;
  box-shadow: 0 0 20px -2px #000;
  text-shadow: 1px 1px 1px #0009;
}
.window.wide {
  max-width: 700px;
}
.window-header {
  padding: 10px 15px;
  background: rgba(150, 150, 150, 0.21);
  box-shadow: 0 2px 4px #0005;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 4px 4px 0 0;
}
.window-header h1,
.window-header h2 {
  font-size: 18px;
  line-height: 1.4;
  margin: 0;
  font-weight: 700;
}
.window-body {
  padding: 15px;
  line-height: 1.6;
}
.window-body p {
  margin: 0 0 12px;
}
.close {
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: #ccc;
  padding: 0 2px;
}
.btn {
  padding: 7px 12px;
  border: 1px solid #ffffff2b;
  border-radius: 4px;
  font-weight: 700;
  text-shadow: 1px 1px 1px #0005;
  white-space: nowrap;
  background: #428da4;
  box-shadow: inset 0 1px #fff1;
}
.btn:hover {
  filter: brightness(1.13);
}
.btn.green {
  background: #5cb85c;
  border-color: #4cae4c;
}
.btn.blue {
  background: #5bc0de;
  border-color: #46b8da;
}
.btn.red {
  background: #d9534f;
  border-color: #d43f3a;
}
.btn.neutral {
  background: #fff1;
}
.stack {
  display: grid;
  gap: 7px;
}
/* Loading stays on the music surface, without a separate screen. */
#startup-identity {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -88px);
  width: min(300px, calc(100% - 48px));
  z-index: 2;
  text-align: center;
  font-family: "DM Sans", system-ui, sans-serif;
  letter-spacing: 0;
  color: #eef0f7;
}
#startup-identity[hidden],
#startup-retry[hidden] { display: none; }
#startup-identity img {
  display: block;
  margin: 0 auto;
  border-radius: 24px;
}
#startup-identity h1 {
  margin: 20px 0 0;
  font: 300 28px / 34px "DM Sans", system-ui, sans-serif;
}
.startup-tagline {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 22px;
  color: #9ca9c5;
}
#startup-message {
  margin: 16px 0 0;
  color: #b9c4dc;
  font-size: 14px;
  line-height: 1.4;
}
#startup-message:empty { display: none; }
#startup-retry {
  margin-top: 12px;
  padding: 10px 20px;
  border: 1px solid #dcece540;
  border-radius: 24px;
  background: #ffffff0b;
  color: #eef0f7;
}
#app-loading {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(160px, 40vw);
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: #dcece520;
  pointer-events: none;
}
#app-loading[hidden] { display: none; }
#app-loading::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: #c8dbeb;
  animation: loading-progress 1.4s ease-in-out infinite;
}
@keyframes loading-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(350%); }
}
@media (prefers-reduced-motion: reduce) {
  #app-loading::after {
    width: 100%;
    opacity: 0.6;
    animation: none;
  }
}
#status {
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #001a20e8;
  border-radius: 6px;
  padding: 10px 18px;
  max-width: 90vw;
  z-index: 10;
  text-align: center;
  pointer-events: none;
}
#status:empty {
  display: none;
}
.hint {
  font-size: 12px;
  color: #b7cccf;
}
.error {
  color: #ffd5c9;
}
@media (max-width: 735px) {
  .window-header {
    flex-wrap: wrap;
  }
  .window-header h1 {
    font-size: 17px;
  }
  .window-header .hint {
    font-size: 11px;
  }
  #windows {
    padding: 76px 10px 24px;
  }
}
@media (max-height: 500px) {
  #windows {
    padding-top: 72px;
    padding-bottom: 20px;
  }
  .window-body {
    padding: 10px;
  }
}

#play-controls {
  position: fixed;
  left: 50%;
  bottom: calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 1;
  transition: opacity 0.25s ease;
}
#play-controls[hidden],
#play-controls button[hidden] {
  display: none;
}
.play-progress {
  position: fixed;
  left: calc(env(safe-area-inset-left) + 20px);
  right: calc(env(safe-area-inset-right) + 20px);
  bottom: calc(env(safe-area-inset-bottom) + 3px);
  height: 1px;
  overflow: hidden;
  background: #dcece51a;
  pointer-events: none;
  z-index: 3;
}
.play-progress[hidden] { display: none; }
.play-progress span {
  display: block;
  height: 100%;
  background: #dcece566;
  transform: scaleX(var(--piece-progress, 0));
  transform-origin: left;
}
#play-controls.is-faint {
  opacity: 0.14;
  pointer-events: none;
}
#encouragement {
  position: fixed;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  bottom: max(18dvh, calc(88px + env(safe-area-inset-bottom)));
  z-index: 3;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  text-align: center;
  font: 300 clamp(24px, 4vw, 32px) / 1.3 "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0.02em;
  color: #eee3ce;
  text-shadow: 0 2px 18px #061418aa;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
#encouragement.is-visible {
  opacity: 0.85;
  transform: translate(-50%, 0);
}
#encouragement.is-introduction {
  top: calc(env(safe-area-inset-top) + clamp(32px, 10dvh, 80px));
  bottom: auto;
  font-size: clamp(36px, 6vw, 48px);
  line-height: 1.2;
}
#play-controls button {
  touch-action: manipulation;
  color: #dcece5cc;
  background: transparent;
  border: 0;
  transition: color 0.2s, background 0.2s;
}
#choose-button,
#settings-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 12px;
  border-radius: 50%;
}
#compose-button {
  min-height: 48px;
  padding: 0 12px;
  border-radius: 24px;
  font-size: 14px;
}
.settings-body {
  overflow-y: auto;
  padding: 8px 20px 24px;
}
.settings-toggle,
.settings-replay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  min-height: 76px;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid #2a2832;
  background: none;
  text-align: left;
  color: #f2efe8;
}
.settings-replay {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
}
.settings-name,
.settings-detail {
  display: block;
}
.settings-name { font-size: 16px; }
.settings-detail { margin-top: 5px; color: #a8a3b3; font-size: 13px; line-height: 1.4; }
.settings-toggle input {
  flex: none;
  width: 24px;
  height: 24px;
  accent-color: #d9b26a;
}
#play-controls button:hover,
#play-controls button:focus-visible {
  color: #e5eeed;
  background: #ffffff0b;
}
@media (prefers-reduced-motion: reduce) {
  #play-controls,
  #encouragement {
    transition: none;
  }
}
#windows.is-paused {
  align-items: center;
  padding: 80px 24px;
  background: #00141970;
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.pause-screen {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.pause-screen h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 60px);
  font-weight: 300;
  letter-spacing: -1.5px;
  color: #f0f5f2;
}
.resume-button {
  padding: 13px 38px;
  border: 1px solid #e7f0e650;
  border-radius: 999px;
  background: #dce9dc;
  color: #163c36;
  font-weight: 700;
  transition:
    background 0.2s,
    transform 0.2s;
}
.resume-button:hover {
  background: #f1f7ee;
  transform: translateY(-1px);
}

#windows.is-library {
  align-items: center;
  padding: 32px;
  background: #0b0a0dcc;
  backdrop-filter: blur(18px);
  pointer-events: auto;
  overflow: hidden;
}
/* The library and the Compose set-up: a dark sheet with serif titles. */
.library {
  width: min(560px, 100%);
  height: min(860px, calc(100dvh - 64px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #2a2832;
  border-radius: 24px;
  background: #16151a;
  color: #f2efe8;
  box-shadow: 0 32px 100px #0008;
  font-family:
    "DM Sans",
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  letter-spacing: 0;
  pointer-events: auto;
}
.library svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.library button:focus-visible,
.library input:focus-visible {
  outline: 2px solid #d9b26a;
  outline-offset: -2px;
}
.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 20px 14px;
}
.library-header h1,
.picker-header h1 {
  margin: 0;
  font:
    600 34px / 1 "Cormorant Garamond",
    Georgia,
    serif;
  letter-spacing: 0;
  color: #f2efe8;
}
.library-close,
.picker-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #ffffff08;
  color: #a8a3b3;
}
.library-close:hover,
.picker-icon:hover {
  background: #ffffff12;
  color: #f2efe8;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Compact music toolbar, visible pieces, and optional movement lists. */
.picker:focus {
  outline: none;
}
.picker-header {
  display: flex;
  flex-direction: column;
  padding: 6px 12px;
  border-bottom: 1px solid #2a2832;
}
.picker-header h1 {
  font-size: 26px;
}
.picker-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.picker-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.picker-fold-all {
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #a8a3b3;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
}
.picker-fold-all:hover {
  color: #f2efe8;
  background: #ffffff08;
}
.picker-title-row[hidden],
.picker-search-row[hidden] {
  display: none;
}
.picker-search-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.picker-search-row .picker-search {
  flex: 1;
  min-width: 0;
}
.picker-icon {
  flex: none;
  background: none;
}
.picker-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid #2e2c36;
  border-radius: 12px;
  background: #1f1e25;
  color: #a8a3b3;
}
.picker-search:focus-within {
  border-color: #d9b26a55;
}
.picker-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: #f2efe8;
  font: inherit;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.picker-search input:focus-visible {
  outline: none;
}
.picker-search input::placeholder {
  color: #a8a3b3;
  opacity: 1;
}
.picker-search input::-webkit-search-cancel-button {
  filter: invert(0.7);
}
.picker-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
  scrollbar-width: thin;
  scrollbar-color: #3a3842 #0000;
}
.picker-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  margin: 0;
  background: none;
  color: inherit;
  text-align: left;
  font: inherit;
}
.picker-composer {
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
  font: 500 25px / 1.2 "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0;
  color: #ead9b8;
  background: linear-gradient(90deg, #d9b26a0c, #d9b26a03);
  box-shadow: inset 2px 0 #d9b26a70;
}
.picker-composer > [data-composer] {
  flex: 1;
  width: auto;
}
.picker-composer button {
  min-height: 44px;
  padding: 10px 16px;
}
.picker-composer-mine > button { width: auto; }
.picker-composer-mine .picker-composer-label { flex: 0 0 auto; min-width: 0; }
.picker-composer-mine .picker-composer-label .picker-text { flex: 0 1 auto; }
.picker-composer-mine .picker-add-composition {
  flex: 0 0 auto;
  justify-content: center;
  min-height: 30px;
  margin: 7px 0;
  padding: 5px 12px;
  border: 1px solid #d9b26a55;
  border-radius: 999px;
  color: #e7c47d;
  font: 500 12px / 1 system-ui, sans-serif;
}
.picker-composer-mine .picker-add-composition:hover {
  background: #d9b26a12;
}
.picker-composer-mine .picker-composer-caret {
  flex: 0 0 44px;
  justify-content: flex-end;
  margin-left: auto;
  gap: 0;
  padding: 10px 12px 10px 4px;
}
.picker-composer button:hover {
  background: #ffffff05;
}
.picker-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.picker-sub {
  font-size: 12px;
  line-height: 1.35;
  color: #a8a3b3;
}
.picker-chevron {
  color: #a8a3b3;
  stroke-width: 1.8 !important;
  transition: transform 0.2s;
}
.picker-current-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #d9b26a;
  box-shadow: 0 0 8px #d9b26a88;
}
.picker-chevron.is-open {
  transform: rotate(180deg);
}
.picker-bars {
  width: 12px;
  height: 12px;
  fill: #d9b26a;
  stroke: none !important;
}
.picker-piece {
  min-height: 54px;
  padding: 8px 16px;
  background: #1c1b21 !important;
  border-top: 1px solid #2a2832 !important;
}
.picker-piece:hover,
.picker-work button:hover,
.picker-movement:hover {
  background: #222128 !important;
}
.picker-saved-piece { display: flex; align-items: stretch; }
.picker-saved-piece .picker-piece { flex: 1; min-width: 0; }
.picker-saved-piece .picker-listen { flex: 0 0 48px; width: 48px; display: grid; place-items: center; padding: 10px; border: 0; border-top: 1px solid #2a2832; background: #1c1b21; color: #c5c9c5; }
.picker-listen svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.picker-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
}
.picker-work {
  display: flex;
  align-items: stretch;
  padding: 0 10px 0 0;
  border-top: 1px solid #2a2832;
  background: #1c1b21;
}
.picker-list .picker-work-toggle {
  flex: 1;
  min-width: 0;
  padding: 7px 8px 7px 16px;
}
.picker-list .picker-work-play {
  flex: none;
  justify-content: center;
  width: 44px;
  min-height: 54px;
  padding: 0;
}
.picker-count {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: #a8a3b3;
}
.picker-count .picker-chevron {
  width: 14px;
  height: 14px;
}
.picker-movement {
  min-height: 44px;
  padding: 0 16px 0 28px;
  background: #1c1b21 !important;
}
.picker-numeral {
  flex: none;
  width: 28px;
  font:
    italic 500 17px "Cormorant Garamond",
    Georgia,
    serif;
  color: #a8a3b3;
}
.picker-name {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.3;
}
.picker-play {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1.5px solid #8a8596;
  border-radius: 50%;
}
.picker-play svg {
  margin-left: 2px;
  fill: #a8a3b3;
  stroke: none !important;
}
.is-current .picker-play {
  background: #d9b26a;
  border-color: #d9b26a;
}
.is-current .picker-play svg {
  fill: #1a1408;
}
.is-current .picker-name,
.is-current .picker-title {
  color: #d9b26a;
}
.picker-empty {
  margin: 0;
  padding: 32px 20px;
  font-size: 15px;
  color: #a8a3b3;
}
@media (max-width: 600px) {
  #windows.is-library {
    padding: 0;
  }
  .library {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
}

/* Native library fills the screen, inside the safe area. */
.native-app #windows.is-library {
  padding: 0;
}
.native-app .library {
  width: 100%;
  height: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.native-app #status {
  bottom: calc(64px + env(safe-area-inset-bottom));
}

/* The Compose home page. */
.library.is-compose {
  grid-template-rows: auto minmax(0, 1fr);
}
.compose-home {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 12px 20px 32px;
  border-top: 1px solid #2a2832;
}
.compose-choice {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.compose-choice legend {
  padding: 16px 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: #a8a3b3;
}
.choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.choice {
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice span {
  display: grid;
  place-items: center;
  min-height: 52px;
  padding: 10px 8px;
  border: 1px solid #2e2c36;
  border-radius: 12px;
  background: #1f1e25;
  color: #f2efe8;
  font-size: 15px;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.16s,
    border-color 0.16s;
}
.choice span:hover {
  background: #ffffff0a;
}
.choice input:checked + span {
  border-color: #d9b26a;
  background: #d9b26a1f;
  color: #f7e9c8;
}
.choice input:focus-visible + span {
  outline: 2px solid #d9b26a;
  outline-offset: 2px;
}
.compose-piano-test {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -12px;
  color: #a8a3b3;
  font-size: 13px;
}
.compose-piano-test input {
  accent-color: #d9b26a;
  width: 18px;
  height: 18px;
}
.compose-note {
  margin: -12px 0 0;
  color: #d9c79f;
  font-size: 13px;
}
.compose-note[hidden] {
  display: none;
}
.begin-button {
  align-self: center;
  margin-top: 8px;
  padding: 14px 52px;
  border: 1px solid #f3dfb150;
  border-radius: 999px;
  background: #ecd9ae;
  color: #3a2a12;
  font-size: 16px;
  font-weight: 700;
  transition:
    background 0.2s,
    transform 0.2s;
}
.begin-button:hover {
  background: #f6e7c4;
  transform: translateY(-1px);
}
@media (max-width: 600px) {
  .compose-home {
    padding: 8px 20px 24px;
  }
}
.native-app .compose-home {
  padding: 4px 20px 32px;
}
@media (max-height: 500px) and (min-width: 600px) {
  .native-app .library.is-compose {
    grid-template-columns: 1fr;
  }
  .native-app .compose-home {
    gap: 12px;
  }
  .native-app .compose-choice legend {
    padding: 8px 0 8px;
  }
  .native-app .choice span {
    min-height: 44px;
  }
}

/* The Compose screen: a warm glow rising from the bottom, brightening with the swell. */
#compose-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  background:
    radial-gradient(ellipse 70% 50% at 100% 0%, #4a2c1499 0%, #0000 70%),
    linear-gradient(160deg, #0b0a08 0%, #241b0f 55%, #15100a 100%);
}
#compose-stage[hidden] {
  display: none;
}
/* The current touch instrument fills the available display in either orientation. */
#compose-stage.is-touch-compose {
  background: var(--world-background, #111713);
  font-family: "DM Sans", sans-serif;
  letter-spacing: 0;
}
#windows.is-compose-pause {
  padding: calc(env(safe-area-inset-top) + 24px) 24px
    calc(env(safe-area-inset-bottom) + 24px);
}
.compose-pause-panel {
  position: relative;
  margin: auto;
  flex: 0 0 auto;
  width: min(100%, 340px);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
  color: #e4e9df;
  font-family: "DM Sans", sans-serif;
  letter-spacing: 0;
}
.compose-pause-panel h1 { margin: 0; font-size: 32px; line-height: 1.2; font-weight: 300; letter-spacing: -.03em; }
.compose-pause-panel button { font: inherit; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.compose-pause-panel button:disabled { opacity: .45; cursor: default; }
.compose-pause-actions { width: min(100%, 220px); display: flex; flex-direction: column; gap: 4px; }
.compose-saved-status { padding: 7px 0; color: #b1c0ae; font-size: 12px; }
.compose-pause-panel .compose-pause-primary { padding: 12px 28px; background: #dce6da; color: #193b32; }
.compose-pause-panel .compose-pause-secondary { padding: 10px 24px; border: 1px solid #dce6da55; background: #dce6da12; color: #e4e9df; }
.compose-pause-icons { display: flex; justify-content: center; gap: 24px; color: #b5c3b6; }
.compose-pause-icons button { width: 44px; padding: 10px; }
.compose-pause-panel svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.compose-pause-panel .compose-panel-back { align-self: flex-start; padding: 10px; margin: -10px 0 -10px -10px; }
.compose-name-form { display: flex; flex-direction: column; gap: 14px; width: 100%; text-align: left; }
.compose-name-form label { font-size: 13px; color: #bdc9ba; }
.compose-name-form label span { opacity: .65; }
.compose-name-form input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #dce6da33; border-radius: 8px; background: #0002; color: #edf0e7; font: 16px "DM Sans", sans-serif; }
.compose-name-form input::placeholder { color: #a0ae9f; opacity: .58; }
.compose-help-copy { text-align: left; color: #bdc9ba; font-size: 14px; line-height: 1.7; }
.compose-help-copy p { margin: 0 0 18px; }
.compose-help-copy p:last-child { margin: 0; }
.compose-pause-panel .compose-quiet-action { font-size: 13px; color: #bdc9ba; }
.is-touch-compose [hidden] { display: none !important; }
.compose-playing-area {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.compose-landscape, .compose-touch-dust, .compose-surface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.compose-landscape, .compose-touch-dust { pointer-events: none; }
.compose-surface {
  touch-action: none;
  outline: none;
}
.compose-surface:focus-visible { outline: 1px solid #e6e8dc66; outline-offset: -2px; }
.compose-touch-atmosphere {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 84% 10%, var(--glow-aux, transparent), transparent 52%),
    radial-gradient(ellipse at 50% 60%, var(--glow-inner, #192b22), transparent 65%);
  filter: brightness(calc(1 + var(--surface-swell, .4) * .7 + var(--pull-charge, 0) * .3));
  transform: translate(calc(var(--landscape-x, 0) * -5%), calc(var(--landscape-y, 0) * -5%))
    scale(calc(1 + var(--surface-density, .2) * .22 + var(--pull-charge, 0) * .06));
}
.compose-recording-controls {
  position: absolute;
  left: 50%;
  bottom: calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1;
}
.compose-recording {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 90px;
  min-height: 48px;
  padding: 12px 16px;
  color: #dcece5cc;
  background: transparent;
  border: 0;
  border-radius: 24px;
  font: 13px/1 "DM Sans", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  touch-action: manipulation;
  transition: opacity .35s ease;
}
.compose-recording.is-faint { opacity: .42; }
.compose-recording:focus-visible { outline: 1px solid #dcece5aa; outline-offset: -3px; opacity: 1; }
.compose-recording-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e3a09a;
  box-shadow: 0 0 7px #e3a09a30;
  animation: compose-recording-pulse 2.8s ease-in-out infinite;
}
@keyframes compose-recording-pulse {
  0%, 100% { opacity: .9; }
  50% { opacity: .4; }
}
@media (prefers-reduced-motion: reduce) {
  .compose-recording-dot { animation: none; }
  .compose-recording { transition: none; }
}
.compose-glow {
  --swell: 0;
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 90% 65% at 50% 108%,
    #a07a3a 0%,
    #7a5a2a 28%,
    #4a3719 58%,
    #0000 88%
  );
  opacity: calc(0.78 + 0.32 * var(--swell));
  transform-origin: 50% 100%;
  transform: scale(calc(1 + 0.12 * var(--swell)));
  transition:
    opacity 0.25s linear,
    transform 0.25s linear;
}
/* The mood's colour, rising from the bottom over the warm glow as words move it. */
.compose-mood {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 105%, var(--glow-inner, #0000) 0%, #0000 75%),
    radial-gradient(ellipse 60% 45% at 100% 0%, var(--glow-aux, #0000) 0%, #0000 70%);
  opacity: calc(0.85 * var(--mood-strength, 0));
  mix-blend-mode: screen;
  transition: opacity 1.5s;
}
.compose-dust,
.compose-waves,
.compose-notes,
.compose-hex,
.compose-orb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Speak: a word settling shows in grey above the notes; sent, it floats up through the orb area. */
.compose-words {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
/* A word settling and a word sent: Living Piano's .play-prompt.previews and .float-word. */
.compose-waiting,
.compose-word {
  position: absolute;
  left: 50%;
  top: 44%;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 300;
}
.compose-waiting {
  font-style: italic;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: 0.08em;
  color: #f2efe861;
  opacity: 0;
  transition:
    color 0.4s,
    opacity 0.14s ease-out;
}
.compose-waiting.is-shown {
  opacity: 1;
  transition:
    color 0.4s,
    opacity 0.09s ease-out;
}
.compose-word {
  font-size: clamp(2.6rem, 8vw, 5rem);
  color: #f2efe8;
  animation: word-rise var(--dur, 4.5s) cubic-bezier(0.22, 0.6, 0.3, 1) forwards;
  transition: color 0.6s;
}
@keyframes word-rise {
  0% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
  60% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
    filter: blur(6px);
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - var(--dy, 40vh)))
      scale(0.82) rotate(var(--rot, 0deg));
  }
}
@media (prefers-reduced-motion: reduce) {
  .compose-word {
    animation: word-fade 2.4s ease-out forwards;
  }
}
@keyframes word-fade {
  from {
    opacity: 0.9;
  }
  to {
    opacity: 0;
  }
}

/* The sentence being said, assembling where words show (compose/src/phraseLine.ts): grey while a phrase is heard, ink
   once the phone has settled it; when the sentence ends the line moves up out of the next one's way, then rises. */
.compose-phrase {
  position: absolute;
  left: 50%;
  top: 44%;
  width: max-content;
  max-width: 88vw;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 0.32em;
  transform: translate(-50%, -50%);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.9rem, 5.4vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: #f2efe880;
  text-align: center;
  transition:
    color 0.18s,
    top 0.35s cubic-bezier(0.22, 0.6, 0.3, 1);
}
.compose-phrase.is-closed {
  top: 34%;
}
.compose-phrase-word {
  display: inline-block;
  transition: color 0.6s;
}
.compose-phrase-word.is-ink {
  font-style: normal;
  color: #f2efe8;
}
.compose-phrase-word.is-new {
  animation: phrase-word-in 0.22s ease-out;
}
@keyframes phrase-word-in {
  from {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(0.18em);
  }
}
.compose-phrase.is-settled {
  font-style: normal;
  color: #f2efe8;
  animation: phrase-rise var(--dur, 4.5s) cubic-bezier(0.22, 0.6, 0.3, 1) 0.12s forwards;
}
@keyframes phrase-rise {
  0% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
  60% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
    filter: blur(6px);
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - var(--dy, 36vh))) scale(0.86);
  }
}
@media (prefers-reduced-motion: reduce) {
  .compose-phrase-word.is-new {
    animation: none;
  }
  .compose-phrase.is-settled {
    animation: word-fade 2.4s ease-out forwards;
  }
}

/* Shown once when a Compose session starts listening. */
.compose-reminder {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #0b1210cc;
  color: #f2efe8;
  font-size: 15px;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  animation: compose-reminder 5.5s ease both;
}
.compose-reminder svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes compose-reminder {
  0%,
  100% {
    opacity: 0;
  }
  7%,
  88% {
    opacity: 1;
  }
}

/* Recite: the poem on the Compose screen, and choosing it on the home page. */
.recite-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.recite-options[hidden] {
  display: none;
}
.recite-options .compose-note {
  margin: 0;
}
.recite-poem {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #d9c79f;
}
.recite-poem select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #f3dfb150;
  border-radius: 10px;
  background: #0000001f;
  color: #f7e9c8;
  font: inherit;
  font-size: 16px;
}
.recite-poem select option {
  color: #1f1a10;
}
.recite {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.recite-line {
  position: absolute;
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  top: 40%;
  margin: 0 auto;
  max-width: 24em;
  transform: translateY(-50%);
  text-align: center;
  text-wrap: balance;
  font: 300 clamp(2rem, 6vw, 3.6rem) / 1.15 "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0.01em;
  color: #f2efe8b3;
}
.recite-line.is-arriving {
  animation: recite-arrive 0.7s ease-out both;
}
@keyframes recite-arrive {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.recite-line span {
  transition: color 0.25s;
}
/* A finished line drifting up to the ribbon: Living Piano's released word. */
.recite-float {
  position: absolute;
  margin: 0;
  text-align: center;
  text-wrap: balance;
  font: 300 clamp(2rem, 6vw, 3.6rem) / 1.15 "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0.01em;
  transform: translate(-50%, -50%);
  animation: recite-drift var(--dur, 4.5s) cubic-bezier(0.22, 0.6, 0.3, 1) forwards;
}
@keyframes recite-drift {
  0% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
  60% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
    filter: blur(6px);
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - var(--dy, 40vh))) scale(0.82) rotate(var(--rot, 0deg));
  }
}
@media (prefers-reduced-motion: reduce) {
  .recite-float {
    animation: word-fade 2.4s ease-out forwards;
  }
}

/* The end of a piece. */
.finish-screen {
  gap: 0;
  font-family:
    "DM Sans",
    ui-sans-serif,
    system-ui,
    sans-serif;
  letter-spacing: 0;
  max-width: 520px;
  text-align: center;
}
.finish-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d9b26a;
}
.finish-screen h1 {
  font:
    600 clamp(38px, 9vw, 56px) / 1.05 "Cormorant Garamond",
    Georgia,
    serif;
  letter-spacing: 0;
  color: #f2efe8;
}
.finish-by {
  margin: 10px 0 0;
  font-size: 15px;
  color: #c9c4d1;
}
.finish-actions {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* The Compose options, over the paused stage. */
.option-links {
  display: flex;
  gap: 8px;
}
.option-link {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #ffffff1c;
  border-radius: 999px;
  background: #ffffff08;
  color: #e9e4d8;
  font-weight: 500;
}
.option-link:hover {
  background: #ffffff14;
}
.option-link.is-primary {
  background: #ecd9ae;
  border-color: #f3dfb150;
  color: #3a2a12;
  font-weight: 700;
}
.save-form {
  width: min(420px, 100%);
  display: grid;
  gap: 8px;
}
.save-form label {
  font-size: 13px;
  color: #c9c1ad;
}
.save-row {
  display: flex;
  gap: 8px;
}
.save-row input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #ffffff24;
  border-radius: 12px;
  background: #0000004d;
  color: #f4efe2;
  font-size: 16px;
}
.save-note {
  max-width: 420px;
  margin: 0;
  text-align: center;
  color: #e6dcc4;
  line-height: 1.5;
}

/* The library and Compose set-up headers: a way home beside the title. */
.library-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

/* The home page: Play and Compose. */
#windows.is-home {
  align-items: stretch;
  padding: 0;
  pointer-events: auto;
  background:
    radial-gradient(ellipse 80% 55% at 0% 100%, #0c4a57 0%, #0000 70%),
    radial-gradient(ellipse 80% 55% at 100% 100%, #6a4a1c 0%, #0000 70%),
    #0b1316;
}
.home {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(28px, 6vh, 64px);
  padding: calc(32px + env(safe-area-inset-top)) 24px
    calc(32px + env(safe-area-inset-bottom));
  pointer-events: auto;
}
.home-header {
  text-align: center;
}
.home-header h1 {
  margin: 0;
  font:
    clamp(72px, 16vw, 120px) / 1 Tangerine,
    serif;
  font-weight: 400;
  letter-spacing: 0;
  color: #f4efe2;
  text-shadow: 0 0 40px #ffffff22;
}
.home-header p {
  margin: 8px 0 0;
  color: #b9c3bd;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.home-modes {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.experiment-links {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.experiment-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  color: #d9c79f;
  font-size: 14px;
  text-align: center;
  text-underline-offset: 4px;
}
.experiment-link:hover {
  color: #f7e9c8;
}
.experiment-link:focus-visible {
  outline: 2px solid #d9b26a;
  outline-offset: 2px;
  border-radius: 8px;
}
.home-mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 132px;
  justify-content: flex-end;
  padding: 22px 24px;
  border: 1px solid #ffffff1a;
  border-radius: 24px;
  text-align: left;
  color: #f4f1ea;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  letter-spacing: 0;
  box-shadow: 0 24px 60px #0005;
  transition:
    transform 0.2s,
    filter 0.2s;
}
.home-mode:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}
.home-mode.is-play {
  background:
    radial-gradient(ellipse 90% 90% at 85% 0%, #2c8a9a88 0%, #0000 70%),
    linear-gradient(160deg, #0d3f4a, #082a32);
}
.home-mode.is-compose {
  background:
    radial-gradient(ellipse 90% 90% at 50% 120%, #b4873f99 0%, #0000 70%),
    linear-gradient(160deg, #2b2112, #18120a);
}
.home-mode-name {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.home-mode-text {
  font-size: 14px;
  line-height: 1.45;
  color: #f4f1eabb;
}
@media (min-width: 640px), (orientation: landscape) and (min-width: 560px) {
  .home-modes {
    grid-template-columns: 1fr 1fr;
  }
  .home-mode {
    min-height: 200px;
  }
}
@media (orientation: landscape) and (min-width: 560px) {
  .play-progress {
    left: 50%;
    right: auto;
    width: min(52vw, 560px);
    transform: translateX(-50%);
  }
}
@media (max-height: 500px) {
  .home {
    gap: 16px;
  }
  .home-header h1 {
    font-size: 64px;
  }
  .home-mode {
    min-height: 120px;
    padding: 16px 20px;
  }
}
