/* ==========================================================================
   Subrata Biswas — al-folio inspired theme (v2)
   Standalone stylesheet. Does not affect the original style.css.
   Swap a single value ( --accent ) to re-brand the whole site.
   ========================================================================== */

:root {
  --accent:        #3b5bdb;
  --accent-soft:   rgba(59, 91, 219, 0.10);
  --accent-hover:  #2f49b0;

  --bg:            #ffffff;
  --bg-alt:        #f7f8fa;
  --card:          #ffffff;
  --border:        #e7e9ee;
  --text:          #1f2328;
  --text-soft:     #4a5058;
  --text-muted:    #8a919c;
  --shadow:        0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg:     0 10px 30px rgba(16, 24, 40, 0.10);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Roboto Slab", Georgia, "Times New Roman", serif;

  --maxw: 960px;
  --nav-h: 62px;
}

[data-theme="dark"] {
  --accent:        #748ffc;
  --accent-soft:   rgba(116, 143, 252, 0.14);
  --accent-hover:  #91a7ff;

  --bg:            #14161a;
  --bg-alt:        #1a1d22;
  --card:          #1c1f25;
  --border:        #2b2f37;
  --text:          #e6e8eb;
  --text-soft:     #b6bcc4;
  --text-muted:    #838a94;
  --shadow:        0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg:     0 10px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.25s ease, color 0.25s ease;
  overflow-x: hidden;            /* never scroll sideways on any screen */
  overflow-wrap: break-word;     /* break long titles/URLs instead of overflowing */
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

img { max-width: 100%; }

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

/* ============================ Navbar ============================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-brand:hover { color: var(--text); text-decoration: none; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: 7px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.nav-links a.active { color: var(--accent); }

.nav-cv {
  border: 1px solid var(--accent) !important;
  color: var(--accent) !important;
}
.nav-cv:hover { background: var(--accent) !important; color: #fff !important; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-soft);
  border-radius: 9px;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.15s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

.nav-toggle { display: none; }

/* ============================ Sections ============================ */
section { padding: 54px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }

.section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 26px;
}
.section-head h2 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.section-head .head-line { flex: 1; height: 1px; background: var(--border); }
.section-head a.see-all { font-size: 0.85rem; font-weight: 500; }

/* ============================ Hero / About ============================ */
.hero { padding-top: 46px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 40px;
  align-items: start;
}
.hero-name {
  font-family: var(--font-head);
  font-size: 2.6rem;
  line-height: 1.1;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.03em;
}
.hero-affil {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin: 0 0 4px;
  font-weight: 500;
}
.hero-affil .accent { color: var(--accent); }
.hero-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 16px 0 20px;
}
.hero-tag {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 999px;
}
.hero-bio p { margin: 0 0 14px; color: var(--text-soft); }
.hero-bio strong { color: var(--text); font-weight: 600; }

