/* ============================================================
   Md Mushfiqur Azam — personal site
   Three-column "About" hero (bio / recent updates / photo+links)
   over a soft lavender-navy palette, card panels, pill nav.
   Light & dark (system preference, overridable via nav toggle).
   ============================================================ */

:root {
  --bg-a:     #f1f2f8;
  --bg-b:     #e6e8f2;
  --paper:    #eceef6;
  --card:     #ffffff;
  --card-border: rgba(30, 41, 78, 0.08);
  --ink:      #1e2a4a;
  --body:     #3c4560;
  --muted:    #767f9c;
  --faint:    #9aa1ba;
  --rule:     #e2e4ef;
  --accent:   #2c3d6b;
  --tint:     #e7ecfb;
  --ok-ink:   #1c7a4d;
  --ok-bg:    #e4f3ea;
  --pending-ink: #8a5a10;
  --pending-bg:  #faf1de;
  --live:     #25a065;
  --shadow:   0 16px 34px -18px rgba(30, 41, 78, 0.28);
}

:root[data-theme="dark"] {
  --bg-a:     #0f121c;
  --bg-b:     #151a29;
  --paper:    #12151f;
  --card:     #1a1f2e;
  --card-border: rgba(255, 255, 255, 0.08);
  --ink:      #edeff9;
  --body:     #c7cbe0;
  --muted:    #9096b3;
  --faint:    #6b7192;
  --rule:     #2a3044;
  --accent:   #aeb9ff;
  --tint:     #202741;
  --ok-ink:   #6cd49a;
  --ok-bg:    #163a2a;
  --pending-ink: #e0b25f;
  --pending-bg:  #3a2f16;
  --live:     #46c486;
  --shadow:   0 16px 34px -18px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-a:     #0f121c;
    --bg-b:     #151a29;
    --paper:    #12151f;
    --card:     #1a1f2e;
    --card-border: rgba(255, 255, 255, 0.08);
    --ink:      #edeff9;
    --body:     #c7cbe0;
    --muted:    #9096b3;
    --faint:    #6b7192;
    --rule:     #2a3044;
    --accent:   #aeb9ff;
    --tint:     #202741;
    --ok-ink:   #6cd49a;
    --ok-bg:    #163a2a;
    --pending-ink: #e0b25f;
    --pending-bg:  #3a2f16;
    --live:     #46c486;
    --shadow:   0 16px 34px -18px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  margin: 0;
  background: radial-gradient(120% 100% at 15% 0%, var(--bg-a), var(--bg-b));
  background-attachment: fixed;
  color: var(--body);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  transition: border-color .15s ease, color .15s ease, opacity .15s ease;
}
a:hover { color: var(--accent); border-color: currentColor; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.sep { color: var(--faint); padding: 0 .35em; }

/* ---------------- Top decorative bar ---------------- */
.topbar { height: 6px; background: var(--ink); }

/* ---------------- Top nav ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--card-border);
}
.nav__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: .85rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  border: 0;
  flex: 0 0 auto;
}
.nav__brand:hover { color: var(--ink); opacity: .8; }
.nav__avatar { width: 34px; height: 34px; border-radius: 50%; display: block; object-fit: cover; }

.nav__links {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.nav__links a {
  color: var(--muted);
  border: 0;
  padding: .5rem .9rem;
  border-radius: 999px;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active {
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

.theme-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: .55rem 1.05rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.theme-toggle:hover { color: var(--accent); }
.theme-toggle__icon { font-size: 1rem; }

/* ---------------- Page ---------------- */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.5rem 1.75rem 5rem;
}

/* ---------------- Hero: 3-column grid ---------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 3rem;
  align-items: start;
  margin-bottom: 4.5rem;
}

.hero-col--bio { padding-top: .35rem; }
.hero__name {
  font-family: "Fraunces", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 3.1rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .85rem;
}
.hero__role { margin: 0 0 1rem; color: var(--body); font-size: 1.02rem; }
.hero__role a { color: var(--body); }

.availability {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 1.5rem;
  padding: .35rem .8rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--tint);
  border-radius: 999px;
}
.availability .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent);
}

.hero__bio { margin: 0 0 1.15rem; font-size: 1.02rem; }
.hero__bio strong { font-weight: 600; color: var(--ink); }

/* ---------------- Panel label (section header row) ---------------- */
.panel-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-label i { flex: 1 1 auto; height: 1px; background: var(--rule); font-style: normal; }

/* ---------------- Panel card ---------------- */
.panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------------- Updates list ---------------- */
.updates {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--faint) transparent;
}
.updates::-webkit-scrollbar { width: 6px; }
.updates::-webkit-scrollbar-track { background: transparent; }
.updates::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 999px; }

