:root {
  --bg: #11110e;
  --bg-deep: #0c0c09;
  --panel: #191915;
  --panel-raised: #1e1e19;
  --panel-soft: #151512;
  --line: #34342c;
  --line-soft: #292923;
  --ink: #151510;
  --paper: #f3eedf;
  --paper-soft: #e7e0ce;
  --text: #f0ecdf;
  --muted: #a09f91;
  --muted-strong: #c0bdaf;
  --acid: #dff247;
  --acid-soft: rgba(223, 242, 71, 0.16);
  --orange: #ff6b3d;
  --danger: #ff7669;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-ui: "Manrope", sans-serif;
  --font-display: "Bodoni Moda", Georgia, serif;
  --font-editorial: "Newsreader", Georgia, serif;
  --font-mono: "IBM Plex Mono", monospace;
  --shadow-deep: 0 34px 90px rgba(0, 0, 0, 0.34);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 48% -8%, rgba(223, 242, 71, 0.055), transparent 27rem),
    linear-gradient(180deg, #12120f 0%, var(--bg) 34%, #0f0f0c 100%);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 70%);
}

::selection {
  color: var(--ink);
  background: var(--acid);
}

button,
input,
select {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--acid);
  border-radius: 8px;
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 clamp(18px, 3.2vw, 54px);
  background: rgba(15, 15, 12, 0.96);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  max-width: 1600px;
  min-height: 74px;
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--paper);
  background: #20201b;
  border: 1px solid #3a3a31;
  border-radius: 11px;
}

.brand-mark svg {
  width: 27px;
  height: 27px;
}

.wordmark {
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.045em;
}

.wordmark span {
  color: var(--acid);
}

.primary-nav {
  display: flex;
  align-items: center;
  padding: 4px;
  background: #171713;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.nav-item {
  position: relative;
  padding: 9px 15px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 8px;
  transition:
    color 180ms ease,
    background 180ms ease;
}

.nav-item:hover {
  color: var(--text);
}

.nav-item.is-active {
  color: var(--paper);
  background: #25251f;
}

.nav-item.is-active::after {
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  content: "";
  background: var(--acid);
  border-radius: 50%;
  transform: translateX(-50%);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.privacy-pill i {
  width: 7px;
  height: 7px;
  background: var(--acid);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(223, 242, 71, 0.08);
}

.download-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  transition:
    transform 180ms var(--ease-out),
    background 180ms ease,
    opacity 180ms ease;
}

.download-button svg {
  width: 17px;
  height: 17px;
}

.download-button:hover:not(:disabled) {
  background: var(--acid);
  transform: translateY(-1px);
}

.download-button:disabled {
  color: #747468;
  background: #1b1b17;
  border-color: var(--line);
  cursor: not-allowed;
}

.studio {
  width: min(100%, 1660px);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px) clamp(18px, 3.2vw, 54px) clamp(58px, 7vw, 100px);
}

.studio-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: end;
  margin-bottom: clamp(30px, 4.4vw, 56px);
  gap: clamp(36px, 7vw, 110px);
}

.eyebrow {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  gap: 10px;
}

.eyebrow span {
  color: var(--acid);
}

.eyebrow::after {
  width: 34px;
  height: 1px;
  content: "";
  background: var(--line);
}

.studio-heading h1 {
  max-width: 950px;
  margin-bottom: 0;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(52px, 6.8vw, 112px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.057em;
  text-wrap: balance;
}

.studio-heading h1 em {
  position: relative;
  z-index: 0;
  font-weight: 500;
}

.studio-heading h1 em::after {
  position: absolute;
  right: -0.02em;
  bottom: 0.02em;
  left: -0.02em;
  z-index: -1;
  height: 0.19em;
  content: "";
  background: var(--acid);
  transform: rotate(-1.2deg);
}

.studio-deck {
  max-width: 420px;
  padding-bottom: 8px;
}

.studio-deck > p {
  margin-bottom: 28px;
  color: var(--muted-strong);
  font-family: var(--font-editorial);
  font-size: clamp(18px, 1.55vw, 23px);
  line-height: 1.42;
}

.studio-deck > p.studio-lead {
  margin-top: -14px;
  margin-bottom: 22px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
}

.deck-meta {
  display: flex;
  flex-wrap: wrap;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  gap: 7px 0;
}

.deck-meta span {
  display: inline-flex;
  align-items: center;
}

.deck-meta span:not(:last-child)::after {
  width: 3px;
  height: 3px;
  margin: 0 10px;
  content: "";
  background: var(--line);
  border-radius: 50%;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(246px, 300px) minmax(460px, 1fr) minmax(250px, 306px);
  align-items: start;
  gap: 16px;
}

.panel {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.016), transparent 120px),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.source-panel,
.refine-panel {
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-bottom: 20px;
}

