/* Gallery — styled to match the rest of the site (research/ card grid) */

/* Base */
body {
  margin: 0;
  min-height: 100vh;
  background-color: rgb(250, 250, 250);
  font-family: "Helvetica Neue", sans-serif;
  color: #222;
}

/* Links */
a:link,
a:visited {
  color: inherit;
  text-decoration: none;
}

/* Header / hero */
.nm-header {
  max-width: 1100px;
  margin: 120px auto 0; /* leave room for the fixed header */
  padding: 0 24px;
  text-align: center;
}

.nm-header h1 {
  margin: 0 0 14px;
  font-size: 3.25rem;
  font-weight: 300;
  color: #222;
  letter-spacing: -0.02em; /* tighten display-size type (§15) */
}

.nm-subtitle {
  margin: 0 auto;
  max-width: 640px;
  color: #7a7a7a;
  font-size: 1.05rem;
  line-height: 1.6;
}

.nm-main {
  max-width: 1200px;
  margin: 72px auto 80px;
  padding: 0 24px;
}

/* Sections — one scrolling page; each section is a heading + its own grid.
   The heading is a quiet landmark, not a second page title: the hero owns the
   display type, so sections stay small and let the thumbnails lead. */
.nm-section + .nm-section {
  margin-top: 88px;
}

.nm-section-header {
  margin-bottom: 24px;
}

/* Anchor links (#neural-interfaces) must clear the fixed nav. */
.nm-section {
  scroll-margin-top: 96px;
}

.nm-section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 400;
  color: #222;
  letter-spacing: -0.005em;
}

.nm-section-subtitle {
  margin: 5px 0 0;
  color: #8a8a8a;
  font-size: 0.9rem;
  line-height: 1.5;
}

.nm-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}

/* Card */
.nm-card {
  background: transparent;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  color: inherit;
}

/* Thumbnail — a fixed ratio keeps every card's caption on the same baseline,
   which a fixed pixel height does not once the column width changes. */
.nm-thumb {
  aspect-ratio: 16 / 10;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-color: #ececec;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
  filter: grayscale(100%);
  -webkit-filter: grayscale(100%);
  transition:
    filter 0.3s ease,
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease;
}

.nm-card:hover .nm-thumb {
  filter: none;
  -webkit-filter: none;
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.11);
}

/* Press feedback on pointer-down, not on release (§1). */
.nm-card:active .nm-thumb {
  transform: scale(0.99);
  transition: transform 100ms ease-out;
}

/* Card content */
.nm-card-body {
  padding: 14px 2px 0;
}

.nm-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
  color: #222;
  line-height: 1.35;
}

.nm-card-desc {
  margin: 5px 0 0;
  font-size: 0.85rem;
  color: #8a8a8a;
  line-height: 1.5;
}

/* Tags — metadata, not controls. These aren't clickable, so they must not
   look like chips (§16 familiarity: same look = same behavior). Quiet text
   also keeps 30 labels from shouting over 10 thumbnails. */
.nm-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  font-size: 0.75rem;
  color: #a0a0a0;
  letter-spacing: 0.01em; /* small text reads better slightly open (§15) */
}

.nm-tag {
  text-transform: lowercase;
}

.nm-tag + .nm-tag::before {
  content: "·";
  margin-right: 6px;
  color: #c8c8c8;
}

/* Footer */
.nm-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 40px;
  color: #a0a0a0;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  text-align: center;
}

@media (max-width: 900px) {
  .nm-header {
    margin-top: 90px;
  }

  .nm-header h1 {
    font-size: 38px;
  }

  .nm-main {
    margin-top: 48px;
  }

  .nm-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .nm-section + .nm-section {
    margin-top: 60px;
  }
}

@media (max-width: 520px) {
  .nm-header {
    margin-top: 88px;
  }

  .nm-header h1 {
    font-size: 30px;
  }

  .nm-subtitle {
    font-size: 1rem;
  }

  .nm-main {
    margin-top: 36px;
  }

  .nm-gallery {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nm-thumb,
  .nm-card:hover .nm-thumb,
  .nm-card:active .nm-thumb {
    transition: filter 0.2s ease;
    transform: none;
  }
}
