/* ============================================================
   ReaL Lab Website — Stylesheet
   ============================================================ */

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a2e;
  --color-text-secondary: #555;
  --color-accent: #0066cc;
  --color-accent-dark: #004a99;
  --color-border: #e0e0e0;
  --color-surface: #f7f8fa;
  --color-hero-bg: #0a1628;
  --color-hero-text: #f0f0f0;
  --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --max-width: 960px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-size: 17px;
}

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

a:hover {
  text-decoration: underline;
}

/* ---- Navigation ---- */

header {
  position: sticky;
  top: 0;
  background: var(--color-hero-bg);
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.logo:hover {
  text-decoration: none;
}

.logo .accent {
  color: #4dabf7;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: #ccc;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #fff;
  text-decoration: none;
}

/* ---- Hero ---- */

.hero {
  background: var(--color-hero-bg);
  color: var(--color-hero-text);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}

.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.6rem;
}

.subtitle {
  font-size: 1.05rem;
  color: #9ab;
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.15rem;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.8;
  color: #c8d6e5;
}

/* ---- Hero Placeholder ---- */

.hero-placeholder {
  max-width: var(--max-width);
  margin: 0 auto 2rem;
  height: 160px;
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-placeholder span {
  color: rgba(255,255,255,0.3);
  font-size: 0.95rem;
  font-style: italic;
}

/* ---- Sections ---- */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.section:last-of-type {
  border-bottom: none;
}

.section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--color-text);
}

.section p {
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
}

.section-note {
  font-style: italic;
  color: #888;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

/* ---- Research Grid ---- */

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.research-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.research-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.research-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.research-card p {
  font-size: 0.92rem;
  margin-bottom: 0;
  line-height: 1.6;
}

.research-card a {
  font-weight: 500;
}

/* ---- Projects ---- */

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.project-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.project-funder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 0.3rem 0.6rem;
  background: var(--color-hero-bg);
  color: #4dabf7;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}

.project-info strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--color-text);
  font-size: 1rem;
}

.project-info p {
  font-size: 0.92rem;
  margin-bottom: 0;
  line-height: 1.5;
}

/* ---- News ---- */

.news-list {
  list-style: none;
  margin-top: 1rem;
}

.news-list li {
  padding: 0.7rem 0 0.7rem 120px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.97rem;
}

.news-list li:last-child {
  border-bottom: none;
}

.news-date {
  display: inline-block;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-text);
  width: 110px;
  margin-left: -120px;
  font-variant-numeric: tabular-nums;
}

/* ---- People ---- */

.people-category {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

.people-category:first-of-type {
  margin-top: 0.5rem;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

a.person-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  transition: box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
}

a.person-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--color-accent);
  text-decoration: none;
}

.person-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;   /* photo-crop: top — shows head/top of image */
  margin-bottom: 0.5rem;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.person-photo.photo-center {
  object-position: center center; /* photo-crop: center — centered crop */
}

a.person-card.has-photo {
  text-align: center;
}

.person-role {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-accent);
  margin-bottom: 0.2rem;
}

.person-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.person-title {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin-top: 0.15rem;
}

span.person-card.alumni {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  opacity: 0.7;
}

/* ---- Contact ---- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

address {
  font-style: normal;
  color: var(--color-text-secondary);
}

address p,
.contact-links p {
  line-height: 1.9;
  margin-bottom: 1rem;
}

.contact-links a {
  font-weight: 500;
}

/* ---- Footer ---- */

footer {
  background: var(--color-hero-bg);
  color: #9ab;
  text-align: center;
  padding: 2rem 1.5rem;
  margin-top: 2rem;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

footer a {
  color: #8bb;
}

footer a:hover {
  color: #fff;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .nav-links {
    gap: 0.8rem;
    font-size: 0.8rem;
  }

  .news-list li {
    padding-left: 0;
  }

  .news-date {
    display: block;
    width: auto;
    margin-left: 0;
    margin-bottom: 0.2rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .people-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .project-item {
    flex-direction: column;
    gap: 0.5rem;
  }
}
