:root {
  --bg: #eef2f8;
  --bg-accent: #dce8f8;
  --surface: #ffffff;
  --text: #142033;
  --muted: #5f6f86;
  --primary: #1a5fb4;
  --primary-soft: rgba(26, 95, 180, 0.1);
  --secondary: #0d7a6f;
  --secondary-soft: rgba(13, 122, 111, 0.1);
  --vcm: #6b4ce6;
  --vcm-soft: rgba(107, 76, 230, 0.12);
  --vaua: #c2410c;
  --vaua-soft: rgba(194, 65, 12, 0.12);
  --border: #d4deea;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(20, 32, 51, 0.08);
  --shadow-lg: 0 20px 60px rgba(20, 32, 51, 0.12);
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
}

html.theme-dark,
body.theme-dark {
  --bg: #0b1018;
  --bg-accent: #152033;
  --surface: #151d2b;
  --text: #e8edf5;
  --muted: #94a3b8;
  --primary: #5ba3f5;
  --primary-soft: rgba(91, 163, 245, 0.14);
  --secondary: #3ecfb8;
  --secondary-soft: rgba(62, 207, 184, 0.12);
  --vcm: #a78bfa;
  --vcm-soft: rgba(167, 139, 250, 0.14);
  --vaua: #fb923c;
  --vaua-soft: rgba(251, 146, 60, 0.16);
  --border: #2a3648;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--bg-accent), transparent),
    radial-gradient(circle at 100% 0%, rgba(26, 95, 180, 0.08), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(13, 122, 111, 0.06), transparent 35%),
    var(--bg);
}

.top-bar {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon,
.theme-toggle .theme-label-dark { display: none; }

html.theme-dark .theme-toggle .icon-sun,
body.theme-dark .theme-toggle .icon-sun,
html.theme-dark .theme-toggle .theme-label-light,
body.theme-dark .theme-toggle .theme-label-light { display: none; }

html.theme-dark .theme-toggle .icon-moon,
body.theme-dark .theme-toggle .icon-moon,
html.theme-dark .theme-toggle .theme-label-dark,
body.theme-dark .theme-toggle .theme-label-dark { display: inline-flex; }

.hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 24px 20px 40px;
  text-align: center;
}

.logo-wrap {
  margin-bottom: 40px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  margin-bottom: 16px;
  border-radius: 24px;
  background: linear-gradient(145deg, var(--primary-soft), var(--secondary-soft));
  color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.logo-mark svg {
  width: 52px;
  height: 52px;
}

.logo-title {
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-sub {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  width: min(960px, 100%);
}

.project-card {
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 14px;
}

.project-sft .project-icon {
  background: var(--primary-soft);
  color: var(--primary);
}

.project-vcm .project-icon {
  background: var(--vcm-soft);
  color: var(--vcm);
}

.project-vaua .project-icon {
  background: var(--vaua-soft);
  color: var(--vaua);
}

.project-icon svg {
  width: 28px;
  height: 28px;
}

.project-card h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.project-tag {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.project-vcm .btn-primary {
  background: var(--vcm);
}

.project-vaua .btn-primary {
  background: var(--vaua);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.hub-footer {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

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