:root{
  --bg:#ffffff; --text:#111; --muted:#666;
  --card:#f7f7f8; --border:#e5e7eb; --accent:#0b74de;
}
:root.dark{
  --bg:#0b0d12; --text:#e6e7ea; --muted:#9aa3af;
  --card:#12151c; --border:#1f2630; --accent:#66aaff;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial,sans-serif;
  background:var(--bg); color:var(--text);
}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}

.site-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 22px; border-bottom:1px solid var(--border);
}
.brand h1{margin:0 0 6px 0; font-size:1.6rem}
.brand .tagline{margin:0; color:var(--muted); font-size:.95rem}
#themeToggle{
  font-size:18px; padding:6px 10px; border-radius:8px; background:var(--card);
  border:1px solid var(--border); cursor:pointer;
}

.top-nav{
  display:flex; flex-wrap:wrap; gap:10px; padding:10px 22px; border-bottom:1px solid var(--border);
}
.top-nav a{
  padding:6px 10px; border:1px solid var(--border); border-radius:8px; color:var(--text);
}
.top-nav a.active, .top-nav a:hover{border-color:var(--accent); color:var(--accent)}

.container{max-width:1100px; margin:0 auto; padding:22px}

.intro{
  display:grid; grid-template-columns: 1.6fr 0.9fr; gap:28px; align-items:start;
}
@media (max-width:900px){ .intro{grid-template-columns:1fr} }

.intro-text h2{margin-top:0}
.cta-row{display:flex; gap:10px; margin:14px 0 10px 0}
.btn{background:var(--accent); color:#fff; padding:8px 12px; border-radius:8px}
.btn.outline{background:transparent; color:var(--accent); border:1px solid var(--accent)}
.btn:hover{text-decoration:none; filter:brightness(1.05)}
.social{margin-top:8px}
.social a{margin-right:12px}

.intro-photo{text-align:center}
.intro-photo img{
  width:100%; max-width:260px; border-radius:14px; border:1px solid var(--border);
  background:var(--card);
}
.photo-caption{color:var(--muted); font-size:.9rem; margin-top:8px}

.highlights h2{margin:28px 0 12px}
.cards{list-style:none; padding:0; margin:0; display:grid; gap:16px; grid-template-columns:repeat(3,1fr)}
@media (max-width:900px){ .cards{grid-template-columns:1fr} }
.card{
  background:var(--card); border:1px solid var(--border); border-radius:14px; padding:16px;
}
.card h3{margin-top:0}

.site-footer{
  display:flex; gap:10px; align-items:center; justify-content:center;
  border-top:1px solid var(--border); padding:18px; color:var(--muted);
}

/* ===== Updates timeline ===== */
.updates { margin-top: 28px; }
.updates h2 { margin: 0 0 12px; }
.updates-timeline {
  margin-left: 10px; padding-left: 16px; display: grid; gap: 14px;
  border-left: 2px solid var(--border);
}
.update {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; transition: transform .16s ease, box-shadow .16s ease;
}
.update::before {
  content: ""; position: absolute; left: -12px; top: 16px; width: 10px; height: 10px;
  background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 3px var(--bg);
}
.update:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.06); }
.u-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.u-date { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.u-tag {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid var(--accent); color: var(--accent);
  padding: 2px 8px; border-radius: 999px; font-size: .85rem;
}
.update a { text-decoration: none; }
.update a:hover { text-decoration: underline; }

/* ===== Under-construction banner ===== */
.notice {
  margin: 12px 22px; padding: 10px 12px; border: 1px dashed var(--border);
  border-radius: 10px; background: var(--card);
}
.notice-inline {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  animation: noticePulse 2.8s ease-in-out infinite;
}
.notice-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 15%, transparent);
}
.notice-close {
  margin-left: auto; border: 1px solid var(--border); background: transparent;
  border-radius: 8px; padding: 2px 8px; cursor: pointer; color: var(--muted);
}
@keyframes noticePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(11,116,222,0.00); }
  50%     { box-shadow: 0 0 0 6px rgba(11,116,222,0.12); }
}

