/* ============================================
   Interactive Robot Lab — Shared Stylesheet
   ============================================ */

:root {
  --color-bg: #fafaf8;
  --color-text: #1a1a1a;
  --color-text-secondary: #555;
  --color-accent: #4a90d9;
  --color-accent-light: #e8f0fa;
  --color-border: #e0e0dc;
  --color-card-bg: #ffffff;
  --color-hero-bg: #02133e;
  --color-hero-text: #f0f0ee;
  --color-nav-bg: rgba(2, 19, 62, 0.97);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --max-width: 1100px;
}

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; display: block; }

/* ---- NAV ---- */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: var(--color-nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
nav .nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
nav .logo {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
nav .logo span { color: #6ea8fe; }

nav .nav-links {
  list-style: none;
  display: flex;
  gap: 1.6rem;
}
nav .nav-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.2s;
}
nav .nav-links a:hover,
nav .nav-links a.active {
  color: #fff;
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: 0.3s;
}

/* ---- HERO / PAGE HEADER ---- */
.hero {
  background: var(--color-hero-bg);
  color: var(--color-hero-text);
  padding: 9rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(74,144,217,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}
.hero-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #6ea8fe;
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.2;
  max-width: 700px;
  margin-bottom: 1.2rem;
}
.hero p {
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 620px;
  color: rgba(240,240,238,0.7);
}
.hero p a {
  color: #6ea8fe;
}

/* Page header (smaller hero for sub-pages) */
.page-header {
  padding: 8rem 2rem 3rem;
}
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.5rem;
}

/* ---- SECTION ---- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}
.section-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}
.divider {
  width: 40px;
  height: 3px;
  background: var(--color-accent);
  margin-bottom: 2.5rem;
  border-radius: 2px;
}

/* ---- CARDS (generic) ---- */
.card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 2rem;
  transition: box-shadow 0.25s, transform 0.25s;
}
.card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

/* ---- RESEARCH INTEREST CARDS (Home) ---- */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.interest-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s;
}
.interest-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}
.interest-card .card-img {
  width: 100%;
  height: 200px;
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--color-accent);
  overflow: hidden;
}
.interest-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.interest-card .card-body {
  padding: 1.5rem;
}
.interest-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.interest-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

/* ---- TEAM ---- */
.team-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
  margin-bottom: 1.2rem;
  margin-top: 2.5rem;
}
.team-section-label:first-of-type {
  margin-top: 0;
}

.pi-card {
  display: flex;
  gap: 2rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 2rem;
}
.pi-card .pi-photo {
  width: 160px;
  height: 160px;
  border-radius: 10px;
  background: var(--color-accent-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--color-accent);
  font-weight: 600;
  overflow: hidden;
}
.pi-card .pi-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pi-card .pi-info h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.pi-card .pi-info .pi-title {
  font-size: 0.9rem;
  color: var(--color-accent);
  margin-bottom: 0.8rem;
}
.pi-card .pi-info p,
.pi-card .pi-info ul {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}
.pi-card .pi-info ul {
  list-style: none;
  margin-top: 0.5rem;
}
.pi-card .pi-info ul li::before {
  content: "· ";
  font-weight: 700;
}
.pi-contact {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.8rem;
  font-size: 0.85rem;
}
.pi-contact a {
  color: var(--color-accent);
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
}
.member-card {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}
.member-avatar {
  width: 110px;
  height: 110px;
  border-radius: 14px;
  background: var(--color-accent-light);
  margin: 0 auto 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--color-accent);
  font-weight: 600;
  overflow: hidden;
}
.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.member-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.member-card .role {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* ---- PUBLICATIONS ---- */
.pub-type-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}
.pub-type-label:first-of-type { margin-top: 0; }

.pub-list { list-style: none; }
.pub-item {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 1rem;
  align-items: baseline;
}
.pub-item:first-child { border-top: 1px solid var(--color-border); }
.pub-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  flex-shrink: 0;
  min-width: 30px;
}
.pub-content { flex: 1; }
.pub-venue {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.3rem;
}
.pub-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
  line-height: 1.5;
  color: var(--color-text);
}
.pub-item .pub-title a {
  color: var(--color-text);
  text-decoration: none;
}
.pub-item .pub-title a:hover {
  color: var(--color-accent);
  text-decoration: none;
}
.pub-authors {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

/* ---- RESEARCH PROJECTS ---- */
.project {
  display: flex;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-border);
}
.project:first-of-type { border-top: 1px solid var(--color-border); }
.project-img {
  width: 320px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.project-img img,
.project-img video {
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.project-info { flex: 1; }
.project-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.project-meta {
  font-size: 0.8rem;
  color: var(--color-accent);
  margin-bottom: 0.6rem;
}
.project-info p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}
.project-points {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  padding-left: 1.2rem;
  margin-top: 0.3rem;
  list-style-position: inside;
}
.project-points li {
  margin-bottom: 0.3rem;
}

/* ---- VIDEO GRID ---- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.video-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}
.video-card .video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
}
.video-card .video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.video-card .video-body {
  padding: 1rem 1.2rem;
}
.video-card h4 {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
}

/* ---- PHOTO GALLERY ---- */
.gallery-section-label {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}
.gallery-section-label:first-of-type { margin-top: 0; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}
.photo-grid .photo-item {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}
.photo-grid .photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- JOIN / INFO BOX ---- */
.info-box {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.info-box h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}
.info-box p,
.info-box li {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
}
.info-box ol,
.info-box ul {
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}
.status-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}
.status-badge.closed {
  background: #fde8e8;
  color: #b91c1c;
}
.status-badge.open {
  background: #d1fae5;
  color: #065f46;
}

/* ---- CONTACT ---- */
.contact-section {
  background: var(--color-hero-bg);
  color: var(--color-hero-text);
  margin: 0;
  max-width: 100%;
  padding: 4rem 2rem;
}
.contact-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.contact-section .section-title { color: #fff; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.contact-item {
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgba(240,240,238,0.75);
}
.contact-item strong {
  display: block;
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.contact-item a {
  color: #6ea8fe;
  text-decoration: none;
}
.contact-item a:hover { text-decoration: underline; }

/* ---- FOOTER ---- */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
}
footer a { color: var(--color-text-secondary); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .hero { padding: 7rem 1.5rem 3rem; }
  .page-header { padding: 7rem 1.5rem 2rem; }
  .section { padding: 3rem 1.5rem; }

  /* Mobile nav */
  .hamburger { display: block; }
  nav .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: var(--color-nav-bg);
    flex-direction: column;
    padding: 1rem 2rem 1.5rem;
    gap: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  nav .nav-links.open { display: flex; }

  .interest-grid { grid-template-columns: 1fr; }
  .pi-card { flex-direction: column; align-items: center; text-align: center; }
  .pi-card .pi-photo { width: 120px; height: 120px; }
  .pi-contact { justify-content: center; flex-wrap: wrap; }
  .project { flex-direction: column; }
  .project-img { width: 100%; }
  .members-grid { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: 1fr; }
}

/* ---- ANIMATION ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-label, .hero h1, .hero p {
  animation: fadeUp 0.7s ease-out both;
}
.hero h1 { animation-delay: 0.1s; }
.hero p   { animation-delay: 0.2s; }
