:root {
  --bg: #111;
  --ink: #000;
  --screen: #fff;
  --paper: #fff;
  --line: #000;
  --muted: #6a6a6a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
html:has(#app.dark),
html:has(#app.dark) body {
  background: #000;
}

.studio {
  display: block;
  height: 100%;
  min-height: 100dvh;
  padding: 0;
}

.desk { display: none; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 10px;
}
.desk h1 {
  font-family: "Archivo Black", Arial, sans-serif;
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #fff;
}
.lede { margin: 8px 0 22px; font-size: 18px; }
.desk ol { padding-left: 18px; line-height: 1.8; }
.note { margin-top: 24px; font-size: 13px; color: #888; }

.phone,
.phone-frame {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}
.phone-frame:has(#app.dark) {
  background: #000;
}

.island {
  display: none;
}

.screen {
  height: 100%;
  background: var(--screen);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 38px 16px 16px;
  position: relative;
}

.status {
  display: none;
}

.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 76px;
  margin: 4px 0 12px;
}

.brand {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  object-position: center;
  display: block;
}
.wordmark { display: none; }
.web-hint { display: none; }
.ratio-tag { display: none; }
.get-app { display: none; }

.credits {
  margin: -8px 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #000;
  text-align: right;
  padding-right: 2px;
}

.album-btn {
  justify-self: start;
  width: 92px;
  height: 52px;
  padding: 0 8px;
  border: 4px solid #000;
  background: #fff;
  color: #000;
  cursor: pointer;
  font-family: "Archivo Black", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.menu-open {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #000;
}
.want-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.08;
  text-align: center;
  min-height: 52px;
}
.want-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 16px;
}
.want-arrow svg {
  display: block;
}
.menu-btn {
  width: 52px;
  height: 52px;
  border: 4px solid #000;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}
.menu-btn span {
  width: 6px;
  height: 6px;
  background: #000;
  display: block;
}

.menu {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 9;
  background: rgba(0,0,0,.28);
  padding: 90px 20px 20px;
}
.menu.open { display: block; }
.menu-card {
  background: #fff;
  border: 4px solid #000;
  padding: 12px;
}
.menu-title {
  font-family: "Archivo Black", Arial, sans-serif;
  font-size: 16px;
  margin-bottom: 12px;
}
.menu-row {
  width: 100%;
  height: 44px;
  border: 4px solid #000;
  background: #000;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.menu-row.ghost {
  background: #fff;
  color: #000;
  margin-bottom: 0;
}
.menu-links {
  display: flex;
  flex-direction: column;
  border: 4px solid #000;
  margin-top: 4px;
}
.menu-links .menu-row.ghost {
  height: 38px;
  border: none;
  border-bottom: 3px solid #000;
  margin: 0;
}
.menu-links .menu-row.ghost:last-child {
  border-bottom: none;
}

.album {
  display: none;
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 8;
  flex-direction: column;
  padding: 38px 16px 16px;
}
.album.open { display: flex; }

.album-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 12px;
  font-weight: 700;
  position: relative;
  z-index: 5;
  background: #fff;
}
.album-bar button {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  border: 4px solid #000;
  background: #fff;
  padding: 6px 10px;
  cursor: pointer;
}

.album-grid {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
}
.album-grid p {
  grid-column: 1 / -1;
  text-align: center;
  color: #666;
  font-weight: 700;
  margin-top: 40px;
}
.thumb {
  position: relative;
  border: 4px solid #000;
  background: #000;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
}
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.thumb-dl {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  z-index: 1;
  border: 3px solid #000;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 6px;
  cursor: pointer;
}

.album-player {
  display: none;
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 3;
}
.album-player.open { display: block; }
.album-player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.album-player-actions {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.album-player-actions .action-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}
.album-player-actions button {
  border: 4px solid #000;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.stage { flex: 1; min-height: 0; }

.well {
  display: block;
  height: 100%;
  background: #fff;
  border: 4px solid #000;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.well.has-photo { cursor: default; }

.well img, .well video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.well.has-photo img { display: block; }
.well.playing img { display: none; }
.well.playing video { display: block; }

.well-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #000;
  font-weight: 700;
}
.well.has-photo .well-empty,
.well-empty[hidden] { display: none; }

.plus {
  width: 44px;
  height: 44px;
  background: #000;
  position: relative;
}
.plus::before, .plus::after {
  content: "";
  position: absolute;
  background: #fff;
}
.plus::before { width: 18px; height: 4px; left: 13px; top: 20px; }
.plus::after { width: 4px; height: 18px; left: 20px; top: 13px; }

.overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.22);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: #000;
  font-weight: 700;
  z-index: 4;
  pointer-events: none;
}
.well.busy .overlay,
.well.fail .overlay { display: flex; }

