:root {
  --ink: #10233b;
  --navy: #102d4f;
  --blue: #1f5f91;
  --gold: #d8a72f;
  --bg: #e9eef4;
  --line: rgba(16,45,79,.16);
  --shadow: 0 22px 55px rgba(12,31,53,.16);
  --zoom: 1;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(31,95,145,.12), transparent 26rem),
    linear-gradient(180deg, #f7f9fc 0, var(--bg) 42rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-user-select: none;
  user-select: none;
}
button, input { font: inherit; }
button {
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
  border-radius: 10px;
  min-height: 38px;
  padding: 0 13px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16,45,79,.12); }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(31,95,145,.28); outline-offset: 2px; }
.site-header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 3.25rem) max(1.25rem, calc((100vw - 1180px)/2));
  color: white;
  background:
    linear-gradient(115deg, rgba(16,45,79,.98), rgba(22,77,119,.95)),
    radial-gradient(circle at 80% 30%, rgba(216,167,47,.32), transparent 22rem);
  border-bottom: 5px solid var(--gold);
}
.brand { display: flex; gap: 1.1rem; align-items: flex-start; max-width: 850px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 16px;
  background: rgba(255,255,255,.12);
  font-weight: 900;
  letter-spacing: .06em;
}
.eyebrow, .section-label { margin: 0 0 .45rem; text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; font-weight: 800; }
.brand h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.65rem, 3vw, 2.85rem); line-height: 1.08; }
.subtitle { margin: .65rem 0 0; max-width: 820px; color: rgba(255,255,255,.78); line-height: 1.5; }
.author-card {
  min-width: 190px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 16px;
  background: rgba(255,255,255,.09);
  backdrop-filter: blur(10px);
}
.author-card span, .author-card small { display: block; color: rgba(255,255,255,.7); }
.author-card strong { display: block; margin: .2rem 0; font-size: 1.05rem; }
.intro {
  width: min(1180px, calc(100% - 2rem));
  margin: 2rem auto 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 22px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 16px 40px rgba(16,45,79,.08);
  backdrop-filter: blur(12px);
}
.section-label { color: var(--blue); }
.intro h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem, 2.4vw, 2rem); }
.intro p:not(.section-label) { max-width: 780px; margin: .7rem 0 0; line-height: 1.7; color: #44566c; }
.project-facts { display: grid; grid-template-columns: repeat(3, minmax(96px,1fr)); gap: .65rem; }
.project-facts div { padding: .85rem; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.project-facts span { display: block; color: #68798b; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.project-facts strong { display: block; margin-top: .3rem; font-size: .93rem; }
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 1.25rem;
  padding: .72rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(16,45,79,.12);
  border-radius: 16px;
  background: rgba(248,250,252,.94);
  box-shadow: 0 12px 32px rgba(16,45,79,.12);
  backdrop-filter: blur(16px);
}
.toolbar-group { display: flex; align-items: center; gap: .45rem; }
.toolbar label, .page-total, .zoom-label { font-size: .85rem; font-weight: 700; color: #5d6c7c; }
#pageInput { width: 64px; height: 38px; border: 1px solid var(--line); border-radius: 10px; text-align: center; color: var(--navy); font-weight: 800; background: white; }
.zoom-label { min-width: 48px; text-align: center; }
.viewer { width: 100%; padding: .25rem 1rem 3rem; overflow-x: auto; }
.page-shell {
  position: relative;
  width: calc(min(900px, calc(100vw - 2rem)) * var(--zoom));
  aspect-ratio: 0.7071;
  margin: 0 auto 2rem;
  border-radius: 5px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: width .18s ease;
}
.page-shell::before {
  content: attr(data-page-label);
  position: absolute;
  left: -1px;
  top: 18px;
  z-index: 3;
  padding: .35rem .65rem;
  color: white;
  background: rgba(16,45,79,.88);
  border-radius: 0 7px 7px 0;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.page-canvas { display: block; width: 100%; height: 100%; background: white; pointer-events: none; }
.page-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #6f7f90; font-weight: 700; background: linear-gradient(110deg,#f4f6f8 8%,#fff 18%,#f4f6f8 33%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }
.site-footer { padding: 2.5rem 1rem 3.2rem; text-align: center; color: #5b6979; font-size: .86rem; }
.site-footer p { margin: .35rem auto; max-width: 760px; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; padding: .75rem 1rem; color: white; background: rgba(16,35,59,.94); border-radius: 12px; pointer-events: none; transition: .2s ease; box-shadow: 0 12px 30px rgba(0,0,0,.22); }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.noscript { padding: 1rem; text-align: center; background: #7d1f1f; color: white; font-weight: 700; }
@media (max-width: 820px) {
  .site-header { align-items: flex-start; }
  .author-card { display: none; }
  .intro { grid-template-columns: 1fr; }
  .project-facts { grid-template-columns: repeat(3,1fr); }
  .toolbar { flex-wrap: wrap; justify-content: center; }
  .toolbar-group { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 520px) {
  .brand-mark { display: none; }
  .project-facts { grid-template-columns: 1fr; }
  #fullBtn { display: none; }
  .page-shell::before { display: none; }
}
@media print {
  body * { display: none !important; }
  body::before { content: "Printing is disabled for this web edition. © Sagar Debnath."; display: block !important; padding: 3rem; font: 18px/1.5 system-ui, sans-serif; }
}
