:root {
  --accent: #1f3a5f;
  --accent-dark: #14263f;
  --accent-rgb: 31, 58, 95;
  --btn: #1f3a5f;
  --btn-hover: #14263f;
  --bg: #faf9f6;
  --page: #fdfbf6;
  --surface: #fff;
  --surface-2: #eee;
  --text: #333;
  --text-2: #444;
  --text-3: #555;
  --text-4: #666;
  --muted: #777;
  --muted-2: #888;
  --line-rgb: 0, 0, 0;
  color-scheme: light;
  --heading-font: 'Lora', Georgia, 'Times New Roman', serif;
  --body-font: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

/* Dark theme: same layout, colors swapped through the variables above */
html[data-theme="dark"] {
  --accent: #8fb4e3;
  --accent-dark: #b7cff0;
  --accent-rgb: 143, 180, 227;
  --btn: #2e5487;
  --btn-hover: #3b679f;
  --bg: #15181d;
  --page: #1c2027;
  --surface: #232833;
  --surface-2: #2a303b;
  --text: #e2e4e8;
  --text-2: #d3d6dc;
  --text-3: #bcc1c9;
  --text-4: #a9afb8;
  --muted: #959ba5;
  --muted-2: #a0a6b0;
  --line-rgb: 255, 255, 255;
  color-scheme: dark;
}


* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--body-font);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
}

main {
  padding: 2rem;
  max-width: 800px;
  margin: auto;
}

.about {
  max-width: 700px;
  padding-top: 18px;
  margin-bottom: 2rem;
}
.about-name {
  font-family: var(--heading-font);
  color: var(--accent-dark);
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
}
.about-role {
  font-size: 1.05rem;
  color: var(--text-3);
  margin-bottom: 18px;
}
.about-fields {
  font-size: 0.95rem;
  color: var(--text-3);
  margin: -10px 0 18px 0;
}
.about-fields span {
  font-weight: 600;
  color: var(--text-2);
}
.about-market {
  display: inline-block;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 14px;
  border-radius: 6px;
  margin-bottom: 22px;
}
.about-bio {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 16px;
}
.about-jmp {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 26px;
}
.about-jmp-label {
  font-weight: 600;
  color: var(--text-2);
}
.about-jmp a {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.35);
}
.about-jmp a:hover {
  border-bottom-color: var(--accent);
}
.about-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 26px;
}
.cv-button {
  display: inline-block;
  padding: 10px 26px;
  background: var(--btn);
  color: white;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
  transition: background-color 0.2s ease;
}
.cv-button:hover {
  background: var(--btn-hover);
}
.about-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.about-links a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.about-links a:hover {
  text-decoration: underline;
}

.research-section {
  max-width: 1150px;
  margin: 0 auto 24px auto;
  padding: 26px 40px;
  background: rgba(var(--accent-rgb), 0.045);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
}
.research-tag {
  display: inline-block;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.14);
  padding: 4px 10px;
  border-radius: 5px;
  margin-bottom: 12px;
}
.research-tag.secondary {
  color: var(--text-4);
  background: rgba(var(--line-rgb), 0.06);
}
.research-title {
  font-family: var(--heading-font);
  color: var(--accent-dark);
  font-size: 1.18em;
  line-height: 1.35;
  margin-bottom: 14px;
  background: rgba(var(--accent-rgb), 0.1);
  padding: 14px 18px;
  border-radius: 6px;
}
.research-authors {
  font-size: 0.85rem;
  color: var(--text-4);
  font-style: italic;
  margin-bottom: 16px;
}
.research-abstract {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  text-align: left;
  max-width: 780px;
  margin: 0 auto 16px auto;
}
.research-status {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--muted);
}

.bandit-demo {
  margin-top: 4px;
  margin-bottom: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid rgba(var(--line-rgb), 0.06);
}
.bandit-demo-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-dark);
  margin-bottom: 6px;
}
.bandit-reduced {
  font-weight: 400;
  font-style: italic;
  color: var(--muted-2);
  font-size: 0.78rem;
}
.bandit-problem-banner {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.1);
  display: block;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 5px;
  margin: 0 auto 10px auto;
}
.bandit-round-title {
  text-align: center;
  font-weight: 700;
  color: var(--accent-dark);
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.bandit-instruction {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 16px;
}
.jar-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 40px;
  margin-bottom: 16px;
}
.jar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.cylinder-button {
  --r: 24px;
  width: 108px;
  height: 144px;
  position: relative;
  overflow: visible;
  background:
    radial-gradient(50% var(--r) at 50% var(--r), #0003 99.99%, #0000 0),
    radial-gradient(50% var(--r) at 50% calc(100% - var(--r)), #fff3 99.99%, #0000 0),
    #a9a9a9;
  border-radius: 100% / calc(var(--r) * 2);
  border: 1px solid #000;
  cursor: pointer;
  margin-bottom: 10px;
}
.cylinder-button:hover {
  background-color: gray;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}
.cylinder-button.pressed {
  box-shadow: none;
  transform: translateY(3px);
}
.cylinder-button:disabled {
  cursor: default;
  opacity: 0.9;
}
.jar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  font-weight: bold;
  font-family: "Courier New", Courier, monospace;
  color: white;
  text-align: center;
  z-index: 1;
}
.ball {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid #000;
  display: none;
  z-index: 2;
}
@keyframes ballRise {
  from {
    top: 65%;
    opacity: 0;
    background: #a9a9a9;
  }
  to {
    top: -30px;
    opacity: 1;
  }
}
.ball.animate {
  display: block;
  animation: ballRise 0.45s ease-out forwards;
}
.prior-label {
  font-size: 0.72rem;
  color: var(--text-3);
  text-align: center;
  max-width: 130px;
  line-height: 1.4;
}
.bandit-message {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-2);
  min-height: 20px;
  margin-bottom: 14px;
}
.bandit-score-wrap {
  text-align: center;
  margin-bottom: 12px;
}
.bandit-score-box {
  display: inline-block;
  border: 2px solid var(--accent-dark);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text);
}
.bandit-caption {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
}

