/* Sangram Krishna Nirmale — site stylesheet
   One small file replaces the old WordPress theme CSS (~770 KB). */

:root {
  --ink: #0E2A47;        /* deep navy: hero, headings */
  --ink-2: #183B61;
  --paper: #F7F8FA;      /* cool page background */
  --white: #FFFFFF;
  --blue: #1F5FA8;       /* links, IIT Bombay family */
  --amber: #F2A900;      /* signal accent, used sparingly */
  --slate: #56606B;      /* secondary text */
  --rule: #DCE1E7;

  --sans: "Barlow Semi Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --wrap: 1140px;
  --measure: 68ch;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--serif);
  font-optical-sizing: auto;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 2px; }
strong { font-weight: 650; }

h1, h2, h3, h4 { font-family: var(--sans); line-height: 1.12; margin: 0 0 .5em; color: var(--ink); letter-spacing: -.005em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.3rem); font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }
h4 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 1em; max-width: var(--measure); }

.skip { position: absolute; left: -999px; top: 0; background: var(--amber); color: var(--ink); padding: .6rem 1rem; z-index: 100; font-family: var(--sans); font-weight: 600; }
.skip:focus { left: 1rem; top: 1rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { height: 38px; width: auto; }
.brand span { font-family: var(--sans); font-weight: 600; font-size: 1.12rem; line-height: 1.1; border-left: 1px solid var(--rule); padding-left: .85rem; }
.brand small { display: block; font-weight: 500; font-size: .85rem; color: var(--slate); }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .15rem; flex-wrap: wrap; }
.nav a {
  display: block; padding: .45rem .6rem; text-decoration: none;
  font: 500 1rem/1 var(--sans); color: var(--ink); border-radius: 4px;
}
.nav a:hover { background: var(--paper); color: var(--blue); }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--amber); border-radius: 0; }
.nav .nav-cta a { background: var(--ink); color: var(--white); margin-left: .35rem; }
.nav .nav-cta a:hover { background: var(--blue); color: var(--white); }
.nav-toggle { display: none; }

@media (max-width: 1060px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: .5rem;
    font: 600 1rem/1 var(--sans); color: var(--ink);
    background: none; border: 1px solid var(--rule); border-radius: 4px; padding: .55rem .8rem; cursor: pointer;
  }
  .nav-toggle svg { width: 18px; height: 18px; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--rule); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; padding: .5rem var(--gutter) 1rem; }
  .nav a { padding: .8rem .25rem; font-size: 1.1rem; border-bottom: 1px solid var(--rule); border-radius: 0; }
  .nav .nav-cta a { margin: .75rem 0 0; text-align: center; border-radius: 4px; border: 0; }
  .nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--amber); padding-left: .75rem; }
}
@media (max-width: 520px) { .brand span { display: none; } }

