:root{
  /* Light theme */
  --bg: #eef1f7;
  --card: #ffffff;
  --border: rgba(15, 23, 42, .18);
  --border2: rgba(15, 23, 42, .26);
  --text: rgba(15, 23, 42, .96);
  --muted: rgba(15, 23, 42, .72);
  --muted2: rgba(15, 23, 42, .58);

  --brand: #4f46e5;  /* indigo */
  --brand2:#0891b2;  /* cyan */

  --shadow2: 0 10px 26px rgba(2, 6, 23, .10);
  --radius: 18px;
  --max: 1120px;
}

/* =========================
   Base
   ========================= */

*{ box-sizing:border-box; }

html{ -webkit-text-size-adjust: 100%; }

body{
  margin:0;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height: 1.45;
  letter-spacing: .1px;

  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(79,70,229,.18), transparent 60%) no-repeat,
    radial-gradient(900px 450px at 95% 10%, rgba(8,145,178,.14), transparent 55%) no-repeat,
    var(--bg);
  background-attachment: fixed;
  background-size: cover, cover, auto;
}

img{ max-width: 100%; height: auto; }

a{
  color: var(--text);
  text-decoration-color: rgba(79,70,229,.55);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover{ text-decoration-color: rgba(8,145,178,.9); }

a:focus-visible{
  outline: 3px solid rgba(79,70,229,.38);
  outline-offset: 3px;
  border-radius: 10px;
}

.wrap{ max-width: var(--max); margin: 0 auto; padding: 0 18px; }

main{ padding: 26px 0 36px; }
section{ padding: 18px 0 6px; }

.section-head{
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.section-head h2{
  margin:0;
  font-size: 15px;
  letter-spacing: .22px;
  text-transform: uppercase;
  color: rgba(15,23,42,.86);
}

/* prevent “text touching borders” / overflow on narrow screens */
.lede,
.feature-text,
.job-lede,
.job-body p,
.job-card p,
.project-body p,
.lines,
.contact-line{
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* =========================
   Top navigation
   ========================= */

.nav{
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(238,241,247,.96), rgba(238,241,247,.82));
  border-bottom: 1px solid var(--border);
}

.nav-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 12px 0;
}

.nav-left{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  text-decoration:none;

  min-width: 260px;
}

.lab-logo{
  height: 34px;
  width:auto;
  filter: drop-shadow(0 10px 16px rgba(2,6,23,.12));
}
.brand-text{
  display:flex;
  flex-direction:column;
  gap: 1px;
  line-height: 1.1;
}
.brand-title{
  font-weight: 800;
  letter-spacing: -.25px;
  font-size: 14px;
}
.brand-sub{
  font-size: 12px;
  color: var(--muted2);
  white-space: nowrap;
}
.divider{
  width: 1px;
  height: 28px;
  background: rgba(15,23,42,.16);
  margin: 0 2px 0 4px;
}
.sinai-logo{
  height: 26px;
  width:auto;
  opacity: .95;
  filter: drop-shadow(0 10px 16px rgba(2,6,23,.10));
}

.github-link{
  display:flex;
  align-items:center;
  padding-left: 12px;
  border-left: 1px solid rgba(15,23,42,.16);
  transition: transform .12s ease, opacity .12s ease;
}
.github-link img{
  height: 22px;
  width:auto;
  opacity: .85;
  filter: drop-shadow(0 8px 14px rgba(2,6,23,.08));
}
.github-link:hover{
  transform: translateY(-1px);
  opacity: 1;
}

.nav-links{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill{
  display:inline-flex;
  align-items:center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.86);
  color: rgba(15,23,42,.78);
  text-decoration: none;
  font-size: 13px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  user-select:none;
  white-space: nowrap;
}
.pill:hover{
  color: var(--text);
  background: #fff;
  border-color: rgba(79,70,229,.32);
  transform: translateY(-1px);
}
.pill.active{
  color: var(--text);
  background: linear-gradient(135deg, rgba(79,70,229,.14), rgba(8,145,178,.10));
  border-color: rgba(79,70,229,.34);
}

/* =========================
   Shared UI bits
   ========================= */

.panel{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.90);
  box-shadow: var(--shadow2);
  padding: 14px;
}

