/* ==========================================================================
   Dr Swati Virmani — site stylesheet
   Single stylesheet for all pages. No build step, no external dependencies.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------ */
:root {
  /* Ink */
  --ink:        #14212c;
  --ink-body:   #35485a;
  --ink-meta:   #566a79;   /* darkened so small meta text clears WCAG AA on both paper tones */

  /* Paper */
  --paper:      #ffffff;
  --paper-warm: #f8f6f1;
  --paper-deep: #14212c;

  /* Accent — deep teal reads as considered and institutional, not corporate */
  --accent:      #0e5250;
  --accent-dark: #0a3d3b;
  --accent-tint: #e8f0ef;
  --ochre:       #9a6425;

  /* Lines */
  --line:        #e2ded4;
  --line-strong: #c9c4b6;

  /* Type */
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Measure & rhythm */
  --measure: 68ch;
  --wrap:    1120px;
  --wrap-narrow: 780px;
  --gutter:  clamp(1.25rem, 5vw, 3rem);

  --radius: 4px;
  --shadow: 0 1px 2px rgba(20, 33, 44, .05), 0 8px 24px -12px rgba(20, 33, 44, .16);
}

/* --- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-body);
  font-family: var(--sans);
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2.1rem, 1.5rem + 2.5vw, 3.25rem); line-height: 1.1; }
h2 { font-size: clamp(1.55rem, 1.3rem + 1.1vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); }
h4 { font-size: 1.0625rem; font-family: var(--sans); font-weight: 650; }

p  { margin: 0 0 1.15em; max-width: var(--measure); }
ul, ol { max-width: var(--measure); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-dark); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Utilities ---------------------------------------------------------- */
.wrap        { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { width: 100%; max-width: var(--wrap-narrow); margin-inline: auto; padding-inline: var(--gutter); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 50%; transform: translateX(-50%) translateY(-120%);
  z-index: 200; background: var(--ink); color: #fff; padding: .75rem 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius); text-decoration: none; font-weight: 600;
  transition: transform .15s ease;
}
.skip-link:focus { transform: translateX(-50%) translateY(0); color: #fff; }

.eyebrow {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .9rem;
  display: block;
}
.eyebrow--light { color: #9dc4c1; }

.lede {
  font-size: clamp(1.125rem, 1.05rem + .35vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink);
}

.section       { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section--warm { background: var(--paper-warm); }
.section--tight{ padding-block: clamp(2.5rem, 5vw, 4rem); }
.section + .section--warm, .section--warm + .section { border-top: 1px solid var(--line); }

.section-head { margin-bottom: 2.5rem; }
.section-head p { color: var(--ink-body); }

/* --- Header / navigation ------------------------------------------------
   Present on every page — the previous site only had a menu on the homepage. */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 68px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.15rem; font-weight: 600; color: var(--ink);
  text-decoration: none; letter-spacing: -.01em; line-height: 1.2;
  display: flex; flex-direction: column;
}
.brand span {
  font-family: var(--sans); font-size: .7rem; font-weight: 550;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-meta);
  margin-top: .15rem;
}
.brand:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  width: 46px; height: 46px;
  align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--ink); cursor: pointer; padding: 0;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open  { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav ul {
  list-style: none; display: flex; align-items: center;
  gap: clamp(.5rem, 1.6vw, 1.5rem); margin: 0; padding: 0; max-width: none;
}
.nav a {
  display: block; padding: .55rem .25rem;
  color: var(--ink-body); text-decoration: none;
  font-size: .95rem; font-weight: 500;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 650; border-bottom-color: var(--accent); }

.nav__cta {
  background: var(--accent); color: #fff !important; border-radius: var(--radius);
  padding: .55rem 1rem !important; border-bottom: 0 !important; font-weight: 600 !important;
}
.nav__cta:hover { background: var(--accent-dark); }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; inset: 100% 0 auto 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem var(--gutter) 1.25rem; }
  .nav a { padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { border-bottom-color: var(--line); }
  .nav li:last-child a { border-bottom: 0; }
  .nav__cta { text-align: center; margin-top: .75rem; padding: .85rem 1rem !important; }
}

/* --- Hero --------------------------------------------------------------- */
.hero { padding-block: clamp(3rem, 6vw, 5.5rem) clamp(2.5rem, 5vw, 4rem); }

.hero__grid {
  display: grid; gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr) 430px; align-items: center;
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { order: -1; max-width: 100%; }
}