.panel-index,
.panel-note {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.panel-index {
  color: var(--acid);
}

.panel .panel-title {
  margin-bottom: 24px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.panel-intro {
  margin-top: -14px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.field-block {
  margin-bottom: 22px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.field-label,
.field-label-row label {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 600;
}

.text-button {
  display: inline-flex;
  align-items: center;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  gap: 5px;
  font-size: 9px;
  font-weight: 600;
  transition: color 150ms ease;
}

.text-button svg {
  width: 13px;
  height: 13px;
}

.text-button:hover {
  color: var(--acid);
}

.phrase-input-wrap {
  position: relative;
}

.phrase-input-wrap input {
  width: 100%;
  height: 58px;
  padding: 0 48px 0 14px;
  color: var(--paper);
  background: #11110e;
  border: 1px solid #3c3c33;
  border-radius: 11px;
  outline: 0;
  font-family: var(--font-editorial);
  font-size: 19px;
  letter-spacing: 0.015em;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.phrase-input-wrap input::placeholder {
  color: #68685d;
}

.phrase-input-wrap input:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px rgba(223, 242, 71, 0.075);
}

.char-count {
  position: absolute;
  top: 50%;
  right: 14px;
  color: #727266;
  font-family: var(--font-mono);
  font-size: 9px;
  transform: translateY(-50%);
}

.char-count.is-low {
  color: var(--orange);
}

.field-hint {
  margin: 8px 0 0;
  color: #77776b;
  font-size: 9px;
  line-height: 1.45;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  margin-top: 12px;
  gap: 6px;
}

.prompt-chips button {
  padding: 6px 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.prompt-chips button:hover {
  color: var(--paper);
  background: #23231d;
  border-color: #45453b;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  background: #11110e;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  gap: 3px;
}

.segmented button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 7px 4px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms var(--ease-out);
}

.segmented button:hover {
  color: var(--paper);
}

.segmented button.is-active {
  color: var(--ink);
  background: var(--acid);
}

.segmented button span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.segmented button small {
  margin-top: 2px;
  color: inherit;
  font-size: 8px;
  opacity: 0.62;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  height: 42px;
  padding: 0 32px 0 11px;
  color: var(--paper);
  background: #11110e;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  outline: 0;
  appearance: none;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  transition: border-color 150ms ease;
}

.select-wrap select:hover,
.select-wrap select:focus {
  border-color: #4a4a40;
}

.select-wrap > svg {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 13px;
  height: 13px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.sound-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 7px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--muted-strong);
  background: #11110e;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  cursor: pointer;
  place-items: center;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button:hover {
  color: var(--acid);
  background: #20201a;
  border-color: #46463b;
}

.generate-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 72px;
  margin-top: 4px;
  padding: 14px 15px 14px 17px;
  color: var(--ink);
  background: var(--acid);
  border: 1px solid var(--acid);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition:
    transform 180ms var(--ease-out),
    background 180ms ease,
    opacity 180ms ease;
}

.generate-button:hover:not(:disabled) {
  background: #edff65;
  transform: translateY(-2px);
}

.generate-button:active:not(:disabled) {
  transform: translateY(0);
}

.generate-button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.generate-button-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.generate-button-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.generate-button-meta {
  color: rgba(21, 21, 16, 0.63);
  font-size: 9px;
  font-weight: 600;
}

.generate-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
  place-items: center;
}

.generate-arrow svg {
  width: 18px;
  height: 18px;
}

.shortcut-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 13px 0 0;
  color: #707064;
  font-family: var(--font-mono);
  font-size: 8px;
  gap: 6px;
}

.shortcut-hint span {
  width: 1px;
  height: 9px;
  margin: 0 2px;
  background: var(--line);
}

kbd {
  min-width: 19px;
  padding: 2px 4px;
  color: #929286;
  background: #20201a;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  text-align: center;
}

.stage-panel {
  display: flex;
  flex-direction: column;
  min-height: 690px;
  padding: 18px;
  overflow: hidden;
}

.stage-head,
.transport-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stage-head {
  min-height: 28px;
  margin-bottom: 9px;
}

.stage-title-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.stage-head .panel-title {
  margin: 0;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--acid);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(223, 242, 71, 0.08);
}

