/* Unslopped Editorial Monograph Portfolio — Mezanur Rahman Sharukh
   Direction: Quiet, scholarly, exact, warm (archival paper + deep ink + monograph index)
   Grid: strict 4px spacing scale | Motion: single ease-out curve */

:root {
  /* Warm archival paper ramp */
  --bg: #f7f4ee;
  --surface: #fdfbf7;
  --surface-raised: #efe9df;
  --hairline: rgba(31, 27, 22, 0.10);
  --hairline-strong: rgba(31, 27, 22, 0.22);

  /* Three text roles */
  --text: #1f1b16;
  --text-secondary: #5e554a;
  --text-muted: #70665a;

  /* Single disciplined accent from the monograph cover's world */
  --accent: #0f4c5c;
  --accent-hover: #0a3844;

  /* Primary button (quiet archival ink so the book cover leads color) */
  --btn-bg: #1f1b16;
  --btn-bg-hover: #352f27;
  --btn-text: #fdfbf7;

  /* Shadows (light mode only: soft, neutral, subtle) */
  --shadow-book: 0 12px 28px rgba(31, 27, 22, 0.12), 0 2px 6px rgba(31, 27, 22, 0.06);
  --shadow-card: 0 1px 2px rgba(31, 27, 22, 0.04);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
}

[data-theme="dark"] {
  --bg: #161513;
  --surface: #1c1a18;
  --surface-raised: #262421;
  --hairline: rgba(239, 233, 222, 0.09);
  --hairline-strong: rgba(239, 233, 222, 0.20);

  --text: #efe9de;
  --text-secondary: #aaa398;
  --text-muted: #8f887d;

  --accent: #6eb5c4;
  --accent-hover: #8fcad6;

  --btn-bg: #efe9de;
  --btn-bg-hover: #dcd4c6;
  --btn-text: #161513;

  --shadow-book: 0 16px 32px rgba(0, 0, 0, 0.45);
  --shadow-card: none;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04";
}

h1, h2, h3 {
  font-family: "Newsreader", Georgia, "Liberation Serif", serif;
  font-weight: 400;
  color: var(--text);
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.container {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Top Navigation — quiet, opaque, single hairline */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: var(--bg);
  border-bottom: 1px solid var(--hairline);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
  opacity: 0.78;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.theme-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background-color: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.theme-btn:hover {
  background-color: var(--surface-raised);
  color: var(--text);
  border-color: var(--hairline-strong);
}

.theme-btn:active {
  transform: scale(0.98);
}

/* Hero — asymmetric editorial split, text left, portrait rail right */
.hero {
  padding: 72px 0 64px;
  border-bottom: 1px solid var(--hairline);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 204px;
  gap: 64px;
  align-items: center;
}

.hero-title {
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin-bottom: 16px;
}

.hero-subhead {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 36rem;
  margin-bottom: 20px;
}

.hero-bio {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 38rem;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Buttons — strict 4px scale, 44px hero height, 8px radius */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--btn-bg);
  color: var(--btn-text);
}

.btn-primary:hover {
  background-color: var(--btn-bg-hover);
  color: var(--btn-text);
}

.btn-secondary {
  background-color: var(--surface-raised);
  color: var(--text);
  border-color: var(--hairline);
}

.btn-secondary:hover {
  border-color: var(--hairline-strong);
  color: var(--text);
}

/* Portrait rail — archival plate frame with nested radii (12px outer = 8px inner + 4px pad) */
.portrait-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.portrait-frame {
  padding: 4px;
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.portrait {
  width: 100%;
  height: 224px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center 12%;
  display: block;
}

.portrait-meta {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.portrait-links {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 8px 16px;
  margin-top: 12px;
  font-size: 13px;
}

.portrait-links a {
  color: var(--text-secondary);
}

.portrait-links a:hover {
  color: var(--accent);
}

/* Sections & Signature Marginal Numbering */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--hairline);
}

.section:last-of-type {
  border-bottom: none;
}

.section-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  margin-bottom: 32px;
}

.section-num {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 28px;
  line-height: 1.18;
  font-weight: 400;
}

.section-caption {
  font-size: 13px;
  color: var(--text-muted);
}

.section-body {
  padding-left: 96px;
}

/* § 01 Monograph Showcase — single bright moment on calm linen */
.monograph-panel {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 36px;
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-card);
  align-items: start;
}

.book-cover-link {
  display: block;
}

.book-cover {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-book);
}

.monograph-meta {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.monograph-title {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 400;
  margin-bottom: 8px;
}

.monograph-subtitle {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.monograph-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Hairline-divided tabular figures (no nested boxes!) */
.figures-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 16px 0;
  gap: 16px;
  margin-bottom: 24px;
}

.figure-val {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.figure-label {
  display: block;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
}

/* Command bar */
.cmd-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 40px;
  padding: 0 8px 0 12px;
  background-color: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  margin-bottom: 20px;
}

.cmd-bar code {
  font-size: 13px;
  color: var(--text);
}

.btn-micro {
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background-color: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.btn-micro:hover {
  color: var(--text);
  border-color: var(--hairline-strong);
}

.monograph-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.inline-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
}

.text-action {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
}

.text-action:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* § 02 Ongoing Research — editorial 2-column ruled index (replaces 6 SaaS cards) */
.research-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
}

.research-entry {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid var(--hairline);
  align-items: start;
}

.entry-idx {
  font-size: 12px;
  line-height: 22px;
  color: var(--text-muted);
}

.entry-domain {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.research-entry h3 {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 400;
  margin-bottom: 8px;
}

.research-entry p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* § 03 Published Works — quiet underline tabs & ruled bibliography */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 8px;
}

.filter-tab {
  position: relative;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.filter-tab:hover {
  color: var(--text);
}

.filter-tab.active {
  color: var(--text);
  font-weight: 500;
  border-bottom-color: var(--accent);
}

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: baseline;
}

.pub-row:last-child {
  border-bottom: none;
}

.pub-row.hidden {
  display: none;
}

.pub-year {
  font-size: 13px;
  color: var(--text-muted);
}

.pub-type {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pub-cite {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.pub-cite strong {
  font-weight: 500;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  font-size: 13px;
}

/* § 04 Background & Methods — ruled rows + compact methods list */
.bg-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: start;
}

.col-heading {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.ledger-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ledger-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
  align-items: baseline;
}

.ledger-date {
  font-size: 12px;
  color: var(--text-muted);
}

.ledger-role {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.ledger-org {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ledger-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.methods-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.method-row {
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
}

.method-row h3 {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.method-row p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Footer */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 40px 0 56px;
  font-size: 13px;
  color: var(--text-muted);
}

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

.footer-name {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.footer-contact {
  margin-top: 4px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 820px) {
  .container { padding: 0 20px; }
  .hero { padding: 48px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .portrait-rail { order: -1; flex-direction: row; align-items: center; gap: 20px; }
  .portrait-frame { width: 104px; flex-shrink: 0; }
  .portrait { width: 100%; height: 112px; border-radius: 8px; }
  .section { padding: 48px 0; }
  .section-head { grid-template-columns: 1fr; gap: 4px; margin-bottom: 24px; }
  .section-body { padding-left: 0; }
  .monograph-panel { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
  .book-cover-link { max-width: 200px; }
  .figures-row { grid-template-columns: repeat(2, 1fr); }
  .research-index, .bg-split { grid-template-columns: 1fr; gap: 0; }
  .bg-split { gap: 40px; }
  .pub-row, .ledger-row { grid-template-columns: 1fr; gap: 4px; }
  .nav-links a:not(:last-of-type) { display: none; }
}
