:root {
  --bg-dark: radial-gradient(circle at 20% 20%, #131a26, #0f1622 45%, #0a0f18 100%);
  --card-dark: rgba(255, 255, 255, 0.08);
  --border-dark: rgba(255, 255, 255, 0.14);
  --text-dark: #eef1f6;
  --muted-dark: #b7c0d1;
  --shadow-dark: 0 15px 40px rgba(0, 0, 0, 0.35);
  --hash-bg-dark: #334155;
  --hash-text-dark: #f1f5f9;
  --accent-dark: #4dabff;
  --accent-2-dark: #FB923C;

  --bg-light: radial-gradient(circle at 20% 20%, #f7f9fd, #e8edf7 45%, #dde6f7 100%);
  --card-light: #ffffff;
  --border-light: rgba(12, 24, 44, 0.14);
  --text-light: #0c1526;
  --muted-light: #4a5568;
  --shadow-light: 0 12px 30px rgba(0, 0, 0, 0.12);
  --hash-bg-light: #e2e8f0;
  --hash-text-light: #475569;
  --accent-light: #0055d4;
  --accent-2-light: #c14d00;

  --bg: var(--bg-dark);
  --card: var(--card-dark);
  --border: var(--border-dark);
  --text: var(--text-dark);
  --muted: var(--muted-dark);
  --shadow: var(--shadow-dark);
  --hash-bg: var(--hash-bg-dark);
  --hash-text: var(--hash-text-dark);
  --accent: var(--accent-dark);
  --accent-2: var(--accent-2-dark);
  --radius: 18px;
  --gap: 18px;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  color: var(--text);
}

:root[data-theme="light"] {
  --bg: var(--bg-light);
  --card: var(--card-light);
  --border: var(--border-light);
  --text: var(--text-light);
  --muted: var(--muted-light);
  --shadow: var(--shadow-light);
  --hash-bg: var(--hash-bg-light);
  --hash-text: var(--hash-text-light);
  --accent: var(--accent-light);
  --accent-2: var(--accent-2-light);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-attachment: fixed;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 18px 64px;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.theme-switch:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 111, 255, 0.5);
}

.switch-track {
  position: relative;
  width: 48px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(15, 111, 255, 0.45);
  background: rgba(15, 111, 255, 0.25);
  transition: background 150ms ease, border-color 150ms ease;
}

.theme-switch[data-state="light"] .switch-track {
  background: rgba(15, 111, 255, 0.55);
  border-color: rgba(15, 111, 255, 0.65);
}

.switch-handle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transition: transform 150ms ease, background 150ms ease;
}

.theme-switch[data-state="light"] .switch-handle {
  transform: translateX(22px);
}

.switch-label {
  font-size: 13px;
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  gap: 24px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
}

.hero--single {
  grid-template-columns: 1fr;
}

.hero__meta h1 {
  margin: 6px 0 10px;
  font-size: clamp(28px, 4vw, 38px);
}

.hero__meta .lede {
  color: var(--muted);
  margin: 0 0 16px;
}

.hero__aside {
  border-left: 1px solid var(--border);
  padding-left: 18px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.aside-note {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent);
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 600;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cta-row .theme-switch {
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  color: var(--text);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

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

.btn.primary {
  background: linear-gradient(135deg, #6bd6f2, #53b3d4);
  color: #0b1a25;
}

.btn.ghost {
  border-color: var(--border);
  background: var(--card);
  color: var(--text);
}

.btn.text {
  padding: 8px 0;
  border: none;
  color: var(--accent);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 215, 240, 0.5);
  color: var(--accent);
}

.grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
}

.grid--fixed {
  grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

.card {
  position: relative;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card--pinned {
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(15, 111, 255, 0.15);
}

.card__pin {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--accent);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.card__pin svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 111, 255, 0.14);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 111, 255, 0.45);
  text-decoration: none;
}

.date {
  color: var(--muted);
  opacity: 0.7;
}

.date a {
  color: inherit;
  text-decoration: none;
}

.date a:hover {
  color: var(--accent);
}

.card h2 {
  margin: 0;
  font-size: 18px;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.tiny {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}

.card-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.card__tags {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hash {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--hash-bg);
  text-decoration: none;
  color: var(--hash-text);
  font-size: 13px;
  font-weight: 600;
}

.hash:hover {
  background: #475569;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.links {
  margin-top: 30px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.links__title {
  font-weight: 700;
  letter-spacing: 0.02em;
  width: 100%;
  text-align: center;
}

.links__list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.links__list a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.foot {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.bio-main {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bio-portrait img {
  width: 75%;
  border-radius: 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.bio-portrait .small-note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

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

  .hero__aside {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 12px;
  }

  .foot {
    flex-direction: column;
    gap: 6px;
  }
}
