/* ---------- Reset & base ---------- */
*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

:root {
  /* Alger palette from book reference:
     #fffdf6, #be917d, #f3e6e1, #499ed7, #dac4ae, #cfe1ef */
  --bg: #fffefb;
  --surface: #f0e6e2;
  --surface-2: #f1e6dd;
  --ink: #393c3d;
  --ink-soft: #494d4e;
  --muted: #7b716b;
  --line: #dac4ae;
  --accent: #d74e49;
  --accent-hover: #fc4e48;
  --warm: #62b398;
  --warm-soft: #dab3ae;
  --paper: #fffefb;
  --plot-blue: #0d5fcf;
  --plot-green: #159447;
  --shadow: 0 1px 2px rgba(56, 59, 61, 0.04), 0 8px 24px rgba(58, 60, 61, 0.07);
  --radius: 50px;
  --radius-sm: 8px;
}

/* Previous type pairing: headings 'Fraunces', body/UI 'Inter'. */
html { scroll-behavior: smooth; }

body {
  font-family: 'Mukta Vaani', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: 'Mukta Vaani', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  font-weight: 400;
  letter-spacing: 0;
  margin: 0 0 0.5em;
  line-height: 1.18;
}

h1, h2 {
  font-family: 'Signika Negative', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.4rem; font-weight: 400; }
h4 { font-size: 1.1rem; font-weight: 400; font-family: 'Mukta Vaani', sans-serif; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }

p { margin: 0 0 1.1em; }

a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--warm); }

/* ---------- Layout ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

.section { padding: 80px 0; }
.section-tight { padding: 56px 0; }
.section-alt { background: var(--surface); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,253,246,.9);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; max-width: 1100px; margin: 0 auto;
}
.nav-brand {
  display: flex; align-items: center;
}
.nav-brand a {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.nav-brand img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover; object-position: center;
  border: 1px solid var(--accent);
  box-shadow: none;
  transition: transform .2s ease;
}
.nav-brand a:hover img {
  transform: scale(1.05);
}
.nav-brand .sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  color: var(--muted); font-size: 0.95rem; font-weight: 500;
  position: relative; padding: 4px 0;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--warm); border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero { padding: 110px 0 60px; }
.hero-eyebrow {
  font-family: 'Mukta Vaani', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: 18px;
  font-weight: 500;
}
.hero h1 {
  margin-bottom: 24px;
  max-width: 25ch;
}
.hero-eyebrow-accent { color: var(--accent); }
.hero-eyebrow-warm { color: var(--warm); }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub {
  max-width: 60ch;
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 500; font-size: 0.95rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--paper);
  transition: all .2s ease;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--paper); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
}
.btn-ghost:hover { background: var(--accent); color: var(--paper); }

/* ---------- About / Intro blocks ---------- */
.intro-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: start;
}
.intro-grid .lead,
.home-about .section-head .lead {
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--ink-soft);
  text-align: justify;
}
.intro-aside { padding: 28px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.intro-aside h4 { margin-top: 0; color: var(--accent); }
.intro-aside ul { padding-left: 18px; margin: 0; }
.intro-aside li { margin-bottom: 8px; color: var(--muted); }

/* ---------- Section heads ---------- */
.section-head { margin-bottom: 48px; max-width: 56ch; }
.section-head .eyebrow {
  font-size: 1rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--warm); font-weight: 600; margin-bottom: 14px;
}
.section-head h2 { margin: 0; }
.section-head p { margin-top: 16px; color: var(--muted); font-size: 1.05rem; }

