/* ============================================================
   Siddharth Joshi — clean / editorial homepage
   Self-contained styles (independent of minimal-mistakes)
   ============================================================ */

:root {
  /* two alternating off-white section shades — no pure white */
  --sec-a: #f5f4f0;          /* warm off-white */
  --sec-b: #e9ebf6;          /* soft accent-tinted off-white */
  --bg: var(--sec-a);
  --bg-soft: var(--sec-b);
  --surface: #fcfcfa;        /* card surface — off-white, lifts off both shades */
  --ink: #16161a;
  --ink-soft: #3f3f46;
  --muted: #6f6f78;
  --line: #e4e2dd;
  --line-strong: #d3d0c9;
  /* single accent (indigo) + tonal variants */
  --accent: #4338ca;
  --accent-soft: #e7e9fb;
  --accent-ink: #3730a3;
  --accent-2: #6d63ec;       /* lighter indigo for subtle monochrome gradients */
  --shadow-sm: 0 1px 2px rgba(16,16,26,.04), 0 1px 3px rgba(16,16,26,.06);
  --shadow-md: 0 8px 24px -8px rgba(16,16,26,.12), 0 2px 8px -2px rgba(16,16,26,.06);
  --shadow-lg: 0 24px 48px -16px rgba(16,16,26,.18), 0 8px 16px -8px rgba(16,16,26,.08);
  --radius: 22px;
  --radius-sm: 14px;
  --maxw: 1120px;
  --serif: "Space Grotesk", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }

::selection { background: var(--accent); color: #fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(12px);
  background: rgba(245,244,240,.72);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.scrolled { border-color: var(--line); background: rgba(245,244,240,.9); }
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.nav__brand {
  font-family: var(--serif); font-weight: 600; font-size: 1.02rem;
  letter-spacing: -.01em; color: var(--ink); display: flex; align-items: center; gap: 10px;
}
.nav__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft); }
.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links a {
  font-size: .92rem; color: var(--ink-soft); font-weight: 500; position: relative;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 2px; width: 0;
  background: var(--accent); transition: width .25s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }
.nav__cta {
  padding: 8px 16px; border-radius: 999px; background: var(--ink); color: #fff !important;
  font-size: .88rem; font-weight: 600;
}
.nav__cta:hover { background: var(--accent); }
.nav__links a.nav__cta::after { display: none; }
@media (max-width: 720px) {
  .nav__links a:not(.nav__cta) { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: 86px 0 56px; }
.hero::before {
  content: ""; position: absolute; inset: -120px 0 auto 0; height: 520px; z-index: -1;
  background:
    radial-gradient(60% 60% at 15% 0%, rgba(67,56,202,.08), transparent 70%),
    radial-gradient(50% 50% at 90% 10%, rgba(67,56,202,.06), transparent 70%);
  pointer-events: none;
}
.hero__grid {
  display: grid; grid-template-columns: 1.55fr .9fr; gap: 56px; align-items: center;
}
@media (max-width: 860px) { .hero__grid { grid-template-columns: 1fr; gap: 36px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: .76rem; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent-soft); border: 1px solid #e0e2ff;
  padding: 6px 13px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(67,56,202,.5); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(67,56,202,.45); }
  70% { box-shadow: 0 0 0 8px rgba(67,56,202,0); }
  100% { box-shadow: 0 0 0 0 rgba(67,56,202,0); }
}

.hero h1 {
  font-family: var(--serif); font-weight: 700; letter-spacing: -.03em;
  font-size: clamp(2.9rem, 7vw, 5rem); line-height: 1.02; margin: 0 0 24px;
  color: var(--ink);
}
.hero h1 .hl {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 36em; margin: 0 0 30px; }
.hero__lead p { margin: 0; }
.hero__lead strong { color: var(--ink); font-weight: 600; }
.story p a, .tile p a, .root p a, .newsitem p a, .callout p a { font-weight: 600; }

.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: .94rem;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--ink); }
.btn--primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn svg { width: 17px; height: 17px; }

