:root {
  --violet-50: #f5f3ff;
  --violet-100: #ede9fe;
  --violet-200: #ddd6fe;
  --violet-400: #a78bfa;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --sky-500: #0ea5e9;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --emerald-50: #ecfdf5;
  --emerald-200: #a7f3d0;
  --emerald-600: #059669;
  --amber-50: #fffbeb;
  --amber-200: #fde68a;
  --amber-600: #d97706;
  --red-400: #f87171;
  --red-600: #dc2626;
  --white: #ffffff;
}

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

html { height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--white);
  color: var(--gray-900);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* ─── Gradient text ─── */
.gradient-text {
  background: linear-gradient(135deg, var(--violet-600) 0%, var(--indigo-600) 60%, var(--sky-500) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Glow border (project cards) ─── */
.glow-border { position: relative; }
.glow-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--violet-600), var(--indigo-600), var(--sky-500));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}
.glow-border:hover::before { opacity: 1; }
.glow-border > * { position: relative; z-index: 1; }

/* ─── Fixed background ─── */
.bg-fixed {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.bg-blobs { pointer-events: none; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}
.blob-1 {
  width: 700px; height: 700px;
  left: 50%; top: 25%;
  transform: translate(-50%, -50%);
  background: rgba(196, 181, 253, 0.45);
  filter: blur(120px);
}
.blob-2 {
  width: 400px; height: 400px;
  right: 25%; bottom: 25%;
  background: rgba(186, 230, 253, 0.4);
  filter: blur(100px);
}
.bg-dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: radial-gradient(circle, var(--gray-300) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ─── Navbar ─── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-100);
}
.navbar-inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand { display: flex; align-items: center; }
.navbar-logo { height: 44px; width: auto; object-fit: contain; }
.navbar-name {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-700);
  transition: color 0.2s;
}
.navbar-name:hover { color: var(--violet-600); }
.navbar-nav { display: flex; align-items: center; gap: 24px; }
.navbar-nav a {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  transition: color 0.2s;
}
.navbar-nav a:hover { color: var(--violet-600); }

/* ─── Hero ─── */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
  text-align: center;
}
.hero-content { max-width: 896px; }
.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.hero-subtitle {
  margin-top: 24px;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--gray-500);
}
.hero-description {
  margin: 24px auto 0;
  max-width: 560px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--gray-400);
  white-space: pre-wrap;
}
.hero-actions { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; }
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--gray-300);
}
.scroll-hint span { font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; }
.scroll-line { width: 1px; height: 32px; background: linear-gradient(to bottom, var(--gray-300), transparent); }

/* ─── Projects section ─── */
.projects-section {
  position: relative;
  z-index: 1;
  padding: 96px 24px;
}
.projects-inner { max-width: 1152px; margin: 0 auto; }
.projects-header { margin-bottom: 64px; }
.projects-title { font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.02em; color: var(--gray-900); }
.projects-subtitle { margin-top: 8px; font-size: 1.125rem; color: var(--gray-400); }
.projects-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
@media (min-width: 640px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .projects-grid { grid-template-columns: repeat(3, 1fr); } }

/* ─── Project card ─── */
.project-card { height: 100%; }
.project-card a { display: block; height: 100%; }
.project-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.3s, border-color 0.3s;
}
.project-card:hover .project-card-inner {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-color: transparent;
}
.project-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--gray-100);
}
.project-card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.project-card:hover .project-card-image img { transform: scale(1.05); }
.project-card-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--violet-50), #eef2ff);
}
.project-card-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.4;
  transition: color 0.2s;
}
.project-card:hover .project-card-title { color: var(--violet-700); }
.project-card-desc { font-size: 0.875rem; color: var(--gray-500); line-height: 1.6; flex: 1; }
.project-card-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--violet-600);
  margin-top: 4px;
}

/* ─── Status badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-idea { background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-200); }
.badge-idea::before { background: var(--gray-400); }
.badge-in_development { background: var(--amber-50); color: var(--amber-600); border: 1px solid var(--amber-200); }
.badge-in_development::before { background: var(--amber-600); }
.badge-beta { background: var(--violet-50); color: var(--violet-600); border: 1px solid var(--violet-200); }
.badge-beta::before { background: var(--violet-500); }
.badge-available { background: var(--emerald-50); color: var(--emerald-600); border: 1px solid var(--emerald-200); }
.badge-available::before { background: var(--emerald-600); }

/* ─── Footer ─── */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--gray-100);
  padding: 32px 24px;
}
.footer-inner {
  max-width: 1152px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer p { font-size: 0.75rem; color: var(--gray-400); }
.footer-name { color: var(--gray-300); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--violet-600);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}
.btn-primary:hover { background: var(--violet-500); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; transform: none; }
.btn-secondary {
  background: var(--white);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.btn-secondary:hover { border-color: var(--violet-300); color: var(--violet-600); }
.btn-ghost {
  background: transparent;
  color: var(--gray-400);
  border: 1px solid var(--gray-100);
}
.btn-ghost:hover { border-color: #fecaca; color: var(--red-600); }
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; border-radius: 8px; }
.btn-link {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}
.btn-link:hover { color: var(--gray-600); }
.text-danger { color: var(--red-400) !important; }
.text-danger:hover { color: var(--red-600) !important; }

/* ─── Form inputs ─── */
.input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--gray-900);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: var(--violet-500);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}
.input-sm { width: 112px; }
textarea.input { resize: vertical; }