/* ---------- Hero ---------- */
.hero { background: var(--ink); color: #E8EEF5; position: relative; overflow: hidden; }
.hero > .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3rem; align-items: center; padding-top: clamp(2.5rem, 7vw, 5rem); padding-bottom: 2.5rem; }
.hero h1 { color: var(--white); margin-bottom: .25em; }
.hero .role { font: 500 clamp(1.1rem, 2vw, 1.35rem)/1.35 var(--sans); color: #B9C8D9; margin: 0 0 1.4rem; }
.hero .role a { color: inherit; }
.hero .lead { font-size: clamp(1.1rem, 1.7vw, 1.25rem); line-height: 1.6; color: #E8EEF5; max-width: 60ch; }
.portrait { width: clamp(180px, 22vw, 260px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 4px solid var(--ink-2); box-shadow: 0 0 0 2px var(--amber); }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 1.5rem; }
.btn {
  display: inline-block; font: 600 1.05rem/1 var(--sans); text-decoration: none;
  padding: .85rem 1.25rem; border-radius: 4px; border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { background: #FFC233; color: var(--ink); }
.btn-ghost { border-color: rgba(255,255,255,.45); color: var(--white); }
.btn-ghost:hover { border-color: var(--white); color: var(--white); background: rgba(255,255,255,.06); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--blue); color: var(--white); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }

.profiles { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 0; padding: 0; list-style: none; font: 500 1rem/1.3 var(--sans); }
.profiles a { color: #B9C8D9; text-decoration: none; border-bottom: 1px solid rgba(185,200,217,.4); }
.profiles a:hover { color: var(--white); border-color: var(--white); }

/* synthetic city: the one animated moment */
.city { margin: 0; border-top: 1px solid rgba(255,255,255,.08); }
.city canvas { display: block; width: 100%; height: 250px; }
.city figcaption { font: 500 .95rem/1.45 var(--sans); color: #8FA3B8; padding-top: .4rem; padding-bottom: 1.5rem; }
.city figcaption p { margin: 0 0 .45rem; max-width: 90ch; }
.city .legend { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; margin: 0 0 .45rem; padding: 0; list-style: none; }
.city .legend li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .45rem; vertical-align: .05em; background: var(--c); }
.city .log { color: #C9D5E2; min-height: 2.9em; }
.city .log b, .city figcaption b { color: var(--amber); font-weight: 600; }
@media (max-width: 760px) {
  .hero > .wrap { grid-template-columns: 1fr; gap: 1.5rem; }
  .portrait { order: -1; width: 128px; }
  .city canvas { height: 210px; }
}

/* page header for inner pages */
.page-head { background: var(--ink); color: #E8EEF5; padding: clamp(2.25rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 3rem); }
.page-head h1 { color: var(--white); font-size: clamp(2.2rem, 5vw, 3.4rem); max-width: 22ch; }
.page-head p { font-size: 1.18rem; color: #C9D5E2; max-width: 62ch; }
.page-head .actions { margin-bottom: 0; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5rem) 0; border-bottom: 1px solid var(--rule); }
.section.alt { background: var(--white); }
.section-grid { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2.5rem; }
.section-grid > header h2 { position: sticky; top: 6rem; }
.section-grid > header p { font-size: .98rem; color: var(--slate); }
@media (max-width: 860px) {
  .section-grid { grid-template-columns: 1fr; gap: .75rem; }
  .section-grid > header h2 { position: static; }
}
.muted { color: var(--slate); }
.small { font-size: .95rem; }

/* definition-style rows (education, experience, projects) */
.rows { margin: 0; padding: 0; list-style: none; }
.rows > li { padding: 1.1rem 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.25rem; }
.rows > li:last-child { border-bottom: 1px solid var(--rule); }
.rows .when { font: 500 1rem/1.5 var(--sans); color: var(--slate); }
.rows h3, .rows h4 { margin-bottom: .2rem; }
.rows p { margin: 0 0 .25rem; }
@media (max-width: 560px) { .rows > li { grid-template-columns: 1fr; gap: .2rem; } }

.meta { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: .15rem 1rem; margin: .4rem 0 0; font-size: .98rem; }
.meta dt { font: 500 .95rem/1.6 var(--sans); color: var(--slate); }
.meta dd { margin: 0; }
@media (max-width: 560px) { .meta { grid-template-columns: 1fr; } .meta dd { margin-bottom: .35rem; } }

/* research themes */
.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 2.5rem; margin: 0; padding: 0; list-style: none; }
.themes li { padding: 1.2rem 0 1.3rem; border-top: 2px solid var(--ink); }
.themes h3 { margin-bottom: .35rem; }
.themes p { margin: 0; font-size: 1rem; }

/* consulting teaser & services */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 2rem 2.5rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.services li { border-left: 3px solid var(--amber); padding: .15rem 0 .15rem 1.1rem; }
.services h3 { margin-bottom: .35rem; }
.services p { margin: 0 0 .5rem; font-size: 1rem; }
.services .outputs { font-size: .95rem; color: var(--slate); }
.services .outputs b { font-family: var(--sans); font-weight: 600; color: var(--ink); }

.callout { background: var(--ink); color: #E8EEF5; border-radius: 6px; padding: clamp(1.5rem, 4vw, 2.25rem); display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: center; justify-content: space-between; margin-top: 2.5rem; }
.callout h3 { color: var(--white); margin: 0 0 .3rem; font-size: 1.5rem; }
.callout p { margin: 0; color: #C9D5E2; }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem; }
.steps li { counter-increment: s; position: relative; padding-top: 2.6rem; }
.steps li::before {
  content: counter(s); position: absolute; top: 0; left: 0;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--ink); color: var(--white);
  font: 600 1.05rem/2rem var(--sans); text-align: center;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 1rem; left: 2.5rem; right: -1rem; border-top: 2px dashed var(--rule); }
.steps h3 { font-size: 1.15rem; margin-bottom: .3rem; }
.steps p { font-size: 1rem; margin: 0; }

.clients { columns: 2 16rem; column-gap: 2.5rem; margin: 0; padding: 0; list-style: none; }
.clients li { break-inside: avoid; padding: .45rem 0; border-bottom: 1px solid var(--rule); }

/* publications */
.pubs { margin: 0 0 2rem; padding: 0; list-style: none; counter-reset: p; }
.pubs li { padding: .9rem 0; border-top: 1px solid var(--rule); font-size: 1rem; line-height: 1.6; max-width: 80ch; }
.pubs li:last-child { border-bottom: 1px solid var(--rule); }
.pubs .me { font-weight: 650; }
.pubs .title { color: var(--ink); }
.pubs .venue { font-style: italic; }
.pubs .doi { font-family: var(--sans); font-size: .95rem; white-space: nowrap; }
.pub-group + .pub-group { margin-top: 2.25rem; }
.pub-group > h3 { display: flex; align-items: baseline; gap: .6rem; }
.pub-group > h3 .count { font-weight: 500; font-size: 1rem; color: var(--slate); }

details.more { margin-top: 1.5rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--white); }
details.more summary { cursor: pointer; padding: 1rem 1.25rem; font: 600 1.1rem/1.3 var(--sans); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--blue); }
details.more[open] summary::after { content: "−"; }
details.more .inner { padding: 0 1.25rem 1.25rem; }
details.more .pubs { margin-bottom: 0; }

/* awards timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.timeline li { position: relative; padding: 0 0 1.4rem 1.5rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--ink); }
.timeline li.key::before { background: var(--amber); border-color: var(--amber); }
.timeline .yr { font: 600 1rem/1.4 var(--sans); color: var(--slate); display: block; }
.timeline p { margin: 0; }

/* teaching */
.courses { list-style: none; margin: 0; padding: 0; }
.courses li { display: grid; grid-template-columns: 5.5rem minmax(0,1fr); gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--rule); }
.courses li:last-child { border-bottom: 1px solid var(--rule); }
.courses code { font: 600 1rem/1.5 var(--sans); color: var(--blue); }

/* team */
.team-group + .team-group { margin-top: 2.75rem; }
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: 2rem 2.5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.person { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0 1.25rem; align-items: start; }
.person img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 25%; border-radius: 50%; background: var(--rule); }
@media (max-width: 560px) { .person { grid-template-columns: 5rem minmax(0, 1fr); gap: 0 1rem; } }
.person h4 { margin: .2rem 0 .1rem; font-size: 1.2rem; }
.person .since { font: 500 .95rem/1.4 var(--sans); color: var(--slate); margin: 0 0 .45rem; }
.person p { font-size: .95rem; line-height: 1.5; margin: 0 0 .3rem; }
.person .area { color: var(--ink); }
.person .links { font: 500 .95rem/1.4 var(--sans); display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .5rem; }
.alumni { list-style: none; margin: 0; padding: 0; }
.alumni li { padding: .8rem 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 1rem; font-size: 1rem; }
.alumni li:last-child { border-bottom: 1px solid var(--rule); }
@media (max-width: 560px) { .alumni li { grid-template-columns: 1fr; gap: .1rem; } }

/* outreach */
.plain { margin: 0; padding: 0; list-style: none; }
.plain > li { padding: .9rem 0; border-top: 1px solid var(--rule); }
.plain > li:last-child { border-bottom: 1px solid var(--rule); }
.plain h4 { margin-bottom: .15rem; }
.plain p { margin: 0; font-size: 1rem; }
.sub + .sub { margin-top: 2.25rem; }

/* contact */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem 2.5rem; }
.contact h3 { font-size: 1.1rem; color: var(--slate); font-weight: 500; margin-bottom: .2rem; }
.contact p { margin: 0; }
.contact .big { font: 600 1.25rem/1.4 var(--sans); }

/* news */
.news { list-style: none; margin: 0; padding: 0; }
.news > li { display: grid; grid-template-columns: 9rem minmax(0,1fr); gap: 1.5rem; padding: 2rem 0; border-top: 1px solid var(--rule); }
.news time { font: 600 1.05rem/1.4 var(--sans); color: var(--ink); }
.news .kind { display: block; font: 500 .95rem/1.4 var(--sans); color: var(--slate); }
.news h2 { font-size: 1.45rem; margin-bottom: .4rem; }
.news .where { font-size: .95rem; color: var(--slate); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .6rem; margin-top: 1rem; max-width: 46rem; }
.thumbs button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 4px; overflow: hidden; }
.thumbs img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
@media (max-width: 620px) { .news > li { grid-template-columns: minmax(0, 1fr); gap: .4rem; } }