/* clickable social icons (icon-only, no label) */
.socials { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ico {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
  transition: transform .18s ease, box-shadow .18s ease, color .18s ease, border-color .18s ease, background .18s ease;
}
.ico:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md);
  color: var(--accent); border-color: var(--accent);
}
.ico svg { width: 18px; height: 18px; }

/* custom tooltip on hover/focus */
.ico[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%) translateY(4px);
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  background: var(--ink); color: #fff; font-size: .76rem; font-weight: 500; letter-spacing: .01em;
  opacity: 0; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 5;
}
.ico[data-tip]::before {
  content: ""; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%) translateY(4px);
  border: 5px solid transparent; border-top-color: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease; z-index: 5;
}
.ico[data-tip]:hover::after, .ico[data-tip]:focus-visible::after,
.ico[data-tip]:hover::before, .ico[data-tip]:focus-visible::before {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

.hero__photo { justify-self: center; width: 100%; max-width: 300px; }
.hero__photo img {
  display: block; width: 100%; height: auto;
}
@media (max-width: 860px) { .hero__photo { max-width: 230px; } }

/* ---------- top highlights band ---------- */
.highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 60px; }
@media (max-width: 820px) { .highlights { grid-template-columns: 1fr; gap: 16px; } }

.hl-card {
  position: relative; display: flex; flex-direction: column;
  padding: 26px 26px 24px; border-radius: 20px; color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(16,16,26,.04);
  border: 1px solid rgba(16,16,26,.05);
  transition: transform .22s ease, box-shadow .22s ease;
  overflow: hidden;
}
.hl-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, rgba(67,56,202,.06), transparent 60%);
  opacity: 0; transition: opacity .25s ease;
}
.hl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--ink); }
.hl-card:hover::after { opacity: 1; }
.hl-card__eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 12px;
}
.hl-card__title {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.015em;
  font-size: 1.18rem; line-height: 1.2; margin: 0 0 8px; color: var(--ink);
}
.hl-card__blurb { font-size: .92rem; color: var(--ink-soft); margin: 0 0 20px; }
.hl-card__metric { display: flex; align-items: baseline; gap: 10px; margin-top: auto; }
.hl-card__num {
  font-family: var(--serif); font-weight: 700; font-size: 2.1rem; letter-spacing: -.03em;
  line-height: 1; background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hl-card__mlabel { font-size: .78rem; color: var(--muted); max-width: 12em; }
.hl-card__go {
  margin-top: 16px; font-size: .82rem; font-weight: 600; color: var(--accent);
  opacity: .7; transition: opacity .2s ease, transform .2s ease;
}
.hl-card:hover .hl-card__go { opacity: 1; transform: translateX(3px); }

/* ---------- office hours strip ---------- */
.oh-strip {
  display: flex; align-items: center; gap: 16px; margin-top: 22px;
  padding: 14px 22px; border-radius: 999px; color: var(--ink);
  background: var(--accent-soft); border: 1px solid #dcdffa;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.oh-strip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--ink); }
.oh-strip__icon { font-size: 1.2rem; flex: none; }
.oh-strip__text { font-size: .95rem; color: var(--ink-soft); flex: 1; min-width: 0; }
.oh-strip__text strong { color: var(--accent-ink); font-weight: 600; }
.oh-strip__go { flex: none; font-weight: 600; font-size: .9rem; color: var(--accent); white-space: nowrap; }
@media (max-width: 640px) {
  .oh-strip { flex-wrap: wrap; border-radius: 18px; }
  .oh-strip__text { flex-basis: 100%; }
}

/* ---------- scrollspy left rail ---------- */
.scrollspy {
  position: fixed; left: 26px; top: 50%; transform: translateY(-50%); z-index: 40;
  display: flex; flex-direction: column; gap: 20px;
}
.scrollspy::before {
  content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px;
  background: var(--line); border-radius: 2px;
}
.scrollspy a { display: flex; align-items: center; gap: 12px; color: var(--muted); position: relative; }
.scrollspy__dot {
  width: 12px; height: 12px; border-radius: 50%; flex: none; z-index: 1;
  background: var(--bg); border: 2px solid var(--line-strong);
  transition: transform .22s ease, background .22s ease, border-color .22s ease;
}
.scrollspy__label {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .03em; font-weight: 500;
  opacity: 0; transform: translateX(-6px); transition: opacity .2s ease, transform .2s ease;
  white-space: nowrap;
}
.scrollspy a:hover .scrollspy__label { opacity: .8; transform: none; }
.scrollspy a.active .scrollspy__dot { background: var(--accent); border-color: var(--accent); transform: scale(1.3); }
.scrollspy a.active .scrollspy__label { opacity: 1; transform: none; color: var(--accent-ink); }
@media (max-width: 1180px) { .scrollspy { display: none; } }

/* ---------- section scaffolding ---------- */
.section { padding: 76px 0; position: relative; }
/* Alternate between two off-white shades, but ease across the boundary:
   each section opens in the *other* shade (matching the band above) and
   blends into its own over the first ~200px, so there's no hard line. */
.section--a { background: linear-gradient(to bottom, var(--sec-b) 0, var(--sec-a) 220px); }
.section--b { background: linear-gradient(to bottom, var(--sec-a) 0, var(--sec-b) 220px); }
.sec-head { margin-bottom: 34px; }
.sec-head .kicker {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 500;
}
.sec-head h2 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin: 8px 0 0; color: var(--ink);
}
.sec-head p { color: var(--muted); margin: 10px 0 0; max-width: 44em; }

/* ---------- work tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } }

.tile {
  position: relative; background: var(--surface); border: 1px solid rgba(16,16,26,.055);
  border-radius: var(--radius); padding: 30px; overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 0 rgba(16,16,26,.03);
}
.tile::before {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tile:hover::before { transform: scaleX(1); }
.tile--feature { grid-column: 1 / -1; padding: 40px; }

.tile__tag {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.tile__tag .pill { background: var(--accent-soft); color: var(--accent-ink); padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.tile h3 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.015em;
  font-size: 1.32rem; margin: 0 0 6px; color: var(--ink); line-height: 1.2;
}
.tile--feature h3 { font-size: clamp(1.6rem, 3vw, 2.05rem); }
.tile__sub { font-size: .98rem; color: var(--accent-ink); font-weight: 500; margin: 0 0 8px; }
.tile__by {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .03em; color: var(--muted);
  margin: 0 0 14px;
}
.tile p { color: var(--ink-soft); font-size: .97rem; margin: 0 0 18px; }
.tile--feature p { font-size: 1.04rem; max-width: 52em; }

/* metrics: borderless, text-first (un-boxy), divided by thin rules */
.metrics { display: flex; flex-wrap: wrap; gap: 16px 28px; margin: 4px 0 22px; }
.metric { padding-left: 14px; border-left: 2px solid var(--accent-soft); min-width: 0; }
.metric b { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.2rem;
  color: var(--ink); letter-spacing: -.02em; line-height: 1.1; }
.metric span { font-size: .78rem; color: var(--muted); }
.tile--feature .metric { border-left-color: var(--accent); }
.tile--feature .metric b { color: var(--accent); font-size: 1.35rem; }

.tile__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.tile__role {
  font-size: .86rem; color: var(--muted); border-left: 2px solid var(--accent); padding-left: 11px;
}
.links { display: flex; flex-wrap: wrap; gap: 14px; }
.links a {
  font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 5px;
}
.links a::after { content: "↗"; font-size: .8em; opacity: .6; transition: transform .18s ease; }
.links a:hover::after { transform: translate(2px,-2px); }

/* small tiles row */
.tiles--mini { grid-template-columns: repeat(3, 1fr); margin-top: 20px; }
@media (max-width: 760px) { .tiles--mini { grid-template-columns: 1fr; } }
.tile--mini { padding: 22px; }
.tile--mini h3 { font-size: 1.08rem; }
.tile--mini p { font-size: .9rem; margin-bottom: 14px; }

/* roots / earlier work — compact list cards */
.roots { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
@media (max-width: 760px) { .roots { grid-template-columns: 1fr; } }
.root {
  display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px;
  background: rgba(255,255,255,.45); border: 1px solid transparent; border-radius: var(--radius-sm);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.root:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); background: var(--surface); }
.root__venue {
  flex: none; font-family: var(--mono); font-size: .72rem; font-weight: 600;
  color: var(--accent-ink); background: var(--accent-soft); border-radius: 8px;
  padding: 6px 9px; white-space: nowrap;
}
.root h4 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; color: var(--ink); font-family: var(--serif); letter-spacing: -.01em; }
.root p { margin: 0; font-size: .88rem; color: var(--muted); }
.root a { font-weight: 600; }