footer {
  text-align: center;
  padding: 1rem;
  background: var(--surface-2);
  margin-top: 2rem;
}

.tabs {
  margin: 2rem;
}

.tab-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 1rem;
}

.tab-link {
  padding: 10px 20px;
  cursor: pointer;
  border: none;
  background-color: var(--surface-2);
  border-radius: 5px;
  font-family: var(--body-font);
  letter-spacing: 0.3px;
  transition: background-color 0.3s ease;
}

.tab-link.active {
  background-color: var(--btn-hover);
  color: white;
}

/* Persistent left sidebar with headshot (shown on About and Research) */
.page-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}
.sidebar {
  flex: 0 0 230px;
  position: sticky;
  top: 24px;
}
.headshot {
  display: block;
  width: 230px;
  height: 230px;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}
.tab-panels {
  flex: 1;
  min-width: 0;
}
.page-layout.no-sidebar .sidebar {
  display: none;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Teaching tab layout — book-styled frame with two "pages" */
.teaching-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  flex-wrap: wrap;
  min-height: 70vh;
  margin: 20px;
  position: relative;
  background: var(--page);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.teaching-container::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 26px;
  margin-left: -13px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(0, 0, 0, 0.07) 45%,
    rgba(0, 0, 0, 0.11) 50%,
    rgba(0, 0, 0, 0.07) 55%,
    transparent
  );
  pointer-events: none;
}

.teaching-left,
.teaching-right {
  flex: 1;
  min-width: 280px;
  max-width: 600px;
  padding: 30px 34px;
  box-sizing: border-box;
  position: relative;
}

.teaching-left {
  box-shadow: inset -10px 0 14px -12px rgba(0, 0, 0, 0.12);
}
.teaching-right {
  box-shadow: inset 10px 0 14px -12px rgba(0, 0, 0, 0.12);
}

/* Evaluation stats for the shorter column */
.stat-filler {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px dashed rgba(var(--accent-rgb), 0.3);
}
.eval-heading {
  font-family: var(--heading-font);
  color: var(--accent-dark);
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.eval-heading:not(:first-child) {
  margin-top: 18px;
}
.eval-rate {
  font-family: var(--body-font);
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--text-4);
}
.eval-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.66rem;
  margin-bottom: 8px;
}
.eval-table th,
.eval-table td {
  padding: 4px 5px;
  text-align: left;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.08);
  vertical-align: top;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: break-word;
}
.eval-table th {
  color: var(--accent-dark);
  font-weight: 700;
  background: rgba(var(--accent-rgb), 0.06);
}
.eval-note {
  font-size: 0.6rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.35;
}
.eval-list {
  list-style: none;
  font-size: 0.7rem;
  line-height: 1.55;
}
.eval-list strong {
  color: var(--accent);
}
.eval-lead {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0 8px 0;
}
.eval-lead-number {
  font-family: var(--heading-font);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}
.eval-lead-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-2);
}

/* Section headings */
.teaching-section {
  margin-bottom: 40px;
}
.teaching-section h2 {
  font-family: var(--heading-font);
  color: var(--accent-dark);
  font-size: 1.5em;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 5px;
}

/* List styling */
.teaching-section ul {
  list-style-type: none;
  padding: 0;
}
.teaching-section li {
  margin: 5px 0;
}

/* Links */
.teaching-section a {
  color: var(--accent);
  text-decoration: none;
}
.teaching-section a:hover {
  text-decoration: underline;
}

