/* ==========================================================
   METHAB — shared stylesheet
   Used by every page of the site.
   ========================================================== */

/* ---------- Colours (change them here, they apply everywhere) ---------- */
:root {
  --bg:        #060a14;   /* night / space background          */
  --bg-soft:   #0c1426;   /* cards and alternate sections      */
  --line:      #1b2a47;   /* borders                           */
  --flame:     #2f7bff;   /* methane flame blue (main accent)  */
  --flame-in:  #8fd3ff;   /* light inner cone of the flame     */
  --text:      #e6ecf7;   /* main text                         */
  --muted:     #9aa8c2;   /* secondary text                    */
  --max:       1100px;    /* max page width                    */
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

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

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

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { line-height: 1.2; font-weight: 700; }
h2 { font-size: 2rem; margin-bottom: 0.6em; }
h3 { font-size: 1.2rem; margin-bottom: 0.4em; }

/* small blue label above section titles */
.eyebrow {
  display: block;
  color: var(--flame);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.6em;
}

/* ---------- Header / menu ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(6, 10, 20, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}
.logo:hover { text-decoration: none; }

.nav { display: flex; flex-wrap: wrap; gap: 4px 22px; list-style: none; }
.nav a { color: var(--muted); font-size: 0.95rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--flame-in); }

/* ---------- Hero (top of home page) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 110px;
  text-align: center;
  /* the "flame glow" */
  background:
    radial-gradient(ellipse 45% 55% at 50% 105%, rgba(143, 211, 255, 0.35), transparent 70%),
    radial-gradient(ellipse 70% 80% at 50% 110%, rgba(47, 123, 255, 0.45), transparent 70%),
    var(--bg);
}

.hero-logo {
  width: 260px;
  max-width: 70%;
  margin: 0 auto 28px;
  filter: drop-shadow(0 10px 40px rgba(47, 123, 255, 0.25));
}

