/* =========================================================
   Miao Group website styles
   ========================================================= */



/* ---------- Colours: change these to restyle the whole site ---------- */
:root {
  --bg: #EEF7F1;
  --band: #2A8460;
  --deep: #17543D;
  --leaf: #4DB383;
  --mint: #D3EEDD;
  --lime: #CDEB98;
  --lime-soft: #EEF8DC;
  --sun: #FFF3D1;
  --ink: #1E2D26;
  --muted: #4F6358;
  --card: #FFFFFF;
}



/* ---------- Basics ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

img {
  max-width: 100%;
}

address {
  font-style: normal;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 50;
  background: #fff;
  padding: 8px 12px;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news, .pubs, .grants, .methods {
  list-style: none;
  margin: 0;
  padding: 0;
}

.person .face {
  overflow: hidden;
}

.person .face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.person p, .news p {
  margin: 0;
}

.prose p {
  margin: 0 0 1em;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none!important;
  }
}


body {
  font: 400 1.08rem/1.7 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: var(--deep);
}

a:hover {
  color: var(--band);
}

:focus-visible {
  outline: 3px solid var(--deep);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(1040px, 100% - 40px);
  margin-inline: auto;
}


/* Green hero band */
.band {
  background: var(--band);
  border-radius: 0 0 48px 48px;
  padding: 18px 0 96px;
  position: relative;
  overflow: hidden;
}

.band::before, .band::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.band::before {
  width: 440px;
  height: 440px;
  left: -160px;
  top: 140px;
  background: rgba(255,255,255,.07);
}

.band::after {
  width: 320px;
  height: 320px;
  right: -90px;
  top: -70px;
  background: rgba(205,235,152,.16);
}

.bar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--card);
  border-radius: 999px;
  padding: 10px 14px 10px 18px;
  box-shadow: 0 8px 28px rgba(15,60,40,.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
}

.brand img {
  width: 38px;
}

.bar nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.bar nav a {
  padding: 7px 13px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: .95rem;
}

.bar nav a:hover {
  background: var(--mint);
  color: var(--deep);
}

.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-top: 52px;
  color: #fff;
}

.friends {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 22px;
}

.friends img {
  animation: hop 2.8s ease-in-out infinite;
}

.friends .f1 {
  width: 104px;
}

.friends .f2 {
  width: 150px;
  animation-delay: -.7s;
}

.friends .f3 {
  width: 110px;
  animation-delay: -1.4s;
}

.friends .f4 {
  width: 70px;
  animation-delay: -2s;
}

@keyframes hop {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.hero h1 {
  font-size: clamp(2.6rem,6vw,4.2rem);
  font-weight: 900;
  margin: 0 0 8px;
  letter-spacing: -.01em;
  line-height: 1.05;
}

.hero .lede {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--lime);
  margin: 0 auto 14px;
}

.hero p {
  max-width: 36em;
  margin: 0 auto 28px;
  color: #F0FAF4;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--deep);
  font-weight: 800;
  text-decoration: none;
}

.btn:hover {
  background: #fff;
  color: var(--deep);
}


/* Panels, the first one overlapping the band */
main > section {
  padding: 28px 0;
}

main > section:first-of-type {
  margin-top: -64px;
  position: relative;
  z-index: 2;
}

section > .wrap {
  background: var(--card);
  border-radius: 30px;
  padding: 42px 46px;
  box-shadow: 0 10px 32px rgba(42,132,96,.10);
}

h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.95rem;
  font-weight: 900;
  color: var(--deep);
  margin: 0 0 24px;
}

h2 img {
  width: 48px;
  flex: none;
}

h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 4px;
}

.split {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 36px;
}

.focus {
  background: var(--lime-soft);
  border-left: 6px solid var(--lime);
  border-radius: 18px;
  padding: 20px 22px;
}

.focus p {
  margin: 0;
}

.aside-title {
  font-weight: 800;
  margin: 0 0 10px;
}

.methods {
  display: grid;
  gap: 10px;
}

.methods li {
  background: var(--mint);
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
}


/* News: green layer with white cards */
#news > .wrap {
  background: var(--band);
}

#news h2 {
  color: #fff;
}

.news {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(260px,1fr));
  gap: 18px;
}

.news li {
  background: var(--card);
  border-radius: 22px;
  padding: 22px;
}

.news time {
  display: inline-block;
  background: var(--lime);
  color: var(--deep);
  font-weight: 800;
  font-size: .85rem;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.news p {
  color: var(--muted);
}


/* People */
.people {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(210px,1fr));
  gap: 18px;
}

.person {
  text-align: center;
  background: var(--mint);
  border-radius: 24px;
  padding: 24px;
}

.person .face {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 4px solid #fff;
  background: #fff;
}

.person p {
  color: var(--muted);
}


/* Publications */
.pubs li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 2px dotted var(--mint);
}

.pubs li:last-child {
  border: 0;
}

.pubs .yr {
  align-self: start;
  justify-self: start;
  background: var(--mint);
  color: var(--deep);
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .95rem;
}

.pubs .venue {
  color: gray;
  font-size: .95rem;
}

.pubs .author {
  color: var(--muted);
  font-size: .95rem;
}


/* Funding: lime layer */
#funding > .wrap {
  background: var(--lime-soft);
}

.grants {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(240px,1fr));
  gap: 16px;
}

.grants li {
  background: var(--card);
  border-radius: 20px;
  padding: 20px 22px;
  border-top: 5px solid var(--leaf);
}

.grants .since {
  display: block;
  color: var(--band);
  font-weight: 800;
  font-size: .9rem;
}

.grants strong {
  display: block;
}

.grants .detail {
  color: var(--muted);
  font-size: .95rem;
}


/* Contact: sunny layer */
#contact > .wrap {
  background: var(--sun);
}

.contact {
  display: flex;
  gap: 30px;
  align-items: center;
}

footer {
  background: var(--band);
  color: #E6F5EC;
  margin-top: 40px;
  padding: 32px 0;
  border-radius: 48px 48px 0 0;
  font-size: .92rem;
}

footer a {
  color: var(--lime);
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 760px) {
  section > .wrap {
    padding: 28px 22px;
    border-radius: 24px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .news li {
    grid-template-columns: 1fr;
  }
  .friends .f2 {
    width: 112px;
  }
  .friends .f1, .friends .f3 {
    width: 80px;
  }
  .friends .f4 {
    display: none;
  }
  .bar {
    border-radius: 24px;
  }
}
