@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');

/* Lawless Lab - global CSS
   Palette: ink #3f1854, pink #db2c7b, gold #f2c94c, blush #fcedf4, rule #f0c6da */

:root {
  --ink: #3f1854;
  --pink: #db2c7b;
  --gold: #f2c94c;
  --blush: #fcedf4;
  --rule: #f0c6da;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Arial, sans-serif;
  --display: 'Anton', var(--sans);
}

html { scroll-behavior: smooth; }

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
}

a { color: var(--pink); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.pdf-link {
  display: inline-block;
  margin: 0 0.4rem 0 0.3rem;
  padding: 0.1rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: var(--pink);
  border-radius: 4px;
}
.pdf-link:hover { background: var(--ink); text-decoration: none; }

/* NAV */
nav {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding: 1rem 2.5rem;
  background: var(--ink);
}
nav .logo {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #fff;
}
nav .logo:hover { text-decoration: none; }
nav ul {
  display: flex;
  gap: 2.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
nav ul li { position: relative; }
nav ul a {
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f2dcec;
}
nav ul a:hover { color: var(--gold); text-decoration: none; }

/* Dropdown base: always a plain block list. Visibility/positioning
   is handled separately per breakpoint below so mobile never
   inherits the desktop flex/absolute layout. */
nav .dropdown {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}
nav .dropdown li { padding: 0; }
nav .dropdown a {
  display: block;
  padding: 0.6rem 1.25rem;
  font-size: 0.92rem;
  white-space: nowrap;
}

/* Team dropdown: Students & Alumni (desktop hover behavior) */
@media (min-width: 721px) {
  nav .has-dropdown > .dropdown {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    margin-top: 0.75rem;
    padding: 0.5rem 0;
    background: var(--ink);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  }
  nav .has-dropdown:hover > .dropdown,
  nav .has-dropdown:focus-within > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  nav .dropdown a:hover { background: rgba(255,255,255,0.06); }
}

/* HERO */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 55vh;
  padding: 6rem 2rem 2rem;
  text-align: left;
  background: url('images/justice-illustration.png');
  background-size: cover;
  background-position: center 10%;
}
.hero h1 {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-size: clamp(3.5rem, 11vw, 8rem);
  font-weight: 400;
  line-height: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ink);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 var(--rule);
}
.hero p {
  max-width: 640px;
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
}

/* SECTIONS */
section { padding: 4rem 1.5rem; scroll-margin-top: 1rem; }
section > *:not(.inner),
section > .inner {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}
section > *:not(.inner) { box-sizing: border-box; }
section.shaded { background: var(--blush); }

section h2 {
  width: fit-content;
  margin: 0 0 2rem;
  padding-bottom: 0.7rem;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  border-bottom: 3px solid var(--pink);
}
section p { margin: 0 0 1.1rem; }
section strong { color: var(--ink); }

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 3rem;
  align-items: start;
}
.about-grid > img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(63, 24, 84, 0.18);
}

/* TEAM */
.team-card {
  display: flex;
  gap: 2.25rem;
  align-items: center;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.team-card:last-of-type { border-bottom: 0; }
.team-card img,
.team-initials {
  flex: 0 0 140px;
  width: 140px;
  height: 140px;
  box-sizing: border-box;
  border: 5px solid var(--pink);
  border-radius: 50%;
}
.team-card img { object-fit: cover; }
.team-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  font-family: var(--sans);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}
.team-card h3 {
  margin: 0.25rem 0 0.3rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.3;
}
.team-card .role {
  margin-bottom: 0.7rem;
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pink);
}
.team-card p { color: #4a3f5c; line-height: 1.75; }

/* STUDENTS AND ALUMNI (own page) */
h3.group {
  margin: 2.5rem auto 1.5rem;
  font-family: var(--display);
  font-size: 1.3rem;
  text-transform: uppercase;
  color: var(--pink);
}
h3.group:first-of-type { margin-top: 0.5rem; }
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.75rem 2rem;
}
.person { display: flex; align-items: center; gap: 1.1rem; }
.person img,
.person .initials {
  flex: 0 0 87px;
  width: 87px;
  height: 87px;
  box-sizing: border-box;
  border: 3px solid var(--pink);
  border-radius: 50%;
}
.person img { object-fit: cover; }
.person .initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}
.person .name, .alumni-list .name {
  display: block;
  font-weight: 700;
  line-height: 1.3;
}
.person .detail, .alumni-list .detail {
  display: block;
  font-size: 0.98rem;
  line-height: 1.4;
  color: #4a3f5c;
}
.alumni-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* RESEARCH */
.pub-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.pub-list li {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.pub-list .year {
  display: inline-block;
  margin-right: 0.6rem;
  padding: 0.1rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--gold);
  border-radius: 4px;
}
.more-link {
  display: block;
  margin-top: 1.5rem;
  font-weight: 700;
}

/* PUBLICATIONS GRID */
.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.75rem;
  margin: 2rem 0 1.5rem;
}
.pub-card {
  display: flex;
  flex-direction: column;
  color: var(--ink);
}
.pub-card:hover { text-decoration: none; }
.pub-card:hover .pub-title { color: var(--pink); text-decoration: underline; }

.pub-card .thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 280px;
  margin-bottom: 0.9rem;
  overflow: hidden;
  background: var(--blush);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.pub-card canvas.pdf-thumb {
  width: 100%;
  height: auto;
  display: block;
}
.pub-card .thumb.fallback {
  color: var(--pink);
}
.pub-card .thumb.fallback svg {
  width: 48px;
  height: 48px;
}