.live-dot.is-busy {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 107, 61, 0.1);
  animation: pulse 1.1s ease-in-out infinite;
}

.stage-meta {
  flex: 0 0 auto;
  color: #77776b;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.stage-viewport {
  position: relative;
  display: grid;
  flex: 1;
  min-height: 500px;
  padding: clamp(18px, 3vw, 38px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(243, 238, 223, 0.06), transparent 30%),
    radial-gradient(circle, rgba(255, 255, 255, 0.11) 0.7px, transparent 0.9px);
  background-size: auto, 24px 24px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  place-items: center;
}

.stage-viewport::before,
.stage-viewport::after {
  position: absolute;
  width: 54px;
  height: 54px;
  pointer-events: none;
  content: "";
  opacity: 0.38;
}

.stage-viewport::before {
  top: 12px;
  left: 12px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.stage-viewport::after {
  right: 12px;
  bottom: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.canvas-frame {
  position: relative;
  width: min(78%, 610px);
  aspect-ratio: var(--canvas-ratio, 1);
  padding: 10px;
  background: #0c0c09;
  border: 1px dashed rgba(243, 238, 223, 0.3);
  border-radius: 17px;
  box-shadow: var(--shadow-deep);
  transition:
    width 420ms var(--ease-out),
    aspect-ratio 320ms ease;
}

.workspace[data-ratio="9:16"] .canvas-frame {
  width: min(53%, 344px);
}

.workspace[data-ratio="16:9"] .canvas-frame {
  width: min(100%, 826px);
}

.canvas-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--paper);
  border-radius: 7px;
}

.canvas-corner {
  position: absolute;
  z-index: 2;
  width: 13px;
  height: 13px;
  pointer-events: none;
  border-color: rgba(243, 238, 223, 0.58);
}

