/* =====================================================================
   Landing-page launcher (public/assets/generator.js), shared by the home
   page and the feature / tool / use-case pages. Reads the page tokens --pop, --pop-ink, --pop-soft,
   --ink, --paper, --mist, --display, --body.
   ===================================================================== */
.lg-gen {
  position: relative; z-index: 2; scroll-margin-top: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%;
}
.lg-gen-noscript { padding: 28px; text-align: center; }

/* ---------- shared pieces ---------- */
.lg-gen-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-gen-mode {
  min-height: 42px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--mist); color: var(--ink); font: 600 14.5px var(--body); transition: background .2s, color .2s;
}
.lg-gen-mode:hover { background: #E4E4E0; }
.lg-gen-mode[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }
.lg-gen-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lg-gen-look {
  position: relative; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; color: var(--ink);
  font: 600 12.5px/1.25 var(--body);
}
.lg-gen-look .ph {
  display: block; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: var(--mist);
  outline: 3px solid transparent; outline-offset: -3px; transition: transform .18s, outline-color .18s;
}
.lg-gen-look img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lg-gen-look .nm { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-gen-look:hover .ph { transform: translateY(-2px); }
.lg-gen-look[aria-pressed="true"] .ph { outline-color: var(--ink); }
.lg-gen-look[aria-pressed="true"]::after {
  content: ''; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--pop) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
  box-shadow: 0 0 0 2px var(--paper);
}
.lg-gen-upload {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 14px;
  border-radius: 22px; border: 2px dashed #BDBDB8; background: #FAFAF8; cursor: pointer; color: var(--ink);
}
.lg-gen-upload:hover { border-color: var(--ink); }
.lg-gen-upload:focus-within { outline: 3px solid #2F4BFF; outline-offset: 2px; }
.lg-gen-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.lg-gen-upload .ic {
  flex: none; width: 48px; height: 48px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #FFFFFF;
}
.lg-gen-upload .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lg-gen-upload .tx strong { font: 700 15px var(--body); }
.lg-gen-upload .tx span { font-size: 13px; color: #555555; line-height: 1.35; }
.lg-gen-upload .pv { display: none; flex: none; width: 52px; height: 52px; border-radius: 14px; object-fit: cover; }
.lg-gen-upload.has-file { border-style: solid; border-color: var(--ink); background: var(--pop-soft); }
.lg-gen-upload.has-file .ic { display: none; }
.lg-gen-upload.has-file .pv { display: block; }
.lg-gen-remove {
  display: none; position: absolute; top: -10px; right: -10px; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--paper); background: var(--ink); color: #FFFFFF; cursor: pointer;
  align-items: center; justify-content: center; padding: 0;
}
.lg-gen-upload.has-file .lg-gen-remove { display: inline-flex; }
.lg-gen-go {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 62px; padding: 0 28px;
  border: 0; border-radius: 999px; cursor: pointer; background: var(--pop); color: var(--pop-ink);
  font: 800 19px var(--body); letter-spacing: -.01em; transition: transform .15s, filter .15s, background .3s;
}
.lg-gen-go:hover { filter: brightness(.95); transform: translateY(-1px); }
.lg-gen-go:disabled { opacity: .7; cursor: progress; transform: none; }
.lg-gen-go .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: hg-blink 1.1s infinite; }
@keyframes hg-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- launcher (home first screen) ---------- */
.lg-gen .lg-gen-modes { justify-content: center; }
.lg-launch-card {
  width: 100%; border-radius: 30px; background: var(--paper); text-align: left;
  border: 1px solid rgba(17, 17, 17, .1); box-shadow: 0 30px 80px -30px rgba(17, 17, 17, .28), 0 2px 0 rgba(17, 17, 17, .04);
}
.lg-launch-rail { position: relative; }
.lg-launch-strip {
  display: flex; align-items: flex-start; gap: 14px; padding: 20px 20px 14px; overflow-x: auto;
  scroll-snap-type: x proximity; scroll-padding: 0 20px; scrollbar-width: none;
}
.lg-launch-strip::-webkit-scrollbar { display: none; }
.lg-launch-rail::before, .lg-launch-rail::after {
  content: ''; position: absolute; z-index: 1; top: 0; bottom: 0; width: 72px; pointer-events: none; transition: opacity .2s;
}
.lg-launch-rail::before { left: 0; border-radius: 30px 0 0 0; background: linear-gradient(90deg, var(--paper) 15%, rgba(255, 255, 255, 0)); }
.lg-launch-rail::after { right: 0; border-radius: 0 30px 0 0; background: linear-gradient(270deg, var(--paper) 15%, rgba(255, 255, 255, 0)); }
.lg-launch-rail.at-start::before, .lg-launch-rail.at-end::after { opacity: 0; }
.lg-launch-nav {
  position: absolute; z-index: 2; top: 50%; width: 44px; height: 44px; margin-top: -32px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid rgba(17, 17, 17, .1); background: var(--paper); color: var(--ink);
  box-shadow: 0 8px 20px -8px rgba(17, 17, 17, .35); transition: opacity .2s, transform .15s;
}
.lg-launch-nav:hover { transform: scale(1.06); }
.lg-launch-nav-prev { left: 10px; }
.lg-launch-nav-prev svg { transform: rotate(180deg); }
.lg-launch-nav-next { right: 10px; }
.lg-launch-rail.at-start .lg-launch-nav-prev, .lg-launch-rail.at-end .lg-launch-nav-next { opacity: 0; pointer-events: none; }
.lg-launch-strip .lg-gen-upload {
  flex: none; width: 132px; aspect-ratio: 3 / 4; min-height: 0; padding: 12px 10px; border-radius: 18px;
  flex-direction: column; justify-content: center; text-align: center; gap: 10px; scroll-snap-align: start;
  background: var(--pop-soft); border-color: color-mix(in srgb, var(--pop) 45%, #FFFFFF); transition: border-color .2s, background .3s;
}
.lg-launch-strip .lg-gen-upload:hover { border-color: var(--pop); }
.lg-launch-strip .lg-gen-upload .ic { width: 44px; height: 44px; border-radius: 50%; background: var(--pop); color: var(--pop-ink); }
.lg-launch-strip .lg-gen-upload .tx strong { font-size: 13.5px; line-height: 1.25; }
.lg-launch-strip .lg-gen-upload .tx span { display: none; }
.lg-launch-strip .lg-gen-upload .pv { width: 100%; height: 100%; position: absolute; inset: 0; border-radius: 16px; }
.lg-launch-strip .lg-gen-upload.has-file .tx { position: relative; margin-top: auto; padding: 4px 10px; border-radius: 999px; background: var(--paper); }
.lg-launch-strip .lg-gen-remove { top: 8px; right: 8px; }
.lg-launch-strip .lg-gen-grid { display: flex; gap: 14px; }
.lg-launch-strip .lg-gen-look { flex: none; width: 132px; scroll-snap-align: start; font-size: 13px; }
.lg-launch-strip .lg-gen-look .ph {
  border-radius: 18px; outline: 0; box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .06), 0 0 0 0 var(--pop);
  transition: transform .18s, box-shadow .18s;
}
.lg-launch-strip .lg-gen-look .ph { background: #F1F1EE; }
/* Most looks are cut-outs on white: multiply lets the tile colour show through as the card. */
.lg-launch-strip .lg-gen-look img { mix-blend-mode: multiply; transition: transform .35s; }
.lg-launch-strip .lg-gen-look:hover img { transform: scale(1.04); }
.lg-launch-strip .lg-gen-look[aria-pressed="true"] .ph { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--pop); }
.lg-launch-strip .lg-gen-look .nm { margin-top: 9px; padding: 0 2px; color: #333333; }
.lg-launch-strip .lg-gen-look[aria-pressed="true"] .nm { color: var(--ink); font-weight: 800; }
.lg-launch-strip .lg-gen-look[aria-pressed="true"]::after { top: 10px; right: 10px; }
.lg-launch-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px 14px 16px; border-top: 1px solid rgba(17, 17, 17, .08);
}
.lg-launch-sel { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lg-launch-thumb { flex: none; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; background: var(--mist); }
.lg-launch-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lg-launch-seltx { display: flex; flex-direction: column; min-width: 0; }
.lg-launch-seltx small { font-size: 12px; color: #555555; }
.lg-gen-sel-name { font: 800 17px/1.15 var(--display); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-launch-bar .lg-gen-go { flex: none; width: auto; min-height: 56px; font-size: 17px; white-space: nowrap; }
.lg-gen-go .ar { display: inline-flex; margin-left: 2px; }

@media (max-width: 640px) {
  .lg-gen-modes { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; max-width: calc(100% + 32px); }
  .lg-gen .lg-gen-modes { justify-content: flex-start; width: calc(100% + 32px); }
  .lg-gen-mode { flex: none; }
  .lg-launch-card { border-radius: 24px; }
  .lg-launch-strip { padding: 14px 14px 10px; gap: 10px; scroll-padding: 0 14px; }
  .lg-launch-strip .lg-gen-grid { gap: 10px; }
  .lg-launch-strip .lg-gen-upload { width: 100px; }
  .lg-launch-strip .lg-gen-look { width: 100px; }
  .lg-launch-nav { display: none; }
  .lg-launch-rail::before, .lg-launch-rail::after { width: 32px; border-radius: 24px 0 0 0; }
  .lg-launch-rail::after { border-radius: 0 24px 0 0; }
  .lg-launch-bar { padding: 10px 12px 12px; }
  .lg-launch-bar .lg-gen-go { min-height: 52px; padding: 0 18px; gap: 8px; }
  .lg-launch-bar .lg-gen-go .dot { display: none; }
  .lg-launch-thumb { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-gen-go .dot { animation: none; }
}

/* ---------- prompt modes (Custom): image slot + prompt box + idea chips ---------- */
.lg-launch-prompt { display: flex; align-items: stretch; gap: 14px; padding: 20px 20px 16px; }
.lg-launch-prompt[hidden], .lg-launch-rail[hidden] { display: none; }
.lg-launch-prompt .lg-gen-upload {
  flex: none; width: 132px; min-height: 176px; padding: 12px 10px; border-radius: 18px;
  flex-direction: column; justify-content: center; text-align: center; gap: 10px;
  background: var(--pop-soft); border-color: color-mix(in srgb, var(--pop) 45%, #FFFFFF);
}
.lg-launch-prompt .lg-gen-upload:hover { border-color: var(--pop); }
.lg-launch-prompt .lg-gen-upload .ic { width: 44px; height: 44px; border-radius: 50%; background: var(--pop); color: var(--pop-ink); }
.lg-launch-prompt .lg-gen-upload .tx strong { font-size: 13.5px; line-height: 1.25; }
.lg-launch-prompt .lg-gen-upload .tx span { display: none; }
.lg-launch-prompt .lg-gen-upload .pv { width: 100%; height: 100%; position: absolute; inset: 0; border-radius: 16px; }
.lg-launch-prompt .lg-gen-upload.has-file .tx { position: relative; margin-top: auto; padding: 4px 10px; border-radius: 999px; background: var(--paper); }
.lg-launch-prompt .lg-gen-remove { top: 8px; right: 8px; }
.lg-prompt-field { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lg-prompt-label { font: 700 13px var(--body); color: #555555; margin-bottom: 8px; }
.lg-prompt-input {
  width: 100%; min-height: 112px; resize: vertical; padding: 14px 16px; border-radius: 18px;
  border: 2px solid rgba(17, 17, 17, .12); background: #FAFAF8; color: var(--ink);
  font: 500 16px/1.45 var(--body); transition: border-color .2s, background .2s;
}
.lg-prompt-input::placeholder { color: #8A8A85; }
.lg-prompt-input:focus { outline: none; border-color: var(--pop); background: var(--paper); }
.lg-prompt-meta { display: flex; justify-content: space-between; gap: 12px; min-height: 20px; margin-top: 6px; font-size: 12.5px; }
.lg-prompt-hint { margin: 0; color: #C2410C; font-weight: 600; }
.lg-prompt-count { margin-left: auto; color: #8A8A85; font-variant-numeric: tabular-nums; }
.lg-prompt-ideas-title { margin: 10px 0 8px; font: 700 13px var(--body); color: #555555; }
.lg-prompt-ideas { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-prompt-idea {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 3px 14px 3px 3px; border-radius: 999px;
  border: 1px solid rgba(17, 17, 17, .1); background: var(--paper); color: var(--ink); cursor: pointer;
  font: 600 13px var(--body); transition: border-color .15s, background .15s;
}
.lg-prompt-idea:hover { border-color: var(--pop); background: var(--pop-soft); }
.lg-prompt-idea img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--mist); }
.lg-launch-thumb { position: relative; }
.lg-launch-pen { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; background: var(--pop-soft); color: var(--ink); }
.lg-launch-thumb.is-prompt img { visibility: hidden; }
.lg-launch-thumb.is-prompt .lg-launch-pen { display: flex; }

@media (max-width: 640px) {
  .lg-launch-prompt { flex-direction: column; padding: 14px 14px 12px; gap: 12px; }
  .lg-launch-prompt .lg-gen-upload { width: 100%; min-height: 64px; flex-direction: row; justify-content: flex-start; text-align: left; }
  .lg-launch-prompt .lg-gen-upload .ic { width: 36px; height: 36px; }
  .lg-launch-prompt .lg-gen-upload .pv { position: static; width: 44px; height: 44px; border-radius: 12px; }
  .lg-launch-prompt .lg-gen-upload.has-file .tx { margin-top: 0; padding: 0; background: none; }
  .lg-prompt-ideas { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; }
  .lg-prompt-idea { flex: none; }
}

/* ---------- loading: skeleton before the catalog arrives, shimmering tiles until images land ---------- */
/* The sweep is a transform on a pseudo-element: compositor-only, no main-thread work per frame. */
@keyframes lg-gen-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.lg-gen-skel i, .lg-gen-skel b, .lg-gen-skel em { position: relative; overflow: hidden; background: #EEEEEA; }
.lg-launch-strip .lg-gen-look .ph { position: relative; }
.lg-gen-skel i::after, .lg-gen-skel b::after, .lg-gen-skel em::after,
.lg-launch-strip .lg-gen-look .ph:not(.is-loaded)::before {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, .6) 50%, transparent 75%);
  animation: lg-gen-sweep 1.3s linear infinite;
}
.lg-launch-strip .lg-gen-look .ph img { opacity: 0; transition: opacity .35s ease, transform .35s; }
.lg-launch-strip .lg-gen-look .ph.is-loaded img { opacity: 1; }
.lg-gen-skel { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.lg-gen[data-lock] .lg-skel-tabs { display: none; }
.lg-skel-tabs { display: flex; gap: 8px; }
.lg-skel-tabs i { display: block; width: 92px; height: 42px; border-radius: 999px; }
.lg-skel-card {
  width: 100%; border-radius: 30px; background: var(--paper); overflow: hidden;
  border: 1px solid rgba(17, 17, 17, .1); box-shadow: 0 30px 80px -30px rgba(17, 17, 17, .28);
}
.lg-skel-strip { display: flex; gap: 14px; padding: 20px 20px 39px; overflow: hidden; }
.lg-skel-strip i { flex: none; display: block; width: 132px; aspect-ratio: 3 / 4; border-radius: 18px; }
.lg-skel-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px 14px 16px; border-top: 1px solid rgba(17, 17, 17, .08); }
.lg-skel-bar span { display: flex; align-items: center; gap: 12px; }
.lg-skel-bar i { display: block; width: 44px; height: 44px; border-radius: 12px; }
.lg-skel-bar b { display: block; width: 120px; height: 18px; border-radius: 6px; }
.lg-skel-bar em { display: block; width: 168px; height: 56px; border-radius: 999px; }
/* The plain link is the no-JS / failed-load fallback; the skeleton covers the wait otherwise. */
.lg-gen > .lg-gen-noscript { display: none; }
.no-js .lg-gen > .lg-gen-noscript, .lg-gen.is-failed > .lg-gen-noscript { display: block; }
.no-js .lg-gen-skel, .lg-gen.is-failed .lg-gen-skel { display: none; }
@media (max-width: 640px) {
  .lg-skel-tabs { width: 100%; overflow: hidden; }
  .lg-skel-tabs i { flex: none; width: 78px; }
  .lg-skel-card { border-radius: 24px; }
  .lg-skel-strip { gap: 10px; padding: 14px 14px 35px; }
  .lg-skel-strip i { width: 100px; }
  .lg-skel-bar { padding: 10px 12px 12px; }
  .lg-skel-bar em { width: 120px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-gen-skel i::after, .lg-gen-skel b::after, .lg-gen-skel em::after, .lg-launch-strip .lg-gen-look .ph:not(.is-loaded)::before { animation: none; }
}
