/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root{
  --black: #000;
  --text: #111;
  --muted: #666;

  --leftBg: #f5f5f5;
  --rightBg: #ffffff;

  /* ✅ EDIT ANIMATION TIME HERE */
  --photoDur: 5000ms;     /* photo zoom duration */
  --textDur: 5000ms;      /* text slide duration */
  --textDelay: 350ms;     /* start texts after photo begins */
  --ease: cubic-bezier(.2, .85, .2, 1);

  /* portrait sizing is already used in .portrait width */
  --portraitSize: min(380px, 48vw);

  /* half the portrait + some breathing room */
  --portraitGutter: calc(var(--portraitSize) / 2 + 48px);
}

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  background: #fff;
}

.page{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container{
  width: min(1200px, calc(100% - 64px));
  margin: 0 auto;
}

/* Topbar */
.topbar{ background: var(--black); }

.topbar__inner{
  min-height: 64px;
  display: flex;
  align-items: center;
}

.nav{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 14px 0;
}

.nav__link{
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.92;
}
.nav__link:hover{ opacity: 0.7; }

.nav__divider{
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.45);
  margin: 0 2px;
}

.iconlink{
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
}
.iconlink:hover{ background: rgba(255,255,255,0.10); }

.icon{ width: 18px; height: 18px; fill: #fff; }

/* HERO */
.hero{
  flex: 1;
  display: flex;
}

.split{
  position: relative;
  width: 100%;
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Panels are static now (no animation on panels) */
.side{
  position: relative;
  display: flex;
  align-items: center;
  padding: 60px 56px;
  overflow: hidden; /* keeps text slide clean */
  z-index: 1;
}

.side--left{ background: var(--leftBg); }
.side--right{ background: var(--rightBg); }

.side__inner{
  max-width: 520px;
}

/* Text styling */
.label{
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 10px;
}

.headline{
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.05;
  margin-bottom: 12px;
}

.subhead{
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  margin-bottom: 18px;
}

.btn{
  display: inline-block;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  background: #111;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn:hover{ opacity: 0.7; }



/* Center portrait overlap */
.portrait{
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(380px, 48vw);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  overflow: hidden;
  border: 6px solid #fff;
  box-shadow: 0 18px 50px rgba(0,0,0,0.12);
  z-index: 3;
  will-change: transform, opacity;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.portrait img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Footer */
.footer{
  border-top: 1px solid #eee;
  padding: 18px 0;
  color: #666;
  font-size: 0.9rem;
}

.footer__inner{
  display: flex;
  justify-content: center;
}

/* Make room for overlapping portrait on large screens */
@media (min-width: 901px){
  /* keep your original padding, but add extra room only on the center side */
  .side--left  { padding-right: calc(56px + var(--portraitGutter)); }
  .side--right { padding-left:  calc(56px + var(--portraitGutter)); }

  /* remove the old inner padding approach if it's still there */
  .side--left  .side__inner { padding-right: 0; }
  .side--right .side__inner { padding-left:  0; }
}



/* ---------------------------------- */
/* Animations (triggered on visibility) */
/* ---------------------------------- */

/* Photo initial state */
.hero .portrait{
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.86);
}

/*
  Text initial states:
  - Left text starts from center (behind photo) and goes outward left
    so it should begin shifted to the RIGHT (+X) and move to 0
  - Right text starts from center and goes outward right
    so it should begin shifted to the LEFT (-X) and move to 0
*/
.hero .side__inner{
  opacity: 0;
  will-change: transform, opacity;
}

.hero .side--left .side__inner{
  transform: translateX(120px);
}

.hero .side--right .side__inner{
  transform: translateX(-120px);
}

/* Trigger */
.hero.is-visible .portrait{
  animation: photoZoom var(--photoDur) var(--ease) forwards;
}

.hero.is-visible .side--left .side__inner{
  animation: textIn var(--textDur) var(--ease) forwards;
  animation-delay: var(--textDelay);
}

.hero.is-visible .side--right .side__inner{
  animation: textIn var(--textDur) var(--ease) forwards;
  animation-delay: calc(var(--textDelay) + 120ms);
}

/* Keyframes */
@keyframes photoZoom{
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.86); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes textIn{
  from { opacity: 0; }
  to   { opacity: 1; transform: translateX(0); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .hero .portrait,
  .hero .side__inner{
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* Responsive (stacked layout) */
@media (max-width: 900px){
  .split{
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .side{
    padding: 44px 24px;
  }

  .portrait{
    position: static;
    transform: none !important;
    margin: 22px auto 0;
    opacity: 1;
  }

  .hero .side__inner{
    opacity: 1;
    transform: none;
    animation: none;
  }
}


/* ---------------------------------- */
/* ABOUT PAGE */
/* ---------------------------------- */

.aboutpage{
  flex: 1;
  padding-bottom: 8px;
}

.page-title{
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.05;
  margin-bottom: 12px;
}

.section{
  padding: 70px 0;
}

.lead{
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 62ch;
}

.lead + .lead{ margin-top: 12px; }
.lead--muted{ color: var(--muted); }

.about-hero{
  padding: 70px 0 46px;
  background: #fff;
}

.about-hero__grid{
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(22px, 4vw, 56px);
}

.about-photo-wrap{
  perspective: 900px;
  max-width: 420px;
  margin-left: auto;
}

.about-photo{
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow:
    0 22px 55px rgba(0,0,0,0.18),
    0 2px 0 rgba(255,255,255,0.6) inset;
  transform: rotateY(-12deg) rotateX(2deg) translateZ(10px);
  transition: transform 280ms var(--ease), box-shadow 280ms var(--ease);
}

.about-photo-wrap:hover .about-photo{
  transform: rotateY(-2deg) rotateX(0deg) translateZ(0);
  box-shadow: 0 26px 70px rgba(0,0,0,0.20);
}

.section-break{
  width: min(820px, 100%);
  margin: 0 auto;
  border: 0;
  height: 1px;
  background: rgba(0,0,0,0.12);
}

#skills .skills-title{
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

#skills .skills-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: 22px;
}

#skills .skill-card{
  grid-column: span 6;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  padding: 18px 18px 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
}

#skills .skill-card h3{
  font-size: 1.05rem;
  margin-bottom: 10px;
}

#skills .skill-card ul{
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

#skills .skill-card li + li{ margin-top: 6px; }



/* ---------------------------------- */
/* EDUCATION SECTION (About page) */
/* ---------------------------------- */

#education .edu-title{
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

#education .edu-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: 22px;
}

#education .edu-card{
  grid-column: span 6;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  padding: 18px 18px 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
}

#education .edu-degree{
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: 10px;
}

#education .edu-focus{
  color: var(--muted);
  font-weight: 500;
}

