:root {
  --fg: #1a1a1a;
  --muted: #5a5a5a;
  --bg: #ffffff;
  --bg-alt: #f4f4f4;
  --accent: #a31f34;       /* MIT cardinal red */
  --accent-dark: #750014;  /* MIT dark red */
  --accent-2: #8a8b8c;     /* MIT gray */
  --border: #d8d8d8;
  --max: 920px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* Hero */
.hero {
  position: relative;
  min-height: 380px;
  background-image: url("img/visual_02.jpg");
  background-size: cover;
  background-position: center 60%;
  color: #fff;
  border-bottom: 4px solid var(--accent);
  overflow: hidden;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.65) 100%);
}
.hero-content {
  position: relative;
  padding: 3rem 1.25rem 3.25rem;
}
.hero-logo {
  width: 180px;
  margin-bottom: 1.25rem;
  background: rgba(255,255,255,0.92);
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
}
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin: 0 0 0.5rem;
}
.hero h1 {
  font-size: 2.4rem;
  line-height: 1.18;
  margin: 0 0 0.85rem;
  max-width: 780px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hero .tagline {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.92);
  margin: 0 0 0.75rem;
  max-width: 720px;
}
.hero .meta {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
  margin: 0;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.nav .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.nav a {
  font-size: 0.95rem;
  color: var(--fg);
}
.nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Sections */
main section {
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 70px;
}
main section:last-child { border-bottom: none; }

h2 {
  font-size: 1.55rem;
  margin: 0 0 1rem;
  letter-spacing: -0.005em;
}
h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
}
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.25rem; }
ul li { margin-bottom: 0.3rem; }

/* Topic image grid (under About) */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 1.25rem 0 0;
}
.topic-grid .topic {
  margin: 0;
}
.topic-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
}
.topic-grid figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
@media (max-width: 600px) {
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Callout */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  border-radius: 0 6px 6px 0;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  background: var(--bg);
}
.card.wide { max-width: none; }
.card h3 { margin-top: 0; }
.card .affil {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.card p:last-child { margin-bottom: 0; }

/* Software cards (clickable) */
a.software-card {
  display: block;
  color: var(--fg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.software-card:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.software-logo {
  height: 56px;
  width: auto;
  margin-bottom: 0.6rem;
}
.card-link {
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Organizer */
.organizer {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.organizer-photo {
  width: 250px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}
.organizer-body h3 { margin-top: 0; }
.organizer-body .affil {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}
.organizer-body p:last-child { margin-bottom: 0; }
@media (max-width: 600px) {
  .organizer { grid-template-columns: 1fr; }
  .organizer-photo { width: 225px; }
}

/* Papers list */
.papers {
  list-style: none;
  padding: 0;
  margin: 0;
}
.papers li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.55;
}
.papers li:last-child { border-bottom: none; }
.papers em { color: var(--fg); }

.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: rgba(163, 31, 52, 0.08);
  border: 1px solid rgba(163, 31, 52, 0.25);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  margin-left: 0.35rem;
  vertical-align: 1px;
  white-space: nowrap;
}

.muted-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

/* Program table */
.program {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.program th, .program td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.program th {
  background: var(--bg-alt);
  font-weight: 600;
}
.program td:first-child {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* Logistics definition list */
.logistics {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.5rem 1.25rem;
  margin: 0 0 1.75rem;
}
.logistics dt {
  font-weight: 600;
  color: var(--fg);
}
.logistics dd {
  margin: 0;
  color: var(--fg);
}
@media (max-width: 600px) {
  .logistics { grid-template-columns: 1fr; gap: 0.1rem 0; }
  .logistics dd { margin-bottom: 0.5rem; }
}

/* Footer */
footer {
  background: var(--bg-alt);
  border-top: 3px solid var(--accent);
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}
footer p { margin: 0 0 0.25rem; }
footer .muted { color: var(--muted); }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.7rem; }
  .hero-content { padding: 2.25rem 1.25rem 2.25rem; }
  .hero-logo { width: 140px; }
}
