/* ─────────────────────────────────────────────
   AI Imager — Professional UI
   ───────────────────────────────────────────── */

/* Fonts & reset */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Sora:wght@600;700&display=swap');

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

:root {
  --bg:         #0b0c10;
  --surface:    #13141a;
  --card:       #1c1d27;
  --border:     #2a2b38;
  --accent1:    #7c3aed;
  --accent2:    #06b6d4;
  --gradient:   linear-gradient(135deg, #7c3aed, #06b6d4);
  --text:       #e8eaf0;
  --muted:      #6b7280;
  --danger:     #ef4444;
  --success:    #10b981;
  --radius:     14px;
  --shadow:     0 8px 32px rgba(0,0,0,.45);
  --nav-h:      64px;
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent2); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

/* ── NAV ─────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(11,12,16,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: auto;
  text-decoration: none;
}
.nav-logo img { width: 32px; height: 32px; flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: var(--card);
  color: var(--text);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background var(--transition);
}
.hamburger:hover { background: var(--card); }
.hamburger span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile nav overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.95);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.mobile-overlay.open { opacity: 1; pointer-events: all; }
.mobile-overlay a {
  font-size: 28px;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  color: var(--muted);
  transition: color var(--transition);
}
.mobile-overlay a:hover { color: #fff; }
.mobile-close {
  position: absolute;
  top: 24px; right: 28px;
  font-size: 36px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}
.mobile-close:hover { color: #fff; }

/* ── MAIN CONTENT ─────────────────────────────── */
main { flex: 1; }

/* ── HOME PAGE ────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  max-width: 700px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.35);
  color: #a78bfa;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 20px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding: 0 24px 80px;
  max-width: 1100px;
  margin: 0 auto;
}

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition);
}
.tool-card:hover {
  border-color: rgba(124,58,237,.5);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(124,58,237,.18);
  color: var(--text);
}
.tool-card:hover::before { opacity: .04; }

.tool-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.tool-card h3 {
  font-family: 'Sora', sans-serif;
  font-size: 17px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.tool-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}
.tool-card .cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent2);
  position: relative;
  z-index: 1;
}
.tool-card .cta svg { transition: transform var(--transition); }
.tool-card:hover .cta svg { transform: translateX(4px); }

/* ── GENERATION FORM PAGE ─────────────────────── */
.form-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.page-header {
  margin-bottom: 36px;
}
.page-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 20px;
  transition: color var(--transition);
}
.page-header .back-link:hover { color: var(--text); }
.page-header h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.page-header p { color: var(--muted); font-size: 14.5px; }

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.form-group { margin-bottom: 22px; }
.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  min-height: 150px;
  max-height: 400px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
textarea:focus {
  border-color: var(--accent1);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}
textarea::placeholder { color: var(--muted); }

.row-inputs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.row-inputs .form-group { flex: 1; min-width: 160px; }

input[type="number"], select {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
input[type="number"]:focus, select:focus {
  border-color: var(--accent1);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}
select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.file-upload {
  position: relative;
}
.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}
.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 100px;
}
.file-upload-label:hover, .file-upload:focus-within .file-upload-label {
  border-color: var(--accent1);
  background: rgba(124,58,237,.06);
}
.file-upload-label .icon { font-size: 28px; }
.file-upload-label span { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.file-upload-label .filename { color: var(--accent2); font-size: 13px; display: none; }
.file-upload-label .filename.visible { display: block; }

.btn-generate {
  width: 100%;
  padding: 14px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-top: 8px;
  letter-spacing: .01em;
}
.btn-generate:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,58,237,.35); }
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-generate svg { flex-shrink: 0; }

/* ── RESULTS ──────────────────────────────────── */
.results-section {
  margin-top: 36px;
}
.results-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
  display: none;
}
.results-label.visible { display: block; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.result-img-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  aspect-ratio: 1;
}
.result-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}
.result-img-wrap:hover img { transform: scale(1.04); }
.result-img-actions {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity var(--transition);
}
.result-img-wrap:hover .result-img-actions { opacity: 1; }
.img-action-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition);
}
.img-action-btn.view { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.img-action-btn.download { background: var(--accent1); color: #fff; border: none; }
.img-action-btn:hover { transform: scale(1.05); }

/* ── LOADING STATE ────────────────────────────── */
.loader-wrap {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 48px 20px;
  text-align: center;
}
.loader-wrap.visible { display: flex; }

.spinner {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, #7c3aed 25%, #06b6d4 50%, transparent 75%);
  animation: spin 1s linear infinite;
  position: relative;
}
.spinner::before {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--card);
  border-radius: 50%;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loader-text { color: var(--muted); font-size: 14.5px; font-weight: 500; }
.loader-sub { color: var(--border); font-size: 12.5px; }

/* ── ERROR STATE ──────────────────────────────── */
.error-box {
  display: none;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: 10px;
  padding: 16px 20px;
  color: #fca5a5;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 16px;
}
.error-box.visible { display: block; }
.error-box strong { display: block; margin-bottom: 4px; color: var(--danger); }

/* ── FOOTER ───────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.footer-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
  font-size: 15px;
}

/* ── RESPONSIVE ───────────────────────────────── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .form-card { padding: 22px 18px; }
  .tools-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 20px 40px; }
}

/* ── API DOCS ─────────────────────────────────── */
.docs-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-h) - 80px);
}

