:root {
  --bg: #0b0d10;
  --bg-elev: #14181f;
  --ink: #f4efe6;
  --muted: #9a9388;
  --line: rgba(244, 239, 230, 0.1);
  --accent: #e8a54b;
  --accent-2: #f0c27a;
  --accent-ink: #1a1208;
  --ok: #8fd9a8;
  --err: #ff8a80;
  --radius: 22px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Unbounded", "Manrope", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  font-family: var(--font);
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(232, 165, 75, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(90, 120, 160, 0.16), transparent 50%),
    radial-gradient(700px 400px at 50% 100%, rgba(232, 165, 75, 0.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

a { color: inherit; }

.wrap {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  animation: rise 0.7s ease both;
}

.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.nav-link:hover { transform: translateY(-1px); filter: brightness(1.05); }

.hero {
  text-align: center;
  animation: rise 0.8s 0.08s ease both;
}

.pills {
  display: flex;
  justify-content: center;
  gap: 0.75rem 1.1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.pills span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pills span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.15);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin-bottom: 0.75rem;
}

.hero .lead {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 auto 1.4rem;
  max-width: 34ch;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: min(260px, 100%);
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 750;
  cursor: pointer;
  color: var(--accent-ink);
  background: var(--ink);
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.cta:hover { transform: translateY(-2px); background: #fff; }
.cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.cta-ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.cta-ghost:hover { background: rgba(255,255,255,0.04); }

.rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin: 1.6rem 0 0.4rem;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  animation: rise 0.85s 0.16s ease both;
}

.rail::-webkit-scrollbar { display: none; }

.shot {
  flex: 0 0 188px;
  height: 250px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  background: var(--bg-elev);
  isolation: isolate;
}

.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.65));
  pointer-events: none;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.5s ease;
}

.shot:hover img { transform: scale(1.07); }

.shot b {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.prompt {
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20, 24, 31, 0.75);
  backdrop-filter: blur(8px);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  animation: rise 0.9s 0.22s ease both;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.prompt:hover {
  border-color: rgba(232, 165, 75, 0.45);
  color: var(--ink);
}

.prompt i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--accent-ink);
  font-style: normal;
  font-weight: 700;
  flex-shrink: 0;
}

.footer {
  margin-top: 1.8rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
  animation: rise 1s 0.28s ease both;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover { color: var(--ink); }

.note {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(154, 147, 136, 0.7);
}

/* Editor */
.page-head {
  text-align: center;
  margin-bottom: 1.25rem;
  animation: rise 0.7s ease both;
}

.page-head .brand-mini {
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.page-head h1 {
  font-family: var(--display);
  font-size: clamp(1.55rem, 6vw, 1.9rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-head p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(20, 24, 31, 0.72);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: left;
  animation: rise 0.8s 0.08s ease both;
}

.drop {
  display: grid;
  place-items: center;
  text-align: center;
  border: 1.5px dashed rgba(232, 165, 75, 0.35);
  border-radius: 16px;
  padding: 1.4rem 1rem;
  background:
    linear-gradient(180deg, rgba(232, 165, 75, 0.06), transparent),
    rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop:hover,
.drop.drag {
  border-color: var(--accent);
  background: rgba(232, 165, 75, 0.1);
}

.drop strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 0.25rem;
}

.drop span {
  color: var(--muted);
  font-size: 0.8rem;
}

.drop input { display: none; }

.file-name {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}

.presets-label {
  display: block;
  margin: 1rem 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
}

.presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.preset {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  border-radius: 12px;
  padding: 0.55rem 0.2rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.preset.active {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border-color: transparent;
}

.actions {
  display: grid;
  gap: 0.65rem;
  justify-items: center;
  margin-top: 1rem;
  animation: rise 0.85s 0.12s ease both;
}

.preview {
  display: none;
  margin: 1rem 0 0.25rem;
  animation: rise 0.5s ease both;
}

.preview.show { display: block; }

.compare {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #07090c;
}

.compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.compare .after { opacity: 0; transition: opacity 0.35s ease; }
.compare.show-after .after { opacity: 1; }

.compare-labels {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.compare-labels span {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.toggle {
  display: none;
  gap: 8px;
  justify-content: center;
  margin-top: 0.75rem;
}

.toggle.show { display: flex; }

.toggle button {
  border: 1px solid var(--line);
  background: rgba(20, 24, 31, 0.8);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.toggle button.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
}

.status {
  min-height: 1.2rem;
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.status.ok { color: var(--ok); }
.status.error { color: var(--err); }

.back {
  display: inline-block;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: 0.2s ease;
}

.back:hover {
  color: var(--ink);
  border-bottom-color: var(--line);
}

.legal-page {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 40px 20px 56px;
  animation: rise 0.7s ease both;
}

.legal-page h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 5vw, 2rem);
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.legal-page h2 {
  font-size: 1.05rem;
  margin: 1.35rem 0 0.45rem;
}

.legal-page p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.legal-page .back { color: var(--accent); border: none; margin-top: 1.5rem; }
.legal-page .back:hover { color: var(--accent-2); }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(26, 18, 8, 0.35);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.cta.loading .spinner { display: inline-block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 380px) {
  .shot { flex-basis: 160px; height: 220px; }
  .presets { grid-template-columns: repeat(2, 1fr); }
}