/* ---------- Projects grid (postcards) ---------- */
.project-filter {
  margin-bottom: 32px;
}
.project-filter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.project-filter-label {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--warm);
  font-weight: 600;
}
.project-filter-count {
  color: var(--muted);
  font-size: 0.9rem;
}
.project-filter-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.project-menu {
  position: relative;
}
.project-menu-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.project-menu-button::-webkit-details-marker {
  display: none;
}
.project-menu-button::marker {
  content: "";
}
.project-menu-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.project-menu-button:hover,
.project-menu[open] .project-menu-button {
  border-color: var(--accent);
  color: var(--accent);
}
.project-menu-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(73, 158, 215, 0.18);
}
.project-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 220px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.project-menu-panel button {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--ink-soft);
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.2;
  padding: 9px 10px;
  text-align: left;
}
.project-menu-panel button:hover,
.project-menu-panel button[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--accent);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
}
.project-card {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  text-decoration: none;
  color: inherit;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent-hover);
  color: inherit;
}
.project-card:hover .card-arrow { transform: translateX(4px); color: var(--warm); }
.project-card .card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}
.project-card .card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.project-card .card-image-contain img {
  object-fit: contain;
  padding: 12px;
}
.project-card:hover .card-image img { transform: scale(1.04); }
.project-card .card-image-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--paper) 100%);
  color: var(--warm-soft);
  font-family: 'Signika Negative', sans-serif;
  font-size: 2.4rem;
}
.card-image-yoga {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%) !important;
  color: var(--accent-hover) !important;
  font-size: 4rem !important;
}
.card-image-design {
  background: linear-gradient(135deg, var(--ink) 0%, var(--warm) 100%) !important;
  color: var(--paper) !important;
  font-size: 4rem !important;
}
.card-image-achira {
  background: linear-gradient(135deg, var(--surface) 0%, var(--warm) 100%) !important;
  color: var(--paper) !important;
  font-family: 'Signika Negative', sans-serif !important;
  font-style: italic !important;
  font-weight: 400 !important;
  font-size: 5rem !important;
}
.project-card .card-body { padding: 22px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.project-card h3 {
  font-size: 1.18rem; font-weight: 500; margin: 0 0 10px;
  color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.project-card h3 .card-arrow {
  color: var(--accent);
  font-weight: 500;
  flex-shrink: 0;
  font-family: 'Mukta Vaani', sans-serif;
  font-size: 1.05rem;
  transition: transform .25s ease, color .25s ease;
}
.project-card:hover h3 .card-arrow {
  transform: translateX(4px);
  color: var(--warm);
}
.project-card .card-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.project-card .tag {
  font-size: 0.72rem;
  padding: 3px 10px;
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.project-card .card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
  font-size: 0.9rem; color: var(--accent); font-weight: 500;
}
.card-arrow { transition: transform .25s ease, color .25s ease; }

/* ---------- Project story page ---------- */
.story-hero {
  padding: 70px 0 30px;
  border-bottom: 1px solid var(--line);
}
.story-hero .back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.92rem; color: var(--muted);
  margin-bottom: 30px;
}
.story-hero .back-link:hover { color: var(--accent); }
.story-hero h1 { max-width: 24ch; }
.story-tags {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px;
}
.story-tags .tag {
  font-size: 0.78rem; padding: 5px 13px;
  background: var(--surface-2); color: var(--ink-soft);
  border-radius: 999px;
}

.story { padding: 60px 0 80px; }
.story p { font-size: 1.1rem; line-height: 1.78; color: var(--ink-soft); max-width: ch; }

.story-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
  margin-bottom: 80px;
}
.story-block.reverse .story-block-image { order: 1; }
.story-block.reverse .story-block-text { order: 2; }
.story-block-image img {
  width: 100%; border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
  max-height: 500px;
}
.story-block-image img.story-figure-contain,
.story-full img.story-figure-contain {
  object-fit: contain;
  background: var(--paper);
  padding: 10px;
}
.story-block-image video {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--ink);
}
.silent-video {
  position: relative;
}
.silent-video video {
  display: block;
}
.silent-video-toggle {
  position: absolute;
  left: 16px;
  bottom: 16px;
  border: 1px solid rgba(255,253,246,0.55);
  background: rgba(38,50,56,0.88);
  color: var(--paper);
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(38,50,56,0.18);
}
.silent-video-toggle:hover,
.silent-video-toggle:focus {
  background: rgba(38,50,56,0.98);
  outline: none;
}
.story-block-text h3 {
  font-family: 'Mukta Vaani', sans-serif;
  font-weight: 400;
  font-size: 1.6rem;
  margin-bottom: 18px;
  color: var(--accent);
}

