/* ==========================================================================
   Imranul Ahsan Moonim, academic portfolio
   style.css: base styles and desktop layout
   Breakpoints live in responsive.css
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --paper: #F5F6F2;        /* page background */
  --paper-tint: #ECEEE7;   /* alternate band */
  --card: #FBFCF9;         /* card surface */
  --line: #D5D9CF;         /* borders and rules */
  --ink: #16211C;          /* main text */
  --muted: #56615A;        /* secondary text */
  --accent: #1D5140;       /* links, buttons */
  --accent-dark: #143A2E;  /* hover */
  --deep: #12332A;         /* dark band */
  --on-deep: #F0F3EC;      /* text on dark band */
  --on-deep-muted: #B6C4BA;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1120px;
  --gutter: 32px;
  --rail: 220px;           /* left column that holds section titles */
  --radius: 14px;
  --radius-sm: 8px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }

ul, ol { padding: 0; list-style: none; }

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

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

button { font: inherit; color: inherit; cursor: pointer; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--paper); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.lead {
  font-family: var(--serif);
  font-size: 1.375rem;
  line-height: 1.45;
}

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* ---------- Header ---------- */
.site-header { padding: 22px 0; }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--accent); }

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

.nav__list { display: flex; align-items: center; gap: 28px; }

.nav__link {
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.nav__link:hover { color: var(--ink); }
.nav__link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.875rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.btn--ghost { background: transparent; color: var(--ink); border-color: #AEB5AA; }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.btn--small { padding: 8px 16px; font-size: 0.875rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 96px; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr);
  gap: 72px;
  align-items: center;
}

.hero__who { margin-bottom: 28px; font-size: 0.9375rem; line-height: 1.5; }
.hero__name { display: block; font-weight: 600; }
.hero__role { display: block; color: var(--muted); text-wrap: balance; }

.hero__title {
  font-size: clamp(2.25rem, 4.3vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero__sub {
  margin-top: 24px;
  max-width: 34em;
  font-size: 1.125rem;
  color: var(--muted);
}

.hero .btn-row { margin-top: 36px; }

.hero__photo {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--paper-tint);
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section--tint { background: var(--paper-tint); border-top: 0; }
.section--tint + .section { border-top: 0; }

.section__grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 56px;
}

.section__title { font-size: 1.75rem; line-height: 1.15; }
.section__note { margin-top: 10px; font-size: 0.875rem; color: var(--muted); }

.stack > * + * { margin-top: 20px; }
.stack-lg > * + * { margin-top: 40px; }

/* ---------- About ---------- */
.about__body { max-width: 40em; }
.about__body p + p { margin-top: 18px; color: var(--muted); }
.about__body .btn-row { margin-top: 32px; }

/* ---------- Numbers band ---------- */
.numbers { background: var(--deep); color: var(--on-deep); padding: 64px 0; }

.numbers__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }

.numbers__value {
  font-family: var(--serif);
  font-size: 3.5rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.numbers__label { margin-top: 12px; max-width: 18em; font-size: 0.9375rem; color: var(--on-deep-muted); }

/* ---------- Cards ---------- */
.card {
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.card__title { font-family: var(--serif); font-size: 1.375rem; font-weight: 400; line-height: 1.25; letter-spacing: -0.01em; }
.card__meta { font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
.card p { color: var(--muted); }
.card p + p { margin-top: 12px; }
.card .card__role { color: var(--ink); }
.card__role strong { font-weight: 600; }
.card__link { display: inline-block; margin-top: 16px; font-size: 0.9375rem; font-weight: 500; }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* ---------- Research: retained-value figure ---------- */
.retain { margin-top: 36px; }

.retain__bar {
  display: flex;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--deep);
}

.retain__kept {
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--deep);
  color: var(--on-deep);
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.retain__paid {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(18, 51, 42, 0.14) 7px 8px);
}

.retain__key {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--muted);
}

.retain__caption { margin-top: 14px; font-size: 0.875rem; color: var(--muted); max-width: 46em; }

/* ---------- Teaching ---------- */
.teaching__photo { border-radius: var(--radius); width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.teaching__caption { margin-top: 10px; font-size: 0.875rem; color: var(--muted); }

.book {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border: 1px dashed #AEB5AA;
  border-radius: var(--radius);
}
.book p { max-width: 34em; }

/* ---------- Post list ---------- */
.post-list > li { border-top: 1px solid var(--line); }
.post-list > li:last-child { border-bottom: 1px solid var(--line); }

.post-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  padding: 26px 0;
  color: inherit;
  text-decoration: none;
}

.post-row__date { padding-top: 6px; font-size: 0.875rem; color: var(--muted); }
.post-row__title { font-family: var(--serif); font-size: 1.5rem; line-height: 1.22; letter-spacing: -0.01em; }
.post-row__sum { margin-top: 8px; max-width: 44em; color: var(--muted); }
.post-row:hover .post-row__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.more-link { display: inline-block; margin-top: 24px; font-weight: 500; font-size: 0.9375rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.contact-card { display: block; color: inherit; text-decoration: none; }
.contact-card:hover { border-color: var(--accent); color: inherit; }
.contact-card .contact-card__kind { font-size: 0.875rem; color: var(--muted); }
.contact-card .contact-card__value {
  margin-top: 32px;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--ink);
}
.contact-card .contact-card__hint { margin-top: 6px; font-size: 0.875rem; color: var(--muted); }

/* ---------- Page head (inner pages) ---------- */
.page-head { padding: 56px 0 56px; }
.page-head__title { font-size: clamp(2.25rem, 4.3vw, 3.25rem); line-height: 1.08; letter-spacing: -0.02em; max-width: 20ch; }
.page-head__sub { margin-top: 20px; max-width: 38em; font-size: 1.125rem; color: var(--muted); }

/* ---------- Article (essay and blog posts) ---------- */
.article { padding: 0 0 96px; }

.article__inner { max-width: 44rem; }

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 16px 0;
  margin-bottom: 40px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

.prose { font-family: var(--serif); font-size: 1.25rem; line-height: 1.62; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { margin-top: 2.2em; font-size: 1.75rem; line-height: 1.2; }
.prose h2 + * { margin-top: 0.7em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.5em; }
.prose strong { font-weight: 600; }

.status {
  padding: 24px 28px;
  margin-bottom: 40px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}
.status dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 20px; margin: 0; }
.status dt { color: var(--muted); }
.status dd { margin: 0; }

.sources { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-family: var(--sans); font-size: 0.875rem; color: var(--muted); }
.sources h2 { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; color: var(--ink); letter-spacing: 0; margin: 0 0 12px; }
.sources ol { list-style: decimal; padding-left: 1.3em; }
.sources li + li { margin-top: 8px; }
.sources a { overflow-wrap: anywhere; }

.article__nav { display: flex; justify-content: space-between; gap: 24px; margin-top: 48px; font-size: 0.9375rem; font-weight: 500; }

/* ---------- Talks and media ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }

.filter__btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--muted);
}
.filter__btn:hover { border-color: var(--ink); color: var(--ink); }
.filter__btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }

.video__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--deep);
}
.video__frame img { width: 100%; height: 100%; object-fit: cover; }
.video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.video__play {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}
.video__play svg { width: 12px; height: 12px; }
.video__frame:hover .video__play { background: #fff; }

.media__kind { margin-top: 16px; font-size: 0.875rem; color: var(--muted); }
.media__title { margin-top: 4px; font-family: var(--serif); font-size: 1.375rem; line-height: 1.25; }
.media__title a { color: inherit; text-decoration: none; }
.media__title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.media__note { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; }

.appear-list > li { border-top: 1px solid var(--line); padding: 24px 0; }
.appear-list > li:last-child { border-bottom: 1px solid var(--line); }
.appear { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; }
.appear__when { font-size: 0.875rem; color: var(--muted); padding-top: 5px; }
.appear__title { font-family: var(--serif); font-size: 1.375rem; line-height: 1.25; }
.appear__body { margin-top: 6px; color: var(--muted); max-width: 44em; }
.appear__link { display: inline-block; margin-top: 10px; font-size: 0.9375rem; font-weight: 500; }

.empty { padding: 24px 0; color: var(--muted); }

[hidden] { display: none !important; }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0 48px; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--muted); }

.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }

.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

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

.article--flush { padding-bottom: 0; }

/* ---------- Research: volume vs value comparison ---------- */
.compare { margin-top: 36px; border-top: 1px solid var(--ink); }

.compare__row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}

