@font-face {
  font-family: Pixelify;
  src: url("./fonts/pixelify-bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #fff5e6;
  background: #151225;
  --ink: #241b3d;
  --cream: #fff1dd;
  --violet: #ae85ff;
  --studio-width: 1672px;
}

* { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
body {
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
  min-block-size: 100dvh;
}
main {
  display: flex;
  flex: 1;
  flex-direction: column;
}
[hidden] { display: none !important; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid #ffe08e; outline-offset: 4px; }

.bar {
  position: relative;
  z-index: 2;
  min-height: 62px;
  padding-inline: max(clamp(.75rem, 2.4vw, 2.5rem), calc((100% - var(--studio-width)) / 2 + 1.75rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  border-block-end: 4px solid #ac82cf;
  background: #1b1832;
}

.brand, .nav, .nav-link {
  display: flex;
  gap: .65rem;
  align-items: center;
}

.brand, .nav-link { min-height: 44px; text-decoration: none; }
.brand { font: 700 clamp(1.5rem, 3vw, 3.15rem)/1 Pixelify, system-ui; }
.brand svg { width: .9em; height: .9em; }
.nav { gap: clamp(.5rem, 2vw, 1.8rem); }
.nav-link { font-weight: 650; }
.nav-link:hover { color: #d9bcff; }
.nav-link svg { width: 1.35em; fill: none; stroke: currentColor; stroke-width: 1.9; }
.language { position: relative; }
.language summary { min-height: 44px; padding: .65rem .5rem; cursor: pointer; color: #e9d6ff; }
.language ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 4px);
  width: max-content;
  max-height: 65dvh;
  overflow: auto;
  padding: .35rem;
  margin: 0;
  list-style: none;
  border: 2px solid #af88d6;
  border-radius: 8px;
  background: #26203a;
  box-shadow: 0 8px 24px #100c21bb;
}
.language a { display: block; min-height: 44px; padding: .62rem .85rem; text-decoration: none; }
.language a:hover, .language a[aria-current] { color: #22172f; background: #d7b4fa; }

.studio {
  position: relative;
  isolation: isolate;
  display: grid;
  width: min(100%, var(--studio-width));
  margin-inline: auto;
  aspect-ratio: 1672 / 941;
  background: #19162c;
}
.room {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}
.studio::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, #1b173225, transparent 48%, #1b173226);
  pointer-events: none;
}
.studio-layout {
  width: min(100%, 1650px);
  margin-inline: auto;
  padding: clamp(1rem, 1.6vw, 1.65rem) clamp(1rem, 6.6vw, 6.4rem) clamp(1.75rem, 3.3vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
}
.intro { text-align: center; z-index: 1; }
.studio-title { display: grid; justify-items: center; gap: .45rem; }
.wordmark {
  direction: ltr;
  display: flex;
  align-items: center;
  gap: clamp(.45rem, 1vw, 1.1rem);
  font: 700 clamp(4.2rem, 6vw, 6.35rem)/.94 Pixelify, system-ui;
  letter-spacing: -.045em;
  color: #fff4dd;
  -webkit-text-stroke: 1px #ffe6b8;
  text-shadow: 0 4px #dd8b52, 0 7px #38233a, 4px 8px #0e0b22;
}
.signal {
  width: clamp(2.6rem, 8.8vw, 9.4rem);
  height: .75em;
  background: linear-gradient(#d6a3fb, #7977fb);
  filter: drop-shadow(0 0 7px #8274ed);
  animation: signal-pulse 2.9s ease-in-out infinite;
  clip-path: polygon(0 47%, 12% 47%, 12% 39%, 16% 39%, 16% 55%, 22% 55%, 22% 25%, 27% 25%, 27% 72%, 32% 72%, 32% 33%, 36% 33%, 36% 60%, 41% 60%, 41% 5%, 47% 5%, 47% 98%, 52% 98%, 52% 28%, 57% 28%, 57% 75%, 63% 75%, 63% 35%, 68% 35%, 68% 65%, 75% 65%, 75% 28%, 80% 28%, 80% 72%, 85% 72%, 85% 37%, 90% 37%, 90% 48%, 100% 48%, 100% 55%, 90% 55%, 90% 63%, 85% 63%, 85% 56%, 80% 56%, 80% 60%, 75% 60%, 75% 51%, 68% 51%, 68% 56%, 63% 56%, 63% 43%, 57% 43%, 57% 62%, 52% 62%, 52% 46%, 47% 46%, 47% 59%, 41% 59%, 41% 52%, 36% 52%, 36% 46%, 32% 46%, 32% 53%, 27% 53%, 27% 62%, 22% 62%, 22% 52%, 16% 52%, 16% 61%, 12% 61%, 12% 53%, 0 53%);
}
.signal:last-child { transform: scaleX(-1); animation-delay: -.7s; }
@keyframes signal-pulse {
  0%, 100% { scale: 1 .8; filter: brightness(.93); }
  30% { scale: 1 1; filter: brightness(1.16); }
  55% { scale: 1 .68; filter: brightness(.87); }
  76% { scale: 1 .92; filter: brightness(1.07); }
}
.studio-badge {
  display: inline-block;
  max-width: 100%;
  padding: .18em .86em .24em;
  color: #24152d;
  background: linear-gradient(#e6b9f4, #c095eb);
  box-shadow: inset 0 3px #f5d0ff, inset 0 -4px #9c72ce;
  clip-path: polygon(3% 0, 97% 0, 97% 10%, 100% 10%, 100% 90%, 97% 90%, 97% 100%, 3% 100%, 3% 90%, 0 90%, 0 10%, 3% 10%);
  font: 700 clamp(1.35rem, 2.55vw, 2.8rem)/1.05 Pixelify, system-ui, sans-serif;
}
.intro h1 { margin-block-start: .7rem; font-weight: 650; font-size: clamp(.95rem, 1.6vw, 1.6rem); text-shadow: 0 2px 6px #100a21; }
.host {
  z-index: 0;
  width: min(42vw, 670px);
  height: clamp(155px, 17vw, 260px);
  transform: translateX(-7%);
  align-self: end;
  margin-block: .3rem -.25rem;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.host-art {
  position: relative;
  direction: ltr;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 376 / 320;
}
.host-art :is(.host-fallback, .host-sprite) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.host-fallback { overflow: hidden; }
.host-fallback img {
  display: block;
  width: 400%;
  height: 100%;
  max-width: none;
  transform: translateX(var(--sprite-x, 0%));
}
.host-fallback .host-still { width: 100%; height: 100%; transform: none; }
.host-fallback img, .host-sprite { image-rendering: pixelated; }
.studio[data-listening] .host-art :is(.host-fallback, .host-sprite) {
  transform-origin: 58% 96%;
  animation: host-sway 5.8s ease-in-out infinite;
}

@keyframes host-sway {
  0%, 50%, 100% { rotate: 0deg; }
  25% { rotate: -1.8deg; }
  75% { rotate: 1.8deg; }
}

.host-note {
  position: absolute;
  top: 31%;
  left: 98%;
  color: #d3a6ff;
  font: 700 1.3rem/1 Pixelify, system-ui;
  text-shadow: 0 0 8px #b482ff;
  opacity: 0;
}
.studio[data-listening] .host-note { animation: host-note 3.2s ease-out infinite; }
@keyframes host-note {
  15% { opacity: 0; }
  34% { opacity: .85; }
  75%, 100% { opacity: 0; translate: .65rem -1.65rem; }
}

.studio-coffee {
  position: absolute;
  left: 37%;
  bottom: -1%;
  width: 22%;
  z-index: 2;
}
.studio-coffee img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.coffee-steam {
  position: absolute;
  bottom: 84%;
  left: 27%;
  width: 15%;
  height: 57%;
  opacity: .6;
  background: #fff0e4;
  clip-path: polygon(55% 0, 88% 0, 88% 18%, 65% 18%, 65% 32%, 35% 32%, 35% 49%, 60% 49%, 60% 62%, 80% 62%, 80% 81%, 58% 81%, 58% 100%, 30% 100%, 30% 81%, 48% 81%, 48% 68%, 22% 68%, 22% 55%, 5% 55%, 5% 34%, 28% 34%, 28% 19%, 55% 19%);
  animation: coffee-steam 2.45s linear infinite;
}
.coffee-steam + .coffee-steam { left: 45%; width: 12%; height: 43%; animation-delay: -1.2s; }

@keyframes coffee-steam {
  0% { opacity: 0; transform: translateY(34%) scale(.65); }
  24%, 48% { opacity: .82; }
  100% { opacity: 0; transform: translate(12%, -60%) scale(1.12); }
}

.deck {
  direction: ltr;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3.8fr) minmax(0, 1fr);
  gap: clamp(.7rem, 2.2vw, 2.5rem);
  align-items: center;
}
html[dir="rtl"] :is(.console, .comparison) { direction: rtl; }

.console {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  display: grid;
  gap: .65rem;
  min-width: 0;
  padding: clamp(.7rem, 1.8vw, 1.75rem) clamp(.7rem, 2.8vw, 2.85rem) .9rem;
  border: 4px solid #171326;
  border-radius: clamp(1.2rem, 3.4vw, 3.5rem);
  background: linear-gradient(170deg, #7866a0, #53426d 63%, #49395f);
  box-shadow: inset 0 5px #e2bedf, inset 0 -5px #312646, inset 5px 0 #826d9a, inset -5px 0 #3c3059, 0 8px #110e21, 0 16px 26px #130f2b9e;
}
#dropzone {
  padding: clamp(.45rem, 1.25vw, 1.2rem);
  color: var(--ink);
  border: 3px solid #322744;
  border-radius: clamp(.8rem, 2.1vw, 2.1rem);
  background: #faecdd;
  box-shadow: inset 0 3px #fffcf7, 0 4px #30243e;
}
#pick-file {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .12rem;
  min-height: clamp(120px, 10.7vw, 178px);
  width: 100%;
  padding: .6rem .7rem;
  border: 3px dashed #b29cb5;
  border-radius: 1.2rem;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font-size: clamp(.9rem, 1.66vw, 1.75rem);
  font-weight: 750;
  cursor: pointer;
}
#pick-file:disabled { cursor: default; }
#pick-file:not(:disabled):hover, #dropzone[data-dragging] #pick-file {
  border-color: #6948ad;
  background: #f0dcf2;
}
#pick-file:focus-visible { outline-color: #6135a3; }
.browse { color: #5b369d; text-decoration: underline; text-underline-offset: .12em; }
.upload-icon { width: clamp(2.7rem, 4.8vw, 5rem); margin-block-end: .15rem; fill: none; stroke: #473960; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.file-icon { position: absolute; top: 21%; inset-inline-end: 7%; width: clamp(2.2rem, 4.1vw, 4.3rem); transform: rotate(10deg); fill: #e5c7f8; stroke: #7a54b9; stroke-width: 3; stroke-linejoin: round; }
.file-icon .note { fill: #865bc8; stroke: none; }

.actions, .file-details { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .55rem; }
.actions { margin-block-start: .2rem; }
.primary, #cancel, #remove {
  min-height: 44px;
  border: 2px solid #241633;
  color: #fff5fc;
  cursor: pointer;
  font-weight: 760;
}
.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  width: min(100%, 34rem);
  padding: .42em .8em;
  border-radius: .85rem;
  background: linear-gradient(#a673f4, #7444ce 65%, #6940c3);
  box-shadow: inset 0 3px #ecc9ff, inset 0 -4px #4d2b93, 0 4px #221734;
  font-size: clamp(1rem, 1.75vw, 1.75rem);
  text-align: center;
  text-decoration: none;
}
.primary-icon { color: #ffe095; }
.primary:not(:disabled):hover { background: linear-gradient(#b584ff, #7a49d4); }
.primary:not(:disabled):active { transform: translateY(2px); }
.primary:disabled { cursor: default; color: #f5e7fa; }
#cancel, #remove { padding-inline: .8rem; background: #403250; border-radius: .45rem; }
#cancel:hover, #remove:hover { background: #332540; }
#filename { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
#progress { width: 100%; height: .65rem; accent-color: #e1bdff; }
#status, #limits { text-align: center; font-size: clamp(.7rem, 1vw, .86rem); }
#status:empty { position: absolute; }
#status { color: #ffe3a6; }
#limits { color: #f0e4f6; }

.comparison {
  position: relative;
  min-width: 0;
  padding: .7rem .7rem .6rem;
  border: 3px solid #a59cb6;
  border-radius: 1.45rem;
  text-align: center;
  background: #29263d;
  box-shadow: inset 0 0 0 2px #141125;
}
.comparison h2 { font-size: clamp(1rem, 1.46vw, 1.45rem); }
.comparison p { font-size: clamp(.75rem, 1.12vw, 1.15rem); }
.before { grid-column: 1; grid-row: 1; }
.after { grid-column: 3; grid-row: 1; border-color: #ecacf9; background: #382659; }
.direction-arrow {
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  color: #d1a6ff;
  font-size: clamp(1.25rem, 3.6vw, 3.8rem);
  line-height: 1;
  text-shadow: 2px 3px #503776;
}
.after .direction-arrow { left: auto; right: calc(100% + 6px); }
.wave {
  direction: ltr;
  margin: .45rem auto .05rem;
  height: clamp(30px, 4vw, 64px);
  width: min(100%, 175px);
  background: #b8afc6;
  clip-path: polygon(0 48%, 5% 48%, 5% 39%, 8% 39%, 8% 58%, 12% 58%, 12% 33%, 16% 33%, 16% 68%, 20% 68%, 20% 18%, 24% 18%, 24% 79%, 28% 79%, 28% 32%, 32% 32%, 32% 64%, 36% 64%, 36% 10%, 40% 10%, 40% 89%, 44% 89%, 44% 39%, 48% 39%, 48% 61%, 52% 61%, 52% 2%, 57% 2%, 57% 97%, 62% 97%, 62% 26%, 66% 26%, 66% 70%, 70% 70%, 70% 15%, 74% 15%, 74% 85%, 78% 85%, 78% 33%, 82% 33%, 82% 65%, 86% 65%, 86% 28%, 90% 28%, 90% 70%, 94% 70%, 94% 45%, 100% 45%, 100% 56%, 0 56%);
}
.after .wave { background: linear-gradient(0deg, #aa6cf3, #ffefdc 49%, #e798ff); }
.comparison audio { width: 100%; height: 44px; margin-block-start: .5rem; }
.comparison .format { font-size: .72rem; color: #ecd9f4; }

.studio-footer {
  flex: 1;
  width: min(100%, var(--studio-width));
  min-block-size: clamp(10.5rem, 14vw, 15rem);
  margin-inline: auto;
  padding: clamp(1.4rem, 2.8vw, 2.5rem) 1rem 2.2rem;
  background:
    linear-gradient(180deg, var(--desk-seam, #251726d9), #2d1926a6 1.75rem, #241724ed 18rem, #1f1623f5 100%),
    url("./studio-desk-grain.webp") center top / max(100%, 52rem) 11rem repeat-y,
    #241724;
  color: #eadbf0;
  text-align: center;
}
.studio-footer > p { font-size: .9rem; }
.studio-guide {
  max-width: 52rem;
  margin: 1rem auto 0;
  border: 1px solid #976b65;
  border-radius: .8rem;
  background: #231522a6;
  text-align: start;
}
.studio-guide summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 48px;
  padding: .8rem clamp(1rem, 3vw, 1.6rem);
  border-radius: inherit;
  color: #fff1e4;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.studio-guide summary::-webkit-details-marker { display: none; }
.studio-guide summary:hover { background: #70434a4d; }
.studio-guide summary::after {
  content: '';
  flex: 0 0 .6rem;
  height: .6rem;
  border: solid #f3c9af;
  border-width: 0 2px 2px 0;
  rotate: 45deg;
}
.studio-guide[open] summary { border-end-start-radius: 0; border-end-end-radius: 0; }
.studio-guide[open] summary::after { rotate: 225deg; }
.studio-guide article {
  border-block-start: 1px solid #976b65;
  padding: clamp(1rem, 3vw, 1.6rem);
}
.studio-guide h2 { font-size: clamp(1.22rem, 3vw, 1.75rem); }
.studio-guide h3 { margin-block: 1.3rem .25rem; color: #f3c9af; font-size: 1.1rem; }
.studio-guide p { line-height: 1.72; }

@media (max-width: 1000px) {
  .studio { aspect-ratio: auto; }
  .studio-layout { max-width: 820px; padding-inline: clamp(1rem, 4vw, 2rem); }
  .room { object-fit: cover; object-position: center top; }
  .host { width: min(62vw, 490px); height: clamp(132px, 24vw, 240px); transform: translateX(-5%); }
  .deck { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
  .console { grid-column: 1 / -1; }
  .before, .after { grid-row: 2; }
  .before { grid-column: 1; }
  .after { grid-column: 2; }
  .direction-arrow { display: none; }
}

@media (max-width: 590px) {
  .bar { min-height: 54px; }
  .nav { gap: .3rem; }
  .nav-link { padding-inline: .25rem; font-size: .82rem; }
  .nav-link svg, .studio-link { display: none; }
  .language summary { font-size: .82rem; }
  .studio-layout { padding-block: 1.25rem 1.65rem; }
  .room { object-position: center top; opacity: .78; }
  .studio::before { background: linear-gradient(0deg, #19162c 4%, transparent 75%); }
  .studio-footer { --desk-seam: #19162c; }
  .wordmark { font-size: clamp(3.2rem, 16vw, 4.2rem); }
  .intro h1 { line-height: 1.4; }
  .host { width: min(86vw, 380px); height: clamp(145px, 44vw, 210px); margin-block-end: -.2rem; }
  .deck { gap: .85rem; }
  .console { padding: .65rem .58rem .7rem; }
  .comparison { border-radius: .95rem; padding-inline: .38rem; }
  .file-icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .primary:not(:disabled):active { transform: none; }
  .signal, .coffee-steam { animation: none; }
}

.studio-brand-intro { max-width: 70ch; margin: .8rem auto 0; line-height: 1.6; }
.studio-brand-intro a { color: #ffe2b9; text-decoration: underline; }