.canvas-corner-tl {
  top: -1px;
  left: -1px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.canvas-corner-tr {
  top: -1px;
  right: -1px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.canvas-corner-bl {
  bottom: -1px;
  left: -1px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.canvas-corner-br {
  right: -1px;
  bottom: -1px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.preview-toggle {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 6px 14px 6px 7px;
  color: var(--paper);
  background: rgba(21, 21, 16, 0.9);
  border: 1px solid rgba(243, 238, 223, 0.32);
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  gap: 7px;
  transform: translate(-50%, -50%);
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms var(--ease-out),
    padding 220ms var(--ease-out);
}

.preview-toggle:hover {
  color: var(--ink);
  background: var(--acid);
  transform: translate(-50%, -50%) scale(1.025);
}

.preview-toggle-icon {
  display: grid;
  width: 32px;
  height: 32px;
  background: rgba(243, 238, 223, 0.08);
  border-radius: 50%;
  place-items: center;
}

.preview-toggle:hover .preview-toggle-icon {
  background: rgba(21, 21, 16, 0.12);
}

.preview-toggle-icon svg {
  width: 18px;
  height: 18px;
}

.preview-icon-pause {
  display: none;
}

.preview-toggle-text {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.canvas-frame.is-playing .preview-toggle {
  top: auto;
  right: 18px;
  bottom: 18px;
  left: auto;
  min-height: 34px;
  padding: 3px;
  transform: none;
}

.canvas-frame.is-playing .preview-toggle:hover {
  transform: none;
}

.canvas-frame.is-playing .preview-toggle-text {
  display: none;
}

.canvas-frame.is-playing .preview-toggle-icon {
  width: 28px;
  height: 28px;
}

.canvas-frame.is-playing .preview-icon-play {
  display: none;
}

.canvas-frame.is-playing .preview-icon-pause {
  display: grid;
}

.transport {
  padding-top: 15px;
}

.timeline {
  position: relative;
  height: 3px;
  overflow: hidden;
  background: #2a2a24;
  border-radius: 99px;
}

.timeline i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--acid);
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(223, 242, 71, 0.28);
  transition: width 80ms linear;
}

.transport-row {
  margin-top: 10px;
  color: #7d7d70;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-top: 14px;
  padding: 13px 14px;
  background: #11110e;
  border: 1px solid var(--line);
  border-radius: 12px;
  gap: 14px;
  animation: rise 420ms var(--ease-out) both;
}

.result-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.result-kicker {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.result-copy strong {
  overflow: hidden;
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-copy > span:last-child {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.result-actions {
  display: flex;
  gap: 7px;
}

.ghost-button,
.solid-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.ghost-button {
  color: var(--muted-strong);
  background: transparent;
  border: 1px solid var(--line);
}

.ghost-button:hover {
  color: var(--paper);
  border-color: #4a4a40;
}

.solid-button {
  color: var(--ink);
  background: var(--acid);
  border: 1px solid var(--acid);
}

.solid-button:hover {
  background: #edff65;
}

.result-video {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 260px;
  margin-top: 3px;
  background: #000;
  border-radius: 8px;
}

.refine-panel .panel-heading {
  margin-bottom: 18px;
}

.reset-button {
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  cursor: pointer;
  gap: 4px;
  font-size: 8px;
  font-weight: 600;
  transition:
    color 150ms ease,
    border-color 150ms ease;
}

.reset-button svg {
  width: 12px;
  height: 12px;
}

.reset-button:hover {
  color: var(--paper);
  border-color: #4a4a40;
}

.slider-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.slider-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-label-row label {
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 600;
}

.slider-label-row output {
  min-width: 29px;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 9px;
  text-align: right;
}

input[type="range"] {
  --fill: 50%;
  width: 100%;
  height: 14px;
  margin: 0;
  background: transparent;
  outline: none;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(90deg, var(--acid) 0 var(--fill), #36362e var(--fill) 100%);
  border-radius: 99px;
}

input[type="range"]::-moz-range-track {
  height: 3px;
  background: #36362e;
  border-radius: 99px;
}

input[type="range"]::-moz-range-progress {
  height: 3px;
  background: var(--acid);
  border-radius: 99px;
}

input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  background: var(--paper);
  border: 0;
  border-radius: 50%;
  box-shadow:
    0 0 0 3px #191915,
    0 0 0 4px rgba(243, 238, 223, 0.15);
  appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--paper);
  border: 0;
  border-radius: 50%;
  box-shadow:
    0 0 0 3px #191915,
    0 0 0 4px rgba(243, 238, 223, 0.15);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 3px #191915,
    0 0 0 5px var(--acid);
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  margin-top: -2px;
  color: #66665b;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.02em;
}

.switch-stack {
  display: flex;
  flex-direction: column;
  margin-top: 25px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  gap: 13px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.switch-row > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.switch-row strong {
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 600;
}

.switch-row span {
  color: #737368;
  font-size: 8px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 19px;
  padding: 0;
  background: #30302a;
  border: 1px solid #414139;
  border-radius: 99px;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  content: "";
  background: #8d8d80;
  border-radius: 50%;
  transition:
    transform 220ms var(--ease-out),
    background 180ms ease;
}

.switch.is-on {
  background: var(--acid);
  border-color: var(--acid);
}

.switch.is-on::after {
  background: var(--ink);
  transform: translateX(15px);
}

.refine-note {
  display: flex;
  margin-top: 22px;
  padding: 13px;
  background: rgba(223, 242, 71, 0.06);
  border: 1px solid rgba(223, 242, 71, 0.14);
  border-radius: 10px;
  gap: 9px;
}

.refine-note-mark {
  color: var(--acid);
  font-size: 15px;
  line-height: 1;
}

.refine-note p {
  margin: 0;
  color: #9d9d8e;
  font-size: 8px;
  line-height: 1.6;
}

.statement-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(calc(100% - 2 * clamp(18px, 3.2vw, 54px)), 1552px);
  margin: 0 auto;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.statement-strip span {
  position: relative;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.statement-strip span:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 1px;
  height: 14px;
  content: "";
  background: var(--line-soft);
  transform: translateY(-50%);
}

.content-section {
  width: min(calc(100% - 2 * clamp(18px, 3.2vw, 54px)), 1320px);
  margin: 0 auto;
  padding: clamp(78px, 10vw, 142px) 0;
  border-bottom: 1px solid var(--line-soft);
}

.section-heading {
  max-width: 840px;
  margin-bottom: clamp(38px, 5.4vw, 68px);
}

.section-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  align-items: end;
  max-width: none;
  gap: 64px;
}

.section-heading h2 {
  margin-bottom: 19px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(43px, 5.1vw, 78px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.048em;
  text-wrap: balance;
}

.section-heading > p:last-child,
.section-heading-row > p {
  max-width: 580px;
  margin-bottom: 0;
  color: var(--muted);
  font-family: var(--font-editorial);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.45;
}

.process-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
  margin: 0;
  list-style: none;
}

.process-list li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  padding: 7px clamp(20px, 3vw, 44px) 7px 0;
  gap: 15px;
}

.process-list li:not(:last-child) {
  border-right: 1px solid var(--line-soft);
}

.process-list li:not(:first-child) {
  padding-left: clamp(20px, 3vw, 44px);
}

.process-number {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 9px;
}

.process-list h3 {
  margin-bottom: 10px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(25px, 2.2vw, 33px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.process-list p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(14px, 2.2vw, 28px);
}

.example-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.example-prompt {
  min-height: 5em;
  margin: 0;
  color: var(--paper);
  font-family: var(--font-editorial);
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.example-prompt mark {
  padding-inline: 0.05em;
  color: inherit;
  background-color: transparent;
  background-image: linear-gradient(transparent 60%, var(--acid) 60%, var(--acid) 92%, transparent 92%);
  background-repeat: no-repeat;
}

.example-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0e0e0b;
  border-radius: 10px;
  cursor: pointer;
}

.example-media canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--paper);
}

.example-media::after {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  content: "";
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FAFAF7'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") 55% 50% / 18px 18px no-repeat rgba(10, 10, 10, 0.75);
  border-radius: 50%;
  opacity: 1;
  pointer-events: none;
  transition: opacity 180ms var(--ease-out);
}

.example-card:hover .example-media::after,
.example-card:focus-within .example-media::after,
.example-card.is-playing .example-media::after {
  opacity: 0;
}

.example-button {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0;
  color: var(--paper);
  background: none;
  border: 0;
  cursor: pointer;
  gap: 7px;
  font-size: 9px;
  font-weight: 700;
}

.example-button svg {
  width: 13px;
  height: 13px;
  transition: transform 180ms var(--ease-out);
}

.example-button:hover {
  color: var(--acid);
}

.example-button:hover svg {
  transform: translateX(3px);
}

.faq-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  align-items: start;
  gap: clamp(36px, 7vw, 110px);
}

.faq-section .section-heading {
  position: sticky;
  top: 108px;
  margin-bottom: 0;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  position: relative;
  padding: 23px 46px 23px 0;
  color: var(--paper);
  cursor: pointer;
  font-family: var(--font-editorial);
  font-size: clamp(18px, 1.7vw, 23px);
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 21px;
  height: 21px;
  content: "+";
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 400;
  line-height: 19px;
  text-align: center;
  transform: translateY(-50%);
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details p {
  max-width: 660px;
  padding: 0 44px 24px 0;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.site-footer {
  width: min(calc(100% - 2 * clamp(18px, 3.2vw, 54px)), 1320px);
  margin: 0 auto;
  padding: 65px 0 30px;
}

.footer-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 50px;
  gap: 34px;
}

.footer-brand .brand-mark {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.footer-top > p {
  max-width: 400px;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-editorial);
  font-size: 16px;
  line-height: 1.5;
  text-align: right;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding-bottom: 22px;
}

.footer-links a {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--acid);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 18px;
  color: #6e6e62;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-top: 22px;
}

.section-links a {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-transform: uppercase;
}

#clipping .section-heading > p {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
  font-family: var(--font-editorial);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.45;
}

.use-list article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px 18px;
  padding: 28px 0 8px;
  border-top: 1px solid var(--line-soft);
}