.hero h1 { margin-bottom: .35em; }

.hero__postnominals {
  font-family: var(--sans); font-size: .78rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
  margin: -.15rem 0 .9rem;
}

.hero__role {
  font-family: var(--sans); font-size: 1.0625rem; font-weight: 600;
  color: var(--ink); margin: 0 0 1.25rem;
}
.hero__role em { font-style: normal; color: var(--ink-meta); font-weight: 500; }
.hero__role br { line-height: 1.9; }

.hero__statement {
  font-size: clamp(1.125rem, 1.05rem + .4vw, 1.35rem);
  line-height: 1.5; color: var(--ink); max-width: 34ch;
  border-left: 3px solid var(--accent); padding-left: 1.15rem; margin: 0 0 1.75rem;
}
.hero__portrait img {
  border-radius: var(--radius); box-shadow: var(--shadow); width: 100%;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 46px; padding: .7rem 1.35rem;
  font-family: var(--sans); font-size: .95rem; font-weight: 600;
  border-radius: var(--radius); text-decoration: none; border: 1px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--light { background: #fff; color: var(--accent-dark); }
.btn--light:hover { background: var(--accent-tint); color: var(--accent-dark); }
.btn--outline-light { border-color: rgba(255,255,255,.4); color: #fff; }
.btn--outline-light:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }

/* --- Credential strip --------------------------------------------------- */
.credentials {
  border-block: 1px solid var(--line);
  background: var(--paper-warm);
  padding-block: 1.75rem;
}
.credentials ul {
  list-style: none; margin: 0; padding: 0; max-width: none;
  display: flex; flex-wrap: wrap; gap: .6rem .5rem;
}
.credentials li {
  font-size: .875rem; font-weight: 550; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 100px; padding: .4rem .9rem;
}
.credentials li:has(strong) {
  border-color: var(--accent); background: var(--accent-tint);
}
.credentials li strong { color: var(--accent-dark); font-weight: 700; }
.credentials li em { font-style: italic; }

/* --- Prose blocks ------------------------------------------------------- */
.prose h3 { margin-top: 2.25rem; }
.prose h3:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }

.two-col {
  display: grid; gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: 1fr 1fr; align-items: start;
}
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

.side-head { position: sticky; top: 96px; }
@media (max-width: 820px) { .side-head { position: static; } }

/* --- Theme / interest tiles --------------------------------------------- */
.themes {
  list-style: none; margin: 0 0 2rem; padding: 0; max-width: none;
  display: grid; gap: 1px; background: var(--line);
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.themes li { background: var(--paper); padding: 1.5rem 1.35rem; }
.themes strong {
  display: block; font-family: var(--serif); font-size: 1.1rem;
  color: var(--ink); margin-bottom: .4rem; font-weight: 600;
}
.themes span { font-size: .925rem; color: var(--ink-body); display: block; line-height: 1.5; }

/* --- Cards -------------------------------------------------------------- */
.card-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.6rem;
  display: flex; flex-direction: column;
}
.card h3 { margin-bottom: .5rem; }
.card p  { font-size: .95rem; margin-bottom: 1rem; }
.card > *:last-child { margin-bottom: 0; margin-top: auto; }
.card__meta {
  font-size: .78rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ochre); margin: 0 0 .6rem;
}
.card__link { font-size: .925rem; font-weight: 600; text-decoration: none; }
.card__link:hover { text-decoration: underline; }
.card__link::after { content: " →"; }

/* --- Projects ----------------------------------------------------------- */
.project {
  display: grid; gap: clamp(1.75rem, 3.5vw, 3rem);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: start;
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line);
}
.project:first-of-type { border-top: 0; padding-top: 0; }
.project--flip .project__media { order: -1; }
@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; }
  .project--flip .project__media { order: 0; }
}

