/* ============================================================
   Monowar Hossain — devmonowar.github.io
   One stylesheet. No framework, no JavaScript, no external request.

   Type and spacing follow the reference design (my-resume-main),
   with three deliberate changes, all for long-form reading:
     - line-height 1.85 instead of 2.0
     - 26px under a heading instead of 50px
     - body text #55607a instead of #929Eb2 (contrast 7.1:1, not 2.6:1)
   ============================================================ */

/* ---------- Poppins, self-hosted. Latin only, ~21 KB total. ---------- */

@font-face {
  font-family: Poppins;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/poppins-400.woff2) format('woff2');
}
@font-face {
  font-family: Poppins;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/poppins-600.woff2) format('woff2');
}
@font-face {
  font-family: Poppins;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/poppins-700.woff2) format('woff2');
}

/* ---------- Tokens ---------- */

:root {
  --font: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --accent: #1857d6;
  --accent-hover: #1244ab;
  --accent-soft: #eaf0fd;
  --accent-line: #cbdcfb;

  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f1f5fb;
  --line: #e4e9f2;

  --heading: #2f333a;
  --body: #55607a;   /* 5.96:1 on the page background */
  --muted: #636d86;  /* 5.17:1 — was #78829a at 3.65:1, which failed the contrast check */

  /* the reference design's shadow pair, tinted blue instead of pink */
  --shadow: 0 3px 20px rgba(23, 42, 80, .07);
  --shadow-hover: 0 14px 28px rgba(24, 87, 214, .12);

  --radius: 16px;
  --radius-sm: 10px;

  --wrap: 1180px;   /* card pages */
  --list: 880px;    /* blog archive — a single column of cards, so it does not need 1180 */
  --read: 730px;    /* article body: 730 minus padding at 18px = ~73 chars/line (range is 60-75) */

  --gap: 28px;
  --card-pad: 40px;
  --section-top: 70px;
  --under-heading: 26px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #79a8ff;
    --accent-hover: #a2c2ff;
    --accent-soft: #17233c;
    --accent-line: #2b3f66;

    --bg: #121519;
    --surface: #1b1f25;
    --surface-2: #232830;
    --line: #2f353e;

    --heading: #eceef2;
    --body: #b3bccd;
    --muted: #8d97a8;

    --shadow: 0 3px 20px rgba(0, 0, 0, .38);
    --shadow-hover: 0 14px 28px rgba(0, 0, 0, .46);
  }
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap-narrow { max-width: var(--read); font-size: 18px; }  /* prose pages read at 18px */
.wrap-list { max-width: var(--list); }

main { display: block; padding: 56px 0 24px; }
main > .wrap > :first-child,
main > .wrap > article > :first-child { margin-top: 0; }

/* ---------- Type ---------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  color: var(--heading);
  font-weight: 700;
  line-height: 1.22;
  margin: 0 0 var(--under-heading);
  letter-spacing: -.018em;
}

h1 { font-size: clamp(2rem, 4.6vw, 2.75rem); }        /* 32 → 44 px */
h2 { font-size: clamp(1.6rem, 3vw, 2.125rem); margin-top: var(--section-top); }  /* → 34 px */
h3 { font-size: 1.25rem; margin-top: 46px; margin-bottom: 14px; }                /* 20 px */
h4 { font-size: 1.125rem; font-weight: 600; margin-top: 34px; margin-bottom: 12px; } /* 18 px */

p { margin: 0 0 20px; }

ul, ol { margin: 0 0 20px; padding-left: 22px; }
li { margin-bottom: 10px; }
li > ul, li > ol { margin-top: 10px; }
li::marker { color: var(--accent); }

a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover, a:focus-visible { color: var(--accent-hover); text-decoration: underline; }

strong { color: var(--heading); font-weight: 600; }
em { font-style: italic; }

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

.lead { font-size: 1.1rem; color: var(--muted); max-width: 66ch; }
.muted { color: var(--muted); }
.small { font-size: .92rem; }

