/* ===== Tokens ===== */
:root {
  --navy: #102a43;
  --navy-2: #16385a;
  --gold: #c69749;
  --gold-soft: #d8b878;
  --ink: #1a2733;
  --muted: #5b6b7b;
  --bg: #faf8f4;
  --surface: #ffffff;
  --line: #e7e1d6;
  --shadow: 0 18px 40px -24px rgba(16, 42, 67, 0.45);
  --radius: 16px;
  --maxw: 1140px;
  --font-display: "Cormorant Garamond", "IBM Plex Sans Arabic", Georgia, serif;
  --font-body: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif;
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }

/* ===== Bilingual visibility ===== */
.t-ar { display: none; }
html[lang="ar"] .t-ar { display: revert; }
html[lang="ar"] .t-en { display: none; }
html[lang="ar"] {
  /* IBM Plex Sans Arabic for all Arabic text (and embedded Latin terms) */
  --font-display: "IBM Plex Sans Arabic", "Cormorant Garamond", serif;
  --font-body: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif;
}
html[lang="ar"] body { font-weight: 400; letter-spacing: 0; }

/* ===== Typography ===== */
.hero-title, .section-title, .brand-name, h3 { font-family: var(--font-display); }
.section-title { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.12; font-weight: 600; color: var(--navy); letter-spacing: .2px; }
html[lang="ar"] .section-title, html[lang="ar"] .hero-title { line-height: 1.3; }

.eyebrow, .section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: .74rem;
  font-weight: 600;
  color: var(--gold);
}
html[lang="ar"] .eyebrow, html[lang="ar"] .section-eyebrow { letter-spacing: 0; font-size: .92rem; }

/* ===== Header ===== */
.site-header {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 50;
  transition: background .35s ease, box-shadow .35s ease, padding .35s ease;
  padding-block: 1.25rem;
}
.site-header.scrolled {
  background: rgba(250, 248, 244, .9);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
  padding-block: .7rem;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; }
.brand-mark {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  background: var(--navy); color: var(--gold);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
}
.brand-name { font-size: 1.18rem; color: var(--navy); white-space: nowrap; }
.site-header:not(.scrolled) .brand-name,
.hero .brand { }

.nav { display: flex; align-items: center; gap: 1.7rem; }
.nav > a { font-size: .94rem; font-weight: 500; color: var(--ink); position: relative; padding-block: .2rem; }
.nav > a::after {
  content: ""; position: absolute; inset-block-end: -2px; inset-inline-start: 0;
  width: 0; height: 2px; background: var(--gold); transition: width .25s ease;
}
.nav > a:hover { color: var(--navy); }
.nav > a:hover::after { width: 100%; }

.lang-toggle {
  font-family: var(--font-body);
  border: 1px solid var(--navy); background: transparent; color: var(--navy);
  padding: .42rem 1rem; border-radius: 999px; cursor: pointer;
  font-size: .85rem; font-weight: 600; transition: all .22s ease;
}
.lang-toggle:hover { background: var(--navy); color: #fff; }

.menu-btn { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.menu-btn span { width: 24px; height: 2px; background: var(--navy); transition: .3s; border-radius: 2px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .82rem 1.6rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--navy-2); transform: translateY(-2px); }
.btn-ghost { border-color: var(--navy); color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; transform: translateY(-2px); }

/* ===== Hero ===== */
.hero {
  position: relative; padding-block: clamp(7rem, 14vh, 11rem) clamp(3rem, 8vh, 6rem);
  background:
    radial-gradient(circle at 85% 10%, rgba(198,151,73,.10), transparent 45%),
    linear-gradient(180deg, #fff 0%, var(--bg) 100%);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero-title { font-size: clamp(2.6rem, 6.5vw, 4.6rem); font-weight: 700; color: var(--navy); line-height: 1.02; margin-block: .5rem .9rem; }
.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 46ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-media { position: relative; }
.hero-media img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top center;
  border-radius: 22px; box-shadow: var(--shadow);
}
.hero-media::before {
  content: ""; position: absolute; inset-block-start: -16px; inset-inline-end: -16px;
  width: 60%; height: 60%; border: 2px solid var(--gold); border-radius: 22px; z-index: -1;
}
.hero-badge {
  position: absolute; inset-block-end: 18px; inset-inline-start: 18px;
  background: rgba(16,42,67,.92); color: #fff; backdrop-filter: blur(4px);
  padding: .6rem 1.1rem; border-radius: 999px; font-size: .86rem; font-weight: 600;
  box-shadow: var(--shadow);
}

/* ===== Sections ===== */
.section { padding-block: clamp(4rem, 9vh, 7rem); }
.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-eyebrow { margin-bottom: .6rem; }
.section-title + .lead, .lead { font-size: 1.12rem; color: var(--muted); }
.section .lead { margin-top: 1rem; }

/* ===== About ===== */
.about { background: var(--surface); border-block: 1px solid var(--line); }
.about-inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.about-media img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow); }
.about-text .section-title { margin-block: .4rem 1.2rem; }
.about-text p + p { margin-top: 1rem; }
.facts { margin-top: 2rem; display: grid; gap: .9rem; }
.facts li { display: flex; gap: 1rem; align-items: baseline; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.fact-k { flex: none; width: 130px; color: var(--gold); font-weight: 600; font-size: .9rem; text-transform: uppercase; letter-spacing: 1px; }
html[lang="ar"] .fact-k { text-transform: none; letter-spacing: 0; }
.fact-v { color: var(--ink); font-weight: 500; }

/* ===== Research cards ===== */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem 1.5rem; position: relative; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--gold-soft); }
.card-num { font-family: var(--font-display); font-size: 1.05rem; color: var(--gold); font-weight: 700; }
.card h3 { font-size: 1.32rem; color: var(--navy); margin-block: .5rem .6rem; font-weight: 600; line-height: 1.2; }
.card p { font-size: .95rem; color: var(--muted); }

