:root {
  color-scheme: dark;
  --bg: #060912;
  --panel: rgba(14, 20, 36, 0.86);
  --panel-strong: rgba(20, 28, 49, 0.96);
  --line: rgba(148, 163, 184, 0.24);
  --text: #f7fbff;
  --muted: #9fb0c7;
  --blue: #64d2ff;
  --violet: #9b7cff;
  --green: #42f59e;
  --amber: #ffd166;
  --red: #ff5d73;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.44);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(100, 210, 255, 0.36), transparent 24rem),
    radial-gradient(circle at 82% 12%, rgba(155, 124, 255, 0.28), transparent 26rem),
    linear-gradient(180deg, #060912 0%, #0b1020 44%, #111827 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button,
a,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0.85rem 1rem;
  color: #03111f;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(66, 245, 158, 0.2);
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

button:hover:not(:disabled),
a:hover {
  transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(100, 210, 255, 0.9);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  color: var(--text);
  background: rgba(3, 8, 19, 0.72);
}

input[type="file"] {
  min-height: 56px;
  border-style: dashed;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 20px;
  min-width: 20px;
  height: 20px;
  accent-color: var(--green);
}

label {
  display: grid;
  gap: 0.48rem;
  color: #dfe9f7;
  font-weight: 800;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.studio-shell {
  width: min(1240px, calc(100% - 1.25rem));
  margin: 0 auto;
  padding: clamp(0.8rem, 2.5vw, 2rem) 0 4rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.brand,
.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.brand {
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.055);
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: #06111f;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.hero-actions,
.toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.subtle-button,
.secondary-link {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.hero-studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.hero-copy,
.render-card,
.panel,
.rail,
.status-message,
.recipe-card,
.export-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 28, 49, 0.88), rgba(8, 13, 26, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border-radius: 34px;
  padding: clamp(1.2rem, 5vw, 4.4rem);
}

.hero-copy::after {
  position: absolute;
  right: -9rem;
  bottom: -11rem;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  content: "";
  background: radial-gradient(circle, rgba(100, 210, 255, 0.32), transparent 68%);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(4.1rem, 12vw, 9.5rem);
  line-height: 0.82;
  letter-spacing: -0.09em;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h3 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}

.hero-lede {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 1.25rem 0 1.5rem;
  color: #cbd8ea;
  font-size: clamp(1.02rem, 2.2vw, 1.35rem);
  font-weight: 720;
  line-height: 1.5;
}

.primary-link {
  border: 0;
  color: #03111f;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.render-card {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 420px;
  overflow: hidden;
  border-radius: 34px;
  padding: 1.35rem;
}

.render-card::before {
  position: absolute;
  inset: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  content: "";
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 40%),
    radial-gradient(circle at 50% 32%, rgba(155, 124, 255, 0.3), transparent 11rem);
}

.render-card > * {
  position: relative;
  z-index: 1;
}

.render-card p {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.render-card strong {
  display: block;
  max-width: 18rem;
  font-size: 2.2rem;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.render-card span {
  display: block;
  margin-top: 0.9rem;
  color: #cbd8ea;
  font-weight: 750;
  line-height: 1.35;
}

.pulse-dot {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 10px rgba(66, 245, 158, 0.12), 0 0 28px rgba(66, 245, 158, 0.78);
}

.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.rail {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.75rem;
  border-radius: 28px;
  padding: 0.85rem;
}

.rail-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0.2rem 0.75rem;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 0.75rem;
  color: var(--muted);
}

.rail-step span {
  grid-row: span 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 950;
}

.rail-step strong {
  color: var(--text);
}

.rail-step small {
  font-weight: 760;
}

.rail-step.is-active {
  border-color: rgba(100, 210, 255, 0.38);
  background: rgba(100, 210, 255, 0.08);
}

.rail-step.is-active span {
  color: #03111f;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.studio-panels {
  display: grid;
  gap: 1rem;
}

.panel {
  border-radius: 28px;
  padding: clamp(1rem, 2.5vw, 1.4rem);
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-heading .eyebrow {
  margin: 0;
}

.project-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.85fr);
  gap: 1rem;
  align-items: end;
}

.project-panel .panel-heading,
.upload-panel .panel-heading,
.recipe-panel .panel-heading,
.render-panel .panel-heading {
  grid-column: 1 / -1;
}

.rights-check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  border: 1px solid rgba(66, 245, 158, 0.24);
  border-radius: 18px;
  padding: 0.9rem;
  background: rgba(66, 245, 158, 0.08);
  line-height: 1.35;
}

.muted,
.empty,
.inline-feedback {
  margin: 0;
  color: var(--muted);
  font-weight: 730;
  line-height: 1.4;
}

.inline-feedback {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
}

.inline-feedback[data-type="success"] {
  border-color: rgba(66, 245, 158, 0.42);
  color: #dfffea;
}

.inline-feedback[data-type="error"] {
  border-color: rgba(255, 93, 115, 0.5);
  color: #ffd5dc;
}

.inline-feedback[data-type="warning"] {
  border-color: rgba(255, 209, 102, 0.5);
  color: #fff0c2;
}

.upload-grid,
.recipe-grid,
.render-layout,
.export-grid {
  display: grid;
  gap: 1rem;
}

.upload-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.upload-box {
  display: grid;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
}

.progress-meter {
  height: 12px;
  margin: 1rem 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--violet));
  transition: width 0.22s ease;
}

