:root {
  color-scheme: dark;
  --black: #000;
  --ink: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.68);
  --soft: rgba(245, 245, 247, 0.42);
  --panel: #1d1d1f;
  --panel-2: #272729;
  --line: rgba(255, 255, 255, 0.1);
  --blue: #0071e3;
  --blue-light: #2997ff;
  --navy: #111820;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(17, 24, 32, 0.5), rgba(0, 0, 0, 0) 360px),
    var(--black);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
}

.topbar a {
  margin-left: auto;
  color: var(--blue-light);
  text-decoration: none;
}

.brand-mark {
  width: 15px;
  height: 20px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #fff, #9aa8b5);
}

.hero {
  min-height: 48vh;
  display: grid;
  align-items: end;
  padding: 84px max(24px, calc((100vw - 1180px) / 2)) 54px;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue-light);
  font-size: 14px;
  line-height: 1.3;
}

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

h1 {
  margin-bottom: 18px;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.04;
  font-weight: 650;
  letter-spacing: 0;
  max-width: 940px;
}

.lede {
  max-width: 680px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 18px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2)) 24px;
  align-items: stretch;
}

.control-panel,
.preview-card,
.prompt-section {
  background: var(--panel);
  border-radius: 8px;
}

.control-panel {
  padding: 22px;
  border: 1px solid var(--line);
}

.panel-header h2,
.prompt-section h2 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.14;
  font-weight: 600;
}

.dropzone {
  min-height: 176px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  margin: 22px 0 18px;
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #111;
  text-align: center;
  cursor: pointer;
}

.dropzone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  font-size: 28px;
  line-height: 1;
}

.dropzone small,
.dropzone em,
.hint,
.preview-toolbar,
.prompt-section p {
  color: var(--soft);
}

.dropzone em {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-style: normal;
}

.dropzone em.is-ready {
  color: #fff;
  background: rgba(0, 113, 227, 0.38);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.field input[type="url"],
.text-input,
.wishlist-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0 12px;
  background: #0b0b0c;
  color: var(--ink);
  outline: none;
}

.field input[type="url"]:focus,
.text-input:focus,
.wishlist-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.35);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 8px;
  background: #0b0b0c;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.segmented label {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--soft);
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented label:has(input:checked) {
  background: var(--ink);
  color: #111;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}

.primary-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.invite-field {
  margin-top: 14px;
}

.progress-panel {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #0b0b0c;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  transition: width 420ms ease;
}

.hint {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.wishlist-panel {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wishlist-title {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.wishlist-copy,
.wishlist-message {
  margin-bottom: 10px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
}

.wishlist-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.wishlist-field button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--ink);
  color: #111;
  cursor: pointer;
  white-space: nowrap;
}

.wishlist-message {
  min-height: 18px;
  margin: 8px 0 0;
}

.preview-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.preview-card {
  min-height: 560px;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
}

.preview-toolbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.image-frame {
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.1), transparent 34%),
    linear-gradient(145deg, #111820, #050506 64%);
  overflow: hidden;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050506;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.toolbar-button {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.toolbar-button:hover,
.toolbar-button:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

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

.empty-preview {
  width: min(72%, 360px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.26);
  font-size: 42px;
  font-weight: 600;
}

.result-json {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #d7e7ff;
  background: #050506;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.prompt-section {
  margin: 0 max(24px, calc((100vw - 1180px) / 2)) 72px;
  padding: 26px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 30px;
  border: 1px solid var(--line);
}

.prompt-section p:last-child {
  margin-bottom: 0;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .workspace,
  .preview-stage,
  .prompt-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 44px;
    padding-bottom: 26px;
  }

  h1 {
    font-size: 42px;
  }

  .preview-card {
    min-height: 430px;
  }
}

@media (max-width: 560px) {
  .hero,
  .workspace,
  .prompt-section,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar span {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  h1 {
    font-size: 31px;
    line-height: 1.08;
  }

  .lede {
    font-size: 15px;
    line-height: 1.45;
  }

  .workspace {
    gap: 12px;
    padding-bottom: 16px;
  }

  .control-panel {
    padding: 16px;
  }

  .dropzone {
    min-height: 132px;
    margin: 16px 0 14px;
    padding: 18px;
  }

  .preview-stage {
    gap: 12px;
  }

  .preview-card {
    min-height: 360px;
  }

  .preview-toolbar {
    min-height: 46px;
    height: auto;
    padding: 0 12px;
    gap: 8px;
  }

  .result-actions {
    gap: 6px;
  }

  .toolbar-button {
    padding: 7px 8px;
    font-size: 11px;
  }

  .wishlist-field {
    grid-template-columns: 1fr;
  }

  .prompt-section {
    margin-bottom: 36px;
  }

  .empty-preview {
    font-size: 30px;
  }
}