.docs-sidebar {
  width: 230px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}
.docs-sidebar-inner {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  padding: 24px 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 16px 0 6px;
}
.sidebar-section-label:first-child { padding-top: 0; }
.sidebar-link {
  font-size: 13.5px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 7px;
  transition: all var(--transition);
  font-weight: 450;
}
.sidebar-link:hover, .sidebar-link.active {
  background: var(--card);
  color: var(--text);
}

.docs-content {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
}

.docs-section {
  margin-bottom: 64px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.docs-page-header { margin-bottom: 0; }
.docs-page-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  transition: color var(--transition);
}
.docs-page-header .back-link:hover { color: var(--text); }

.api-version-badge {
  display: inline-block;
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.3);
  color: #a78bfa;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.docs-page-header h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
}
.docs-lead {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.75;
  max-width: 640px;
}

.docs-section h2 {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-top: 4px;
}
.docs-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 24px 0 10px;
}
.form-note {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  margin-left: 8px;
}
.docs-section > p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 18px;
}
.docs-note {
  background: rgba(6,182,212,.07);
  border: 1px solid rgba(6,182,212,.2);
  border-radius: 8px;
  padding: 12px 16px;
  color: #67e8f9;
  font-size: 13.5px;
}
.docs-note code { color: #a5f3fc; }

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-family: 'Menlo', 'Monaco', monospace;
}
.endpoint-url {
  font-size: 15px;
  color: var(--text);
  word-break: break-all;
}

