/* ============================================
   MOURAD EL HAMRI — Personal Academic Website
   Inspired by premium editorial aesthetics
   ============================================ */

/* --- RESET & BASE --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sage: rgba(130, 172, 181, 1);
  --sage-gradient: linear-gradient(to right, rgba(119, 169, 176, 1) 0%, rgba(142, 176, 187, 1) 50%, rgba(170, 193, 202, 1) 100%);
  --sage-dark: #9bbcc4;
  --sage-deeper: #4a7a80;
  --white: #ffffff;
  --off-white: #f5f6f1;
  --charcoal: #1a1a1a;
  --dark: #111111;
  --gray: #6b6b6b;
  --gray-light: #a0a0a0;
  --border: #c0d4da;
  --font-serif: 'Cormorant Garamond', 'Georgia', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  --spacing-xxl: 8rem;
  --letter-wide: 0.15em;
  --letter-normal: 0.03em;
  --transition: 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

strong {
  font-weight: 500;
}

/* --- HEADER --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition);
  will-change: transform;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}

.site-header.scrolled .site-logo {
  color: #0a0a0a;
}

.site-header.scrolled .menu-bar {
  background: var(--dark);
}

.site-header.scrolled .header-search {
  color: var(--gray);
}

.site-header.scrolled .header-contact-link {
  color: var(--gray);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.8rem 3.5rem;
  max-width: 1600px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 0;
}

.header-search {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition);
  padding: 0;
}

.header-search:hover {
  color: #ffffff;
}

.header-search-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: var(--letter-wide);
  font-weight: 400;
}

.menu-bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.6);
  transition: var(--transition);
}

.menu-toggle:hover .menu-bar {
  background: var(--gray);
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #ffffff;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-style: normal;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color var(--transition);
}

.header-contact-link:hover {
  color: #ffffff;
}

.header-contact-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: var(--letter-wide);
  font-weight: 400;
}

.header-icon {
  color: var(--gray);
  transition: color var(--transition);
  display: flex;
  align-items: center;
}

.header-icon:hover {
  color: var(--charcoal);
}

/* --- NAVIGATION OVERLAY --- */
/* --- NAV BACKDROP --- */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* --- NAV PANEL (sidebar) --- */
.nav-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 340px;
  max-width: 85vw;
  background: var(--white);
  z-index: 200;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  overflow-y: auto;
}

.nav-panel.active {
  transform: translateX(0);
}

.nav-close {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: var(--letter-wide);
  color: var(--charcoal);
  margin-bottom: 3rem;
  padding: 0;
}

.nav-close:hover {
  color: var(--gray);
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.nav-link {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: var(--letter-wide);
  color: var(--charcoal);
  padding: 0.85rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: color var(--transition);
  position: relative;
}

.nav-link::after {
  content: '›';
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--gray-light);
  transition: transform var(--transition), color var(--transition);
}

.nav-link:hover {
  color: var(--sage-deeper);
}

.nav-link:hover::after {
  transform: translateX(4px);
  color: var(--sage-deeper);
}

.nav-kalimat-separator {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.nav-link--kalimat {
  border-bottom: none;
}

.nav-kalimat-arabic {
  font-family: 'Aref Ruqaa Ink', 'Aref Ruqaa', 'Traditional Arabic', serif;
  font-size: 1.4rem;
  letter-spacing: 0;
  text-transform: none;
  color: #4A0E1C;
  direction: rtl;
}

.nav-link--kalimat:hover .nav-kalimat-arabic {
  color: #8B2D3A;
}

.nav-link--kalimat::after {
  content: '›';
  color: #4A0E1C;
}

/* --- HERO --- */
.hero {
  min-height: 88vh;
  background: var(--sage-gradient);
  display: flex;
  align-items: center;
  padding: var(--spacing-xxl) 3rem var(--spacing-xl);
  position: relative;
  overflow: visible;
}

.hero-content {
  max-width: 650px;
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-overline {
  font-size: 0.75rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: var(--spacing-md);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: var(--spacing-md);
}

.hero-subtitle {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.75);
  max-width: 520px;
  margin: 0 auto var(--spacing-lg);
}

.cta-link {
  font-size: 0.75rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.4);
  transition: color var(--transition), border-color var(--transition);
  display: inline-block;
}

.cta-link:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.7);
}

.cta-link--small {
  font-size: 0.7rem;
}

.hero-visual {
  position: absolute;
  right: calc(3% + 50px);
  top: 50%;
  transform: translateY(calc(-50% - 30px));
  width: 500px;
  height: 500px;
  opacity: 0.7;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  overflow: visible;
}

#otCanvas {
  width: 100%;
  height: 100%;
}

/* --- SECTIONS --- */
.section {
  padding: var(--spacing-xxl) 3rem;
  position: relative;
  z-index: 1;
}

.section--white {
  background: var(--white);
}

.section--sage {
  background: var(--sage-gradient);
}

.section--royal {
  background: #1a2a6c;
  color: #ffffff;
}