.pub-title {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
}
.pub-meta {
  display: block;
  font-family: var(--sans);
  font-size: 0.88rem;
  color: #4a3f5c;
}

@media (max-width: 720px) {
  .pub-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.25rem; }
  .pub-card .thumb { height: 220px; }
}

/* COLLABORATORS (own page) */
.collab-section { background: var(--blush); }
#collaborators > * { max-width: 1200px; }
.collab-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}
.collab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.4rem 1.5rem;
  text-align: center;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
}
.collab:hover {
  border-color: var(--pink);
  text-decoration: none;
}
.collab-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 96px;
  margin-bottom: 1rem;
  object-fit: contain;
  object-position: center;
}
.collab-name {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}

/* PROJECTS (hidden on the home page until the nav link is clicked) */
.projects-section {
  display: none;
  border-top: 1px solid var(--rule);
}
.projects-section:target { display: block; }
.project {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.project:first-child { padding-top: 0.5rem; }
.project:last-child { border-bottom: 0; }
.project h3 {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.35;
}
.project p { margin: 0 0 0.9rem; }
.project .soon {
  font-style: italic;
  color: #6b6385;
}
.project .funder {
  display: inline-block;
  margin-right: 0.75rem;
  padding: 0.15rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--blush);
  border-radius: 4px;
}

/* CONTACT */
.contact-block {
  margin-top: 2rem;
  padding: 2.25rem 2.5rem 1.75rem;
  background: var(--ink);
  border-radius: 8px;
  color: #f2dcec;
}
.contact-block p { margin: 0 0 1rem; }
.contact-block a { color: var(--gold); }

/* FOOTER */
footer {
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--ink);
}
footer p {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: #cbb8d6;
}
footer a { color: #fff; }
footer .social {
  display: inline-block;
  margin-top: 1rem;
  color: #fff;
  line-height: 0;
}
footer .social:hover { color: var(--gold); text-decoration: none; }

/* STUDENT BIO POPUP */
.person.has-bio { cursor: pointer; }
.person.has-bio .name {
  text-decoration: underline;
  text-decoration-color: var(--pink);
  text-underline-offset: 3px;
}
.person.has-bio:hover .name,
.person.has-bio:focus-visible .name { color: var(--pink); }

.bio-modal {
  width: min(560px, calc(100% - 2rem));
  max-height: calc(100vh - 3rem);
  padding: 2rem 2rem 1.75rem;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(63, 24, 84, 0.35);
}
.bio-modal::backdrop { background: rgba(63, 24, 84, 0.55); }
.bio-close {
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  padding: 0.25rem 0.5rem;
  border: 0;
  background: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.bio-close:hover { color: var(--pink); }
.bio-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.bio-photo img,
.bio-photo .initials {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  box-sizing: border-box;
  border: 4px solid var(--pink);
  border-radius: 50%;
  object-fit: cover;
}
.bio-photo .initials {
  background: var(--ink);
  font-family: var(--sans);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}
.bio-head h3 {
  margin: 0 0 0.2rem;
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1.25;
}
.bio-detail { margin: 0; font-size: 0.98rem; color: #4a3f5c; }
.bio-text p { margin: 0 0 1rem; }
.bio-text p:last-child { margin-bottom: 0; }

/* MOBILE */
@media (max-width: 720px) {
  nav { padding: 0.9rem 1.25rem; justify-content: center; }
  nav ul { flex-wrap: wrap; justify-content: center; gap: 0.75rem 1.25rem; }

  /* Dropdown becomes a stacked, centered block under the Team link,
     toggled by the 'open' class from JS on tap. It is never a flex
     row here, so it can't force horizontal overflow. */
  nav .has-dropdown > .dropdown {
    display: none;
    position: static;
    width: 100%;
    margin-top: 0.5rem;
    text-align: center;
  }
  nav .has-dropdown.open > .dropdown { display: block; }

  /* Taller hero so the title/tagline sit lower, off the illustration's face */
.hero {
  min-height: 38vh;
  padding: 6rem 1.25rem 2rem;
  background-position: center 20%;
}

  .hero h1 {
    font-size: clamp(2.5rem, 14vw, 3.5rem);
    -webkit-text-stroke: 1.5px var(--ink);
  }
  .hero p {
    font-size: clamp(0.95rem, 4vw, 1.1rem);
  }
  section { padding: 3.5rem 1.25rem; }
  .about-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .team-card { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .contact-block { padding: 1.75rem 1.5rem 1.25rem; }

  /* Students heading — align left like Alumni, and bigger photos */
  #students h3.group {
    text-align: left;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  #students .person img,
  #students .person .initials {
    width: 110px;
    height: 110px;
    flex-basis: 110px;
  }

.bio-modal {
  width: calc(100vw - 2rem);
  max-width: calc(100vw - 2rem);
  box-sizing: border-box;
  padding: 1.5rem 1.25rem 1.25rem;
}
.bio-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

  /* Collaborators — stop the right-edge cutoff on narrow screens */
  #collaborators > * { max-width: 100%; }
  .collab-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .collab { padding: 1rem; box-sizing: border-box; }

  /* Projects — more breathing room between the funder badge and the link after it */
  .project .funder { display: block; margin-bottom: 0.9rem; }
  .project > a { display: inline-block; margin-top: 0.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