.eyebrow {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

hr.rule {
  width: 56px;
  height: 4px;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
  margin: 0 0 28px;
}

/* Centred section heading — used on the card pages, not inside articles */
.center-head { text-align: center; margin-top: var(--section-top); }
.center-head h2 { margin-top: 0; margin-bottom: 14px; }
.center-head p { color: var(--muted); max-width: 62ch; margin: 0 auto 8px; }
.center-head + .cards,
.center-head + .tags,
.center-head + .posts { margin-top: 38px; }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .12em .42em;
  color: var(--heading);
  overflow-wrap: break-word;
}

pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  overflow-x: auto;
  margin: 0 0 24px;
  font-size: .92rem;
  line-height: 1.7;
}
pre code { background: none; border: 0; padding: 0; font-size: 1em; }

blockquote {
  margin: 0 0 24px;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent-line);
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: .97rem;
}
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--heading); background: var(--surface-2); }
.table-scroll { overflow-x: auto; margin-bottom: 24px; }
.table-scroll table { margin-bottom: 0; }

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: .7em 1.2em;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 20;
  font-weight: 600;
}
.skip:focus { left: 0; text-decoration: none; color: #fff; }

/* ---------- Header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--heading);
  margin-right: auto;
  letter-spacing: -.02em;
}
.brand:hover, .brand:focus-visible { color: var(--accent); text-decoration: none; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: 0;
  flex: none;
}
@media (prefers-color-scheme: dark) { .brand-mark { color: #10141c; } }

.site-nav { display: flex; flex-wrap: wrap; gap: 4px 26px; }
.site-nav a { color: var(--muted); font-size: .97rem; padding: 3px 0; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--accent); text-decoration: none; }
.site-nav a[aria-current="page"] {
  color: var(--heading);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  background: var(--surface);
  border-radius: 22px;
  padding: 62px 52px 58px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.hero h1 { margin-bottom: 14px; }
.hero .lead { margin-bottom: 32px; }

.role {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 22px;
}

@media (max-width: 640px) {
  .hero { padding: 38px 26px 34px; border-radius: 18px; }
}

/* ---------- Buttons ---------- */

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

.btn {
  display: inline-block;
  padding: .78em 1.65em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: .97rem;
  line-height: 1.5;
  box-shadow: 0 3px 12px rgba(24, 87, 214, .16);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.btn:hover, .btn:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(24, 87, 214, .24);
}

.btn-outline { background: transparent; color: var(--accent); box-shadow: none; }
.btn-outline:hover, .btn-outline:focus-visible { background: var(--accent); color: #fff; }

@media (prefers-color-scheme: dark) {
  .btn, .btn:hover, .btn:focus-visible { color: #0f141c; }
  .btn-outline { color: var(--accent); }
  .btn-outline:hover, .btn-outline:focus-visible { color: #0f141c; }
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--card-pad);
  box-shadow: var(--shadow);
  margin: 0;
  transition: box-shadow .3s ease, transform .3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card h3 { margin-top: 0; margin-bottom: 12px; }
.card > :last-child { margin-bottom: 0; }
.card p { color: var(--body); }

.card-links { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: .94rem; font-weight: 500; }

/* icon tile on a card */
.ico {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 24px;
}
.ico svg { width: 26px; height: 26px; display: block; }

/* ---------- Tag pills ---------- */

.tags { display: flex; flex-wrap: wrap; gap: 12px; padding: 0; margin: 34px 0 0; list-style: none; }
.tags li {
  background: var(--surface);
  border-radius: 999px;
  padding: .42em 1.25em;
  font-size: .94rem;
  color: var(--body);
  margin: 0;
  box-shadow: var(--shadow);
}

.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: .25em .85em;
  vertical-align: middle;
  margin-left: 10px;
  white-space: nowrap;
  line-height: 1.6;
}

/* ---------- Panels ---------- */

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 46px var(--card-pad) 48px;
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
  transition: box-shadow .3s ease;
}
.panel:hover { box-shadow: var(--shadow-hover); }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel h2 { margin-top: 0; }
.panel h3 { margin-top: 38px; }

.note {
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 0 0 26px;
}
.note > :first-child { margin-top: 0; }
.note > :last-child { margin-bottom: 0; }

/* ---------- Link list ---------- */

.linklist { list-style: none; padding: 0; margin: 30px 0 0; }
.linklist li {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.linklist li:last-child { border-bottom: 0; }
.linklist .label { min-width: 168px; font-weight: 600; color: var(--heading); }

/* ---------- Breadcrumb ---------- */

.crumbs { font-size: .92rem; color: var(--muted); margin: 0 0 26px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 9px; padding: 0; margin: 0; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 9px; color: var(--line); }

/* ============================================================
   Article — tuned for reading, not for cards
   ============================================================ */

.article-head { margin-bottom: 34px; }
.article-head h1 { margin-bottom: 16px; }

.meta { font-size: .93rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }

/* Article body. The container (730px) already gives ~73 characters per line,
   so nothing here needs an extra max-width. */
.article { font-size: 18px; }
.article h2 { font-size: 1.65rem; margin-top: 58px; margin-bottom: 20px; scroll-margin-top: 90px; }
.article h3 { font-size: 1.2rem; margin-top: 40px; margin-bottom: 12px; scroll-margin-top: 90px; }
.article p  { margin-bottom: 22px; }
.article li { margin-bottom: 12px; }
.article ul, .article ol { margin-bottom: 24px; }
.article > :last-child { margin-bottom: 0; }

.toc {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px 32px;
  margin: 0 0 40px;
  box-shadow: var(--shadow);
}
.toc h2 {
  margin: 0 0 14px;
  font-size: .78rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 7px; }

.faq dt { font-weight: 600; color: var(--heading); margin-top: 28px; font-size: 1.03rem; }
.faq dd { margin: 8px 0 0; color: var(--body); }

.author-box {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 32px 36px;
  margin-top: 58px;
  box-shadow: var(--shadow);
}
.author-box p { margin-bottom: 14px; }
.author-box > :last-child { margin-bottom: 0; }

/* ---------- Figures ---------- */

figure { margin: 0 0 32px; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  background: var(--surface-2);
}
figcaption {
  font-size: .91rem;
  color: var(--muted);
  margin-top: 14px;
  line-height: 1.7;
}

/* ---------- About photo ---------- */

.profile { display: flex; flex-wrap: wrap; align-items: center; gap: 30px; margin-bottom: 34px; }
.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
  flex: none;
}
.profile .lead { margin-bottom: 0; flex: 1 1 320px; }

/* ---------- Post list ---------- */

.posts { list-style: none; padding: 0; margin: 38px 0 0; }
.posts > li {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 34px 38px;
  margin-bottom: var(--gap);
  box-shadow: var(--shadow);
  transition: box-shadow .3s ease, transform .3s ease;
}
.posts > li:last-child { margin-bottom: 0; }
.posts > li:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.posts h2 { margin: 0 0 10px; font-size: 1.32rem; line-height: 1.35; }
.posts h2 a { color: var(--heading); }
.posts h2 a:hover { color: var(--accent); text-decoration: none; }
.posts .meta { margin-bottom: 12px; }
/* the card is 880px wide but its excerpt is prose, so cap the line length */
.posts p { margin-bottom: 0; max-width: 72ch; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 72px;
  padding: 22px 0 24px;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-left: auto; }
.site-footer a { color: var(--muted); }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--accent); }

/* ---------- 404 ---------- */

.center { text-align: center; padding: 60px 0 30px; }
.center .rule { margin-left: auto; margin-right: auto; }
.center .lead { margin-left: auto; margin-right: auto; }
.center .actions { justify-content: center; }
