/* =====================================================================
   STYLES
   Change the look of the whole site here.
   The main color comes from "themeColor" in data.js.
   ===================================================================== */

:root {
  --theme: #1d4ed8;       /* overwritten by themeColor in data.js */
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --radius: 10px;
  --font: "Segoe UI", Tahoma, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

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

a { color: var(--theme); }

/* ---------- Top menu bar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--theme);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-inline-start: auto;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active { color: #fff; background: rgba(255, 255, 255, 0.18); }

.nav-links a.external { border: 1px solid rgba(255, 255, 255, 0.5); }

.menu-toggle {
  display: none;
  margin-inline-start: auto;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

/* ---------- Page layout ---------- */
.container {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 20px 28px;
  margin-bottom: 24px;
}

/* Title box: theme-colored banner with a small neural network drawing */
.hero {
  padding: 36px 28px;
  padding-inline-end: 240px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 160'%3E%3Cpath d='M30 40L110 25M30 40L110 62M30 40L110 98M30 40L110 135M30 80L110 25M30 80L110 62M30 80L110 98M30 80L110 135M30 120L110 25M30 120L110 62M30 120L110 98M30 120L110 135M110 25L190 60M110 25L190 100M110 62L190 60M110 62L190 100M110 98L190 60M110 98L190 100M110 135L190 60M110 135L190 100' stroke='white' stroke-opacity='.35' stroke-width='1.5' fill='none'/%3E%3Cg fill='white' fill-opacity='.85'%3E%3Ccircle cx='30' cy='40' r='7'/%3E%3Ccircle cx='30' cy='80' r='7'/%3E%3Ccircle cx='30' cy='120' r='7'/%3E%3Ccircle cx='110' cy='25' r='7'/%3E%3Ccircle cx='110' cy='62' r='7'/%3E%3Ccircle cx='110' cy='98' r='7'/%3E%3Ccircle cx='110' cy='135' r='7'/%3E%3Ccircle cx='190' cy='60' r='7'/%3E%3Ccircle cx='190' cy='100' r='7'/%3E%3C/g%3E%3C/svg%3E")
      no-repeat right 28px center / 190px auto,
    linear-gradient(120deg, var(--theme), color-mix(in srgb, var(--theme) 55%, #000));
}

.hero h1 { margin: 0; color: #fff; font-size: 2.2rem; line-height: 1.3; }
.hero p  { margin: 8px 0 0; color: rgba(255, 255, 255, 0.85); }

.section h2 {
  margin: 0 0 14px;
  padding-bottom: 8px;
  color: var(--theme);
  border-bottom: 2px solid var(--border);
}

.section h3 { margin: 18px 0 10px; color: var(--text); }

/* Long lists split into two columns:  <ol class="two-col"> */
.two-col { columns: 2; column-gap: 40px; }
.two-col li { break-inside: avoid; }

/* Small labels:  <div class="tags"><span>PyTorch</span>...</div> */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.tags span {
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--theme);
  background: color-mix(in srgb, var(--theme) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--theme) 25%, #fff);
}

/* ---------- type: people ---------- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.person {
  text-align: center;
  padding: 16px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.person img,
.person .initials {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 25%;   /* portrait photos: keep the face in view */
  margin-bottom: 8px;
}

.person .initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--theme);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 600;
  opacity: 0.85;
}

.person .name  { font-weight: 600; }
.person .name a { color: inherit; }
.person .role,
.person .email { font-size: 0.85rem; color: var(--muted); word-break: break-all; }

/* ---------- type: cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.box {
  padding: 14px 18px;
  background: var(--bg);
  border-radius: var(--radius);
  border-inline-start: 4px solid var(--theme);
}

.box h3 { margin: 0 0 6px; }
.box ul { margin: 0; padding-inline-start: 20px; }

/* ---------- type: table ---------- */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 10px 14px;
  text-align: start;
  border-bottom: 1px solid var(--border);
}

th { background: var(--theme); color: #fff; font-weight: 600; }
tbody tr:nth-child(even) { background: #f9fafb; }
tbody tr:hover { background: #eef2ff; }

.empty { color: var(--muted); font-style: italic; text-align: center; }

/* ---------- Footer & back-to-top ---------- */
.footer { text-align: center; color: var(--muted); padding: 24px 16px 40px; font-size: 0.9rem; }

.to-top {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--theme);
  color: #fff;
  text-decoration: none;
  font-size: 1.3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.to-top.show { display: flex; }

/* ---------- Medium screens: tighter menu so it stays on one line ---------- */
@media (max-width: 1100px) {
  .nav-links a { padding: 6px 8px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .navbar { flex-wrap: wrap; padding: 12px 16px; }
  .nav-links { display: none; width: 100%; flex-direction: column; margin: 0; }
  .nav-links.open { display: flex; }
  .card { padding: 16px; }
  .hero { padding: 28px 16px; padding-inline-end: 16px; background-size: 0 0, auto; }
  .hero h1 { font-size: 1.6rem; }
  .two-col { columns: 1; }
}