.hero h1 {
  font-size: clamp(3rem, 9vw, 6rem);
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, #ffffff 30%, var(--flame-in));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .subtitle {
  max-width: 760px;
  margin: 18px auto 36px;
  color: var(--muted);
  font-size: 1.15rem;
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid var(--flame);
  color: var(--text);
  font-weight: 600;
  margin: 6px;
}
.btn:hover { text-decoration: none; background: rgba(47, 123, 255, 0.15); }
.btn.primary { background: var(--flame); }
.btn.primary:hover { background: #4a8cff; }

/* ---------- Sections ---------- */
section { padding: 90px 0; }
section.alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.lead { font-size: 1.15rem; color: var(--muted); max-width: 820px; }
.lead + .lead { margin-top: 1em; }

/* ---------- Key numbers strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  text-align: center;
}
.stat .num { font-size: 2.6rem; font-weight: 800; color: var(--flame-in); }
.stat .label { color: var(--muted); font-size: 0.95rem; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}
section.alt .card { background: var(--bg); }
.card p { color: var(--muted); }
.card .tag { color: var(--flame); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- Partners ---------- */
.partners {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.partner {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
}
.partner p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Page title (inner pages) ---------- */
.page-head {
  padding: 90px 0 40px;
  background:
    radial-gradient(ellipse 60% 100% at 50% 0%, rgba(47, 123, 255, 0.18), transparent 70%),
    var(--bg);
}
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 0.4em; }

/* ---------- People (team page) ---------- */
.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.person {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  border-top: 3px solid var(--flame);
  padding: 24px 20px;
  text-align: center;
}
section.alt .person { background: var(--bg); }
.person h3 { margin-bottom: 6px; }
.person p { color: var(--muted); font-size: 0.92rem; margin-top: 10px; }
.role {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.role.coord { color: var(--flame-in); }

/* ---------- Field sites ---------- */
:root {
  /* shown when a site photo is missing */
  --photo-fallback: linear-gradient(160deg, #1c3c78, #0c1426 70%);
}
.site {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 80px;
}
.site:last-child { margin-bottom: 0; }
.site.reverse .site-photo { order: 2; }   /* photo on the right */
.site-photo {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
}
.site-text .tag { color: var(--flame); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.site-text h2 { margin-top: 6px; }
.site-text p { color: var(--muted); }

@media (max-width: 760px) {
  .site { grid-template-columns: 1fr; gap: 20px; }
  .site.reverse .site-photo { order: 0; }
}

/* ---------- Research lines ---------- */
.line {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}
.line:first-child { padding-top: 0; }
.line:last-child { border-bottom: none; padding-bottom: 0; }
.line-num {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  /* outline effect made with shadows: -webkit-text-stroke showed glitches
     on some fonts (e.g. the "2" on Mac) */
  color: var(--bg);
  text-shadow:
    -1.5px -1.5px 0 var(--flame),  1.5px -1.5px 0 var(--flame),
    -1.5px  1.5px 0 var(--flame),  1.5px  1.5px 0 var(--flame),
     0     -1.5px 0 var(--flame),  0      1.5px 0 var(--flame),
    -1.5px  0     0 var(--flame),  1.5px  0     0 var(--flame);
}
.line-body .tag { color: var(--flame); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.line-body h2 { margin-top: 6px; }
.line-body .cards { margin-top: 28px; }

@media (max-width: 760px) {
  .line { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Timeline ---------- */
.timeline {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 10px 20px;
  margin-top: 40px;
  align-items: center;
}
.tl-axis {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  color: var(--muted);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.tl-axis span { border-left: 1px solid var(--line); padding-left: 6px; }
.tl-label { color: var(--muted); font-size: 0.92rem; text-align: right; }
.tl-row {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  height: 18px;
}
.tl-bar { border-radius: 999px; background: var(--flame); }
.tl-bar.b2 { background: #5a9bff; }
.tl-bar.b3 { background: var(--flame-in); }
.tl-bar.b4 { background: #c9e9ff; }
.tl-bar.b5 { background: #3b4f75; }

@media (max-width: 760px) {
  .timeline { grid-template-columns: 1fr; }
  .tl-axis { grid-column: 1; }
  .tl-label { text-align: left; margin-top: 8px; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }

/* ---------- Timeline milestones (project meetings) ---------- */
.tl-ms {
  width: 14px;
  height: 14px;
  justify-self: center;
  align-self: center;
  transform: rotate(45deg);
  border: 2px solid var(--flame-in);
  background: var(--bg-soft);
}
.tl-ms.done { background: var(--flame-in); }
.tl-note { margin-top: 24px; color: var(--muted); font-size: 0.9rem; }
.tl-note .tl-ms { display: inline-block; width: 10px; height: 10px; margin: 0 8px 0 16px; }
.tl-note .tl-ms:first-child { margin-left: 0; }

/* ---------- Timeline month cells (subtle grid behind the bars) ---------- */
.tl-row {
  height: 22px;
  background: repeating-linear-gradient(
    to right,
    rgba(143, 211, 255, 0.05) 0,
    rgba(143, 211, 255, 0.05) calc(100% / 24 - 2px),
    transparent calc(100% / 24 - 2px),
    transparent calc(100% / 24)
  );
  border-radius: 4px;
}
.tl-bar { margin: 3px 0; }

/* ---------- Publications (outputs page) ---------- */
.pubs { margin-top: 32px; }
.pub {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.pub:first-child { border-top: 1px solid var(--line); }
.pub-year { font-size: 1.4rem; font-weight: 800; color: var(--flame); }
.pub-body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.pub-body h3 a { color: var(--text); }
.pub-body h3 a:hover { color: var(--flame-in); }
.pub-authors { color: var(--muted); }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-journal { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }
.pub-links { margin-top: 10px; font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pub-oa {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--flame-in);
  border: 1px solid var(--flame);
  border-radius: 999px;
  padding: 2px 10px;
}
@media (max-width: 760px) {
  .pub { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- Gallery carousel ---------- */
.carousel { position: relative; }
.track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;              /* hide scrollbar (Firefox) */
}
.track::-webkit-scrollbar { display: none; }  /* hide scrollbar (Chrome/Safari) */
.slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}
.frame {
  aspect-ratio: 16 / 9;
  max-height: 70vh;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--photo-fallback);   /* shown while a photo is missing */
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.slide figcaption { margin-top: 14px; color: var(--muted); text-align: center; }
.car-btn {
  position: absolute;
  top: calc(50% - 22px);
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--flame);
  background: rgba(6, 10, 20, 0.7);
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.car-btn:hover { background: var(--flame); }
.car-btn.prev { left: 16px; }
.car-btn.next { right: 16px; }
.car-counter { margin-top: 8px; text-align: center; color: var(--flame-in); font-size: 0.9rem; font-weight: 600; }
.carousel.single .car-btn { display: none; }   /* no arrows with 0–1 photos */

/* ---------- Budget of each research unit (home page) ---------- */
.partner .budget {
  margin-top: 14px;
  color: var(--flame-in);
  font-size: 1.1rem;
  font-weight: 700;
}

/* ---------- Key numbers in bordered boxes (home page) ---------- */
.stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 16px;
  background: var(--bg-soft);
}

/* ---------- Mobile menu (☰ button on phones) ---------- */
.menu-toggle, .menu-btn { display: none; }

@media (max-width: 760px) {
  .menu-btn {
    display: block;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text);
    cursor: pointer;
    padding: 4px 8px;
  }
  .nav {
    display: none;              /* hidden until ☰ is tapped */
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 8px 0 4px;
  }
  .nav a { display: block; padding: 10px 0; font-size: 1.05rem; border-top: 1px solid var(--line); }
  .menu-toggle:checked ~ .nav { display: flex; }
}

/* ---------- Full-screen viewer (gallery) ---------- */
.frame img { cursor: zoom-in; }
.car-full {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 20, 0.7);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}
.car-full:hover { background: var(--flame); }
.carousel.empty .car-full { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 5, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lb-img {
  max-width: calc(100vw - 160px);   /* leave room for the arrows */
  max-height: 86vh;
  object-fit: contain;
  border-radius: 6px;
}
.lb-caption {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.6rem;
  line-height: 1;
}
.lightbox button:hover { background: var(--flame); }
.lb-close { top: 18px; right: 18px; font-size: 1.2rem !important; }
.lb-prev  { left: 18px;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
@media (max-width: 760px) {
  .lb-img { max-width: 100vw; border-radius: 0; }   /* phones: full width, swipe to change photo */
  .lb-prev, .lb-next { top: auto !important; bottom: 60px; transform: none !important; }
}
.frame video { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* ---------- Round "scroll down" button with pulsing glow (home hero) ---------- */
.cue-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-top: 6px;
  border-radius: 50%;
  border: 1px solid var(--flame);
  color: var(--flame-in);
  font-size: 1.4rem;
  animation: pulse 2.4s ease-out infinite;
}
.cue-ring:hover { text-decoration: none; background: var(--flame); color: #fff; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0    rgba(47, 123, 255, 0.55); }
  70%  { box-shadow: 0 0 0 18px rgba(47, 123, 255, 0); }
  100% { box-shadow: 0 0 0 0    rgba(47, 123, 255, 0); }
}

/* ---------- Figures from the project (home, research) ---------- */
.figure { margin-top: 48px; }
.figure img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}
.figure.narrow { max-width: 780px; }
.figure figcaption { margin-top: 12px; color: var(--muted); font-size: 0.92rem; max-width: 820px; }
.fig-license { display: block; margin-top: 6px; font-size: 0.8rem; color: var(--muted); opacity: 0.8; }

/* ---------- Hint line (gallery page) ---------- */
.hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.9rem;
}
.hint-icon { color: var(--flame-in); font-size: 1rem; }
