/* Homepage profile layout — layered on top of main.css */

/* ---------- Hero ---------- */
.hero {
  min-height: auto;
  padding-block: calc(var(--header-h) + 3.5rem) var(--space-2xl);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero-sub {
  margin-bottom: var(--space-md);
  color: #cbd5e1;
}

.hero-bio {
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 var(--space-lg);
  animation: fade-up 1s ease 0.16s both;
}

.hero-toolbar {
  margin-bottom: var(--space-md);
}

.hero-links {
  animation: fade-up 1.1s ease 0.22s both;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(148, 163, 184, 0.08);
  color: #cbd5e1;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

/* Profile card */
.profile-card {
  position: relative;
  padding: 1.6rem;
  border-radius: 26px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(167, 139, 250, 0.16), transparent 60%),
    radial-gradient(380px 220px at 0% 100%, rgba(56, 189, 248, 0.12), transparent 60%),
    linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(10, 15, 30, 0.82));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: fade-up 1s ease 0.2s both;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.avatar {
  position: relative;
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), #f472b6, var(--accent));
}

.avatar span,
.avatar img {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0b1222;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  color: #e0f2fe;
  object-fit: cover;
}

.avatar img {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
}

.profile-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.profile-role {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.affil-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.affil-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.affil-list b {
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
}

.affil-list a {
  display: block;
  direction: ltr;
  text-align: start;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  overflow-wrap: anywhere;
}

body.rtl .affil-list a {
  text-align: end;
}

.affil-list a:hover {
  color: var(--accent);
}

.affil-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.affil-badge.sharif {
  color: #ddd6fe;
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.28);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.profile-stats a {
  text-decoration: none;
  color: var(--text);
  text-align: center;
  padding: 0.75rem 0.4rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(2, 6, 23, 0.35);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.profile-stats a:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
}

.profile-stats b {
  display: block;
  font-size: 1.6rem;
  line-height: 1.1;
  font-weight: 800;
  background: linear-gradient(120deg, #e0f2fe, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.profile-stats small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.profile-focus-title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

body.rtl .profile-focus-title {
  letter-spacing: 0;
  font-size: 0.8rem;
}

.profile-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.focus-chip {
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

/* ---------- Section heads ---------- */
.section-head h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-head h2::before {
  content: "";
  width: 6px;
  height: 1.05em;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  flex: none;
}

/* ---------- Highlights ---------- */
.spotlight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

a.spotlight-card {
  display: block;
  color: inherit;
  text-decoration: none;
  padding-bottom: 2.6rem;
}

.spotlight-card.is-new {
  border-color: rgba(52, 211, 153, 0.28);
  background:
    radial-gradient(400px 160px at 100% 0%, rgba(52, 211, 153, 0.12), transparent 60%),
    linear-gradient(155deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.55));
}

@media (min-width: 641px) {
  .spotlight-card.featured {
    grid-column: span 2;
  }
}

.spotlight-card.has-image {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  align-items: center;
  padding: 0;
}

.spot-media {
  display: block;
  height: 100%;
  min-height: 240px;
  overflow: hidden;
  border-start-start-radius: inherit;
  border-end-start-radius: inherit;
}

.spot-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform 0.6s ease;
}

a.spotlight-card:hover .spot-media img {
  transform: scale(1.04);
}

.spot-body {
  display: block;
  padding: 1.75rem 1.75rem 2.6rem 0;
}

body.rtl .spot-body {
  padding: 1.75rem 0 2.6rem 1.75rem;
}

.spotlight-card.has-image h3 {
  font-size: var(--step-3);
}

@media (max-width: 640px) {
  .spotlight-card.has-image {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .spot-media {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-radius: 0;
  }
  .spot-media img {
    object-position: center top;
  }
  .spot-body,
  body.rtl .spot-body {
    padding: 1.4rem 1.5rem 2.6rem;
  }
}

.spotlight-card.is-new .tag {
  color: var(--success);
}

.card-arrow {
  position: absolute;
  inset-inline-end: 1.4rem;
  bottom: 1.1rem;
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.25s ease;
}

body.rtl .card-arrow,
body.rtl .hub-cta .arrow {
  transform: scaleX(-1);
}

a.spotlight-card:hover .card-arrow {
  transform: translateX(4px);
}

body.rtl a.spotlight-card:hover .card-arrow {
  transform: scaleX(-1) translateX(4px);
}

/* ---------- Research ---------- */
.research-layout {
  width: min(var(--max), 100% - 2rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.research-layout .subsection-title,
.research-layout .interest-panel,
.research-layout .scholar-strip,
.research-layout .publications-list {
  width: 100%;
  margin-inline: 0;
}

.research-layout .subsection-title:first-child {
  margin-top: 0;
}

.research-side {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

.research-side .interest-list {
  justify-content: flex-start;
}

.scholar-strip-inner {
  gap: 1rem;
}

.scholar-strip-inner p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.pub-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.pub-item::before {
  display: none !important;
}

.pub-year {
  flex: none;
  min-width: 3.2rem;
  margin-top: 0.15rem;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.22);
}

.pub-main {
  flex: 1;
  min-width: 0;
}

/* ---------- Teaching hubs ---------- */
.hubs-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: var(--space-md);
}

.hub-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  background:
    radial-gradient(360px 160px at 0% 0%, rgba(167, 139, 250, 0.14), transparent 60%),
    linear-gradient(155deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.6));
}

.hub-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: var(--space-md);
  border-radius: 14px;
  font-size: 1.3rem;
  color: #ddd6fe;
  background: rgba(167, 139, 250, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.28);
}

.hub-card h3 {
  margin: 0 0 var(--space-xs);
  font-size: var(--step-1);
}

.hub-card p {
  margin: 0 0 var(--space-md);
  color: var(--muted);
  font-size: var(--step--1);
  flex: 1;
}

.hub-cta {
  color: var(--accent);
  font-weight: 650;
  font-size: var(--step--1);
}

.hub-cta .arrow {
  display: inline-block;
}

/* ---------- Courses ---------- */
.teaching-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.course-card {
  display: flex;
  flex-direction: column;
}

.course-card h3 {
  font-size: var(--step-1);
  line-height: 1.35;
}

.course-card p {
  flex: 1;
}

.course-card .course-link {
  margin-top: var(--space-sm);
}

.icon-dl .course-icon::after {
  content: "";
  position: absolute;
  inset: 10px;
  background:
    radial-gradient(circle, var(--accent) 2.5px, transparent 3px) 0 0 / 50% 50%;
}

.icon-gen .course-icon {
  background: rgba(244, 114, 182, 0.12);
  border-color: rgba(244, 114, 182, 0.25);
}

.icon-gen .course-icon::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: conic-gradient(#f472b6, var(--accent-2), var(--accent), #f472b6);
  opacity: 0.85;
}

/* ---------- Simulators ---------- */
.apps-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-card {
  display: flex;
  flex-direction: column;
}

.app-card p {
  flex: 1;
}

.app-card .btn-ghost {
  align-self: flex-start;
}

.app-card.featured {
  grid-column: span 2;
  padding-top: 0;
  border-color: rgba(56, 189, 248, 0.28);
  background:
    radial-gradient(600px 260px at 100% 0%, rgba(56, 189, 248, 0.14), transparent 60%),
    linear-gradient(155deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.6));
}

