:root {
  --ink: #050505;
  --paper: #f3f5f8;
  --brand: #0077c8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (hover: hover) and (pointer: fine) {
  html,
  body {
    cursor: none;
  }

  html:has(body.legal),
  html:has(body.legal-open),
  body.legal,
  body.legal-open {
    cursor: auto;
  }
}

.stage-wrap {
  position: fixed;
  inset: 0;
  touch-action: none;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hud {
  position: fixed;
  z-index: 12;
  top: max(1.35rem, env(safe-area-inset-top));
  left: 0;
  right: 0;
  padding-inline: max(2rem, env(safe-area-inset-left)) max(1.4rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.hud-tools {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.mark,
.mark-ai {
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(243, 245, 248, 0.62);
  font-weight: 500;
}

.mark-ai {
  letter-spacing: 0.28em;
  color: var(--brand);
}

a.mark,
a.mark-ai {
  text-decoration: none;
  pointer-events: auto;
}

a.mark:hover,
a.mark-ai:hover {
  color: #fff;
}

.voice-dock {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  pointer-events: auto;
}

.voice-btn {
  pointer-events: auto;
  cursor: pointer;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: rgba(243, 245, 248, 0.32);
  transition: color 0.28s ease;
}

.voice-btn svg {
  width: 18px;
  height: 18px;
  display: none;
}

.voice-btn .voice-ic-on {
  display: block;
}

.voice-btn.is-off {
  color: rgba(243, 245, 248, 0.18);
}

.voice-btn.is-off .voice-ic-on {
  display: none;
}

.voice-btn.is-off .voice-ic-off {
  display: block;
}

.voice-btn:hover,
.voice-btn[aria-pressed="true"]:hover {
  color: var(--brand);
}

.voice-vol {
  display: grid;
  place-items: center;
}

.voice-vol input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  width: 72px;
  height: 16px;
  margin: 0;
  background: transparent;
}

.voice-vol input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: linear-gradient(to right, var(--brand) var(--p, 86%), rgba(243, 245, 248, 0.12) var(--p, 86%));
}

.voice-vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 8px;
  height: 8px;
  margin-top: -3.5px;
  border: 0;
  border-radius: 50%;
  background: #f3f5f8;
  box-shadow: 0 0 0 3px rgba(5, 5, 5, 0.92);
}

.voice-vol input[type="range"]::-moz-range-track {
  height: 1px;
  background: rgba(243, 245, 248, 0.12);
}

.voice-vol input[type="range"]::-moz-range-progress {
  height: 1px;
  background: var(--brand);
}

.voice-vol input[type="range"]::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: #f3f5f8;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  pointer-events: none;
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.18s ease, width 0.18s ease, height 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.78);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

body.has-cursor .cursor-dot {
  opacity: 0.85;
}

body.has-cursor .cursor-ring {
  opacity: 0.42;
}

body.has-cursor .cursor-dot.is-over {
  opacity: 1;
  background: var(--brand);
}

body.has-cursor .cursor-ring.is-over {
  opacity: 1;
  width: 44px;
  height: 44px;
  border-color: rgba(0, 119, 200, 0.86);
}

.studio {
  position: fixed;
  z-index: 12;
  right: max(1.4rem, env(safe-area-inset-right));
  bottom: max(1.4rem, env(safe-area-inset-bottom));
  pointer-events: none;
}

.studio-gear {
  pointer-events: auto;
  cursor: pointer;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: rgba(243, 245, 248, 0.32);
  transition: color 0.28s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.studio-gear svg {
  width: 18px;
  height: 18px;
  display: block;
}

.studio-gear:hover,
.studio.is-open .studio-gear {
  color: var(--brand);
}

.studio.is-open .studio-gear {
  transform: rotate(30deg);
}

.studio-pane {
  pointer-events: auto;
  cursor: auto;
  touch-action: pan-y;
  position: absolute;
  right: 0;
  bottom: 34px;
  width: min(292px, calc(100vw - 2.4rem));
  max-height: min(78vh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.1rem 1.15rem 1.05rem;
  border: 1px solid rgba(243, 245, 248, 0.08);
  background: rgba(7, 7, 7, 0.82);
  backdrop-filter: blur(18px);
  color: var(--paper);
}

.studio-pane::-webkit-scrollbar {
  width: 3px;
}

.studio-pane::-webkit-scrollbar-thumb {
  background: rgba(243, 245, 248, 0.14);
}

.studio-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.05rem;
}

.studio-kicker {
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--brand);
}