.asset-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.asset-tile,
.music-pill {
  display: grid;
  justify-items: start;
  gap: 0.25rem;
  min-height: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.85rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
  text-align: left;
}

.asset-tile.is-selected {
  border-color: rgba(66, 245, 158, 0.62);
  background: rgba(66, 245, 158, 0.1);
}

.asset-tile span,
.music-pill {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 760;
}

.recipe-grid {
  grid-template-columns: minmax(220px, 0.45fr) 1fr;
  align-items: end;
}

.toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  background: rgba(255, 255, 255, 0.055);
}

.recipe-panel button,
.render-summary button,
.project-panel button {
  width: 100%;
}

.render-layout {
  grid-template-columns: minmax(220px, 330px) minmax(0, 1fr);
  align-items: stretch;
}

.phone-preview {
  display: grid;
  min-height: 520px;
  place-items: center;
  overflow: hidden;
  border: 10px solid #020617;
  border-radius: 38px;
  padding: 1rem;
  color: var(--muted);
  background: linear-gradient(160deg, rgba(100, 210, 255, 0.18), rgba(155, 124, 255, 0.12), rgba(0, 0, 0, 0.32));
  font-weight: 900;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), 0 26px 60px rgba(0,0,0,0.36);
}

.phone-preview.has-video {
  padding: 0;
  background: #000;
}

.phone-preview video,
.export-card video {
  width: 100%;
  aspect-ratio: 9 / 16;
  display: block;
  background: #000;
  object-fit: contain;
}

.render-summary {
  display: grid;
  align-content: start;
  gap: 0.8rem;
}

.status-message {
  min-height: 120px;
  border-radius: 22px;
  padding: 1rem;
  color: #dfe9f7;
  font-weight: 820;
  line-height: 1.45;
}

.status-message[data-type="success"] {
  border-color: rgba(66, 245, 158, 0.42);
}

.status-message[data-type="warning"] {
  border-color: rgba(255, 209, 102, 0.5);
}

.status-message[data-type="error"] {
  border-color: rgba(255, 93, 115, 0.5);
  color: #ffd5dc;
}

.recipe-output,
.exports-output {
  margin-top: 1rem;
}

.recipe-card {
  border-radius: 22px;
  padding: 1rem;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.metric-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  color: #dfe9f7;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recipe-card li {
  margin: 0.4rem 0;
  color: #d7e3f4;
  font-weight: 730;
  line-height: 1.4;
}

.plan-quality {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

.plan-quality span {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(143, 181, 255, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: #dbe8ff;
  font-weight: 850;
}

.recipe-card details {
  margin-top: 1rem;
}

.recipe-card summary {
  cursor: pointer;
  font-weight: 950;
}

.recipe-card pre {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem;
  color: #dfffea;
  background: rgba(0, 0, 0, 0.32);
  white-space: pre-wrap;
}

.exports-output h3 {
  margin-top: 0;
}

.export-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.export-card {
  display: grid;
  gap: 0.55rem;
  border-radius: 22px;
  padding: 0.85rem;
}

.export-card video {
  border-radius: 16px;
}

.export-card a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border-radius: 14px;
  color: #03111f;
  background: linear-gradient(135deg, var(--green), var(--blue));
  text-decoration: none;
  font-weight: 950;
}

.is-busy button:not(:disabled) {
  cursor: wait;
}

@media (max-width: 980px) {
  .hero-studio,
  .workspace,
  .project-panel,
  .upload-grid,
  .recipe-grid,
  .render-layout {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phone-preview {
    min-height: auto;
    aspect-ratio: 9 / 16;
    max-width: 360px;
    margin: 0 auto;
  }
}

@media (max-width: 620px) {
  .studio-shell {
    width: min(100% - 0.75rem, 560px);
  }

  .topbar,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-copy,
  .render-card,
  .panel,
  .rail {
    border-radius: 22px;
  }

  .hero-copy,
  .render-card {
    min-height: auto;
  }

  h1 {
    font-size: clamp(3.5rem, 22vw, 5.8rem);
  }

  .rail {
    grid-template-columns: 1fr;
  }
}

.preview-label {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  border: 1px solid rgba(66, 245, 158, 0.45);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  color: #dfffea;
  background: rgba(2, 6, 23, 0.82);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-label.is-warning {
  border-color: rgba(255, 209, 102, 0.65);
  color: #fff3cc;
}

.phone-preview.has-video {
  position: relative;
}

.offline-export-note {
  display: grid;
  gap: 0.35rem;
  border: 1px dashed rgba(255, 209, 102, 0.52);
  border-radius: 18px;
  padding: 1rem;
  color: #fff3cc;
  background: rgba(255, 209, 102, 0.08);
  font-weight: 850;
}
