/* ============================================================
   Hasebul Hassan Chowdhury — Portfolio

   Journal-style pairing: Source Serif 4 for prose, Inter for
   headings, navigation and metadata.

   Layout: a 1200px container; content sits in an auto-fitting
   card grid. Panels carry real internal structure — header,
   body, footer, divided by hairlines. No gradients, shadows,
   or animation.
   ============================================================ */

:root {
  --navy: #004081;
  --navy-dark: #002d5c;

  --ink: #1A1A1A;
  --graphite: #5A5A5A;
  --paper: #FFFFFF;
  --panel-head: #FAFBFC;

  --line: #D8DEE4;
  --line-soft: #E8ECEF;

  /* prose */
  --font-body: 'Source Serif 4', Charter, 'Bitstream Charter', Cambria, Georgia, serif;
  /* headings, nav, metadata */
  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1200px;
  /* narrowest a card may get before the grid drops a column */
  --card-min: 430px;
}

@supports (font-variation-settings: normal) {
  :root {
    --font-display: 'InterVariable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 14px;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color 120ms ease;
}

a:hover {
  color: var(--navy-dark);
}

b,
strong {
  font-weight: 600;
}

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

ul {
  margin: 0;
  padding-left: 20px;
}

/* ============================================================ LAYOUT */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 44px 0;
  border-top: 1px solid var(--line-soft);
}

.section:first-of-type {
  border-top: 0;
}

.section-navy {
  border-top: 1px solid var(--line-soft);
}

/* prose must not run the full 1200px — cap it at a readable measure */
.hero .role,
.research-item p {
  max-width: 68ch;
}

/* ============================================================ TYPE SCALE */
.mono {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.display-xl {
  font-family: var(--font-display);
  font-size: 2.125rem;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.022em;
}

.display-l {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

/* ============================================================ NAV */
.nav {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 24px;
}

.brand {
  font-family: var(--font-display);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.name-short {
  white-space: nowrap;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  color: var(--graphite);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--navy);
}

.nav-link.is-active {
  color: var(--ink);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px;
  color: var(--ink);
  cursor: pointer;
}

/* ============================================================ HERO */
.hero {
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 56px;
  align-items: start;
  padding: 48px 0;
}

.hero h1 {
  margin: 0;
}

.hero .role {
  margin-top: 12px;
  color: var(--graphite);
}

.hero .meta {
  font-family: var(--font-display);
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.9375rem;
  color: var(--graphite);
}

.hero-cta {
  font-family: var(--font-display);
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.9375rem;
}

.hero-photo img {
  width: 156px;
  height: 156px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--line);
}

/* ============================================================ BUTTONS (plain links) */
.btn,
.btn-primary {
  display: inline;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  /* must follow the `font` shorthand, which would otherwise reset the family */
  font-family: var(--font-display);
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn:hover {
  color: var(--navy-dark);
}

.nav-link.btn-primary {
  color: var(--graphite);
  text-decoration: none;
}

.nav-link.btn-primary:hover {
  color: var(--navy);
}

/* ============================================================ FACTS STRIP */
.stat-strip {
  border-bottom: 1px solid var(--line);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 32px;
  padding: 20px 0;
}

.stat {
  font-family: var(--font-display);
  font-size: 0.9375rem;
}

.num {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lbl {
  font-family: var(--font-display);
  color: var(--graphite);
}

/* ============================================================ CARD GRID
   auto-fit means the column count follows the container, so there
   are no per-page breakpoints to keep in sync. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-min), 1fr));
  gap: 20px;
  align-items: stretch;
}

/* a panel that should never share a row */
.card-grid .span-all {
  grid-column: 1 / -1;
}

/* ============================================================ PANEL
   header / body / footer, divided by hairlines. Bordered, not
   decorated: no shadow, no gradient, no hover lift. */
.panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.panel-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-head);
}

.panel-head h3 {
  font-size: 1.0625rem;
  line-height: 1.4;
}

.panel-kicker {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--graphite);
  margin: 0 0 6px;
}

.panel-meta {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--graphite);
  margin: 5px 0 0;
  font-variant-numeric: tabular-nums;
}