.hero-col--updates .panel { position: relative; }
.hero-col--updates .panel::after {
  content: "";
  position: absolute;
  left: 1px; right: 1px; bottom: 1px;
  height: 30px;
  background: linear-gradient(to bottom, transparent, var(--card));
  border-radius: 0 0 15px 15px;
  pointer-events: none;
}
.updates__row {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  font-size: .92rem;
}
.updates__row:last-child { border-bottom: 0; }
.updates__date {
  flex: 0 0 4.4rem;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: .15rem;
}
.updates__body { flex: 1 1 auto; color: var(--body); }
.updates__body strong { color: var(--ink); font-weight: 600; }
.updates__body em { font-style: italic; color: var(--ink); }

/* ---------------- Photo + contact column ---------------- */
.hero-col--contact { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.hero__photo {
  width: 190px; height: 190px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid var(--card);
  box-shadow: var(--shadow);
}
.contact-card { width: 100%; display: flex; flex-direction: column; }
.contact-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  color: var(--body);
  font-size: .92rem;
  font-weight: 500;
  border-bottom-width: 1px;
}
.contact-row:last-child { border-bottom: 0; }
.contact-row:hover { color: var(--accent); background: var(--tint); }
.contact-row--cv { font-weight: 700; color: var(--ink); }
.contact-row__icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--faint);
}
.contact-row__icon svg { display: block; width: 100%; height: 100%; }
.contact-row:hover .contact-row__icon { color: var(--accent); }
.contact-row--cv .contact-row__icon { color: var(--ink); }

/* ---------------- Section (Publications, Service, Experience, Education, Contact) --- */
.section { margin: 0 0 3.5rem; scroll-margin-top: 5.5rem; }
.section__note { font-size: .85rem; color: var(--muted); margin: -.5rem 0 1rem; }

/* ---------------- Tags ---------------- */
.tag {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; border-radius: 999px; padding: .12rem .55rem;
  vertical-align: 1px; white-space: nowrap;
  color: var(--ok-ink); background: var(--ok-bg);
}
.tag--pending { color: var(--pending-ink); background: var(--pending-bg); }

/* ---------------- Publications ---------------- */
.pubs { list-style: none; counter-reset: pub; margin: 0; padding: 0; }
.pub {
  position: relative; counter-increment: pub;
  padding: 1.1rem 1.25rem 1.1rem 3rem;
  border-bottom: 1px solid var(--rule);
}
.pub:last-child { border-bottom: 0; }
.pub::before {
  content: "[" counter(pub) "]"; position: absolute; left: 1.1rem; top: 1.15rem;
  font-size: .8rem; color: var(--faint); font-variant-numeric: tabular-nums;
}
.pub__title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 1.08rem; line-height: 1.35; margin: 0 0 .25rem; color: var(--ink);
}
.pub__authors { margin: 0 0 .1rem; font-size: .92rem; }
.pub__authors strong { font-weight: 600; color: var(--ink); }
.pub__venue { margin: 0; font-size: .88rem; color: var(--muted); font-style: italic; }
.pub__links { margin: .4rem 0 0; font-size: .86rem; }
.pub__links a { font-weight: 600; }

/* ---------------- Rows (service, experience, education, contact) ---------------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--rule);
}
.row:last-child { border-bottom: 0; }
.row__main { display: flex; flex-direction: column; }
.row__role { font-weight: 600; color: var(--ink); }
.row__org { color: var(--muted); font-size: .9rem; }
.row__date {
  flex: 0 0 auto; color: var(--faint); font-size: .84rem;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rows--plain .row__role { flex: 0 0 6rem; font-weight: 600; color: var(--muted); }

/* ---------------- Footer ---------------- */
.foot {
  margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--rule);
  color: var(--muted); font-size: .86rem; text-align: center;
}
.foot p { margin: 0; }

/* ---------------- Responsive ---------------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-col--contact { order: -1; flex-direction: row; align-items: center; text-align: left; }
  .hero-col--bio { order: 0; }
  .hero-col--updates { order: 1; }
  .hero__photo { width: 110px; height: 110px; flex: 0 0 auto; }
  .contact-card { flex: 1 1 auto; }
}

@media (max-width: 640px) {
  .nav__inner { flex-wrap: wrap; padding: .75rem 1rem; gap: .75rem; }
  .nav__brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav__brand { font-size: .92rem; min-width: 0; flex: 1 1 auto; }
  .nav__avatar { width: 28px; height: 28px; }
  .theme-toggle { flex: 0 0 auto; padding: .45rem .8rem; font-size: .7rem; }

  .nav__links {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .3rem;
    padding: .3rem;
    background: var(--tint);
    border: 1px solid var(--card-border);
    border-radius: 14px;
  }
  .nav__links a {
    text-align: center;
    padding: .5rem .3rem;
    border-radius: 10px;
  }

  .hero { gap: 3rem; }
  .hero-col--contact { flex-direction: column; }

  .hero__name { font-size: 2.3rem; }
  .row { flex-direction: column; gap: .1rem; }
  .rows--plain .row__role { flex-basis: auto; }
  .updates__row { flex-direction: column; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  html { scroll-behavior: auto; }
}
