@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Manrope:wght@400;500;600;700&family=Noto+Nastaliq+Urdu:wght@400;500;600&family=Vazirmatn:wght@400;500;600;700&display=swap");

:root {
  --ink: #17211c;
  --muted: #667069;
  --paper: #f8f6f0;
  --surface: #ffffff;
  --tint: #eef0e9;
  --line: #d9ddd6;
  --accent: #b84932;
  --accent-deep: #843220;
  --forest: #173e31;
  --on-forest: #f5f3ea;
  --shadow: 0 24px 70px rgba(31, 44, 37, 0.09);
  --radius: 22px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #edf1eb;
  --muted: #a7b0a9;
  --paper: #111612;
  --surface: #18201a;
  --tint: #1b241d;
  --line: #334038;
  --accent: #e17a61;
  --accent-deep: #f29b85;
  --forest: #dce8df;
  --on-forest: #152019;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  line-height: 1.65;
  transition: background 180ms ease, color 180ms ease;
}

html[dir="rtl"] body {
  font-family: "Vazirmatn", sans-serif;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

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

.shell {
  width: min(1160px, calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wordmark-mark {
  width: 38px;
  aspect-ratio: 1;
  display: block;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
}

.wordmark-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.desktop-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
  color: var(--accent);
}

.header-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.icon-button,
.language-button {
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.language-button {
  padding-inline: 13px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.icon-button:hover,
.language-button:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.hero {
  min-height: 690px;
  padding-block: 96px 110px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.7fr);
  gap: clamp(56px, 9vw, 130px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 750px;
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.7rem, 8vw, 7.8rem);
  font-weight: 600;
  letter-spacing: 0.012em;
  line-height: 0.88;
  text-wrap: balance;
}

.hero-copy > .eyebrow {
  margin: 28px 0 12px;
}

.hero-copy > .hero-description {
  margin-top: 0;
}

html[dir="rtl"] .hero h1 {
  max-width: 820px;
  padding-block: 0.08em 0.18em;
  font-family: "Noto Nastaliq Urdu", "Vazirmatn", serif;
  font-size: clamp(3.5rem, 7vw, 6.8rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.55;
}

.hero-description {
  max-width: 660px;
  margin: 34px 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  text-align: justify;
  text-justify: inter-word;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 700;
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.link-button::after {
  content: "↗";
  margin-inline-start: 7px;
  color: var(--accent);
}

.link-button.has-custom-icon::after,
.link-button.no-indicator::after {
  content: none;
}

.button-icon {
  width: 16px;
  height: 16px;
  margin-inline-start: 8px;
  object-fit: contain;
}

.link-button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  transform: translateY(-2px);
}

.portrait-frame {
  position: relative;
}

.portrait-frame > img,
.portrait-frame > .media-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 46% 46% var(--radius) var(--radius);
  box-shadow: var(--shadow);
}

.portrait-frame > img {
  object-fit: cover;
}

.media-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 25% 25%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 28%),
    linear-gradient(145deg, var(--surface), var(--tint));
  color: var(--muted);
  text-align: center;
  font-size: 0.76rem;
}

.placeholder-monogram {
  color: var(--ink);
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.08em;
}

.portrait-caption {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.section {
  padding-block: 110px;
  scroll-margin-top: 70px;
}

.section-tinted {
  background: var(--tint);
}

.section-heading {
  display: grid;
  grid-template-columns: 85px 1fr;
  margin-bottom: 55px;
}

.section-index {
  margin: 7px 0 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.section-heading h2,
.research-layout h2,
.personal-copy h2,
.site-footer h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.06;
}

.section-heading > div > p {
  max-width: 600px;
  margin: 15px 0 0;
  color: var(--muted);
}

.timeline {
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 30px;
  align-items: start;
  padding-block: 27px;
  border-bottom: 1px solid var(--line);
}

.timeline-date,
.item-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.timeline-item h3,
.education-copy h3,
.award-card h3,
.publication-copy h3,
.credential-copy h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

.timeline-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.timeline-item .link-button {
  justify-self: end;
}

.stack {
  display: grid;
  gap: 18px;
}

.education-card {
  display: grid;
  grid-template-columns: 104px 1fr auto;
  gap: 28px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.logo-box {
  width: 88px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 12px;
  overflow: hidden;
  border: 1px solid #d9dedb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgb(20 28 24 / 10%);
  color: #38413d;
  font-size: 0.64rem;
  text-align: center;
}

.logo-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

html[data-theme="dark"] .logo-box {
  border-color: #d9dedb;
  background: #fff;
  box-shadow: 0 10px 26px rgb(0 0 0 / 24%);
}

.education-copy > p,
.award-card > p,
.credential-copy > p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 16px;
}

.detail-list span {
  color: var(--muted);
  font-size: 0.75rem;
}

.detail-list strong {
  color: var(--ink);
  font-weight: 600;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.award-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.award-card .logo-box {
  margin-bottom: 42px;
}

.award-card .item-meta {
  margin-top: auto;
  padding-top: 20px;
}

.award-card h3,
.award-card > p {
  text-align: justify;
  text-justify: inter-word;
}

.publication-list {
  display: grid;
  gap: clamp(72px, 10vw, 120px);
}

.publication-card {
  padding-bottom: clamp(64px, 8vw, 96px);
  border-bottom: 1px solid var(--line);
}

.publication-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.publication-copy,
.publication-media {
  width: 100%;
}

.publication-media {
  margin: clamp(30px, 5vw, 48px) 0 0;
  padding: clamp(14px, 2.5vw, 28px);
  border-radius: var(--radius);
  border: 1px solid rgb(22 28 25 / 12%);
  background: #fff;
  color: #242826;
  box-shadow: 0 22px 55px rgb(18 23 20 / 10%);
}

.publication-image-link,
.publication-image-crop {
  display: block;
}

.publication-image-link {
  overflow: hidden;
  border-radius: calc(var(--radius) * 0.65);
  background: #fff;
}

.publication-image-crop {
  aspect-ratio: var(--figure-aspect-ratio, auto);
  overflow: hidden;
}

.publication-image-crop img {
  display: block;
  width: 100%;
  height: auto;
}

.publication-media figcaption {
  margin-top: clamp(16px, 2.5vw, 24px);
  padding-top: clamp(14px, 2vw, 20px);
  border-top: 1px solid rgb(22 28 25 / 12%);
  color: #3f4542;
  font-size: clamp(0.82rem, 1.15vw, 0.96rem);
  line-height: 1.65;
  text-align: justify;
  text-justify: inter-word;
}

.publication-copy h3 {
  width: 100%;
  margin-top: 0;
  font-size: clamp(1.3rem, 2.1vw, 1.9rem);
  letter-spacing: -0.035em;
}

.publication-actions {
  justify-content: center;
  margin-top: clamp(22px, 3vw, 34px);
  text-align: center;
}

html[dir="rtl"] .publication-copy {
  direction: ltr;
  text-align: left;
}

html[dir="rtl"] .publication-media figcaption {
  direction: ltr;
  text-align: justify;
}

.publication-authors {
  margin: 18px 0 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.publication-venue {
  margin: 0 0 25px;
  color: var(--accent-deep);
  font-size: 0.8rem;
  font-weight: 700;
}

.research-band {
  background: var(--forest);
  color: var(--on-forest);
}

.research-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(300px, 1.3fr);
  gap: clamp(32px, 5vw, 72px);
}

.research-layout .section-index {
  color: color-mix(in srgb, var(--accent) 70%, white);
}

.research-statement {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  line-height: 1.55;
  letter-spacing: -0.025em;
  text-align: justify;
  text-justify: inter-word;
}

.credential-list {
  border-top: 1px solid var(--line);
}

#credentials {
  padding-bottom: 55px;
}

.credential-item {
  display: grid;
  grid-template-columns: 1fr 180px 80px;
  gap: 24px;
  align-items: center;
  padding-block: 27px;
  border-bottom: 1px solid var(--line);
}

.credential-item .link-button {
  justify-self: end;
}

.personal-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 470px;
  overflow: hidden;
  direction: ltr;
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  border-radius: calc(var(--radius) * 1.4);
  background: linear-gradient(135deg, #d7edf4, #ecf4f1);
  box-shadow: var(--shadow);
  color: #2a201b;
}

#contact {
  padding-top: 35px;
  padding-bottom: 36px;
}

html[data-theme="dark"] .personal-card {
  background: linear-gradient(135deg, #24362f, #17231e);
  color: #fff7f1;
}

.personal-image {
  grid-column: 1;
}

.personal-image .media-placeholder,
.personal-image img {
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  background:
    radial-gradient(circle at 25% 35%, rgba(255,255,255,.35), transparent 20%),
    linear-gradient(145deg, #bd8067, #e4c7b3);
  color: inherit;
}

.placeholder-symbol {
  font-size: 4rem;
}

.personal-copy {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 7vw, 85px);
  direction: ltr;
  text-align: center;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.58);
  background: linear-gradient(
    145deg,
    rgba(238, 251, 255, 0.78),
    rgba(205, 233, 239, 0.58)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  color: #101820;
}

.personal-copy h2 {
  line-height: 1.3;
}

html[dir="rtl"] .personal-copy {
  direction: rtl;
}

html[data-theme="dark"] .personal-copy {
  border-inline-start-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(
    145deg,
    rgba(37, 54, 47, 0.76),
    rgba(20, 31, 26, 0.62)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #f2f3ee;
}

.site-footer {
  padding-block: 52px 35px;
  background: #101512;
  color: #f2f3ee;
}

.footer-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  justify-items: center;
  text-align: center;
}

.site-footer h2 {
  max-width: 620px;
  margin-inline: auto;
  line-height: 1.2;
}

.site-footer p:not(.eyebrow) {
  max-width: 600px;
  margin-inline: auto;
  color: #aeb6b0;
}

.footer-links {
  justify-content: center;
}

.footer-actions {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.footer-secondary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  color: #7f8b84;
  font-size: 0.76rem;
}

.footer-secondary a {
  color: #aeb6b0;
  text-decoration: none;
  text-underline-offset: 4px;
}

.footer-secondary a:hover,
.footer-secondary a:focus-visible {
  color: #f2f3ee;
  text-decoration: underline;
}

.personal-copy .footer-actions {
  justify-items: center;
  margin-top: 30px;
}

.personal-copy .footer-links,
.personal-copy .footer-secondary {
  justify-content: center;
}

.personal-copy .footer-secondary,
.personal-copy .footer-secondary a {
  color: color-mix(in srgb, currentColor 76%, transparent);
}

.personal-copy .footer-secondary a:hover,
.personal-copy .footer-secondary a:focus-visible {
  color: var(--accent-deep);
}

.site-footer .link-button {
  border-color: #344039;
  background: #19201c;
  color: #f2f3ee;
}

.site-footer .link-button:hover,
.site-footer .link-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 0;
  padding-top: 25px;
  border-top: 1px solid #344039;
  color: #8f9b94;
  font-size: 0.75rem;
}

.footer-bottom a {
  text-decoration: none;
}

.reveal {
  animation: reveal 600ms ease both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 850px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .desktop-nav {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: 70px;
  }

  .hero-copy {
    order: 2;
  }

  .portrait-frame {
    width: min(390px, 88%);
    margin-inline: auto;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .research-layout,
  .personal-card,
  .footer-layout {
    grid-template-columns: 1fr;
  }

  .personal-image,
  .personal-copy {
    grid-column: 1;
  }

  .credential-item {
    grid-template-columns: 1fr auto;
  }

  .credential-item .item-meta {
    grid-column: 1;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 30px, 1160px);
  }

  .header-inner {
    min-height: 66px;
  }

  .wordmark > span:last-child {
    display: none;
  }

  .hero h1 {
    font-size: clamp(3.1rem, 17vw, 5rem);
  }

  .section {
    padding-block: 78px;
  }

  #credentials {
    padding-bottom: 38px;
  }

  #contact {
    padding-top: 22px;
    padding-bottom: 30px;
  }

  .site-footer {
    padding-top: 46px;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .timeline-item {
    grid-template-columns: 1fr auto;
    gap: 10px 20px;
  }

  .timeline-item > div {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .education-card {
    grid-template-columns: 72px 1fr;
    padding: 20px;
    gap: 18px;
  }

  .logo-box {
    width: 64px;
    padding: 9px;
  }

  .education-card > .item-meta {
    grid-column: 2;
  }

  .credential-item {
    grid-template-columns: 1fr;
  }

  .credential-item .link-button {
    justify-self: start;
  }

  .personal-copy {
    padding: 38px 28px 46px;
  }

  .footer-links {
    justify-content: center;
  }

  .footer-bottom {
    gap: 20px;
  }
}
