/* ─── RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0d0f;
  --bg-card: #141416;
  --bg-hover: #1a1a1e;
  --border: #272730;
  --border-active: #4a4a6a;
  --text: #e8e8f0;
  --text-muted: #6b6b80;
  --text-dim: #9999b0;
  --accent: #c4a882;
  --accent-glow: rgba(196, 168, 130, 0.15);
  --accent-2: #7b6fa0;
  --red: #e05555;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ─── HEADER ─────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(13,13,15,0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.logo {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.5px;
  color: var(--accent);
}

.nav-badge {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 99px;
}

/* ─── MAIN ───────────────────────────────────────────────── */
.main {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  width: 100%;
}

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
  margin-bottom: 64px;
  text-align: center;
}

.hero-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-glow);
  background: var(--accent-glow);
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1.08;
  letter-spacing: -2px;
  color: var(--text);
  margin-bottom: 20px;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  color: var(--text-dim);
  font-size: 16px;
  font-weight: 300;
  max-width: 400px;
  margin: 0 auto;
}

/* ─── SECTION TITLE ──────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

/* ─── MODE SECTION ───────────────────────────────────────── */
.mode-section { margin-bottom: 48px; }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-body);
}

.mode-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.mode-card.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.mode-icon {
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.mode-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.mode-desc {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.5;
}

/* ─── GENERATOR ──────────────────────────────────────────── */
.generator-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 48px;
}

/* ─── UPLOADS ────────────────────────────────────────────── */
.uploads-row {
  display: flex;
  gap: 16px;
}

.upload-panel { flex: 1; }

.upload-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.drop-zone {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition), background var(--transition);
  background: var(--bg-card);
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.drop-icon {
  font-size: 28px;
  color: var(--text-muted);
  line-height: 1;
}

.drop-text {
  font-size: 14px;
  color: var(--text-dim);
}

.drop-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.drop-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

.drop-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(13,13,15,0.85);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 99px;
  width: 26px;
  height: 26px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 2;
}

.drop-clear:hover { background: var(--red); border-color: var(--red); }

/* ─── PROMPT ─────────────────────────────────────────────── */
.prompt-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.prompt-input {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  padding: 14px 18px;
  resize: vertical;
  transition: border-color var(--transition);
  outline: none;
}

.prompt-input::placeholder { color: var(--text-muted); }
.prompt-input:focus { border-color: var(--accent); }

/* ─── MODEL SELECT ───────────────────────────────────────── */
.model-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.model-select-wrap { position: relative; }

.model-select {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 16px;
  cursor: pointer;
  appearance: none;
  outline: none;
  transition: border-color var(--transition);
}

.model-select:focus { border-color: var(--accent); }

.model-select-wrap::after {
  content: '↓';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}

/* ─── RATIO PILLS ────────────────────────────────────────── */
.ratio-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

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

.ratio-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 16px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.ratio-pill:hover {
  border-color: var(--border-active);
  color: var(--text);
}

.ratio-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ─── GENERATE BUTTON ────────────────────────────────────── */
.generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--accent);
  color: #0d0d0f;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 16px 32px;
  cursor: pointer;
  transition: opacity var(--transition), transform 0.15s ease;
  width: 100%;
  letter-spacing: 0.02em;
}

.generate-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.generate-btn:active { transform: translateY(0); }
.generate-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.generate-btn-icon { font-size: 18px; transition: transform 0.2s ease; }
.generate-btn:hover .generate-btn-icon { transform: translateX(3px); }

/* ─── RESULT ─────────────────────────────────────────────── */
.result-section { margin-bottom: 48px; }

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Loader */
.result-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px;
}

.loader-ring {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loader-text {
  font-size: 14px;
  color: var(--text-muted);
}

/* Result image */
.result-img {
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  display: block;
}

/* Error */
.result-error {
  padding: 32px;
  color: var(--red);
  font-size: 14px;
  text-align: center;
}

/* Actions */
.result-actions {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--border);
  width: 100%;
}

.result-download {
  flex: 1;
  background: var(--accent);
  color: #0d0d0f;
  border-radius: var(--radius-sm);
  text-align: center;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity var(--transition);
}

.result-download:hover { opacity: 0.85; }

.result-new {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  padding: 12px;
  transition: border-color var(--transition), color var(--transition);
}

.result-new:hover { border-color: var(--border-active); color: var(--text); }

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .header { padding: 16px 20px; }
  .main { padding: 40px 16px 60px; }
  .mode-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; gap: 8px; padding: 20px; }
  .hero-title { letter-spacing: -1px; }
}
