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

:root {
  --bg: #0a0a12;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.18);
  --text: #e2e8f0;
  --text-muted: #7a8094;
  --text-dim: #4a5068;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-glow: rgba(99,102,241,0.25);
  --green: #10b981;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }

/* ── Background orbs ──────────────────────────────────────────────────────── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
}
.orb-1 {
  width: 600px; height: 600px;
  top: -200px; left: -100px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
}
.orb-2 {
  width: 500px; height: 500px;
  bottom: -150px; right: -100px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
}
.orb-3 {
  width: 300px; height: 300px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  opacity: 0.1;
}

/* ── Site Header ──────────────────────────────────────────────────────────── */
.site-header {
  position: relative;
  z-index: 1;
  padding: 60px 24px 40px;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-icon { width: 48px; height: 48px; flex-shrink: 0; }
.site-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 50%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.site-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Projects Grid ────────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

@media (max-width: 480px) {
  .projects-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ── Project Card ─────────────────────────────────────────────────────────── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform var(--transition), border-color var(--transition),
              box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(99,102,241,0.15);
}

.card-image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.project-card:hover .card-image img { transform: scale(1.05); }

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.card-version {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(99,102,241,0.3);
  white-space: nowrap;
  flex-shrink: 0;
}
.card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99,102,241,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.5);
}

.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--border-hover);
}

.btn-link {
  background: rgba(139,92,246,0.12);
  color: #a78bfa;
  border-color: rgba(139,92,246,0.25);
}
.btn-link:hover {
  background: rgba(139,92,246,0.22);
  border-color: rgba(139,92,246,0.5);
}

.btn-docs {
  background: rgba(16,185,129,0.12);
  color: #34d399;
  border-color: rgba(16,185,129,0.25);
}
.btn-docs:hover {
  background: rgba(16,185,129,0.22);
  border-color: rgba(16,185,129,0.5);
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 16px;
}
.empty-icon {
  width: 80px;
  height: 80px;
  color: var(--text-dim);
  opacity: 0.5;
}
.empty-icon svg { width: 100%; height: 100%; }
.empty-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.empty-text {
  color: var(--text-muted);
  max-width: 360px;
}
.empty-link {
  color: var(--accent);
  font-size: 0.9rem;
  transition: color var(--transition);
}
.empty-link:hover { color: #818cf8; }

/* ── Site Footer ──────────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
}
.footer-admin-link {
  color: var(--text-dim);
  font-size: 0.8rem;
  transition: color var(--transition);
}
.footer-admin-link:hover { color: var(--text-muted); }

/* ── Instruction Header ───────────────────────────────────────────────────── */
.instruction-header {
  position: relative;
  z-index: 1;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
}
.instruction-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color var(--transition);
}
.back-link:hover { color: #fff; }
.back-link svg { width: 16px; height: 16px; }

.instruction-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.instruction-project {
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}
.instruction-version {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── Instruction Main ─────────────────────────────────────────────────────── */
.instruction-main {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.instruction-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  backdrop-filter: blur(20px);
}
.instruction-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
}

/* ── Markdown Body ────────────────────────────────────────────────────────── */
.markdown-body {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  color: #fff;
  font-weight: 700;
  margin: 1.8em 0 0.6em;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.markdown-body h1 { font-size: 1.8rem; }
.markdown-body h2 { font-size: 1.4rem; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.markdown-body h3 { font-size: 1.1rem; }
.markdown-body p { margin: 0 0 1em; }
.markdown-body ul, .markdown-body ol { margin: 0.5em 0 1em 1.5em; }
.markdown-body li { margin: 0.3em 0; }
.markdown-body a { color: #818cf8; text-decoration: underline; }
.markdown-body a:hover { color: #a5b4fc; }
.markdown-body strong { color: #fff; font-weight: 700; }
.markdown-body em { color: #c4b5fd; font-style: italic; }
.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 1em 0;
  background: rgba(99,102,241,0.07);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}
.markdown-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(255,255,255,0.07);
  padding: 2px 6px;
  border-radius: 4px;
  color: #c4b5fd;
  border: 1px solid rgba(255,255,255,0.08);
}
.markdown-body pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  margin: 1.2em 0;
}
.markdown-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.7;
}
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.9rem;
}
.markdown-body th {
  background: rgba(99,102,241,0.15);
  color: #c4b5fd;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(99,102,241,0.3);
}
.markdown-body td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.markdown-body tr:hover td { background: rgba(255,255,255,0.03); }
.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
