/* Reset + base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --bg: #f7f7f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #666;
  --border: #ececef;
  --accent-from: #6366f1;
  --accent-to: #22d3ee;
  --github: #24292e;
  --codeberg: #2185d0;
  --badge-bg: #eef0ff;
  --badge-fg: #3b3f8f;
  --badge-soft-bg: #fff1e6;
  --badge-soft-fg: #8a4a1a;
  --badge-ops-bg: #e8f5ee;
  --badge-ops-fg: #1b6b3a;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --card: #161b22;
    --text: #c9d1d9;
    --muted: #8b949e;
    --border: #30363d;
    --github: #21262d;
    --codeberg: #1f6feb;
    --badge-bg: #1f2a4d;
    --badge-fg: #a5b4fc;
    --badge-soft-bg: #3a2614;
    --badge-soft-fg: #ffba7a;
    --badge-ops-bg: #14342a;
    --badge-ops-fg: #7ee2a8;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* Card */
.card {
  width: 100%;
  max-width: 880px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  overflow: hidden;
}

.identity {
  padding: 28px 24px;
  border-right: 1px solid var(--border);
  text-align: center;
}

.content { padding: 28px 28px; }

/* Avatar (initials) */
.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: white;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  user-select: none;
}

.name { margin: 0 0 4px; font-size: 19px; }
.tagline { margin: 0 0 16px; color: var(--muted); font-size: 13px; }

.meta { list-style: none; padding: 0; margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.meta li { margin: 2px 0; }
.meta-label { display: inline-block; min-width: 56px; color: var(--text); opacity: .55; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

/* Platform buttons */
.platforms { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: white;
  font-size: 13px;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-github { background: var(--github); }
.btn-codeberg { background: var(--codeberg); }
.btn-label { font-weight: 600; }
.btn-handle { font-size: 11px; opacity: .75; }

/* Contact */
.contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.contact a { color: var(--text); text-decoration: none; }
.contact a:hover { text-decoration: underline; }
.copy-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--muted);
}
.copy-btn:hover { background: var(--border); color: var(--text); }
.copy-btn.copied { color: var(--badge-ops-fg); }

/* Content blocks */
.block { margin-bottom: 22px; }
.block:last-child { margin-bottom: 0; }
.block h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 600;
}
.block p { margin: 0; }

/* Stack */
.stack { display: grid; grid-template-columns: 80px 1fr; gap: 6px 12px; margin: 0; }
.stack dt { font-size: 12px; color: var(--muted); align-self: center; }
.stack dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-size: 12px;
  font-weight: 500;
}
.badge-soft { background: var(--badge-soft-bg); color: var(--badge-soft-fg); }
.badge-ops { background: var(--badge-ops-bg); color: var(--badge-ops-fg); }

/* Projects */
.projects { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.project {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "title stars" "desc desc";
  gap: 4px 12px;
}
.project-title { grid-area: title; font-weight: 600; text-decoration: none; color: var(--text); }
.project-title:hover { color: var(--accent-from); }
.stars { grid-area: stars; font-size: 12px; color: var(--muted); white-space: nowrap; }
.project-desc { grid-area: desc; margin: 0; font-size: 13px; color: var(--muted); }

/* Mirror footer */
.mirror {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.mirror a { color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--border); }
.mirror a:hover { border-bottom-color: var(--accent-from); }
.mirror-arrow { margin: 0 4px; }
.mirror-icon { margin-right: 4px; }

/* Responsive: stack columns under 640px */
@media (max-width: 640px) {
  .card { grid-template-columns: 1fr; }
  .identity { border-right: none; border-bottom: 1px solid var(--border); }
}
