:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #64748b;
  --card: #f8fafc;
  --link: #0ea5e9;
  --border: #e2e8f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --fg: #e6e9ef;
    --muted: #a0aec0;
    --card: #11162a;
    --link: #38bdf8;
    --border: #1f2937;
  }
}

html[data-theme="light"] {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #64748b;
  --card: #f8fafc;
  --link: #0ea5e9;
  --border: #e2e8f0;
}

html[data-theme="dark"] {
  --bg: #0b1020;
  --fg: #e6e9ef;
  --muted: #a0aec0;
  --card: #11162a;
  --link: #38bdf8;
  --border: #1f2937;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

img {
  max-width: 100%;
  height: auto;
}

html {
  transition: background-color 0.25s ease, color 0.25s ease;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 24px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand h1 {
  margin: 0;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
  object-position: center;
  display: block;
  background: transparent;
}

button.theme-toggle,
button.theme {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.links a {
  color: var(--link);
  text-decoration: none;
  margin-right: 14px;
}

.links .pill-link {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--fg);
  background: var(--card);
}

.links .pill-link:hover {
  filter: brightness(1.05);
}

.social-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 4px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 18px;
  margin: 16px 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
}

h1,
h2 {
  line-height: 1.25;
  margin: 0 0 8px;
}

h2 {
  margin-top: 20px;
}

.grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 700px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.muted {
  color: var(--muted);
}

.pill {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
}

.hidden {
  display: none !important;
}

footer {
  margin: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

.page {
  display: grid;
  gap: 16px;
  grid-template-areas: 'main' 'sidebar';
}

@media (min-width: 900px) {
  .page {
    grid-template-columns: 400px 1fr;
    grid-template-areas: 'sidebar main';
  }
}

@media (min-width: 1200px) {
  .page {
    grid-template-columns: 420px 1fr;
  }
}

.sidebar {
  grid-area: sidebar;
  position: sticky;
  top: 16px;
  align-self: start;
  height: fit-content;
}

.page > main {
  grid-area: main;
}

.sidebar .grid {
  grid-template-columns: 1fr;
}

.sidebar .card:first-child {
  margin-top: 0;
}

[data-theme="light"] .icon-dark {
  display: inline;
}

[data-theme="light"] .icon-light {
  display: none;
}

[data-theme="dark"] .icon-dark {
  display: none;
}

[data-theme="dark"] .icon-light {
  display: inline;
}
