/* ==========================================================================
   EcoHydroLab — stylesheet
   Palette, type, layout tokens
   ========================================================================== */
:root {
  --slate:      #0d3b45;   /* deep slate-teal, anchor */
  --slate-2:    #12505d;
  --river:      #2a7f9e;   /* river blue */
  --river-lt:   #6fb3c9;
  --sediment:   #c98a3b;   /* warm accent, used sparingly */
  --paper:      #f7f5f0;   /* off-white */
  --paper-2:    #eeece4;
  --ink:        #16232a;
  --muted:      #5c6b70;
  --line:       #d8d5cc;
  --white:      #ffffff;

  --maxw: 1120px;
  --gap: clamp(1rem, 2vw, 2rem);
  --radius: 4px;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--river); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--sediment); }

/* Layout helpers */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gap); }
.section { padding-block: clamp(3rem, 7vw, 6rem); }
.section--tight { padding-block: clamp(2rem, 4vw, 3.5rem); }
.section--alt { background: var(--paper-2); }
.section--dark { background: var(--slate); color: var(--paper); }
.section--dark a { color: var(--river-lt); }
.section--dark a:hover { color: var(--sediment); }
.section--feature { background: var(--paper-2); border-top: 3px solid var(--sediment); border-bottom: 3px solid var(--sediment); }
.badge-live {
  display: inline-block; margin-left: .6em; padding: .2em .7em; border-radius: 100px;
  background: var(--sediment); color: var(--white); font-size: .7rem; letter-spacing: .05em; vertical-align: middle;
}

/* Typography */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.12; color: var(--slate); letter-spacing: -0.01em; }
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--paper); }
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; font-family: var(--sans); font-weight: 600; }
p { margin-block: 0.6em; max-width: 68ch; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sediment);
  margin-bottom: 0.8rem;
  display: block;
}
.lead { font-size: 1.15rem; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  padding: 0.7rem 1.3rem; border-radius: var(--radius);
  border: 1.5px solid var(--slate); background: var(--slate); color: var(--paper);
  cursor: pointer; transition: all .15s ease;
}
.btn:hover { background: var(--slate-2); color: var(--white); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--slate); }
.btn--ghost:hover { background: var(--slate); color: var(--paper); }
.section--dark .btn--ghost { color: var(--paper); border-color: var(--paper); }
.section--dark .btn--ghost:hover { background: var(--paper); color: var(--slate); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,245,240,0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--slate); }
.brand .mark { width: 30px; height: 30px; flex: none; }
.nav-links { display: flex; gap: 1.6rem; list-style: none; align-items: center; }
.nav-links a { color: var(--ink); font-weight: 500; font-size: 0.95rem; position: relative; }
.nav-links a.active, .nav-links a:hover { color: var(--river); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 100%; height: 2px; background: var(--sediment);
}
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--slate); margin: 5px 0; transition: .2s; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--paper);
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav-links.open { max-height: 420px; }
  .nav-links li { width: 100%; border-top: 1px solid var(--line); }
  .nav-links a { display: block; padding: 1rem var(--gap); }
  .nav-links a.active::after { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--paper);
  background: linear-gradient(rgba(15,42,50,.72), rgba(15,42,50,.82)), url("../img/background.jpg");
  background-size: cover; background-position: center;
}
.hero-contours { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.28; }
.hero-inner { position: relative; z-index: 2; padding-block: clamp(4rem, 10vw, 7rem); }
.hero h1 { color: var(--paper); max-width: 16ch; }
.hero .lead { color: var(--river-lt); max-width: 56ch; margin-top: 1.2rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.tag {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  padding: .35rem .7rem; border: 1px solid rgba(255,255,255,.25); border-radius: 100px;
  color: var(--paper);
}
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2rem; }
.hero-cta .btn { background: var(--sediment); border-color: var(--sediment); color: var(--ink); }
.hero-cta .btn:hover { background: #d99a4f; }
.hero-cta .btn--ghost { background: transparent; color: var(--paper); border-color: rgba(255,255,255,.4); }
.hero-cta .btn--ghost:hover { background: var(--paper); color: var(--slate); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(13,59,69,.10); }
.card h3 { margin-bottom: .4rem; }
.card .icon { width: 40px; height: 40px; color: var(--river); margin-bottom: .9rem; }
.card p { font-size: .95rem; color: var(--muted); }

/* Research area cards with accent bar */
.research-card { border-top: 3px solid var(--river); }
.research-card:nth-child(2n) { border-top-color: var(--sediment); }
.research-card:nth-child(3n) { border-top-color: var(--slate-2); }

/* ---------- Highlights ---------- */
.highlight { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--gap); align-items: center; margin-bottom: 2.5rem; }
.highlight:nth-child(even) .highlight-media { order: 2; }
.highlight-media img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--paper-2); }
@media (max-width: 720px) { .highlight { grid-template-columns: 1fr; } .highlight:nth-child(even) .highlight-media { order: 0; } }