.story-full {
  margin: 60px 0;
}
.story-full img {
  width: 100%; border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.story-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.story-gallery img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.story-gallery-small {
  max-width: 520px;
}
.story-image-stack {
  display: grid;
  gap: 14px;
}
.story-image-stack img {
  width: 100%;
  display: block;
}
.story-image-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.story-image-pair img {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--paper);
  padding: 8px;
}
.story-gallery img,
.story-full img,
.story-document img {
  cursor: zoom-in;
}
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 20, 22, 0.86);
  border: 0;
}
.image-lightbox[hidden] {
  display: none;
}
.image-lightbox img {
  max-width: min(96vw, 1400px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.35);
  cursor: zoom-out;
}
.image-lightbox button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--paper);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.story-mini-gallery {
  display: grid;
  gap: 12px;
}
.story-mini-gallery img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.design-gallery {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.design-gallery img {
  aspect-ratio: auto;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: var(--paper);
  padding: 10px;
}
.story-document {
  margin: 46px 0 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-soft);
}
.story-document h3 { margin-top: 0; }
.story-document a { font-weight: 600; }
.story-document img {
  width: 100%;
  max-height: 640px;
  object-fit: contain;
  background: var(--paper);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.story-cta {
  margin-top: 60px;
  padding: 36px 38px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
}
.story-cta p { margin: 0; }

/* Compact bottom CTA for project story pages */
.story-end {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.95rem;
}
.story-end a {
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 4px;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.story-end a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Research & CV layouts ---------- */
.timeline { border-left: 2px solid var(--line); padding-left: 28px; margin-top: 24px; }
.timeline-item { position: relative; padding-bottom: 38px; }
.timeline-item::before {
  content: ''; position: absolute; left: -35px; top: 8px;
  width: 12px; height: 12px; background: var(--warm); border-radius: 50%;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--warm-soft);
}
.timeline-item h3 { margin-bottom: 4px; font-size: 1.2rem; font-family: 'Mukta Vaani', sans-serif; font-weight: 500; color: var(--ink); }
.timeline-item .meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 10px; }
.timeline-item ul { padding-left: 18px; margin: 0; }
.timeline-item li { margin-bottom: 6px; color: var(--ink-soft); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  margin-top: 30px;
}
.skill-card {
  padding: 24px; background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--line);
}
.skill-card h4 {
  font-family: 'Mukta Vaani', sans-serif;
  font-size: 1.05rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 500;
}
.skill-card p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); line-height: 1.6; }

