/* ============================================================
   Arijit Dey — custom academic theme
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #fbfbfd;
  --bg-soft: #f2f3f8;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --border: rgba(20, 23, 33, 0.10);
  --border-strong: rgba(20, 23, 33, 0.16);
  --text: #1a1f2b;
  --text-soft: #4d556a;
  --muted: #79809a;
  --accent: #5654d4;
  --accent-2: #8b5cf6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(86, 84, 212, 0.10);
  --ring: rgba(86, 84, 212, 0.30);
  --shadow-sm: 0 1px 2px rgba(16, 20, 40, 0.06), 0 1px 3px rgba(16, 20, 40, 0.05);
  --shadow-md: 0 8px 24px rgba(16, 20, 40, 0.08), 0 2px 6px rgba(16, 20, 40, 0.05);
  --shadow-lg: 0 20px 50px rgba(16, 20, 40, 0.14);
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1120px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0c0f17;
  --bg-soft: #11151f;
  --surface: #151a25;
  --surface-2: #1a2030;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ecf5;
  --text-soft: #b3bbce;
  --muted: #828aa0;
  --accent: #8f8df6;
  --accent-2: #b794f6;
  --accent-ink: #0c0f17;
  --accent-soft: rgba(143, 141, 246, 0.14);
  --ring: rgba(143, 141, 246, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--text); line-height: 1.2; font-weight: 600; }
.muted { color: var(--muted); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.nav-wrap {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 68px; display: flex; align-items: center; gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 600; }
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-family: var(--serif); font-weight: 600; font-size: .98rem;
  box-shadow: var(--shadow-sm); letter-spacing: .02em;
}
.brand-name { font-family: var(--serif); font-size: 1.12rem; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.nav-link {
  color: var(--text-soft); font-size: .95rem; font-weight: 500;
  padding: .5rem .7rem; border-radius: 9px; position: relative;
}
.nav-link:hover { color: var(--text); background: var(--accent-soft); }
.nav-link.is-active { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: .35rem; }
.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  cursor: pointer; transition: all .15s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-strong); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.nav-burger { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-size: .94rem; font-weight: 600;
  padding: .62rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  line-height: 1; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary, .btn--success { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover, .btn--success:hover { color: #fff; box-shadow: var(--shadow-md); }
.btn--info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn--info:hover { color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 60%, var(--accent) 12%); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 60% at 78% 18%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%),
    radial-gradient(50% 50% at 12% 8%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
}
.hero-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 76px 24px 64px;
  display: grid; grid-template-columns: 1.25fr .85fr; gap: 56px; align-items: center;
}
.hero-eyebrow {
  margin: 0 0 .5rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  font-size: .78rem; color: var(--accent);
}
.hero-name { margin: 0; font-size: clamp(2.6rem, 5.5vw, 4rem); letter-spacing: -0.01em; }
.hero-tagline { margin: .7rem 0 0; font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-soft); font-weight: 500; }
.hero-blurb { margin: 1.1rem 0 0; color: var(--text-soft); max-width: 36rem; }
.hero-cta { margin: 1.8rem 0 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-social { margin: 1.5rem 0 0; display: flex; gap: .6rem; }
.hero-social a, .footer-social a {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
  font-size: 1.05rem; transition: all .15s ease;
}
.hero-social a:hover, .footer-social a:hover {
  color: #fff; border-color: transparent; transform: translateY(-2px);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.hero-portrait { display: flex; justify-content: center; }
.portrait-frame {
  position: relative; width: min(330px, 78vw); aspect-ratio: 3 / 3.6;
  border-radius: 26px; padding: 8px;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-lg);
}
.portrait-frame::after {
  content: ""; position: absolute; inset: -22px; z-index: -1; border-radius: 40px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
  filter: blur(8px);
}
.portrait-frame img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 19px;
}

/* ---------- Page header (interior pages) ---------- */
.page-head { position: relative; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.page-head::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(70% 120% at 80% -10%, var(--accent-soft), transparent 60%);
}
.page-head-inner {
  position: relative; max-width: var(--maxw); margin: 0 auto; padding: 54px 24px 40px;
}
.page-title { margin: 0; font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: -0.01em; }
.page-subtitle { margin: .6rem 0 0; color: var(--text-soft); font-size: 1.08rem; }
.back-link { font-size: .9rem; font-weight: 600; display: inline-flex; gap: .4rem; align-items: center; margin-bottom: .8rem; }