.studio-defaults {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  color: rgba(243, 245, 248, 0.3);
  font: inherit;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.studio-defaults:hover {
  color: var(--brand);
}

.studio-block + .studio-block {
  margin-top: 1.05rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(243, 245, 248, 0.06);
}

.studio-label {
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(243, 245, 248, 0.38);
  margin-bottom: 0.55rem;
}

.studio-label-sub {
  margin-top: 1.05rem;
}

.studio-slot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  margin-top: 0.45rem;
}

.studio-name {
  display: block;
  margin-top: 0.55rem;
}

.studio-name input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(243, 245, 248, 0.14);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 0.28rem 0 0.38rem;
  outline: none;
}

.studio-name input:focus {
  border-bottom-color: var(--brand);
}

.studio-name input::placeholder {
  color: rgba(243, 245, 248, 0.22);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 8px;
}

.studio-voices[data-slots] .studio-voice {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.studio-voices[data-slots] .studio-voice.is-default {
  white-space: normal;
  overflow: visible;
}

.studio-voice.is-default {
  color: rgba(243, 245, 248, 0.78);
}

.studio-voice.is-default span {
  color: var(--brand);
}

.studio-voice.is-default::after {
  content: "Default";
  display: block;
  margin-top: 0.08rem;
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
}

.studio-switch {
  appearance: none;
  cursor: pointer;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.48rem 0;
  border: 0;
  background: none;
  color: rgba(243, 245, 248, 0.72);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: left;
}

.studio-switch:hover {
  color: #fff;
}

.studio-knob {
  position: relative;
  flex: 0 0 30px;
  width: 30px;
  height: 16px;
  border-radius: 99px;
  background: rgba(243, 245, 248, 0.07);
  box-shadow: inset 0 0 0 1px rgba(243, 245, 248, 0.12);
  transition: background 0.22s ease, box-shadow 0.22s ease;
}

.studio-knob::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(243, 245, 248, 0.4);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.22s ease;
}

.studio-switch.is-on .studio-knob {
  background: rgba(0, 119, 200, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 119, 200, 0.75);
}

.studio-switch.is-on .studio-knob::after {
  transform: translateX(14px);
  background: var(--brand);
}

.studio-range {
  display: grid;
  gap: 0.15rem;
  margin: 0.55rem 0 0.35rem;
}

.studio-range-top {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(243, 245, 248, 0.5);
}

.studio-range-top > span:first-child {
  flex: 1;
}

.studio-range-top b {
  font-weight: 500;
  color: rgba(243, 245, 248, 0.82);
  letter-spacing: 0.08em;
  min-width: 1.6rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.studio-def {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  color: rgba(243, 245, 248, 0.28);
  font: inherit;
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.studio-def:hover {
  color: var(--brand);
}

.studio-range input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  width: 100%;
  height: 16px;
  margin: 0;
  background: transparent;
}

.studio-range input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: linear-gradient(to right, var(--brand) var(--p, 50%), rgba(243, 245, 248, 0.12) var(--p, 50%));
}

.studio-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 8px;
  height: 8px;
  margin-top: -3.5px;
  border: 0;
  border-radius: 50%;
  background: #f3f5f8;
  box-shadow: 0 0 0 3px rgba(7, 7, 7, 0.92);
}

.studio-range input[type="range"]::-moz-range-track {
  height: 1px;
  background: rgba(243, 245, 248, 0.12);
}

.studio-range input[type="range"]::-moz-range-progress {
  height: 1px;
  background: var(--brand);
}

.studio-range input[type="range"]::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: #f3f5f8;
}

.studio-lines {
  display: grid;
  gap: 2px;
}

.studio-line {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.38rem 0;
  border: 0;
  background: none;
  color: rgba(243, 245, 248, 0.7);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: left;
}

.studio-line span {
  width: 1rem;
  color: rgba(0, 119, 200, 0.9);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.studio-line:hover {
  color: #fff;
}

.say-bar {
  position: fixed;
  z-index: 11;
  left: 50%;
  bottom: max(1.55rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(34rem, calc(100vw - 7.5rem));
  display: flex;
  align-items: baseline;
  gap: 1.15rem;
  pointer-events: auto;
}

.say-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid rgba(243, 245, 248, 0.14);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 0.3rem 0 0.42rem;
  outline: none;
}

.say-bar input:focus {
  border-bottom-color: var(--brand);
}

.say-go {
  flex: none;
  border: 0;
  background: none;
  padding: 0 0 0.42rem;
  color: rgba(243, 245, 248, 0.22);
  font: inherit;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.say-bar.has-line .say-go {
  color: rgba(243, 245, 248, 0.48);
}

.say-go:hover,
.say-bar.is-live .say-go {
  color: var(--brand);
}

body.legal-open .say-bar {
  opacity: 0;
  pointer-events: none;
}

.studio-voices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1rem;
}

.studio-voice {
  appearance: none;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0.2rem 0;
  text-align: left;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(243, 245, 248, 0.38);
}

.studio-voice span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(243, 245, 248, 0.55);
  margin-bottom: 0.12rem;
}

