:root {
  --bg-1: #1a1340;
  --bg-2: #3a1a6b;
  --bg-3: #6b2e8a;
  --text: #f4f1ff;
  --text-dim: rgba(244, 241, 255, 0.65);
  --text-faint: rgba(244, 241, 255, 0.42);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-hover: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo",
               "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--text);
  background: #100828;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Background ---------- */
.bg-gradient {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(at 20% 10%, var(--bg-3) 0px, transparent 50%),
    radial-gradient(at 80% 90%, var(--bg-2) 0px, transparent 50%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
}
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}
.blob-1 { width: 480px; height: 480px; background: #5a3df5; top: -100px; left: -120px; }
.blob-2 { width: 420px; height: 420px; background: #c54fb0; top: 40%; right: -100px; animation-delay: -6s; }
.blob-3 { width: 360px; height: 360px; background: #3a8df5; bottom: -80px; left: 30%; animation-delay: -12s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, -30px) scale(1.08); }
}

/* ---------- Glass utility ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--glass-shadow);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 16px;
  margin: 16px auto 0;
  max-width: 1100px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 22px; }
.brand-name { font-weight: 600; letter-spacing: 0.2px; font-size: 17px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 8px 14px;
  width: 320px; max-width: 40vw;
}
.search-icon { opacity: 0.65; }
.search input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: var(--text); font-size: 14px;
}
.search input::placeholder { color: var(--text-faint); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--glass-border);
  color: var(--text); cursor: pointer; font-size: 16px;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- Container ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ---------- Hero ---------- */
.hero { text-align: center; margin-bottom: 40px; }
.hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.hero-sub { color: var(--text-dim); font-size: 15px; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}
.card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 22px;
  border-radius: var(--radius-lg);
  text-decoration: none; color: inherit;
  transition: transform 0.25s, background 0.25s, border-color 0.25s;
  min-height: 160px;
  overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 0%, rgba(var(--accent, 130, 180, 255), 0.25), transparent 60%);
  opacity: 0.8; pointer-events: none;
}
.card:hover {
  transform: translateY(-4px);
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.32);
}
.card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  background: rgba(var(--accent, 130, 180, 255), 0.18);
  border: 1px solid rgba(var(--accent, 130, 180, 255), 0.3);
  margin-bottom: 18px;
}
.card-body h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.card-body p { color: var(--text-dim); font-size: 13px; }
.card-count {
  position: absolute; top: 22px; right: 22px;
  font-size: 12px; color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- Recent ---------- */
.recent { padding: 22px; border-radius: var(--radius-lg); }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.section-head h3 { font-size: 15px; font-weight: 600; letter-spacing: 0.2px; }
.more { color: var(--text-dim); text-decoration: none; font-size: 13px; }
.more:hover { color: var(--text); }

.recent-list { list-style: none; }
.recent-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
}
.recent-item:last-child { border-bottom: 0; }
.ri-title { color: var(--text); }
.ri-date  { color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.recent-item.placeholder .ri-title { color: var(--text-faint); font-style: italic; }

/* ---------- Footer ---------- */
.footer {
  margin-top: 40px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
}
.footer .dot { margin: 0 8px; opacity: 0.6; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .topbar { margin: 12px; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .search { width: 100%; max-width: none; order: 3; }
  .container { padding: 32px 16px 60px; }
  .card { min-height: 140px; }
}