/* Buttons */
.button-container {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.dropdown-btn {
  padding: 9px 16px;
  border: none;
  background-color: var(--btn);
  color: white;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9em;
  font-family: var(--body-font);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
  transition: background-color 0.2s ease;
}
.dropdown-btn:hover {
  background-color: var(--btn-hover);
}
.dropdown-btn.open {
  background-color: var(--btn-hover);
}
.dropdown-btn .chevron {
  display: inline-block;
  font-size: 0.7em;
  transition: transform 0.25s ease;
}
.dropdown-btn.open .chevron {
  transform: rotate(180deg);
}

/* Dropdown list (glow-up) */
.dropdown-list {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid rgba(var(--line-rgb), 0.06);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
  list-style-type: none;
  transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
}
.dropdown-list.open {
  max-height: 900px;
  opacity: 1;
  padding: 6px 0;
}
.dropdown-list li {
  margin: 0;
  padding: 10px 18px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.055);
  transition: background 0.15s ease;
}
.dropdown-list li:last-child {
  border-bottom: none;
}
.dropdown-list li:hover {
  background: rgba(var(--accent-rgb), 0.045);
}
.course-code {
  flex: 0 0 auto;
  min-width: 80px;
  text-align: center;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.3px;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.09);
  padding: 4px 8px;
  border-radius: 6px;
}
.course-detail {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-2);
}
.course-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Right half */
.teaching-right h2 {
  font-family: var(--heading-font);
  color: var(--accent-dark);
  font-size: 1.6em;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 5px;
}
.assessment-subsection {
  margin-bottom: 25px;
}
.assessment-subsection h3 {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 1.2em;
  font-family: var(--heading-font);
}
.assessment-subsection p {
  margin: 8px 0;
}
/* Links inside sentences are underlined so they read as clickable */
.assessment-subsection p a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Student quote grid */
.highlight-quotes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0 22px 0;
}
.highlight-quote {
  background: rgba(var(--accent-rgb), 0.06);
  border-radius: 8px;
  padding: 10px 14px;
}
.highlight-quote .quote-tag {
  display: inline-block;
  font-style: normal;
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.12);
  padding: 2px 7px;
  border-radius: 5px;
  margin-bottom: 5px;
}
.highlight-quote p {
  font-style: italic;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text);
  margin: 0;
}

/* Experience: Instructor and IA blocks */
.exp-block {
  margin-top: 26px;
}
.exp-heading {
  font-family: var(--heading-font);
  color: var(--accent);
  font-size: 1.25em;
  margin-bottom: 10px;
}
.exp-subheading {
  font-family: var(--heading-font);
  color: var(--accent-dark);
  font-size: 0.88rem;
  margin: 14px 0 6px 0;
}
.course-list {
  list-style: none;
  padding: 2px 0;
  margin: 0 0 12px 0;
  background: var(--surface);
  border: 1px solid rgba(var(--line-rgb), 0.06);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}
/* One flowing line per course: code, name, then dates; wraps under the code */
.teaching-section .course-list li {
  margin: 0;
  padding: 6px 14px;
  line-height: 1.55;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.055);
}
.teaching-section .course-list li:last-child {
  border-bottom: none;
}
.course-list .course-code {
  display: inline-block;
  min-width: 0;
  margin-right: 8px;
  padding: 1px 7px;
  font-size: 0.72rem;
}
.course-list .course-detail {
  font-size: 0.86rem;
}
.course-list .course-meta {
  display: inline;
  margin: 0;
}
.course-list .course-meta::before {
  content: " \00B7  ";
}
.course-highlight {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
}
.table-note {
  font-size: 0.68rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
  margin: 2px 0 8px 0;
}
.ia-group {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(var(--accent-rgb), 0.3);
}
.ia-group-title {
  font-family: var(--heading-font);
  color: var(--accent-dark);
  font-size: 1.02rem;
  margin-bottom: 10px;
}
.evals-link {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 6px;
}

/* -----------------------
   Responsive adjustments
------------------------ */
@media (max-width: 900px) {
  .page-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }
  .sidebar {
    position: static;
    flex: none;
    align-self: center;
  }
  .headshot {
    width: 155px;
    height: 155px;
  }
  .about {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    padding-top: 0;
  }
  .about-actions {
    justify-content: center;
  }
  .about-links {
    justify-content: center;
  }
  .teaching-container {
    flex-direction: column;
    align-items: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
  }

  .teaching-container::before {
    display: none;
  }

  .teaching-left,
  .teaching-right {
    width: 100%;
    max-width: 100%;
    padding: 20px;
    box-shadow: none;
  }

  .teaching-right {
    border-top: 1px dashed rgba(var(--accent-rgb), 0.25);
    margin-top: 6px;
  }

  .highlight-quotes {
    grid-template-columns: 1fr;
  }

  .eval-table thead {
    display: none;
  }
  .eval-table,
  .eval-table tbody,
  .eval-table tr,
  .eval-table td {
    display: block;
    width: 100%;
  }
  .eval-table td {
    border-bottom: 1px solid rgba(var(--line-rgb), 0.08);
    padding: 7px 2px;
    font-size: 0.72rem;
  }
  .eval-table td:last-child {
    border-bottom: none;
  }
  .eval-table tr {
    border: 1px solid rgba(var(--line-rgb), 0.08);
    border-radius: 8px;
    padding: 2px 10px;
    margin-bottom: 8px;
    background: var(--surface);
  }
  .eval-table td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--accent-dark);
  }
}


/* Light / dark toggle (left of the About tab) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background-color: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.theme-toggle:hover {
  background-color: rgba(var(--accent-rgb), 0.18);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
body, .tab-link, footer, .course-list, .dropdown-list, .bandit-demo, .teaching-container {
  transition: background-color 0.25s ease, color 0.25s ease;
}