.publication {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.publication .pub-tag { color: var(--warm); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.publication h3 { margin: 8px 0 12px; font-family: 'Mukta Vaani', sans-serif; font-weight: 500; }
.publication .authors { color: var(--muted); font-size: 0.95rem; margin-bottom: 14px; }
.publication .pub-link { font-weight: 500; }
.award-list { margin: 0; padding-left: 18px; }
.award-list li { margin-bottom: 8px; color: var(--ink-soft); }
.award-list li:last-child { margin-bottom: 0; }

.thesis-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 42px;
  align-items: start;
  margin-bottom: 44px;
}
.thesis-lead p {
  max-width: 70ch;
  font-size: 1.08rem;
  line-height: 1.78;
  color: var(--ink-soft);
}
.thesis-figure {
  margin: 0;
}
.thesis-figure > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.thesis-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}
.pl-setup-stack {
  display: grid;
  gap: 12px;
}
.pl-setup-stack-columns {
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}
.pl-setup-stack-compact {
  max-width: 860px;
  margin-inline: auto;
}
.pl-setup-stack img {
  width: 100%;
  display: block;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.pl-setup-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pl-setup-pair img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.thesis-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 30px 0 36px;
}
.thesis-card {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.thesis-card span {
  display: block;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.thesis-card h3,
.thesis-results h3 {
  font-family: 'Mukta Vaani', sans-serif;
  font-weight: 500;
  margin: 0 0 10px;
}
.thesis-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.6;
}
.thesis-results {
  max-width: 78ch;
  margin-top: 42px;
  margin-bottom: 42px;
}
.thesis-results ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.thesis-results li {
  margin-bottom: 8px;
}

/* ---------- CV ---------- */
.cv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 20px;
  align-items: start;
}
.cv-grid h2 {
  font-size: 1.6rem;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
  margin: 0 0 24px;
}
.cv-grid .skills-grid { grid-template-columns: 1fr; gap: 16px; }
.cv-bottom { margin-top: 70px; }
.cv-meta {
  margin-top: 70px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  align-items: start;
}
.cv-meta-item h4 {
  color: var(--muted); font-size: 0.78rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  margin: 0 0 10px;
}
.cv-meta-item p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.55; }
.cv-meta-cta { display: flex; align-items: flex-start; }
.cv-meta-cta .btn { width: 100%; justify-content: center; }
@media (max-width: 800px) {
  .cv-grid { grid-template-columns: 1fr; gap: 40px; }
}
.cv-aside-sticky {
  position: sticky;
  top: 90px;
}
.cv-skill-list h4 {
  font-family: 'Mukta Vaani', sans-serif;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent);
  margin: 0 0 6px;
  font-weight: 500;
}
.cv-skill-list .skill-block {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.cv-skill-list .skill-block:last-child { border-bottom: none; }
.cv-skill-list p { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--ink-soft); }
.cv-aside-block { margin-bottom: 28px; }
.cv-aside-block h4 {
  color: var(--muted); font-size: 0.78rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  margin: 0 0 10px;
}
.cv-aside-block p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.cv-aside h4 { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.16em; }
.cv-contact a { display: block; padding: 6px 0; color: var(--ink-soft); }
.cv-contact a:hover { color: var(--warm); }
.cv-contact-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.cv-contact-item:last-child { border-bottom: none; }
.cv-contact-item .icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); color: var(--accent);
  font-size: 0.85rem;
}

.cv-section { margin-bottom: 56px; }
.cv-section h2 {
  font-size: 1.6rem; padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 24px;
}

.exp-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  margin-bottom: 36px;
  align-items: start;
}
.exp-row .logo {
  width: 70px; height: 70px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  overflow: hidden;
}
.exp-row .logo-empty { background: var(--surface-2); }
.exp-row .logo img { max-width: 78%; max-height: 78%; object-fit: contain; }
.exp-row h3 { font-size: 1.1rem; font-family: 'Mukta Vaani', sans-serif; font-weight: 500; margin-bottom: 4px; color: var(--ink); }
.exp-row .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }
.exp-row ul { padding-left: 18px; margin: 0; }
.exp-row li { margin-bottom: 5px; color: var(--ink-soft); font-size: 0.97rem; }

/* ---------- Highlight / Featured strip ---------- */
.featured {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 30px;
}
.featured .project-card { transition: transform .3s ease, box-shadow .3s ease; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.footer a { color: var(--muted); margin-left: 18px; }
.footer a:first-of-type { margin-left: 0; }
.footer a:hover { color: var(--accent); }

/* ---------- Home (no-nav) variants ---------- */
.home-page { min-height: 100vh; }
.home-hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 80px 0 60px;
  position: relative;
}
.home-hero::before {
  content: "";
  position: absolute;
  left: clamp(50px, 2vw, 500px);
  top: 0vh;
  bottom: 0vh;
  width: 40px;
  background: var(--accent);
}
.home-hero-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 50px;
  align-items: center;
  margin-bottom: 28px;
}
.home-hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.15;
  max-width: 18ch;
}
.home-hero .hero-eyebrow { margin-bottom: 14px; text-align: center; color: var(--warm); }
.home-hero .hero-sub {
  max-width: none;
  font-size: 1.3rem;
  margin: 0;
}
.home-portrait {
  position: relative;
  border-radius: 50%;
  aspect-ratio: 1;
  width: 280px;
  height: 280px;
  flex-shrink: 0;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: none;
  border: 2px solid var(--accent);
}
.home-portrait::before {
  content: none;
}
.home-portrait img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center center;
  display: block;
}
.home-portrait .initials {
  display: none;
  width: 100%; height: 100%;
  align-items: center; justify-content: center;
  font-family: 'Signika Negative', sans-serif;
  font-weight: 300;
  font-size: 4.8rem;
  color: var(--accent);
  letter-spacing: -0.02em;
  user-select: none;
}
.home-portrait img.broken { display: none; }
.home-portrait img.broken ~ .initials { display: flex; }