/* ---------- Shell / prose ---------- */
.page-shell { max-width: var(--maxw); margin: 0 auto; padding: 48px 24px 80px; }
.prose { max-width: 760px; }
.landing-body { padding-top: 8px; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15rem; color: var(--text-soft); }
.prose h2 {
  font-size: 1.7rem; margin: 2.6rem 0 1rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--border); position: relative;
}
.prose h3 { font-size: 1.28rem; margin: 1.9rem 0 .7rem; color: var(--text); }
.prose h4 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.3rem; color: var(--text-soft); }
.prose li { margin: .4rem 0; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { font-weight: 500; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.prose a:hover { border-bottom-color: var(--accent-2); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.2rem 0; }
.prose blockquote {
  margin: 1.4rem 0; padding: .4rem 1.2rem; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 10px 10px 0; color: var(--text-soft);
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em;
  background: var(--surface-2); border: 1px solid var(--border); padding: .12em .4em; border-radius: 6px;
}
.prose pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.1rem; overflow-x: auto; margin: 0 0 1.3rem;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose img { border-radius: 12px; box-shadow: var(--shadow-sm); margin: 1.2rem 0; }
.prose .btn { color: #fff; border-bottom: none; }
.prose .btn--info { color: var(--accent); }
.prose .btn--ghost { color: var(--text); }
.prose .btn:hover { border-bottom: none; }

/* Buttons that sit together in markdown get spacing */
.prose p .btn { margin: .2rem .4rem .2rem 0; }

/* ---------- Cards (used in home sections) ---------- */
.section { margin: 3rem 0 0; }
.section-lead { color: var(--text-soft); max-width: 46rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.1rem; margin-top: 1.3rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem 1.35rem; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.card p { margin: 0; color: var(--text-soft); font-size: .96rem; }
.card .card-icon {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent); font-size: 1.1rem; margin-bottom: .9rem;
}
.card-links { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .9rem; font-weight: 600; }

/* Publication entry card */
.pub {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm); margin: 1rem 0;
  transition: transform .15s ease, box-shadow .15s ease;
}
.pub:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pub-title { font-size: 1.12rem; margin: 0 0 .35rem; }
.pub-authors { margin: 0 0 .25rem; color: var(--text-soft); font-size: .96rem; }
.pub-authors .me { color: var(--text); font-weight: 600; }
.pub-venue { margin: 0 0 .8rem; color: var(--muted); font-size: .9rem; font-style: italic; }
.pub-tag {
  display: inline-block; font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: .2rem .6rem; border-radius: 999px; margin-bottom: .7rem;
}
.pub-links { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Highlight band (e.g. MBZUAI) */
.highlight-band {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-md); margin-top: 1.4rem;
  display: grid; grid-template-columns: 1.1fr 1fr; min-height: 220px;
}
.highlight-band .hb-text { padding: 1.8rem 1.9rem; display: flex; flex-direction: column; justify-content: center; }
.highlight-band .pub-tag { align-self: flex-start; }
.highlight-band h3 { margin: 0 0 .5rem; font-size: 1.4rem; }
.highlight-band p { margin: 0; color: var(--text-soft); }
.highlight-band .hb-media { position: relative; }
.highlight-band .hb-media img { width: 100%; height: 100%; object-fit: cover; }
.highlight-band .hb-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--surface), transparent 38%);
}

/* Timeline (education) */
.timeline { margin: 1.3rem 0 0; border-left: 2px solid var(--border); padding-left: 1.4rem; }
.timeline-item { position: relative; padding: 0 0 1.4rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -1.4rem; top: .35rem; transform: translateX(-52%);
  width: 13px; height: 13px; border-radius: 50%; background: var(--surface);
  border: 3px solid var(--accent);
}
.timeline-item h4 { margin: 0; font-size: 1.05rem; }
.timeline-item .ti-meta { color: var(--muted); font-size: .9rem; }

/* Pills */
.pill-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.pill {
  font-size: .86rem; font-weight: 500; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border); padding: .4rem .85rem; border-radius: 999px;
}

/* ---------- News feed ---------- */
.news { list-style: none; margin: 1.3rem 0 0; padding: 0; display: grid; gap: .2rem; }
.news-item {
  display: grid; grid-template-columns: 132px 1fr; gap: 1.1rem; align-items: start;
  padding: 1rem 0; border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-size: .82rem; font-weight: 600; letter-spacing: .03em; color: var(--accent);
  background: var(--accent-soft); padding: .25rem .6rem; border-radius: 999px;
  justify-self: start; white-space: nowrap; margin-top: .15rem;
}
.news-body { color: var(--text-soft); }
.news-body strong { color: var(--text); }
.news-body .star { color: var(--accent-2); margin-right: .25rem; }
@media (max-width: 560px) {
  .news-item { grid-template-columns: 1fr; gap: .35rem; }
}

/* ---------- Blog list ---------- */
.post-list { display: grid; gap: 1.1rem; max-width: 760px; }
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.post-date { font-size: .82rem; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.post-card-title { margin: .35rem 0 .5rem; font-size: 1.3rem; }
.post-excerpt { color: var(--text-soft); }
.post-more { font-weight: 600; font-size: .92rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1.2rem; margin-top: 2rem; }
.pagination-count { color: var(--muted); font-size: .9rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 2rem; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 14px;
  display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between;
}
.footer-brand { display: flex; flex-direction: column; }
.footer-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.footer-bio { color: var(--muted); font-size: .92rem; }
.footer-legal { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 32px; color: var(--muted); font-size: .84rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2.2rem; text-align: left; padding-top: 52px; }
  .hero-portrait { order: -1; justify-content: flex-start; }
  .portrait-frame { width: min(240px, 60vw); }
  .highlight-band { grid-template-columns: 1fr; }
  .highlight-band .hb-media { min-height: 180px; }
  .highlight-band .hb-media::after { background: linear-gradient(0deg, var(--surface), transparent 45%); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .site-nav {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: .5rem;
    transform: translateY(-130%); transition: transform .28s ease; box-shadow: var(--shadow-md);
  }
  .site-nav.is-open { transform: translateY(0); }
  .nav-link { padding: .8rem 1rem; border-radius: 10px; }
  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); cursor: pointer; padding: 0 10px;
  }
  .nav-burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
  .nav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-burger.is-open span:nth-child(2) { opacity: 0; }
  .nav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
