@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #14121a;
  --surface: #1e1b26;
  --surface-alt: #26222f;
  --border: #363048;
  --accent: #da52a8;
  --accent-dim: #7a2655;
  --good: #ae3f9d;
  --bad: #d9695f;
  --text: #f1ede6;
  --text-muted: #9a93a8;
  --radius: 10px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at top left, rgba(232, 163, 61, 0.06), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(63, 174, 143, 0.05), transparent 55%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.site-nav {
  border-bottom: 1px solid var(--border);
  background: rgba(20, 18, 26, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand .brand-dot { color: var(--accent); }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface-alt); }
.nav-links a.button {
  color: var(--bg);
  background: var(--accent);
  font-weight: 600;
}
.nav-links a.button:hover { background: #b34776; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 48px;
  border-bottom: 1px dashed var(--border);
}
.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--good);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  line-height: 1.08;
  margin: 14px 0 16px;
  max-width: 20ch;
}
.hero p {
  color: var(--text-muted);
  max-width: 56ch;
  font-size: 1.05rem;
}
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #1a1408; }
.btn-primary:hover { background: #f05890; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: rgba(217, 105, 95, 0.12); }
.btn-good { background: var(--good); color: #08211a; }
.btn-good:hover { background: #4fc39f; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Section headers ---------- */
.section { padding: 48px 0; }
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.filter-chip.active { border-color: var(--accent); color: var(--accent); background: rgba(232, 163, 61, 0.08); }

/* ---------- Gallery grid ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.widget-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.widget-preview {
  height: 180px;
  background:
    linear-gradient(135deg, rgba(232,163,61,0.05), rgba(63,174,143,0.05)),
    repeating-linear-gradient(45deg, #1a1722 0 10px, #1c1926 10px 20px);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.widget-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}
.widget-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.widget-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.widget-title { font-weight: 600; font-size: 1.02rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  white-space: nowrap;
}
.widget-desc { color: var(--text-muted); font-size: 0.9rem; flex: 1; }
.widget-actions { margin-top: 4px; }
.widget-actions button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.widget-actions button:hover { border-color: var(--accent); color: var(--accent); }

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state strong { color: var(--text); }

/* ---------- Ticket / form (submission) ---------- */
.ticket {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}
.ticket::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 10px, transparent 10px 18px);
  border-radius: var(--radius) var(--radius) 0 0;
}
.ticket-header {
  padding: 20px 26px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.ticket-header .ticket-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ticket-body { padding: 26px; display: grid; gap: 20px; }

.field { display: grid; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.field .hint { font-size: 0.78rem; color: var(--text-muted); font-weight: 400; }
.field input,
.field textarea,
.field select {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.94rem;
  resize: vertical;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

.code-tabs { display: flex; gap: 6px; margin-bottom: -1px; }
.code-tab {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: var(--text-muted);
  cursor: pointer;
}
.code-tab.active { color: var(--accent); background: var(--surface); border-color: var(--accent); }
.code-panel { display: none; }
.code-panel.active { display: block; }
.code-panel textarea {
  width: 100%;
  min-height: 160px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-radius: 0 8px 8px 8px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.form-message { font-size: 0.88rem; }
.form-message.success { color: var(--good); }
.form-message.error { color: var(--bad); }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } }

.queue-list { display: grid; gap: 10px; }
.queue-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  display: grid;
  gap: 4px;
}
.queue-item:hover { border-color: var(--accent); }
.queue-item.selected { border-color: var(--accent); background: rgba(232, 163, 61, 0.06); }
.queue-item .qi-title { font-weight: 600; }
.queue-item .qi-meta { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); }

.review-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  gap: 18px;
}
.review-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 260px;
  background: repeating-linear-gradient(45deg, #1a1722 0 10px, #1c1926 10px 20px);
  overflow: hidden;
}
.review-preview iframe { width: 100%; height: 260px; border: 0; background: transparent; }
.review-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 0.88rem; }
.review-meta dt { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.review-meta dd { margin: 2px 0 0; }
.review-code details { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.review-code summary { cursor: pointer; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.review-code pre { white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); font-size: 0.8rem; margin: 10px 0 0; color: var(--text); }
.review-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.review-actions input[type="text"] {
  flex: 1;
  min-width: 200px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.88rem;
}

.login-shell { max-width: 380px; margin: 96px auto; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: grid;
  gap: 18px;
}
.login-card h1 { font-family: var(--font-display); font-size: 1.5rem; margin: 0; }

.status-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}
.status-pill.pending { background: rgba(232, 163, 61, 0.12); color: var(--accent); }
.status-pill.approved { background: rgba(63, 174, 143, 0.14); color: var(--good); }
.status-pill.rejected { background: rgba(217, 105, 95, 0.14); color: var(--bad); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