.home-buttons {
  display: flex; flex-wrap: wrap; gap: 0;
  margin-top: 36px;
  justify-content: center;
  align-items: center;
}
.home-buttons a {
  position: relative;
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  font-weight: 500; font-size: 1.2rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  transition: color .2s ease;
  text-decoration: none;
}
.home-buttons a:not(:last-child)::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line);
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
}
.home-buttons a::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: var(--warm);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s ease;
}
.home-buttons a:hover {
  color: var(--accent);
}
.home-buttons a.primary {
  color: var(--accent);
}
.home-buttons a:hover::before,
.home-buttons a.primary::before {
  transform: scaleX(1);
}

.home-tagline {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 100px;
  letter-spacing: 0.04em;
  text-align: center;
}
.home-tagline a { color: var(--muted); border-bottom: 1px solid transparent; }
.home-tagline a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Scroll-down indicator */
.scroll-cue {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .2s ease;
}
.scroll-cue:hover { color: var(--accent); }
.scroll-cue .chevron {
  width: 22px; height: 22px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -6px;
  animation: scroll-bounce 2s ease-in-out infinite;
}
@keyframes scroll-bounce {
  0%, 100% { transform: rotate(45deg) translate(-4px, -4px); opacity: 0.6; }
  50%      { transform: rotate(45deg) translate(2px, 2px);   opacity: 1;   }
}

/* About reveal section on home */
.home-about {
  padding: 50px 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.home-about-buttons {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: 30px 0 60px;
}
.home-about-buttons a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 500; font-size: 0.92rem;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: all .2s ease;
}
.home-about-buttons a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ---------- CV horizontal contact strip ---------- */
.contact-strip {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 36px;
}
.contact-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all .2s ease;
}
.contact-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--paper);
}
.contact-pill .icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent);
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 600;
}
.contact-pill:hover .icon { background: var(--warm); }

/* ---------- Project cards: tags hidden until hover ---------- */
.project-card .card-tags {
  max-height: 0;
  overflow: hidden;
  margin-bottom: 0;
  transition: max-height .35s ease, margin-bottom .35s ease, opacity .25s ease;
  opacity: 0;
}
.project-card:hover .card-tags,
.project-card:focus-within .card-tags {
  max-height: 80px;
  margin-bottom: 14px;
  opacity: 1;
}

/* ---------- Interactive graph ---------- */
.graph-card {
  margin-top: 40px;
  padding: 36px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.graph-card h3 {
  font-family: 'Mukta Vaani', sans-serif;
  font-weight: 400;
  margin: 0 0 8px;
  color: var(--accent);
}
.graph-card .graph-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
  max-width: 100ch;
}
.graph-svg-wrap {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, var(--paper) 0%, var(--surface) 100%);
  border-radius: var(--radius-sm);
  padding: 8px 8px 4px;
  border: 1px solid var(--line);
}
.graph-svg { width: 100%; height: auto; display: block; }
.graph-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  margin-top: 28px;
}
.graph-control { display: flex; flex-direction: column; }
.graph-control label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.graph-control label .value {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.graph-control input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--bg);
  border-radius: 2px;
  outline: none;
}
.graph-control input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--paper);
  box-shadow: 0 2px 6px rgba(38,50,56,.2);
  transition: transform .15s ease, background .15s ease;
}
.graph-control input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--warm);
}
.graph-control input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--paper);
}

