/* ===========================================================
   ERA Lab — main stylesheet
   Clean academic lab style. Light background, logo blue + cyan accent.
   =========================================================== */

:root {
  /* Palette derived from the ERA logo (cyan → blue → deep navy gradient). */
  --bg:        #ffffff;
  --bg-alt:    #f3f7fb;
  --bg-navy:   #071d4f;   /* deep logo navy-blue */
  --surface:   #ffffff;
  --border:    #dde6f1;
  --navy:      #103a8f;   /* primary brand blue — headings, buttons, brand */
  --navy-2:    #07215c;   /* deeper brand blue — hero / footer */
  --text:      #15202e;
  --muted:     #5a6678;
  --accent:    #17b3c0;   /* logo cyan — icons, badges, decoration */
  --accent-d:  #0c8090;   /* darker cyan — links & hover (accessible) */
  --link:      #0c8090;
  --radius:    12px;
  --shadow:    0 1px 3px rgba(16,32,52,0.06), 0 8px 24px rgba(16,32,52,0.06);
  --shadow-h:  0 4px 12px rgba(16,32,52,0.10), 0 16px 40px rgba(16,32,52,0.12);
  --maxw:      1120px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--navy); font-weight: 700; }
.serif { font-family: 'Source Serif 4', Georgia, serif; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }

.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand__logo {
  width: 40px; height: 40px; border-radius: 9px;
  object-fit: contain; flex-shrink: 0;
}
.brand__name { display: block; font-weight: 700; font-size: 1.02rem; color: var(--navy); }
.brand__sub  { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 500; }

.site-nav ul { list-style: none; display: flex; gap: 0.35rem; align-items: center; }
.site-nav a {
  display: block; padding: 0.5rem 0.7rem; border-radius: 7px;
  color: var(--muted); font-weight: 500; font-size: 0.92rem;
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover { color: var(--navy); background: var(--bg-alt); text-decoration: none; }
.site-nav a.is-active { color: var(--accent-d); }

.nav-toggle {
  display: none; background: none; border: 0; font-size: 1.25rem;
  color: var(--navy); cursor: pointer; padding: 0.35rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 1.05rem; border-radius: 8px;
  font-weight: 600; font-size: 0.9rem;
  background: var(--navy); color: #fff; border: 1px solid var(--navy);
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--accent-d); border-color: var(--accent-d); text-decoration: none; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg-alt); color: var(--navy); }
.btn--accent { background: var(--accent); border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn--sm { padding: 0.34rem 0.7rem; font-size: 0.8rem; }

/* ---------- Badges / tags ---------- */
.badge {
  display: inline-block; padding: 0.25em 0.8em; border-radius: 20px;
  background: rgba(23,179,192,0.12); color: var(--accent-d);
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  padding: 0.2rem 0.65rem; border-radius: 20px; font-size: 0.76rem; font-weight: 500;
  background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border);
}

/* ---------- Section helpers ---------- */
.section { padding: 4rem 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 2rem; max-width: 720px; }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head__eyebrow {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.74rem;
  font-weight: 700; color: var(--accent-d); margin-bottom: 0.5rem;
}
.section-head h2 { font-size: 1.9rem; margin-bottom: 0.6rem; }
.section-head p { color: var(--muted); font-size: 1.02rem; }
.section-foot { margin-top: 2rem; text-align: center; }

/* ---------- Page header ---------- */
.page-head { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 3.2rem 0 2.6rem; }
.page-head__eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.76rem; font-weight: 700; color: var(--accent-d); margin-bottom: 0.6rem; }
.page-head__title { font-size: 2.4rem; }
.page-head__lead { margin-top: 0.8rem; color: var(--muted); font-size: 1.1rem; max-width: 760px; }
.page-body { padding: 3rem 1.5rem 4.5rem; }

