/* ============================================================
   Horwitz Lab — main stylesheet
   Clean, fast, no dependencies
   ============================================================ */

:root {
  --uw-purple:   #4b2e83;
  --uw-gold:     #b7a57a;
  --uw-purple-dark: #391e6a;
  --text:        #1a1a1a;
  --text-muted:  #555;
  --bg:          #fff;
  --bg-alt:      #f7f5f2;
  --border:      #e0dcd6;
  --link:        #4b2e83;
  --link-hover:  #391e6a;
  --max-width:   900px;
  --font-sans:   "Georgia", "Times New Roman", serif;
  --font-ui:     system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Links ---- */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* ---- Site header ---- */
.site-header {
  background: var(--uw-purple);
  color: #fff;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.site-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.site-title:hover { color: var(--uw-gold); text-decoration: none; }

.site-title .subtitle {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.75;
  display: block;
  letter-spacing: 0;
}

/* ---- Nav ---- */
.site-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; }

.site-nav a {
  color: rgba(255,255,255,0.88);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover, .site-nav a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}

/* ---- Hero (home page) ---- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: #050810 center/cover no-repeat;
  color: #fff;
  padding: 4rem 1.5rem;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(5,8,16,0.82) 0%,
    rgba(5,8,16,0.55) 55%,
    rgba(5,8,16,0.15) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 580px;
  margin-left: 6vw;
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.6rem;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,0.88);
  line-height: 1.5;
  margin-bottom: 0.4rem;
  font-weight: 400;
}

.hero-dept {
  font-size: 0.9rem;
  color: var(--uw-gold);
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
  font-weight: 500;
}

.hero-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 0.55rem 1.3rem;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary { background: var(--uw-gold); color: #1a1a1a; }
.btn-outline { border: 2px solid rgba(255,255,255,0.6); color: #fff; }

/* ---- Research highlights on home ---- */
.home-section {
  max-width: var(--max-width);
  margin: 3rem auto;
  padding: 0 1.5rem;
}
.home-section h2 {
  font-size: 1.5rem;
  color: var(--uw-purple);
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--uw-gold);
  display: inline-block;
}
.home-section p { color: var(--text-muted); font-size: 1rem; max-width: 72ch; }

/* ---- Research Areas — alternating full-width rows ---- */
.research-areas-section > p { max-width: 72ch; }

.topics-list {
  margin-top: 2rem;
}

.topic-row {
  display: grid;
  grid-template-columns: clamp(200px, 36%, 320px) 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}
.topic-row:last-child { border-bottom: none; }

.topic-row--alt {
  grid-template-columns: 1fr clamp(200px, 36%, 320px);
}
.topic-row--alt .row-img  { order: 2; }
.topic-row--alt .row-text { order: 1; }

.row-img {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 16px rgba(75,46,131,.13);
  height: clamp(160px, 20vw, 240px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  min-width: 0;
  width: 100%;
}
.row-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.row-text {
  min-width: 0;
}
.row-text h3 {
  font-size: 1.1rem;
  color: var(--uw-purple);
  margin-bottom: 0.5rem;
}
.row-text p {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.row-cite {
  font-size: .78rem;
  color: #6a5a99;
  font-style: italic;
  margin-top: .5rem;
  display: block;
}

/* ---- Lightbox ---- */
.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lb-overlay.lb-open { display: flex; }
.lb-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  cursor: default;
}
.lb-close {
  position: fixed;
  top: 1.1rem;
  right: 1.4rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: .8;
}
.lb-close:hover { opacity: 1; }

/* ---- Responsive: stack rows on small screens ---- */
@media (max-width: 700px) {
  .topic-row,
  .topic-row--alt {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .topic-row--alt .row-img  { order: 0; }
  .topic-row--alt .row-text { order: 0; }
  .row-img { height: clamp(160px, 45vw, 220px); }
}

/* ---- Legacy card styles (kept for research page if used) ---- */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.topic-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.4rem;
}
.topic-card h3 { font-size: 1rem; color: var(--uw-purple); margin-bottom: 0.4rem; }
.topic-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; }

/* ---- Page layout ---- */
.page-wrap {
  flex: 1;
}

.page-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem 1.5rem;
}
.page-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.page-header h1 {
  font-size: 2rem;
  color: var(--uw-purple);
  letter-spacing: -0.02em;
}

.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ---- Members ---- */
.member-list { display: flex; flex-direction: column; gap: 2.5rem; }

.member-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.75rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.member-card:last-child { border-bottom: none; padding-bottom: 0; }

