/* ==========================================================
   Cell Biophysics Lab — IISER Kolkata
   Shared stylesheet for all pages
   ========================================================== */

:root {
  --bg: #f8f7f3;
  --bg-alt: #efeee8;
  --card: #ffffff;
  --ink: #15212b;
  --muted: #56636d;
  --line: #e2dfd6;
  --brand: #0e5566;        /* deep teal */
  --brand-ink: #ffffff;
  --accent: #d9481f;       /* fluorescence orange-red */
  --accent-2: #6a9e00;     /* logo green */
  --chip: #e7f0f1;
  --shadow: 0 1px 2px rgba(20, 30, 40, .05), 0 8px 24px rgba(20, 30, 40, .06);
  --radius: 14px;
  --maxw: 1160px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1519;
    --bg-alt: #121c21;
    --card: #152127;
    --ink: #e6ecee;
    --muted: #9aa9b1;
    --line: #25343c;
    --brand: #5cb6c8;
    --brand-ink: #0b1215;
    --accent: #ff7a4f;
    --accent-2: #9ccd3a;
    --chip: #1c2d34;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1519;
    --bg-alt: #121c21;
    --card: #152127;
    --ink: #e6ecee;
    --muted: #9aa9b1;
    --line: #25343c;
    --brand: #5cb6c8;
    --brand-ink: #0b1215;
    --accent: #ff7a4f;
    --accent-2: #9ccd3a;
    --chip: #1c2d34;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.eyebrow {
  font-family: var(--sans); font-size: .78rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  margin-bottom: .6em; display: block;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 46px; height: 46px; border-radius: 10px; }
.brand-text { line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; display: block; }
.brand-text span { font-size: .78rem; color: var(--muted); }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: .95rem;
  padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s;
}
.nav a:hover { background: var(--chip); color: var(--brand); }
.nav a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); }
.iiser-link img { width: 42px; height: 42px; border-radius: 8px; background: #fff; padding: 2px; }
.menu-btn {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line);
  border-radius: 10px; width: 42px; height: 42px; color: var(--ink); cursor: pointer;
}
.menu-btn svg { width: 22px; height: 22px; }

@media (max-width: 820px) {
  .menu-btn { display: grid; place-items: center; }
  .iiser-link { display: none; }
  .nav {
    position: absolute; left: 0; right: 0; top: 72px; flex-direction: column;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 10px; }
}

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px;
  border-radius: 999px; font-weight: 600; text-decoration: none; font-size: .95rem;
  border: 1px solid transparent; transition: transform .15s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chip {
  background: var(--chip); color: var(--ink); padding: 6px 14px; border-radius: 999px;
  font-size: .9rem; font-weight: 500;
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 64px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-visual { position: relative; aspect-ratio: 1 / 1; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); background: #000; }
.hero-visual img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.4s ease;
}
.hero-visual img.active { opacity: 1; }
.hero-visual .caption {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  background: rgba(0,0,0,.55); color: #fff; font-size: .8rem; padding: 4px 12px; border-radius: 999px;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { max-width: 480px; }
}

/* Page header for inner pages */
.page-head { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.page-head .lead { margin-bottom: 0; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.theme-card { position: relative; padding-top: 28px; }
.theme-card .num {
  font-family: var(--serif); font-size: .9rem; color: var(--accent); font-weight: 600;
  display: block; margin-bottom: 6px;
}
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; }

/* ---------- News timeline ---------- */
.news-year { margin-top: 36px; }
.news-year > summary {
  cursor: pointer; list-style: none; font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  display: flex; align-items: center; gap: 12px; padding: 6px 0;
}
.news-year > summary::-webkit-details-marker { display: none; }
.news-year > summary::after {
  content: "+"; font-family: var(--sans); font-size: 1.1rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; width: 28px; height: 28px;
  display: grid; place-items: center;
}
.news-year[open] > summary::after { content: "–"; }
.news-year > summary .count { font-family: var(--sans); font-size: .8rem; color: var(--muted); font-weight: 500; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0 0 0 22px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 10px 0 14px 8px; }
.timeline li::before {
  content: ""; position: absolute; left: -29px; top: 18px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--card); border: 2px solid var(--brand);
}
.timeline li.star::before { background: var(--accent); border-color: var(--accent); }
.timeline time {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 2px;
}
.timeline p { margin: 0; }

