/* ============================================================
   Design System — Robin Mesnage
   ============================================================ */

/* --- Custom properties --- */
:root {
  --navy:        #0f172a;
  --navy-mid:    #1e293b;
  --blue:        #2563eb;
  --blue-hover:  #1d4ed8;
  --blue-light:  #eff6ff;
  --teal:        #0ea5e9;
  --bg:          #f8fafc;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --text-light:  #94a3b8;
  --radius-sm:   6px;
  --radius:      12px;
  --radius-lg:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:      0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.12);
  --nav-height:  64px;
  --transition:  .2s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Lato', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 600; }
p { max-width: 70ch; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Navigation
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  transition: box-shadow var(--transition);
}
.site-nav.scrolled { box-shadow: var(--shadow); }
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}
.nav-brand {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; color: var(--blue); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a, .nav-links .nav-dropdown-toggle {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Lato', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-links a:hover, .nav-links .nav-dropdown-toggle:hover {
  color: var(--navy);
  background: var(--bg);
  text-decoration: none;
}
.nav-links a.nav-cta {
  background: var(--blue);
  color: white;
  padding: 6px 16px;
}
.nav-links a.nav-cta:hover { background: var(--blue-hover); }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 170px;
  padding: 6px;
  z-index: 300;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text);
}
.nav-dropdown-menu a:hover { background: var(--bg); color: var(--blue); text-decoration: none; }

/* Mobile toggle */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--navy);
  border-radius: var(--radius-sm);
}
.nav-mobile-toggle:hover { background: var(--bg); }
.hamburger { display: flex; flex-direction: column; gap: 5px; width: 22px; }
.hamburger span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile nav panel */
.nav-mobile-panel {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 190;
  padding: 16px 24px 24px;
}
.nav-mobile-panel.open { display: block; }
.nav-mobile-panel a, .nav-mobile-panel .nav-section-label {
  display: block;
  padding: 10px 0;
  font-size: 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.nav-mobile-panel .nav-section-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
  font-weight: 700;
  margin-top: 12px;
  border-bottom: none;
}
.nav-mobile-panel a:hover { color: var(--blue); text-decoration: none; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-hover); box-shadow: 0 4px 12px rgba(37,99,235,.35); color: white; }
.btn-outline { background: transparent; color: white; border-color: rgba(255,255,255,.5); }
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: white; color: white; }
.btn-ghost { background: transparent; color: var(--blue); border-color: var(--border); }
.btn-ghost:hover { background: var(--blue-light); border-color: var(--blue); }