/* gallery */
.gallery { columns: 3 18rem; column-gap: 1.25rem; }
.gallery figure { break-inside: avoid; margin: 0 0 1.5rem; }
.gallery button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 6px; overflow: hidden; }
.gallery figcaption { font-size: .95rem; line-height: 1.5; margin-top: .55rem; color: var(--slate); }

dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1600px); max-height: 94vh; }
dialog.lightbox::backdrop { background: rgba(8, 20, 34, .88); }
dialog.lightbox img { max-height: 84vh; width: auto; margin: 0 auto; border-radius: 4px; }
dialog.lightbox p { color: #E8EEF5; text-align: center; margin: .75rem auto 0; font-size: 1rem; }
dialog.lightbox .close { position: fixed; top: 1rem; right: 1rem; background: var(--white); color: var(--ink); border: 0; border-radius: 4px; font: 600 1rem/1 var(--sans); padding: .6rem .9rem; cursor: pointer; }

/* join us */
.openings { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 2rem 2.5rem; list-style: none; margin: 0; padding: 0; }
.openings li { border-top: 2px solid var(--ink); padding-top: 1.1rem; display: flex; flex-direction: column; }
.openings p { font-size: 1rem; }
.openings .btn { align-self: flex-start; margin-top: auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #B9C8D9; padding: 3rem 0 2rem; font-size: .98rem; }
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer h2 { color: var(--white); font-size: 1.15rem; margin-bottom: .6rem; }
.site-footer a { color: #DCE6F1; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .3rem; }
.site-footer .fine { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.25rem; margin: 1rem 0 0; font-size: .9rem; color: #8FA3B8; max-width: none; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } .site-footer .wrap > div:first-child { grid-column: 1 / -1; } }

@media print {
  .site-header, .city, .nav-toggle, .actions, .site-footer { display: none !important; }
  .hero, .page-head { background: none; color: #000; }
  .hero h1, .page-head h1 { color: #000; }
  body { background: #fff; }
  details.more { border: 0; }
}