.app-card.featured h3 {
  font-size: var(--step-3);
}

.app-card.featured p {
  font-size: var(--step-0);
  max-width: 56ch;
  flex: 0 1 auto;
}

.app-card.featured .btn-ghost {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #0f172a;
  border-color: transparent;
  border-radius: 999px;
  padding-inline: 1.5rem;
}

.app-art {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  margin: 0 calc(-1 * var(--space-lg)) var(--space-md);
  padding: 1.5rem var(--space-lg) 0;
  border-bottom: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.5));
  overflow: hidden;
}

.app-art i {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #f472b6, #a78bfa 45%, #38bdf8);
  opacity: 0.85;
  animation: eq 2.4s ease-in-out infinite alternate;
  height: 40%;
}

.app-art i:nth-child(2n) { animation-duration: 1.9s; }
.app-art i:nth-child(3n) { animation-duration: 2.8s; }
.app-art i:nth-child(1) { animation-delay: -0.2s; }
.app-art i:nth-child(2) { animation-delay: -1.1s; }
.app-art i:nth-child(3) { animation-delay: -0.6s; }
.app-art i:nth-child(4) { animation-delay: -1.7s; }
.app-art i:nth-child(5) { animation-delay: -0.9s; }
.app-art i:nth-child(6) { animation-delay: -2.1s; }
.app-art i:nth-child(7) { animation-delay: -0.4s; }
.app-art i:nth-child(8) { animation-delay: -1.4s; }
.app-art i:nth-child(9) { animation-delay: -0.1s; }
.app-art i:nth-child(10) { animation-delay: -1.9s; }
.app-art i:nth-child(11) { animation-delay: -0.7s; }
.app-art i:nth-child(12) { animation-delay: -1.2s; }

@keyframes eq {
  0% { height: 18%; }
  50% { height: 88%; }
  100% { height: 42%; }
}

@media (prefers-reduced-motion: reduce) {
  .app-art i { animation: none; height: 60%; }
}

.app-card.featured .app-top {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  margin: 0;
}

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

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  color: inherit;
  text-decoration: none;
}

.contact-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.22);
}

.contact-icon svg {
  width: 20px;
  height: 20px;
}

.contact-text {
  min-width: 0;
}

.contact-text b {
  display: block;
  font-weight: 650;
}

.contact-text small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--stroke);
  margin-top: var(--space-xl);
  padding: var(--space-xl) 0 var(--space-lg);
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.6));
}

.footer-grid {
  width: min(var(--max), 100% - 2rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr;
  gap: var(--space-xl);
}

.footer-brand .brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.footer-brand p {
  color: var(--muted);
  font-size: var(--step--1);
  margin: var(--space-sm) 0 0;
  max-width: 42ch;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-col h4 {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

body.rtl .footer-col h4 {
  letter-spacing: 0;
}

.footer-col a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: var(--step--1);
  width: fit-content;
}

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

.site-footer .footer-copy {
  width: min(var(--max), 100% - 2rem);
  margin: var(--space-xl) auto 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid,
  .research-layout {
    grid-template-columns: 1fr;
  }
  .profile-card {
    max-width: 560px;
  }
  .research-side {
    position: static;
  }
  .spotlight-grid,
  .apps-grid,
  .contact-grid,
  .hubs-grid,
  .teaching-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: calc(var(--header-h) + 2rem);
  }
  .spotlight-grid,
  .apps-grid,
  .contact-grid,
  .hubs-grid,
  .teaching-grid {
    grid-template-columns: 1fr;
  }
  .app-card.featured {
    grid-column: auto;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .profile-card {
    padding: 1.2rem;
  }
  .float-nav {
    display: none;
  }
}
