/* Personal site of Debanjan Mahata.
   Visual language inspired by the Adritian Hugo theme (MIT, Adrián Moreno Peña),
   rewritten as plain CSS so GitHub Pages can serve it without a build step. */

:root {
  --accent: #478079;
  --accent-strong: #345f5a;
  --accent-soft: rgba(71, 128, 121, 0.1);
  --bg: #ffffff;
  --bg-tint: #f5f8f7;
  --surface: #ffffff;
  --text: #1c2321;
  --text-muted: #5b6764;
  --border: #e3e9e7;
  --shadow: 0 1px 2px rgba(16, 24, 22, 0.04), 0 8px 24px rgba(16, 24, 22, 0.06);
  --radius: 14px;
  --nav-h: 68px;
  --maxw: 1140px;
}

[data-theme="dark"] {
  --accent: #66b2a9;
  --accent-strong: #8fcac3;
  --accent-soft: rgba(102, 178, 169, 0.14);
  --bg: #0f1514;
  --bg-tint: #141c1b;
  --surface: #182120;
  --text: #e6eeec;
  --text-muted: #9fb0ac;
  --border: #253331;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.02em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

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

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

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.navbar.is-scrolled { border-bottom-color: var(--border); box-shadow: 0 4px 20px rgba(0,0,0,.04); }
.navbar__inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.navbar__brand { white-space: nowrap; font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: -0.02em; }
.navbar__brand:hover { color: var(--accent); text-decoration: none; }
.navbar__nav { display: flex; gap: 2px; }
.navbar__nav a {
  color: var(--text-muted); font-size: 15px; font-weight: 500;
  padding: 8px 10px; border-radius: 8px;
}
.navbar__nav a:hover, .navbar__nav a.is-current { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.navbar__actions { display: flex; gap: 6px; align-items: center; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.navbar__toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1.5px solid var(--accent); transition: transform .15s ease, background .2s, color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; }
[data-theme="dark"] .btn--primary { color: #0f1514; }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
[data-theme="dark"] .btn--primary:hover { color: #0f1514; }
.btn--ghost { color: var(--accent); background: transparent; }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 620px; height: 620px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
  pointer-events: none;
}
.hero__inner { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: center; position: relative; }
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; margin: 0 0 12px; }
.hero__title { font-size: clamp(40px, 6vw, 64px); font-weight: 800; margin-bottom: 16px; }
.hero__phd { color: var(--text-muted); font-weight: 600; }
.hero__role { font-size: 19px; color: var(--text); margin: 0 0 16px; }
.hero__lead { color: var(--text-muted); font-size: 18px; max-width: 58ch; margin: 0 0 28px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }

.socials { list-style: none; display: flex; gap: 10px; padding: 0; margin: 0; }
.socials a {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--surface);
  transition: color .2s, border-color .2s, transform .15s;
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }

.hero__media { display: flex; justify-content: center; }
.hero__photo {
  position: relative; width: min(340px, 80vw); aspect-ratio: 4 / 5;
  border-radius: 28px; overflow: hidden; box-shadow: var(--shadow);
}
.hero__photo::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.hero__media::before {
  content: ""; position: absolute; width: min(340px, 80vw); aspect-ratio: 4 / 5;
  border-radius: 28px; border: 2px solid var(--accent); transform: translate(18px, 18px); opacity: .5;
}
.hero__media { position: relative; }


/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section--border { border-bottom: 1px solid var(--border); }
.section--tint { background: var(--bg-tint); }
.section__head { margin-bottom: 40px; max-width: 720px; }
.section__title { font-size: clamp(28px, 3.5vw, 38px); font-weight: 800; position: relative; padding-bottom: 14px; }
.section__title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 48px; height: 4px; border-radius: 4px; background: var(--accent); }
.section__sub { color: var(--text-muted); margin: 8px 0 0; }

