:root {
  /* Dark-mode-first palette */
  --bg: #050609;
  --bg-elevated: #101218;
  --fg: #f5f5f7;
  --muted: #a1a1a6;
  --accent: #4f8cff;
  --border-subtle: rgba(255,255,255,0.12);
  --shadow-soft: 0 14px 30px rgba(0,0,0,0.55);
  --radius-large: 28px;
  --radius-medium: 18px;
  --radius-pill: 999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

html[data-theme="light"] {
  /* Optional light theme override */
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --fg: #111111;
  --muted: #6e6e73;
  --accent: #0071e3;
  --border-subtle: rgba(0,0,0,0.06);
  --shadow-soft: 0 18px 40px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  padding: 72px 24px 56px;
}

@media (min-width: 960px) {
  .site-main {
    padding: 88px 80px 80px;
  }
}

.site-main {
  background: var(--bg);
}

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  backdrop-filter: none;
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

@media (min-width: 960px) {
  .site-header-inner {
    padding-inline: 80px;
  }
}

.site-logo {
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--fg);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 14px;
  color: var(--muted);
  padding: 0;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}

.site-nav a.is-active,
.site-nav a:hover {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

html[data-theme="dark"] .site-nav a:hover,
html[data-theme="dark"] .site-nav a.is-active {
  border-bottom-color: var(--accent);
}

.theme-toggle {
  margin-left: auto;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 2px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

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

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

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

.hero {
  max-width: 960px;
  margin: 0 auto;
  padding-block: 32px 40px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-content {
  max-width: 640px;
}

.hero-photo {
  flex-shrink: 0;
}

.hero-photo img {
  width: 140px;
  height: 140px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
}

@media (min-width: 800px) {
  .hero-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hero-photo img {
    width: 160px;
    height: 160px;
  }
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(40px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  background: transparent;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn.secondary {
  color: var(--fg);
}

.btn.tertiary {
  border: none;
  padding: 0;
  background: none;
  color: var(--accent);
}

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding-block: 32px 8px;
}

.section-header h2 {
  font-size: 24px;
  margin-bottom: 4px;
}

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

.card-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 720px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card,
.card-horizontal {
  background: transparent;
  border-radius: 0;
  padding: 0 0 18px;
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.card p {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--muted);
}

.card-link {
  font-size: 14px;
}

.card-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-horizontal .card-body {
  display: flex;
  flex-direction: column;
}

.card-meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 4px;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-list article {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.page {
  max-width: 840px;
  margin: 0 auto;
}

.cv-headshot-wrapper {
  text-align: center;
  margin-bottom: 16px;
}

.cv-headshot {
  width: 140px;
  height: 140px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
}

.page-header {
  margin-bottom: 16px;
}

.page-header h1 {
  font-size: 32px;
  margin-bottom: 4px;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
}

.page-content p {
  line-height: 1.6;
  color: var(--fg);
}

.page-content h2 {
  margin-top: 24px;
}

.post {
  max-width: 780px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 16px;
}

.post-title {
  font-size: 30px;
  margin-bottom: 6px;
}

.post-meta {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 20px 24px 28px;
}

@media (min-width: 960px) {
  .site-footer {
    padding-inline: 80px;
  }
}

.site-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--muted);
}

.site-footer-meta {
  margin-top: 4px;
}

form.contact-form {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

/* Topics strip for magazine-style taxonomy */
.section-topics {
  padding-top: 8px;
}

.topics-strip {
  max-width: 1120px;
  margin: 0 auto 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.topics-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--muted);
}

.topics-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.contact-form label {
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--fg);
}

.contact-form textarea {
  resize: vertical;
  min-height: 140px;
}

.contact-form button[type="submit"] {
  justify-self: flex-start;
}