/* body grows so footers line up across a row */
.panel-main {
  padding: 16px 20px;
  flex: 1 1 auto;
}

.panel-body {
  color: var(--graphite);
  margin: 0;
  /* a span-all card is ~1150px wide; cap the measure for readability */
  max-width: 88ch;
}

.panel-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--line-soft);
}

.panel-links {
  font-family: var(--font-display);
  font-size: 0.875rem;
  margin: 0;
}

.panel-note {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--graphite);
  margin: 0;
}

/* ---- lists and chips inside panels ---- */
.impact {
  list-style: disc;
  margin: 0;
  padding-left: 20px;
}

.impact li {
  margin-bottom: 9px;
}

.impact li:last-child {
  margin-bottom: 0;
}

.chips {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--graphite);
  margin: 0;
}

/* chips sitting under body copy inside a card need breathing room */
.panel-main .chips {
  margin-top: 12px;
}

.chip {
  white-space: nowrap;
}

.chip:not(:last-child)::after {
  content: ' · ';
  color: var(--line);
}

/* ============================================================ HOME: TWO NAMED COLUMNS */
.duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-min), 1fr));
  gap: 20px 32px;
  align-items: start;
}

.duo-col {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

.duo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}

.duo-head h2 {
  font-size: 1.25rem;
}

.duo-head a {
  font-family: var(--font-display);
  font-size: 0.875rem;
  white-space: nowrap;
}

/* ============================================================ PUBLICATIONS */
.pub-authors {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--graphite);
  margin: 8px 0 0;
}

.pub-links {
  font-family: var(--font-display);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 18px;
  font-size: 0.875rem;
}

.pub-link {
  word-break: break-word;
}

/* standalone ORCID line above the publications grid */
.page-orcid {
  margin-bottom: 20px;
}

.pub-pages {
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
}

.status {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--ink);
}

/* ============================================================ ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 64ch) minmax(240px, 1fr);
  gap: 48px;
  align-items: start;
}

.focus-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px 20px;
}

.focus-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.focus-list {
  list-style: disc;
  color: var(--graphite);
  font-size: 0.9375rem;
}

.focus-list li {
  margin-bottom: 6px;
}

/* ============================================================ SKILLS / RESEARCH */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px 20px;
}

.skill-card {
  text-decoration: none;
  color: inherit;
}

.skill-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

a.skill-card h3 {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.skill-card p {
  color: var(--graphite);
  font-size: 0.9375rem;
  margin: 0;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px 32px;
}

.research-item p {
  color: var(--graphite);
  margin: 0;
}

/* ============================================================ PROJECTS */
.repo {
  font-family: var(--font-display);
  font-size: 0.875rem;
}

.project-links {
  font-family: var(--font-display);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.875rem;
}

/* ============================================================ CONTACT */
.contact-actions {
  font-family: var(--font-display);
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.lang-row {
  font-family: var(--font-display);
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  font-size: 0.9375rem;
}

.lang b {
  font-weight: 600;
}

.lang span {
  color: var(--graphite);
}

.lang b::after {
  content: ': ';
  color: var(--graphite);
  font-weight: 400;
}

/* ============================================================ FOOTER */
.footer {
  font-family: var(--font-display);
  border-top: 1px solid var(--line);
  padding: 24px 0 32px;
  font-size: 0.9375rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.footer-links a,
.footer .brand {
  color: var(--graphite);
}

.copy {
  margin-top: 14px;
  color: var(--graphite);
}

/* ============================================================ RESPONSIVE */
@media (max-width: 900px) {
  /* Collapse to one column explicitly rather than by setting --card-min
     to 100%: minmax(0, 1fr) can never contribute a min-content floor
     wider than the track, so it degrades safely at any width. Verified
     no horizontal overflow at 320 / 360 / 430 / 500 / 780px. */
  .card-grid,
  .duo {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-grid .span-all {
    grid-column: auto;
  }

  .nav-inner {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0 4px;
  }

  .nav-links.open {
    display: flex;
  }

  .hero-inner,
  .about-grid,
  .research-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-inner {
    padding: 32px 0;
  }

  .display-xl {
    font-size: 1.75rem;
  }
}
