/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:       #1a1916;
  --ink-2:     #4a4840;
  --ink-3:     #8c8a82;
  --line:      #e8e6df;
  --bg:        #fdfcf8;
  --bg-2:      #f4f2ea;
  --accent:    #3d5a80;
  --accent-lt: #e8eef5;
  --accent-dk: #2c4260;
  --tag-dt:    #e6f0ed;  --tag-dt-t:   #1a5240;
  --tag-ccd:   #ece8f5;  --tag-ccd-t:  #3d2a80;
  --tag-opt:   #f5ece8;  --tag-opt-t:  #80381a;
  --r:         8px;
  --r-lg:      16px;
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; font-size: 16px; line-height: 1.7; color: var(--ink); background: var(--bg); }

a { color: inherit; text-decoration: none; }
strong { font-weight: 600; }

/* === NAV === */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(253,252,248,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
/* === HIRING BANNER === */
.hiring-banner {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; height: 60px; gap: 2rem;
}
.nav-logo { font-weight: 600; font-size: 15px; letter-spacing: -0.02em; color: var(--ink); }
.nav-links { display: flex; gap: 0.25rem; list-style: none; margin-left: auto; }
.nav-links a { font-size: 14px; color: var(--ink-2); padding: 6px 12px; border-radius: 6px; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--ink); background: var(--bg-2); }
.nav-cta { background: var(--accent) !important; color: #fff !important; border-radius: 6px; }
.nav-cta:hover { background: var(--accent-dk) !important; }
.nav-hamburger { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-hamburger span { display: block; width: 20px; height: 1.5px; background: var(--ink); border-radius: 2px; }

.mobile-nav { display: none; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); }
.mobile-nav a { padding: 14px 2rem; font-size: 15px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.mobile-nav.open { display: flex; }

/* === HERO === */
.hero {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center;
  max-width: 1140px; margin: 0 auto; padding: 6rem 2rem;
  position: relative; gap: 4rem;
}
.hero-inner { flex: 1; max-width: 560px; }
.hero-eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 1.25rem; }
.hero-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600; line-height: 1.1;
  letter-spacing: -0.02em; color: var(--ink);
  margin-bottom: 1.5rem;
}
.hero-sub { font-size: 1.1rem; color: var(--ink-2); line-height: 1.65; max-width: 480px; margin-bottom: 2.5rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-decoration { flex: 0 0 380px; max-width: 380px; color: var(--accent); opacity: 0.7; }
.hero-decoration svg { width: 100%; height: auto; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center;
  padding: 10px 22px; border-radius: var(--r); font-size: 14px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn-full { width: 100%; justify-content: center; }

/* === STATS BAR === */
.stats-bar {
  background: var(--accent); color: #fff;
  display: flex; justify-content: center; gap: 0; flex-wrap: wrap;
}
.stat {
  padding: 1.75rem 3rem; display: flex; flex-direction: column; align-items: center;
  border-right: 1px solid rgba(255,255,255,0.12);
}
.stat:last-child { border-right: none; }
.stat-n { font-family: 'Lora', serif; font-size: 2rem; font-weight: 600; line-height: 1; }
.stat-l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.7; margin-top: 4px; }

/* === SECTIONS === */
.section { padding: 6rem 0; }
.section-alt { background: var(--bg-2); }
.container { max-width: 1140px; margin: 0 auto; padding: 0 2rem; }
.section-header { max-width: 900px; margin: 0 auto 3.5rem; text-align: center; }
.section-eyebrow { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 0.75rem; }
.section-title { font-family: 'Lora', serif; font-size: 2.2rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; margin-bottom: 1rem; }
.section-desc { font-size: 1rem; color: var(--ink-2); line-height: 1.7; }

/* === NEWS === */
.news-list { display: flex; flex-direction: column; gap: 0; max-width: 860px; margin: 0 auto; }
.news-item {
  display: flex; gap: 2rem; padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}
.news-item:first-child { border-top: 1px solid var(--line); }
.news-date {
  flex: 0 0 100px; font-size: 12px; font-weight: 600;
  color: var(--accent); letter-spacing: 0.06em;
  text-transform: uppercase; padding-top: 3px; line-height: 1.4;
}
.news-body { flex: 1; display: flex; flex-direction: column; gap: 0.6rem; }
.news-headline { font-size: 0.95rem; font-weight: 500; color: var(--ink); line-height: 1.5; }
.news-detail { font-size: 0.875rem; color: var(--ink-2); line-height: 1.7; display: none; }
.news-detail.open { display: block; }
.news-toggle {
  align-self: flex-start; font-size: 12px; font-weight: 500;
  color: var(--accent); background: none; border: none; cursor: pointer;
  padding: 0; margin-top: 2px;
}
.news-toggle:hover { color: var(--accent-dk); text-decoration: underline; }

@media (max-width: 640px) {
  .news-item { flex-direction: column; gap: 0.5rem; }
  .news-date { flex: none; }
}

/* === RESEARCH GRID === */
.research-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.research-card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 2rem; transition: box-shadow .2s, transform .2s;
}
.research-card:hover { box-shadow: 0 4px 24px rgba(61,90,128,0.1); transform: translateY(-2px); }
.research-card.featured { border-color: var(--accent); background: var(--accent-lt); }
.rc-icon { width: 40px; height: 40px; color: var(--accent); margin-bottom: 1.25rem; }
.rc-icon svg { width: 100%; height: 100%; }
.research-card h3 { font-family: 'Lora', serif; font-size: 1.15rem; font-weight: 600; color: var(--ink); margin-bottom: 0.75rem; }
.research-card p { font-size: 0.9rem; color: var(--ink-2); line-height: 1.65; }
.rc-link { display: inline-block; margin-top: 1rem; font-size: 13px; font-weight: 500; color: var(--accent); }
.rc-link:hover { color: var(--accent-dk); text-decoration: underline; }