.research-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-top: 3rem; }
.research-photos figure { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.research-photos img { width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 30%; transition: transform .5s ease; }
.research-photos figure:nth-child(1) img { object-position: center 62%; }
.research-photos figure:hover img { transform: scale(1.04); }
.research-photos figcaption {
  position: absolute; inset-block-end: 0; inset-inline: 0;
  background: linear-gradient(transparent, rgba(16,42,67,.85));
  color: #fff; padding: 1.6rem 1.2rem .9rem; font-weight: 600; font-size: .95rem;
}

/* ===== Publications ===== */
.publications { background: var(--surface); border-block: 1px solid var(--line); }
.pub-list { display: grid; gap: 0; }
.pub { display: flex; gap: 1.6rem; padding-block: 1.6rem; border-bottom: 1px solid var(--line); align-items: flex-start; }
.pub:first-child { padding-top: 0; }
.pub-year {
  flex: none; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  color: var(--gold); width: 64px; line-height: 1.4;
}
.pub-body h3 { font-size: 1.3rem; color: var(--navy); font-weight: 600; line-height: 1.25; }
.pub-venue { color: var(--muted); font-size: .96rem; margin-top: .35rem; }
.pub-link { display: inline-block; margin-top: .55rem; color: var(--navy); font-weight: 600; font-size: .9rem; border-bottom: 2px solid var(--gold); padding-bottom: 1px; transition: color .2s; }
.pub-link:hover { color: var(--gold); }
.pub-more { margin-top: 2.5rem; }

/* ===== Gallery ===== */
.grid-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.g-item { border: 0; padding: 0; background: none; cursor: pointer; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 3 / 4; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.g-item:hover img { transform: scale(1.06); }

/* ===== Contact ===== */
.contact { background: var(--navy); color: #fff; }
.contact-inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.contact .section-title { color: #fff; }
.contact .section-eyebrow { color: var(--gold-soft); }
.contact .lead { color: rgba(255,255,255,.8); }
.contact-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top center; border-radius: 20px; box-shadow: var(--shadow); }
.contact-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.contact-link {
  display: inline-flex; align-items: center; gap: .7rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  padding: .8rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: background .22s ease, transform .22s ease, border-color .22s;
}
.contact-link:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); transform: translateY(-2px); }
.contact-link .ci { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.15); font-size: .8rem; font-weight: 700; }
.contact-link:hover .ci { background: rgba(16,42,67,.15); }

/* ===== Footer ===== */
.site-footer { background: #0b2034; color: rgba(255,255,255,.7); padding-block: 2rem; font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-note { color: rgba(255,255,255,.45); }

/* ===== Lightbox ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(11,32,52,.94);
  display: none; align-items: center; justify-content: center; padding: 2rem;
  opacity: 0; transition: opacity .25s ease;
}
.lightbox.open { display: flex; opacity: 1; }
.lightbox img { max-width: 90vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lightbox-close {
  position: absolute; inset-block-start: 1.2rem; inset-inline-end: 1.6rem;
  background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; line-height: 1;
}

/* ===== Reveal animation (only when JS is active; content shows by default) ===== */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner, .about-inner, .contact-inner { grid-template-columns: 1fr; }
  .about-media, .contact-media { max-width: 360px; }
  .hero-media { order: -1; max-width: 380px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .research-photos { grid-template-columns: 1fr; }
  .grid-gallery { grid-template-columns: repeat(2, 1fr); }

  .menu-btn { display: flex; }
  .nav {
    position: fixed; inset-block-start: 0; inset-inline-end: 0; height: 100vh; width: min(78vw, 320px);
    background: var(--surface); flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 1.6rem; padding: 2rem 2.2rem; box-shadow: var(--shadow);
    transform: translateX(110%); transition: transform .35s ease; z-index: 60;
  }
  html[dir="rtl"] .nav { transform: translateX(-110%); }
  .nav.open { transform: translateX(0); }
  .nav > a { font-size: 1.2rem; }
}
@media (max-width: 520px) {
  .cards, .grid-gallery { grid-template-columns: 1fr; }
  .brand-name { font-size: 1rem; }
  .pub { flex-direction: column; gap: .3rem; }
  .pub-year { font-size: 1.2rem; width: auto; }
  .footer-inner { flex-direction: column; text-align: center; }
}
