/* =====================================================
   HUFNAGEL LAB — HOMEPAGE
   ===================================================== */


/* =====================================================
   1. HERO
   ===================================================== */

.hero {
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(14, 26, 43, 0.94) 40%,
    transparent 100%
  );
  z-index: 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(40px, 8vw, 80px);
  align-items: center;
  padding: 30px 0 60px;
}

.hero-inner > div:first-child {
  position: relative;
  z-index: 1;
}

.kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 600;
}

.hero h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0.35em 0 0.45em;
  font-size: clamp(2.2rem, 4.2vw, 3.1rem);
  max-width: 24ch;
  color: #fff;
}

.lead {
  max-width: 60ch;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 1.4em;
}


/* =====================================================
   2. HERO VISUAL WRAPPER
   ===================================================== */

.hero-visual-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  position: relative;
  z-index: 1;
}


/* =====================================================
   3. ANIMATION CONTAINER
   ===================================================== */

.visual {
  position: relative;
  isolation: isolate;

  width: 100%;
  height: 400px;

  border-radius: 18px;

  background:
    radial-gradient(
      circle at 65% 40%,
      rgba(211, 168, 90, 0.07),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      var(--navy-2),
      #0d2136
    );

  box-shadow:
    inset 0 0 0 1px rgba(241, 204, 125, 0.18),
    0 10px 40px rgba(0, 0, 0, 0.35);

  /*
   * Keep overflow visible so the social icons
   * can sit above the animation box.
   */
  overflow: visible;
}


/* =====================================================
   4. CONSTELLATION ANIMATION
   ===================================================== */

#constellation {
  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  display: block;

  border-radius: inherit;

  z-index: 0;

  pointer-events: none;
}


/* =====================================================
   5. GRADIENT BEHIND R CODE
   ===================================================== */

.visual::after {
  content: "";

  position: absolute;

  right: 0;
  bottom: 0;

  width: 58%;
  height: 48%;

  background: radial-gradient(
    ellipse at bottom right,
    rgba(10, 21, 35, 0.88) 0%,
    rgba(10, 21, 35, 0.55) 35%,
    rgba(10, 21, 35, 0.20) 65%,
    transparent 100%
  );

  border-bottom-right-radius: 18px;

  pointer-events: none;

  z-index: 1;
}


/* =====================================================
   6. R CODE ANIMATION
   ===================================================== */

#code-stream {
  position: absolute;

  inset: 0;

  width: 100%;
  height: 100%;

  display: block;

  pointer-events: none;

  z-index: 2;

  opacity: 0.65;
}


/* =====================================================
   7. NEURON ILLUSTRATION
   ===================================================== */

#neuron {
  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  display: block;

  opacity: 1;

  pointer-events: none;

  z-index: 3;

  filter:none;
}


/* =====================================================
   8. SOCIAL ICONS
   ===================================================== */