.section--royal .section-overline {
  color: rgba(255,255,255,0.6);
}

.section--royal .section-title {
  color: #ffffff;
}

.section--royal .advising-year {
  color: rgba(255,255,255,0.7);
}

.section--royal .advising-info h4 {
  color: #ffffff;
}

.section--royal .advising-info p {
  color: rgba(255,255,255,0.6);
}

.section--royal .advising-item {
  border-bottom-color: rgba(255,255,255,0.15);
}

.section--royal .advising-item:first-child {
  border-top-color: rgba(255,255,255,0.15);
}

.section--royal .advising-item {
  padding: 1.5rem 1rem;
  border-radius: 4px;
  transition: background var(--transition);
}

.section--royal .advising-item:hover {
  background: rgba(255,255,255,0.08);
}

.section--royal .pub-year {
  color: rgba(255,255,255,0.7);
}

.section--royal .pub-type {
  color: rgba(255,255,255,0.5);
}

.section--royal .pub-title {
  color: #ffffff;
}

.section--royal .pub-authors {
  color: rgba(255,255,255,0.6);
}

.section--royal .pub-meta {
  color: rgba(255,255,255,0.5);
}

.section--royal .pub-item-extended {
  border-left-color: rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 1.5rem;
  transition: background var(--transition), border-left-color var(--transition);
}

.section--royal .pub-item-extended:hover {
  background: rgba(255,255,255,0.08);
  border-left-color: rgba(255,255,255,0.4);
}

.section--royal .pub-logo-wrapper img {
  filter: grayscale(0%);
  opacity: 0.6;
  border-radius: 4px;
}

.section--royal .pub-item-extended:hover .pub-logo-wrapper img {
  filter: grayscale(0%);
  opacity: 1;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-overline {
  font-size: 0.7rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--spacing-md);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: var(--spacing-lg);
}

/* --- ABOUT --- */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--spacing-xl);
}

.about-text {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--gray);
  margin-bottom: var(--spacing-sm);
}

.about-text:last-child {
  margin-bottom: 0;
}

.about-details {
  padding-top: 0.25rem;
}

.detail-block {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border);
}

.detail-block:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.65rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.detail-block p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- RESEARCH --- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.research-card {
  background: rgba(255,255,255,0.5);
  padding: 2.5rem;
  transition: background var(--transition);
  position: relative;
}

.section--sage .research-card {
  background: rgba(255,255,255,0.45);
}

.research-card:hover {
  background: var(--sage-gradient);
}

.research-number {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  color: var(--sage-deeper);
  opacity: 0.4;
  display: block;
  margin-bottom: 1.5rem;
}

.research-card h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.research-card p {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.7;
}

/* --- RESEARCH CAROUSEL --- */
/* --- RESEARCH SPLIT LAYOUT --- */
.research-split {
  display: flex;
  height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
}

.research-split-left {
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  background: var(--white);
}

.research-split-right {
  width: 50%;
  height: 100%;
  background: #1a2e6b;
  display: flex;
  flex-direction: column;
  position: relative;
}

.research-right-img {
  width: 100%;
  flex: 1;
  object-fit: cover;
  object-position: center;
  min-height: 0;
}

.research-right-caption {
  padding: 1.5rem 2.5rem;
  background: #1a2e6b;
}

.research-right-caption p {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
}

.research-right-link {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: color var(--transition), border-color var(--transition);
}

.research-right-link:hover {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.5);
}

.research-carousel-wrapper {
  width: 100%;
  overflow: hidden;
}

.research-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
}

.research-carousel::-webkit-scrollbar {
  display: none;
}

.research-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  background: var(--white);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  aspect-ratio: 1 / 1;
  position: relative;
  box-sizing: border-box;
  padding: 3rem;
}

.research-slide h3 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 1.2rem;
  line-height: 1.25;
  color: var(--charcoal);
}

.research-slide p {
  font-size: 0.95rem;
  color: var(--gray);
  line-height: 1.8;
  max-width: 380px;
}

.research-slide-arrow {
  margin-top: 2rem;
  font-size: 1.4rem;
  color: var(--sage-deeper);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.research-slide:hover .research-slide-arrow {
  opacity: 0.6;
  transform: translateX(0);
}

/* Carousel navigation */
.research-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-top: -5rem;
  position: relative;
  z-index: 1;
}

.carousel-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--gray);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: var(--charcoal);
  border-color: var(--charcoal);
}

/* --- PUBLICATIONS --- */
.pub-year-group {
  margin-bottom: var(--spacing-lg);
}

.pub-year {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--sage-deeper);
  margin-bottom: var(--spacing-md);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pub-item {
  padding-left: 1.5rem;
  border-left: 2px solid transparent;
  transition: border-color var(--transition);
}

.pub-item:hover {
  border-left-color: var(--sage-deeper);
}

