/* Marco Baiesi academic homepage - static responsive style */
:root {
  --bg: #f5faf7;
  --paper: #fff;
  --ink: #14211d;
  --muted: #5f706a;
  --line: #d7e5df;
  --accent: #047857;
  --accent-2: #0f766e;
  --accent-dark: #064e3b;
  --soft: #e7f5ef;
  --soft-2: #dff3ea;
  --max: 1120px;
  --radius: 8px;
  --shadow: 0 14px 34px rgba(6, 78, 59, .08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fbfffd 0%, var(--bg) 100%);
  line-height: 1.66;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(4, 120, 87, .25);
}

a:hover {
  border-bottom-color: var(--accent-dark);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(244, 250, 247, .9);
  border-bottom: 1px solid rgba(215, 229, 223, .9);
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: .85rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 750;
  letter-spacing: 0;
  color: var(--ink);
  border: 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .75rem 1rem;
  font-size: .94rem;
}

.nav-links a {
  color: var(--muted);
  border: 0;
}

.nav-links a:hover {
  color: var(--accent-dark);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.4rem 1.2rem 5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.card,
.hero-card,
.photo-card,
.topic-card,
.info-card,
.paper-card {
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 2.8rem 3rem;
}

.photo-card {
  width: 100%;
  max-width: 300px;
  justify-self: end;
  padding: .9rem;
  display: grid;
  gap: .85rem;
}

.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--soft);
}

.profile-links {
  display: grid;
  gap: .45rem;
}

.profile-links a {
  display: grid;
  gap: .1rem;
  padding: .62rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfffd;
  color: var(--ink);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.3;
}

.profile-links a:hover {
  border-color: rgba(4, 120, 87, .55);
}

.profile-links span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
}

h1,
h2,
h3 {
  font-family: inherit;
  line-height: 1.1;
  color: #0f1f1a;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 3.65rem;
  font-weight: 750;
}

.subtitle {
  margin: 1rem 0 0;
  font-size: 1.22rem;
  color: var(--muted);
  max-width: 43rem;
}

.hero-summary {
  margin-top: 1.6rem;
  font-size: 1rem;
  max-width: 48rem;
}

section {
  margin-top: 4.2rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.3rem;
}

.section-head h2 {
  margin: 0;
  font-size: 2.35rem;
}

.section-head p {
  margin: 0;
  max-width: 35rem;
  color: var(--muted);
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.topic-card {
  padding: 1.35rem;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(6, 78, 59, .12);
}

.topic-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbf9;
}

.topic-thumb::before,
.topic-thumb::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.topic-thumb-stochastic {
  background:
    repeating-linear-gradient(90deg, rgba(4, 120, 87, .12) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(4, 120, 87, .08) 0 1px, transparent 1px 28px),
    #f5fbf8;
}

.topic-thumb-stochastic::before {
  inset: 28% 11% 35%;
  border-top: 3px solid rgba(4, 120, 87, .82);
  border-radius: 55% 45% 45% 55%;
  transform: rotate(-6deg);
}

.topic-thumb-stochastic::after {
  inset: 36% 18% 22%;
  border-right: 3px solid rgba(15, 118, 110, .72);
  border-bottom: 3px solid rgba(15, 118, 110, .72);
  border-radius: 38% 62% 52% 48%;
  transform: rotate(5deg);
}

.topic-thumb-microrheology {
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(15, 118, 110, .14) 18% 20%, transparent 20% 38%, rgba(4, 120, 87, .16) 38% 40%, transparent 40% 62%, rgba(15, 118, 110, .13) 62% 64%, transparent 64% 100%),
    repeating-linear-gradient(0deg, rgba(95, 112, 106, .09) 0 2px, transparent 2px 16px),
    #f8fbf6;
}

.topic-thumb-microrheology::before {
  width: 34%;
  height: 34%;
  left: 33%;
  top: 32%;
  border: 3px solid rgba(4, 120, 87, .78);
  border-radius: 50%;
  background: rgba(255, 255, 255, .62);
}

.topic-thumb-microrheology::after {
  width: 36%;
  height: 3px;
  left: 49%;
  top: 49%;
  background: rgba(15, 118, 110, .75);
  box-shadow: 8px 0 0 rgba(15, 118, 110, .75);
}

.topic-thumb-learning {
  background:
    repeating-linear-gradient(90deg, rgba(20, 33, 29, .08) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, rgba(20, 33, 29, .08) 0 1px, transparent 1px 32px),
    #f7fafb;
}

.topic-thumb-learning::before {
  inset: 22% 14%;
  background:
    linear-gradient(30deg, transparent 0 20%, rgba(4, 120, 87, .5) 20% 22%, transparent 22% 100%),
    linear-gradient(150deg, transparent 0 31%, rgba(15, 118, 110, .48) 31% 33%, transparent 33% 100%),
    linear-gradient(90deg, transparent 0 48%, rgba(4, 120, 87, .36) 48% 50%, transparent 50% 100%);
}

