:root {
  color-scheme: light;
  --primary: #0a0a0a;
  --primary-active: #1f1f1f;
  --primary-disabled: #e5e5e5;
  --ink: #0a0a0a;
  --body: #3a3a3a;
  --body-strong: #1a1a1a;
  --muted: #6a6a6a;
  --muted-soft: #9a9a9a;
  --hairline: #e5e5e5;
  --hairline-soft: #f0f0f0;
  --canvas: #fffaf0;
  --surface-soft: #faf5e8;
  --surface-card: #f5f0e0;
  --surface-strong: #ebe6d6;
  --brand-pink: #ff4d8b;
  --brand-teal: #1a3a3a;
  --brand-lavender: #b8a4ed;
  --brand-peach: #ffb084;
  --brand-ochre: #e8b94a;
  --brand-mint: #a4d4c5;
  --brand-coral: #ff6b5a;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 max(24px, calc((100vw - 1280px) / 2 + 24px));
  border-bottom: 1px solid var(--hairline);
  background: rgba(255, 250, 240, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand-logo-frame {
  display: block;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface-soft);
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.brand-wordmark {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.app {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 0 24px 96px;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(280px, 5fr);
  gap: 48px;
  align-items: center;
  min-height: 0;
  padding: 20px 0;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--surface-card);
  color: var(--body-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
}

h1 {
  max-width: 760px;
  font-size: clamp(48px, 8vw, 72px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.hero-copy > p:last-child {
  max-width: 650px;
  margin: 24px 0 0;
  color: var(--body);
  font-size: 18px;
  line-height: 1.55;
}

.hero-illustration-card {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 40px;
  border-radius: 24px;
  background: var(--surface-soft);
}

.hero-illustration-card img {
  display: block;
  width: min(100%, 360px);
  border-radius: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 5fr) minmax(0, 7fr);
  gap: 24px;
  align-items: start;
}

.seo-content {
  display: grid;
  gap: 32px;
  padding: 96px 0 0;
}

.seo-heading {
  max-width: 760px;
}

.seo-heading h2 {
  max-width: 760px;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.seo-heading > p:last-child {
  margin: 18px 0 0;
  color: var(--body);
  font-size: 16px;
  line-height: 1.55;
}

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

.seo-card {
  min-height: 220px;
  border-radius: 24px;
  padding: 28px;
}

.seo-card h3 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.seo-card p {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.55;
}

.seo-card-pink {
  background: var(--brand-pink);
  color: #ffffff;
}

.seo-card-pink h3 {
  color: #ffffff;
}

.seo-card-teal {
  background: var(--brand-teal);
  color: #ffffff;
}

.seo-card-teal h3 {
  color: #ffffff;
}

.seo-card-lavender {
  background: var(--brand-lavender);
}

.seo-card-cream {
  background: var(--surface-card);
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 18px 20px;
}

.faq-list summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.faq-list p {
  margin: 12px 0 0;
  color: var(--body);
  font-size: 15px;
  line-height: 1.55;
}

.left-stack,
.right-stack {
  display: grid;
  gap: 24px;
}

.feature-card-lavender,
.feature-card-cream,
.feature-card-peach,
.product-mockup-card {
  border-radius: 24px;
}

.feature-card-lavender {
  background: var(--brand-lavender);
}

.feature-card-cream,
.product-mockup-card {
  background: var(--surface-card);
}

.feature-card-peach {
  background: var(--brand-peach);
}

.upload-card,
.settings-card,
.compare-card,
.queue-card {
  padding: 32px;
}

.upload-card {
  cursor: pointer;
}

.upload-card.is-dragging {
  outline: 2px solid var(--ink);
  outline-offset: -8px;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 24px;
  border-radius: 16px;
  background: var(--canvas);
  color: var(--ink);
}

.upload-icon svg,
.section-heading svg,
.button-primary svg,
.button-secondary svg,
.download-button svg,
.empty-preview svg,
.comparison-handle svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.upload-card h2 {
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.upload-card h2 span {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.upload-card p {
  margin: 12px 0 0;
  color: var(--body);
  font-size: 14px;
  line-height: 1.55;
}

.hidden-file-input {
  display: none;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.setting-group {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.setting-group > label,
.setting-line label,
.setting-line span,
.custom-size span {
  color: var(--body-strong);
  font-size: 14px;
  font-weight: 600;
}

.setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

output {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  padding: 5px 10px;
  border-radius: 9999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.setting-group p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.format-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(88px, max-content);
  gap: 8px;
  max-width: 100%;
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-color: var(--surface-strong) transparent;
  scrollbar-width: thin;
}

.format-scroll::-webkit-scrollbar {
  height: 8px;
}

.format-scroll::-webkit-scrollbar-thumb {
  border-radius: 9999px;
  background: var(--surface-strong);
}

.segmented {
  display: grid;
  gap: 8px;
}

.segmented.two {
  grid-template-columns: 1fr 1fr;
}

.control-chip {
  min-height: 40px;
  border: 0;
  border-radius: 9999px;
  padding: 8px 16px;
  background: rgba(255, 250, 240, 0.72);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.control-chip.is-active {
  background: var(--primary);
  color: var(--on-primary, #ffffff);
}

input[type="range"] {
  width: 100%;
  height: 8px;
  accent-color: var(--primary);
  cursor: pointer;
}

.resize-panel {
  display: grid;
  gap: 10px;
}

.custom-size {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.custom-size label {
  display: grid;
  gap: 8px;
}

.text-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--canvas);
  color: var(--ink);
  outline: none;
  font-size: 16px;
}

.text-input:focus {
  border-color: var(--ink);
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.button-primary {
  background: var(--primary);
  color: #ffffff;
}

.button-primary:active {
  background: var(--primary-active);
}

.button-primary:disabled {
  background: var(--primary-disabled);
  color: var(--muted);
  cursor: not-allowed;
}

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

.process-button {
  width: 100%;
  margin-top: 32px;
}

.compare-heading,
.queue-heading {
  justify-content: space-between;
  gap: 16px;
}

.compare-heading > div,
.queue-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend span,
#batch-count,
.status-badge {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  border-radius: 9999px;
  padding: 5px 12px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.legend span:first-child {
  background: var(--brand-ochre);
}

.legend span:last-child {
  background: var(--brand-mint);
}

.comparison-slider {
  position: relative;
  height: 430px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background:
    linear-gradient(45deg, rgba(229, 229, 229, 0.5) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(229, 229, 229, 0.5) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(229, 229, 229, 0.5) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(229, 229, 229, 0.5) 75%);
  background-color: var(--canvas);
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
  user-select: none;
}

.empty-preview {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 32px;
  background: var(--canvas);
  text-align: center;
}

.empty-preview div {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.empty-preview strong {
  font-size: 18px;
  font-weight: 600;
}

.empty-preview span {
  max-width: 320px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.preview-img:not([src]),
.preview-img[src=""] {
  display: none;
}

.original-layer {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 2;
  width: 50%;
  overflow: hidden;
  border-right: 1px solid var(--ink);
}

.original-img {
  max-width: none;
}

.comparison-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 10;
  width: 44px;
  transform: translateX(-50%);
  cursor: ew-resize;
  outline: none;
}

.comparison-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--ink);
}

.comparison-handle span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  transform: translate(-50%, -50%);
  background: var(--primary);
  color: #ffffff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--canvas);
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.stat-card strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.stat-card small {
  color: var(--muted-soft);
  font-size: 12px;
}

.download-button {
  min-height: 92px;
  flex-direction: column;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.queue-actions .button-secondary {
  min-height: 36px;
  padding: 8px 12px;
}

.queue-list {
  display: grid;
  gap: 12px;
  max-height: 330px;
  margin-top: 16px;
  overflow-y: auto;
}

.empty-queue {
  padding: 32px 16px;
  color: var(--body);
  text-align: center;
  font-size: 14px;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(10, 10, 10, 0.12);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 250, 240, 0.72);
  cursor: pointer;
  text-align: left;
}

.queue-item.is-active {
  background: var(--canvas);
  border-color: var(--ink);
}

.queue-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.queue-item img {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-soft);
}

.queue-item-title {
  min-width: 0;
}

.queue-item-title strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item-title span {
  display: block;
  margin-top: 4px;
  color: var(--body);
  font-size: 13px;
}

.queue-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge.done {
  background: var(--brand-mint);
}

.remove-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9999px;
  background: var(--canvas);
  color: var(--ink);
}

.remove-button svg {
  width: 16px;
  height: 16px;
}

.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--surface-card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.toast.success {
  background: var(--brand-mint);
}

.toast.error {
  background: var(--brand-coral);
}

.toast.info {
  background: var(--surface-card);
}

.is-muted {
  opacity: 0.55;
}

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

  .hero-band {
    min-height: 0;
    padding-top: 40px;
  }

  .hero-illustration-card {
    min-height: 320px;
  }

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

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

@media (max-width: 620px) {
  .site-header {
    padding: 0 16px;
  }

  .app {
    padding: 32px 16px 72px;
  }

  h1 {
    font-size: 46px;
  }

  .upload-card,
  .settings-card,
  .compare-card,
  .queue-card {
    padding: 24px;
  }

  .compare-heading,
  .queue-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .comparison-slider {
    height: 330px;
  }

  .custom-size,
  .stats-grid,
  .seo-grid,
  .segmented.two,
  .queue-item {
    grid-template-columns: 1fr;
  }

  .queue-item-actions {
    justify-content: space-between;
  }
}