/* ---------- Publications ---------- */
.pub-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.pub-tools input {
  flex: 1 1 260px; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit;
}
.pub-tools input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.filter-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .9rem;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
}
.filter-btn[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pub-year { font-family: var(--serif); font-size: 1.4rem; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.pub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pub {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px;
}
.pub .title { font-weight: 600; font-size: 1.02rem; line-height: 1.4; }
.pub .authors { font-size: .9rem; color: var(--muted); }
.pub .authors b { color: var(--ink); font-weight: 600; }
.pub .venue { font-size: .9rem; }
.pub .venue i { font-style: italic; }
.pub .tag {
  grid-column: 2; grid-row: 1; align-self: start; font-size: .72rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px;
  background: var(--chip); color: var(--brand); white-space: nowrap;
}
.pub .tag.preprint { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.pub .tag.review { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }
.pub .links { grid-column: 1 / -1; font-size: .88rem; }
.pub .note { font-size: .85rem; color: var(--muted); grid-column: 1 / -1; }
.pub.cover { grid-template-columns: 1fr auto 96px; }
.pub.cover .cover-img { grid-column: 3; grid-row: 1 / span 4; width: 96px; border-radius: 6px; border: 1px solid var(--line); }
@media (max-width: 560px) {
  .pub, .pub.cover { grid-template-columns: 1fr; }
  .pub .tag { grid-column: 1; grid-row: auto; justify-self: start; }
  .pub.cover .cover-img { grid-column: 1; grid-row: auto; }
}
.pub-empty { display: none; padding: 24px; text-align: center; color: var(--muted); }

/* ---------- People ---------- */
.banner-strip { border-radius: var(--radius); overflow: hidden; margin-top: 32px; position: relative; aspect-ratio: 1161 / 166; }
.banner-strip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s; }
.banner-strip img.active { opacity: 1; }
.pi-card { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: center; }
.pi-card img { width: 220px; height: 220px; object-fit: cover; border-radius: 20px; }
@media (max-width: 640px) { .pi-card { grid-template-columns: 1fr; } }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.person { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.person img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--bg-alt); }
.person .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.person h3 { margin: 0; font-size: 1.15rem; }
.person .role { font-size: .8rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.person .works { font-size: .92rem; }
.person .meta { font-size: .85rem; color: var(--muted); }
.person .email { font-size: .85rem; color: var(--brand); margin-top: auto; padding-top: 6px; word-break: break-all; }
.group-title { margin: 48px 0 20px; display: flex; align-items: center; gap: 14px; }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.alumni-cols { columns: 2 320px; column-gap: 40px; }
.alumni-block { break-inside: avoid; margin-bottom: 22px; }
.alumni-block h4 { margin: 0 0 6px; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.alumni-block ul { list-style: none; margin: 0; padding: 0; }
.alumni-block li { padding: 3px 0; font-size: .95rem; }
.alumni-block li span { color: var(--muted); font-size: .88rem; }

/* ---------- Tools ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.photo-grid figure { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tech { display: flex; gap: 14px; align-items: flex-start; }
.tech .abbr {
  flex: none; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: .85rem;
}
.tech h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin: 4px 0 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split .movie { max-width: 340px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.contact-list li { display: flex; gap: 14px; }
.contact-list .ic {
  flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--chip);
  display: grid; place-items: center; color: var(--brand);
}
.contact-list .ic svg { width: 20px; height: 20px; }
.contact-list strong { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.map-frame { border: 0; width: 100%; height: 100%; min-height: 320px; border-radius: var(--radius); }

/* ---------- Funders ---------- */
.funders { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.funders a, .funders span {
  background: #fff; border-radius: 12px; padding: 10px 16px; height: 76px; display: grid; place-items: center;
  border: 1px solid var(--line);
}
.funders img { max-height: 56px; width: auto; }

/* ---------- Footer ---------- */
.site-footer { background: #0b1b22; color: #c6d3d8; padding: 48px 0 28px; margin-top: 0; }
.site-footer a { color: #e6eef1; }
.site-footer a:hover { color: #ff9a76; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { color: #fff; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; margin: 0 0 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { padding: 2px 0; }
.footer-bottom { border-top: 1px solid #22363f; margin-top: 32px; padding-top: 18px; font-size: .85rem; color: #8ea3ab; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* Reveal-on-scroll */
.reveal { opacity: 1; transform: translateY(6px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-visual img, .banner-strip img { transition: none; }
}