.lede{
  margin: 0 0 10px;
  color: rgba(15,23,42,.90);
  font-size: 13.5px;
  line-height: 1.58;
}

.feature-meta{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(15,23,42,.10);
}

.kv{
  font-size: 13px;
  color: rgba(15,23,42,.86);
}
.kv span{
  color: var(--muted2);
  margin-right: 6px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15,23,42,.03);
  color: rgba(15,23,42,.86);
  font-size: 12px;
  text-decoration: none;
}
.chip:hover{
  border-color: rgba(8,145,178,.38);
  background: rgba(8,145,178,.10);
}
.icon{ display:inline-flex; line-height: 0; }
.chip svg{ width: 14px; height: 14px; opacity: .8; }

/* =========================
   People page
   ========================= */

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.card{
  grid-column: span 6;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow2);
  padding: 14px;
  display:flex;
  gap: 14px;
  align-items:flex-start;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
  min-height: 118px;
}
.card:hover{
  transform: translateY(-2px);
  border-color: rgba(79,70,229,.36);
  box-shadow: 0 14px 38px rgba(2,6,23,.14);
}

.avatar{
  width: 88px;
  height: 88px;
  border-radius: 16px;
  border: 1px solid var(--border2);
  overflow:hidden;
  background: rgba(15,23,42,.04);
  flex: 0 0 auto;
}
.avatar img{ width:100%; height:100%; object-fit: cover; }

.info{ min-width:0; }
.name{ font-size: 16px; font-weight: 740; margin: 0 0 3px; letter-spacing: -.2px; }
.role{ margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.lines{
  margin: 0 0 10px;
  color: rgba(15,23,42,.86);
  font-size: 13px;
  white-space: pre-line;
}
.meta{ display:flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

.alumni{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.alumni-item{
  grid-column: span 6;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  padding: 10px 12px;
  color: rgba(15,23,42,.90);
  font-size: 13px;
}
.alumni-item span{ color: var(--muted); }

/* =========================
   Research / Projects page
   ========================= */

.project-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.project-card{
  grid-column: span 12;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow2);
  padding: 14px;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
  overflow: hidden; /* helps on very narrow screens */
}
.project-card:hover{
  transform: translateY(-2px);
  border-color: rgba(79,70,229,.30);
  box-shadow: 0 14px 38px rgba(2,6,23,.12);
}

.project-top{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
}
.project-head{ min-width: 0; }

.project-title{
  margin: 0;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -.2px;
}

.project-body{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(15,23,42,.10);
}
.project-body p{
  margin: 0;
  color: rgba(15,23,42,.88);
  font-size: 13.5px;
  line-height: 1.58;
}

/* =========================
   Positions page
   ========================= */

.job-section{ padding: 18px 0 10px; }

.job-feature{
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 16px;
}

.job-feature.reverse{ grid-template-columns: 7fr 5fr; }
.job-feature.reverse .job-media{ order: 2; }
.job-feature.reverse .job-body{ order: 1; }

.job-media{
  margin: 0;
  display: flex;
  align-self: stretch;
}

.job-media img{
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow2);
  object-fit: cover;
}

.job-body,
.job-card{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.90);
  box-shadow: var(--shadow2);
  padding: 14px;
}

.job-body{
  display: flex;
  flex-direction: column;
}

.job-lede{
  margin: 0 0 10px;
  color: rgba(15,23,42,.90);
  font-size: 13.5px;
  line-height: 1.58;
}

.job-body p,
.job-card p{
  margin: 0 0 10px;
  color: rgba(15,23,42,.88);
  font-size: 13.5px;
  line-height: 1.58;
}
.job-body p:last-child,
.job-card p:last-child{ margin-bottom: 0; }

.job-actions{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.job-note{
  color: var(--muted2);
  font-size: 12px;
}

/* =========================
   Home page (feature blocks + contact)
   ========================= */

.feature{
  display:grid;
  grid-template-columns: 5fr 7fr;
  gap: 16px;
}

.feature.reverse{ grid-template-columns: 7fr 5fr; }
.feature.reverse .feature-media{ order: 2; }
.feature.reverse .feature-body{ order: 1; }

.feature.wide-media{ grid-template-columns: 6fr 6fr; }

.feature-media{
  margin: 0;
  display: flex;
  align-self: stretch;
}

.feature-media img{
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow2);
  object-fit: cover;
}

