/* ================================================================
   HydroclimateX Lab — Design System
   Based on academic site patterns · Hohai Blue #004098
   Fonts: DM Sans + Playfair Display + DM Mono
   ================================================================ */

/* ---- Custom Properties ---- */
:root {
  --ink:    #004098;   /* Hohai blue — main dark */
  --blue:   #0055b3;   /* links, eyebrow */
  --cyan:   #1fb6d5;   /* accent */
  --teal:   #078f91;   /* hero italic */
  --green:  #4c9f70;
  --orange: #ed7a32;
  --gold:   #e7af27;
  --paper:  #f5f8f9;
  --line:   #cfdee4;
  --muted:  #526a7b;
}

/* ---- Reset ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 'DM Sans', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 5; background: #fff; padding: .5rem; }

/* ---- Header ---- */
.site-header {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.2rem, 5vw, 5rem);
  border-bottom: 1px solid var(--line);
  background: #f9fbfc;
  position: sticky;
  top: 0;
  z-index: 3;
}
.brand {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .02em;
}
.brand span {
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  margin-right: .5rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font: 500 11px 'DM Mono';
}
nav { display: flex; gap: 1.35rem; }
nav a, .text-link {
  color: var(--ink);
  text-decoration: none;
  font-size: .88rem;
}
nav a:hover, .text-link:hover { color: var(--blue); }
.menu-button { display: none; }

/* ---- Hero ---- */
.hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 3rem;
  align-items: center;
  padding: clamp(4rem, 9vw, 8rem) clamp(1.2rem, 8vw, 8rem);
  background: radial-gradient(circle at 82% 20%, #d9e8f5, transparent 23%),
              linear-gradient(145deg, #f9fbfc 45%, #e7eef5);
}
.eyebrow {
  font: 500 .74rem 'DM Mono';
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .11em;
}
.hero h1, h2 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.06;
}
.hero h1 {
  max-width: 800px;
  margin: .55rem 0 1.4rem;
  font-size: clamp(3rem, 6vw, 5.8rem);
  letter-spacing: -.045em;
}
.hero h1 em {
  font-style: italic;
  color: var(--teal);
}
.lead {
  max-width: 680px;
  font-size: 1.15rem;
  color: var(--muted);
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 2rem;
}
.button {
  display: inline-block;
  padding: .75rem 1rem;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--ink);
  font-weight: 600;
  font-size: .86rem;
  cursor: pointer;
}
.button:hover { background: var(--blue); border-color: var(--blue); }
.outline {
  margin-top: 1.2rem;
  background: transparent;
  color: var(--ink);
}
.outline:hover { background: var(--ink); color: #fff; }

/* Hero visual — extreme illustration */
.hero-visual { justify-self: end; }
.extreme-card {
  position: relative;
  max-width: 360px;
}
.extreme-card svg {
  display: block;
  width: 100%;
  border: 8px solid #fff;
  box-shadow: 15px 15px 0 var(--cyan);
}
.extreme-caption { padding: .8rem .4rem; }
.extreme-caption strong, .extreme-caption span { display: block; }
.extreme-caption span { font-size: .78rem; color: var(--muted); }

/* ---- Facts bar ---- */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
  background: #fff;
}
.facts div {
  padding: 1.4rem clamp(1rem, 3vw, 3rem);
  border-right: 1px solid var(--line);
}
.facts div:last-child { border: 0; }
.facts span, .recognition-grid span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
}
.facts strong { display: block; margin-top: .25rem; font-size: .95rem; }
.facts small { display: block; font-size: .72rem; color: var(--muted); margin-top: .2rem; }

/* ---- Sections ---- */
.section {
  padding: clamp(4.5rem, 8vw, 7.5rem) clamp(1.2rem, 8vw, 8rem);
  border-bottom: 1px solid var(--line);
}
.section h2 {
  margin: .4rem 0 1.8rem;
  font-size: clamp(2.1rem, 4vw, 4rem);
  letter-spacing: -.035em;
}
.split, .team, .teaching, .methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 8vw, 9rem);
}
.prose {
  max-width: 670px;
  color: #314b5e;
}
.prose p { margin-top: 0; }
.prose ul { padding-left: 1.2rem; color: var(--muted); font-size: .92rem; }
.prose li { margin-bottom: .4rem; }