.two-col { display: grid; grid-template-columns: 1fr 2.2fr; gap: 48px; }
.prose p { margin: 0 0 1.1em; }
.prose p:first-child { font-size: 19px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card h3 { font-size: 18px; }
.card p { color: var(--text-muted); font-size: 15px; margin: 0; }
.card__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px;
}
.card__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Experience (Adritian-style list + detail) ---------- */
.xp { display: grid; grid-template-columns: 340px 1fr; gap: 32px; align-items: start; }
.xp__list { display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--border); }
.xp__tab {
  all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 1px;
  padding: 14px 18px; margin-left: -2px; border-left: 2px solid transparent;
  border-radius: 0 10px 10px 0; transition: background .2s, border-color .2s;
}
.xp__tab:hover { background: var(--accent-soft); }
.xp__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.xp__tab.is-active { border-left-color: var(--accent); background: var(--accent-soft); }
.xp__company { font-weight: 700; color: var(--text); }
.xp__tab.is-active .xp__company { color: var(--accent); }
.xp__role { font-size: 14px; color: var(--text); }
.xp__date { font-size: 13px; color: var(--text-muted); }

.xp__panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow); animation: fade .3s ease;
}
.xp__panel h3 { font-size: 22px; }
.xp__panel h3 span { color: var(--accent); }
.xp__meta { color: var(--text-muted); font-size: 14px; margin: -4px 0 18px; }
.xp__panel ul { margin: 0 0 20px; padding-left: 20px; }
.xp__panel li { margin-bottom: 8px; }
.xp__panel li::marker { color: var(--accent); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font-size: 13px; font-weight: 500; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}