.feature-body{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.90);
  box-shadow: var(--shadow2);
  padding: 14px;
}

.feature-title{
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -.2px;
}

.feature-sub{
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.feature-text{
  margin: 0;
  color: rgba(15,23,42,.88);
  font-size: 13.5px;
  line-height: 1.58;
}

.feature-actions{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.contact-split{
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 14px;
}

.contact-split.wide-media{ grid-template-columns: 6fr 6fr; }
.contact-split.wide-media.reverse .map-card{ order: 1; }
.contact-split.wide-media.reverse .panel{ order: 2; }

.contact-block{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(15,23,42,.10);
}
.contact-line{
  font-size: 13.5px;
  line-height: 1.58;
  color: rgba(15,23,42,.88);
}

.map-card{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.90);
  box-shadow: var(--shadow2);
  overflow: hidden;
  min-height: 320px;
}
.map-card iframe{
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
  display: block;
}

/* =========================
   Equal-height columns
   ========================= */

.feature,
.contact-split,
.job-feature{
  align-items: stretch;
}

.feature-body,
.feature-media,
.panel,
.map-card,
.job-media,
.job-body{
  height: 100%;
}

/* =========================
   Responsive (AGGRESSIVE)
   ========================= */

/* hide subtitle earlier to avoid nav crowding */
@media (max-width: 1100px){
  .brand-sub{ display:none; }
}

/* THIS is the important breakpoint for your phone screenshots */
@media (max-width: 1024px){

  /* ---------- NAV: force 2-row layout, no overlap ---------- */
  .nav-inner{
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .nav-left{
    flex: 1 1 100%;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
  }

  .brand{
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
  }

  .brand-title{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .divider{ height: 22px; }

  .lab-logo{ height: 30px; }
  .sinai-logo{ height: 22px; }

  .github-link{ padding-left: 10px; }
  .github-link img{ height: 20px; }

  /* pills row under logos; scroll instead of wrapping into a mess */
  .nav-links{
    flex: 1 1 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;

    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;

    padding-bottom: 2px;
  }
  .nav-links::-webkit-scrollbar{ display:none; }

  .pill{ padding: 7px 11px; }

  /* ---------- TWO-COLUMN SECTIONS: collapse cleanly ---------- */
  .feature,
  .feature.reverse,
  .feature.wide-media,
  .feature.wide-media.reverse,
  .job-feature,
  .job-feature.reverse,
  .contact-split,
  .contact-split.wide-media{
    grid-template-columns: 1fr;
  }

  .feature.reverse .feature-media,
  .feature.reverse .feature-body,
  .job-feature.reverse .job-media,
  .job-feature.reverse .job-body{
    order: initial;
  }

  /* ---------- CRITICAL: disable equal-height behavior on mobile ---------- */
  .feature-body,
  .feature-media,
  .panel,
  .map-card,
  .job-media,
  .job-body{
    height: auto !important;
  }

  /* ---------- CRITICAL: stop images from becoming gigantic ---------- */
  .feature-media img,
  .job-media img{
    height: auto !important;
    max-height: 360px;
    width: 100%;
    object-fit: cover;
  }

  .map-card{ min-height: 260px; }
  .map-card iframe{ min-height: 260px; }
}

/* smaller phones */
@media (max-width: 720px){
  .wrap{ padding: 0 14px; }

  .card{ grid-column: span 12; }
  .alumni-item{ grid-column: span 12; }

  .project-top{
    flex-direction: column;
    align-items: flex-start;
  }

  .project-card{ padding: 16px; } /* keeps text off the borders */
}

/* very small phones */
@media (max-width: 420px){
  .pill{ padding: 6px 10px; font-size: 12.5px; }
  .lab-logo{ height: 28px; }
  .sinai-logo{ height: 20px; }
}

/* motion */
@media (prefers-reduced-motion: reduce){
  .card, .pill, .github-link, .project-card{ transition: none; }
}