.hero-photo { position: sticky; top: calc(var(--nav-h) + 24px); }
.hero-photo img {
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: block;
}
.hero-social {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  justify-content: center;
  margin-top: 16px;
}
.hero-social a {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  max-width: 48px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 1.1rem;
  transition: all 0.15s ease;
}
.hero-social a:hover { color: #fff; background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* ============================ Opportunity banner ============================ */
.banner {
  margin-top: 30px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 12px;
}
.banner i { color: var(--accent); font-size: 1.3rem; margin-top: 2px; }
.banner h4 { margin: 0 0 4px; font-size: 1rem; font-weight: 700; }
.banner p { margin: 0; font-size: 0.92rem; color: var(--text-soft); }

/* ============================ Experience (date-rail résumé) ============================ */
.exp-section { background: var(--bg-alt); }
.exp-grid { display: flex; flex-direction: column; gap: 4px; }

.exp-item {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 22px;
  padding: 16px 16px;
  border-radius: 14px;
  transition: background 0.18s ease;
}
.exp-item:hover { background: color-mix(in srgb, var(--card) 60%, transparent); }
.exp-item.current { background: var(--accent-soft); }

.exp-date {
  display: flex;
  flex-direction: column;
  padding-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.exp-item.current .exp-date .exp-date-end { color: var(--accent); }

.exp-main { display: flex; gap: 18px; align-items: center; min-width: 0; }
.exp-logo {
  flex-shrink: 0;
  width: 66px; height: 66px;
  border-radius: 15px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 11px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.exp-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.exp-item:hover .exp-logo { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 24, 40, 0.18); }
.exp-item.current .exp-logo { box-shadow: 0 0 0 2px var(--accent), 0 2px 10px rgba(16, 24, 40, 0.12); }
.exp-body { min-width: 0; }
.exp-role {
  font-size: 1.04rem; font-weight: 700; margin: 0 0 3px;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.exp-org { color: var(--text-soft); font-size: 0.92rem; margin: 0 0 3px; }
.exp-org .loc { color: var(--text-muted); }
.exp-meta { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.exp-meta a { font-weight: 500; }
.badge-now {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ============================ Publications ============================ */
.pub-year {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 26px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.pub-year:first-of-type { margin-top: 0; }
.pub {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 16px 0;
  align-items: start;
}
.pub + .pub { border-top: 1px solid var(--border); }
.pub-media { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.pub-thumb {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-alt);
  aspect-ratio: 16 / 10;
  display: flex; align-items: center; justify-content: center;
}
.pub-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.pub-thumb:hover img { transform: scale(1.04); }
.pub-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 5px; line-height: 1.35; }
.pub-authors { font-size: 0.9rem; color: var(--text-soft); margin: 0 0 5px; }
.pub-authors .me { color: var(--text); font-weight: 700; border-bottom: 2px solid var(--accent); }
.pub-venue {
  display: inline-block;
  max-width: 100%;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
  padding: 3px 10px;
}
.pub-summary { font-size: 0.9rem; color: var(--text-soft); margin: 0 0 11px; }
.pub-btns { display: flex; flex-wrap: wrap; gap: 7px; }
.pub-btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: var(--card);
  transition: all 0.15s ease;
}
.pub-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pub-btn.primary { border-color: var(--accent); color: var(--accent); }
.pub-btn.primary:hover { background: var(--accent); color: #fff; }
.pub-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ============================ News (timeline) ============================ */
.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 104px;         /* marker center: 68 date + 18 gap + 19 (½ of 38) = 105, minus 1 for 2px width */
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: var(--border);
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 68px 38px 1fr;
  gap: 18px;
  padding: 9px 0;
  align-items: center;
}
.tl-date {
  text-align: right;
  align-self: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.tl-marker {
  position: relative;
  z-index: 1;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.98rem;
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-text { margin: 0; min-width: 0; font-size: 0.94rem; color: var(--text-soft); }
.tl-text strong { color: var(--text); font-weight: 600; }

/* marker colors by news type */
.tl-item[data-type="position"]  .tl-marker { background: #3b82f6; }
.tl-item[data-type="paper"]     .tl-marker { background: #10b981; }
.tl-item[data-type="award"]     .tl-marker { background: #f59e0b; }
.tl-item[data-type="degree"]    .tl-marker { background: #8b5cf6; }
.tl-item[data-type="milestone"] .tl-marker { background: #14b8a6; }

.news-extra { display: none; }
.timeline.show-all .news-extra { display: grid; }

.news-more-wrap { text-align: center; margin-top: 20px; }
.show-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.show-more-btn:hover { background: var(--accent); color: #fff; }
.show-more-btn i { transition: transform 0.2s ease; }
.show-more-btn[aria-expanded="true"] i { transform: rotate(180deg); }

/* ============================ Education & Awards ============================ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

.edu-item { display: flex; gap: 14px; padding: 12px 0; }
.edu-item + .edu-item { border-top: 1px solid var(--border); }
.edu-logo {
  flex-shrink: 0; width: 46px; height: 46px;
  border-radius: 9px; background: #fff; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; padding: 6px;
}
.edu-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.edu-degree { font-weight: 700; font-size: 0.96rem; margin: 0; }
.edu-inst { font-size: 0.88rem; color: var(--text-soft); margin: 1px 0; }
.edu-when { font-size: 0.82rem; color: var(--text-muted); }

/* Awards reuse the timeline; a narrower date column since dates are just years */
.timeline-awards .tl-item { grid-template-columns: 44px 38px 1fr; }
.timeline-awards::before { left: 80px; }   /* 44 date + 18 gap + 19 (½ of 38) - 1 */

/* ============================ Contact / Footer ============================ */
.contact-grid { display: flex; flex-wrap: wrap; gap: 28px; }
.contact-item { display: flex; gap: 13px; align-items: center; }
.contact-item i { font-size: 1.5rem; color: var(--accent); }
.contact-item h4 { margin: 0 0 2px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.contact-item p { margin: 0; font-size: 0.95rem; }

footer {
  text-align: center;
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.back-to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 90;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

/* ============================ Responsive ============================ */

/* --- Tablet & below: collapse nav to a hamburger dropdown (7 links would
       otherwise overflow a horizontal bar on narrow tablets) --- */
@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 14px 16px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-125%);
    transition: transform 0.25s ease;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 12px; border-radius: 8px; }
  .nav-links li { width: 100%; }
  .nav-toggle { display: inline-flex; }
}

/* --- Stack the two-column layouts (hero, education/awards) --- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { position: static; max-width: 220px; margin: 0 auto; order: -1; }
  .two-col { grid-template-columns: 1fr; gap: 30px; }
}

/* --- Phones: single-column publications, wrapping experience cards --- */
@media (max-width: 680px) {
  .hero-name { font-size: 2.1rem; }
  .pub { grid-template-columns: 1fr; }
  .pub-thumb { max-width: 260px; }
  .exp-item { grid-template-columns: 1fr; gap: 8px; }
  .exp-date { flex-direction: row; gap: 6px; padding-top: 0; }
  section { padding: 42px 0; }
}

/* --- Small phones (~320–420px): tighten spacing and type --- */
@media (max-width: 420px) {
  :root { --nav-h: 56px; }
  .container, .nav-inner { padding-left: 16px; padding-right: 16px; }
  .nav-brand { font-size: 1.05rem; }
  .hero { padding-top: 34px; }
  .hero-name { font-size: 1.75rem; }
  .hero-affil { font-size: 0.95rem; }
  .section-head h2 { font-size: 1.35rem; }
  .banner { flex-direction: column; gap: 8px; }
  .exp-logo { width: 58px; height: 58px; }
  .tl-item { grid-template-columns: 46px 34px 1fr; gap: 12px; }
  .tl-marker { width: 34px; height: 34px; font-size: 0.9rem; }
  .timeline::before { left: 74px; }   /* 46 date + 12 gap + 17 (½ of 34) */
  .tl-date { font-size: 0.74rem; }
  .timeline-awards .tl-item { grid-template-columns: 40px 34px 1fr; }
  .timeline-awards::before { left: 68px; }   /* 40 + 12 gap + 17 (½ of 34) - 1 */
  .hero-social a { font-size: 1rem; }
  .back-to-top { right: 14px; bottom: 14px; }
}