.compare__row > :nth-child(2) { color: var(--muted); }

.compare__row--head {
  font-family: var(--serif);
  font-size: 1.375rem;
  line-height: 1.2;
  padding: 18px 0 14px;
}
.compare__row--head > :nth-child(2) { color: var(--muted); }
.compare__row--head > :nth-child(3) { color: var(--accent); }

.compare__label { color: var(--muted); font-size: 0.875rem; padding-top: 2px; }

.compare__row--end { border-bottom: 1px solid var(--ink); font-family: var(--serif); font-size: 1.25rem; }
.compare__row--end .compare__label { font-family: var(--sans); }
.compare__row--end > :nth-child(3) { color: var(--accent); }

.pub-group { margin-bottom: 16px; font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Research: smile curve ---------- */
.smile-fig { margin-top: 36px; max-width: 40em; }
.smile { display: block; width: 100%; height: auto; font-family: var(--sans); overflow: visible; }
.smile--narrow { display: none; }
.smile__area { fill: var(--paper-tint); }
.smile__axis, .smile__tick { stroke: #AEB5AA; stroke-width: 1; }
.smile__axislabel, .smile__stage { fill: var(--muted); }
.smile__curve { fill: none; stroke: var(--deep); stroke-width: 2.5; stroke-linecap: round; }
.smile__arrow { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.smile__head { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.smile__note { fill: var(--accent); font-weight: 600; }
.smile__dotlabel { fill: var(--ink); font-weight: 500; }
.smile__leader { stroke: var(--ink); stroke-width: 1; }
.smile__dot { fill: var(--deep); stroke: var(--paper); stroke-width: 3; }
.smile__key { display: none; margin-top: 12px; font-size: 0.875rem; color: var(--ink); }
.smile__key li { display: flex; align-items: center; gap: 10px; }
.smile__key li + li { margin-top: 6px; }
.smile__key-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--deep); flex: none; }
.smile__key-arrow { width: 12px; color: var(--accent); font-weight: 600; text-align: center; flex: none; }
