/* =========================================================================
   style.css — Christophe Droz · Research Website
   Custom layer on top of Tailwind (CDN). Defines:
   - Design tokens (CSS variables)
   - Base typography & page canvas
   - Reusable component classes (buttons, cards, galleries, accordions...)
   - Tab cross-fade + reveal-on-scroll animations
   To restyle the whole site, edit tokens / component classes here only.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------------------- */
:root {
  --c-bg:          #ffffff;   /* crisp white                       */
  --c-paper:       #faf9f6;   /* warm off-white canvas             */
  --c-ink:         #1f2937;   /* charcoal body text                */
  --c-navy:        #0f172a;   /* rich navy headings / navbar       */
  --c-academic:    #2563eb;   /* primary accent — academic blue    */
  --c-academic-d:  #1d4ed8;   /* darker blue (hover)               */
  --c-teal:        #0f766e;   /* secondary accent — muted teal     */
  --c-warm:        #64748b;   /* warm gray secondary text          */
  --c-red:         #C9191E;   /* People-page red accent            */
  --c-line:        #e5e7eb;   /* hairline dividers                 */

  --serif: "Crimson Text", "EB Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", "Lato", "Source Sans Pro", system-ui, -apple-system, sans-serif;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
}

/* -------------------------------------------------------------------------
   2. BASE
   ------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--c-ink);
  background-color: var(--c-paper);
  /* very faint grid background, used sparingly */
  background-image:
    linear-gradient(rgba(100, 116, 139, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 116, 139, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .font-serif { font-family: var(--serif); }

a { color: var(--c-academic); }
a:hover { color: var(--c-academic-d); }

/* Shared prose link style for inline citations */
.cite-link {
  color: var(--c-academic);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}
.cite-link:hover { color: var(--c-teal); }

/* -------------------------------------------------------------------------
   3. SECTION SCAFFOLDING
   ------------------------------------------------------------------------- */
.section-wrap { max-width: 72rem; margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 640px) { .section-wrap { padding-inline: 1.5rem; } }
@media (min-width: 1024px){ .section-wrap { padding-inline: 2rem; } }

.section-head {
  font-family: var(--serif);
  color: var(--c-navy);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-teal);
}

.hairline { border-top: 1px solid var(--c-line); }

/* -------------------------------------------------------------------------
   4. BUTTONS
   ------------------------------------------------------------------------- */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.6rem;
  padding: 0.65rem 1.15rem;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease,
              box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary { background: var(--c-academic); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--c-academic-d); color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn-secondary { background: #fff; color: var(--c-academic); border-color: var(--c-academic); }
.btn-secondary:hover { background: rgba(37, 99, 235, 0.06); color: var(--c-academic-d); }

.btn-ghost { background: transparent; color: var(--c-ink); }
.btn-ghost:hover { background: rgba(100, 116, 139, 0.10); color: var(--c-navy); }

.btn-copy {
  background: var(--c-navy);
  color: #fff;
  border-radius: 999px;
  font-family: var(--sans);
}
.btn-copy:hover { background: #020617; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-copy.is-copied { background: var(--c-teal); }

/* -------------------------------------------------------------------------
   5. CARDS
   ------------------------------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* Person card (People page, red accent language) */
.person-card .person-name { color: var(--c-navy); }
.person-card .person-role { color: var(--c-red); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.02em; text-transform: uppercase; }
.person-card:hover { border-color: rgba(201, 25, 30, 0.35); }
.person-card:hover .person-name { color: var(--c-red); }

.avatar { border-radius: 9999px; object-fit: cover; background: var(--c-paper); }

/* Placeholder avatar (anonymous members) */
.avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  border-radius: 9999px;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  color: var(--c-warm);
  font-weight: 700; font-family: var(--serif);
}

/* -------------------------------------------------------------------------
   6. LOGO STRIP
   ------------------------------------------------------------------------- */
.logo-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 1.75rem; }
.logo-strip img {
  height: 2.6rem; width: auto; object-fit: contain;
  filter: grayscale(100%); opacity: 0.7;
  transition: filter .25s ease, opacity .25s ease, transform .25s ease;
}
.logo-strip img:hover { filter: grayscale(0%); opacity: 1; transform: translateY(-2px); }
.logo-pill {
  display: inline-flex; align-items: center; height: 2.6rem; padding-inline: 0.9rem;
  border: 1px solid var(--c-line); border-radius: 0.6rem; background: #fff;
  color: var(--c-navy); font-weight: 600; font-size: 0.9rem; text-decoration: none;
}
.logo-pill:hover { border-color: var(--c-academic); color: var(--c-academic); }

/* -------------------------------------------------------------------------
   7. COMPOSITE IMAGE GALLERY (Image-Guidelines)
   ------------------------------------------------------------------------- */
.composite-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) { .composite-grid { grid-template-columns: repeat(2, 1fr); } }