.pub-type {
  font-size: 0.65rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 0.5rem;
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.pub-meta {
  font-size: 0.8rem;
  color: var(--gray);
}

/* --- PROJECTS --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: rgba(255,255,255,0.45);
  padding: 3rem;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  background: rgba(255,255,255,0.8);
}

.project-index {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--sage-deeper);
  opacity: 0.5;
  margin-bottom: 1.5rem;
}

.project-card h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.35;
  margin-bottom: 1rem;
}

.project-card p {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex: 1;
}

/* --- TEACHING --- */
.teaching-quote {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 300;
  font-style: italic;
  color: var(--gray);
  margin-bottom: var(--spacing-xl);
  padding-left: 2rem;
  border-left: 2px solid var(--border);
  line-height: 1.5;
}

.teaching-quote cite {
  display: block;
  font-size: 0.85rem;
  font-style: normal;
  margin-top: 0.75rem;
  color: var(--gray-light);
}

.teaching-group {
  margin-bottom: var(--spacing-lg);
}

.teaching-institution {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.teaching-role {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--gray-light);
}

.teaching-list {
  display: flex;
  flex-direction: column;
}

.teaching-item {
  display: flex;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.teaching-item:first-child {
  border-top: 1px solid var(--border);
}

.teaching-level {
  font-size: 0.7rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--gray-light);
  min-width: 200px;
  flex-shrink: 0;
}

.teaching-course {
  font-size: 0.95rem;
}

/* --- ADVISING --- */
.advising-list {
  display: flex;
  flex-direction: column;
}

.advising-item {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-lg);
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.section--sage .advising-item {
  border-bottom-color: rgba(0,0,0,0.08);
}

.advising-item:first-child {
  border-top: 1px solid rgba(0,0,0,0.08);
}

.advising-year {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--sage-deeper);
  min-width: 120px;
}

.advising-info h4 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.advising-info p {
  font-size: 0.8rem;
  color: var(--gray);
}

/* --- TIMELINE / CV --- */
.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 160px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  gap: var(--spacing-lg);
  padding: 2rem 0;
  position: relative;
}

.timeline-item:not(:last-child) {
  border-bottom: none;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--gray);
  min-width: 140px;
  padding-top: 0.2rem;
  text-align: right;
  padding-right: 2rem;
}

.timeline-content {
  padding-left: 2rem;
  position: relative;
}

.timeline-content::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 0.55rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage-deeper);
}

.timeline-content h4 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
}

.timeline-content p {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.7;
}

.timeline-content em {
  font-style: italic;
  color: var(--gray);
}

