/* ══════════════════════════════════════════════════════
   Rizbi Islam — Personal Bio-Data
   A4 single-page, full-bleed, print-ready
   ══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

/* Base size bumped to 15.5px — fills A4 nicely */
html { font-size: 15.5px; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: #dde3ea;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ── Screen wrapper ── */
.screen-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.6rem 1rem 2.5rem;
  gap: .9rem;
}

/* ── Action bar (screen only, hidden on print) ── */
.action-bar {
  width: 100%;
  max-width: 794px;
  background: #fff;
  border-radius: .75rem;
  padding: .65rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.action-note { font-size: .75rem; color: #64748b; }
.action-note b { color: #1e293b; }
.action-btns { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }

.btn-dl {
  display: inline-flex; align-items: center; gap: .38rem;
  font-family: 'JetBrains Mono', monospace; font-size: .68rem; font-weight: 600;
  padding: .45rem 1rem; border-radius: .5rem;
  background: linear-gradient(135deg, #15803d, #0ea5e9);
  color: #fff; cursor: pointer; border: none; transition: all .15s; text-decoration: none;
}
.btn-dl:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(21,128,61,.3); }

.btn-print {
  display: inline-flex; align-items: center; gap: .38rem;
  font-family: 'JetBrains Mono', monospace; font-size: .68rem; font-weight: 600;
  padding: .45rem 1rem; border-radius: .5rem;
  background: transparent; border: 1.5px solid #15803d; color: #15803d;
  cursor: pointer; transition: all .15s;
}
.btn-print:hover { background: #f0fdf4; }

/* ══════════════════════════════════════════════════════
   A4 PAGE — 794px × 1123px screen = 210mm × 297mm print
   All content must live inside this box
   ══════════════════════════════════════════════════════ */
.a4-page {
  width: 794px;
  height: 1123px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 8px 48px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.bio-header {
  background: linear-gradient(135deg, #0f2540 0%, #0c3547 55%, #0f2540 100%);
  padding: 1.5rem 2.2rem;
  display: flex;
  gap: 1.75rem;
  align-items: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.bio-header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(21,128,61,.2), transparent 65%);
}
.bio-photo {
  width: 90px; height: 90px;
  object-fit: cover; object-position: top center;
  border-radius: 50%;
  border: 3px solid rgba(74,222,128,.55);
  box-shadow: 0 0 0 5px rgba(74,222,128,.1), 0 6px 20px rgba(0,0,0,.4);
  flex-shrink: 0; position: relative; z-index: 1; display: block;
}
.bio-photo-fallback {
  width: 90px; height: 90px; border-radius: 50%;
  background: rgba(74,222,128,.15); border: 3px solid rgba(74,222,128,.4);
  display: none; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; color: #4ade80;
  flex-shrink: 0; position: relative; z-index: 1;
}
.bio-header-text { flex: 1; z-index: 1; }
.bio-doc-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(74,222,128,.85); display: flex; align-items: center; gap: .4rem;
  margin-bottom: .35rem;
}
.bio-doc-label::before { content: ''; width: 20px; height: 1px; background: rgba(74,222,128,.5); }
.bio-name  { font-size: 1.75rem; font-weight: 800; color: #fff; letter-spacing: -.03em; margin-bottom: .18rem; }
.bio-title { font-size: .88rem; color: rgba(148,212,255,.85); font-weight: 400; margin-bottom: .7rem; }
.bio-pills { display: flex; flex-wrap: wrap; gap: .38rem; }
.hpill {
  font-family: 'JetBrains Mono', monospace; font-size: .6rem;
  color: rgba(255,255,255,.62); background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.11); padding: .2rem .6rem;
  border-radius: 999px; white-space: nowrap;
}
.hpill.green { color: rgba(74,222,128,.92); border-color: rgba(74,222,128,.28); background: rgba(74,222,128,.09); }

/* ── Body — flex column, fills remaining space ── */
.bio-body {
  flex: 1;
  padding: 1.2rem 2.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  /* no overflow:hidden here so content flows naturally */
}

/* ── Two columns ── */
.bio-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

/* ── Section label ── */
.bio-sec-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem; font-weight: 600; color: #15803d;
  letter-spacing: .16em; text-transform: uppercase;
  display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem;
}
.bio-sec-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, #bbf7d0, transparent);
}

/* ── Info table ── */
.info-table { width: 100%; border-collapse: collapse; border-radius: .6rem; overflow: hidden; border: 1px solid #e2e8f0; }
.info-table tr:nth-child(even) { background: #f8fafc; }
.info-table td { padding: .48rem .75rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; line-height: 1.5; }
.info-table tr:last-child td { border-bottom: none; }
.td-key {
  font-family: 'JetBrains Mono', monospace; font-size: .7rem; font-weight: 600;
  color: #15803d; white-space: nowrap; width: 8rem;
}
.td-val { font-size: .84rem; color: #334155; }

/* ── Education cards ── */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.edu-card {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .65rem;
  padding: .75rem .9rem; position: relative; overflow: hidden;
}
.edu-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2.5px;
  background: linear-gradient(90deg, #15803d, #0ea5e9);
}
.edu-level  { font-family: 'JetBrains Mono', monospace; font-size: .58rem; color: #64748b; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .28rem; }
.edu-degree { font-size: .82rem; font-weight: 700; color: #1e293b; margin-bottom: .15rem; line-height: 1.35; }
.edu-inst   { font-size: .75rem; color: #15803d; font-weight: 500; margin-bottom: .1rem; }
.edu-year   { font-size: .7rem; color: #94a3b8; }

/* ── Skills ── */
.skills-wrap { display: flex; flex-wrap: wrap; gap: .38rem; }
.sk-chip {
  font-family: 'JetBrains Mono', monospace; font-size: .67rem;
  color: #14532d; background: #f0fdf4; border: 1px solid #bbf7d0;
  padding: .22rem .62rem; border-radius: 999px;
}
.sk-chip.blue   { color: #0c4a6e; background: #eff6ff; border-color: #bfdbfe; }
.sk-chip.amber  { color: #713f12; background: #fffbeb; border-color: #fde68a; }
.sk-chip.purple { color: #3b0764; background: #faf5ff; border-color: #e9d5ff; }

/* ── Declaration ── */
.declaration {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .65rem;
  padding: .72rem 1rem; display: flex; align-items: flex-start; gap: .6rem;
}
.decl-icon { font-size: 1.05rem; flex-shrink: 0; margin-top: .08rem; }
.decl-text { font-size: .78rem; color: #475569; line-height: 1.65; font-style: italic; }

/* ── Signature row — pushed to bottom ── */
.sig-spacer { flex: 1; } /* this pushes signature down */

.sig-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: .65rem;
  border-top: 1px solid #e2e8f0;
  gap: 1rem;
  flex-shrink: 0;
}
.sig-block { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .22rem; }

/* Fixed signature image box — any image scales inside, never overflows */
.sig-img-box {
  width: 160px; height: 64px;
  display: flex; align-items: flex-end; justify-content: center;
}
.sig-img {
  max-width: 160px; max-height: 64px;
  width: auto; height: auto;
  object-fit: contain; object-position: bottom center;
  display: block;
}
.sig-placeholder { width: 160px; height: 1px; background: #cbd5e1; margin-top: auto; }

.sig-date-box { width: 130px; height: 64px; display: flex; align-items: flex-end; justify-content: center; }
.sig-date-line { width: 130px; height: 1px; background: #cbd5e1; }

.sig-name { font-size: .78rem; font-weight: 700; color: #1e293b; }
.sig-role { font-size: .66rem; color: #94a3b8; font-family: 'JetBrains Mono', monospace; }

/* ── Footer ── */
.bio-footer {
  background: #0f2540; padding: .62rem 2.2rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .4rem; flex-shrink: 0;
}
.bio-footer span { font-family: 'JetBrains Mono', monospace; font-size: .6rem; color: rgba(255,255,255,.38); }

/* ══════════════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════════════ */
@media print {
  @page { size: A4; margin: 0; }
  body   { background: #fff; }
  .screen-wrap { padding: 0; background: #fff; }
  .action-bar  { display: none !important; }
  .a4-page {
    width: 210mm; height: 297mm;
    border-radius: 0; box-shadow: none;
    page-break-after: avoid; page-break-inside: avoid;
  }
  .bio-header, .bio-footer, .edu-card::before,
  .sk-chip, .sk-chip.blue, .sk-chip.amber, .sk-chip.purple {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}

/* ── Mobile fallback ── */
@media (max-width: 840px) {
  html { font-size: 13px; }
  .a4-page { width: 100%; max-width: 794px; height: auto; }
  .bio-cols { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr 1fr; }
  .sig-spacer { display: none; }
}
@media (max-width: 520px) {
  .bio-header { flex-direction: column; align-items: flex-start; padding: 1.2rem; }
  .bio-body   { padding: .9rem 1.2rem; }
  .bio-footer { padding: .5rem 1.2rem; flex-direction: column; text-align: center; }
  .edu-grid   { grid-template-columns: 1fr; }
  .sig-row    { flex-direction: column; align-items: center; }
}