.studio-voice:hover,
.studio-voice:hover span {
  color: #fff;
}

.studio-voice.is-on span {
  color: var(--brand);
}

.studio-voice.is-on {
  color: rgba(243, 245, 248, 0.7);
}

.studio-tints {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.15rem 0 0.65rem;
}

.studio-tint {
  appearance: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d8dce2;
  box-shadow: inset 0 0 0 1px rgba(243, 245, 248, 0.18);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
}

.studio-tint[data-tint="gold"] {
  background: #c4a056;
}

.studio-tint[data-tint="blue"] {
  background: #0077c8;
}

.studio-tint[data-tint="copper"] {
  background: #b56a42;
}

.studio-tint:hover,
.studio-tint.is-on {
  transform: scale(1.12);
}

.studio-tint.is-on {
  box-shadow: 0 0 0 1px rgba(5, 5, 5, 1), 0 0 0 2px var(--brand);
}

.studio-by {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1.05rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(243, 245, 248, 0.06);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(243, 245, 248, 0.28);
}

.studio-legal {
  color: rgba(243, 245, 248, 0.34);
  text-decoration: none;
  letter-spacing: 0.22em;
}

.studio-legal:hover {
  color: var(--brand);
}

.legal-sheet {
  position: fixed;
  inset: 0;
  z-index: 16;
  overflow: auto;
  background: rgba(5, 5, 5, 0.96);
  touch-action: pan-y;
}

.legal-x {
  position: fixed;
  z-index: 17;
  top: max(1.35rem, env(safe-area-inset-top));
  right: max(1.4rem, env(safe-area-inset-right));
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: rgba(243, 245, 248, 0.32);
  cursor: pointer;
  transition: color 0.28s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.legal-x svg {
  width: 18px;
  height: 18px;
  display: block;
}

body.legal-open .legal-x {
  animation: legal-x-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.legal-x:hover {
  color: var(--brand);
  transform: rotate(90deg);
}

@keyframes legal-x-in {
  from {
    transform: rotate(-90deg);
    opacity: 0;
  }
  to {
    transform: rotate(0);
    opacity: 1;
  }
}

.studio-gear,
.studio-pane,
.studio-pane *,
.voice-dock,
.voice-dock *,
.say-bar,
.say-bar *,
.legal-sheet,
.legal-sheet * {
  cursor: auto;
}

.studio-gear,
.studio-switch,
.studio-def,
.studio-defaults,
.studio-line,
.studio-voice,
.studio-tint,
.studio-legal,
.say-go,
.studio-range input[type="range"],
.voice-btn,
.voice-vol input[type="range"],
.legal-x {
  cursor: pointer;
}

body.studio-open .cursor-dot,
body.studio-open .cursor-ring,
body.legal-open .cursor-dot,
body.legal-open .cursor-ring {
  opacity: 0;
}

@media (hover: none), (max-width: 960px) {
  html,
  body {
    cursor: auto;
  }

  .cursor-dot,
  .cursor-ring {
    display: none;
  }

  .studio-pane {
    width: min(320px, calc(100vw - 1.6rem));
    max-height: min(56vh, 480px);
  }

  .studio-tint {
    width: 22px;
    height: 22px;
  }

  .say-bar input {
    font-size: 16px;
  }

  .say-go {
    font-size: 11px;
    min-height: 44px;
    padding: 0.45rem 0;
  }
}

body.legal,
html:has(body.legal) {
  cursor: auto;
  overflow: auto;
  height: auto;
  min-height: 100%;
}

body.legal,
body.legal-open {
  cursor: auto;
}

.legal-page {
  position: relative;
  z-index: 3;
  max-width: 36rem;
  margin: 0 auto;
  padding: max(5.5rem, calc(env(safe-area-inset-top) + 4.2rem)) max(2rem, env(safe-area-inset-right))
    max(3rem, env(safe-area-inset-bottom)) max(2rem, env(safe-area-inset-left));
}

.legal-kicker {
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.85rem;
}

.legal-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 2.2rem;
}

.legal-item + .legal-item {
  margin-top: 1.55rem;
  padding-top: 1.45rem;
  border-top: 1px solid rgba(243, 245, 248, 0.06);
}

.legal-item h2 {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(243, 245, 248, 0.4);
  margin-bottom: 0.55rem;
}

.legal-item p,
.legal-item a {
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: rgba(243, 245, 248, 0.72);
}

.legal-item a {
  color: var(--brand);
  text-decoration: none;
}

.legal-item a:hover {
  color: #fff;
}