.paper-plot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.paper-plot-panel {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.paper-plot-svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--paper);
  border-radius: 6px;
}
.paper-plot-svg .plot-bg {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 1;
}
.paper-plot-svg .plot-axes {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
}
.paper-plot-svg .plot-ticks {
  font-family: 'Mukta Vaani', sans-serif;
  font-size: 14px;
  fill: var(--muted);
}
.paper-plot-svg .plot-label {
  font-family: 'Mukta Vaani', sans-serif;
  font-size: 14px;
  font-weight: 400;
  fill: var(--muted);
  text-anchor: middle;
  dominant-baseline: middle;
}
.paper-plot-svg .plot-family,
.paper-plot-svg .plot-curve {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.paper-plot-svg .plot-family path {
  stroke-width: 2;
  opacity: 0.62;
}
.paper-plot-svg .plot-family-blue path {
  stroke: var(--plot-blue);
}
.paper-plot-svg .plot-family-green path {
  stroke: var(--plot-green);
}
.paper-plot-svg .plot-curve {
  stroke: var(--ink);
  stroke-width: 4.2;
}
.paper-plot-panel-blue .plot-curve {
  stroke: var(--ink);
}
.paper-plot-panel-green .plot-curve {
  stroke: var(--ink);
}
.paper-plot-svg .plot-markers circle {
  stroke: none;
}
.paper-plot-svg .plot-markers-blue circle {
  fill: var(--plot-blue);
}
.paper-control {
  margin-top: 16px;
  padding: 0 4px 2px;
}
.spectral-plot-section {
  margin-bottom: 34px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}
.plotly-plot {
  width: 100%;
  height: 360px;
  background: var(--paper);
  border-radius: 6px;
}
.plotly-plot .main-svg {
  border-radius: 6px;
}
.spectral-plot-svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--paper);
  border-radius: 6px;
}
.spectral-plot-svg .plot-bg {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 1;
}
.spectral-plot-svg .plot-axes {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
}
.spectral-plot-svg .plot-axes text,
.spectral-plot-svg .plot-ticks {
  font-family: 'Mukta Vaani', sans-serif;
  font-size: 14px;
  fill: var(--muted);
  stroke: none;
}
.spectral-plot-svg .plot-label {
  font-family: 'Mukta Vaani', sans-serif;
  font-size: 17px;
  font-weight: 500;
  fill: var(--ink);
}
.spectral-family path,
.spectral-active,
.spectral-2d-curve {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spectral-family path {
  stroke-width: 2.6;
  opacity: 0.78;
}
.spectral-active {
  stroke: var(--ink);
  stroke-width: 4.6;
}
.spectral-2d-curve {
  stroke-width: 4.4;
}
.spectral-control {
  max-width: 520px;
  margin: 22px auto 0;
}
.spectral-control input[type=range] {
  background: linear-gradient(90deg, hsl(270 92% 39%), hsl(210 92% 42%), hsl(155 92% 40%), hsl(80 92% 42%), hsl(20 92% 44%), hsl(0 92% 35%));
}
.spectral-control input[type=range]::-webkit-slider-thumb {
  background: var(--ink);
}
.spectral-control input[type=range]::-moz-range-thumb {
  background: var(--ink);
}
.plot-caption {
  max-width: 84ch;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
  text-align: justify;
}
.spectral-plot-section .plot-caption {
  margin-top: 18px;
}
.paper-plot-panel-blue .graph-control input[type=range]::-webkit-slider-thumb {
  background: var(--plot-blue);
}
.paper-plot-panel-blue .graph-control input[type=range]::-moz-range-thumb {
  background: var(--plot-blue);
}
.paper-plot-panel-blue .graph-control label .value {
  color: var(--plot-blue);
}
.paper-plot-panel-green .graph-control input[type=range]::-webkit-slider-thumb {
  background: var(--plot-green);
}
.paper-plot-panel-green .graph-control input[type=range]::-moz-range-thumb {
  background: var(--plot-green);
}
.paper-plot-panel-green .graph-control label .value {
  color: var(--plot-green);
}
.graph-legend {
  display: flex; gap: 22px; margin-top: 18px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--muted);
}
.graph-legend .swatch {
  display: inline-block; width: 18px; height: 3px;
  background: var(--accent); margin-right: 8px; vertical-align: middle;
  border-radius: 2px;
}
.graph-legend .swatch.warm { background: var(--warm); }
.graph-legend .swatch.warm-dashed {
  background: transparent;
  border-top: 2px dashed var(--warm);
  height: 0;
  width: 22px;
  vertical-align: middle;
  margin-right: 8px;
}
.graph-legend .swatch.fam {
  background: var(--accent);
  opacity: 0.18;
}