/* === PUBLICATIONS === */
.pub-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.pf-btn {
  padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); cursor: pointer; transition: all .15s;
}
.pf-btn:hover { border-color: var(--accent); color: var(--accent); }
.pf-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.pub-list { display: flex; flex-direction: column; gap: 0; }
.pub-item {
  padding: 1.75rem 0; border-bottom: 1px solid var(--line);
  display: flex; gap: 1.5rem; align-items: flex-start; transition: opacity .2s;
}
.pub-item:first-child { border-top: 1px solid var(--line); }
.pub-item.hidden { display: none; }

.pub-media {
  flex: 0 0 250px; width: 250px; height: 200px;
  border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
}
.pub-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pub-media-placeholder { color: var(--ink-3); font-size: 12px; }

.pub-body { flex: 1; display: grid; gap: 0.4rem; }
.pub-meta { display: flex; align-items: center; gap: 0.75rem; }
.pub-tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em;
}
.pub-item[data-tag="digitaltwin"] .pub-tag { background: var(--tag-dt);  color: var(--tag-dt-t); }
.pub-item[data-tag="ccd"]         .pub-tag { background: var(--tag-ccd); color: var(--tag-ccd-t); }
.pub-item[data-tag="optimization"] .pub-tag { background: var(--tag-opt); color: var(--tag-opt-t); }
.pub-year { font-size: 13px; color: var(--ink-3); }
.pub-title { font-family: 'Lora', serif; font-size: 1.05rem; font-weight: 600; color: var(--ink); line-height: 1.4; }
.pub-authors { font-size: 0.88rem; color: var(--ink-2); }
.pub-venue { font-size: 0.85rem; color: var(--ink-3); font-style: italic; }
.pub-links { display: flex; gap: 0.75rem; }
.pub-link {
  font-size: 12px; font-weight: 500; color: var(--accent); padding: 3px 10px;
  border: 1px solid var(--accent-lt); border-radius: 4px; transition: all .15s;
}
.pub-link:hover { background: var(--accent); color: #fff; }

/* === TEAM === */
.team-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr 1fr;
}
.team-card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1.75rem; display: flex; gap: 1.25rem;
  transition: box-shadow .2s;
}
.team-card.pi { border-color: var(--accent); grid-column: 1 / -1; }
.team-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.team-avatar {
  width: 180px; height: 180px; flex-shrink: 0; border-radius: 50%;
  background: hsl(var(--hue,220) 40% 88%); color: hsl(var(--hue,220) 40% 30%);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
}
.joining-av {
  background: var(--bg-2); color: var(--ink-3); font-size: 22px; font-weight: 300;
}
.team-info h3 { font-family: 'Lora', serif; font-size: 1rem; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.team-role { font-size: 12px; color: var(--accent); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.6rem; }
.team-bio { font-size: 0.875rem; color: var(--ink-2); line-height: 1.6; margin-bottom: 0.75rem; }
.team-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tl {
  font-size: 12px; font-weight: 500; color: var(--ink-2); padding: 3px 10px;
  border: 1px solid var(--line); border-radius: 4px; transition: all .15s;
}
.tl:hover { border-color: var(--accent); color: var(--accent); }

/* === JOIN US === */
.join-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.join-card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 2rem;
  display: flex; flex-direction: column; gap: 1rem;
  transition: box-shadow .2s;
}
.join-card:hover { box-shadow: 0 4px 24px rgba(61,90,128,0.1); }
.join-badge {
  display: inline-block; align-self: flex-start;
  padding: 3px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent); color: #fff;
}
.join-badge.ug { background: var(--accent-lt); color: var(--accent-dk); }
.join-card h3 {
  font-family: 'Lora', serif; font-size: 1.15rem; font-weight: 600;
  color: var(--ink); line-height: 1.3;
}
.join-card p { font-size: 0.9rem; color: var(--ink-2); line-height: 1.7; }
.join-btn { align-self: flex-start; }
.join-btn-group { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: auto; }