.member-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}
.member-photo-placeholder {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.member-info h2 {
  font-size: 1.15rem;
  color: var(--uw-purple);
  margin-bottom: 0.2rem;
}
.member-info h2 a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1.5px solid rgba(75, 46, 131, 0.3);
  transition: border-color 0.2s;
}
.member-info h2 a:hover {
  border-bottom-color: var(--uw-purple);
}
.member-role {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.member-bio {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.65;
}
.member-links { margin-top: 0.75rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.member-links a { font-size: 0.85rem; color: var(--link); }

@media (max-width: 600px) {
  .member-card {
    grid-template-columns: 1fr;
  }
  .member-photo, .member-photo-placeholder {
    width: 140px;
    height: 140px;
  }
}

/* ---- Publications ---- */
.pub-year-section { margin-bottom: 2.5rem; }
.pub-year {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--uw-purple);
  margin-bottom: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--uw-gold);
  display: inline-block;
}
.pub-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.pub-item {
  font-size: 0.95rem;
  line-height: 1.6;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  transition: border-color 0.15s;
}
.pub-item:hover { border-left-color: var(--uw-purple); }
.pub-item a { color: var(--link); font-weight: 500; }
.pub-journal { color: var(--text-muted); font-style: italic; }

/* ---- Gallery ---- */
.gallery-note {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 1rem;
}

/* ---- Links page ---- */
.links-sections { display: flex; flex-direction: column; }
.links-section { margin-bottom: 2rem; }
.links-category {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 .5rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.links-rows { display: flex; flex-direction: column; gap: 2px; }
.links-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  text-decoration: none;
  color: var(--text);
  font-size: .95rem;
  transition: border-color .15s, background .15s, color .15s;
}
.links-row:hover {
  border-left-color: var(--uw-purple);
  background: #f3f0f9;
  color: var(--uw-purple);
}
.links-row i {
  font-size: .95rem;
  color: var(--uw-purple);
  opacity: .55;
  flex-shrink: 0;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--uw-purple);
  color: rgba(255,255,255,0.75);
  padding: 2rem 1.5rem;
  margin-top: auto;
  font-size: 0.85rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.footer-inner h3 { color: var(--uw-gold); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.footer-inner p, .footer-inner a { color: rgba(255,255,255,0.75); font-size: 0.85rem; line-height: 1.6; }
.footer-inner a:hover { color: #fff; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 540px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.25rem; }
  .hero { min-height: 70vh; padding: 2.5rem 1.25rem; }
  .hero-content { margin-left: 0; }
}

/* ---- WIP banner (research page) ---- */
.wip-banner {
  background: repeating-linear-gradient(
    -45deg,
    #f5c518,
    #f5c518 10px,
    #1a1a1a 10px,
    #1a1a1a 20px
  );
  color: #fff;
  text-align: center;
  padding: 0.75rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.wip-text {
  background: rgba(0,0,0,0.75);
  padding: 0.3rem 1rem;
  border-radius: 3px;
}
.wip-icon { font-size: 1.2rem; }

/* ---- Gallery grid ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.gallery-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  transition: opacity 0.2s;
}
.gallery-item img:hover { opacity: 0.9; }
.gallery-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-family: var(--font-ui);
}

@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* ---- Gallery heading link ---- */
.gallery-more-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid var(--uw-purple);
  padding-bottom: 2px;
  transition: opacity .15s;
}
.gallery-more-link:hover { opacity: .7; }

/* ---- Gallery more — back link ---- */
.gallery-back {
  color: var(--uw-purple);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}
.gallery-back:hover { text-decoration: underline; }

/* ---- Gallery more intro text ---- */
.gallery-more-intro { font-family: "Pacifico", cursive; font-size: 1.6rem; color: var(--uw-purple); margin-bottom: 1.75rem; font-weight: 400; }

/* ── Alumni page ─────────────────────────────────────────────── */
.alumni-list { display: flex; flex-direction: column; gap: 0; }
.alumni-card {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.alumni-card:last-child { border-bottom: none; }
.alumni-info h2 { font-size: 1.1rem; color: var(--uw-purple); font-weight: 600; margin: 0 0 0.2rem; }
.alumni-role { font-size: .85rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 0.3rem; }
.alumni-current { font-size: .93rem; color: var(--text); line-height: 1.5; margin: 0; }

/* ── Members page alumni footer link ────────────────────────── */
.members-alumni-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .95rem;
}
.members-alumni-footer a {
  color: var(--uw-purple);
  font-weight: 500;
}
.members-alumni-footer a:hover { text-decoration: underline; }

/* ── Alumni Neurotree footer link ────────────────────────────── */
.alumni-neurotree {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .95rem;
}
.alumni-neurotree a { color: var(--uw-purple); font-weight: 500; }
.alumni-neurotree a:hover { text-decoration: underline; }

/* ── Research page ───────────────────────────────────────────── */
.page-intro {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 820px;
}

.demo-section {
  margin-bottom: 3rem;
}
.demo-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--uw-purple);
  margin-bottom: 0.75rem;
}
.demo-section > p {
  font-size: 0.97rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  max-width: 820px;
}

.animation-frame {
  background: #09111f;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.6rem;
  line-height: 0;
}
.animation-frame iframe {
  width: 800px;
  height: 660px;
  max-width: 100%;
  border: 0;
  display: block;
}

.demo-caption {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0 !important;
}

/* ── LGN animation frame (narrower than FEF) ────────────────────── */
.lgn-frame iframe { width: 800px; height: 660px; }