#education .edu-line{
  color: var(--muted);
  line-height: 1.65;
}

#education .edu-line + .edu-line{
  margin-top: 8px;
}

#education .edu-link{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.25);
}

#education .edu-link:hover{ opacity: 0.7; }

/* Stagger like Skills */
#education .edu-card:nth-child(1){ transition-delay: 0ms; }
#education .edu-card:nth-child(2){ transition-delay: 120ms; }

@media (max-width: 900px){
  #education .edu-card{ grid-column: span 12; }
}

/* ---------------------------------- */
/* Scroll reveal animations (no dependencies) */
/* ---------------------------------- */

.reveal-left,
.reveal-right,
.reveal-up{
  opacity: 0;
  filter: blur(0.2px);
  transform: translate3d(0, 0, 0);
  transition: opacity 3000ms var(--ease), transform 3000ms var(--ease);
  will-change: opacity, transform;
}

.reveal-left{ transform: translate3d(-28px, 0, 0); }
.reveal-right{ transform: translate3d(28px, 0, 0); }
.reveal-up{ transform: translate3d(0, 18px, 0); }

.is-visible{
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Stagger skill cards a bit */
#skills .skill-card{
  transition-delay: 0ms;
}
#skills .skill-card:nth-child(1){ transition-delay: 0ms; }
#skills .skill-card:nth-child(2){ transition-delay: 80ms; }
#skills .skill-card:nth-child(3){ transition-delay: 160ms; }
#skills .skill-card:nth-child(4){ transition-delay: 240ms; }
#skills .skill-card:nth-child(5){ transition-delay: 320ms; }
#skills .skill-card:nth-child(6){ transition-delay: 400ms; }
#skills .skill-card:nth-child(7){ transition-delay: 480ms; }
#skills .skill-card:nth-child(8){ transition-delay: 560ms; }


/* ---------------------------------- */
/* CONTACT PAGE */
/* ---------------------------------- */

.contactpage{
  flex: 1;
  padding-bottom: 8px;
}

.contact-hero{
  padding: 70px 0 46px;
  background: #fff;
}

