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

::selection {
  background: #0f0f0f;
  color: #fafafa;
}

:root {
  --ink: #0f0f0f;
  --paper: #FCFCFC;
  --dim: #706e68;
  --dim2: #55534e;
  --rule: #d8d6cf;
  --section-nav-w: 140px;
  --main-max: 680px;
}

html {
  font-size: 19px;
}

body {
  font-family: 'EB Garamond', 'Noto Serif Bengali', Georgia, serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-top: 88px;
  /* compensate for fixed topbar */
}

/* ── OUTER WRAPPER ── */
.outer {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── TOP BAR ── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Mirror the .outer max-width (900px) + 40px side padding */
  padding: 14px max(40px, calc((100vw - 900px) / 2 + 40px));
  opacity: 0;
  animation: appear 0.4s ease 0.05s forwards;
}

.brand {
  text-decoration: none;
  color: inherit;
  line-height: 1.25;
}

.brand-mark {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 300;
  font-size: 0.72em;
  letter-spacing: 0.16em;
  color: var(--ink);
  display: block;
}

.brand-sub {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 0.82em;
  color: var(--dim);
  display: block;
}

.topnav {
  display: flex;
  gap: 2em;
  align-items: center;
}

.topnav a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68em;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s;
}

.topnav a:hover,
.topnav a.active {
  color: var(--ink);
}

/* ── PAGE HEADER ── */
.page-header {
  padding: 64px 0 32px;
  opacity: 0;
  animation: slideup 0.55s ease 0.15s forwards;
}

.page-header h1 {
  font-size: clamp(2.6em, 6vw, 4.2em);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.page-header h1 em {
  font-style: italic;
}

.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7em;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: background 0.18s, color 0.18s;
}

.cv-btn:hover {
  background: var(--paper);
  color: var(--ink);
}

/* ── BODY LAYOUT: fixed section-nav + main content ── */
.body-layout {
  display: flex;
  gap: 0;
  align-items: flex-start;
  margin-top: 40px;
  opacity: 0;
  animation: appear 0.5s ease 0.28s forwards;
}

/* ── FIXED SECTION NAV ── */
.section-nav {
  width: var(--section-nav-w);
  flex-shrink: 0;
  position: sticky;
  top: 65px;
  /* stays in normal flow, sticks while scrolling */
}

.section-nav a {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66em;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  transition: color 0.15s, padding-left 0.15s;
}

.section-nav a:first-child {
  border-top: 1px solid var(--rule);
}

.section-nav a:hover {
  color: var(--ink);
  padding-left: 4px;
}

.section-nav a.is-active {
  color: var(--ink);
  font-weight: 400;
}

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  min-width: 0;
  padding-left: 48px;
  border-left: 1px solid var(--rule);
}

/* ── SECTION ── */
.port-section {
  margin-bottom: 64px;
  scroll-margin-top: 96px;
}

.section-title {
  font-family: 'EB Garamond', serif;
  font-weight: 500;
  font-size: 1.6em;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.section-title em {
  font-style: italic;
  font-weight: 400;
}

/* ── TIMELINE ── */
.timeline {
  display: grid;
  gap: 0;
}

.tl-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}


.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
}

.tl-title {
  font-family: 'EB Garamond', serif;
  font-weight: 500;
  font-size: 1.08em;
}

.tl-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65em;
  font-weight: 300;
  color: var(--dim);
  white-space: nowrap;
}

.tl-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68em;
  font-weight: 300;
  color: var(--dim);
  margin-bottom: 10px;
}

.tl-body {
  font-size: 0.93em;
  line-height: 1.72;
  color: #3a3a3a;
}

.tl-body ul {
  list-style: none;
  padding: 0;
}

.tl-body ul li {
  padding: 2px 0 2px 16px;
  position: relative;
}

.tl-body ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--dim);
}

.tl-links {
  margin-top: 10px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.tl-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68em;
  font-weight: 300;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tl-links a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ── SKILLS ── */
.skills-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68em;
  font-weight: 300;
  color: var(--dim);
  margin-bottom: 22px;
}

.skills-grid {
  display: grid;
  gap: 13px;
}

.skill-row {
  display: grid;
  grid-template-columns: 130px 1fr 36px;
  align-items: center;
  gap: 14px;
}

.skill-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72em;
  font-weight: 300;
  color: var(--ink);
}

.skill-track {
  height: 4px;
  background: var(--rule);
  position: relative;
}

.skill-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--ink);
  width: 0;
  transition: width 0.7s cubic-bezier(.25, .46, .45, .94);
}

.skill-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65em;
  font-weight: 300;
  color: var(--dim);
  text-align: right;
}

