:root {
  color-scheme: dark;
  --bg: #10131b;
  --panel: #1d2030;
  --panel-strong: #262a3d;
  --ink: #f8fbff;
  --muted: #b9bed3;
  --aqua: #34d5c8;
  --coral: #ff8a80;
  --gold: #ffc857;
  --line: rgba(255, 255, 255, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 18%, rgba(52, 213, 200, 0.26), transparent 28%),
    radial-gradient(circle at 84% 20%, rgba(255, 138, 128, 0.2), transparent 24%),
    linear-gradient(145deg, #10131b 0%, #171827 54%, #132522 100%);
  color: var(--ink);
}

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

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 24px;
  align-items: center;
}

.hero-copy,
.preview-panel,
.tool-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(29, 32, 48, 0.84);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
}

.hero-copy {
  padding: clamp(24px, 5vw, 48px);
}

.kicker {
  margin: 0 0 12px;
  color: var(--aqua);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(44px, 7vw, 82px);
  line-height: 0.96;
  letter-spacing: 0;
}

.lead {
  max-width: 58ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  border: 1px solid var(--line);
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  background: var(--aqua);
  color: #06211f;
}

.secondary-action {
  background: var(--panel-strong);
  color: var(--ink);
}

.secondary-action input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  opacity: 0;
}

.preview-panel {
  min-height: min(70vh, 680px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.preview-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(38, 42, 61, 0.88);
  color: var(--muted);
  font-weight: 800;
}

#handoffStatus {
  color: var(--gold);
  font-size: 13px;
}

.preview-stage {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%);
  background-color: #141721;
  background-size: 32px 32px;
  background-position: 0 0, 0 16px, 16px -16px, -16px 0;
}

#emptyState {
  max-width: 36ch;
  margin: 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

#previewImage {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

.tool-studio {
  margin-top: 18px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
}

.section-title .kicker {
  margin-bottom: 6px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
}

.tool-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tool-card button,
.tool-card input[type="range"] {
  width: 100%;
}

.tool-card button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(38, 42, 61, 0.9);
  color: var(--ink);
  font-weight: 800;
}

.tool-card button:disabled {
  cursor: default;
  opacity: 0.72;
}

.tool-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.tool-card input[type="range"] {
  accent-color: var(--aqua);
}

@media (max-width: 860px) {
  .hero,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    align-items: stretch;
  }

  h1 {
    max-width: 12ch;
    font-size: clamp(40px, 14vw, 62px);
  }
}