/* ---------- Section head ---------- */
.section-head { margin-bottom: 2.5rem; max-width: 60ch; }
.section-head p { color: var(--muted); }

/* ---------- Publications ---------- */
.pub-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; align-items: center; }
.filter-btn {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em;
  padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 100px;
  background: var(--white); color: var(--muted); cursor: pointer; transition: .15s;
}
.filter-btn:hover { border-color: var(--river); color: var(--river); }
.filter-btn.active { background: var(--slate); color: var(--paper); border-color: var(--slate); }
.pub-year { font-family: var(--serif); font-size: 1.6rem; color: var(--sediment); margin: 2rem 0 1rem; padding-bottom: .3rem; border-bottom: 2px solid var(--line); }
.pub {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line);
}
.pub-badge {
  font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--river); border: 1px solid var(--river-lt); border-radius: var(--radius);
  padding: .2rem .5rem; height: fit-content; white-space: nowrap;
}
.pub-badge.featured { color: var(--sediment); border-color: var(--sediment); }
.pub-title { font-weight: 600; color: var(--ink); }
.pub-title a:hover { color: var(--sediment); }
.pub-meta { font-size: .9rem; color: var(--muted); margin-top: .25rem; }
.pub-venue { font-style: italic; }
.pub-links { margin-top: .4rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.pub-links a { font-family: var(--mono); font-size: .74rem; letter-spacing: .03em; }

/* ---------- Team ---------- */
.person { text-align: center; }
.person .avatar {
  width: 130px; height: 130px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 1rem; border: 3px solid var(--paper-2); background: var(--paper-2);
}
.person h3 { font-size: 1.1rem; }
.person .role { font-family: var(--mono); font-size: .74rem; letter-spacing: .05em; color: var(--river); text-transform: uppercase; }
.person .desc { font-size: .88rem; color: var(--muted); margin-top: .5rem; }
.person .socials { margin-top: .6rem; display: flex; gap: .7rem; justify-content: center; }
.person .socials a { font-size: .8rem; font-family: var(--mono); }
.person .pubs { margin-top: .7rem; padding-top: .6rem; border-top: 1px dashed var(--line); text-align: left; }
.person .pubs-title { font-family: var(--mono); font-size: .68rem; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; margin-bottom: .35rem; }
.person .pubs ul { list-style: none; }
.person .pubs li { font-size: .8rem; line-height: 1.4; margin-bottom: .4rem; }
.person .pubs li a { color: var(--slate); }
.person .pubs li .pub-year { color: var(--muted); font-family: var(--mono); font-size: .72rem; }
.person .pubs .pubs-more { font-size: .78rem; }
.person .pubs .pubs-more a { font-family: var(--mono); }
.pi-grid { grid-template-columns: minmax(320px, 440px); justify-content: start; }
.team-group-title { margin: 2.5rem 0 1.5rem; }
.team-subgroup-title { font-size: 1.1rem; color: var(--river); margin: 2.5rem 0 1.2rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); font-family: var(--sans); font-weight: 600; letter-spacing: .01em; }
.team-subgroup-title:first-of-type { margin-top: 1rem; }
.team-year-title { font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--sediment); margin: 1.6rem 0 1rem; }

/* ---------- News ---------- */
.news-item { display: grid; grid-template-columns: 130px 1fr; gap: 1.2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.news-date { font-family: var(--mono); font-size: .8rem; color: var(--sediment); letter-spacing: .03em; padding-top: .15rem; }
.news-body p { margin: 0; font-size: .96rem; }
@media (max-width: 560px) { .news-item { grid-template-columns: 1fr; gap: .3rem; } }

/* ---------- Dataset feature ---------- */
.dataset-feature { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--gap); align-items: center; }
.dataset-stat { display: flex; gap: 2rem; margin: 1.5rem 0; flex-wrap: wrap; }
.dataset-stat .num { font-family: var(--serif); font-size: 2.6rem; color: var(--sediment); line-height: 1; }
.dataset-stat .lbl { font-size: .82rem; color: var(--muted); }
@media (max-width: 720px) { .dataset-feature { grid-template-columns: 1fr; } }

/* ---------- Join / CTA ---------- */
.join-list { list-style: none; margin: 1.2rem 0; }
.join-list li { padding: .6rem 0 .6rem 1.6rem; position: relative; border-bottom: 1px dashed rgba(255,255,255,.18); }
.join-list li::before { content: "→"; position: absolute; left: 0; color: var(--sediment); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c3cdd1; padding-block: 3rem 2rem; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--gap); margin-bottom: 2rem; }
.site-footer h4 { color: var(--paper); margin-bottom: .8rem; }
.site-footer a { color: #c3cdd1; }
.site-footer a:hover { color: var(--sediment); }
.footer-links { list-style: none; }
.footer-links li { margin: .35rem 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .82rem; color: #8a999e; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Page hero (interior) ---------- */
.page-hero {
  color: var(--paper); padding-block: clamp(2.5rem, 6vw, 4rem);
  background: linear-gradient(rgba(15,42,50,.72), rgba(15,42,50,.82)), url("../img/background.jpg");
  background-size: cover; background-position: center;
}
.page-hero h1 { color: var(--paper); }
.page-hero p { color: var(--river-lt); max-width: 60ch; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--river-lt); outline-offset: 2px; border-radius: 2px;
}

.center { text-align: center; }

/* PI page */
.pi-intro { display: grid; grid-template-columns: 260px 1fr; gap: 2.5rem; align-items: start; }
.pi-photo img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper-2); }
.pi-bio p { margin-bottom: 1rem; }
.pi-links { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.2rem; }
@media (max-width: 720px) { .pi-intro { grid-template-columns: 1fr; } .pi-photo { max-width: 240px; } }

