:root {
  --bg: #0b0c0f;
  --fg: #e9eef5;
  --muted: #a9b2c0;
  --accent: #8ec5ff;
  --card: #151821;
  --border: #262b36;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --fg: #0b1220;
    --muted: #516078;
    --accent: #0a84ff;
    --card: #f4f7fb;
    --border: #dbe2ef;
  }
}

/*
 * Support explicit light/dark modes via the data-theme attribute on <html>.
 * The default (no data-theme attribute or "auto") will defer to system preferences.
 */
:root[data-theme="light"] {
  --bg: #ffffff;
  --fg: #0b1220;
  --muted: #516078;
  --accent: #0a84ff;
  --card: #f4f7fb;
  --border: #dbe2ef;
}

:root[data-theme="dark"] {
  --bg: #0b0c0f;
  --fg: #e9eef5;
  --muted: #a9b2c0;
  --accent: #8ec5ff;
  --card: #151821;
  --border: #262b36;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.site {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
}

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

.site__header, .site__footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0; gap: 1rem; border-bottom: 1px solid var(--border);
}
.site__footer { border-top: 1px solid var(--border); border-bottom: 0; margin-top: 3rem; padding: 2rem 0; }

.brand { font-weight: 800; text-decoration: none; color: var(--fg); font-size: 1.15rem; letter-spacing: .3px; }
.brand__dot { color: var(--accent); }

.nav { display: flex; gap: .75rem; align-items: center; }
.nav__link { color: var(--muted); text-decoration: none; padding: .25rem .5rem; border-radius: .5rem; }
.nav__link:hover, .nav__link.is-active { color: var(--fg); background: color-mix(in oklab, var(--accent) 17%, transparent); }

.button {
  border: 1px solid var(--border); background: var(--card);
  color: var(--fg); padding: .6rem .9rem; border-radius: .8rem; cursor: pointer;
}
.button--secondary { background: transparent; }
.button--ghost { background: transparent; border: 0; padding: .25rem .5rem; }

.hero {
  display: grid; grid-template-columns: 120px 1fr; gap: 1.25rem; align-items: center; margin: 2rem 0 1rem;
}
.hero__avatar { width: 120px; height: 120px; border-radius: 50%; border: 2px solid var(--border); object-fit: cover; }
.lead { color: var(--muted); max-width: 60ch; }
.cta { display: flex; gap: .75rem; margin-top: .75rem; }

.section { margin-top: 2rem; }

.tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tag {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  padding: .35rem .7rem; border-radius: 999px; cursor: pointer;
}
.tag.is-active { color: var(--fg); border-color: var(--accent); }

.grid.projects {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card { border: 1px solid var(--border); background: var(--card); border-radius: 1rem; padding: 1rem; }
.card__link { color: inherit; text-decoration: none; display: block; height: 100%; }
.card__title { margin: 0 0 .25rem; }
.card__desc { margin: 0; color: var(--muted); }
.accent { color: var(--accent); }

/* Utility */
.muted { color: var(--muted); }

/* ===========================
   Resume page styles
   =========================== */

.resume__toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 1rem 0;
}

.resume__header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 2rem;
  align-items: start;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
}

.resume__contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.resume__contact a { text-decoration: none; color: var(--fg); }
.resume__contact a:hover { text-decoration: underline; }

.resume__section { margin-top: 2rem; }
.resume__section > h2 {
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

/* Subheadings for Graduate/Undergraduate */
.resume__subheading {
  margin-top: 1.25rem;
  font-size: 1.05rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.resume__item { margin-top: 1rem; }

 /* Use flex layout in resume headers to align logos and text */
 .resume__itemHead {
   display: flex;
   gap: 0.75rem;
   align-items: flex-start;
 }

 /* Logo styling for organization/company images in resume */
 .resume__logo {
   width: 36px;
   height: 36px;
   object-fit: contain;
   flex-shrink: 0;
   border-radius: 0.25rem;
 }

.resume__role { margin: 0; }

.resume__meta {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--muted);
}
.resume__org, .resume__location { font-weight: 500; }

.resume__bullets { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.resume__bullets li { margin: 0.25rem 0; }

.chips {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.chip {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* Link accent inside resume content */
.resume__link {
  color: var(--accent);
  text-decoration: none;
}
.resume__link:hover { text-decoration: underline; }

/*
 * Project card expansion styles
 * The .project-card class is applied to project cards on the projects page. Clicking a card toggles the .expanded class.
 */
.project-card {
  cursor: pointer;
}

.project-card .project-details {
  display: none;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.project-card.expanded .project-details {
  display: block;
}

/* When a project card is expanded, make it span the full width of the grid. This provides more
   space for additional information and a photo to comfortably fit inside each project. */
.project-card.expanded {
  grid-column: 1 / -1;
}

/* Project images inside the expanded details. Each project can include a single photo with this
   class. The image scales to the width of its container and preserves its aspect ratio. */
.project-image {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
}

/* Small screens */
@media (max-width: 720px) {
  .resume__header { grid-template-columns: 1fr; }
  .resume__contact { justify-content: flex-start; }
}

/* Print-friendly */
@media print {
  .site__header, .site__footer, #theme-toggle, .resume__toolbar { display: none; }
  body { background: #ffffff; color: #000000; }
  .resume__header, .resume__section { break-inside: avoid; page-break-inside: avoid; }
}