/* ---------- Publications ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); transition: all .2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .chip.is-active { color: #0f1514; }

.pubs { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.pub {
  display: grid; grid-template-columns: 72px 1fr; gap: 20px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; transition: border-color .2s, transform .2s;
}
.pub:hover { border-color: var(--accent); }
.pub[hidden] { display: none; }
.pub__year { font-weight: 800; font-size: 20px; color: var(--accent); letter-spacing: -0.02em; }
.pub__title { font-weight: 600; font-size: 17px; margin: 0 0 4px; line-height: 1.4; }
.pub__title a { color: var(--text); }
.pub__title a:hover { color: var(--accent); }
.pub__venue { color: var(--text-muted); font-size: 14px; margin: 0; font-style: italic; }
.pub__note { font-size: 14px; color: var(--text-muted); margin: 6px 0 0; }
.pub__links { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.pub__links a { font-size: 13px; font-weight: 600; padding: 2px 10px; border: 1px solid var(--border); border-radius: 6px; }
.pub__links a:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- Education timeline ---------- */
.timeline { position: relative; padding-left: 32px; max-width: 820px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline__item { position: relative; padding-bottom: 32px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -32px; top: 5px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.timeline__item h3 { font-size: 20px; margin-bottom: 4px; }
.timeline__org { color: var(--accent); font-weight: 500; margin: 0 0 6px; }
.timeline__item p:not(.timeline__org) { color: var(--text-muted); margin: 0; }

/* ---------- Service ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.panel h3 { font-size: 18px; color: var(--accent); }
.list { margin: 0; padding-left: 18px; }
.list li { margin-bottom: 8px; font-size: 15px; }
.list li::marker { color: var(--accent); }
.press { margin-top: 40px; }
.press h3 { font-size: 18px; }
.press__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
.press__list a { display: block; padding: 12px 0; border-bottom: 1px dashed var(--border); color: var(--text); font-size: 15px; }
.press__list a::after { content: " \2197"; color: var(--accent); }
.press__list a:hover { color: var(--accent); text-decoration: none; }

/* ---------- Contact ---------- */
.contact {
  background:
    radial-gradient(800px 300px at 50% 0%, var(--accent-soft), transparent),
    var(--bg);
  text-align: center;
}
.contact__inner { max-width: 720px; }
.contact .section__title::after { left: 50%; transform: translateX(-50%); }
.contact__links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: 14px; color: var(--text-muted); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer p { margin: 0; }
.footer__quote { font-style: italic; flex: 1; text-align: center; min-width: 240px; }

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

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .navbar__nav {
    position: fixed; top: var(--nav-h); left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px;
    transform: translateY(-120%); transition: transform .25s ease; visibility: hidden;
  }
  .navbar__nav.is-open { transform: none; visibility: visible; }
  .navbar__nav a { padding: 12px; }
  .navbar__toggle { display: inline-grid; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__media { order: -1; }
  .hero__photo, .hero__media::before { width: min(240px, 60vw); }
  .two-col { grid-template-columns: 1fr; gap: 8px; }
  .xp { grid-template-columns: 1fr; }
  .xp__list { flex-direction: row; overflow-x: auto; border-left: 0; border-bottom: 2px solid var(--border); gap: 0; scrollbar-width: thin; }
  .xp__tab { margin: 0 0 -2px; border-left: 0; border-bottom: 2px solid transparent; border-radius: 10px 10px 0 0; min-width: 190px; }
  .xp__tab.is-active { border-bottom-color: var(--accent); }
  .grid-3 { grid-template-columns: 1fr; }
  .press__list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .section { padding: 64px 0; }
  .cards { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; gap: 4px; padding: 18px; }
  .xp__panel { padding: 22px; }
  .footer__inner { flex-direction: column; text-align: center; }
}

@media print {
  .navbar, .hero__cta, .filters, .contact__links, .footer__top, .hero::before, .hero__media::before { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .xp__panel[hidden] { display: block !important; }
  .section { padding: 24px 0; }
}

/* ---------- Publications: tools, authors, badges ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pub-tools { display: grid; gap: 16px; margin-bottom: 12px; }
.pub-tools .filters { margin-bottom: 0; }
.search {
  display: flex; align-items: center; gap: 10px; max-width: 460px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 16px;
  transition: border-color .2s;
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 15px; padding: 11px 0; outline: none;
}
.pub-count { color: var(--text-muted); font-size: 14px; margin: 0 0 16px; }
.pub__authors { font-size: 14px; color: var(--text-muted); margin: 0 0 4px; }
.pub__authors strong { color: var(--text); font-weight: 600; }
.pub__venue { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pub__type {
  font-style: normal; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent);
}
.pub__year { font-size: 18px; }
.timeline__date { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--text-muted); margin: 0 0 2px; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .cards--3 { grid-template-columns: 1fr; } }
.hero__role a { color: inherit; }
.xp__panel h3 span a { color: inherit; }

/* ---------- Mentoring ---------- */
.mentees { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; align-items: start; }
.people { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.people a, .people span {
  display: inline-block; font-size: 15px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.people a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
@media (max-width: 860px) { .mentees { grid-template-columns: 1fr; } }

/* ---------- Resources ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.res { padding-bottom: 16px; border-bottom: 1px dashed var(--border); }
.res:last-child { border-bottom: 0; padding-bottom: 0; }
.res__title { font-weight: 600; margin: 0 0 4px; line-height: 1.4; }
.res__desc { font-size: 14px; color: var(--text-muted); margin: 0; }
.res__links { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.res__links a { font-size: 13px; font-weight: 600; padding: 2px 10px; border: 1px solid var(--border); border-radius: 6px; }
.res__links a:hover { border-color: var(--accent); text-decoration: none; }
@media (max-width: 1040px) { #resources .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- News ---------- */
.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.news__item {
  display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: baseline;
  padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.news__date { font-weight: 700; color: var(--accent); font-size: 15px; }
.news__item p { margin: 0; }
.news__item a { color: var(--text); }
.news__item a:hover { color: var(--accent); }
@media (max-width: 560px) { .news__item { grid-template-columns: 1fr; gap: 4px; } }
