/* ===== CSS Custom Properties - Light Theme ===== */
:root {
  --color-bg: #ffffff;
  --color-bg-elevated: #f5f5f5;
  --color-text: #1a1a1a;
  --color-text-muted: #666666;
  --color-accent: #dc2626;
  --color-accent-hover: #b91c1c;
  --color-border: #e0e0e0;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  --max-width: 900px;
  --spacing: 1.5rem;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

/* ===== Layout ===== */
header, main, footer {
  padding: var(--spacing);
  max-width: var(--max-width);
  margin: 0 auto;
}

main {
  min-height: calc(100vh - 200px);
}

/* ===== Navigation (Mobile First) ===== */
nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

nav .site-title {
  text-decoration: none;
  display: flex;
  align-items: center;
}

nav .logo {
  height: 40px;
  width: auto;
  transition: opacity 0.2s;
}

nav .site-title:hover .logo {
  opacity: 0.8;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color 0.2s;
}

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

/* Desktop navigation */
@media (min-width: 600px) {
  nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ===== Typography ===== */
h1, h2, h3 {
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 1.75rem + 1.25vw, 2.75rem);
  margin-top: 0;
}

h2 {
  font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem);
}

h3 {
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
}

p {
  margin: 0 0 1rem;
}

/* ===== Links ===== */
a {
  color: var(--color-accent);
  transition: color 0.2s;
}

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

/* ===== Images ===== */
img {
  max-width: 100%;
  height: auto;
}

/* ===== Code ===== */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-elevated);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--color-bg-elevated);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* ===== Cards ===== */
.card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  margin-top: 0;
}

/* ===== Team Grid ===== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.member-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

.member-card img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 3px solid var(--color-border);
}

.member-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.member-card .role {
  color: var(--color-accent);
  font-size: 0.9em;
  margin-bottom: 0.5rem;
}

.member-card .links {
  font-size: 0.85em;
}

.member-card .links a {
  margin: 0 0.5rem;
}

.member-card-cta {
  border-style: dashed;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.2s, background 0.2s;
}

.member-card-cta:hover {
  border-color: var(--color-accent);
  background: rgba(220, 38, 38, 0.05);
}

/* ===== Publications ===== */
.publications {
  list-style: none;
  padding: 0;
}

.publications li {
  margin-bottom: 1.5rem;
  padding-left: 0;
}

.publications a {
  font-size: 0.9em;
}

.year-group {
  margin-top: 2rem;
}

.year-group h3 {
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
}

/* ===== News List ===== */
.news-list {
  list-style: none;
  padding: 0;
}

.news-list li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

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

.news-date {
  color: var(--color-text-muted);
  font-size: 0.9em;
}

/* ===== Research List ===== */
.research-list {
  margin-top: 1.5rem;
}

.research-item {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.research-item .research-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.research-item .research-intro p {
  margin-bottom: 0.75rem;
}

.research-details summary {
  cursor: pointer;
  color: var(--color-accent);
  font-weight: 500;
  list-style: none;
  display: inline-block;
}

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

.research-details summary:hover {
  color: var(--color-accent-hover);
}

.research-details[open] summary {
  margin-bottom: 1rem;
}

.research-details .research-content {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.research-details .research-content h2 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

.research-details .research-content h3 {
  font-size: 1rem;
  margin-top: 1.25rem;
}

/* ===== Status Badges ===== */
.status {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.8em;
  border-radius: 3px;
  font-weight: 500;
}

.status-active {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.status-completed {
  background: rgba(100, 100, 100, 0.1);
  color: #666666;
}

.status-hiring {
  background: rgba(220, 38, 38, 0.15);
  color: #b91c1c;
  border: 1px solid var(--color-accent);
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95em;
}

th, td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  background: var(--color-bg-elevated);
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ===== Syntax Highlighting (Light) ===== */
code[class*="language-"],
pre[class*="language-"] {
  color: var(--color-text);
  background: var(--color-bg-elevated);
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6a737d;
}

.token.punctuation {
  color: #1a1a1a;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #dc2626;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #16a34a;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #1a1a1a;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #c026d3;
}

.token.function,
.token.class-name {
  color: #2563eb;
}

.token.regex,
.token.important,
.token.variable {
  color: #d97706;
}

/* ===== Project Accordion ===== */
.projects-list {
  margin-top: 1.5rem;
}

.project-accordion {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.project-accordion summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  list-style: none;
}

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

.project-accordion summary::before {
  content: "▸";
  color: var(--color-text-muted);
  transition: transform 0.2s;
}

.project-accordion[open] summary::before {
  transform: rotate(90deg);
}

.project-accordion .project-title {
  font-weight: 600;
  flex: 1;
}

.project-accordion .project-id {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--color-text-muted);
  font-weight: 500;
}

.project-accordion .project-content {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--color-border);
  margin-top: 0.5rem;
}

.project-accordion .project-content h2 {
  font-size: 1.1rem;
  margin-top: 1.25rem;
}

/* Course badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75em;
  border-radius: 3px;
  font-weight: 500;
}

.badge-cs390 {
  background: rgba(37, 99, 235, 0.15);
  color: #2563eb;
}

.badge-cs490 {
  background: rgba(124, 58, 237, 0.15);
  color: #7c3aed;
}

/* Apply button */
.project-apply {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.btn-apply {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-apply:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

/* ===== Utilities ===== */
.muted {
  color: var(--color-text-muted);
}

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

.text-center {
  text-align: center;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--color-bg);
  border-radius: 8px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-body {
  padding: 1.25rem;
}

.modal-field {
  margin-bottom: 1rem;
}

.modal-field:last-child {
  margin-bottom: 0;
}

.modal-field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: var(--color-text-muted);
}

.modal-field-value {
  background: var(--color-bg-elevated);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  word-break: break-all;
}

.modal-field-value.body {
  white-space: pre-line;
  font-family: var(--font-sans);
}

.copy-btn {
  display: inline-block;
  margin-top: 0.5rem;
  background: var(--color-border);
  color: var(--color-text);
  padding: 0.25rem 0.5rem;
  border: none;
  border-radius: 3px;
  font-size: 0.8rem;
  cursor: pointer;
}

.copy-btn:hover {
  background: #d0d0d0;
}

.copy-btn.copied {
  background: #22c55e;
  color: #fff;
}
