/* ==========================================================================
   sirajhussain.in: site styles
   1. Fonts   2. Tokens   3. Base   4. Layout   5. Components   6. Sections
   7. Videos   8. Utilities   9. Small screens
   ========================================================================== */

/* 1. Fonts: self-hosted variable fonts (copied from node_modules at build) */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/assets/fonts/source-sans-3-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/assets/fonts/source-serif-4-latin-opsz-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/assets/fonts/source-code-pro-latin-wght-normal.woff2') format('woff2');
}

/* 2. Tokens */
:root {
  --ink: #14261F;
  --text-2: #33443D;
  --muted: #4A5A53;
  --paper: #F6F7F4;
  --white: #FFFFFF;
  --line: #D9DFDA;
  --pill-line: #B9C5BE;
  --accent: #1E6B4E;
  --gold: #C9A227;
  --forest: #12332B;
  --forest-2: #1C4438;
  --forest-line: #2F5A4C;
  --ghost-line: #5E7E72;
  --mist: #C9D6CF;
  --mist-2: #DCE6E0;
  --sage: #9FB7AC;
  --overlay: rgba(18, 51, 43, 0.88);

  --font-sans: 'Source Sans 3', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-mono: 'Source Code Pro', ui-monospace, monospace;

  --max: 1200px;
  --gutter: 32px;
  --radius: 4px;
}

/* 3. Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
}
img, svg { max-width: 100%; }
h1, h2, h3, p, li, a, span, div { overflow-wrap: break-word; min-width: 0; }
section, header, footer { max-width: 100%; overflow-x: clip; }
/* :where() keeps these at zero specificity so component link colours win */
:where(a) { color: var(--accent); text-underline-offset: 3px; }
:where(a):hover { color: var(--forest); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.site-header :focus-visible, .hero :focus-visible, .site-footer :focus-visible { outline-color: var(--gold); }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 16px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--white);
  color: var(--forest);
  font-weight: 600;
  border-radius: var(--radius);
}
.skip-link:focus { top: 16px; }

/* 4. Layout */
.container { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-top: 96px; }

.split { display: flex; flex-wrap: wrap; gap: 56px; }
.split--tight { gap: 48px; }
.split__main { flex: 999 1 560px; min-width: 0; }
.split__side { flex: 1 1 320px; }
.split__aside { flex: 1 1 300px; }

.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 40px; }
.papers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.boards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; margin-bottom: 48px; }
.pubs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 48px; }
.talk-hosts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; margin-bottom: 40px; }

/* 5. Components */

/* Section heading: number + title over a rule */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  border-top: 2px solid var(--ink);
  padding-top: 16px;
  margin-bottom: 40px;
}
.section-head--sub { margin: 96px 0 40px; }
.section-head__num { font-family: var(--font-mono); font-size: 14px; color: var(--accent); }
.section-head__title { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: -0.01em; }

/* Small uppercase labels */
.eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--spaced { margin-top: 48px; }
.eyebrow--spaced-lg { margin-top: 56px; }
.dateline {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--accent); }
.kicker--gold { color: var(--gold); }

.meta { font-size: 14px; color: var(--muted); }
.intro { margin: 0 0 32px; max-width: 760px; font-size: 18px; color: var(--text-2); }
.intro--spaced { margin-bottom: 40px; }
.outlets { margin: 0; font-size: 16px; line-height: 2; color: var(--text-2); }
.link-plain { color: var(--ink); }

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.list-head .eyebrow { margin: 0; }

/* Buttons */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
}
.btn--light { background: var(--paper); color: var(--forest); font-weight: 600; padding: 13px 22px; }
.btn--light:hover { background: var(--white); color: var(--forest); }
.btn--ghost { color: var(--paper); font-weight: 500; border: 1px solid var(--ghost-line); }
.btn--ghost:hover { color: var(--white); border-color: var(--paper); }
.btn--outline {
  min-height: 44px;
  font-weight: 600;
  border: 1px solid var(--ink);
  background: var(--white);
  color: var(--ink);
}
.btn--outline:hover { background: var(--paper); }

/* Filter pills */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filters--spaced { margin-bottom: 28px; }
.pill {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--pill-line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}
.pill:hover { border-color: var(--forest); }
.pill[aria-pressed="true"] { font-weight: 600; border-color: var(--forest); background: var(--forest); color: var(--paper); }