/* ---------- story ---------- */
.story { max-width: 760px; }
.story blockquote {
  margin: 0 0 26px; font-family: var(--serif); font-weight: 500; letter-spacing: -.01em;
  font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.3; color: var(--ink);
  border: none; padding: 0;
}
.story blockquote .hl { color: var(--accent); }
.story p { color: var(--ink-soft); font-size: 1.04rem; }
.story__attr { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin-top: 18px; }

.callout {
  margin-top: 30px; display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 22px 24px; box-shadow: var(--shadow-sm);
}
.callout__icon { font-size: 1.4rem; }
.callout h4 { margin: 0 0 4px; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.callout p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* ---------- publications ---------- */
.pubtabs { display: flex; gap: 8px; margin-bottom: 22px; }
.pubtab {
  font-family: var(--sans); font-weight: 600; font-size: .9rem; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-soft);
  transition: all .18s ease;
}
.pubtab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pubtab:hover { border-color: var(--accent); color: var(--accent); }
.pubtab[aria-selected="true"]:hover { color: #fff; }

.publist { list-style: none; margin: 0; padding: 0; }
.publist[hidden] { display: none; }
.pub {
  display: flex; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line);
}
.pub:last-child { border-bottom: none; }
.pub__n { flex: none; width: 30px; font-family: var(--mono); font-size: .85rem; color: var(--muted); padding-top: 3px; }
.pub__body { flex: 1; }
.pub__title { font-weight: 600; color: var(--ink); }
.pub__title a { color: var(--ink); }
.pub__title a:hover { color: var(--accent); }
.pub__authors { font-size: .9rem; color: var(--muted); margin-top: 3px; }
.pub__authors .me { color: var(--ink); font-weight: 600; }
.pub__venue {
  display: inline-block; margin-top: 8px; font-family: var(--mono); font-size: .74rem;
  font-weight: 600; letter-spacing: .03em; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 6px; padding: 3px 9px;
}
.pub__venue.oral { color: #b45309; background: #fef3c7; }

/* ---------- news timeline ---------- */
.news { list-style: none; margin: 0; padding: 0; position: relative; }
.news::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.newsitem { position: relative; padding: 0 0 22px 34px; }
.newsitem::before {
  content: ""; position: absolute; left: 2px; top: 7px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--line-strong);
}
.newsitem:first-child::before { border-color: var(--accent); background: var(--accent); }
.newsitem time { font-family: var(--mono); font-size: .76rem; color: var(--muted); font-weight: 500; }
.newsitem p { margin: 3px 0 0; font-size: .98rem; color: var(--ink-soft); }
.newsitem .news-more { display: none; }
.news.expanded .news-more { display: block; }
.news-toggle {
  margin-top: 6px; margin-left: 34px; font-family: var(--sans); font-weight: 600; font-size: .9rem;
  cursor: pointer; border: none; background: none; color: var(--accent); padding: 0;
}
.news-toggle:hover { color: var(--accent-ink); }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: #d4d4d8; padding: 56px 0 40px; }
.foot__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.foot h3 { font-family: var(--serif); color: #fff; font-size: 1.4rem; margin: 0 0 8px; }
.foot p { margin: 0; max-width: 30em; color: #a1a1aa; }
.foot__links { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.foot__links a { color: #d4d4d8; font-weight: 500; font-size: .92rem; display: inline-flex; align-items: center; gap: 7px; }
.foot__links a:hover { color: #fff; }
.foot__links svg { width: 18px; height: 18px; }
.foot__bar { margin-top: 36px; padding-top: 20px; border-top: 1px solid #2a2a31; font-size: .82rem; color: #71717a; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot__bar a { color: #a1a1aa; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .06s; }
.reveal.d2 { transition-delay: .12s; }
.reveal.d3 { transition-delay: .18s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .eyebrow .pulse { animation: none; }
}
