@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap');
@import 'tokens.css';

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--fg-2);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ── Typography ── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--fg-1);
  line-height: 1.15;
  font-weight: 600;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.02em; }
h3 { font-size: 1.375rem; letter-spacing: -0.01em; }
h4 { font-size: 1.0625rem; }
p  { color: var(--fg-2); line-height: 1.65; }
a  { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
strong { font-weight: 600; color: var(--fg-1); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-subtle);
  padding: 0.125em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--fg-1);
  border: 1px solid var(--border-default);
}

/* ── Layout ── */
.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Flame text ── */
.flame-text {
  background: linear-gradient(180deg, var(--flame-top) 0%, var(--flame-mid) 50%, var(--flame-bottom) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Placeholder ── */
.placeholder {
  color: var(--fg-4);
  font-style: italic;
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-default);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
  position: relative;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; color: var(--fg-1); }

.nav-brand img { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.nav-brand .nav-icon-light { display: block; }
.nav-brand .nav-icon-dark  { display: none; }
[data-theme="dark"] .nav-brand .nav-icon-light { display: none; }
[data-theme="dark"] .nav-brand .nav-icon-dark  { display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex: 1;
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fg-3);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  transition: color 0.15s, background-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover   { color: var(--fg-1); background-color: var(--bg-subtle); text-decoration: none; }
.nav-links a.active  { color: var(--brand); background-color: rgba(255, 80, 16, 0.06); }

[data-theme="dark"] .nav-links a.active { background-color: rgba(255, 80, 16, 0.10); }

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle,
.nav-hamburger {
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fg-3);
  transition: color 0.15s, background-color 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover,
.nav-hamburger:hover { color: var(--fg-1); background-color: var(--bg-subtle); }
.theme-toggle svg,
.nav-hamburger svg { width: 18px; height: 18px; pointer-events: none; flex-shrink: 0; }

.nav-hamburger { display: none; }

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: -1.5rem;
    right: -1.5rem;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border-default);
    padding: 0.5rem 1rem 1rem;
    gap: 0.125rem;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.625rem 0.75rem; }
}

/* ── Hero ── */
.hero {
  padding: 5rem 0 5.5rem;
  border-bottom: 1px solid var(--border-default);
}

.hero-overline {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.hero-overline::before {
  content: '';
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--brand);
  flex-shrink: 0;
}

.hero h1 { margin-bottom: 1.25rem; max-width: 760px; }

.hero-sub {
  font-size: 1.125rem;
  color: var(--fg-3);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2.25rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ── Page hero (inner pages) ── */
.page-hero {
  padding: 3rem 0 2.75rem;
  border-bottom: 1px solid var(--border-default);
}
.page-hero-overline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-bottom: 0.625rem;
}
.page-hero h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); margin-bottom: 0.625rem; }
.page-hero p  { font-size: 1.0625rem; color: var(--fg-3); max-width: 540px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.6875rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }

.btn-secondary { background: transparent; color: var(--fg-1); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-subtle); }

/* ── Section ── */
.section { padding: 4rem 0; }

.section-header { margin-bottom: 2.5rem; }
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-bottom: 0.5rem;
}
.section-header h2 { margin-bottom: 0.5rem; }
.section-header > p { color: var(--fg-3); font-size: 1.0625rem; max-width: 580px; }

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

@media (max-width: 1024px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ── Card ── */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 0.75rem;
}
.card h3 { font-size: 1.0625rem; margin-bottom: 0.5rem; }
.card > p { font-size: 0.9375rem; color: var(--fg-3); line-height: 1.65; }

/* ── Research areas ── */
.research-list { display: flex; flex-direction: column; }
.research-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--border-default);
}
.research-item:first-child { padding-top: 0; }
.research-item:last-child  { border-bottom: none; padding-bottom: 0; }
.research-item-head .item-num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-bottom: 0.5rem;
}
.research-item-head h3 { font-size: 1.125rem; line-height: 1.3; }
.research-item-body p { color: var(--fg-2); line-height: 1.7; font-size: 0.9375rem; }
.research-item-body ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.research-item-body li { font-size: 0.9375rem; color: var(--fg-3); line-height: 1.6; }
.research-item-body li strong { color: var(--fg-2); }

@media (max-width: 768px) {
  .research-item { grid-template-columns: 1fr; gap: 0.875rem; }
}

/* ── Team ── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 3rem;
}
@media (max-width: 640px) { .team-grid { grid-template-columns: 1fr; } }

.team-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.team-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--flame-top) 0%, var(--flame-bottom) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.team-card-body { flex: 1; min-width: 0; }
.team-card-body h3 { font-size: 1.0625rem; margin-bottom: 0.125rem; }
.team-role { font-size: 0.8125rem; font-weight: 500; color: var(--brand); margin-bottom: 0.625rem; }
.team-card-body p { font-size: 0.9375rem; color: var(--fg-3); line-height: 1.6; }
.team-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.875rem; }
.team-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.25em 0.625em;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--fg-3);
}

/* ── Student groups ── */
.student-group { padding: 2.5rem 0; border-bottom: 1px solid var(--border-default); }
.student-group:last-child { border-bottom: none; padding-bottom: 0; }