.more { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 28px; }
.more--spaced { margin-top: 36px; }

/* Cards */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card--roomy { padding: 28px; }
.card--dark { background: var(--forest); color: var(--paper); border: 0; padding: 28px; }
.card__kicker { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.card__title { margin-top: 8px; font-weight: 600; line-height: 1.4; }
.card__heading { margin-top: 12px; font-family: var(--font-serif); font-size: 22px; line-height: 1.3; }
.card__note { margin-top: 8px; font-size: 14px; color: var(--muted); }
.card--dark .card__note { color: var(--mist); }
.card__note--lg { font-size: 15px; }
.card__source { margin-top: 6px; font-size: 14px; color: var(--muted); }

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  margin-bottom: 48px;
  padding: 24px 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.callout__text { flex: 1 1 480px; }

/* Row lists: label on the left, content on the right */
.rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.row { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.row--tight { padding-block: 14px; }
.row--loose { padding-block: 18px; }
.row__label { flex: 0 0 120px; font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.row__label--year { flex-basis: 64px; }
.row__label--wide { flex-basis: 200px; font-size: 13px; }
.row__body { flex: 1 1 400px; }
.row__title { font-family: var(--font-serif); font-size: 18px; }
.row__link { font-family: var(--font-serif); font-size: 18px; color: var(--ink); }

/* Publication lists */
.pub-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 22px; }
.pub__title { font-family: var(--font-serif); font-size: 18px; line-height: 1.4; }
.pub__meta { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* Career timeline */
.timeline { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--mist); }
.timeline--accent { border-left-color: var(--accent); }
.timeline__item { padding: 0 0 22px 24px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__title { font-weight: 600; }

.col-title { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.col-title--spaced { margin-bottom: 20px; }
.col-subtitle { margin: 0 0 24px; font-size: 15px; color: var(--muted); }

/* 6. Sections */

/* Header */
.site-header { background: var(--forest); color: var(--paper); }
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}
.site-header__brand { color: var(--paper); text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: 0.01em; }
.site-header__brand:hover { color: var(--white); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 14px; }
.site-nav__link { color: var(--mist); text-decoration: none; padding: 10px 0; }
.site-nav__link:hover { color: var(--white); text-decoration: underline; }

/* Hero */
.hero { background: var(--forest); color: var(--paper); border-bottom: 6px solid var(--gold); }
.hero__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-block: 72px 88px; }
.hero__text { flex: 999 1 560px; min-width: 0; }
.hero__eyebrow {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.hero__lede { margin: 20px 0 0; max-width: 640px; font-size: 22px; line-height: 1.45; color: var(--mist-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__portrait { flex: 1 1 280px; max-width: 340px; }
.hero__portrait img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.portrait-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 5;
  width: 100%;
  padding: 24px;
  background: var(--forest-2);
  border: 1px solid var(--forest-line);
  border-radius: var(--radius);
  color: var(--sage);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
}

/* Key facts strip */
.facts { background: var(--white); border-bottom: 1px solid var(--line); }
.facts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 24px;
  padding-block: 32px;
}
.fact__value { font-family: var(--font-serif); font-size: 30px; font-weight: 500; color: var(--forest); }

/* Profile */
.prose { font-family: var(--font-serif); font-size: 19px; line-height: 1.7; }
.prose p { margin: 0 0 20px; }
.prose p:last-child { margin-bottom: 0; }
.roles-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 15px;
  line-height: 1.5;
}

/* ICRIER */
.feature-title { margin: 8px 0 16px; font-family: var(--font-serif); font-size: 28px; font-weight: 500; line-height: 1.25; }
.feature-text { margin: 0; font-size: 16px; color: var(--text-2); }

/* Opinion pieces */
.op__meta { flex: 0 0 180px; min-width: 0; }
.op__date { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.op__outlet { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--accent); }
.op__body { flex: 1 1 420px; min-width: 0; }
.op__title { font-family: var(--font-serif); font-size: 19px; line-height: 1.4; color: var(--ink); }
.op__co { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* Footer */
.site-footer { margin-top: 112px; background: var(--forest); color: var(--paper); border-top: 6px solid var(--gold); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 48px; padding-block: 72px 40px; }
.site-footer__intro { flex: 1 1 420px; }
.site-footer__title { margin: 0; font-family: var(--font-serif); font-weight: 500; font-size: 40px; line-height: 1.15; }
.site-footer__lede { margin: 16px 0 0; max-width: 480px; font-size: 17px; color: var(--mist); }
.site-footer__links { flex: 1 1 320px; display: flex; flex-direction: column; gap: 12px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--forest-line);
}
.contact-link:hover { color: var(--white); border-bottom-color: var(--gold); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 24px 40px;
  font-size: 13px;
  color: var(--sage);
}

/* 7. Videos */
.video-featured { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 24px; margin-bottom: 64px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 32px 24px; }

.video { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.video--featured { display: block; }
.video:hover .video__title { text-decoration: underline; text-underline-offset: 3px; }
.video__thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--text-2); }
.video__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px;
  color: var(--paper);
}
.video__ini { font-family: var(--font-mono); font-size: 26px; font-weight: 500; line-height: 1; opacity: 0.9; }
.video__fallback-channel { margin-top: 6px; font-size: 12px; color: var(--mist-2); }
.video--featured .video__fallback { padding: 20px; }
.video--featured .video__ini { font-size: 40px; }
.video--featured .video__fallback-channel { margin-top: 8px; font-size: 14px; }
.video__badge {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--overlay);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
}
.video__play {
  position: absolute;
  left: 16px;
  top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--overlay);
}
.video__date { margin-top: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.video__channel { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--accent); }
.video__title {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video__kicker { margin-top: 14px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--accent); }
.video--featured .video__title { font-size: 21px; line-height: 1.35; display: block; overflow: visible; }
.video__cta { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--accent); }