.contact-hero__grid{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(22px, 4vw, 56px);
}

.contact-block{
  margin-top: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  padding: 16px 16px 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
  max-width: 62ch;
}

.contact-row{
  display: flex;
  gap: 10px;
  line-height: 1.7;
  color: var(--muted);
}

.contact-row + .contact-row{ margin-top: 10px; }

.contact-key{
  min-width: 88px;
  color: var(--text);
  font-weight: 600;
}

.contact-row a{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.25);
}

.contact-row a:hover{ opacity: 0.7; }

.contact-photo-wrap{
  perspective: 900px;
  max-width: 520px;
  margin-left: auto;
}

.contact-photo{
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow:
    0 22px 55px rgba(0,0,0,0.18),
    0 2px 0 rgba(255,255,255,0.6) inset;
  transform: rotateY(12deg) rotateX(2deg) translateZ(10px);
  transition: transform 280ms var(--ease), box-shadow 280ms var(--ease);
}

.contact-photo-wrap:hover .contact-photo{
  transform: rotateY(2deg) rotateX(0deg) translateZ(0);
  box-shadow: 0 26px 70px rgba(0,0,0,0.20);
}

@media (max-width: 900px){
  .contact-hero__grid{ grid-template-columns: 1fr; }
  .contact-photo-wrap{ margin-left: 0; }
}

/* ---------------------------------- */
/* RESEARCH PAGE */
/* ---------------------------------- */

.researchpage{
  flex: 1;
  padding-bottom: 8px;
}

/* Research hero */
.research-hero{
  padding: 70px 0 46px;
  background: #fff;
}

.interest-list{
  margin-top: 16px;
  padding-left: 36px; /* extra indent */
  color: var(--muted);
  line-height: 1.7;
}

.interest-list li + li{
  margin-top: 6px;
}

/* Projects grid: max 3 per row */
.projects-grid{
  margin-top: 22px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card{
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  padding: 18px 18px 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
}

.project-card h3{
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: 10px;
}

.project-desc{
  color: var(--muted);
  line-height: 1.65;
}

.project-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill{
  font-size: 0.85rem;
  color: #111;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.02);
}

.project-link{
  margin-top: 14px;
  width: fit-content;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid rgba(0,0,0,0.25);
}

.project-link:hover{ opacity: 0.7; }

/* Match About page stagger feel (like skill cards) */
#projects .project-card:nth-child(1){ transition-delay: 0ms; }
#projects .project-card:nth-child(2){ transition-delay: 120ms; }
#projects .project-card:nth-child(3){ transition-delay: 240ms; }

/* Hover zoom (quick) */
.project-card.is-visible{
  transition: opacity 3000ms var(--ease), transform 3000ms var(--ease), box-shadow 220ms ease;
}

.project-card.is-visible:hover{
  transform: translate3d(0, -6px, 0) scale(1.03);
  box-shadow: 0 16px 40px rgba(0,0,0,0.10);
}

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

/* Project image placed after text (inside card) */
.project-image{
  margin-top: 14px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
}

.project-image img{
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
/* ---------------------------------- */
/* PROJECT DETAILS PAGE */
/* ---------------------------------- */

.projectpage{
  flex: 1;
  padding-bottom: 8px;
}

.project-hero{
  padding: 70px 0 46px;
  background: #fff;
}

.project-hero__grid{
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(22px, 4vw, 56px);
}

.breadcrumb{
  color: var(--muted);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.breadcrumb a{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.25);
}

.breadcrumb a:hover{ opacity: 0.7; }

.section-title{
  font-size: 1.35rem;
  margin-bottom: 12px;
  line-height: 1.25;
}

.kpi-grid{
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.kpi-card{
  grid-column: span 6;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  padding: 18px 18px 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
}

.kpi-card h3{
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.kpi-card p{
  color: var(--muted);
  line-height: 1.7;
}

.bullets{
  margin-top: 10px;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.75;
  max-width: 85ch;
}

.bullets li + li{ margin-top: 10px; }

.pill-cloud{
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-meta--hero{
  margin-top: 14px;
  margin-bottom: 18px;
}

@media (max-width: 900px){
  .project-hero__grid{
    grid-template-columns: 1fr;
  }
  .kpi-card{ grid-column: span 12; }
}



/* Justified text for transcriptomics project detail page */
.projectpage.transcriptomics-project p,
.projectpage.transcriptomics-project li {
  text-align: justify;
}