/* ─── Admin layout ─── */
.admin-body { background: var(--gray-50); }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar-top {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}
.admin-back {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  transition: color 0.2s;
}
.admin-back:hover { color: var(--violet-600); }
.admin-nav { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-400);
  padding: 8px 12px;
}
.admin-nav-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: background 0.15s, color 0.15s;
}
.admin-nav-link:hover { background: var(--gray-50); color: var(--violet-600); }
.admin-sidebar-footer {
  border-top: 1px solid var(--gray-100);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-user-email { font-size: 0.75rem; color: var(--gray-400); truncate: true; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-main { flex: 1; padding: 32px; overflow-y: auto; max-width: 860px; }

/* ─── Admin page structure ─── */
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.page-subtitle { font-size: 0.875rem; color: var(--gray-400); margin-bottom: 32px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 32px; }
.page-header .page-title { margin-bottom: 2px; }
.page-header .page-subtitle { margin-bottom: 0; }

/* ─── Dashboard cards ─── */
.dashboard-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); max-width: 640px; }
.dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
}
.dashboard-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: var(--violet-200); }
.dashboard-card-icon { font-size: 1.5rem; }
.dashboard-card h2 { font-size: 0.9375rem; font-weight: 600; color: var(--gray-900); }
.dashboard-card:hover h2 { color: var(--violet-600); }
.dashboard-card p { font-size: 0.8125rem; color: var(--gray-400); }

/* ─── Form cards / content form ─── */
.form-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}
.form-card-title { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); margin-bottom: 16px; }
.form-card-hint { font-size: 0.75rem; color: var(--gray-400); margin-top: -12px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; max-width: 560px; }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--gray-700); }
.form-hint { font-size: 0.75rem; color: var(--gray-400); }
.form-actions { display: flex; align-items: center; gap: 12px; padding-top: 8px; }
.saved-msg { font-size: 0.875rem; font-weight: 500; color: #059669; }
.content-form .form-group { max-width: 100%; }

/* ─── Project form ─── */
.project-form { max-width: 560px; }

/* ─── Project list ─── */
.project-list { display: flex; flex-direction: column; gap: 12px; }
.project-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 16px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.project-list-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.project-list-thumb {
  width: 80px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--gray-100);
  flex-shrink: 0;
}
.project-list-thumb-empty { background: var(--gray-100); }
.project-list-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.project-list-name { font-weight: 600; color: var(--gray-900); font-size: 0.9375rem; }
.project-list-desc { font-size: 0.8125rem; color: var(--gray-400); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px; }
.project-list-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ─── Empty state ─── */
.empty-state {
  border: 2px dashed var(--gray-200);
  border-radius: 16px;
  padding: 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-state p { color: var(--gray-400); }
.empty-state .btn-link { font-size: 0.875rem; color: var(--violet-500); text-transform: none; letter-spacing: 0; }
.empty-state .btn-link:hover { color: var(--violet-700); }

/* ─── Upload area ─── */
.upload-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 2px dashed var(--gray-200);
  border-radius: 12px;
  padding: 32px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: none;
  text-align: center;
}
.upload-area:hover { border-color: var(--violet-300); background: rgba(124, 58, 237, 0.02); }
.upload-icon {
  background: var(--gray-100);
  border-radius: 12px;
  padding: 12px;
  color: var(--gray-400);
  transition: background 0.2s, color 0.2s;
}
.upload-area:hover .upload-icon { background: var(--violet-100); color: var(--violet-500); }
.upload-label { font-size: 0.875rem; font-weight: 500; color: var(--gray-600); }
.upload-area:hover .upload-label { color: var(--violet-700); }
.upload-hint { font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }

/* ─── Image previews ─── */
.image-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.logo-preview { height: 48px; width: auto; object-fit: contain; }
.image-preview-wrap { display: inline-block; background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 12px; padding: 12px; }
.bg-preview-wrap { border-radius: 12px; overflow: hidden; }
.bg-preview { width: 100%; max-width: 480px; height: auto; aspect-ratio: 16/5; object-fit: cover; display: block; }
.project-image-preview-wrap { border-radius: 12px; overflow: hidden; margin-bottom: 2px; }
.project-image-preview { width: 100%; max-width: 420px; aspect-ratio: 16/9; object-fit: cover; display: block; }

/* ─── Image crop ─── */
.crop-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 16px;
  margin-bottom: 12px;
  max-width: 560px;
}
.crop-wrap img { max-height: 400px; width: 100%; object-fit: contain; }

/* ─── Text utilities ─── */
.text-muted { color: var(--gray-400); }