/* New graph grid layout */
.graph-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  align-items: start;
}
.graph-grid .graph-svg-wrap { margin: 0; }
.graph-side {
  display: flex; flex-direction: column; gap: 18px;
}
.readout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.readout h4 {
  font-family: 'Mukta Vaani', sans-serif;
  font-size: 0.95rem;
  text-transform: none; letter-spacing: 0;
  color: var(--accent);
  margin: 0 0 10px;
  font-weight: 500;
}
.readout dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
}
.readout dt {
  color: var(--muted);
  font-size: 0.82rem;
}
.readout dd {
  margin: 0;
  font-family: 'Mukta Vaani', sans-serif;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.subplot {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px 8px;
}
.subplot-title {
  font-family: 'Mukta Vaani', sans-serif;
  font-size: 0.92rem;
  color: var(--accent);
  margin-bottom: 6px;
}
.subplot svg { width: 100%; height: auto; display: block; }

@media (max-width: 900px) {
  .graph-grid { grid-template-columns: 1fr; }
  .paper-plot-grid { grid-template-columns: 1fr; }
  .thesis-lead { grid-template-columns: 1fr; }
  .thesis-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  body { font-size: 16px; }
  .section { padding: 60px 0; }
  .hero { padding: 70px 0 40px; }
  .intro-grid { grid-template-columns: 1fr; gap: 32px; }
  .story-block { grid-template-columns: 1fr; gap: 24px; margin-bottom: 50px; }
  .pl-setup-stack-columns {
    grid-template-rows: none;
    grid-auto-flow: row;
  }
  .story-block.reverse .story-block-image,
  .story-block.reverse .story-block-text { order: initial; }
  .story-image-pair { grid-template-columns: 1fr; }
  .cv-grid { grid-template-columns: 1fr; gap: 32px; }
  .featured { grid-template-columns: 1fr; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.88rem; }
  .nav-brand { font-size: 1rem; }
  .container { padding: 0 20px; }
  .home-hero { min-height: auto; padding: 60px 0 40px; }
  .home-hero::before { content: none; }
  .home-hero-row { grid-template-columns: 1fr; gap: 28px; justify-items: center; text-align: center; }
  .home-hero h1 { text-align: center; max-width: none; }
  .home-hero .hero-sub { text-align: center; }
  .home-portrait { width: 180px; height: 180px; order: -1; }
  .home-portrait .initials { font-size: 4rem; }
  .scroll-cue { position: static; transform: none; margin-top: 36px; }
  .cv-aside-sticky { position: static; }
  .graph-card { padding: 22px; }
  /* Mobile: always show tags since hover doesn't apply */
  .project-card .card-tags { max-height: 80px; opacity: 1; margin-bottom: 14px; }
  /* Tighten the project grid on narrow phones */
  .project-grid { grid-template-columns: 1fr; gap: 22px; }
  .thesis-map { grid-template-columns: 1fr; }
  .pl-setup-pair { grid-template-columns: 1fr; }
  /* CV meta: button stretches full width on its own row */
  .cv-meta { gap: 24px; }
}

/* iPhone-friendly: research figures fit the viewport instead of forcing horizontal scroll */
@media (max-width: 700px) {
  .graph-svg-wrap {
    overflow-x: visible;
    position: relative;
    padding: 6px;
  }
  .graph-svg-wrap .graph-svg { min-width: 0; }
  .graph-svg-wrap::after { content: none; }
  .paper-plot-grid { gap: 18px; }
  .paper-plot-panel {
    padding: 8px;
    overflow-x: visible;
  }
  .paper-control { padding: 0; }
  .graph-control label {
    gap: 12px;
    line-height: 1.25;
  }
  .subplot svg { min-width: 0; }
  .paper-plot-svg,
  .spectral-plot-svg,
  .plotly-plot { min-width: 0; }
  .plotly-plot { height: 300px; }
  .graph-controls { gap: 16px; }
}