/* ── RESEARCH ── */
.research-desc {
  font-size: 0.97em;
  line-height: 1.8;
  color: #3a3a3a;
  margin-bottom: 28px;
}

.research-card {
  border-left: 2px solid var(--ink);
  padding: 16px 20px;
  background: transparent;
  transition: background 0.18s;
}

.research-card:hover {
  background: #f2f1f1;
}

.research-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.research-name {
  font-family: 'EB Garamond', serif;
  font-weight: 500;
  font-size: 1.06em;
}

.status-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6em;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 2px 9px;
  color: var(--ink);
}

.research-card p {
  font-size: 0.92em;
  line-height: 1.7;
  color: #3a3a3a;
}

/* ── PUBLICATIONS ── */
.pub-list {
  display: grid;
  gap: 0;
}

.pub-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}


.pub-title {
  font-family: 'EB Garamond', serif;
  font-weight: 500;
  font-size: 1.06em;
  line-height: 1.4;
  margin-bottom: 5px;
}

.pub-authors {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68em;
  font-weight: 300;
  color: var(--dim);
  margin-bottom: 12px;
}

.pub-link {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66em;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  padding: 4px 13px;
  transition: background 0.15s, color 0.15s;
}

.pub-link:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ── PROJECTS ── */
.project-list {
  display: grid;
  gap: 0;
}

.project-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}


.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.project-name {
  font-family: 'EB Garamond', serif;
  font-weight: 500;
  font-size: 1.1em;
}

.project-tech {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65em;
  font-weight: 300;
  color: var(--dim);
  margin-bottom: 10px;
}

.project-body {
  font-size: 0.93em;
  line-height: 1.75;
  color: #3a3a3a;
  margin-bottom: 12px;
}

.project-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.project-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68em;
  font-weight: 300;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.project-links a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ── CERTIFICATES ── */
.certificate-list {
  display: grid;
  gap: 0;
}

.certificate-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.certificate-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.certificate-name {
  font-family: 'EB Garamond', serif;
  font-weight: 500;
  font-size: 1.1em;
}

.certificate-issuer {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65em;
  font-weight: 300;
  color: var(--dim);
  margin-bottom: 10px;
}

.certificate-body {
  font-size: 0.93em;
  line-height: 1.75;
  color: #3a3a3a;
  margin-bottom: 12px;
}

.certificate-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.certificate-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68em;
  font-weight: 300;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.certificate-links a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--rule);
  margin-top: 60px;
  padding: 24px 0 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  opacity: 0;
  animation: appear 0.5s ease 0.5s forwards;
}

.footer-sig {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65em;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.footer-icons {
  display: flex;
  gap: 0.9em;
  flex-wrap: wrap;
}

.footer-icon {
  font-size: 0.88em;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-icon:hover {
  color: var(--ink);
}

@keyframes appear {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideup {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── RESPONSIVE ── */

/* Tablet: collapse section nav to horizontal strip */
@media (max-width: 860px) {
  .outer {
    padding: 0 28px;
  }
}

@media (max-width: 720px) {
  .body-layout {
    flex-direction: column;
    gap: 0;
  }

  /* Section nav becomes horizontal scrollable strip */
  .section-nav {
    position: static;
    width: 100%;
    z-index: 100;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    border-top: 1px solid var(--rule);
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 22px;
    gap: 0;
    margin-bottom: 16px;
  }

  .section-nav::-webkit-scrollbar {
    display: none;
  }

  .section-nav a {
    flex-shrink: 0;
    border-bottom: none;
    border-top: none;
    border-right: 1px solid var(--rule);
    padding: 12px 14px;
    font-size: 0.6em;
  }

  .section-nav a:first-child {
    border-top: none;
  }

  .section-nav a:last-child {
    border-right: none;
  }

  .section-nav a:hover {
    padding-left: 14px;
  }

  .main-content {
    padding-left: 0;
    border-left: none;
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  body {
    padding-top: 72px;
  }

  .outer {
    padding: 0 22px;
  }

  .topbar {
    padding: 12px 22px;
  }

  .brand-sub {
    white-space: normal;
  }

  .brand-sub-break {
    display: block;
    height: 0;
  }

  .topnav {
    gap: 0.7em;
    flex-wrap: nowrap;
  }

  .page-header {
    padding: 44px 0 24px;
  }

  .page-header h1 {
    font-size: 2.4em;
  }

  .tl-header {
    flex-direction: column;
    gap: 2px;
  }

  .skill-row {
    grid-template-columns: 100px 1fr 30px;
    gap: 10px;
  }

  .skill-label {
    font-size: 0.65em;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

@media (max-width: 440px) {
  .topnav {
    gap: 0.6em;
  }

  .topnav a {
    font-size: 0.62em;
  }
}