.use-list h3 {
  margin-bottom: 12px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.use-list p {
  max-width: 68ch;
  margin: 0 0 14px;
  color: var(--muted);
  font-family: var(--font-editorial);
  font-size: 18px;
  line-height: 1.65;
}

.use-close {
  max-width: 68ch;
  margin-top: 18px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.use-close p {
  margin: 0 0 14px;
  color: var(--muted);
  font-family: var(--font-editorial);
  font-size: 18px;
  line-height: 1.65;
}

.use-close p:last-child {
  margin-bottom: 0;
}

.use-close a {
  color: var(--acid);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-page {
  width: min(calc(100% - 2 * clamp(18px, 3.2vw, 54px)), 760px);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 92px) 0 clamp(64px, 9vw, 110px);
}

.article-kicker {
  margin-bottom: 18px;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-page h1 {
  margin-bottom: 22px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(46px, 6.4vw, 76px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

.article-lede {
  margin-bottom: 28px;
  color: var(--muted-strong);
  font-family: var(--font-editorial);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.45;
}

.article-prose {
  max-width: 68ch;
  color: var(--text);
  font-family: var(--font-editorial);
  font-size: 19px;
  line-height: 1.65;
}

.article-prose h2 {
  margin: 1.55em 0 0.45em;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.article-prose p,
.article-prose li {
  margin: 0 0 1em;
}

.article-prose ul {
  margin: 0 0 1.2em;
  padding-left: 1.15em;
}

.article-prose a {
  color: var(--acid);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(21, 21, 16, 0.12);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 220ms ease,
    transform 220ms var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  color: #fff4ef;
  background: #5f2118;
}

.studio-heading,
.workspace,
.statement-strip {
  animation: rise 700ms var(--ease-out) both;
}

.workspace {
  animation-delay: 80ms;
}

.statement-strip {
  animation-delay: 160ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.42;
  }
}

@media (max-width: 1260px) {
  .workspace {
    grid-template-columns: minmax(238px, 278px) minmax(420px, 1fr);
  }

  .refine-panel {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 0.75fr 1.25fr 1fr;
    align-items: start;
    gap: 28px;
  }

  .refine-panel .panel-heading {
    grid-column: 1 / -1;
    margin-bottom: -6px;
  }

  .refine-panel .panel-title {
    margin-bottom: 9px;
  }

  .refine-panel .panel-intro {
    margin: 0;
  }

  .slider-stack {
    grid-column: 2;
    grid-row: 2 / span 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 19px 24px;
  }

  .switch-stack {
    grid-column: 3;
    grid-row: 2;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .refine-note {
    grid-column: 3;
    grid-row: 3;
    align-self: end;
    margin-top: 12px;
  }
}

@media (max-width: 980px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
  }

  .primary-nav {
    display: none;
  }

  .studio-heading {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .studio-deck {
    max-width: 600px;
  }

  .studio-deck > p {
    margin-bottom: 15px;
  }

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

  .stage-panel {
    order: -1;
  }

  .source-panel,
  .refine-panel {
    display: block;
  }

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

  .refine-panel .panel-heading {
    display: flex;
  }

  .slider-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 28px;
  }

  .switch-stack {
    margin-top: 24px;
    padding-top: 17px;
    border-top: 1px solid var(--line-soft);
  }

  .refine-note {
    margin-top: 20px;
  }

  .section-heading-row {
    grid-template-columns: 1fr;
    gap: 22px;
  }

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

  .faq-section {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .faq-section .section-heading {
    position: static;
  }
}

@media (max-width: 700px) {
  .topbar {
    padding: 0 15px;
  }

  .topbar-inner {
    min-height: 66px;
    gap: 12px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-mark svg {
    width: 24px;
    height: 24px;
  }

  .wordmark {
    font-size: 11px;
  }

  .privacy-pill {
    display: none;
  }

  .download-button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 10px;
  }

  .studio {
    padding-top: 32px;
  }

  .studio-heading h1 {
    font-size: clamp(48px, 15vw, 70px);
  }

  .studio-deck > p {
    font-size: 18px;
  }

  .stage-panel {
    min-height: auto;
    padding: 12px;
  }

  .stage-viewport {
    min-height: 360px;
    padding: 24px 16px;
  }

  .workspace[data-ratio="1:1"] .canvas-frame {
    width: min(94%, 480px);
  }

  .workspace[data-ratio="9:16"] .canvas-frame {
    width: min(76%, 320px);
  }

  .workspace[data-ratio="16:9"] .canvas-frame {
    width: 100%;
  }

  .stage-head {
    padding: 2px 2px 0;
  }

  .stage-meta {
    font-size: 8px;
  }

  .source-panel,
  .refine-panel {
    padding: 18px;
  }

  .panel .panel-title {
    font-size: 28px;
  }

  .slider-stack {
    grid-template-columns: 1fr;
  }

  .result-panel {
    grid-template-columns: 1fr;
  }

  .result-actions {
    justify-content: flex-end;
  }

  .statement-strip {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 14px;
  }

  .statement-strip span:nth-child(2)::after {
    display: none;
  }

  .process-list {
    grid-template-columns: 1fr;
  }

  .process-list li,
  .process-list li:not(:first-child) {
    padding: 22px 0;
  }

  .process-list li:not(:last-child) {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

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

  .footer-top {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 34px;
  }

  .footer-top > p {
    text-align: left;
  }

  .footer-links {
    flex-direction: column;
    gap: 10px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 7px;
  }

  .use-list article {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .article-page h1 {
    font-size: clamp(40px, 12vw, 56px);
  }
}

@media (max-width: 430px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  .studio-heading h1 {
    font-size: 47px;
  }

  .studio-deck .deck-meta {
    gap: 5px;
  }

  .studio-deck .deck-meta span:not(:last-child)::after {
    margin: 0 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