/* ---- Research section (dark) ---- */
.research-section {
  background: var(--ink);
  color: #fff;
}
.research-section .eyebrow { color: #7bc0e8; }
.research-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: #1a3a78;
  border: 1px solid #1a3a78;
}
.research-card {
  min-height: 260px;
  padding: 1.35rem;
  background: #003388;
}
.research-card span {
  font: 500 .78rem 'DM Mono';
  color: #7bc0e8;
}
.research-card h3 {
  font: 600 1.22rem 'DM Sans';
  margin: 3.5rem 0 .7rem;
}
.research-card p {
  font-size: .86rem;
  color: #c4d5f0;
}
.research-card.orange { background: #67351e; }
.research-card.teal   { background: #104e55; }
.research-card.green  { background: #274d3e; }
.research-card.gold   { background: #5a491f; }

/* ---- Methods / Approach ---- */
.methods { background: #e7eef5; }
.methods ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: item;
}
.methods li {
  padding: 1rem 0;
  border-bottom: 1px solid #b9c8dd;
  font-weight: 600;
}
.methods li span {
  display: inline-block;
  width: 3rem;
  color: var(--blue);
  font: 500 .75rem 'DM Mono';
}
.methods small {
  display: block;
  margin: .25rem 0 0 3.1rem;
  color: var(--muted);
  font-weight: 400;
}

/* ---- Publications ---- */
.section-intro {
  max-width: 760px;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 1.7rem 0;
}
.filters button {
  border: 1px solid var(--line);
  background: #fff;
  padding: .45rem .65rem;
  color: var(--ink);
  font: 500 .72rem 'DM Mono';
  cursor: pointer;
  transition: all .15s;
}
.filters button.active,
.filters button:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.publication-list { border-top: 1px solid var(--line); }
.publication {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
}
.publication .meta {
  font: .72rem 'DM Mono';
  color: var(--blue);
}
.publication h3 { margin: 0 0 .3rem; font-size: 1rem; }
.publication p { margin: 0; color: var(--muted); font-size: .87rem; }
.publication a { color: var(--ink); }
.publication .pub-venue { font-style: italic; }

/* ---- Showcase ---- */
.software-badges {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 1.5rem 0 1.8rem;
}
.sw-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; font-weight: 600; color: var(--ink);
  background: #fff; border: 1px solid var(--line);
  padding: 6px 14px; text-decoration: none;
  transition: all .15s;
}
.sw-badge:hover { border-color: var(--blue); color: var(--blue); }
.sw-lang {
  font: 500 .62rem 'DM Mono'; color: #fff;
  background: var(--ink); padding: 1px 6px; letter-spacing: .04em;
}
.sw-stars { font-size: .72rem; color: var(--gold); }

.wasp-demo-wrapper {
  border: 1px solid var(--line);
  overflow: hidden;
}
.wasp-demo-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: #0f172a; color: #a0a0b0;
  font: 500 .78rem 'DM Mono';
}
.wasp-demo-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #22c55e; flex-shrink: 0;
}
.wasp-iframe {
  width: 100%; height: 620px; border: none;
  display: block; background: #fff;
}

/* ---- Team / Contact ---- */
.team {
  background: linear-gradient(120deg, #e1ebf5, #f5f9f8);
}

/* ---- Recognition ---- */
.recognition {
  background: var(--ink);
  color: #fff;
}
.recognition .eyebrow { color: #7bc0e8; }
.recognition-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #1a3a78;
}
.recognition-grid article {
  padding: 1.5rem;
  background: #003388;
}
.recognition-grid strong { display: block; margin-bottom: .5rem; }

/* ---- Footer ---- */
footer {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.6fr;
  gap: 2rem;
  padding: 2.2rem clamp(1.2rem, 8vw, 8rem);
  background: #002766;
  color: #c4d5f0;
  font-size: .8rem;
}
footer strong, footer > div span, footer > span { display: block; }
footer a { color: #fff; text-decoration: none; }

/* ---- Responsive ---- */
@media (max-width: 850px) {
  nav { display: none; }
  .menu-button { display: block; border: 0; background: transparent; color: var(--ink); font: 500 .8rem 'DM Mono'; cursor: pointer; }
  .site-header.open nav {
    display: flex; position: absolute; top: 74px; left: 0; right: 0;
    padding: 1rem; flex-direction: column; background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .hero, .split, .team, .teaching, .methods { grid-template-columns: 1fr; }
  .hero { padding-top: 4rem; }
  .hero-visual { justify-self: start; }
  .extreme-card { max-width: 280px; }
  .facts, .research-grid, .recognition-grid { grid-template-columns: 1fr 1fr; }
  .publication { grid-template-columns: 1fr; gap: .4rem; }
  .section { padding: 4rem 1.3rem; }
  footer { grid-template-columns: 1fr; }
  .research-card { min-height: 200px; }
}

@media (max-width: 520px) {
  .facts, .research-grid, .recognition-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 3.2rem; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
}