.pi-metrics { display: flex; flex-wrap: wrap; gap: 2.5rem; align-items: baseline; margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.pi-metric .num { font-family: var(--serif); font-size: 2.4rem; color: var(--sediment); line-height: 1; }
.pi-metric .lbl { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.pi-note { font-size: .78rem; color: var(--muted); font-style: italic; margin-left: auto; align-self: flex-end; }

/* Timeline (appointments / education) */
.timeline { list-style: none; margin-top: 1rem; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.tl-when { font-family: var(--mono); font-size: .78rem; color: var(--river); letter-spacing: .02em; padding-top: .15rem; }
.tl-what { font-size: .96rem; }
.tl-sub { display: block; color: var(--muted); font-size: .88rem; margin-top: .2rem; }
@media (max-width: 520px) { .timeline li { grid-template-columns: 1fr; gap: .2rem; } }

/* Award cards */
.award-card { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.award-year { font-family: var(--mono); font-size: .72rem; color: var(--sediment); border: 1px solid var(--sediment); border-radius: var(--radius); padding: .2rem .5rem; height: fit-content; }
.award-card p { margin: 0; font-size: .95rem; }

/* Plain lists (editorial / memberships) */
.plain-list { list-style: none; margin-top: 1rem; }
.plain-list li { padding: .5rem 0 .5rem 1.4rem; position: relative; font-size: .95rem; border-bottom: 1px dashed var(--line); }
.plain-list li::before { content: "—"; position: absolute; left: 0; color: var(--river); }
.plain-list--muted li { padding: .3rem 0 .3rem 1.1rem; border-bottom: none; color: var(--muted); font-size: .95rem; }
.plain-list--muted li::before { content: "•"; color: var(--muted); }

.proj-meta { display: block; font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-top: .6rem; letter-spacing: .02em; }

/* Zenodo community banner */
.zenodo-banner { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.zenodo-banner-text h2 { margin: .2rem 0 .5rem; }
.zenodo-banner-text p { margin: 0; }
.zenodo-banner-cta { white-space: nowrap; }
@media (max-width: 720px) { .zenodo-banner { grid-template-columns: 1fr; gap: 1.2rem; } }

/* ---------- GIS window (CAMELS-IND catchments / gauges map) ---------- */
.gis-controls { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.gis-controls label {
  display: flex; flex-direction: column; gap: .35rem; flex: 1 1 220px; min-width: 200px;
  font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.gis-controls select {
  font-size: .92rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); color: var(--slate); cursor: pointer;
}
.gis-controls select:focus { outline: 2px solid var(--river); outline-offset: 1px; }
.gis-window { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); align-items: stretch; }
.gis-map { height: 560px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper-2); }
.gis-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 1.2rem; max-height: 560px; overflow-y: auto; }
.gis-panel h4 { margin-bottom: .6rem; font-size: 1.05rem; }
.gis-panel dt { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: .8rem; }
.gis-panel dt:first-child { margin-top: 0; }
.gis-panel dd { font-size: .95rem; margin: .1rem 0 0; }
.gis-panel .attr-primary { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.attr-toggle {
  display: block; width: 100%; margin-top: 1.1rem; padding: .55rem .7rem;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .03em; text-align: left;
  background: var(--paper-2); color: var(--slate); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.attr-toggle:hover { border-color: var(--river); color: var(--river); }
.attr-groups { margin-top: .8rem; }
.attr-group { border-top: 1px solid var(--line); padding: .6rem 0; }
.attr-group summary {
  cursor: pointer; font-family: var(--mono); font-size: .78rem; letter-spacing: .03em;
  color: var(--slate); text-transform: uppercase;
}
.attr-group .attr-count { color: var(--muted); text-transform: none; }
.attr-group dl { margin-top: .6rem; }
.attr-group dt { margin-top: .5rem; }
.attr-group dt:first-child { margin-top: .5rem; }
@media (max-width: 820px) { .gis-window { grid-template-columns: 1fr; } .gis-map { height: 380px; } .gis-panel { max-height: none; } }

/* Responsive video embed (16:9) */
.video-embed { position: relative; width: 100%; max-width: 860px; margin: 1.8rem auto 0; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.section--dark .video-embed { border-color: rgba(255,255,255,.15); }
.mt-2 { margin-top: 2rem; }
.muted { color: var(--muted); }