/* Photos */
.photo-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 32px 24px;
}
.photo__figure { margin: 0; }
.photo__link { display: block; overflow: hidden; border-radius: var(--radius); background: var(--line); }
.photo__link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.photo__link:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .photo__link img { transition: none; } .photo__link:hover img { transform: none; } }
.photo__caption { display: flex; flex-direction: column; margin-top: 12px; }
.photo__date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.photo__event { margin-top: 2px; font-family: var(--font-serif); font-size: 17px; line-height: 1.4; }
.photo__place { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--accent); }

/* Full-size photo viewer */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 56px 72px 24px;
  border: 0;
  background: #0A1814;
  color: var(--paper);
}
.lightbox::backdrop { background: rgba(10, 24, 20, 0.8); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox__figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; }
.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
}
.lightbox__caption { margin-top: 14px; max-width: 900px; text-align: center; font-size: 15px; color: var(--mist-2); }
.lightbox__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--forest-line);
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  cursor: pointer;
}
.lightbox__btn:hover { background: var(--forest-2); border-color: var(--gold); }
.lightbox__btn:focus-visible { outline-color: var(--gold); }
.lightbox__btn--close { top: 12px; right: 12px; }
.lightbox__btn--prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__btn--next { right: 12px; top: 50%; transform: translateY(-50%); }

/* 8. Utilities: 404 page */
.notfound {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--forest);
  color: var(--paper);
  border-top: 6px solid var(--gold);
}
.notfound h1 { margin: 0 0 12px; font-family: var(--font-serif); font-weight: 500; font-size: 44px; }
.notfound p { margin: 0 0 28px; font-size: 18px; color: var(--mist); }

/* 9. Small screens */
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .section { padding-top: 72px; }
  .section-head--sub { margin-top: 72px; }
  .section-head__title { font-size: 26px; }
  .hero__inner { padding-block: 48px 64px; gap: 40px; }
  .hero__title { font-size: 46px; }
  .hero__lede { font-size: 19px; }
  .prose { font-size: 18px; }
  .site-footer { margin-top: 88px; }
  .site-footer__title { font-size: 32px; }
  .lightbox { padding: 64px 8px 88px; }
  .lightbox__img { max-height: calc(100vh - 200px); }
  .lightbox__btn--prev, .lightbox__btn--next { top: auto; bottom: 20px; transform: none; }
  .lightbox__btn--prev { left: calc(50% - 60px); }
  .lightbox__btn--next { right: calc(50% - 60px); }
}

/* Video fallback colours (generated from videos.json) */
.tone-4b2e5a { background: #4b2e5a; }
.tone-33443d { background: #33443d; }
.tone-6b3e1f { background: #6b3e1f; }
.tone-12332b { background: #12332b; }
.tone-1f4e79 { background: #1f4e79; }
.tone-1e6b4e { background: #1e6b4e; }