.method-badge {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.method-post { background: rgba(124,58,237,.2); color: #a78bfa; border: 1px solid rgba(124,58,237,.35); }
.method-get  { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); }

/* Code blocks */
.code-block {
  background: #0d0d14;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.code-label {
  padding: 8px 16px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.code-block pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #cdd6f4;
}
code { font-family: 'Menlo', 'Monaco', 'Consolas', monospace; font-size: .9em; }
:not(.code-block) > code {
  background: rgba(255,255,255,.07);
  padding: 2px 6px;
  border-radius: 5px;
  color: #a5f3fc;
}
.json-key    { color: #cba6f7; }
.json-string { color: #a6e3a1; }
.json-null   { color: #f38ba8; }
.json-comment{ color: #585b70; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}
.tab-btn {
  padding: 7px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn.active, .tab-btn:hover { background: #0d0d14; color: var(--text); border-color: var(--border); }
.tab-panel.hidden { display: none; }

/* Tables */
.docs-table-wrap { overflow-x: auto; margin-bottom: 20px; }
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.docs-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.docs-table td {
  padding: 11px 14px;
  border: 1px solid var(--border);
  color: var(--muted);
  vertical-align: top;
  line-height: 1.55;
}
.docs-table td:first-child { color: var(--text); }
.docs-table tr:hover td { background: rgba(255,255,255,.02); }

.type-badge {
  display: inline-block;
  background: rgba(6,182,212,.1);
  color: #67e8f9;
  border: 1px solid rgba(6,182,212,.2);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  font-family: monospace;
  white-space: nowrap;
}
.required-badge {
  display: inline-block;
  background: rgba(239,68,68,.1);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  white-space: nowrap;
}
.optional-badge {
  display: inline-block;
  background: rgba(107,114,128,.12);
  color: var(--muted);
  border: 1px solid rgba(107,114,128,.2);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  white-space: nowrap;
}

.status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--muted);
}
.http-badge {
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
}
.http-200 { background: rgba(16,185,129,.15); color: #6ee7b7; }
.http-400 { background: rgba(251,191,36,.12); color: #fde68a; }
.http-501 { background: rgba(239,68,68,.12);  color: #fca5a5; }

@media (max-width: 768px) {
  .docs-sidebar { display: none; }
  .docs-content { padding: 28px 20px 60px; }
  .docs-layout { flex-direction: column; }
}

/* ── BRANDED JSON VIEWER ──────────────────────── */
.json-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
.json-page-header {
  margin-bottom: 28px;
}
.json-meta {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.json-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.json-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.json-brand-name {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.json-endpoint-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-family: 'Menlo', monospace;
}
.json-method {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #6ee7b7;
  background: rgba(16,185,129,.15);
  border: 1px solid rgba(16,185,129,.3);
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: .05em;
}
.json-path {
  font-size: 14px;
  color: var(--text);
}
.json-status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: monospace;
}
.json-status-ok  { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.25); }
.json-status-err { background: rgba(239,68,68,.12);  color: #fca5a5; border: 1px solid rgba(239,68,68,.2); }

.json-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.json-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.json-copy-btn:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.json-docs-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: color var(--transition);
}
.json-docs-link:hover { color: var(--text); }

.json-viewer {
  background: #0d0d14;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.json-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
}
.json-viewer-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.json-viewer-type {
  font-size: 11px;
  color: rgba(255,255,255,.25);
  font-family: monospace;
}
.json-body {
  margin: 0;
  padding: 22px 24px;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 13.5px;
  line-height: 1.75;
  color: #cdd6f4;
  overflow-x: auto;
  white-space: pre;
}
.jt-key  { color: #cba6f7; }
.jt-str  { color: #a6e3a1; }
.jt-num  { color: #fab387; }
.jt-bool { color: #89dceb; }
.jt-null { color: #f38ba8; }
.jt-link {
  color: #67e8f9;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.jt-link:hover { color: #a5f3fc; }

@media (max-width: 600px) {
  .json-page { padding: 24px 16px 60px; }
  .json-title-row { flex-direction: column; align-items: flex-start; }
}

/* ── BRANDED JSON PAGE (jp-*) ─────────────────── */
.jp-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Brand bar */
.jp-brand-bar {
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  padding: 16px 0;
}
.jp-brand-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.jp-brand-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.jp-brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 16px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.jp-brand-name { white-space: nowrap; }
.jp-brand-sep { color: var(--border); font-size: 18px; }
.jp-brand-sub {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  -webkit-text-fill-color: var(--muted);
}
.jp-brand-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.jp-powered { color: rgba(255,255,255,.3); }
.jp-casper-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #a78bfa;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid rgba(167,139,250,.25);
  padding: 3px 10px;
  border-radius: 6px;
  transition: all var(--transition);
}
.jp-casper-link:hover {
  background: rgba(167,139,250,.1);
  color: #c4b5fd;
}

/* Request line */
.jp-request-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 10px;
  font-family: 'Menlo', monospace;
}
.jp-method {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 5px;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.jp-method-get { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); }
.jp-method-err { background: rgba(239,68,68,.12);  color: #fca5a5; border: 1px solid rgba(239,68,68,.2); }
.jp-path { font-size: 14px; color: var(--text); }
.jp-qs { font-size: 13px; color: var(--muted); word-break: break-all; }
.jp-spacer { flex: 1; }
.jp-status {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.jp-s-ok  { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.25); }
.jp-s-err { background: rgba(239,68,68,.12);  color: #fca5a5; border: 1px solid rgba(239,68,68,.2); }

/* Toolbar */
.jp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 8px;
  margin-bottom: 2px;
}
.jp-toolbar-right { display: flex; gap: 6px; }
.jp-ct-badge {
  font-size: 11.5px;
  color: rgba(255,255,255,.3);
  font-family: monospace;
}
.jp-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.jp-tool-btn:hover { color: var(--text); border-color: rgba(255,255,255,.18); }

/* JSON viewer */
.jp-viewer {
  background: #0b0b12;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.jp-code {
  margin: 0;
  padding: 24px 26px;
  font-family: 'Menlo', 'Monaco', 'Consolas', ui-monospace, monospace;
  font-size: 13.5px;
  line-height: 1.8;
  color: #cdd6f4;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.jc-key  { color: #cba6f7; }
.jc-str  { color: #a6e3a1; }
.jc-num  { color: #fab387; }
.jc-bool { color: #89dceb; }
.jc-null { color: #f38ba8; }
.jc-link {
  color: #67e8f9;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.jc-link:hover { color: #a5f3fc; }

/* Footer note */
.jp-footer-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 12.5px;
  color: rgba(255,255,255,.3);
}
.jp-footer-note a {
  color: var(--muted);
  transition: color var(--transition);
}
.jp-footer-note a:hover { color: var(--text); }

@media (max-width: 600px) {
  .jp-wrap { padding: 0 14px 60px; }
  .jp-brand-bar-inner { flex-direction: column; align-items: flex-start; }
  .jp-request-line { flex-direction: column; align-items: flex-start; }
  .jp-spacer { display: none; }
}

/* ── PROFESSIONAL FOOTER ──────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 40px 40px;
}
.footer-brand .footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'Sora', sans-serif;
  font-size: 17px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
}
.footer-brand .footer-logo img { flex-shrink: 0; }
.footer-tagline {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 280px;
  margin-bottom: 20px;
}
.footer-socials {
  display: flex;
  gap: 10px;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  transition: all var(--transition);
}
.social-link:hover {
  color: var(--text);
  border-color: rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
}
.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col ul li a {
  font-size: 13.5px;
  color: var(--muted);
  transition: color var(--transition);
  font-weight: 450;
}
.footer-col ul li a:hover { color: var(--text); }

/* Bottom bar */
.footer-bottom {
  border-top: 1px solid var(--border);
}
.footer-bottom-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy {
  font-size: 13px;
  color: rgba(255,255,255,.3);
}
.footer-copy a {
  color: var(--muted);
  transition: color var(--transition);
}
.footer-copy a:hover { color: var(--text); }
.footer-bottom-links {
  display: flex;
  gap: 20px;
}
.footer-bottom-links a {
  font-size: 13px;
  color: rgba(255,255,255,.3);
  transition: color var(--transition);
}
.footer-bottom-links a:hover { color: var(--muted); }

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    padding: 40px 24px 32px;
  }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
}

/* ── LEGAL PAGES ──────────────────────────────── */
.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}
.legal-header { margin-bottom: 40px; }
.legal-badge {
  display: inline-block;
  background: rgba(124,58,237,.12);
  border: 1px solid rgba(124,58,237,.25);
  color: #a78bfa;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 14px;
}
.legal-header h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.legal-meta {
  font-size: 13.5px;
  color: var(--muted);
}
.legal-body {
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.legal-body section h2 {
  font-family: 'Sora', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.legal-body section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 14px 0 6px;
}
.legal-body section p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 10px;
}
.legal-body section ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legal-body section ul li {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.65;
}
.legal-body a {
  color: #67e8f9;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-body a:hover { color: #a5f3fc; }
.legal-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 52px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.legal-footer-nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: color var(--transition);
}
.legal-footer-nav a:hover { color: var(--text); }

@media (max-width: 600px) {
  .legal-page { padding: 32px 18px 60px; }
}

/* ── Image‑to‑Prompt / Analyze Page ──────────────────────────── */
.analyze-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 28px 24px;
  margin: 0 auto 20px;
  max-width: 680px;
}
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.upload-zone.dz-over {
  border-color: #7c3aed;
  background: rgba(124,58,237,.07);
}
.upload-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 24px;
  text-align: center;
  width: 100%;
}
.upload-icon { color: var(--muted); opacity: .7; margin-bottom: 2px; }
.upload-label { font-size: 15px; color: var(--muted); margin: 0; }
.upload-browse {
  background: none;
  border: none;
  color: #a855f7;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.upload-browse:hover { color: #c084fc; }
.upload-hint { font-size: 12.5px; color: var(--muted); opacity: .7; margin: 0; }
.upload-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  width: 100%;
}
.upload-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.preview-meta {
  font-size: 13.5px;
  color: var(--muted);
  flex: 1;
  word-break: break-all;
}
.preview-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.preview-remove:hover { background: rgba(255,255,255,.08); color: var(--text); }
.analyze-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}
.analyze-btn:disabled { opacity: .45; cursor: not-allowed; }
.analyze-btn:not(:disabled):hover { opacity: .88; }
.analyze-result {
  max-width: 680px;
  margin: 0 auto 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.025);
}
.result-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #a855f7;
}
.result-actions { display: flex; gap: 8px; }
.result-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.result-action-btn:hover { border-color: #a855f7; color: #a855f7; background: rgba(168,85,247,.07); }
.result-prompt {
  padding: 20px 22px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}
.palette-row {
  display: flex;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.015);
}
.palette-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.12);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.palette-swatch:hover { transform: scale(1.18); box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.analyze-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 680px;
  margin: 0 auto 20px;
  padding: 32px 20px;
}
.analyze-loading p { font-size: 14.5px; color: var(--muted); margin: 0; }
.analyze-error {
  max-width: 680px;
  margin: 0 auto 20px;
}
.analyze-info {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.info-item svg { color: #a855f7; flex-shrink: 0; margin-top: 1px; }
.info-item span { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
@media (max-width: 600px) {
  .analyze-card { padding: 20px 16px 18px; }
  .result-header { flex-direction: column; align-items: flex-start; }
}