/* --- FOOTER --- */
.site-footer {
  background: var(--white);
  padding: 4rem 3rem 3rem;
  text-align: center;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.footer-brand {
  display: flex;
  justify-content: center;
}

.footer-marinid {
  opacity: 0.9;
  transition: opacity var(--transition);
}

.footer-marinid:hover {
  opacity: 1;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.footer-links a {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--gray);
  text-decoration: none;
  transition: color var(--transition);
}

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

.footer-bottom {
  margin-top: 2.5rem;
  text-align: center;
}

.footer-bottom-line {
  height: 1px;
  background: var(--border);
  margin: 0 -3rem 1.5rem;
}

.footer-copyright {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: var(--letter-wide);
  color: var(--charcoal);
}

/* --- SCROLL ANIMATIONS --- */
.section-overline,
.section-title,
.about-text,
.research-card,
.pub-year-group,
.project-card,
.teaching-group,
.advising-item,
.timeline-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for grids */
.research-card:nth-child(2),
.project-card:nth-child(2) { transition-delay: 0.1s; }
.research-card:nth-child(3),
.project-card:nth-child(3) { transition-delay: 0.2s; }
.research-card:nth-child(4),
.project-card:nth-child(4) { transition-delay: 0.3s; }
.research-card:nth-child(5) { transition-delay: 0.4s; }
.research-card:nth-child(6) { transition-delay: 0.5s; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .hero-visual {
    display: none;
  }

  .research-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .research-split {
    flex-direction: column;
    height: auto;
  }

  .research-split-left {
    width: 100%;
    height: 100vh;
  }

  .research-split-right {
    width: 100%;
    height: auto;
    min-height: 50vh;
  }

  .research-slide {
    padding: 3rem;
  }

  .research-slide h3 {
    font-size: 1.6rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .timeline::before {
    display: none;
  }

  .timeline-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .timeline-date {
    text-align: left;
    padding-right: 0;
    min-width: auto;
  }

  .timeline-content::before {
    display: none;
  }

  .timeline-content {
    padding-left: 0;
  }
}

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .section {
    padding: var(--spacing-xl) 1.5rem;
  }

  .header-inner {
    padding: 1.25rem 1.5rem;
  }

  .header-actions .header-icon:not(:first-child) {
    display: none;
  }

  .header-search-label,
  .header-contact-label {
    display: none;
  }

  .header-left {
    gap: 1rem;
  }

  .site-logo {
    font-size: 1.15rem;
    position: relative;
    left: auto;
    transform: none;
    font-style: normal;
  }

  .hero {
    padding: 7rem 1.5rem var(--spacing-lg);
    min-height: auto;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

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

  .research-card {
    padding: 2rem;
  }

  .research-slide {
    padding: 2rem 1.5rem;
  }

  .research-slide h3 {
    font-size: 1.35rem;
  }

  .research-carousel-nav {
    padding: 0 1.5rem 2rem;
  }

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

  .project-card {
    padding: 2rem;
  }

  .teaching-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .teaching-level {
    min-width: auto;
  }

  .teaching-quote {
    font-size: 1.2rem;
    padding-left: 1.5rem;
  }

  .advising-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .advising-year {
    min-width: auto;
  }

  .nav-panel {
    padding: 2rem 1.5rem;
  }

  .site-footer {
    padding: var(--spacing-lg) 1.5rem var(--spacing-md);
  }

  .about-text {
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

@media (max-width: 480px) {
  .header-actions {
    gap: 1rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .teaching-quote {
    font-size: 1.2rem;
  }
}

/* --- UTILITY --- */
::selection {
  background: var(--sage-dark);
  color: var(--charcoal);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--off-white);
}

::-webkit-scrollbar-thumb {
  background: var(--sage-dark);
  border-radius: 3px;
}

/* ============================================
   MULTI-PAGE ADDITIONS
   ============================================ */

/* --- PAGE TRANSITIONS --- */
body {
  animation: pageLoad 0.6s ease-out;
}
@keyframes pageLoad {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- ACTIVE NAV LINK --- */
.nav-link--active {
  color: var(--sage-deeper) !important;
}

/* --- PAGE HERO (shared across pages) --- */
.page-hero {
  background: var(--sage-gradient);
  min-height: 88vh;
  padding: 10rem 3rem 6rem;
  position: sticky;
  top: 0;
  z-index: 0;
}

.page-hero .section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.page-hero .section-overline {
  opacity: 1;
  transform: none;
}

.page-hero .section-title {
  opacity: 1;
  transform: none;
  margin-bottom: 1rem;
}

.page-hero .section-overline {
  color: rgba(255, 255, 255, 0.5);
}

.page-hero .section-title {
  color: #ffffff;
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-style: italic;
}

.page-hero-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 520px;
  line-height: 1.8;
}

/* --- ABOUT PAGE --- */
.about-page-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--spacing-xl);
  align-items: start;
}

.portrait-wrapper {
  position: sticky;
  top: 120px;
}

.portrait-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--sage-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.portrait-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}

.portrait-placeholder svg {
  width: 60px;
  height: 60px;
  color: var(--sage-deeper);
  opacity: 0.4;
}

.about-bio {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* About section — split layout like research */
.about-full {
  padding: 0;
}

.about-full .section-inner {
  max-width: none;
  padding: 0;
}

.about-full .about-page-grid {
  display: flex;
  height: 100vh;
  width: 100%;
  gap: 0;
}

.about-full .about-bio {
  flex: 0 0 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 4rem 2rem 3.5rem;
  background: var(--white);
}

.about-full .portrait-wrapper {
  flex: 0 0 50%;
  height: 100%;
  overflow: hidden;
  position: relative;
  top: 0;
}

.about-full .portrait-placeholder {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
}

.about-bio .about-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--dark);
}

.about-info-block {
  padding-bottom: 1rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.about-info-line {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--dark);
}

.about-vitae-link {
  display: block;
  margin-top: 1.2rem;
  text-align: right;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 400;
  color: var(--charcoal);
  letter-spacing: 0.02em;
  transition: color var(--transition);
}
.about-vitae-link:hover {
  color: var(--charcoal);
}