/* Tag variants */
.u-tag {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 2px 8px; border-radius: 999px; font-size: .85rem;
}

.u-tag.is-reviewed {
  /* keep accent blue for review items */
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}

.u-tag.is-published {
  /* green for publications */
  --pub: #16a34a; /* tailwind-emerald-600-ish */
  background: color-mix(in srgb, var(--pub) 12%, transparent);
  border-color: var(--pub);
  color: var(--pub);
}

/* Orange for talks/presentations */
.u-tag.is-talk {
  --talk: #d97706; /* amber-600-ish */
  background: color-mix(in srgb, var(--talk) 12%, transparent);
  border-color: var(--talk);
  color: var(--talk);
}

/* Base tag */
.u-tag {
  display: inline-block;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid transparent;
  background: var(--tag-bg, #eef2f7);
  color: var(--tag-fg, #1f2937);
}

/* Existing variants (optional — keep if you’re already using them) */
.u-tag.is-reviewed { --tag-bg: #e6f4ff; --tag-fg: #084b83; border-color: #b3ddff; }
.u-tag.is-talk     { --tag-bg: #fff6e6; --tag-fg: #7a3d00; border-color: #ffd9a6; }
.u-tag.is-award    { --tag-bg: #fff1cc; --tag-fg: #5f3b00; border-color: #ffe08a; }
.u-tag.is-published{ --tag-bg: #eaf8ef; --tag-fg: #0b4d2b; border-color: #c8edd6; }

/* New variants */
.u-tag.is-invited  { --tag-bg: #efe6ff; --tag-fg: #4b2ca3; border-color: #d7c8ff; } /* purple-ish */
.u-tag.is-visit    { --tag-bg: #e9f7ff; --tag-fg: #064663; border-color: #c9ebff; } /* teal/blue */

/* Dark mode tuning */
@media (prefers-color-scheme: dark) {
  .u-tag {
    --tag-bg: rgba(255,255,255,0.08);
    --tag-fg: #e5e7eb;
    border-color: rgba(255,255,255,0.16);
  }
  .u-tag.is-reviewed { --tag-bg: rgba(64, 161, 255, 0.18); --tag-fg: #cfe8ff; border-color: rgba(64,161,255,0.35); }
  .u-tag.is-talk     { --tag-bg: rgba(255, 183, 77, 0.18); --tag-fg: #ffe1b3; border-color: rgba(255,183,77,0.35); }
  .u-tag.is-award    { --tag-bg: rgba(255, 214, 102, 0.18); --tag-fg: #ffebb3; border-color: rgba(255,214,102,0.35); }
  .u-tag.is-published{ --tag-bg: rgba(86, 194, 136, 0.18); --tag-fg: #c9f1da; border-color: rgba(86,194,136,0.35); }

  .u-tag.is-invited  { --tag-bg: rgba(124, 77, 255, 0.22); --tag-fg: #e6ddff; border-color: rgba(124,77,255,0.45); }
  .u-tag.is-visit    { --tag-bg: rgba(64, 192, 255, 0.20); --tag-fg: #d9f2ff; border-color: rgba(64,192,255,0.42); }
}
.site-footer {
  display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; justify-content: center;
  padding: 1rem; font-size: .95rem; opacity: .95;
}
.footer-links { display: inline-flex; gap: .75rem; margin-left: .5rem; }
.footer-links a { color: inherit; opacity: .8; transition: opacity .15s ease; }
.footer-links a:hover, .footer-links a:focus-visible { opacity: 1; }
.footer-links svg { display: inline-block; vertical-align: -3px; }
.sr-only {
  position: absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border:0;
}

/* Optional: subtle dividers on wide screens */
@media (min-width: 640px) {
  .site-footer > span[aria-hidden="true"] { margin: 0 .25rem; }
}


/* Make page use full height so footer can sit at bottom */
html, body { height: 100%; }
body { display: flex; min-height: 100vh; flex-direction: column; }
main { flex: 1; }

/* Centered footer */
.site-footer {
  margin-top: 3rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border,#eee);

  /* center it */
  display: flex;
  flex-direction: column;       /* stack credit + socials */
  align-items: center;          /* horizontal center */
  justify-content: center;      /* vertical center within footer */
  gap: .6rem;                   /* space between lines */
  text-align: center;           /* center text on wrap */
}

/* center the icons row too */
.footer-links {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: center;      /* center the icons row */
}

/* (nice touch) subtle hover on icons */
.footer-links a { opacity: .9; transition: opacity .15s ease; }
.footer-links a:hover { opacity: 1; }

.footer-quick-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.footer-quick-links a {
  color: var(--text-muted, #666);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-quick-links a:hover {
  color: var(--accent, #0366d6);
}

/* ---------- Layout shell ---------- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* Make teaching page feel like a sectioned dashboard */
.teaching-page .page-header {
  margin-bottom: 1.75rem;
  padding: 1.5rem 1.75rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #e0f2fe, #eef2ff);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.teaching-page .page-header h1 {
  margin: 0 0 0.4rem;
}

.teaching-page .page-header p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- Filter controls ---------- */
.teaching-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem 1.5rem;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: #f5f7ff;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.teaching-controls .control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.teaching-controls label,
.teaching-controls .control-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #64748b;
}

.teaching-controls input[type="search"],
.teaching-controls select {
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  font-size: 0.9rem;
  outline: none;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.teaching-controls input[type="search"]:focus,
.teaching-controls select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

/* ---------- Chips ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s;
}

.chip.is-active {
  background: #1d4ed8;
  color: #f9fafb;
  border-color: #1d4ed8;
}

/* ---------- Timeline + cards ---------- */
.teaching-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.year-heading {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #6b7280;
}

.teaching-card {
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.teaching-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  border-color: #bfdbfe;
}

.teaching-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.teaching-card-header h3 {
  margin: 0;
  font-size: 1rem;
}

.semester {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.dept-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.course-meta {
  margin: 0;
  font-size: 0.85rem;
  color: #4b5563;
}

/* ---------- Details (expand/collapse) ---------- */
.course-details {
  margin-top: 0.3rem;
  font-size: 0.85rem;
}

.course-details summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: #2563eb;
}

.course-details summary::-webkit-details-marker {
  display: none;
}

.course-details summary::before {
  content: "▸ ";
  font-size: 0.8rem;
  display: inline-block;
  transform: translateY(-1px);
}

.course-details[open] summary::before {
  content: "▾ ";
}

.course-details ul {
  margin: 0.35rem 0 0.25rem 1rem;
  padding: 0;
}

/* ---------- Updates section ---------- */
.page-updates {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed #e5e7eb;
}

.page-updates h2 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: #111827;
}

.page-updates p {
  margin: 0;
  font-size: 0.9rem;
  color: #4b5563;
}

/* ---------- Dark mode tweaks ---------- */
.dark .teaching-page .page-header {
  background: linear-gradient(135deg, #0f172a, #020617);
  border-color: #1d4ed8;
}

.dark .teaching-controls {
  background: #020617;
  border-color: #1f2937;
}

.dark .teaching-controls input[type="search"],
.dark .teaching-controls select {
  background: #020617;
  border-color: #374151;
  color: #e5e7eb;
}

.dark .chip {
  background: #020617;
  border-color: #374151;
  color: #e5e7eb;
}

.dark .chip.is-active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #f9fafb;
}

.dark .teaching-card {
  background: #020617;
  border-color: #111827;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.dark .semester,
.dark .course-meta,
.dark .page-updates p {
  color: #9ca3af;
}

.dark .year-heading {
  color: #9ca3af;
}

.dark .dept-tag {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.5);
  color: #93c5fd;
}

/* ---------- Layout shell for all pages ---------- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* ---------- Teaching header ---------- */
.teaching-page .page-header {
  margin-bottom: 1.75rem;
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #e0f2fe, #eef2ff);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.teaching-page .page-header h1 {
  margin: 0 0 0.35rem;
}

.teaching-page .page-header p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- Summary row ---------- */
.teaching-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 1.75rem;
}

.summary-pill {
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  flex-direction: column;
  min-width: 120px;
}

.summary-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #64748b;
}

.summary-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

/* ---------- Course grid ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.3rem;
}

/* Base card style */
.course-card {
  border-radius: 18px;
  padding: 1.2rem 1.3rem 1.1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.course-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  transition: opacity 0.2s ease;
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
  border-color: rgba(59, 130, 246, 0.6);
}

.course-card:hover::before {
  opacity: 0.06;
}

/* Course-specific accent gradients */
.course-cs110::before {
  background: radial-gradient(circle at top left, #60a5fa, transparent 55%),
              radial-gradient(circle at bottom right, #22c55e, transparent 55%);
}
.course-cs111::before {
  background: radial-gradient(circle at top left, #a855f7, transparent 55%),
              radial-gradient(circle at bottom right, #38bdf8, transparent 55%);
}
.course-ee221::before {
  background: radial-gradient(circle at top left, #f97316, transparent 55%),
              radial-gradient(circle at bottom right, #facc15, transparent 55%);
}
.course-cpe313::before {
  background: radial-gradient(circle at top left, #0ea5e9, transparent 55%),
              radial-gradient(circle at bottom right, #4ade80, transparent 55%);
}

/* ---------- Course header ---------- */
.course-card-header {
  position: relative;
  z-index: 1;
  cursor: pointer; /* makes it feel interactive */
}

.course-tag-row {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin-bottom: 0.3rem;
}

.course-code {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #0f172a;
}

.course-pillar {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1d4ed8;
}

.course-blurb {
  margin: 0.2rem 0 0.45rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.course-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.meta-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

/* ---------- Course body & details ---------- */
.course-body {
  position: relative;
  z-index: 1;
  border-top: 1px dashed #e5e7eb;
  padding-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.course-body details {
  background: rgba(248, 250, 252, 0.9);
  border-radius: 12px;
  padding: 0.4rem 0.6rem 0.55rem;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.course-body details[open] {
  border-color: #d1d5db;
  background: #ffffff;
}

.course-body summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #111827;
}

.course-body summary::-webkit-details-marker {
  display: none;
}

.course-body summary::before {
  content: "▸";
  margin-right: 0.25rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.course-body details[open] summary::before {
  content: "▾";
}

.summary-pill-sem {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
}

.course-body ul {
  margin: 0.35rem 0 0 1.15rem;
  padding: 0;
  font-size: 0.85rem;
  color: #4b5563;
}

/* ---------- Updates section ---------- */
.page-updates {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed #e5e7eb;
}

.page-updates h2 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.page-updates p {
  margin: 0;
  font-size: 0.9rem;
  color: #4b5563;
}

/* ---------- Dark mode tweaks ---------- */
.dark .teaching-page .page-header {
  background: linear-gradient(135deg, #020617, #0f172a);
  border-color: #1d4ed8;
}

.dark .teaching-page .page-header p {
  color: #e5e7eb;
}

.dark .summary-pill {
  background: #020617;
  border-color: #1f2937;
}

.dark .summary-label {
  color: #9ca3af;
}

.dark .summary-value {
  color: #f9fafb;
}

.dark .course-card {
  background: #020617;
  border-color: #111827;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.dark .course-code {
  color: #e5e7eb;
}

.dark .course-pillar {
  color: #93c5fd;
}

.dark .course-blurb,
.dark .page-updates p {
  color: #9ca3af;
}

.dark .meta-chip {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.5);
  color: #bfdbfe;
}

.dark .course-body {
  border-top-color: #1f2937;
}

.dark .course-body details {
  background: #020617;
}

.dark .course-body details[open] {
  background: #020617;
  border-color: #1f2937;
}

.dark .course-body summary {
  color: #e5e7eb;
}

.dark .summary-pill-sem {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

.dark .course-body ul {
  color: #9ca3af;
}

/* ---------- Experience header ---------- */
.experience-page .page-header {
  margin-bottom: 1.75rem;
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #dcfce7, #e0f2fe);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.experience-page .page-header h1 {
  margin: 0 0 0.35rem;
}

.experience-page .page-header p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- Summary row (reuse style similar to teaching) ---------- */
.experience-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 1.75rem;
}

/* summary-pill, summary-label, summary-value were already defined for teaching;
   reuse them here. If you don't have them yet, copy from your teaching.css block. */

/* ---------- Experience grid ---------- */
.experience-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 1.4rem;
}

@media (max-width: 900px) {
  .experience-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Base experience card */
.exp-card {
  position: relative;
  border-radius: 18px;
  padding: 1.25rem 1.3rem 1.15rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.exp-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Accent gradients for industry vs academic */
.exp-industry::before {
  background: radial-gradient(circle at top left, #22c55e, transparent 55%),
              radial-gradient(circle at bottom right, #0ea5e9, transparent 55%);
}
.exp-academic::before {
  background: radial-gradient(circle at top left, #6366f1, transparent 55%),
              radial-gradient(circle at bottom right, #f97316, transparent 55%);
}

.exp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
  border-color: rgba(59, 130, 246, 0.6);
}

.exp-card:hover::before {
  opacity: 0.09;
}

/* ---------- Card header ---------- */
.exp-card-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.exp-title-block h2 {
  margin: 0;
  font-size: 1.05rem;
}

.exp-org {
  margin: 0;
  font-size: 0.88rem;
  color: #4b5563;
}

.exp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.exp-chip {
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

/* ---------- Timeline strip ---------- */
.exp-timeline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(129, 140, 248, 0.12), rgba(52, 211, 153, 0.12));
}

.exp-timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

.exp-timeline-text {
  font-size: 0.8rem;
  color: #1f2937;
}

/* ---------- Body ---------- */
.exp-body {
  position: relative;
  z-index: 1;
  border-top: 1px dashed #e5e7eb;
  padding-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.exp-role-label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: #111827;
}

/* details/summary */
.exp-body details {
  background: rgba(248, 250, 252, 0.9);
  border-radius: 12px;
  padding: 0.45rem 0.6rem 0.55rem;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.exp-body details[open] {
  border-color: #d1d5db;
  background: #ffffff;
}

.exp-body summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #111827;
}

.exp-body summary::-webkit-details-marker {
  display: none;
}

.exp-body summary::before {
  content: "▸";
  margin-right: 0.25rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.exp-body details[open] summary::before {
  content: "▾";
}

.exp-body ul {
  margin: 0.4rem 0 0 1.15rem;
  padding: 0;
  font-size: 0.86rem;
  color: #4b5563;
}

.exp-role-dates {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Links row */
.exp-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.exp-link {
  font-size: 0.82rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid #1d4ed8;
  color: #1d4ed8;
  background: #eff6ff;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.exp-link:hover {
  background: #1d4ed8;
  color: #f9fafb;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

.exp-link.secondary {
  border-color: #9ca3af;
  color: #374151;
  background: #f9fafb;
}

.exp-link.secondary:hover {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

/* ---------- Dark mode tweaks ---------- */
.dark .experience-page .page-header {
  background: linear-gradient(135deg, #022c22, #020617);
  border-color: #22c55e;
}

.dark .experience-page .page-header p {
  color: #e5e7eb;
}

.dark .experience-summary .summary-pill {
  background: #020617;
  border-color: #1f2937;
}

.dark .exp-card {
  background: #020617;
  border-color: #111827;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
}

.dark .exp-org,
.dark .exp-body ul,
.dark .exp-role-dates,
.dark .exp-timeline-text {
  color: #9ca3af;
}

.dark .exp-chip {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.5);
  color: #bfdbfe;
}

.dark .exp-timeline {
  background: linear-gradient(90deg, rgba(129, 140, 248, 0.25), rgba(52, 211, 153, 0.3));
}

.dark .exp-body {
  border-top-color: #1f2937;
}

.dark .exp-body details {
  background: #020617;
}

.dark .exp-body details[open] {
  background: #020617;
  border-color: #1f2937;
}

.dark .exp-body summary {
  color: #e5e7eb;
}

.dark .exp-link.secondary {
  background: #020617;
  border-color: #374151;
  color: #e5e7eb;
}

.dark .exp-link.secondary:hover {
  background: #f9fafb;
  color: #020617;
}
