/* ============================================================
   GRC · New Design — Space Mono + DM Sans, clean light palette
   Polished with: text-wrap:balance, concentric radii, shadow
   cards, antialiasing, tabular nums, staggered enter anims,
   interruptible transitions, image outlines.
   ============================================================ */

:root {
  --bg:       #f8f9fb;
  --surface:  #ffffff;
  --surface2: #f0f2f5;
  --border:   #e2e6ed;
  --accent:   #0073e6;
  --accent2:  #00a86b;
  --text:     #1a202c;
  --muted:    #64748b;
  --mono:     'Space Mono', monospace;
  --sans:     'DM Sans', sans-serif;
  /* concentric radii: outer = inner + padding */
  --r-inner:  8px;
  --r-card:   14px;   /* inner + 6px gap */
  --r-outer:  20px;   /* card + 6px gap */
  --nav-h:    72px;
  /* layered shadow for cards */
  --shadow-card:
    0px 0px 0px 1px rgba(0,0,0,0.06),
    0px 1px 2px -1px rgba(0,0,0,0.06),
    0px 2px 4px 0px rgba(0,0,0,0.04);
  --shadow-card-hover:
    0px 0px 0px 1px rgba(0,0,0,0.09),
    0px 2px 6px -1px rgba(0,0,0,0.09),
    0px 6px 16px 0px rgba(0,115,230,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  /* crispy text */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* balanced headings never orphan a word */
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

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

/* image outline — depth without a hard border */
img {
  max-width: 100%;
  display: block;
  outline: 1px solid rgba(0,0,0,0.08);
  outline-offset: -1px;
}
/* suppress outline on decorative/logo images */
img.no-outline, .nav-brand img, .nav-upv img, .award-banner img,
.pub-logos img, .pub-logos-large img, .project-logo img { outline: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── NAV ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  box-shadow: var(--shadow-card);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 24px;
}
.nav-brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.nav-brand img.logo-grc { height: 56px; width: auto; display: block; }
.brand-mono { display: none; }
.brand-sub  { display: none; }
.nav-upv { flex-shrink: 0; display: flex; align-items: center; }
.nav-upv img { height: 38px; width: auto; display: block; opacity: 0.8; }
.nav-links { list-style: none; display: flex; gap: 4px; margin-left: auto; margin-right: 20px; }
.nav-links a {
  display: block; padding: 6px 14px; font-size: 13px; font-weight: 500;
  color: var(--muted); border-radius: var(--r-inner);
  /* interruptible: use transition not keyframe */
  transition: color 0.18s ease, background 0.18s ease;
  text-decoration: none;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: rgba(0,115,230,0.07); font-weight: 600; }
.nav-toggle { display: none; }

/* ── HERO ── */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex; flex-direction: column; justify-content: center;
  padding: 80px 24px 60px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 50%, rgba(0,115,230,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 15% 80%, rgba(0,168,107,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.hero-grid {
  max-width: 1100px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}

/* staggered enter: each hero block animates individually */
@keyframes enter {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
.hero-tag  { animation: enter 700ms cubic-bezier(0.25,0.46,0.45,0.94) both; animation-delay: 80ms; }
.hero-title{ animation: enter 700ms cubic-bezier(0.25,0.46,0.45,0.94) both; animation-delay: 160ms; }
.hero-desc { animation: enter 700ms cubic-bezier(0.25,0.46,0.45,0.94) both; animation-delay: 260ms; }
.hero-cta  { animation: enter 700ms cubic-bezier(0.25,0.46,0.45,0.94) both; animation-delay: 360ms; }
.hero-visual { animation: enter 700ms cubic-bezier(0.25,0.46,0.45,0.94) both; animation-delay: 200ms; }

.hero-tag {
  font-family: var(--mono); font-size: 12px; color: var(--accent2);
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 20px;
}
.hero-title {
  font-family: var(--mono); font-size: clamp(28px,4vw,50px);
  font-weight: 700; line-height: 1.15; letter-spacing: -0.02em;
  color: var(--text); margin-bottom: 24px;
}
.hero-title .accent { color: var(--accent); }
.hero-desc { font-size: 16px; color: var(--muted); max-width: 440px; margin-bottom: 36px; line-height: 1.75; }
.hero-cta  { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; padding: 11px 24px;
  border-radius: var(--r-card); font-family: var(--mono); font-size: 13px;
  font-weight: 700; letter-spacing: 0.04em;
  /* interruptible hover */
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer; border: none; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #005cbf; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,115,230,0.25); text-decoration: none; }
.btn-ghost {
  background: transparent; color: var(--text);
  box-shadow: var(--shadow-card); /* shadow instead of border */
}
.btn-ghost:hover { box-shadow: var(--shadow-card-hover); color: var(--accent); transform: translateY(-2px); text-decoration: none; }

.net-canvas {
  width: 100%; height: 260px; background: var(--surface);
  border-radius: var(--r-outer);
  /* shadow instead of border */
  box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
}
.hero-visual { display: flex; flex-direction: column; gap: 20px; }
.hero-stat-stack { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.stat-card {
  background: var(--surface);
  /* concentric: card inside hero-visual which has no border, so just shadow */
  box-shadow: var(--shadow-card);
  border-radius: var(--r-card); padding: 16px 12px; text-align: center;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.stat-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.stat-num {
  display: block; font-family: var(--mono); font-size: 22px; font-weight: 700;
  color: var(--accent);
  /* tabular numbers so digits don't shift */
  font-variant-numeric: tabular-nums;
}
.stat-label { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

.hero-scroll-hint {
  text-align: center; font-family: var(--mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.1em; margin-top: 48px;
  /* subtle — small translateY only, soft timing */
  animation: scrollBounce 2.4s cubic-bezier(0.45,0.05,0.55,0.95) infinite;
}
@keyframes scrollBounce {
  0%,100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(5px); opacity: 1; }
}

/* ── PAGE HEADER ── */
.page-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 48px 0 36px; }
.page-header h1 {
  font-family: var(--mono); font-size: clamp(26px,3.5vw,40px);
  font-weight: 700; color: var(--text); letter-spacing: -0.02em; margin-top: 8px;
}
.page-header p { color: var(--muted); font-size: 15px; margin-top: 10px; max-width: 600px; }
.page-content { padding: 56px 0 80px; }

/* ── SECTION HEADERS ── */
.section-header { margin-bottom: 32px; }
.section-tag {
  display: inline-block; font-family: var(--mono); font-size: 11px; color: var(--accent);
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px;
  padding: 3px 9px; background: rgba(0,115,230,0.08); border-radius: var(--r-inner);
}
.section-header h2 {
  font-family: var(--mono); font-size: clamp(20px,2.5vw,28px);
  font-weight: 700; color: var(--text); letter-spacing: -0.02em;
}

/* ── RESEARCH AREAS ── */
.areas-section { padding: 80px 0; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.areas-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.area-card {
  background: var(--bg);
  /* concentric: card is inside .areas-section (surface), padding ~28px, so outer = 14+6 = 20 */
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  /* interruptible transition */
  transition: box-shadow 0.18s ease, transform 0.18s ease;
  /* staggered enter */
  animation: enter 600ms cubic-bezier(0.25,0.46,0.45,0.94) both;
  animation-delay: calc(var(--i) * 70ms + 100ms);
}
.area-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-4px); }
.area-icon { font-size: 28px; display: block; margin-bottom: 14px; }
.area-card h3 { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.area-card p { font-size: 13px; color: var(--muted); line-height: 1.65; }

/* ── NEWS & EVENTS ── */
.news-section { padding: 80px 0; }
.news-split { display: grid; grid-template-columns: 1fr 1.4fr; gap: 64px; align-items: start; }
.news-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.news-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.18s ease;
}
.news-item:hover { box-shadow: var(--shadow-card-hover); }
.news-badge {
  flex-shrink: 0; font-family: var(--mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent2);
  background: rgba(0,168,107,0.1); padding: 3px 7px; border-radius: var(--r-inner); margin-top: 2px;
}
.news-item a { font-size: 14px; color: var(--text); line-height: 1.5; }
.news-item a:hover { color: var(--accent); text-decoration: none; }
.news-date { font-size: 12px; color: var(--muted); margin-left: 6px; }
.award-banner {
  margin-top: 24px; border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--shadow-card);
}
.award-banner img { width: 100%; height: 160px; object-fit: contain; background: var(--surface); padding: 16px; }

.event-group { margin-bottom: 32px; }
.event-group-label {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted);
  border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 12px;
}
.event-card {
  padding: 14px 16px; background: var(--surface);
  /* concentric inner radius on left bar: card radius minus border-left width */
  border-radius: 0 var(--r-card) var(--r-card) 0;
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
  transition: border-left-color 0.18s ease, box-shadow 0.18s ease;
}
.event-card:hover { border-left-color: var(--accent2); box-shadow: var(--shadow-card-hover); }
.event-meta { display: flex; gap: 12px; margin-bottom: 5px; }
.event-date,.event-loc {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.event-name { display: block; font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 3px; }
.event-name:hover { color: var(--accent); text-decoration: none; }
.event-desc { font-size: 12px; color: var(--muted); line-height: 1.55; margin: 0; }

/* ── PUBLICATIONS BAR ── */
.pubs-bar { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 28px 0; }
.pubs-bar .container { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.pubs-bar p { font-size: 13px; color: var(--muted); margin: 0; flex-shrink: 0; }
.pub-logos { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.pub-logos a { opacity: 0.55; transition: opacity 0.18s ease; text-decoration: none; }
.pub-logos a:hover { opacity: 1; }
.pub-logos img { height: 28px; }

/* ── MEMBERS ── */
.members-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 40px; }
.member-group {
  background: var(--surface); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); overflow: hidden;
}
.member-group-head {
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  padding: 12px 20px; letter-spacing: 0.03em;
}
.member-group ul { list-style: none; padding: 16px 20px; display: flex; flex-direction: column; gap: 0; }
.member-group li {
  font-size: 14px; color: var(--text); padding: 7px 0;
  border-bottom: 1px solid var(--border); line-height: 1.4;
}
.member-group li:last-child { border-bottom: none; }
.member-group li a { color: var(--accent); text-decoration: none; }
.member-group li a:hover { color: var(--accent2); }
.member-note { font-size: 12px; color: var(--muted); margin-left: 4px; }
.alumni-section { margin-top: 48px; }
.alumni-list { list-style: none; display: flex; flex-direction: column; }
.alumni-list li { font-size: 14px; color: var(--text); padding: 10px 0; border-bottom: 1px solid var(--border); line-height: 1.55; }
.alumni-list li:last-child { border-bottom: none; }
.alumni-year {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  background: rgba(0,115,230,0.08); padding: 2px 7px;
  border-radius: var(--r-inner); margin-right: 8px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── PAPERS ── */
.papers-intro {
  background: var(--surface); border-radius: var(--r-outer);
  box-shadow: var(--shadow-card); padding: 40px; text-align: center; margin-bottom: 40px;
}
.papers-intro h2 { font-family: var(--mono); font-size: 18px; color: var(--text); margin-bottom: 32px; }
.pub-logos-large { display: flex; gap: 32px; justify-content: center; align-items: center; flex-wrap: wrap; }
.pub-logos-large a {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 24px 32px; border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.18s ease, transform 0.18s ease; text-decoration: none; background: var(--bg);
}
.pub-logos-large a:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); text-decoration: none; }
.pub-logos-large img { height: 36px; }
.pub-logos-large span { font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* ── PROJECTS ── */
.projects-section-head {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); background: var(--surface2);
  padding: 10px 16px; border-radius: var(--r-card); margin: 32px 0 8px;
  box-shadow: var(--shadow-card);
}
.projects-list { display: flex; flex-direction: column; }
.project-card { display: grid; grid-template-columns: 160px 1fr; gap: 24px; align-items: start; padding: 28px 0; border-bottom: 1px solid var(--border); }
.project-card:last-child { border-bottom: none; }
.project-logo { display: flex; align-items: flex-start; justify-content: center; padding-top: 4px; }
.project-logo img { max-width: 140px; max-height: 50px; object-fit: contain; }
.project-title { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.project-tag {
  font-family: var(--mono); font-size: 11px; padding: 3px 8px;
  border-radius: var(--r-inner); background: var(--surface2); color: var(--muted);
  box-shadow: var(--shadow-card);
}
.project-tag.active { background: rgba(0,168,107,0.1); color: var(--accent2); }
.project-body ul { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.project-body li { font-size: 13px; color: var(--muted); line-height: 1.5; }
.project-body li::before { content: '— '; color: var(--accent); }
.project-body li a { color: var(--accent); }

/* ── TEACHING ── */
.teaching-list { display: flex; flex-direction: column; }
.teaching-item { padding: 24px 0; border-bottom: 1px solid var(--border); }
.teaching-item:last-child { border-bottom: none; }
.teaching-year {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  background: rgba(0,115,230,0.08); padding: 2px 8px;
  border-radius: var(--r-inner); margin-bottom: 8px; display: inline-block;
}
.teaching-title { font-weight: 700; font-size: 16px; color: var(--text); margin-bottom: 6px; line-height: 1.4; }
.teaching-title a { color: var(--text); text-decoration: none; }
.teaching-title a:hover { color: var(--accent); }
.teaching-where { font-size: 13px; color: var(--muted); line-height: 1.5; }
.teaching-where a { color: var(--accent); }
.teaching-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.teaching-link {
  font-size: 12px; font-family: var(--mono); padding: 4px 10px;
  border-radius: var(--r-inner);
  box-shadow: var(--shadow-card);
  color: var(--muted);
  transition: box-shadow 0.18s ease, color 0.18s ease; text-decoration: none;
}
.teaching-link:hover { box-shadow: var(--shadow-card-hover); color: var(--accent); text-decoration: none; }
.disclaimer-box {
  margin-top: 48px; padding: 20px 24px; background: var(--surface2);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  font-size: 13px; color: var(--muted); line-height: 1.6;
}
.disclaimer-box h3 { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; color: var(--text); }

/* ── SOFTWARE ── */
.software-card {
  background: var(--surface); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: 28px 32px; margin-bottom: 20px;
  transition: box-shadow 0.18s ease;
}
.software-card:hover { box-shadow: var(--shadow-card-hover); }
.software-card h3 { font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.software-card p { font-size: 14px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.software-card a.repo-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  box-shadow: var(--shadow-card);
  padding: 5px 12px; border-radius: var(--r-inner);
  transition: box-shadow 0.18s ease, color 0.18s ease; text-decoration: none;
}
.software-card a.repo-link:hover { box-shadow: var(--shadow-card-hover); color: var(--accent2); text-decoration: none; }

/* ── FOOTER ── */
.site-footer { padding: 44px 0; border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 40px; align-items: start; }
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-brand .brand-mono {
  font-family: var(--mono); font-size: 22px; font-weight: 700;
  color: var(--accent); letter-spacing: 0.08em; display: block;
}
.footer-brand span:not(.brand-mono) { font-size: 12px; color: var(--muted); display: block; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color 0.18s ease; }
.footer-links a:hover { color: var(--accent); }
.footer-contact { display: flex; flex-direction: column; gap: 6px; text-align: right; }
.footer-contact a { font-family: var(--mono); font-size: 13px; color: var(--accent); text-decoration: none; }
.footer-contact span { font-size: 12px; color: var(--muted); }
.switch-link { font-size: 12px !important; color: var(--muted) !important; margin-top: 4px; }
.switch-link:hover { color: var(--accent) !important; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .areas-grid { grid-template-columns: repeat(2,1fr); }
  .news-split { grid-template-columns: 1fr; gap: 40px; }
  .members-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-contact { text-align: left; }
  .project-card { grid-template-columns: 1fr; }
  .project-logo { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .areas-grid { grid-template-columns: 1fr; }
  .hero-stat-stack { grid-template-columns: repeat(3,1fr); }
  .nav-links { display: none; }
  .nav-upv { display: none; }
  .nav-toggle {
    display: block; margin-left: auto; background: none;
    box-shadow: var(--shadow-card); color: var(--text);
    padding: 6px 10px; border-radius: var(--r-inner); cursor: pointer; font-size: 18px; border: none;
  }
}
