/* drmred.com — shared styles. Follows the system light/dark setting. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #1a1d21;
  --muted: #646b75;
  --line: #dde1e6;
  --accent: #2563eb;
  --accent-soft: #e0eaff;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1e222a;
    --text: #e8eaed;
    --muted: #9aa1ab;
    --line: #2b3039;
    --accent: #6ea0ff;
    --accent-soft: #1c2a47;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}
a { color: var(--accent); }

/* Top bar */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.topbar a { color: inherit; text-decoration: none; }
.topbar .crumb-sep { color: var(--muted); font-weight: 400; }
.topbar .crumb-here { font-weight: 600; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* Profile layout: sidebar + main */
.profile {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 760px) {
  .profile { grid-template-columns: 1fr; gap: 28px; }
}

.sidebar .avatar {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #10101c; /* matches the avatar image's background */
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 5rem;
  font-weight: 700;
  overflow: hidden;
}
.sidebar .avatar img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .sidebar { display: grid; grid-template-columns: 88px 1fr; gap: 0 16px; align-items: center; }
  .sidebar .avatar { font-size: 2.2rem; }
  .sidebar .bio, .sidebar .facts { grid-column: 1 / -1; }
}
.sidebar h1 { margin: 16px 0 0; font-size: 1.6rem; line-height: 1.2; }
.sidebar .handle { color: var(--muted); font-size: 1.1rem; }
.sidebar .bio { margin: 14px 0; }
.facts { list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: 0.92rem; }
.facts li { padding: 3px 0; }
.facts strong { color: var(--text); font-weight: 600; }

/* Section headings */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.section-title .count {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
}
.section + .section { margin-top: 40px; }

/* Project cards */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover, .card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgb(0 0 0 / .08);
  outline: none;
}
.thumb {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.thumb .mark {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.5rem;
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-weight: 600; color: var(--accent); }
.card-blurb { color: var(--muted); font-size: 0.92rem; flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
  font-size: 0.75rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 9px;
}

/* README-style detail page */
.project-head { margin-bottom: 24px; }
.project-head h1 { margin: 0 0 4px; font-size: 1.8rem; }
.project-head .blurb { color: var(--muted); margin: 0 0 8px; font-size: 1.05rem; }

.readme {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.readme-bar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface-2);
}
.readme-body { padding: 8px 28px 28px; }
@media (max-width: 560px) { .readme-body { padding: 4px 16px 20px; } }

.readme-body h1, .readme-body h2 {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.readme-body h1 { font-size: 1.6rem; }
.readme-body h2 { font-size: 1.25rem; margin-top: 28px; }
.readme-body img {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  margin: 12px 0;
}
.readme-body blockquote {
  margin: 12px 0;
  padding: 2px 16px;
  border-left: 4px solid var(--line);
  color: var(--muted);
}
.readme-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}
.readme-body pre {
  background: var(--surface-2);
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
}
.readme-body pre code { background: none; padding: 0; }
.readme-body table { border-collapse: collapse; }
.readme-body th, .readme-body td { border: 1px solid var(--line); padding: 6px 12px; }

.back { display: inline-block; margin-top: 24px; }
.notice { color: var(--muted); }

footer.site {
  margin-top: 56px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
