/* DORL — Dynamic Optimization & Reinforcement Learning Lab
   University of Toronto, MIE
   Static site — unique design system */

:root {
  --navy: #002a5c;
  --navy-deep: #001635;
  --navy-soft: #0c3c78;
  --accent: #e87722;
  --accent-soft: #f6a13a;
  --ink: #0e1420;
  --muted: #525a6b;
  --line: #d9dde5;
  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --bg-grid: #eef2f8;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 42, 92, 0.05), 0 2px 8px rgba(0, 42, 92, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 42, 92, 0.10);
  --shadow-lg: 0 20px 60px rgba(0, 42, 92, 0.18);
  --font-serif: "Source Serif 4", "Source Serif Pro", "Times New Roman", Georgia, serif;
  --font-sans: "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --maxw: 1200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--navy-soft); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--navy-deep); margin-top: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-weight: 600; }
p { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-text .acronym {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--navy-deep);
  letter-spacing: 0.02em;
}
.brand-text .full {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  position: relative;
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  padding: 4px 0;
}
.site-nav a.current { color: var(--navy-deep); }
.site-nav a.current::after,
.site-nav a:hover::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.uoft-tag {
  font-size: 12px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 14px;
  line-height: 1.25;
}
.uoft-tag strong { color: var(--navy-deep); font-weight: 600; display: block; }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .2s ease; }

@media (max-width: 860px) {
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: #fff; border-bottom: 1px solid var(--line); padding: 16px 24px; gap: 14px; }
  .site-nav.open { display: flex; }
  .menu-btn { display: block; }
  .uoft-tag { display: none; }
}

/* ============ HERO ============ */
.hero {
  position: relative;
  padding: 120px 0 140px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(232,119,34,0.25), transparent 60%),
    radial-gradient(900px 500px at 10% 100%, rgba(12,60,120,0.7), transparent 65%),
    linear-gradient(140deg, var(--navy-deep) 0%, var(--navy) 50%, #003e8a 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black 30%, transparent 80%);
}
.hero-inner { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 600;
  margin-bottom: 24px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.hero h1 {
  color: #fff;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.04;
  max-width: 900px;
  margin: 0 0 24px;
  font-weight: 500;
}
.hero h1 em { color: var(--accent-soft); font-style: normal; }
.hero .lede {
  max-width: 640px;
  font-size: 18px;
  color: rgba(255,255,255,0.82);
  margin-bottom: 36px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #ff8a34; color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.8); }
.btn-dark { background: var(--navy-deep); color: #fff; }
.btn-dark:hover { background: var(--navy); color: #fff; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.hero-stats .stat .n { font-family: var(--font-serif); font-size: 36px; color: #fff; font-weight: 500; }
.hero-stats .stat .l { font-size: 13px; color: rgba(255,255,255,0.65); text-transform: uppercase; letter-spacing: 0.08em; }
@media (max-width: 720px) { .hero-stats { grid-template-columns: repeat(2,1fr); } }

/* ============ SECTION ============ */
section { padding: 88px 0; }
.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}
.section-head .eyebrow { color: var(--accent); }
.section-head h2 {
  font-size: clamp(30px, 4vw, 46px);
  margin: 0 0 16px;
  font-weight: 500;
}
.section-head p { color: var(--muted); font-size: 17px; }

.section-muted { background: var(--bg-soft); }

/* ============ ABOUT / INTRO ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 72px;
  align-items: start;
}
.about-grid p { font-size: 16px; color: var(--ink); }
.about-callout {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.about-callout h4 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-family: var(--font-sans); font-weight: 700; }
.callout-list { list-style: none; margin: 0; padding: 0; }
.callout-list li { padding: 10px 0; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.callout-list li:first-child { border-top: 0; }
.callout-list li span:first-child { color: var(--muted); }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; gap: 40px; } }

/* ============ RESEARCH PILLARS ============ */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .pillar-grid { grid-template-columns: 1fr; } }
.pillar {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 30px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  overflow: hidden;
}
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cfd6e4; }
.pillar::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 48px; height: 3px;
  background: var(--accent);
}
.pillar .num { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 16px; display: block; }
.pillar h3 { font-size: 22px; margin-bottom: 12px; }
.pillar p { font-size: 15px; color: var(--muted); margin: 0; }

/* ============ DOMAINS (APPLICATION AREAS) ============ */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1000px) { .domain-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .domain-grid { grid-template-columns: 1fr; } }
.domain {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  font-weight: 500;
  font-size: 15px;
  color: var(--navy-deep);
  transition: all .18s ease;
  overflow-wrap: anywhere;
}
.domain:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.domain .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.domain .label {
  min-width: 0;
  line-height: 1.3;
  word-break: break-word;
}

/* ============ PEOPLE ============ */
.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 48px 0 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.group-head h3 { font-size: 24px; margin: 0; }
.group-head .count { font-family: var(--font-mono); color: var(--muted); font-size: 13px; }

