/* ---------- Theme variables ---------- */
:root {
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6B7280;
  --line: #E5E7EB;
  --brand: #0EA5E9;
  --chip-bg: #F4F6F8;
  --card-bg: #fff;

  /* Header */
  --header-bg: #ffffff;
  --topbar-bg: #F9FAFB;
  --pill-bg: #ffffff;
  --pill-border: #E5E7EB;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  line-height: 1.55;
  font-size: 16px;
}

.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
}

.small {
  font-size: .9rem;
}

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

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

a:hover {
  text-decoration: underline;
}

/* ---------- Sticky header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}

.site-header.scrolled {
  box-shadow: 0 8px 20px rgba(0, 0, 0, .06);
  border-bottom-color: transparent;
}

/* Top utility bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
}

.cta-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.cta {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--pill-bg);
  color: var(--fg);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .92rem;
}

.cta:hover {
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
}

.cta.strong {
  border-color: var(--brand);
}

/* Theme toggle button */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Main header row */
.headrow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  padding: 14px 0;
}

.title {
  font-size: 1.85rem;
  margin: 0;
}

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

.tagline {
  margin: .25rem 0 0;
  color: var(--muted);
}

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

.nav a {
  color: var(--fg);
  border-bottom: 2px solid transparent;
  padding-bottom: 3px;
}

.nav a:hover {
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
}

/* Active nav link while scrolling */
.nav a.active {
  border-bottom: 2px solid var(--brand);
  color: var(--brand);
}

/* Avoid sticky-header overlap when jumping to anchors */
.section[id] {
  scroll-margin-top: 96px;
}


/* ---------- Sections ---------- */
.section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .9rem;
}

.chip.small {
  font-size: .8rem;
  padding: 2px 8px;
}

.bullets {
  margin: 10px 0 0 18px;
}

.about-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}

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

  .avatar {
    width: 96px;
    height: 96px;
  }
}

/* ---------- Cards / lists ---------- */
.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}

.card {
  grid-column: span 12;
  border: 1px solid var(--line);
  background: var(--card-bg);
  border-radius: 14px;
  padding: 14px;
  transition: box-shadow .15s ease, transform .15s ease;
}

.card:hover {
  box-shadow: 0 8px 24px rgba(2, 6, 23, .06);
  transform: translateY(-1px);
}

@media (min-width: 760px) {
  .card {
    grid-column: span 6;
  }
}

@media (min-width: 1100px) {
  .card {
    grid-column: span 4;
  }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  background: #E6F7FD;
  color: #0677A0;
  border: 1px solid #CDECF9;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: .8rem;
}

.links {
  margin: .2rem 0 0;
}

.links a {
  color: var(--brand);
}

.links a:hover {
  text-decoration: underline;
}

.pubs {
  margin: 0;
  padding-left: 18px;
}

.pubs li {
  margin: 8px 0;
}

.list {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.list-item:last-child {
  border-bottom: none;
}

.button {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--fg);
}

.button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.button.subtle {
  opacity: .9;
}

.btn-mini{
  border:1px solid var(--line);
  background:var(--pill-bg);
  color:var(--fg);
  border-radius:8px;
  font-size:.8rem;
  padding:4px 8px;
  cursor:pointer;
}
.btn-mini:hover{ border-color:var(--brand); color:var(--brand); }


.site-footer {
  padding: 20px 0 40px;
}

/* ---------- System dark fallback (Auto when system=dark) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0F16;
    --fg: #F3F4F6;
    --muted: #9CA3AF;
    --line: #1F2937;
    --chip-bg: #111827;
    --card-bg: #0E131B;
    --brand: #38BDF8;
    --header-bg: #0B0F16;
    --topbar-bg: #0B0F16;
    --pill-bg: #0E131B;
    --pill-border: #1F2937;
  }
}

/* ---------- Explicit overrides (win) ---------- */
:root[data-theme="light"] {
  --bg: #fff;
  --fg: #111827;
  --muted: #6B7280;
  --line: #E5E7EB;
  --chip-bg: #F4F6F8;
  --card-bg: #fff;
  --brand: #0EA5E9;
  --header-bg: #ffffff;
  --topbar-bg: #F9FAFB;
  --pill-bg: #ffffff;
  --pill-border: #E5E7EB;
}

:root[data-theme="dark"] {
  --bg: #0B0F16;
  --fg: #F3F4F6;
  --muted: #9CA3AF;
  --line: #1F2937;
  --chip-bg: #111827;
  --card-bg: #0E131B;
  --brand: #38BDF8;
  --header-bg: #0B0F16;
  --topbar-bg: #0B0F16;
  --pill-bg: #0E131B;
  --pill-border: #1F2937;
}

.exp-list{ display:grid; gap:16px; }
.exp{ border:1px solid var(--line); border-radius:12px; padding:12px; background:var(--card-bg); }
.exp-head{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