/* --- NEWS SECTION --- */
.news-section {
  background: rgba(164, 212, 245);
  padding: var(--spacing-xl) 3.5rem;
  min-height: 88vh;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

.news-inner {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.news-section .section-overline {
  color: #ffffff;
  font-weight: 500;
  margin-bottom: var(--spacing-lg);
}

.news-items {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.news-item {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.news-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.news-date {
  display: block;
  font-size: 0.7rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: #ffffff;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.news-content {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--charcoal);
}

.news-content em {
  font-style: italic;
}

.news-content strong {
  font-weight: 500;
}

.news-content em {
  font-style: italic;
}

.news-content strong {
  font-weight: 500;
}

.about-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border);
}

/* --- PUBLICATIONS PAGE (with logos) --- */
.pub-item-extended {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: 1.5rem;
  border-left: 2px solid transparent;
  border-radius: 4px;
  transition: background var(--transition), border-left-color var(--transition);
}

.pub-item-extended:hover {
  background: var(--sage-gradient);
  border-left-color: var(--sage-deeper);
}

.pub-item-content {
  flex: 1;
}

.pub-authors {
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.pub-logo-wrapper {
  flex-shrink: 0;
  width: 80px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-logo-wrapper img {
  width: 80px;
  height: 40px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.pub-item-extended:hover .pub-logo-wrapper img {
  opacity: 1;
}

/* --- RESEARCH CARDS (clickable) --- */
a.research-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

a.research-card-link .research-card {
  cursor: pointer;
  position: relative;
}

a.research-card-link .research-card::after {
  content: '→';
  position: absolute;
  bottom: 2.5rem;
  right: 2.5rem;
  font-size: 1.2rem;
  color: var(--sage-deeper);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity var(--transition), transform var(--transition);
}

a.research-card-link:hover .research-card::after {
  opacity: 0.6;
  transform: translateX(0);
}

/* --- SEARCH DROPDOWN --- */
.header-left {
  position: relative;
}

.search-dropdown {
  display: none;
  position: fixed;
  top: 86.5px;
  left: 0;
  right: 0;
  max-height: calc(70vh - 43px);
  background: var(--white);
  z-index: 99;
  overflow-y: auto;
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

.search-dropdown.active {
  display: block;
}

.search-dropdown-field {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 3.5rem;
  border-bottom: 1px solid var(--border);
  max-width: 1600px;
  margin: 0 auto;
}

.search-dropdown-field svg {
  flex-shrink: 0;
  color: var(--gray);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 300;
  background: transparent;
  color: var(--charcoal);
  letter-spacing: 0.02em;
}

.search-input::placeholder {
  color: var(--gray-light);
  font-weight: 300;
}

.search-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray);
  padding: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.search-close:hover {
  color: var(--charcoal);
}

/* Categories grid (shown before typing) */
.search-categories {
  display: flex;
  gap: 2rem;
  padding: 1.2rem 3.5rem 1rem;
  max-width: 1600px;
  margin: 0 auto;
}

.search-categories-left {
  display: flex;
  gap: 2.5rem;
  flex-shrink: 0;
}

.search-categories-right {
  flex: 1;
  min-width: 0;
  padding-left: 2.5rem;
  border-left: 1px solid var(--border);
  max-height: calc(50vh - 160px);
  overflow-y: auto;
}

.search-category {
  min-width: 0;
}

.search-category-title {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: var(--letter-wide);
  color: var(--gray);
  margin-bottom: 0.6rem;
}

.search-category a {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--charcoal);
  text-decoration: none;
  padding: 0.15rem 0;
  transition: opacity 0.15s;
}

.search-category a:hover {
  opacity: 0.5;
}

.search-cta-wrapper {
  padding: 0 3.5rem 1.2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.search-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 2rem;
  background: rgba(107, 29, 42, 0.08);
  border: 1px solid rgba(107, 29, 42, 0.15);
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: #4A0E1C;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}

.search-cta:hover {
  background: rgba(107, 29, 42, 0.14);
  border-color: rgba(107, 29, 42, 0.25);
}

.search-cta-logo {
  flex-shrink: 0;
}

.search-cta-arabic {
  font-family: 'Aref Ruqaa Ink', 'Aref Ruqaa', 'Traditional Arabic', serif;
  font-size: 1.1rem;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  direction: rtl;
}

/* Filtered results (shown when typing) */
.search-results {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.5rem 3.5rem 2rem;
}

.search-results:empty {
  display: none;
}

.search-result-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.search-result-item:hover {
  opacity: 0.5;
}

.search-result-tag {
  flex-shrink: 0;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: var(--letter-wide);
  color: var(--sage-deeper);
  min-width: 80px;
}

.search-result-body {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.3;
}

.search-result-detail {
  font-size: 0.72rem;
  color: var(--gray);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-detail mark {
  background: rgba(74, 122, 128, 0.25);
  color: var(--charcoal);
  padding: 0 2px;
  border-radius: 2px;
}

.search-no-results {
  text-align: center;
  color: var(--gray);
  font-size: 0.85rem;
  padding: 2rem 0;
}

/* Suggestion items in right panel */
.search-suggestion-item {
  display: block;
  padding: 0.45rem 0;
  text-decoration: none;
  color: var(--charcoal);
  transition: opacity 0.15s;
  border-bottom: 1px solid var(--border);
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.search-suggestion-item:hover {
  opacity: 0.5;
}

.search-suggestion-tag {
  display: none;
}

.search-suggestion-title {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 400;
}

/* --- SEARCH HIGHLIGHT ON ARRIVAL --- */
@keyframes searchHighlight {
  0% { box-shadow: 0 0 0 4px rgba(74, 122, 128, 0.7), inset 0 0 0 100px rgba(74, 122, 128, 0.15); }
  100% { box-shadow: 0 0 0 0px rgba(74, 122, 128, 0), inset 0 0 0 100px rgba(74, 122, 128, 0); }
}
.search-highlight {
  animation: searchHighlight 2.5s ease-out;
  border-radius: 6px;
}

/* --- RESEARCH SUB-PAGES --- */
.research-detail-content {
  max-width: 800px;
}

.research-detail-content p {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--gray);
  margin-bottom: var(--spacing-sm);
}

.research-detail-content h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--spacing-md);
  transition: color var(--transition);
}

.back-link:hover {
  color: #ffffff;
}

/* --- TEACHING PAGE (university cards) --- */
.teaching-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.university-card {
  background: var(--sage-gradient);
  padding: 3rem;
  transition: background var(--transition);
}

.university-card--upc {
  background: #9b3a5a;
  color: #ffffff;
}

.university-card--upc:hover {
  background: #7a1538;
}

.university-card--upc .university-role,
.university-card--upc .course-level {
  color: rgba(255,255,255,0.7);
}

.university-card--upc .university-courses li {
  border-bottom-color: rgba(255,255,255,0.15);
}

.university-card--upc .university-courses li:first-child {
  border-top-color: rgba(255,255,255,0.15);
}

.university-card--uspn {
  background: #445070;
  color: #ffffff;
}

.university-card--uspn:hover {
  background: #2d3a5c;
}

.university-card--uspn .university-role,
.university-card--uspn .course-level {
  color: rgba(255,255,255,0.7);
}

.university-card--uspn .university-courses li {
  border-bottom-color: rgba(255,255,255,0.15);
}

.university-card--uspn .university-courses li:first-child {
  border-top-color: rgba(255,255,255,0.15);
}


.university-logo {
  width: 60px;
  height: 60px;
  margin-bottom: 2rem;
  overflow: hidden;
  border-radius: 6px;
}

.university-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.university-card h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.university-role {
  font-size: 0.7rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 2rem;
  display: inline-block;
}

.university-courses {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.university-courses li {
  display: flex;
  align-items: baseline;
  padding: 0.75rem 0.75rem;
  margin: 0 -0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 0.9rem;
  cursor: default;
  user-select: text;
  -webkit-user-select: text;
  border-radius: 4px;
  transition: background 0.25s ease;
}

.university-courses li:hover {
  background: rgba(255, 255, 255, 0.12);
}

.university-courses li:first-child {
  border-top: 1px solid rgba(0,0,0,0.06);
}

.course-level {
  font-size: 0.65rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--gray-light);
  min-width: 185px;
  margin-right: 1.5rem;
  flex-shrink: 0;
}

/* --- JOURNEY PAGE (enhanced timeline) --- */
.journey-timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.journey-timeline::before {
  content: '';
  position: absolute;
  left: 180px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.journey-item {
  display: flex;
  gap: 3rem;
  padding: 2.5rem 0;
  position: relative;
}

.journey-date {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--sage-deeper);
  min-width: 160px;
  text-align: right;
  padding-right: 2rem;
  padding-top: 0.15rem;
}

.journey-content {
  padding-left: 2.5rem;
  position: relative;
  flex: 1;
}

.journey-content::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 0.5rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--sage-deeper);
}

.journey-content h4 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.journey-institution {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.6;
}

.journey-detail {
  font-size: 0.85rem;
  color: var(--gray);
  font-style: italic;
  margin-top: 0.35rem;
}

/* --- GENEALOGY PAGE --- */
.genealogy-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
}

.genealogy-card {
  display: flex;
  width: 100%;
  background: var(--off-white);
  border-left: 3px solid var(--border);
  transition: border-color var(--transition), background var(--transition);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.4s ease, background 0.4s ease;
}

.genealogy-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.genealogy-card:hover {
  border-left-color: var(--sage-deeper);
  background: var(--sage-gradient);
}

.genealogy-card--highlight {
  border-left-color: var(--sage-deeper);
  background: var(--sage-gradient);
}

.genealogy-card-year {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--sage-deeper);
  min-width: 80px;
  padding: 1.75rem 0 1.75rem 1.5rem;
  display: flex;
  align-items: flex-start;
  padding-top: 1.85rem;
}