.spin {
  width: 52px;
  height: 52px;
  border: 5px solid #000;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.well.fail .spin { display: none; }
.overlay p {
  font-size: 13px;
  text-align: center;
  background: #fff;
  border: 4px solid #000;
  padding: 8px 10px;
  max-width: 86%;
  line-height: 1.35;
}

.actions {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  display: none;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.well.has-photo .actions { display: flex; }
.actions[hidden] { display: none; }

.actions .action-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  pointer-events: none;
}
.again, .mute, .save {
  pointer-events: auto;
  border: 4px solid #000;
  background: #fff;
  color: #000;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.mute[hidden], .save[hidden] { display: none; }

.dock {
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#prompt {
  width: 100%;
  height: 48px;
  border: 4px solid #000;
  background: #fff;
  color: #000;
  border-radius: 0;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 48px;
  outline: none;
}
#prompt::placeholder { color: #888; font-weight: 700; }

.go {
  height: 48px;
  border: 4px solid #000;
  background: #000;
  color: #fff;
  font-family: "Archivo Black", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
}
.go:disabled { opacity: .35; cursor: not-allowed; }

.dur-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dur {
  height: 40px;
  border: 4px solid #000;
  background: #fff;
  color: #000;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.dur.on {
  background: #000;
  color: #fff;
}
.dur.locked {
  opacity: 0.55;
}

.screen.dark {
  background: #000;
  color: #fff;
}
.screen.dark .credits,
.screen.dark .status,
.screen.dark .well-empty,
.screen.dark .want-more,
.screen.dark .menu-open { color: #fff; }
.screen.dark .album-btn,
.screen.dark .menu-btn,
.screen.dark .well,
.screen.dark #prompt,
.screen.dark .again,
.screen.dark .mute,
.screen.dark .save,
.screen.dark .overlay p,
.screen.dark .album,
.screen.dark .album-bar,
.screen.dark .album-bar button,
.screen.dark .album-player-actions button,
.screen.dark .thumb-dl,
.screen.dark .menu-card,
.screen.dark .menu-row.ghost,
.screen.dark .menu-links {
  background: #000;
  color: #fff;
  border-color: #fff;
}
.screen.dark .menu-btn span { background: #fff; }
.screen.dark .plus { background: #fff; }
.screen.dark .plus::before,
.screen.dark .plus::after { background: #000; }
.screen.dark .spin {
  border-color: #fff;
  border-top-color: #000;
}
.screen.dark .overlay { background: rgba(0,0,0,.28); }
.screen.dark .menu { background: rgba(255,255,255,.22); }
.screen.dark .menu-row {
  background: #000;
  color: #fff;
  border-color: #fff;
}
.screen.dark .plus-points { color: #fff; }
.screen.dark .logo { filter: invert(1); }
.screen.dark .go {
  background: #000;
  color: #fff;
  border-color: #000;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 901px) {
  html, body {
    background: #fff;
    height: 100%;
    overflow: hidden;
  }
  html:has(#app.dark),
  html:has(#app.dark) body {
    background: #000;
  }
  .studio {
    display: block;
    height: 100%;
    min-height: 100dvh;
    padding: 0;
    gap: 0;
  }
  .desk,
  .island,
  .status,
  .album-btn { display: none; }
  .phone,
  .phone-frame {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }
  .phone-frame:has(#app.dark) {
    background: #000;
  }
  .screen {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "top top"
      "album stage"
      "album dock";
    height: 100%;
    padding: 0;
  }
  .top {
    grid-area: top;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
    margin: 0;
    padding: 8px 20px 8px 16px;
    border-bottom: 4px solid #000;
  }
  .brand { justify-self: auto; }
  .wordmark {
    display: block;
    font-family: "Archivo Black", Arial, sans-serif;
    font-size: 28px;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #000;
  }
  .logo {
    width: 48px;
    height: 48px;
  }
  .credits {
    position: absolute;
    top: 14px;
    right: 188px;
    z-index: 6;
    margin: 0;
    padding: 8px 12px;
    border: 4px solid #000;
    background: #fff;
    font-size: 14px;
    line-height: 1;
  }
  .stage {
    grid-area: stage;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 28px 32px;
    background: #ececec;
    position: relative;
  }
  .ratio-tag {
    display: block;
    position: absolute;
    top: 16px;
    left: 20px;
    z-index: 1;
    border: 3px solid #000;
    background: #fff;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
  }
  .well {
    width: min(680px, 100%);
    height: auto;
    min-height: 0;
    max-height: min(460px, 100%);
    aspect-ratio: 16 / 10;
    border-style: dashed;
    background: #fff;
  }
  .well.has-photo,
  .well.playing,
  .well.busy,
  .well.fail {
    width: auto;
    height: 100%;
    min-height: 0;
    max-height: none;
    aspect-ratio: 9 / 16;
    border-style: solid;
  }
  .web-hint {
    display: block;
    max-width: 280px;
    text-align: center;
    font-size: 13px;
    color: #6a6a6a;
    font-weight: 700;
    line-height: 1.35;
  }
  .plus {
    width: 56px;
    height: 56px;
  }
  .plus::before { width: 22px; height: 5px; left: 17px; top: 26px; }
  .plus::after { width: 5px; height: 22px; left: 26px; top: 17px; }
  .dock {
    grid-area: dock;
    display: grid;
    grid-template-columns: 1fr minmax(168px, 200px) minmax(200px, 240px);
    gap: 10px;
    align-items: stretch;
    padding: 14px 20px 16px;
    border-top: 4px solid #000;
    background: #fff;
  }
  #prompt,
  .go {
    height: 56px;
    line-height: 56px;
  }
  #prompt { font-size: 16px; }
  .go { font-size: 18px; }
  .dur-row { height: 56px; }
  .dur { height: 100%; }
  .album {
    grid-area: album;
    display: flex;
    flex-direction: column;
    position: relative;
    inset: auto;
    z-index: 2;
    padding: 16px 16px 14px;
    border-right: 4px solid #000;
    background: #fff;
  }
  .album-bar {
    margin: 0 0 12px;
    font-family: "Archivo Black", Arial, sans-serif;
    font-size: 22px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }
  .album-bar button { display: none; }
  .album-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .album-grid p { margin-top: 28px; font-size: 14px; }
  .thumb {
    border-width: 4px;
  }
  .thumb-dl {
    font-size: 11px;
    padding: 5px 6px;
    opacity: 0;
  }
  .thumb:hover .thumb-dl,
  .thumb:focus-within .thumb-dl {
    opacity: 1;
  }
  .get-app {
    display: block;
    flex-shrink: 0;
    margin-top: 12px;
    padding: 12px;
    border: 4px solid #000;
    background: #fff;
  }
  .get-app p {
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 10px;
    line-height: 1.25;
  }
  .store {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    margin: 0 0 8px;
    border: 4px solid #000;
    background: #000;
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
  }
  .store:last-child { margin-bottom: 0; }
  .store.apple.off {
    background: #fff;
    color: #888;
    border-style: dashed;
    cursor: default;
    pointer-events: none;
  }
  .album-player {
    position: fixed;
    inset: 0;
    z-index: 12;
  }
  .menu {
    padding: 80px 20px 24px;
  }
  .menu.open {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
  }
  .menu-card {
    width: min(420px, 100%);
  }
  .screen.dark .wordmark { color: #fff; }
  .screen.dark .stage { background: #111; }
  .screen.dark .credits,
  .screen.dark .ratio-tag {
    background: #000;
    color: #fff;
    border-color: #fff;
  }
  .screen.dark .web-hint { color: #9a9a9a; }
  .screen.dark .get-app,
  .screen.dark .store.apple.off {
    background: #000;
    color: #fff;
    border-color: #fff;
  }
  .screen.dark .store.apple.off { color: #888; }
  .screen.dark .store.android {
    background: #fff;
    color: #000;
    border-color: #fff;
  }
  .screen.dark .dock,
  .screen.dark .top,
  .screen.dark .album {
    border-color: #fff;
  }
}

@media (max-width: 900px) {
  html, body {
    background: #fff;
    height: 100%;
    overflow: hidden;
  }
  .studio {
    display: block;
    min-height: 100%;
    padding: 0;
    gap: 0;
  }
  .desk,
  .island { display: none; }
  .status {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    padding: 0 4px 6px;
  }
  .get-app { display: none; }
  .phone,
  .phone-frame {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .screen {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

html.native,
html.native body {
  background: #fff;
  height: 100%;
  overflow: hidden;
}
html.native .studio {
  display: block;
  min-height: 100%;
  padding: 0;
}
html.native .desk,
html.native .island,
html.native .get-app {
  display: none;
}
html.native .status {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  padding: 0 4px 6px;
}
html.native .phone,
html.native .phone-frame {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
html.native .screen {
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.api-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  font-weight: 700;
}
.api-row input {
  width: 100%;
  border: 3px solid #000;
  padding: 10px;
  font: inherit;
}
.auth-form,
.auth-in {
  margin: 0 0 10px;
}
.auth-form input {
  width: 100%;
  height: 40px;
  border: 4px solid #000;
  background: #fff;
  color: #000;
  padding: 0 10px;
  font: inherit;
  font-weight: 700;
  margin-bottom: 8px;
}
.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.auth-actions .menu-row {
  margin-bottom: 0;
  height: 40px;
}
.screen.dark .auth-form input {
  background: #000;
  color: #fff;
  border-color: #fff;
}
.plus-points {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  margin: 0 0 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.plus-points span {
  flex: 0 1 auto;
}
.menu-hint {
  font-size: 12px;
  color: #666;
  padding: 0 4px 8px;
}