.topic-thumb-learning::after {
  inset: 18% 12%;
  background:
    radial-gradient(circle at 18% 28%, rgba(4, 120, 87, .78) 0 4px, transparent 5px),
    radial-gradient(circle at 48% 45%, rgba(15, 118, 110, .8) 0 5px, transparent 6px),
    radial-gradient(circle at 78% 30%, rgba(4, 120, 87, .72) 0 4px, transparent 5px),
    radial-gradient(circle at 32% 74%, rgba(15, 118, 110, .74) 0 5px, transparent 6px),
    radial-gradient(circle at 70% 72%, rgba(4, 120, 87, .7) 0 4px, transparent 5px);
}

.topic-number {
  color: var(--accent);
  font-weight: 800;
  font-size: .9rem;
  letter-spacing: 0;
}

.topic-card h3 {
  margin: .65rem 0 .75rem;
  font-size: 1.55rem;
  font-weight: 750;
}

.topic-card p {
  color: var(--muted);
  margin-top: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  color: #fff;
  background: var(--accent-dark);
  border: 0;
  border-radius: var(--radius);
  padding: .66rem .95rem;
  font-weight: 700;
  line-height: 1.25;
}

.button:hover {
  background: var(--accent);
  border: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}

.info-card {
  padding: 1.35rem;
}

.info-card h3 {
  margin-top: 0;
  font-size: 1.5rem;
}

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

.publication-card {
  max-width: 640px;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  margin: .75rem 0;
}

.contact-label {
  display: block;
  color: var(--muted);
  font-size: .82rem;
}

.link-list {
  display: grid;
  gap: .7rem;
  margin: 1rem 0 0;
}

.link-list a {
  display: block;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfffd;
  color: var(--ink);
}

.link-list a span {
  display: block;
  color: var(--muted);
  font-size: .86rem;
  margin-top: .15rem;
}

.page-title {
  max-width: 780px;
  margin-top: 1rem;
}

.page-title h1 {
  font-size: 3.35rem;
}

.page-title p {
  font-size: 1.1rem;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.2rem;
  align-items: start;
  margin-top: 2rem;
}

.prose {
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.2rem;
}

.prose h2 {
  font-size: 2rem;
  margin-top: 2.3rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  color: #31413c;
}

.sidebar {
  position: sticky;
  top: 5.5rem;
  padding: 1.2rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sidebar h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.sidebar a {
  display: block;
  margin: .65rem 0;
  border: 0;
}

.paper-list {
  display: grid;
  gap: .9rem;
  margin-top: 1rem;
}

.paper-card {
  padding: 1rem;
  box-shadow: none;
  background: #fbfffd;
}

.paper-card p {
  margin: .3rem 0;
}

.paper-title {
  font-weight: 750;
  color: var(--ink);
}

.paper-meta {
  color: var(--muted);
  font-size: .94rem;
}

.notice {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft-2);
  color: #24443a;
}

.papers-list {
  max-width: 920px;
}

.papers-list .page-content > h3 {
  margin-top: 0;
  font-size: 1.55rem;
}

.papers-list .page-content > a {
  display: inline-flex;
  margin-bottom: .6rem;
  font-weight: 700;
}

.papers-list ol {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0;
}

.papers-list ol > div {
  width: 100% !important;
  padding: 1.15rem 1.25rem;
  overflow-wrap: anywhere;
  background: #fbfffd !important;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}

.papers-list ol > div h3 {
  margin: 0 0 1rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--line);
  color: var(--accent-dark);
  font-size: 1.45rem;
}

.papers-list li {
  margin: 0 0 1rem 1.5rem;
  padding-left: .2rem;
  color: #31413c;
}

.papers-list li:last-child {
  margin-bottom: 0;
}

.papers-list b {
  color: var(--ink);
}

.redirect-card {
  max-width: 720px;
  margin: 4rem auto;
}

.redirect-card h1 {
  font-size: 2.4rem;
}

footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.2rem;
  color: var(--muted);
  font-size: .92rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  main {
    padding-top: 1.8rem;
  }

  .hero,
  .info-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .photo-card {
    justify-self: center;
    max-width: 300px;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: block;
  }

  .section-head p {
    margin-top: .8rem;
  }

  h1 {
    font-size: 3rem;
  }

  .page-title h1 {
    font-size: 2.8rem;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  main {
    padding-top: 1.4rem;
  }

  .hero-card {
    padding: 1.45rem;
  }

  h1 {
    font-size: 2.45rem;
  }

  .subtitle {
    font-size: 1.05rem;
  }

  .section-head h2 {
    font-size: 2rem;
  }

  .page-title h1 {
    font-size: 2.35rem;
  }

  .prose {
    padding: 1.35rem;
  }

  .papers-list ol > div {
    padding: 1rem;
  }

  .papers-list li {
    margin-left: 1.2rem;
  }
}