.genealogy-card-body {
  flex: 1;
  padding: 1.75rem 2rem;
  border-left: 1px solid var(--border);
}

.genealogy-card-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.genealogy-card--highlight .genealogy-card-name {
  font-size: 1.35rem;
  color: var(--sage-deeper);
}

.genealogy-card-thesis {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 0.35rem;
}

.genealogy-card-institution {
  font-size: 0.72rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--gray-light);
}

.genealogy-stem {
  width: 1px;
  height: 24px;
  background: var(--border);
  position: relative;
}

.genealogy-stem::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage-deeper);
  opacity: 0.4;
}

/* --- CONTACT PAGE --- */
.contact-hero {
  padding: 10rem 3rem 6rem;
  min-height: 88vh;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--spacing-xl);
}

.contact-info h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: var(--spacing-md);
}

.contact-info p {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.8;
  margin-bottom: var(--spacing-sm);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.form-group {
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 300;
  color: #ffffff;
  background: transparent;
  outline: none;
  transition: border-color var(--transition);
  resize: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

.contact-form textarea {
  min-height: 150px;
}

.form-submit {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--sage);
  background: #ffffff;
  border: none;
  padding: 1rem 3rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  align-self: flex-start;
}

.form-submit:hover {
  background: rgba(255, 255, 255, 0.85);
}

.form-success {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  display: none;
}

/* --- HOME PAGE NAVIGATION GRID --- */
.home-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.home-nav-card {
  display: block;
  background: var(--white);
  padding: 2.5rem;
  text-decoration: none;
  color: inherit;
  transition: background var(--transition), transform var(--transition);
  position: relative;
}

.home-nav-card:hover {
  background: var(--sage-gradient);
  transform: translateY(-2px);
}

.home-nav-card .card-number {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  color: var(--sage-deeper);
  opacity: 0.3;
  margin-bottom: 1.5rem;
  display: block;
}

.home-nav-card h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.home-nav-card p {
  font-size: 0.8rem;
  color: var(--gray);
  line-height: 1.6;
}

/* --- MULTI-PAGE RESPONSIVE ADDITIONS --- */
@media (max-width: 1024px) {
  .about-page-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .portrait-wrapper {
    position: static;
    max-width: 400px;
  }

  .about-full .about-page-grid {
    flex-direction: column;
    height: auto;
  }

  .about-full .about-bio {
    flex: none;
    height: auto;
    padding: 3rem 1.5rem;
  }

  .about-full .portrait-wrapper {
    flex: none;
    height: 60vh;
    max-width: none;
  }

  .teaching-cards {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr !important;
  }

  .contact-hero {
    padding: 7rem 1.5rem 3rem;
    min-height: auto;
  }

  .about-details-grid {
    grid-template-columns: 1fr;
  }

  .journey-timeline::before {
    display: none;
  }

  .journey-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .journey-date {
    text-align: left;
    padding-right: 0;
    min-width: auto;
  }

  .journey-content {
    padding-left: 0;
  }

  .journey-content::before {
    display: none;
  }
}

@media (max-width: 768px) {
  .page-hero {
    padding: 7rem 1.5rem 3rem;
  }

  .home-nav-grid {
    grid-template-columns: 1fr;
  }

  .home-nav-card {
    padding: 2rem;
  }

  .pub-item-extended {
    flex-direction: column;
    gap: 1rem;
  }

  .pub-logo-wrapper {
    width: auto;
    justify-content: flex-start;
  }

  .university-card {
    padding: 2rem;
  }

  .course-level {
    min-width: 100px;
  }

  .genealogy-card {
    flex-direction: column;
  }

  .genealogy-card-year {
    min-width: auto;
    padding: 1rem 1.5rem 0;
  }

  .genealogy-card-body {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
  }

  .genealogy-card-name {
    font-size: 1rem;
  }

  .genealogy-stem {
    height: 16px;
  }
}

/* --- PAGE TRANSITION ANIMATION --- */
#pageTransitionOverlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #FAF9F6;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.tr-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.tr-kalimat-title {
  font-family: 'Aref Ruqaa Ink', 'Aref Ruqaa', 'Traditional Arabic', serif;
  font-size: 2rem;
  font-weight: 700;
  color: #4A0E1C;
  letter-spacing: 0.05em;
  opacity: 0;
}