/* ============================================================
   Hero — Homepage
   ============================================================ */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, #162844 60%, #1a3a5c 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  padding: calc(var(--nav-height) + 64px) 64px 80px;
  max-width: 1140px;
  margin: 0 auto;
}
.hero-content { color: white; }
.hero-eyebrow {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 16px;
}
.hero h1 { color: white; margin-bottom: 20px; }
.hero h1 span { color: var(--teal); }
.hero-subtitle {
  font-size: 1.1rem;
  color: #94a3b8;
  margin-bottom: 36px;
  max-width: 52ch;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-image-wrap {
  display: flex;
  justify-content: center;
}
.hero-image-wrap img {
  width: 100%;
  max-width: 380px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  object-fit: cover;
  filter: grayscale(15%);
}
.hero-bg-wrap {
  background: linear-gradient(135deg, var(--navy) 0%, #162844 60%, #1a3a5c 100%);
  padding-top: var(--nav-height);
}

/* ============================================================
   Stats bar
   ============================================================ */
.stats-bar {
  background: var(--blue);
  padding: 40px 24px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}
.stat-number {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: white;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: .85rem;
  color: rgba(255,255,255,.7);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ============================================================
   Feature cards — Homepage
   ============================================================ */
.features-section {
  padding: 96px 24px;
  background: var(--bg);
}
.section-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}
.section-title { margin-bottom: 48px; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 36px 32px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.feature-icon {
  width: 52px; height: 52px;
  background: var(--blue-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  color: var(--blue);
  font-size: 1.4rem;
}
.feature-card h3 { margin-bottom: 12px; color: var(--navy); }
.feature-card p { color: var(--text-muted); font-size: .95rem; line-height: 1.7; margin-bottom: 20px; }
.feature-card a.card-link {
  font-size: .875rem;
  font-weight: 600;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.feature-card a.card-link:hover { gap: 8px; text-decoration: none; }

/* ============================================================
   Page hero (inner pages)
   ============================================================ */
.page-hero {
  padding: calc(var(--nav-height) + 56px) 24px 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.page-hero--dark {
  background: linear-gradient(135deg, var(--navy) 0%, #162844 100%);
  color: white;
}
.page-hero__title {
  color: white;
  margin-bottom: 12px;
}
.page-hero__subtitle {
  color: #94a3b8;
  font-size: 1.05rem;
  max-width: 60ch;
}
.page-hero--light .page-hero__title { color: var(--navy); }
.page-hero--light .page-hero__subtitle { color: var(--text-muted); }

/* ============================================================
   Research content sections
   ============================================================ */
.content-section {
  padding: 72px 24px;
}
.content-section:nth-child(even) { background: var(--surface); }
.content-section:nth-child(odd) { background: var(--bg); }
.content-section .container > h2 { margin-bottom: 20px; }
.content-section .container > p, .content-section .container > h5 {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 78ch;
}
.content-section img {
  border-radius: var(--radius);
  margin: 32px auto;
  box-shadow: var(--shadow);
}

/* Accordion (research pages) */
.accordion-group { margin-bottom: 8px; }
.accordion-btn {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition), border-color var(--transition);
}
.accordion-btn:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.accordion-btn.open { background: var(--blue-light); border-color: var(--blue); color: var(--blue); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.accordion-arrow { transition: transform .25s ease; font-size: .8rem; }
.accordion-btn.open .accordion-arrow { transform: rotate(180deg); }
.accordion-body {
  display: none;
  border: 1px solid var(--blue);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 28px 24px;
  background: var(--surface);
}
.accordion-body.open { display: block; }
.accordion-body p, .accordion-body h5 {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 78ch;
}
.accordion-body ul { margin: 12px 0 16px 20px; list-style: disc; }
.accordion-body ul li { margin-bottom: 10px; line-height: 1.7; color: var(--text-muted); }
.accordion-body img {
  border-radius: var(--radius);
  margin: 20px auto;
  box-shadow: var(--shadow);
}

/* ============================================================
   Publications page
   ============================================================ */
.pub-page { padding: 48px 24px 80px; }

.pub-controls {
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
  background: var(--bg);
  padding: 16px 0;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.pub-search-wrap {
  position: relative;
  margin-bottom: 16px;
}
.pub-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}
.pub-search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 1rem;
  font-family: 'Lato', sans-serif;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.pub-search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.pub-search-input::placeholder { color: var(--text-light); }
.pub-count {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .8rem;
  color: var(--text-light);
  white-space: nowrap;
}

.year-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.year-pill {
  padding: 5px 14px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Montserrat', sans-serif;
}
.year-pill:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.year-pill.active { background: var(--blue); color: white; border-color: var(--blue); }

.pub-year-section { margin-bottom: 56px; scroll-margin-top: calc(var(--nav-height) + 130px); }
.pub-year-heading {
  font-size: 1.8rem;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.pub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 12px;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.pub-card:hover {
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}
.pub-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.45;
  margin-bottom: 8px;
  font-family: 'Lato', sans-serif;
}
.pub-authors {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.pub-authors strong { color: var(--blue); font-weight: 700; }
.pub-journal {
  font-size: .875rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 14px;
}
.pub-doi-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--blue);
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 50px;
  transition: all var(--transition);
}
.pub-doi-link:hover {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  text-decoration: none;
}
.pub-no-results {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--navy);
  color: #94a3b8;
  padding: 56px 24px 40px;
}
.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
}
.footer-brand {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}
.footer-tagline { font-size: .9rem; margin-bottom: 20px; }
.footer-contact { font-size: .875rem; line-height: 1.8; }
.footer-contact a { color: #93c5fd; }
.footer-contact a:hover { color: white; }
.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.footer-social a {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8;
  font-size: .95rem;
  transition: all var(--transition);
}
.footer-social a:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  text-decoration: none;
}
.footer-nav { display: flex; flex-direction: column; gap: 10px; text-align: right; }
.footer-nav a { font-size: .9rem; color: #94a3b8; }
.footer-nav a:hover { color: white; text-decoration: none; }
.footer-bottom {
  max-width: 1140px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .8rem;
  color: #475569;
}

/* ============================================================
   Scroll reveal animation
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: calc(var(--nav-height) + 48px) 24px 64px;
    gap: 40px;
    text-align: center;
  }
  .hero-cta { justify-content: center; }
  .hero-image-wrap img { max-width: 260px; margin: 0 auto; }
  .hero-image-wrap { order: -1; }
  .stats-grid { grid-template-columns: repeat(3,1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { text-align: left; }
}

@media (max-width: 640px) {
  :root { --nav-height: 56px; }
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; }
  .hero { padding: calc(var(--nav-height) + 32px) 20px 48px; }
  .stats-grid { grid-template-columns: 1fr; gap: 16px; }
  .stat-number { font-size: 2.2rem; }
  .features-section { padding: 56px 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .pub-page { padding: 32px 16px 60px; }
  .pub-card { padding: 20px; }
  .content-section { padding: 48px 20px; }
  .year-nav { gap: 4px; }
  .year-pill { font-size: .75rem; padding: 4px 11px; }
}