.project__eyebrow {
  font-size: .75rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ochre); margin: 0 0 .6rem;
}
.project h2 { margin-bottom: .35rem; }
.project__sub {
  font-family: var(--serif); font-style: italic; font-size: 1.075rem;
  color: var(--ink-meta); margin-bottom: 1.1rem;
}
.project__facts {
  list-style: none; margin: 0 0 1.25rem; padding: 1rem 0 0; max-width: none;
  border-top: 1px solid var(--line);
  display: grid; gap: .5rem;
}
.project__facts li { display: flex; gap: .75rem; font-size: .9rem; }
.project__facts dt, .project__facts b {
  min-width: 92px; flex-shrink: 0; color: var(--ink-meta);
  font-weight: 600; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  padding-top: .12rem;
}
.project__facts span { color: var(--ink); }

figure { margin: 0; }
figure img { border: 1px solid var(--line); border-radius: var(--radius); width: 100%; }
figcaption {
  font-size: .85rem; color: var(--ink-meta); margin-top: .7rem; line-height: 1.45;
}

/* --- Framework gallery -------------------------------------------------- */
.frameworks {
  display: grid; gap: 1.75rem;
  grid-template-columns: 1fr;
}
/* Two-up keeps the four frameworks balanced and the diagrams legible. */
@media (min-width: 720px) {
  .frameworks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.framework {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.framework img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain;
  background: #fff; border-bottom: 1px solid var(--line); padding: .75rem;
}
.framework__body { padding: 1.35rem; }
.framework__body h3 { font-size: 1.075rem; margin-bottom: .4rem; }
.framework__body p  { font-size: .9rem; margin: 0; color: var(--ink-body); }

/* --- Publications ------------------------------------------------------- */
.pub-group { margin-bottom: 3rem; }
.pub-group:last-child { margin-bottom: 0; }
.pub-group > h2 {
  font-size: 1.3rem; padding-bottom: .6rem; margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--ink);
}
.pub-list { list-style: none; margin: 0; padding: 0; max-width: none; }
.pub-list li {
  padding: 1.1rem 0 1.1rem 3.4rem; border-bottom: 1px solid var(--line);
  position: relative; max-width: 78ch;
}
.pub-list li:last-child { border-bottom: 0; }
.pub-year {
  position: absolute; left: 0; top: 1.15rem;
  font-family: var(--sans); font-size: .8rem; font-weight: 700;
  color: var(--ink-meta); letter-spacing: .02em;
}
.pub-title { color: var(--ink); font-weight: 600; display: block; margin-bottom: .2rem; }
.pub-meta  { font-size: .9rem; color: var(--ink-body); display: block; }
.pub-meta em { font-style: italic; }
.pub-link  { font-size: .85rem; font-weight: 600; display: inline-block; margin-top: .35rem; }

/* --- Talks & writing lists ---------------------------------------------- */
.entry-list { list-style: none; margin: 0; padding: 0; max-width: none; }
.entry {
  display: grid; grid-template-columns: 152px minmax(0, 1fr);
  gap: 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line);
}
.entry:last-child { border-bottom: 0; }
@media (max-width: 700px) { .entry { grid-template-columns: 1fr; gap: .4rem; } }

.entry__date {
  font-size: .82rem; font-weight: 650; letter-spacing: .04em;
  color: var(--ink-meta); text-transform: uppercase; padding-top: .2rem;
}
.entry__title { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); margin: 0 0 .3rem; font-weight: 600; }
.entry__title a { text-decoration: none; color: inherit; }
.entry__title a:hover { color: var(--accent); text-decoration: underline; }
.entry__host { font-size: .95rem; color: var(--ink-body); margin: 0 0 .4rem; }
.entry__host strong { color: var(--ink); font-weight: 600; }
.entry__note { font-size: .9rem; color: var(--ink-meta); margin: 0; }
.entry__tag {
  display: inline-block; font-size: .72rem; font-weight: 650; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-tint);
  padding: .2rem .55rem; border-radius: 3px; margin-bottom: .5rem;
}