.composite-grid figure {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 0.85rem;
  padding: 0.6rem;
  box-shadow: var(--shadow-sm);
  margin: 0;
  transition: transform .25s ease, box-shadow .25s ease;
}
.composite-grid figure:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.composite-grid img {
  width: 100%;
  height: 16rem;
  object-fit: contain;
  border-radius: 0.55rem;
  background: var(--c-paper);
  display: block;
}
.composite-grid figcaption {
  margin-top: 0.6rem;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--c-warm);
}

/* -------------------------------------------------------------------------
   8. RESEARCH AXIS GRID (clickable visual tiles)
   ------------------------------------------------------------------------- */
.axis-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0.9rem;
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-sm);
  background: var(--c-navy);
  aspect-ratio: 16 / 10;
  text-decoration: none;
  transition: transform .3s ease, box-shadow .3s ease;
}
.axis-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.axis-tile video, .axis-tile img, .axis-tile iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; border: 0;
}
.axis-tile .axis-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1rem 1.1rem;
  background: linear-gradient(to top, rgba(15,23,42,0.78) 0%, rgba(15,23,42,0.15) 55%, rgba(15,23,42,0) 100%);
  color: #fff;
  z-index: 2;
}
.axis-tile .axis-num {
  font-family: var(--serif); font-size: 1rem; letter-spacing: 0.12em;
  text-transform: uppercase; opacity: 0.85;
}
.axis-tile .axis-name { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.2; }

.axis-section { scroll-margin-top: 6rem; }

/* -------------------------------------------------------------------------
   9. ACCORDION (Contact audience cards)
   ------------------------------------------------------------------------- */
.accordion-trigger { width: 100%; text-align: left; cursor: pointer; background: none; border: 0; }
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, opacity .35s ease, padding .35s ease;
  opacity: 0;
}
.accordion-panel.is-open,
.accordion.is-open .accordion-panel { max-height: 2600px; opacity: 1; }
.accordion .accordion-chevron { transition: transform .3s ease; }
.accordion.is-open .accordion-chevron { transform: rotate(180deg); }

/* -------------------------------------------------------------------------
   10. QUICK LINK CARDS (Contact)
   ------------------------------------------------------------------------- */
.quick-link-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
  padding: 1.1rem 0.75rem; text-align: center; text-decoration: none;
  color: var(--c-navy);
}
.quick-link-card svg { width: 2rem; height: 2rem; color: var(--c-academic); transition: color .2s ease, transform .2s ease; }
.quick-link-card:hover svg { color: var(--c-teal); transform: translateY(-2px); }
.quick-link-card span { font-size: 0.85rem; font-weight: 600; }

/* -------------------------------------------------------------------------
   11. NAVBAR
   ------------------------------------------------------------------------- */
.nav-link {
  position: relative;
  font-weight: 500;
  color: var(--c-ink);
  text-decoration: none;
  padding: 0.35rem 0.15rem;
  transition: color .2s ease;
}
.nav-link:hover { color: var(--c-academic); }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  height: 2px; width: 0; background: var(--c-academic);
  transition: width .25s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--c-academic); }
.nav-link.active::after { width: 100%; }

/* Mobile menu */
.mobile-menu { display: none; }
.mobile-menu.open { display: block; }

/* -------------------------------------------------------------------------
   12. TAB CROSS-FADE + REVEAL ANIMATIONS
   ------------------------------------------------------------------------- */
#main-content { transition: opacity .28s ease; }
#main-content.is-loading { opacity: 0; }

.tab-panel { animation: tabFadeIn .35s ease both; }
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Toast for copy confirmation */
.copy-toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(1rem);
  background: var(--c-navy); color: #fff; padding: 0.6rem 1.1rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 80;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* -------------------------------------------------------------------------
   13. UTILITIES
   ------------------------------------------------------------------------- */
.prose-body p { line-height: 1.75; margin-bottom: 1.05rem; }
.prose-body { color: var(--c-ink); font-size: 1.07rem; }

.dropcap::first-letter {
  font-family: var(--serif);
  font-size: 3.2rem;
  font-weight: 700;
  float: left;
  line-height: 0.8;
  padding: 0.18rem 0.55rem 0 0;
  color: var(--c-academic);
}

/* -------------------------------------------------------------------------
   14. REDUCED MOTION
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
