/* Imagine studio. Dark shell, system font stack, no web fonts. */
:root {
  --bg: #0c0c0d;
  --surface: #161618;
  --board: #101012;
  --ink: #f3f0ea;
  --muted: #8e8a84;
  --line: rgba(243, 240, 234, .1);
  --card: #141416;
  --accent: #f3efe6;
  --accent-ink: #141416;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  --max: 84rem;
  --command: 56rem;
  --radius: 22px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 400 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
button, textarea, input, summary { font: inherit; color: inherit; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
.top {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  min-height: 3.4rem;
  width: 100%;
  margin: 0;
  padding: .45rem max(1rem, calc((100% - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 680; letter-spacing: .14em; text-decoration: none; font-size: .78rem; }
.logo b { font-weight: 720; margin-right: .35rem; }
.nav { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .86rem; }
.nav a { text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.sw, .acct, .credit, .recharge {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: .32rem .72rem;
  font-size: .75rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  color: var(--ink);
}
.credit {
  color: var(--muted);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}
.studio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  padding: clamp(1.6rem, 5vw, 3.2rem) 0 1.4rem;
}
.studio > h1 {
  order: 0;
  margin: .15rem 0 .15rem;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 520;
  letter-spacing: -.04em;
  line-height: 1.15;
  color: var(--ink);
}
.composer { order: 2; }
.quick { order: 3; }
.board {
  order: 1;
  width: 100%;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1rem;
  border-radius: 28px;
  background:
    radial-gradient(620px 240px at 50% 0%, rgba(243, 239, 230, .045), transparent 70%),
    var(--board);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.board:not(:has(.tile)):not(:has(.result:not([hidden]))) {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.empty { margin: 0 auto; max-width: 32rem; text-align: center; padding: .2rem 1rem 0; }
.empty p { margin: 0; font-size: .92rem; letter-spacing: -.01em; color: var(--muted); }
.empty .hint { margin-top: .2rem; }
.composer {
  position: relative;
  width: min(var(--command), 100%);
  display: grid;
  gap: .7rem;
  padding: .85rem .85rem .75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.composer.is-over { border-color: rgba(243, 239, 230, .4); }
.prompt {
  width: 100%;
  min-height: 11rem;
  max-height: 34rem;
  resize: vertical;
  border: 0;
  border-radius: 16px;
  padding: .55rem .6rem .4rem;
  background: transparent;
  line-height: 1.55;
  font-size: 1.08rem;
  letter-spacing: -.015em;
  overflow-y: auto;
  box-sizing: border-box;
}
.prompt::placeholder { color: #6f6b66; }
.prompt:focus { outline: none; }
.refs { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .6rem; min-height: 2.4rem; }
.drop {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: .2rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}
.drop.is-over, .drop:hover { color: var(--ink); border-color: rgba(243, 239, 230, .28); }
.drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.drop-title { font-size: .78rem; font-weight: 650; }
.thumbs { display: flex; gap: .4rem; margin: 0; padding: 0; list-style: none; overflow-x: auto; }
.thumbs:empty { display: none; }
.thumbs li { position: relative; flex: 0 0 2.7rem; }
.thumbs img { width: 2.7rem; height: 2.7rem; object-fit: cover; border-radius: 10px; display: block; background: #222; }
.x {
  position: absolute;
  top: -.2rem;
  right: -.2rem;
  width: 1.15rem;
  height: 1.15rem;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 12, 13, .86);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  font-size: .75rem;
}
.hint, .status { margin: 0; color: var(--muted); font-size: .78rem; }
.command-row { display: flex; align-items: center; gap: .6rem; }
.status { flex: 1; min-height: 1.2rem; }
.controls { position: relative; color: var(--muted); font-size: .78rem; }
.controls summary {
  cursor: pointer;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .32rem .7rem;
}
.controls summary::-webkit-details-marker { display: none; }
.controls[open] summary { color: var(--ink); }
.controls .aspects, .controls .hint { margin-top: .45rem; }
.control-section { display: grid; gap: .35rem; }
.control-label { font-size: .74rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.aspects, .cats { display: flex; flex-wrap: wrap; gap: .35rem; }
.aspects button, .cats button, .go, .ghost, .download, .pack button {
  min-height: 2.15rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  padding: .28rem .75rem;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 650;
  text-decoration: none;
  color: var(--ink);
  transition: all .16s ease;
}
.aspects button[aria-pressed="true"], .cats button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--accent-ink);
  border-color: var(--ink);
}
.qualities button {
  border-radius: 999px;
  cursor: pointer;
  transition: all .16s ease;
}
.aspects.qualities button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--accent-ink);
  border-color: var(--ink);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(243, 239, 230, .22);
}
.qualities button:hover {
  border-color: rgba(243, 239, 230, .6);
}
.go {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  padding-inline: 1.05rem;
  font-size: .86rem;
}
.go:disabled { opacity: .55; cursor: wait; }
.prompt:focus-visible, .go:focus-visible, .acct:focus-visible, a:focus-visible, .x:focus-visible, .cats button:focus-visible, .drop:focus-visible {
  outline: 2px solid rgba(243, 239, 230, .7);
  outline-offset: 2px;
}
.turnstile {
  position: absolute;
  left: .85rem;
  right: .85rem;
  height: 65px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.turnstile.is-live {
  position: static;
  height: auto;
  opacity: 1;
  pointer-events: auto;
  overflow: auto;
  padding: .4rem .5rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--board);
}
.turnstile iframe { display: block; max-width: 100%; color-scheme: dark; }
.quick { width: 100%; }
.quick-head {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: end;
  margin-bottom: .7rem;
}
.quick-head h2, .block h2, #pricing h2, .hero h1, .prose h2, .shot h2, .pack h2 {
  margin: 0;
  font-weight: 560;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.quick-head h2, #pricing h2 { font-size: 1.05rem; }
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: 1.1rem;
  width: 100%;
  padding-bottom: .8rem;
}
.scene-card {
  display: grid;
  align-content: start;
  gap: .35rem;
  transition: transform .18s ease;
}
.scene-card:hover {
  transform: translateY(-2px);
}
.scene-card[hidden] { display: none; }
.scene-card button {
  display: grid;
  gap: .4rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.scene-art {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  background: #09090b;
  border: 0;
}
.scene-card .scene-art::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background: linear-gradient(to top, rgba(6, 6, 8, .5), rgba(6, 6, 8, 0));
  pointer-events: none;
}
.scene-art img, .shot .scene-art img, .scene-hero .scene-art img, .tile img, .frame img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  display: block;
}
.scene-copy { display: grid; gap: .05rem; padding: 0 .15rem; }
.scene-copy strong { font-size: .88rem; font-weight: 620; letter-spacing: -.02em; }
.scene-copy em { font-style: normal; color: var(--muted); font-size: .74rem; }
.scene-use {
  position: absolute;
  left: .5rem;
  bottom: .5rem;
  z-index: 1;
  border-radius: 999px;
  background: rgba(12, 12, 13, .78);
  color: #fff;
  padding: .28rem .55rem;
  font-size: .7rem;
  font-weight: 650;
}
.scene-more {
  color: var(--muted);
  font-size: .68rem;
  text-decoration: none;
  padding-left: .15rem;
}
.scene-card button[aria-pressed="true"] .scene-art { box-shadow: inset 0 0 0 1.5px var(--accent); }
.result { margin: 0 auto; width: min(40rem, 100%); }
.result[hidden], .empty[hidden], img[hidden], .skeleton[hidden] { display: none; }
.frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #1a1a1d;
  min-height: 16rem;
  border: 1px solid var(--line);
}
.frame img { width: 100%; height: auto; }
.skeleton {
  display: grid;
  gap: .7rem;
  padding: 1.2rem;
  min-height: 16rem;
  background: linear-gradient(110deg, #1a1a1d 30%, #26262b 45%, #1a1a1d 60%);
  background-size: 200% 100%;
  animation: shine 1.3s linear infinite;
}
.skeleton span { display: block; height: .7rem; border-radius: 999px; background: rgba(243, 240, 234, .08); }
.skeleton span:first-child { width: 46%; height: 8rem; border-radius: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin-top: .7rem; }
.pill {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: .15rem .55rem;
  font-size: .72rem;
}
.tile-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.gallery, .packs, .split { display: grid; gap: .8rem; }
.gallery { grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); width: 100%; }
.packs, .split { grid-template-columns: 1fr; margin: .8rem 0 1.6rem; }
.shot, .pack, .tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: .55rem;
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tile:hover {
  border-color: rgba(243, 239, 230, .2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .35);
}
.shot-copy, .tile-copy { display: grid; gap: .2rem; padding: .55rem .3rem .2rem; }
.tile { position: relative; display: flex; flex-direction: column; }
.tile img {
  border-radius: 12px;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: opacity .2s ease;
}
.tile img:hover { opacity: .92; }
.tile h2 { font-size: .84rem; font-weight: 560; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.tile p { margin: 0; font-size: .74rem; color: var(--muted); }
.tile .tile-actions { margin-top: auto; padding-top: .4rem; }
.tile .tile-actions .download, .tile .tile-actions .ghost { min-height: 1.9rem; font-size: .72rem; padding: .2rem .55rem; }
.tile .tile-actions .edit-btn {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: #fff;
  font-weight: 600;
}
.tile .tile-actions .edit-btn:hover {
  background: var(--accent);
  color: #fff;
}

.history-section {
  width: 100%;
  margin: 1.8rem 0 .8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1rem;
}
.history-header {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.history-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
}
.history-title-row h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.history-badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .65rem;
  border-radius: 999px;
  background: rgba(243, 239, 230, .07);
  border: 1px solid var(--line);
  font-size: .74rem;
  color: var(--muted);
  font-weight: 500;
}
.history-desc {
  margin: 0;
  font-size: .83rem;
  color: var(--muted);
  line-height: 1.45;
}
.history-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .65rem .9rem;
  border-radius: 14px;
  background: rgba(196, 83, 42, .08);
  border: 1px solid rgba(196, 83, 42, .25);
  font-size: .82rem;
  color: var(--ink);
}
.history-notice .acct-inline {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: .3rem .75rem;
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.history-empty {
  text-align: center;
  padding: 2.2rem 1rem;
  border-radius: 18px;
  background: var(--surface);
  border: 1px dashed var(--line);
  display: grid;
  gap: .35rem;
}
.history-empty p {
  margin: 0;
  font-size: .92rem;
  color: var(--ink);
  font-weight: 540;
}
.history-empty .hint {
  font-size: .8rem;
  color: var(--muted);
}
.price { font-size: 1.35rem; font-weight: 620; letter-spacing: -.04em; margin: .15rem 0; }
.prose, #pricing {
  width: min(var(--command), 100%);
  margin: .4rem auto 1.2rem;
}
#pricing { padding-top: .4rem; }
.prose { padding: 0; }
.prose p, .prose li, .lede, .shot p, .pack p { color: var(--muted); }
.lede { margin: .4rem 0 0; max-width: 38rem; }
.hero { padding: clamp(1.6rem, 4vw, 3rem) 0 .3rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.prompt-sample { color: var(--ink); line-height: 1.6; }
.scene-hero { display: grid; gap: 1rem; padding: 1.2rem 0 .2rem; align-items: center; }
.scene-hero .scene-art { aspect-ratio: 16 / 10; border-radius: 22px; }
.eyebrow {
  margin: 0 0 .45rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 680;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .62);
  padding: 1rem;
}
.modal[hidden] { display: none; }
.dialog {
  width: min(24rem, 100%);
  padding: 1.15rem;
  display: grid;
  gap: .65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.dialog h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.03em; }
.dialog p { margin: 0; color: var(--muted); }
.dialog .go, .dialog .ghost { text-align: center; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .82);
  padding: 1.2rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 88vh; border-radius: 16px; }
.lightbox .x { position: fixed; top: 1rem; right: 1rem; width: 2.2rem; height: 2.2rem; font-size: 1.1rem; }
.foot {
  width: min(var(--max), calc(100% - 2rem));
  margin: 1.5rem auto 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 0 1.8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}
.foot nav { display: flex; gap: .9rem; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.email-login-box {
  display: grid;
  gap: .5rem;
  margin-top: .3rem;
}
.email-login-box input {
  min-height: 2.6rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 .75rem;
  background: #101012;
  color: var(--ink);
  font-size: .88rem;
  transition: border-color .15s ease;
}
.email-login-box input:focus {
  outline: none;
  border-color: var(--accent);
}
.devbox { display: grid; gap: .4rem; }
.devbox input {
  min-height: 2.6rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 .75rem;
  background: #101012;
}
.empty-card { grid-column: 1 / -1; color: var(--muted); }
@keyframes shine { to { background-position: -200% 0; } }
@media (min-width: 52rem) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .packs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scene-grid { grid-auto-columns: minmax(12.2rem, 14.5rem); }
}
@media (min-width: 68rem) {
  .split, .scene-hero { grid-template-columns: minmax(0, 1.15fr) minmax(16rem, .85fr); }
  .shot:hover, .tile:hover, .pack:hover, .scene-card:hover { transform: translateY(-3px); }
  .shot, .tile, .pack, .scene-card { transition: transform .2s ease; }
  .scene-art img, .tile img { transition: transform .45s ease; }
  .scene-card:hover img, .tile:hover img, .shot:hover img { transform: scale(1.035); }
}
@media (hover: hover) {
  .scene-more { opacity: 0; }
  .scene-card:hover .scene-more, .scene-card:focus-within .scene-more { opacity: 1; }
  .scene-use { opacity: 0; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease; }
  .scene-card button:hover .scene-use,
  .scene-card button:focus-visible .scene-use { opacity: 1; transform: none; }
  .tile .tile-actions {
    position: absolute;
    left: .7rem;
    right: .7rem;
    bottom: .7rem;
    opacity: 0;
    transition: opacity .18s ease;
    background: rgba(12, 12, 13, .88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: .35rem;
    border-radius: 12px;
    border: 1px solid var(--line);
  }
  .tile:hover .tile-actions, .tile:focus-within .tile-actions { opacity: 1; }
  .result .tile-actions { opacity: .0; }
  .result:hover .tile-actions, .result:focus-within .tile-actions { opacity: 1; }
}
@media (max-width: 40rem) {
  .nav .quiet { display: none; }
  .credit { max-width: 7.2rem; font-size: .68rem; padding-inline: .5rem; }
  .studio > h1 { font-size: 1.55rem; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .quick-head { display: grid; }
  .command-row { flex-wrap: wrap; }
  .command-row .go { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