/* --- Talk poster gallery ------------------------------------------------ */
/* Six posters — three-up keeps both rows full. */
.poster-grid {
  display: grid; gap: 1.25rem; margin-top: 2.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 720px) {
  .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.poster-grid figure { display: flex; flex-direction: column; }
.poster-grid img {
  aspect-ratio: 1 / 1; object-fit: cover; object-position: top center;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.poster-grid figcaption { font-size: .8rem; }

/* --- Audience blocks ---------------------------------------------------- */
.audience {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
}
.audience article {
  background: var(--paper); border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius); padding: 1.75rem 1.5rem;
}
.audience h3 { font-size: 1.15rem; margin-bottom: .65rem; }
.audience p  { font-size: .95rem; margin-bottom: .9rem; }
.audience ul { margin: 0; padding-left: 1.1rem; font-size: .925rem; }
.audience li { margin-bottom: .4rem; }
.audience li::marker { color: var(--accent); }

/* --- Quote / pull ------------------------------------------------------- */
.pull {
  font-family: var(--serif); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem);
  line-height: 1.4; color: var(--ink); max-width: 26ch;
  margin: 0; padding-left: 1.25rem; border-left: 3px solid var(--ochre);
}

/* --- CTA band ----------------------------------------------------------- */
.cta-band {
  background: var(--paper-deep); color: #dfe7ea;
  padding-block: clamp(3rem, 6vw, 4.5rem);
}
.cta-band h2 { color: #fff; }
.cta-band p  { color: #b6c4cc; max-width: 56ch; }
.cta-band .btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* --- Contact ------------------------------------------------------------ */
.contact-grid {
  display: grid; gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: start;
}
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-list { list-style: none; margin: 0; padding: 0; max-width: none; }
.contact-list li { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list dt, .contact-list .label {
  font-size: .75rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-meta); display: block; margin-bottom: .3rem;
}
.contact-list a, .contact-list .value { font-size: 1.05rem; color: var(--ink); font-weight: 550; }
.contact-list a { color: var(--accent); }

.note {
  background: var(--accent-tint); border-left: 3px solid var(--accent);
  padding: 1.1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .925rem; margin: 0 0 1.5rem; max-width: var(--measure);
}
.note strong { color: var(--accent-dark); }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  background: var(--paper-warm); border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 3.5rem) 2rem; margin-top: 0;
}
.site-footer__grid {
  display: grid; gap: 2rem;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  padding-bottom: 2rem; border-bottom: 1px solid var(--line);
}
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr; gap: 1.75rem; } }

.site-footer h2 {
  font-family: var(--sans); font-size: .75rem; font-weight: 650;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-meta); margin-bottom: .9rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; max-width: none; }
.site-footer li { margin-bottom: .5rem; }
.site-footer a { color: var(--ink-body); text-decoration: none; font-size: .95rem; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer__name { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); margin-bottom: .3rem; font-weight: 600; }
.site-footer__blurb { font-size: .925rem; max-width: 34ch; margin-bottom: 1rem; }
.site-footer__legal {
  padding-top: 1.5rem; font-size: .85rem; color: var(--ink-meta);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}
.site-footer__legal p { margin: 0; max-width: none; }

.social { display: flex; gap: .6rem; }
.social a {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink);
}
.social a:hover { border-color: var(--accent); color: var(--accent); background: var(--paper); }
.social svg { width: 18px; height: 18px; fill: currentColor; }

/* --- Page header (interior pages) --------------------------------------- */
.page-header {
  background: var(--paper-warm); border-bottom: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.page-header h1 { margin-bottom: .4em; }
.page-header .lede { max-width: 60ch; margin-bottom: 0; }

/* --- Print -------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .cta-band, .nav-toggle, .skip-link { display: none !important; }
  body { font-size: 11pt; color: #000; }
  a { color: #000; text-decoration: underline; }
  .section { padding-block: 1rem; }
}