.student-group-header { margin-bottom: 1.5rem; }
.student-group-header .group-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}
.student-group-header h3 { font-size: 1.125rem; }
.student-group-header > p { font-size: 0.9375rem; color: var(--fg-3); margin-top: 0.25rem; }

.group-pill {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3em 0.75em;
  border-radius: 2rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  color: var(--fg-4);
  white-space: nowrap;
}

/* ── Project cards ── */
.project-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.375rem;
}
.project-meta { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.875rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.25em 0.625em;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--fg-3);
}
.project-card h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.project-student { font-size: 0.8125rem; color: var(--fg-4); font-family: var(--font-mono); margin-bottom: 0.75rem; }
.project-card p  { font-size: 0.9375rem; color: var(--fg-3); line-height: 1.65; }

/* ── Publications ── */
.pub-list { display: flex; flex-direction: column; gap: 1.25rem; }
.pub-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.625rem;
}
.pub-badges { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 1rem; }
.badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3em 0.7em;
  border-radius: var(--radius-sm);
}
.badge-review {
  background: #FFF3E0;
  color: #BF4E00;
  border: 1px solid #FFCC80;
}
[data-theme="dark"] .badge-review {
  background: rgba(255, 80, 16, 0.12);
  color: var(--ember-300);
  border-color: rgba(255, 80, 16, 0.2);
}
.badge-venue {
  background: var(--bg-subtle);
  color: var(--fg-4);
  border: 1px solid var(--border-default);
}
.pub-card h3 { font-size: 1.0625rem; margin-bottom: 0.375rem; line-height: 1.4; }
.pub-venue { font-size: 0.9375rem; color: var(--link); font-weight: 500; margin-bottom: 0.625rem; display: block; }
.pub-card > p { font-size: 0.9375rem; color: var(--fg-3); line-height: 1.65; margin-bottom: 0.625rem; }
.pub-authors { font-size: 0.8125rem; color: var(--fg-4); font-family: var(--font-mono); }

/* ── CTA band ── */
.cta-band {
  background: var(--bg-raised);
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  padding: 3.5rem 0;
}
.cta-band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta-band-inner h2 { font-size: 1.625rem; margin-bottom: 0.25rem; }
.cta-band-inner > div > p { color: var(--fg-3); font-size: 0.9375rem; }

/* ── Platform callout ── */
.platform-callout {
  background: linear-gradient(135deg, rgba(255, 80, 16, 0.04) 0%, transparent 60%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}
[data-theme="dark"] .platform-callout {
  background: linear-gradient(135deg, rgba(255, 80, 16, 0.07) 0%, transparent 60%);
}
.platform-callout h3 { font-size: 1.1875rem; margin-bottom: 0.375rem; }
.platform-callout p  { color: var(--fg-3); font-size: 0.9375rem; line-height: 1.65; }
.platform-callout-tech { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--fg-4); margin-top: 0.625rem; }
@media (max-width: 640px) { .platform-callout { grid-template-columns: 1fr; } }

/* ── Fill notice ── */
.fill-notice {
  background: rgba(255, 80, 16, 0.04);
  border: 1px dashed rgba(255, 80, 16, 0.25);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--fg-4);
  font-family: var(--font-mono);
  margin-bottom: 1.5rem;
}
[data-theme="dark"] .fill-notice { background: rgba(255, 80, 16, 0.07); }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border-default); }

/* ── Footer ── */
.footer { background: var(--graphite-900); }

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3rem;
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid #1D242E;
}
.footer-brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}
.footer-brand-logo img { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #F0F3F6;
}
.footer-tagline   { font-size: 0.875rem; color: #5C6573; margin-bottom: 0.5rem; }
.footer-affil     { font-size: 0.8125rem; color: #3D4752; line-height: 1.6; }

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3D4752;
  margin-bottom: 0.875rem;
}
.footer-col ul  { display: flex; flex-direction: column; gap: 0.375rem; }
.footer-col a   { font-size: 0.9375rem; color: #5C6573; }
.footer-col a:hover { color: #BEC5CF; text-decoration: none; }
.footer-col p   { font-size: 0.875rem; color: #5C6573; line-height: 1.6; }
.footer-col p + p { margin-top: 0.5rem; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-bottom p { font-size: 0.8125rem; color: #3D4752; }

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: span 2; }
}
@media (max-width: 540px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