/* ===========================================================
   HOME — Hero
   =========================================================== */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(1100px 520px at 82% -10%, rgba(23,179,192,0.55), transparent 60%),
    linear-gradient(155deg, #07215c 0%, #0e3a87 50%, #0c6f93 100%);
}
.hero__inner { padding: 5.5rem 0 5rem; max-width: 820px; }
.hero__eyebrow {
  display: inline-block; margin-bottom: 1.1rem; padding: 0.3rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 20px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; color: #cfe9ec;
}
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -0.01em; }
.hero__lead { margin-top: 1.3rem; font-size: 1.18rem; color: #d4e0ec; max-width: 640px; line-height: 1.6; }
.hero__cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.4); }
.hero .btn--ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Stats strip */
.stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.15); }
.stat__num { font-size: 1.8rem; font-weight: 700; color: #fff; }
.stat__label { font-size: 0.82rem; color: #b8c6d6; }

/* ---------- Research areas (home) ---------- */
.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.area-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.4rem; transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.area-card:hover { box-shadow: var(--shadow-h); transform: translateY(-2px); border-color: #cfd9e6; }
.area-card__icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: rgba(23,179,192,0.12); color: var(--accent); font-size: 1.15rem; margin-bottom: 1rem; }
.area-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.area-card p { color: var(--muted); font-size: 0.92rem; }

/* ===========================================================
   Project cards
   =========================================================== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.card-grid--2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.project-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.project-card:hover { box-shadow: var(--shadow-h); transform: translateY(-3px); border-color: #cfd9e6; }
.project-card__thumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg-alt); }
.project-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card__thumb .badge { position: absolute; top: 0.7rem; left: 0.7rem; background: rgba(7,33,92,0.85); color: #fff; backdrop-filter: blur(4px); }
.project-card__body { padding: 1.25rem 1.3rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.project-card__body h3 { font-size: 1.12rem; margin-bottom: 0.45rem; }
.project-card__body h3 a { color: var(--navy); }
.project-card__body h3 a:hover { color: var(--accent); text-decoration: none; }
.project-card__desc { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.9rem; flex: 1; }
.project-card__meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.8rem; }
.project-card__links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; }
.project-card__links a {
  font-size: 0.78rem; font-weight: 600; color: var(--navy);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.25rem 0.6rem;
  transition: color 0.15s, border-color 0.15s;
}
.project-card__links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ===========================================================
   People cards
   =========================================================== */
.people-section { margin-bottom: 3rem; }
.people-section__title { font-size: 1.4rem; margin-bottom: 0.3rem; }
.people-section__count { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.4rem; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.4rem; }
.person {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-align: center; transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.person:hover { box-shadow: var(--shadow-h); transform: translateY(-2px); border-color: #cfd9e6; }
.person__photo { aspect-ratio: 1 / 1; background: var(--bg-alt); overflow: hidden; }
.person__photo img { width: 100%; height: 100%; object-fit: cover; }
.person__body { padding: 0.9rem 0.85rem 1.1rem; }
.person__name { font-size: 0.98rem; font-weight: 700; color: var(--navy); margin-bottom: 0.2rem; }
.person__role { font-size: 0.78rem; color: var(--muted); line-height: 1.4; min-height: 2.1em; }
.person__interests { font-size: 0.76rem; color: var(--accent-d); margin-top: 0.4rem; }
.person__links { margin-top: 0.6rem; display: flex; justify-content: center; gap: 0.6rem; }
.person__links a { color: var(--muted); font-size: 0.95rem; }
.person__links a:hover { color: var(--accent); }

/* Director — larger featured card */
.director {
  display: grid; grid-template-columns: 200px 1fr; gap: 2rem; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem; box-shadow: var(--shadow);
}
.director__photo img { width: 200px; height: 240px; object-fit: cover; border-radius: 10px; }
.director h3 { font-size: 1.5rem; margin-bottom: 0.2rem; }
.director__role { color: var(--accent-d); font-weight: 600; margin-bottom: 0.2rem; }
.director__affil { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.9rem; }
.director__bio { color: var(--text); font-size: 0.96rem; margin-bottom: 1rem; }
.director__links { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Collaborators / simple list */
.namelist { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.6rem 1.5rem; }
.namelist li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.94rem; }
.namelist li .role { color: var(--muted); font-size: 0.83rem; }

/* ===========================================================
   Publications
   =========================================================== */
.pub-year { font-size: 1.3rem; color: var(--navy); margin: 2.4rem 0 1.1rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--border); }
.pub-year:first-of-type { margin-top: 0; }
.pub {
  display: grid; grid-template-columns: 150px 1fr; gap: 1.4rem; align-items: start;
  padding: 1.2rem 0; border-bottom: 1px solid var(--border);
}
.pub__thumb { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; }
.pub__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pub__thumb--empty { display: grid; place-items: center; color: #aeb8c4; font-size: 1.4rem; }
.pub__title { font-weight: 700; color: var(--navy); font-size: 1.02rem; margin-bottom: 0.25rem; }
.pub__authors { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.15rem; }
.pub__authors b { color: var(--text); }
.pub__venue { font-style: italic; color: var(--muted); font-size: 0.88rem; margin-bottom: 0.5rem; }
.pub__note { display: inline-block; margin-left: 0.4rem; color: var(--accent-d); font-weight: 600; font-style: normal; }
.pub__links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pub__links a {
  font-size: 0.78rem; font-weight: 600; color: var(--navy);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.22rem 0.6rem;
}
.pub__links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ===========================================================
   News
   =========================================================== */
.news-list { max-width: 820px; }
.news-item { display: grid; grid-template-columns: 120px 1fr; gap: 1.5rem; padding: 1.3rem 0; border-bottom: 1px solid var(--border); }
.news-item__date { color: var(--accent-d); font-weight: 600; font-size: 0.88rem; padding-top: 0.1rem; }
.news-item__title { font-weight: 700; color: var(--navy); margin-bottom: 0.25rem; }
.news-item__desc { color: var(--muted); font-size: 0.94rem; }
.news-mini { list-style: none; }
.news-mini li { padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.94rem; }
.news-mini .date { color: var(--accent-d); font-weight: 600; font-size: 0.82rem; margin-right: 0.5rem; }

/* ===========================================================
   Robots
   =========================================================== */
.robot-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.18s, transform 0.18s; }
.robot-card:hover { box-shadow: var(--shadow-h); transform: translateY(-2px); }
.robot-card__thumb { aspect-ratio: 4 / 3; background: var(--bg-alt); position: relative; }
.robot-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.robot-card__thumb--empty { display: grid; place-items: center; color: #aeb8c4; font-size: 2rem; }
.robot-card__status { position: absolute; top: 0.6rem; right: 0.6rem; font-size: 0.7rem; font-weight: 700; padding: 0.2em 0.7em; border-radius: 20px; background: #fff; border: 1px solid var(--border); color: var(--muted); }
.robot-card__body { padding: 1.2rem 1.3rem 1.4rem; }
.robot-card__body h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.robot-card__desc { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.9rem; }
.robot-card__sensors { font-size: 0.82rem; color: var(--text); }
.robot-card__sensors strong { color: var(--navy); }

/* ===========================================================
   Fun gallery
   =========================================================== */
.gallery { columns: 3 240px; column-gap: 1rem; }
.gallery figure { break-inside: avoid; margin-bottom: 1rem; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-alt); }
.gallery img { width: 100%; display: block; }
.gallery figcaption { padding: 0.5rem 0.7rem; font-size: 0.8rem; color: var(--muted); }
.gallery-placeholder { aspect-ratio: 4 / 3; display: grid; place-items: center; color: #aeb8c4; font-size: 1.6rem; }

/* ===========================================================
   Project page
   =========================================================== */
.project-hero { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 3rem 0 2.5rem; text-align: center; }
.project-hero__inner { max-width: 800px; margin: 0 auto; }
.project-hero__title { font-size: 2.1rem; margin: 0.9rem 0; }
.project-hero__authors { color: var(--text); font-size: 1.02rem; }
.project-hero__authors a { color: var(--accent-d); }
.project-hero__affil { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; }
.project-hero__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.project-body { max-width: 820px; margin: 0 auto; padding: 3rem 1.5rem; }
.project-body h2 { font-size: 1.5rem; margin: 2.2rem 0 1rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
.project-body h2:first-child { margin-top: 0; }
.project-body p { margin-bottom: 1rem; color: var(--text); }
.project-body figure { margin: 1.5rem 0; }
.project-body figure img { border-radius: 10px; box-shadow: var(--shadow); }
.project-body figcaption { margin-top: 0.7rem; font-size: 0.88rem; color: var(--muted); text-align: center; }
.project-body pre { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; padding: 1.1rem; overflow-x: auto; font-size: 0.82rem; }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 10px; box-shadow: var(--shadow); }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.placeholder-box { border: 2px dashed var(--border); border-radius: 10px; padding: 2.5rem; text-align: center; color: #9aa6b2; background: var(--bg-alt); }
.back-link { padding: 1.5rem 0 0; }
.back-link a { color: var(--muted); font-weight: 600; font-size: 0.9rem; }

/* prose helper for callouts */
.callout { background: var(--bg-alt); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 1.1rem 1.3rem; margin: 1.5rem 0; }
.callout p:last-child { margin-bottom: 0; }
.note-todo { color: #9a6b00; }

/* CTA band */
.cta-band { background: var(--navy); color: #fff; text-align: center; padding: 3.5rem 0; }
.cta-band h2 { color: #fff; font-size: 1.8rem; margin-bottom: 0.7rem; }
.cta-band p { color: #cdd8e6; max-width: 600px; margin: 0 auto 1.6rem; }
.cta-band .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.4); }
.cta-band .btn--ghost:hover { background: rgba(255,255,255,0.12); }

/* ===========================================================
   Footer
   =========================================================== */
.site-footer { background: var(--bg-navy); color: #c7d2df; margin-top: 0; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; padding: 3rem 1.5rem 2rem; }
.site-footer__name { color: #fff; font-weight: 700; font-size: 1.05rem; }
.site-footer__meta { font-size: 0.88rem; color: #9fb0c2; }
.site-footer__meta a { color: #9fb0c2; }
.site-footer__links { display: flex; flex-direction: column; gap: 0.4rem; }
.site-footer__links a { color: #c7d2df; font-size: 0.9rem; }
.site-footer__social { display: flex; gap: 0.8rem; align-items: flex-start; }
.site-footer__social a { color: #9fb0c2; font-size: 1.2rem; }
.site-footer__social a:hover { color: #fff; }
.site-footer__copy { border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.8rem; color: #8497aa; padding: 1.1rem 0; text-align: center; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 66px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height 0.25s ease;
  }
  .site-nav.is-open { max-height: 460px; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 1rem 1rem; }
  .site-nav a { padding: 0.7rem 0.6rem; border-radius: 6px; }
  .director { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .director__links { justify-content: center; }
  .pub { grid-template-columns: 1fr; }
  .pub__thumb { max-width: 200px; }
  .news-item { grid-template-columns: 1fr; gap: 0.3rem; }
  .gallery { columns: 2 160px; }
}
@media (max-width: 480px) {
  .gallery { columns: 1; }
  .hero__inner { padding: 4rem 0 3.5rem; }
  .stats { gap: 1.5rem; }
}