.social-icons {
  position: absolute;

  top: -55px;
  right: 10px;

  display: flex;
  align-items: center;
  gap: 18px;

  z-index: 5;

  background: rgba(14, 26, 43, 0.55);

  backdrop-filter: blur(8px);

  padding: 10px 14px;

  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.social-icons svg {
  width: 24px;
  height: 24px;

  opacity: 0.85;

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    filter 0.25s ease;
}

.social-icons svg:hover {
  opacity: 1;

  transform: scale(1.15);

  filter: drop-shadow(
    0 0 6px rgba(241, 204, 125, 0.8)
  );
}


/* =====================================================
   9. INSTITUTIONAL AFFILIATION
   ===================================================== */

.affiliation-block {
  display: block;

  position: static;

  width: 100%;

  margin-top: 16px;
  padding: 0;

  background: transparent;
  border: none;
  box-shadow: none;

  text-align: right;
}

.affiliation-block span {
  font-family: "Inter", sans-serif;

  font-size: 12px;
  font-weight: 500;

  line-height: 1.5;
  letter-spacing: 0.04em;

  color: rgba(244, 239, 230, 0.65);
}


/* =====================================================
   10. HOMEPAGE SECTIONS
   ===================================================== */

section.light {
  background: var(--cream);
  color: #111;
}

.section-pad {
  padding: 24px 0;
}

.tiles {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 24px;
}

.tile {
  background: #fff;

  border: 1px solid #e7e2d8;
  border-radius: 18px;

  padding: 20px;
}


/* =====================================================
   11. DARK STRIP — PUBLICATIONS AND NEWS
   ===================================================== */

.dark-strip {
  background: linear-gradient(
    180deg,
    #0e1a2b,
    #0b1c2d
  );

  border-top: 1px solid rgba(211, 168, 90, 0.18);
  border-bottom: 1px solid rgba(211, 168, 90, 0.14);
}

.grid-2 {
  display: grid;

  grid-template-columns: 1.1fr 0.9fr;

  gap: 34px;
}


/* =====================================================
   12. NEWS
   ===================================================== */

.news {
  display: grid;
  gap: 14px;
}

.news-item {
  display: grid;

  grid-template-columns: auto 1fr;

  gap: 12px;

  padding: 10px 0;

  border-bottom: 1px dashed rgba(241, 204, 125, 0.22);
}

.news-date {
  width: 7.2ch;
  color: #d9c8a7;
}


/* =====================================================
   13. HOMEPAGE PEOPLE SECTION
   ===================================================== */

.people-heading {
  display: flex;

  justify-content: space-between;
  align-items: flex-end;

  gap: 24px;

  margin-bottom: 35px;
}

.people-kicker {
  color: #a88443;

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0.15em;
}

.people-heading h2 {
  font-size: 36px;
  margin: 8px 0;
}

.people-heading p {
  color: #65707c;
  margin: 0;
}

.people-all-link {
  color: #a88443;

  text-decoration: none;

  font-size: 14px;
  font-weight: 600;

  white-space: nowrap;
}

.people-all-link:hover {
  color: var(--navy);
}


/* =====================================================
   14. PEOPLE GRID
   ===================================================== */

.people-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 320px));

  gap: 24px;

  align-items: start;
}


/* =====================================================
   15. PEOPLE CARDS — COMPACT DESIGN
   ===================================================== */

.home-person-card {
  background: #fff;
  border: 1px solid #e7e1d6;
  border-radius: 14px;
  overflow: hidden;
  max-width: 320px;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.home-person-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(14, 26, 43, 0.10);
}

.home-person-photo {
  display: block;
  width: 100%;
  height: 220px;

  object-fit: contain;
  object-position: center;

  background: #0e1a2b;
}

.home-person-content {
  padding: 18px 20px;
}

.home-person-role {
  color: #a88443;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-person-name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 21px;
  color: var(--navy);
  margin: 8px 0 12px;
}

.home-person-bio {
  color: #65707c;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 16px;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.home-person-link {
  color: #a88443;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.home-person-link:hover {
  color: var(--navy);
}


/* =====================================================
   16. RESPONSIVE
   ===================================================== */

@media (max-width: 900px) {

  .people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}


@media (max-width: 820px) {

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero h1 {
    max-width: 18ch;
    margin-left: auto;
    margin-right: auto;
  }

  .lead {
    margin-left: auto;
    margin-right: auto;
  }

  .visual {
    height: 320px;
    margin-bottom: 30px;
  }

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

  .affiliation-block {
    text-align: center;
  }

}


@media (max-width: 600px) {

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

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

  .people-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .people-heading h2 {
    font-size: 30px;
  }

  .hero-inner {
    gap: 25px;
  }

  .visual {
    height: 300px;
  }

  .social-icons {
    top: -45px;
    right: 5px;

    gap: 12px;

    padding: 8px 10px;
  }

  .social-icons svg {
    width: 20px;
    height: 20px;
  }

}

/* =====================================================
   17. NEURONAL CALCIUM ACTIVITY
   Controlled by JavaScript
   ===================================================== */

/* Resting appearance */

#neuron .calcium-neuron {
  opacity: 0.85;
}

/* Resting soma */

#neuron .calcium-neuron .soma {
  fill: #F4EFE6;
  fill-opacity: 0.18;
  stroke: none;
}

/* Calcium fluorescence halo */

#neuron .calcium-glow {
  fill: #F4EFE6;
  fill-opacity: 0;
  stroke: none;

  pointer-events: none;
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
  #neuron .calcium-neuron {
    filter: none !important;
  }
}