.people-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 960px) { .people-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .people-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .people-grid { grid-template-columns: 1fr; } }

.person-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex;
  flex-direction: column;
}
.person-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cfd6e4; }
.person-photo {
  aspect-ratio: 1 / 1;
  background: var(--bg-grid);
  overflow: hidden;
  position: relative;
}
.person-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.person-card:hover .person-photo img { transform: scale(1.04); }
.person-body { padding: 18px 20px 20px; }
.person-body h4 { margin: 0 0 4px; font-size: 17px; color: var(--navy-deep); }
.person-body .role { color: var(--muted); font-size: 13px; margin: 0; }
.person-body .links { margin-top: 10px; display: flex; gap: 10px; }
.person-body .links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--navy-soft);
  transition: all .15s ease;
}
.person-body .links a:hover { background: var(--navy-deep); color: #fff; border-color: var(--navy-deep); }

.person-professor {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 220px 1fr;
}
@media (max-width: 700px) { .person-professor { grid-column: span 1; grid-template-columns: 1fr; } }
.person-professor .person-photo { aspect-ratio: 1 / 1; }
.person-professor .person-body { padding: 26px 28px; }
.person-professor .person-body h4 { font-size: 22px; }

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .18s ease;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalUp .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all .15s ease;
}
.modal-close:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.modal-head {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 32px;
  border-bottom: 1px solid var(--line);
}
.modal-head img {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--bg-grid);
}
.modal-head h3 { margin: 0 0 4px; font-size: 24px; }
.modal-head .role { color: var(--muted); margin: 0 0 8px; font-size: 14px; }
.modal-head a { font-size: 13px; }
.modal-body { padding: 28px 32px 32px; }
.modal-body p { font-size: 15.5px; color: var(--ink); line-height: 1.7; white-space: pre-line; }

/* ============ CONTACT / CTA ============ */
.cta-block {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 56px 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  position: relative;
  overflow: hidden;
}
.cta-block::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; width: 40%;
  background: radial-gradient(circle at top right, rgba(232,119,34,0.3), transparent 60%);
  pointer-events: none;
}
@media (max-width: 720px) { .cta-block { grid-template-columns: 1fr; padding: 40px 28px; } }
.cta-block h2 { color: #fff; font-size: 34px; margin: 0 0 12px; }
.cta-block p { color: rgba(255,255,255,0.8); margin: 0; max-width: 520px; }
.cta-block .btn-group { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
}
.contact-card h3 { font-size: 22px; margin: 0 0 8px; }
.contact-card .lede { color: var(--muted); margin-bottom: 20px; }
.contact-item { padding: 14px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 120px 1fr; gap: 16px; font-size: 14.5px; align-items: start; }
.contact-item:first-of-type { border-top: 0; }
.contact-item .k { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; padding-top: 2px; }
.contact-item .v strong { color: var(--navy-deep); }

.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map-wrap iframe { display: block; width: 100%; height: 380px; border: 0; }

/* ============ FOOTER ============ */
.site-footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.72);
  padding: 56px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h5 { color: #fff; font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 14px; }
.site-footer a { color: rgba(255,255,255,0.72); display: block; padding: 4px 0; font-size: 14px; }
.site-footer a:hover { color: var(--accent-soft); }
.site-footer .foot-brand { font-family: var(--font-serif); color: #fff; font-size: 20px; margin-bottom: 10px; }
.site-footer .foot-brand-sub { font-size: 13px; color: rgba(255,255,255,0.55); max-width: 360px; }
.site-footer .addr { font-size: 13.5px; line-height: 1.7; color: rgba(255,255,255,0.72); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  gap: 18px;
  flex-wrap: wrap;
}
.footer-bottom a { color: rgba(255,255,255,0.55); display: inline; padding: 0; }
.footer-bottom a:hover { color: #fff; }
.land-ack {
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  margin-top: 32px;
  max-width: 780px;
  line-height: 1.65;
}
.land-ack strong { color: #fff; display: block; margin-bottom: 6px; letter-spacing: 0.06em; font-size: 12px; text-transform: uppercase; }

/* ============ PAGE HEADER (subpages) ============ */
.page-hero {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  color: #fff;
  padding: 88px 0 64px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.6;
}
.page-hero .container { position: relative; }
.page-hero h1 { color: #fff; font-size: clamp(36px, 5vw, 56px); margin: 0 0 14px; font-weight: 500; }
.page-hero p { color: rgba(255,255,255,0.82); font-size: 18px; max-width: 680px; }

/* ============ UTILS ============ */
.small-caps { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 600; }
.text-muted { color: var(--muted); }
.mt-lg { margin-top: 36px; }
.center { text-align: center; }

/* Icon (link chevron) */
.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--navy-soft);
}
.icon-link::after { content: "→"; transition: transform .2s ease; }
.icon-link:hover::after { transform: translateX(4px); }
