.home-hero {
  margin: 1rem 0 2rem;
  padding-bottom: 0.5rem;
}

.home-hero-align {
  max-width: 1084px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 1.1rem;
}

.home-hero-copy {
  width: 100%;
}

.home-hero-copy p {
  margin: 0 0 0.8rem;
  line-height: 1.45;
  text-align: justify;
  hyphens: auto;
}

/* everything after the first intro paragraph is a touch smaller */
.home-hero-copy p + p {
  font-size: 0.95em;
}

/* hover highlight on people links: stronger link-blue for the advisors, softer grayish blue for the rest */
.home-hero-copy a[target="_blank"] {
  border-radius: 3px;
  transition: all 0.2s ease;
}
.home-hero-copy a[target="_blank"]:hover {
  background-color: rgba(39, 97, 227, 0.14);
}

/* people links after the first paragraph (not the advisors) are a quieter grayish blue */
.home-hero-copy p + p a[target="_blank"] {
  color: #5f7189;
  text-decoration: underline;
  text-decoration-color: #c5cfdb;
  text-underline-offset: 2px;
  transition: all 0.2s ease;
}
.home-hero-copy p + p a[target="_blank"]:hover {
  color: #3d4f66;
  text-decoration-color: #3d4f66;
  background-color: rgba(95, 113, 137, 0.09);
}

.home-hero-note {
  color: #555;
  font-size: 0.95em;
  font-style: italic;
}

.home-news {
  font-size: 0.82rem;
  line-height: 1.25;
}

.home-hero-sidebar-photo {
  text-align: center;
  margin-top: 0.2rem;
}

.home-hero-sidebar-photo img {
  width: 185px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.home-news h3 {
  margin-top: 0;
  font-size: 0.95rem;
}

h2[data-anchor-id="essays"],
h3[data-anchor-id="news"] {
  margin-top: 0;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: lowercase;
}

.home-news ul {
  padding-left: 0.9rem;
  margin-bottom: 0.35rem;
}

.home-news li {
  margin: 0;
}

.home-news li + li {
  margin-top: 1.15rem;
}

.home-news time {
  font-weight: 600;
  font-size: 0.95em;
}

.home-news-more {
  display: block;
  text-align: right;
  margin-top: 0.25rem;
  font-size: 0.9em;
}

h2[data-anchor-id="essays"] .anchorjs-link,
h3[data-anchor-id="news"] .anchorjs-link {
  display: none !important;
}

/* heading + type pills share one line */
.essays-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 0 0 0.2rem;
}

.essays-head h2[data-anchor-id="essays"] {
  margin: 0;
}

/* hidden until JS mounts it — the pills do nothing without JS anyway */
.essay-types {
  display: none;
}

.essay-types.ready {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem;
  line-height: 1.2;
}

.essay-type {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  padding: 0.1rem 0.58rem;
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.5;
  color: #666;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.essay-type:hover {
  background: #fafafa;
  border-color: #b9b9b9;
  color: #1f1f1f;
}

.essay-type:focus-visible {
  outline: 2px solid #1f6feb;
  outline-offset: 1px;
}

.essay-type.active {
  background: #1f1f1f;
  border-color: #1f1f1f;
  color: #fff;
}

@media (max-width: 991.98px) {
  .home-hero-align {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  h2[data-anchor-id="essays"],
  h3[data-anchor-id="news"] {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
  }

  /* give the heading its own row so the accordion chevron keeps the
     right edge and the pills wrap underneath it */
  .essays-head h2[data-anchor-id="essays"] {
    flex: 1 1 100%;
  }

  .accordion-chevron {
    font-style: normal;
    font-size: 0.85em;
    margin-left: 0.4em;
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  .accordion-chevron.closed {
    transform: rotate(-90deg);
  }
}

/* hover bubble on "psycholinguist" in the intro; tabindex makes it work on tap/keyboard too */
.hover-note {
  position: relative;
  border-bottom: 1px dotted currentColor;
  cursor: help;
}
.hover-note::after,
.hover-note::before {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  transform: translateY(-4px);
  z-index: 20;
}
.hover-note::after {
  content: attr(data-note);
  top: calc(100% + 10px);
  left: 0;
  width: max-content;
  max-width: min(280px, 80vw);
  padding: 0.55rem 0.8rem;
  border-radius: 14px;
  background: #fff;
  border: 1px dashed #e8d9b0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  color: #333;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.35;
  text-align: left;
  hyphens: none;
}
.hover-note::before {
  content: "";
  top: calc(100% + 4px);
  left: 0.5rem;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px dashed #e8d9b0;
  border-top: 1px dashed #e8d9b0;
  rotate: 45deg;
  z-index: 21;
}
.hover-note:hover::after,
.hover-note:hover::before,
.hover-note:focus::after,
.hover-note:focus::before {
  opacity: 1;
  transform: none;
}
/* wide screens: bubble sits in the empty margin left of the intro, tail pointing right.
   shortcut: 1440px assumes the 1084px hero column; change both if that width changes */
@media (min-width: 1440px) {
  .home-hero-copy { position: relative; }
  .hover-note { position: static; }
  .hover-note::after,
  .hover-note::before { transform: translateX(-4px); }
  .hover-note::after {
    top: 0;
    left: auto;
    right: calc(100% + 16px);
    width: 175px;
    max-width: none;
  }
  .hover-note::before {
    top: 0.7rem;
    left: auto;
    right: calc(100% + 10px);
    border-left: none;
    border-right: 1px dashed #e8d9b0;
  }
}

/* ===== night mode (Darcula) ===== */
body.quarto-dark .home-hero-note {
  color: #909090;
}
body.quarto-dark .home-hero-copy p + p a[target="_blank"] {
  color: #8c9bad;
  text-decoration-color: #4e5a68;
}
body.quarto-dark .home-hero-copy p + p a[target="_blank"]:hover {
  color: #c3cfdc;
  text-decoration-color: #c3cfdc;
}
body.quarto-dark .hover-note::after,
body.quarto-dark .hover-note::before {
  background: #3c3f41;
}
body.quarto-dark .hover-note::after {
  color: #a9b7c6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
body.quarto-dark .essay-type {
  background: #313335;
  border-color: #4e5254;
  color: #a9b7c6;
}
body.quarto-dark .essay-type:hover {
  background: #3c3f41;
  border-color: #6b6f72;
  color: #ffffff;
}
body.quarto-dark .essay-type.active {
  background: #a9b7c6;
  border-color: #a9b7c6;
  color: #2b2b2b;
}