.tr-author-name {
  font-family: 'Aref Ruqaa Ink', 'Aref Ruqaa', 'Traditional Arabic', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: #4A0E1C;
  opacity: 0;
}

#pageTransitionOverlay.active .tr-kalimat-title {
  animation: trFadeIn 0.6s ease-out 0.1s forwards;
}

#pageTransitionOverlay.active .tr-author-name {
  animation: trFadeIn 0.6s ease-out 1.8s forwards;
}

#pageTransitionOverlay.active {
  opacity: 1;
  pointer-events: all;
}

/* All shapes start invisible */
.transition-logo .tr-center,
.transition-logo .tr-frame,
.transition-logo .tr-inner,
.transition-logo .tr-star,
.transition-logo .tr-octagon {
  opacity: 0;
}

/* ── PHASE 1: Center dot + outer broken square ── */

/* Center dot pulses in */
#pageTransitionOverlay.active .tr-center {
  animation: trDotIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
}

/* 8 frame segments appear sequentially, drawing clockwise */
#pageTransitionOverlay.active .tr-f1 { animation: trSegmentDraw 0.2s ease-out 0.4s forwards; }
#pageTransitionOverlay.active .tr-f2 { animation: trSegmentDraw 0.2s ease-out 0.5s forwards; }
#pageTransitionOverlay.active .tr-f3 { animation: trSegmentDraw 0.2s ease-out 0.6s forwards; }
#pageTransitionOverlay.active .tr-f4 { animation: trSegmentDraw 0.2s ease-out 0.7s forwards; }
#pageTransitionOverlay.active .tr-f5 { animation: trSegmentDraw 0.2s ease-out 0.8s forwards; }
#pageTransitionOverlay.active .tr-f6 { animation: trSegmentDraw 0.2s ease-out 0.9s forwards; }
#pageTransitionOverlay.active .tr-f7 { animation: trSegmentDraw 0.2s ease-out 1.0s forwards; }
#pageTransitionOverlay.active .tr-f8 { animation: trSegmentDraw 0.2s ease-out 1.1s forwards; }

