/* ── App-level styles (non-landing pages) ─────────────────────────────────── */

.app-body { background: var(--bg); }

/* ── Nav ───────────────────────────────────────────────────────────────────── */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(15, 24, 16, 0.8);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--fg);
  text-decoration: none;
}
.nav-back {
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--fg); }

/* ── Generator page ─────────────────────────────────────────────────────────── */
.generator-layout {
  min-height: 100vh;
  padding-top: 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
  padding-bottom: 60px;
}
.generator-left { display: flex; flex-direction: column; gap: 28px; }
.gen-heading {
  font-family: var(--font-serif);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.08;
  color: var(--fg);
  margin-bottom: 8px;
}
.gen-heading em { font-style: italic; color: var(--accent); }
.gen-sub { font-size: 16px; color: var(--fg-muted); line-height: 1.6; }

/* Prompt box */
.prompt-box {
  background: var(--bg-2);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.prompt-box:focus-within { border-color: var(--accent); }
.prompt-textarea {
  display: block;
  width: 100%;
  padding: 20px 24px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  resize: none;
  min-height: 140px;
}
.prompt-textarea::placeholder { color: var(--fg-muted); }
.prompt-meta {
  display: flex;
  justify-content: flex-end;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
}
.char-count { font-size: 12px; color: var(--fg-muted); }

/* Generate button */
.generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  align-self: flex-start;
}
.generate-btn:hover { background: #d4a55a; }
.generate-btn:active { transform: scale(0.98); }
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Error */
.error-msg {
  font-size: 13px;
  color: #e07070;
  padding: 10px 16px;
  background: rgba(224, 112, 112, 0.08);
  border: 1px solid rgba(224, 112, 112, 0.2);
  border-radius: 4px;
}

/* State cards */
.state-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 28px;
  background: var(--bg-2);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
}
.state-label {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--fg);
}
.state-sub { font-size: 13px; color: var(--fg-muted); }

/* Spinner */
.spinner-ring {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* View scene button */
.view-scene-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s;
  margin-top: 4px;
}
.view-scene-btn:hover { background: rgba(196, 149, 74, 0.1); }

/* Right panel */
.generator-right { display: flex; align-items: center; justify-content: center; }
.scene-preview-card {
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-2);
}
.preview-label {
  padding: 8px 16px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.preview-placeholder {
  aspect-ratio: 16/10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: relative;
}
.placeholder-hint { font-size: 13px; color: var(--fg-muted); }
.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 160px;
}
.p-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.p-accent { background: linear-gradient(135deg, var(--accent-dim), var(--accent)); border-color: var(--accent-dim); }

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-nav { padding: 14px 24px; }
  .generator-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 100px 24px 60px;
  }
  .generator-right { order: -1; }
  .scene-preview-card { max-width: 100%; }
}