/* === CONTACT === */
.section-contact { background: var(--ink); color: #fff; }
.section-contact .section-eyebrow { color: hsl(218 60% 75%); }
.section-contact .section-title { color: #fff; }
.section-contact p { color: rgba(255,255,255,0.7); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 5rem; align-items: start; }
.contact-info { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.ci-item { display: flex; flex-direction: column; gap: 2px; }
.ci-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.4); font-weight: 500; }
.ci-item a, .ci-item span { font-size: 0.9rem; color: rgba(255,255,255,0.8); line-height: 1.5; }
.ci-item a:hover { color: #fff; text-decoration: underline; }

.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.06em; }
.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r); padding: 10px 14px; font-size: 14px;
  color: #fff; font-family: inherit; outline: none; transition: border .15s;
  width: 100%;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: rgba(255,255,255,0.3); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: hsl(218 60% 65%);
}
.form-group select option { background: var(--ink); }
.contact-form .btn-primary { background: hsl(218 60% 55%); border-color: transparent; margin-top: 0.5rem; }
.contact-form .btn-primary:hover { background: hsl(218 60% 48%); }
.form-notice { font-size: 13px; text-align: center; margin-top: 0.5rem; }

/* === FOOTER === */
.footer { background: #111; border-top: 1px solid rgba(255,255,255,0.06); padding: 1.5rem 2rem; }
.footer-inner { max-width: 1140px; margin: 0 auto; display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.footer-logo { font-weight: 600; font-size: 14px; color: #fff; }
.footer-copy { font-size: 13px; color: rgba(255,255,255,0.4); margin-right: auto; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,0.45); transition: color .15s; }
.footer-links a:hover { color: #fff; }

/* === MORE PUBLICATIONS === */
.more-pubs-cta { margin-top: 3.5rem; padding-top: 3rem; border-top: 2px solid var(--line); display: flex; justify-content: center; }
.more-pubs { margin-top: 3.5rem; padding-top: 3rem; border-top: 2px solid var(--line); }
.more-pubs-title { font-family: 'Lora', serif; font-size: 1.4rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; margin-bottom: 2rem; }
.more-pubs-group { margin-bottom: 2.5rem; }
.more-pubs-category { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.more-pubs-category small { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--ink-3); }
.more-pubs-list { list-style: decimal; padding-left: 1.75rem; display: flex; flex-direction: column; gap: 0.85rem; }
.more-pubs-item { font-size: 0.875rem; color: var(--ink-2); line-height: 1.75; }
.more-pubs-item em { font-style: italic; color: var(--ink); }

/* === TEACHING === */
.teaching-list { display: flex; flex-direction: column; gap: 0; max-width: 860px; margin: 0 auto; }
.teaching-item { padding: 2rem 0; border-bottom: 1px solid var(--line); }
.teaching-item:first-child { border-top: 1px solid var(--line); }
.teaching-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.teaching-badge {
  display: inline-block; padding: 3px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent); color: #fff;
}
.teaching-term { font-size: 12px; color: var(--accent); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.teaching-item h3 { font-family: 'Lora', serif; font-size: 1.1rem; font-weight: 600; color: var(--ink); margin-bottom: 0.25rem; line-height: 1.4; }
.teaching-role { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.85rem; }
.teaching-desc { font-size: 0.9rem; color: var(--ink-2); line-height: 1.7; margin-bottom: 0.85rem; }
.teaching-topics { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; }
.teaching-topics li { font-size: 0.875rem; color: var(--ink-2); line-height: 1.6; padding-left: 1.25rem; position: relative; }
.teaching-topics li::before { content: '—'; position: absolute; left: 0; color: var(--accent); font-weight: 600; }
.teaching-tbd { font-size: 0.9rem; color: var(--ink-3); font-style: italic; }
/* specificity boost for teaching classes nested inside .research-card */
.research-card .teaching-role { font-size: 12px; color: var(--ink-3); }
.research-card .teaching-tbd  { color: var(--ink-3); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .hero { flex-direction: column; padding: 4rem 2rem; min-height: auto; gap: 3rem; }
  .hero-decoration { max-width: 260px; align-self: center; }
  .research-card.featured { grid-column: span 1; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .team-card.pi { grid-column: span 1; }
  .pub-media { flex: 0 0 250px; width: 250px; height: 200px; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .hero-title { font-size: 2.4rem; }
  .form-row { grid-template-columns: 1fr; }
  .team-card { flex-direction: column; }
  .pub-item { flex-direction: column; }
  .pub-media { width: 100%; height: 180px; flex: none; }
  .team-grid { grid-template-columns: 1fr; }
}