/* ── PHASE 2: Inner square scales in ── */
#pageTransitionOverlay.active .tr-inner {
  animation: trSquareIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1.3s forwards;
}

/* ── PHASE 3: Rotated square spins in to form the Marinid star ── */
#pageTransitionOverlay.active .tr-star {
  animation: trStarIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 1.55s forwards;
}

/* Octagon appears subtly with the star */
#pageTransitionOverlay.active .tr-octagon {
  animation: trFadeIn 0.4s ease-out 1.7s forwards;
}

/* ── KEYFRAMES ── */

@keyframes trDotIn {
  0% { opacity: 0; transform: scale(0); }
  60% { opacity: 1; transform: scale(1.8); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes trSegmentDraw {
  0% { opacity: 0; stroke-dasharray: 80; stroke-dashoffset: 80; }
  100% { opacity: 1; stroke-dasharray: 80; stroke-dashoffset: 0; }
}

@keyframes trSquareIn {
  0% { opacity: 0; transform: scale(0) rotate(0deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes trStarIn {
  0% { opacity: 0; transform: scale(0) rotate(0deg); }
  100% { opacity: 1; transform: scale(1) rotate(45deg); }
}

@keyframes trFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* ============================================
   KALIMAT PAGE — Arabic Poetry
   ============================================ */

/* Parchment background for entire page */
body.kalimat-page {
  background: #FAF9F6;
}

/* Header on kalimat page — dark text on ivory background */
body.kalimat-page .site-logo {
  color: #4A0E1C;
}

body.kalimat-page .menu-bar {
  background: #4A0E1C;
}

body.kalimat-page .header-search {
  color: #4A0E1C;
}

body.kalimat-page .header-contact-link {
  color: #4A0E1C;
}

body.kalimat-page .site-header.scrolled .site-logo {
  color: #4A0E1C;
}

body.kalimat-page .site-header.scrolled .menu-bar {
  background: #4A0E1C;
}

body.kalimat-page .site-header.scrolled .header-search {
  color: #4A0E1C;
}

body.kalimat-page .site-header.scrolled .header-contact-link {
  color: #4A0E1C;
}

/* --- Intro --- */
.kalimat-intro {
  padding: 8rem 3.5rem 0;
  background: #FAF9F6;
}

.kalimat-intro-inner {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.kalimat-intro-inner p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--dark);
  margin-bottom: 1.2rem;
}

.kalimat-intro-inner p:last-child {
  margin-bottom: 0;
}

.arabic-inline {
  font-family: 'Aref Ruqaa Ink', 'Aref Ruqaa', 'Traditional Arabic', 'Geeza Pro', 'Al Nile', 'Droid Arabic Naskh', 'Tahoma', sans-serif;
  font-size: 1.4rem;
  line-height: 1;
  unicode-bidi: isolate;
}

/* --- Poems --- */
.kalimat-poems {
  padding: var(--spacing-lg) 3.5rem;
  background: #FAF9F6;
}

.kalimat-poems-inner {
  max-width: 720px;
  margin: 0 auto;
}

.poem {
  padding: var(--spacing-lg) 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.poem:first-child {
  padding-top: 0;
}

.poem:last-child {
  border-bottom: none;
}

.poem-arabic {
  margin-bottom: 2rem;
}

.poem-arabic p {
  font-family: 'Aref Ruqaa Ink', 'Aref Ruqaa', 'Traditional Arabic', 'Geeza Pro', 'Al Nile', 'Droid Arabic Naskh', 'Tahoma', sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 2.4;
  color: #1a1a1a;
  -webkit-text-size-adjust: 100%;
}

.poem-translation {
  text-align: left;
  margin-bottom: 1.5rem;
}

.poem-translation p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--dark);
}

.poem-author {
  display: none;
}

.poem-commentary .poet-name {
  color: #4A0E1C;
  font-weight: 700;
}

.poem-commentary {
  max-width: 100%;
}

.poem-commentary p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--dark);
  margin-bottom: 1rem;
}

.poem-commentary p:last-child {
  margin-bottom: 0;
}

/* --- Back button --- */
.kalimat-back {
  padding: var(--spacing-lg) 3.5rem;
  text-align: center;
  background: #FAF9F6;
}

.kalimat-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--gray);
  text-decoration: none;
  transition: color var(--transition);
}

.kalimat-back-link:hover {
  color: var(--charcoal);
}

/* Footer on kalimat page */
body.kalimat-page .site-footer {
  background: #FAF9F6;
}

/* --- Kalimat responsive --- */
@media (max-width: 768px) {
  .kalimat-intro {
    padding: 6rem 1.5rem var(--spacing-lg);
  }
  .kalimat-poems {
    padding: var(--spacing-lg) 1.5rem;
  }
  .poem-arabic p {
    font-size: 1.2rem;
    line-height: 2.2;
  }
  .kalimat-back {
    padding: var(--spacing-md) 1.5rem;
  }
}
