/* Fonts are hosted here (no third-party request); Cairo is one variable file per script */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('assets/fonts/cairo-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('assets/fonts/cairo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('assets/fonts/cairo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/tajawal-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/tajawal-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/tajawal-500-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/tajawal-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/tajawal-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/tajawal-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --cream: #F7F2E8;
  --ink: #1E1B17;
  --wine: #6B1E2E;
  --navy: #1F2F4D;
  --green: #1B8A3F; /* Muwatin green */
  --muted: #6E6558;
  --gold: #B8801C;
  --gold-light: #E6BF6E;
  --gold-deep: #8C5F10; /* gold for text on light backgrounds (4.2:1 on sand) */
  --sand: #E9DDC8; /* first screen: a deeper tone so About reads as a new surface */
  /* Swap this stack when Muwatin's preferred display font is available */
  --font-display: 'Cairo', 'Tajawal', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Tajawal', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.8;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.3;
  margin: 0 0 0.5em;
}

a { color: inherit; }

/* Language toggle: show only the content matching body[data-lang] */
[data-i18n] { display: block; }
body[data-lang="ar"] [data-i18n="en"] { display: none; }
body[data-lang="en"] [data-i18n="ar"] { display: none; }
a[data-i18n], span[data-i18n] { display: inline-block; }

.lang-toggle {
  padding: 8px 16px;
  border: 1px solid var(--muted);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.lang-toggle:hover { color: var(--wine); border-color: var(--wine); }

/* Top bar */
.topbar {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 5vw;
  background: rgba(253, 251, 247, 0.96); /* off-white, neutral against every section */
  will-change: transform; /* its own layer, so scrolling doesn't repaint the page (see .stage) */
}
.brand-block {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark { display: block; height: 38px; width: auto; }
.brand-sub [lang="ar"] { font-size: 15px; letter-spacing: 0; }
.brand-sub {
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--navy);
}
.topbar nav { flex: 0 0 auto; display: flex; align-items: center; gap: 32px; }
.topbar-end { flex: 1 1 0; display: flex; justify-content: flex-end; }
.topbar nav a {
  text-decoration: none;
  font-size: 16px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.topbar nav a:hover { color: var(--wine); }

/* Hero: a tall section; the stage is pinned while the threads gather, then the page scrolls over it */
.hero { height: 100vh; position: relative; } /* one screen: the pinned homepage; sections scroll over it */

.stage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 0;
  height: 100vh;
  overflow: hidden;
  contain: layout paint;
  /* Its own layer, like the top bar. On standard (non-high-DPI) screens Chrome otherwise keeps
     fixed elements in the page's layer, and every scroll step repaints the whole screen
     (photos and shadows included): measured at 1366×768, that made wheel scrolling stutter. */
  will-change: transform;
}

/* The threads use the whole screen; the title sits above the cable and the dates below it */
.visual { position: absolute; inset: 0; }
#threads {
  display: block;
  width: 100%;
  height: 100%;
}

.copy-top,
.copy-bottom {
  position: absolute;
  inset-inline: 6vw;
  z-index: 1;
}
/* Title and dates hug the cable: --cable-y must match Y0 in main.js */
.stage { --cable-y: 62%; --gap: clamp(68px, 11vh, 104px); }
.copy-top { bottom: calc(100% - var(--cable-y) + var(--gap)); }
.copy-bottom { top: calc(var(--cable-y) + var(--gap)); }

.edition {
  color: var(--navy);
  font-size: 20px;
  margin: 0 0 8px;
}
.title-ar { margin: 0; }
.title-ar .accent {
  display: block;
  font-size: clamp(44px, min(5.8vw, 10vh), 96px);
  line-height: 1.1;
  color: var(--wine);
}
.title-ar span:not(.accent) {
  display: block;
  font-size: clamp(20px, min(2.4vw, 4vh), 34px);
  color: var(--ink);
  font-weight: 800;
  margin-top: 0.3em;
  line-height: 1.5;
}
.copy-en { text-align: left; }
body[data-lang="en"] .copy-top,
body[data-lang="en"] .copy-bottom {
  left: auto;
  right: 6vw;
  width: max-content;
  max-width: calc(100% - 12vw);
}
.edition-en {
  color: var(--navy);
  font-size: 20px;
  margin: 0 0 8px;
}
.title-en { margin: 0; }
.title-en .accent {
  display: block;
  font-size: clamp(40px, min(5.2vw, 9vh), 84px);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--wine);
}
.title-en span:not(.accent) {
  display: block;
  font-size: clamp(18px, min(2.2vw, 3.8vh), 30px);
  color: var(--ink);
  font-weight: 800;
  margin-top: 0.4em;
  line-height: 1.35;
}

/* Dates: under the title, in gold */
.dates {
  margin: 0.5em 0 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(20px, min(2.4vw, 4.4vh), 34px);
  line-height: 1.2;
  color: var(--gold-deep);
}

/* Content sections */
.block { padding: 80px 8vw; background: var(--cream); }
.block h2 {
  font-size: clamp(32px, 3.8vw, 56px);
  color: var(--wine);
}
.block-alt { background: var(--navy); color: var(--cream); }
.block-alt h2 { color: var(--cream); }
.lede { max-width: 680px; }

/* Accordion: smooth open/close via grid-template-rows */
.accordion { border-top: 1px solid rgba(30, 27, 23, 0.3); }
.accordion:last-child { border-bottom: 1px solid rgba(30, 27, 23, 0.3); }
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  text-align: start;
  cursor: pointer;
}
.accordion-trigger::after {
  content: "+";
  margin-inline-start: auto;
  font-size: 28px;
  line-height: 1;
  color: var(--wine);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.accordion-trigger[aria-expanded="true"]::after { transform: rotate(45deg); }
.accordion-trigger:hover { color: var(--wine); }

/* Concept note download: a large, labelled button that is obviously clickable */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 16px;
  min-height: 40px;
  background: var(--wine);
  color: #fff;
  border: 2px solid var(--wine);
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.download-btn svg { flex: none; width: 16px; height: 16px; }

/* Download button shares the expand row: trigger | button, panel below.
   The panel stays the trigger's next sibling so the accordion script still finds it. */
.accordion.has-download {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 16px;
}
.accordion.has-download > .accordion-trigger { grid-column: 1; grid-row: 1; }
.accordion.has-download > .download-btn { grid-column: 2; grid-row: 1; white-space: nowrap; }
.accordion.has-download > .accordion-panel { grid-column: 1 / -1; }
.download-btn .dl-short { display: none; }
@media (max-width: 560px) {
  .accordion.has-download > .download-btn { padding: 8px 12px; font-size: 14px; }
  .accordion.has-download > .accordion-trigger { font-size: 17px; gap: 10px; }
  .download-btn .dl-long { display: none; }
  .download-btn .dl-short { display: inline; }
}
.download-btn:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
.download-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}
.accordion-panel.open {
  grid-template-rows: 1fr;
  opacity: 1;
}
.accordion-inner { overflow: hidden; min-height: 0; }

.prose { max-width: 720px; padding: 4px 0 24px; }
.prose p { margin: 0 0 1em; }
.prose h3 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--wine);
  margin: 1.6em 0 0.5em;
}

/* Program (off-white), below the light olive Participants */
#about.block { background: var(--sand); } /* a deeper warm tone so it contrasts with the off-white homepage scrolling behind it */
#program.block { background: #FDFBF7; } /* off-white, the same as the cards */
#participants.block { background: #F0F1E4; } /* a very light olive, so the off-white cards stand out */
.stage { background: #FDFBF7; } /* first screen: off-white, the same as Programme and the cards */
#program-days { margin-top: 40px; }
.program-day-trigger { font-size: clamp(24px, 2.4vw, 28px); color: var(--wine); }

/* Participants (cream) */
.participants {
  display: grid;
  gap: 14px;
  margin-top: 40px;
}
.participant-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(30, 27, 23, 0.2);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(30, 27, 23, 0.06);
}
.person-btn {
  display: flex;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.person-btn:hover .name { color: var(--wine); }
.person-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 6px; }
.participant-card .name { margin: 0; font-weight: 700; line-height: 1.4; }

/* Abstracts (navy) */
.abstracts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.abstract-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(244, 237, 225, 0.09);
  border: 1px solid rgba(244, 237, 225, 0.32);
  border-radius: 8px;
  padding: 28px;
  scroll-margin-top: 90px;
}
.abstract-card .paper-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.45;
  color: var(--cream);
  text-align: center;
  text-wrap: balance;
}
.abstract-card .name {
  font-size: 15px;
  color: var(--gold-light);
}

/* Floating profile card */
.profile-dialog {
  border: 0;
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.profile-dialog[open] { animation: pop 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.profile-dialog::backdrop { background: rgba(30, 27, 23, 0.55); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
.profile-close {
  position: absolute;
  top: 8px;
  inset-inline-end: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.profile-close:hover { color: var(--wine); }
/* Share: beside the close button; copies the popup's own link (or opens the phone's share sheet) */
.profile-share {
  position: absolute;
  top: 8px;
  inset-inline-end: 56px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  z-index: 1;
}
.profile-share:hover, .profile-share.is-done { color: var(--wine); }
.profile-share:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.profile-share-done {
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  transform: translate(-50%, -4px);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.profile-share.is-done .profile-share-done { opacity: 1; transform: translate(-50%, 0); }
.profile-photo {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto 16px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
}
.profile-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wine);
  color: var(--cream);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 48px;
}
.profile-name { margin: 0 0 4px; font-size: 24px; color: var(--wine); }
.profile-bio { line-height: 1.75; }

main { position: relative; z-index: 1; }

footer.site-footer {
  position: relative;
  z-index: 1;
  padding: 24px 8vw;
  background: #1F2B26;
  border-top: 6px solid #C9C9C9;
  color: #E6E3DC;
  font-size: 14px;
  line-height: 1.7;
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.footer-logo img {
  display: block;
  width: 150px;
  height: auto;
  filter: brightness(0) invert(1);
}
.footer-contact { font-style: normal; }
.footer-contact p { margin: 0; }
.footer-uni {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #6CC48A;
  text-decoration: none;
}
.footer-uni:hover { text-decoration: underline; }
.footer-line { display: flex; flex-wrap: wrap; column-gap: 0; }
.footer-line > span:not(:last-child)::after { content: "·"; margin: 0 10px; opacity: .5; }
.footer-line a { color: #6CC48A; text-decoration: none; }
.footer-line a:hover { text-decoration: underline; }
.footer-side { text-align: center; max-width: 300px; }
.footer-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}
.footer-social a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid #E6E3DC;
  border-radius: 50%;
  color: #E6E3DC;
  transition: background 0.2s, color 0.2s;
}
.footer-social a:hover, .footer-social a:focus-visible { background: #E6E3DC; color: #1F2B26; }
.footer-social svg { width: 16px; height: 16px; fill: currentColor; }
.footer-copy { margin: 0; font-size: 13px; }

@media (max-width: 820px) {
  .footer-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 18px; }
  .footer-logo img { width: 140px; }
  .footer-line { justify-content: center; }
}

/* Soft reveal for content sections */
/* Sections keep a solid background (they cover the pinned hero); only their content fades in */
.reveal > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease-out, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in > * {
  opacity: 1;
  transform: none;
}

/* Reduced motion: show the finished hero without scroll-driven animation */
.hero.static { height: auto; }
.hero.static .stage { position: relative; height: 100vh; }
.reveal.static > * { opacity: 1; transform: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .accordion-panel, .accordion-trigger::after { transition: none; }
  html { scroll-behavior: auto; }
  .profile-dialog[open] { animation: none; }
}

/* Phones: title, then the threads, then the dates; no pinned scroll */
@media (max-width: 820px) {
  .topbar nav { display: none; }
  .stage {
    height: 100vh;                 /* stays fixed (from the base rule) and pinned on phones too */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 72px 6vw 40px;
  }
  .visual { position: relative; inset: auto; order: 2; height: 300px; margin-inline: -6vw; }
  .copy-top, .copy-bottom { position: static; }
  body[data-lang="en"] .copy-top,
  body[data-lang="en"] .copy-bottom { width: auto; max-width: none; }
  .copy-top { order: 1; }
  .copy-bottom { order: 3; }
  .block { padding: 64px 6vw; }
}

/* Title lines come forward out of the screen as they are revealed */
[data-reveal] { transform-origin: 100% 50%; will-change: opacity, transform; }
body[data-lang="en"] [data-reveal] { transform-origin: 0 50%; }

/* Keyboard focus */
.accordion-trigger:focus-visible,
.lang-toggle:focus-visible,
.topbar a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

@media (max-width: 960px) {
  .brand-sub { display: none; }
}

/* Participant card with a cutout photo: big name on top, photo in the bottom-left corner */
.participant-card.has-cutout {
  position: relative;
  padding: 0;
}
.has-cutout .person-btn { height: 100%; }
.has-cutout .person-btn .name {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.2;
  color: var(--wine);
}
.has-cutout .cutout {
  position: absolute;
  left: 0;
  bottom: 0;
  object-fit: cover;
  object-position: 50% 0;
  pointer-events: none;
}

/* Profile popup with a cutout: same look, larger */
.profile-dialog.has-cutout {
  position: fixed;
  text-align: start;
}
.profile-dialog.has-cutout .profile-name { font-weight: 900; }
.profile-dialog.has-cutout .profile-cutout {
  position: absolute;
  bottom: 0;
  object-fit: cover;
  object-position: 50% 0;
}

/* Photo cards: a slightly stronger outline; one column on phones */
.participant-card.has-cutout { border-color: rgba(30, 27, 23, 0.2); }
@media (max-width: 600px) { .participant-card.has-cutout { grid-column: auto; } }

/* Popup: what they will speak on takes the place of a bio */
.profile-kicker { display: block; font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--wine); margin-bottom: 4px; }

/* A little depth on the cutout photos */
.has-cutout .cutout,
.profile-dialog.has-cutout .profile-cutout { filter: drop-shadow(6px 4px 10px rgba(30, 27, 23, 0.32)); }

/* The grids keep the same order in both languages; only each card's inner alignment follows the language */
.participants, .abstracts { direction: ltr; }
body[data-lang="ar"] .participant-card, body[data-lang="ar"] .abstract-card { direction: rtl; }
body[data-lang="en"] .participant-card, body[data-lang="en"] .abstract-card { direction: ltr; }

/* Bio sits under the name, above what they will speak on; long text reads better aligned to the start */
.profile-bio { text-align: start; }

/* Person popup: name, bio, and a small "Speaking on" link to their abstract. It never scrolls: it grows wider instead. */
.profile-dialog { width: min(640px, 94vw); max-height: none; padding: 36px 32px 28px; }
.profile-bio { border-bottom: 0; padding-bottom: 0; margin: 8px 0 20px; font-size: 16px; }

/* With a cutout photo: photo on the left, text in its own column beside it, no overlap */
.profile-dialog.has-cutout {
  background:
    radial-gradient(circle at 17% 80%, rgba(107, 30, 46, 0.14) 0 22%, transparent 23%),
    linear-gradient(160deg, #EAE5DC 0%, #DDD6CA 100%);
}
@media (max-width: 640px) {
  .profile-dialog.has-cutout { background: linear-gradient(160deg, #EAE5DC 0%, #DDD6CA 100%); }
  .profile-dialog.has-cutout .profile-cutout { position: static; display: block; margin: 0 auto 12px; }
}

/* Photo size in the popup */
.profile-dialog.has-cutout .profile-cutout { width: 210px; height: 265px; left: 0; }
@media (max-width: 640px) {
  .profile-dialog.has-cutout { min-height: 0; }
  .profile-dialog.has-cutout .profile-cutout { width: 170px; height: 200px; }
}

/* Participants: slightly narrower columns, so the photo card (two columns) is less wide */
.participants { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* Photo card: the first few lines of the bio beside the photo */
.participant-card.has-cutout { background: linear-gradient(160deg, #EAE5DC 0%, #DDD6CA 100%); }
.has-cutout .person-btn .card-bio {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
  color: var(--ink);
  font-weight: 400;
}
body[data-lang="ar"] .has-cutout .card-bio[data-i18n="en"],
body[data-lang="en"] .has-cutout .card-bio[data-i18n="ar"] { display: none; }
@media (max-width: 600px) { .has-cutout .person-btn .card-bio { -webkit-line-clamp: 6; margin-left: 165px; } }

/* Participants: the script sets the columns and each card's span (photo card = one and a half cards) */
.participant-card { min-width: 0; }
.participant-card .name { overflow-wrap: anywhere; }
.has-cutout .person-btn { padding: 20px; min-height: 0; }
.has-cutout .cutout { width: 150px; height: 180px; }
.has-cutout .person-btn .card-bio { margin-left: 140px; -webkit-line-clamp: 4; font-size: 15px; }
.has-cutout .card-more {
  display: block;
  margin: 8px 0 0 140px;
  font-size: 13px;
  font-weight: 700;
  color: var(--wine);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.has-cutout .card-more [data-i18n] { display: inline; }
body[data-lang="ar"] .has-cutout .card-more [data-i18n="en"],
body[data-lang="en"] .has-cutout .card-more [data-i18n="ar"] { display: none; }

.has-cutout .person-btn .name { position: relative; z-index: 1; }

/* No decorative circles anywhere: plain backgrounds for photo cards and popups */
.participant-card.has-cutout,
.profile-dialog.has-cutout { background: linear-gradient(160deg, #EAE5DC 0%, #DDD6CA 100%); }

.profile-photo { object-position: 50% 25%; }

/* Photo cards: the name on top, then the whole photo (never cropped) in the left corner, and the bio
   wrapping around the person's outline. The photo is a float whose shape is the photo itself. */
.participant-card.has-cutout .person-btn .card-bio { display: block; margin: 0; overflow: visible; -webkit-line-clamp: unset; }
.participant-card.has-cutout .person-btn .card-more { margin: 6px 0 16px; }

/* Previous / next participant: plain chevrons on the dark backdrop, either side of the popup */
.profile-dialog { overflow: visible; }
.profile-nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 64px;
  margin-top: -32px;
  border: 0;
  background: none;
  color: var(--cream);
  font-size: 56px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity .2s, transform .2s;
}
.profile-nav:hover { opacity: 1; }
.profile-nav:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
/* Arabic: next on the left, previous on the right. English: the other way round */
body[data-lang="ar"] .profile-next, body[data-lang="en"] .profile-prev { left: -64px; }
body[data-lang="ar"] .profile-prev, body[data-lang="en"] .profile-next { right: -64px; }
@media (max-width: 760px) {
  body[data-lang="ar"] .profile-next, body[data-lang="en"] .profile-prev { left: calc(50% - 64px); }
  body[data-lang="ar"] .profile-prev, body[data-lang="en"] .profile-next { right: calc(50% - 64px); }
}
/* Phones: arrows sit in the popup's top corner, opposite the close button, so they never fall off screen */
@media (max-width: 760px) {
  .profile-nav { top: 8px; bottom: auto; margin-top: 0; width: 40px; height: 44px; font-size: 40px; color: var(--wine); opacity: 1; }
  body[data-lang="ar"] .profile-prev { right: 12px; left: auto; }
  body[data-lang="ar"] .profile-next { right: 52px; left: auto; }
  body[data-lang="en"] .profile-prev { left: 12px; right: auto; }
  body[data-lang="en"] .profile-next { left: 52px; right: auto; }
}

/* ===== Photo popup: name centered on top; text flows around the photo's outline ===== */
.profile-dialog.has-cutout { width: min(640px, 94vw); min-height: 0; padding: 28px 32px 0 0; }
.profile-dialog .profile-name { text-align: center; }
.profile-dialog.has-cutout .profile-name {
  margin: 0 0 16px;
  padding-left: 32px;
  font-size: clamp(28px, 5vw, 34px);
  line-height: 1.15;
}
.profile-body { display: flow-root; text-align: start; }
.profile-float-spacer { float: left; width: 1px; height: 0; }
.profile-dialog.has-cutout .profile-body img.profile-cutout {
  position: static;
  float: left;
  clear: left;
  display: block;
  width: auto;
  height: 270px;
  margin: 0 20px 0 0;
  object-fit: fill;
  shape-image-threshold: 0.2;
  shape-margin: 12px;
  filter: drop-shadow(6px 4px 10px rgba(30, 27, 23, 0.28));
}
.profile-dialog.has-cutout .profile-bio { margin: 0 0 20px; font-size: 16px; line-height: 1.75; }

/* "Speaking on": the paper title as a quotation, with a link to the abstract */
.profile-paper-card {
  position: relative;
  display: flow-root;
  margin: 0 0 26px;
  padding: 16px 18px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border-inline-start: 3px solid var(--green);
  color: var(--ink);
  text-decoration: none;
  text-align: start;
  transition: background .2s;
}
.profile-paper-card:hover { background: rgba(255, 255, 255, 0.85); }
.profile-paper-card .profile-kicker { display: block; }
.profile-paper-quote {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
}
.profile-paper-go { gap: 6px; }
.profile-paper-go [aria-hidden] { transition: transform .2s; }
body[data-lang="ar"] .profile-paper-card:hover .profile-paper-go [aria-hidden] { transform: translateX(-4px); }
body[data-lang="en"] .profile-paper-card:hover .profile-paper-go [aria-hidden] { transform: translateX(4px); }
/* the small popup (no photo) uses the same block, centered under the name */
.profile-dialog:not(.has-cutout) .profile-bio { text-align: start; }

/* Phones: name, then the photo, then the text (no wrapping) */
@media (max-width: 640px) {
  .profile-dialog.has-cutout { padding: 56px 20px 0; }
  .profile-dialog.has-cutout .profile-name { padding-left: 0; }
  .profile-dialog.has-cutout .profile-body img.profile-cutout { float: none; margin: 0 auto 16px; height: 220px; shape-outside: none !important; }
}

/* ===== Photo cards in Participants: name centered across the top ===== */
.has-cutout .person-btn .name {
  display: block;
  margin: 0 0 8px;
  text-align: center;
  font-size: clamp(24px, 2.2vw, 28px);
}
.participant-card.has-cutout { min-height: 255px; }
.has-cutout .person-btn .card-bio { margin-top: 0; }
/* Text keeps a margin on the left; the photo still sits flush with the edge */
.profile-dialog.has-cutout .profile-body { padding-left: 32px; }
.profile-dialog.has-cutout .profile-body img.profile-cutout { margin-left: -32px; }
@media (max-width: 640px) {
  .profile-dialog.has-cutout .profile-body { padding-left: 0; }
  .profile-dialog.has-cutout .profile-body img.profile-cutout { margin-left: auto; }
}
/* Buttons centre their content vertically by default; lay the photo card out from the top instead */
.has-cutout .person-btn { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
.has-cutout .card-more { align-self: stretch; }

/* ===== "Speaking on": no box, no quotation marks. Centered, the title in green, "More" underneath ===== */
.profile-paper-card,
.profile-paper-card:hover {
  display: block;
  margin: 8px 0 28px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  text-align: center;
  color: inherit;
  text-decoration: none;
}
.profile-paper-card .profile-kicker { margin-bottom: 4px; color: var(--muted); font-weight: 500; font-size: 13px; letter-spacing: .02em; text-align: center; }
.profile-paper-quote {
  font-size: 20px;
  line-height: 1.5;
  color: var(--navy);
  text-align: center;
  text-wrap: balance;
}
.profile-paper-go {
  display: inline-block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--wine);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(107, 30, 46, 0.35);
}
.profile-paper-card:hover .profile-paper-go { text-decoration-color: var(--wine); }
.profile-dialog:not(.has-cutout) .profile-paper-card { margin: 16px 0 0; }

/* Off-white for the participant cards and their popups */
.participant-card,
.participant-card.has-cutout,
.profile-dialog,
.profile-dialog.has-cutout { background: #FDFBF7; }

/* ===== Participants: one even grid — a single alphabetical list of photo cards and placeholder cards ===== */
#participants-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}
body[data-lang="ar"] #participants-list { direction: rtl; }
body[data-lang="en"] #participants-list { direction: ltr; }

/* Placeholder card (no photo yet): large initial + name, centred, matching a photo card's footprint */
.participant-card.is-placeholder .person-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 210px;
  padding: 26px 20px;
  text-align: center;
}
.participant-card.is-placeholder .ph-avatar {
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sand);
  color: var(--wine);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  line-height: 1;
  overflow: hidden;
}
.participant-card.is-placeholder .ph-avatar.ph-photo { object-fit: cover; object-position: 50% 25%; padding: 0; }
.participant-card.is-placeholder .name { font-size: clamp(18px, 1.6vw, 21px); font-weight: 700; line-height: 1.4; }
.participant-card.has-cutout { grid-column: auto; grid-row: auto; }

/* Footer links to the privacy policy and disclaimer */
.footer-legal { margin: 6px 0 0; font-size: 13px; }
.footer-legal a { color: #E6E3DC; text-decoration: none; }
.footer-legal a:hover { text-decoration: underline; }

/* Privacy policy and disclaimer pages */
.legal-page main.legal { min-height: 70vh; padding-top: 140px; }
.legal h1 { font-size: clamp(32px, 3.8vw, 52px); color: var(--green); }
.legal h2 { margin: 1.6em 0 0.4em; font-size: 22px; font-weight: 800; color: var(--ink); }
.legal .prose { max-width: 760px; }
.legal .prose ul { margin: 0 0 1em; padding-inline-start: 1.4em; }
.legal .prose a { color: var(--green); }
@media (max-width: 820px) { .legal-page main.legal { padding-top: 104px; } }

/* Programme: the final timetable, one row per slot as in the printed programme */
.timetable { list-style: none; margin: 0; padding: 4px 0 28px; }
.tt-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid rgba(30, 27, 23, 0.12);
}
.tt-time { font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }
.tt-body p { margin: 0; }
.tt-label { font-weight: 700; }
.tt-break .tt-label { color: var(--muted); }
.tt-lines { margin-top: 6px; color: var(--muted); font-size: 15px; }
.tt-keynote-text { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.tt-session-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 20px;
  margin-bottom: 10px;
}
.tt-session-name { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--wine); }
.tt-chair { font-size: 15px; color: var(--muted); }
.tt-chair .person-link { font-style: italic; }
.tt-papers { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tt-paper {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 30%);
  gap: 4px 24px;
  align-items: start;
}
.tt-speakers { font-weight: 700; text-align: end; }
.person-link, .tt-paper-title {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color .2s, color .2s;
}
.tt-paper-title { text-align: start; line-height: 1.6; }
.person-link:hover, .tt-paper-title:hover { text-decoration-color: currentColor; }
.person-link:hover { color: var(--wine); }
.tt-paper-title:hover { color: var(--navy); }
.person-link:focus-visible, .tt-paper-title:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 640px) {
  .tt-row { grid-template-columns: 1fr; gap: 6px; }
  .tt-paper { grid-template-columns: 1fr; }
  .tt-speakers { text-align: start; font-size: 15px; }
}

/* Abstract cards: title and speakers only; the whole card opens the abstract */
button.abstract-card { width: 100%; font: inherit; color: inherit; cursor: pointer; justify-content: center; transition: background-color .2s; }
button.abstract-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.abstract-card-inner { display: flex !important; flex-direction: column; align-items: center; gap: 12px; }
body[data-lang="ar"] .abstract-card-inner[data-i18n="en"],
body[data-lang="en"] .abstract-card-inner[data-i18n="ar"] { display: none !important; }
.abstract-card .paper-title { display: block; margin: 0; }
.abstract-card .name { display: block; margin: 0; padding: 0; border: 0; width: auto; }

/* Abstract popup: title in Muwatin green, the speakers, then the abstract */
.abstract-dialog .profile-kicker { text-align: center; }
.abstract-title { margin: 6px 0 10px; font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.45; color: var(--green); text-wrap: balance; }
.abstract-names { margin: 0 0 18px; font-weight: 700; color: var(--wine); }
.abstract-text { text-align: start; font-size: 16px; line-height: 1.8; }
.abstract-text p { margin: 0 0 12px; }
.abstract-text.is-empty { text-align: center; color: var(--muted); }
/* Arabic programme: the speakers come first (on the right), then the title, as printed */
.timetable[dir="rtl"] .tt-paper { grid-template-columns: minmax(130px, 24%) 1fr; }
.timetable[dir="rtl"] .tt-speakers { order: -1; text-align: start; }
/* Abstract cards follow the programme order, reading right to left in Arabic */
body[data-lang="ar"] .abstracts { direction: rtl; }

/* Abstracts: heading and intro centred */
#abstracts h2,
#abstracts .lede { text-align: center; margin-inline: auto; }

/* Two light sections in a row (participants, programme): a thin rule between them */
.block:not(.block-alt) + .block:not(.block-alt) { border-top: 1px solid rgba(30, 27, 23, 0.15); }

/* Concept note: heading centred, expand row and full text in a centred column */
#about h2,
#participants h2,
#program h2 { text-align: center; }
#program .lede { text-align: center; margin-inline: auto; }
#about .accordion { max-width: 820px; margin-inline: auto; border-bottom: 0; }   /* no closing rule under "Read more" */
#about .prose { max-width: none; }
#about .prose h3 { text-align: center; }
/* The opening passage is always visible; the expand row below it carries the rest */
/* Concept note: the expand / download row on top, then the opening paragraph. Until the note is
   opened, the paragraph's last lines fade out over a "Read more", so it reads as the start of a longer
   text. The script only needs the panel to stay the trigger's next sibling; the grid sets the order. */
.accordion.has-download > .concept-lede { grid-column: 1 / -1; grid-row: 2; margin: 18px 0 0; }
.accordion.has-download > .concept-more { grid-column: 1 / -1; grid-row: 3; }
.accordion.has-download > .accordion-panel { grid-row: 4; }
.concept-lede {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3.4em), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 3.4em), transparent);
}
.concept-more {
  justify-self: center;
  margin: 2px 0 22px;
  padding: 6px 14px;
  border: 0;
  background: none;
  color: var(--wine);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.concept-more::after { content: " ↓"; }
.concept-more:hover { text-decoration: underline; text-underline-offset: 4px; }
.concept-more:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
/* Once the note is open the paragraph simply runs on into the rest */
.accordion:has(> .accordion-trigger[aria-expanded="true"]) > .concept-lede { -webkit-mask-image: none; mask-image: none; }
.accordion:has(> .accordion-trigger[aria-expanded="true"]) > .concept-more { display: none; }

/* Abstract cards: solid navy (same as the section), outlined so they still read as cards */
.abstract-card,
button.abstract-card { background-color: var(--navy); border: 1px solid rgba(244, 237, 225, 0.32); }
button.abstract-card:hover { background-color: rgba(244, 237, 225, 0.08); }

/* ===== Abstract popup: a sheet of paper on the dark backdrop =====
   Long abstracts make the sheet longer and the whole view scrolls like a page (no box scrolling inside a box). */
.profile-dialog.abstract-dialog {
  position: fixed;
  top: 0;
  inset-inline: 0;
  bottom: auto;
  width: 100%;
  /* Dynamic viewport height: on phones this excludes the browser toolbars, so a long abstract
     scrolls to its end instead of the last lines hiding behind the toolbar / spilling out. */
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 7vh 96px 10vh;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: none;
}
.abstract-sheet {
  position: relative;
  width: min(720px, 100%);
  padding: 56px 64px 52px;
  border-radius: 6px;
  background: #FDFBF7;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  animation: pop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.abstract-head { text-align: center; margin-bottom: 36px; }
.abstract-head::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  margin: 28px auto 0;
  background: var(--navy);
  opacity: .55;
}
.abstract-dialog .profile-kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .06em;
}
.abstract-dialog .abstract-title {
  margin: 0 0 14px;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.45;
  color: var(--navy);
}
.abstract-dialog .abstract-names { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
.abstract-dialog .abstract-names .person-link:hover { color: var(--wine); }
.abstract-dialog .abstract-text {
  max-width: 62ch;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.9;
  color: #2B2620;
}
.abstract-dialog .abstract-text[dir="rtl"] { line-height: 2; }
.abstract-dialog .abstract-text p { margin: 0 0 1.1em; text-wrap: pretty; }
.abstract-dialog .abstract-text p:last-child { margin-bottom: 0; }
.abstract-dialog .abstract-text.is-empty { text-align: center; color: var(--muted); font-style: italic; }
.abstract-sheet .profile-close { top: 12px; inset-inline-end: 14px; }
.abstract-sheet .profile-share { top: 12px; inset-inline-end: 58px; }
/* Previous / next: fixed at the sides of the screen, so they stay put while a long abstract scrolls */
.abstract-dialog .profile-nav { position: fixed; top: 50%; color: var(--cream); }
body[data-lang="ar"] .abstract-dialog .profile-next, body[data-lang="en"] .abstract-dialog .profile-prev { left: 24px; right: auto; }
body[data-lang="ar"] .abstract-dialog .profile-prev, body[data-lang="en"] .abstract-dialog .profile-next { right: 24px; left: auto; }
@media (max-width: 760px) {
  .profile-dialog.abstract-dialog { padding: 0; }
  .abstract-sheet { width: 100%; padding: 64px 22px 40px; border-radius: 0; box-shadow: none; }
  .abstract-head { margin-bottom: 28px; }
  .abstract-dialog .abstract-text { font-size: 16px; }
  /* Phones: arrows in the sheet's top corner, opposite the close button; they scroll away with the page */
  .abstract-dialog .profile-nav { position: absolute; top: 8px; margin-top: 0; color: var(--wine); }
  body[data-lang="ar"] .abstract-dialog .profile-prev { right: 12px; left: auto; }
  body[data-lang="ar"] .abstract-dialog .profile-next { right: 52px; left: auto; }
  body[data-lang="en"] .abstract-dialog .profile-prev { left: 12px; right: auto; }
  body[data-lang="en"] .abstract-dialog .profile-next { left: 52px; right: auto; }
  body[data-lang="ar"] .abstract-sheet .profile-close { left: 12px; right: auto; }
  body[data-lang="en"] .abstract-sheet .profile-close { right: 12px; left: auto; }
}
@media (prefers-reduced-motion: reduce) { .abstract-sheet { animation: none; } }

/* Abstract sheet sits in the middle of the screen; long ones still scroll as a page */
.profile-dialog.abstract-dialog[open] { display: flex; flex-direction: column; }
.abstract-sheet { margin: auto; }
/* "Back to <name>" when the abstract was opened from someone's card */
.abstract-back {
  position: absolute;
  top: 16px;
  inset-inline-start: 20px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.abstract-back:hover { color: var(--wine); }
@media (max-width: 640px) { .abstract-back { top: 20px; inset-inline-start: 92px; } }

/* Links inside a bio (e.g. institutes): navy text, light underline */
.profile-bio a { color: var(--navy); text-decoration: underline; text-decoration-color: rgba(31, 47, 77, 0.35); text-underline-offset: 3px; }
.profile-bio a:hover { text-decoration-color: currentColor; }

/* No focus ring around the popup itself (the browser's default dark outline when the popup takes focus) */
.profile-dialog:focus,
.profile-dialog:focus-visible { outline: none; }

/* Phones: a person popup can't grow wider to avoid scrolling (the desktop trick), so when a long
   bio makes it taller than the screen, let it scroll inside the card instead of spilling off-screen.
   The abstract popup already scrolls as a full page, so it is left out. */
@media (max-width: 760px) {
  .profile-dialog:not(.abstract-dialog) { max-height: 92vh; max-height: 92dvh; overflow-y: auto; }
}

/* ================================================================
   Photo cards, final layout: the portrait sits flush in the card's
   bottom-left corner whether or not the person has a bio. The name is
   centred on top; the bio (a short snippet) wraps beside the figure.
   Earlier rules floated the photo under the name, which left a gap
   below it on bio-less cards (e.g. Santosh Kumar, Talal Shahwan).
   ================================================================ */
.participant-card.has-cutout { overflow: hidden; }
.participant-card.has-cutout .person-btn {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 255px;
  padding: 20px 20px 0;             /* no bottom padding: the photo reaches the edge */
}
.participant-card.has-cutout .person-btn .name {
  flex: none;
  margin: 0 0 10px;
  text-align: center;
}
.participant-card.has-cutout .person-btn .card-figure {
  display: flow-root;               /* its own block context, contains the float */
  margin-top: auto;                 /* pushes the photo block down to the card's bottom */
  width: 100%;
  min-height: 0;
}
.participant-card.has-cutout .person-btn .card-figure .cutout {
  position: static;
  float: left;
  width: auto;
  height: 185px;
  margin: 0 12px 0 -20px;           /* flush with the card's left edge */
  object-fit: contain;
  object-position: left bottom;
  shape-margin: 10px;
  shape-image-threshold: 0.3;       /* how much of the photo's edge counts as its outline */
  filter: drop-shadow(6px 4px 10px rgba(30, 27, 23, 0.28));
}
.participant-card.has-cutout .person-btn .card-figure .card-bio {
  display: block;
  margin: 0;
  overflow: visible;
  -webkit-line-clamp: unset;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink);
}
.participant-card.has-cutout .person-btn .card-figure .card-more {
  display: block;
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--wine);
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Talal Shahwan: the photo is trimmed to the outline and mirrored so it faces into
   the card like the others, and runs a little taller than the default to match. */
.participant-card.has-cutout .person-btn .card-figure .cutout[src*="shahwan"] { height: 205px; }

/* Download button under the Abstracts and Participants headings
   (same style as the concept-note button) */
.section-download { margin: 20px 0 0; text-align: center; }

/* Long abstracts: keep the cream sheet at its full content height so it always
   backs the text. Flexbox was shrinking it to the viewport, spilling the last
   lines onto the transparent (blurred) backdrop — the garbled band on phones. */
.abstract-sheet { flex-shrink: 0; }
@media (max-width: 760px) {
  /* Full-screen reading sheet: no vertical centring and a solid background,
     so the cream always reaches every edge whatever the abstract's length. */
  .profile-dialog.abstract-dialog,
  .profile-dialog.abstract-dialog[open] { display: block; background: #FDFBF7; }
  .abstract-sheet { margin: 0 auto; min-height: 100%; }
}

/* ================================================================
   Entrance choreography
   Each card fades up as it comes into view (the script adds .shown), so a
   card is never still blank when the reader reaches it. Cards arriving
   together ripple in, a short step apart (--d, set by the script). Once a
   card has arrived the script adds .settled, which drops the entrance
   timing so hovering answers at once. Each card enters once per visit;
   the language toggle moves cards, it doesn't replay their entrance.
   ================================================================ */
.reveal .participant-card:not(.settled),
.reveal .abstract-card:not(.settled) {
  transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0ms);
}
.reveal .participant-card:not(.shown),
.reveal .abstract-card:not(.shown) { opacity: 0; transform: translateY(20px) scale(0.98); }

/* Hover: the whole card lifts and its photo casts a longer shadow, so the
   cutout reads as standing off the card. The photo itself is never scaled —
   zooming a cutout on hover looks cheap and breaks its footing on the edge. */
.participant-card {
  transition: box-shadow 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s ease;
}
.participant-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(30, 27, 23, 0.18);
  border-color: rgba(30, 27, 23, 0.22);
}
.participant-card .cutout { transition: filter 0.35s ease; }
.participant-card:hover .cutout { filter: drop-shadow(10px 8px 16px rgba(30, 27, 23, 0.36)); }
.participant-card:hover .card-more { text-decoration-thickness: 2px; }

/* The programme rows ripple in each time a day is opened. Unlike the section
   reveal, which fires once per page load, this replays on every open, so the
   programme always answers the click with movement. */
.accordion-panel .timetable > li {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease-out, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.accordion-panel.open .timetable > li { opacity: 1; transform: none; }
.accordion-panel.open .timetable > li:nth-child(1) { transition-delay: 0.12s; }
.accordion-panel.open .timetable > li:nth-child(2) { transition-delay: 0.18s; }
.accordion-panel.open .timetable > li:nth-child(3) { transition-delay: 0.24s; }
.accordion-panel.open .timetable > li:nth-child(4) { transition-delay: 0.30s; }
.accordion-panel.open .timetable > li:nth-child(5) { transition-delay: 0.36s; }
.accordion-panel.open .timetable > li:nth-child(6) { transition-delay: 0.42s; }
.accordion-panel.open .timetable > li:nth-child(7) { transition-delay: 0.48s; }
.accordion-panel.open .timetable > li:nth-child(8) { transition-delay: 0.54s; }
.accordion-panel.open .timetable > li:nth-child(n+9) { transition-delay: 0.60s; }

/* Nothing moves for anyone who asked for less motion */
.reveal.static .participant-card,
.reveal.static .abstract-card { opacity: 1; transform: none; transition: none; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) {
  .reveal .participant-card,
  .reveal .abstract-card { opacity: 1; transform: none; transition: none; transition-delay: 0s; }
  .participant-card:hover .cutout { transform: none; }
  .participant-card:hover { transform: none; }
  .accordion-panel .timetable > li,
  .accordion-panel.open .timetable > li { opacity: 1; transform: none; transition: none; transition-delay: 0s; }
}

/* ================================================================
   Language toggle — the final say
   Only the page language's copy is ever shown, anywhere on the page.
   This is !important on purpose: the photo-card rules further up
   (.participant-card.has-cutout .person-btn .card-figure .card-bio)
   carry more specificity than the plain [data-i18n] rules near the
   top, so they were overriding them and every photo card showed the
   Arabic and the English bio at once. The doubled text also made the
   card-figure tall, which floated the photo up off the card's bottom
   edge. Keeping this last and !important means adding a new, more
   specific card rule can never re-break the toggle.
   ================================================================ */
body[data-lang="ar"] [data-i18n="en"],
body[data-lang="en"] [data-i18n="ar"] { display: none !important; }

/* ================================================================
   Accompanying activities: the book fair. The covers are the
   spotlight: a full-width strip that scrolls sideways (swipe, trackpad,
   wheel or keyboard), on the same warm sand as the concept note. Each
   end fades out while more covers wait beyond it, so they slide in and
   out of view. In Arabic the first cover sits on the right.
   ================================================================ */
#activities.block { background: var(--sand); padding: 40px 0 36px; scroll-margin-top: 72px; }
#activities > [data-i18n] { padding-inline: 8vw; }
#activities h2 { font-size: clamp(26px, 2.6vw, 38px); margin-bottom: 0.35em; }
#activities h2,
#activities .lede { text-align: center; margin-inline: auto; }
#activities .lede { max-width: 720px; margin-bottom: 0; }

/* The strip runs the full width of the screen; the first cover lines up with the text above */
.books-track {
  display: flex;
  justify-content: safe center;   /* centred on a screen wide enough for all six, otherwise from the start */
  gap: clamp(18px, 2vw, 32px);
  margin: 4px 0 0;
  padding: 22px 8vw 38px;   /* room for the cover shadows, which the scrolling strip would otherwise clip */
  list-style: none;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 8vw;
  overscroll-behavior-x: contain;
  scrollbar-width: none;           /* swipe, trackpad, wheel or keyboard; no bar under the covers */
  /* --fade-left / --fade-right are set by main.js: 0px at an end with nothing more to show */
  --fade-left: 0px;
  --fade-right: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent 100%);
}
.books-track::-webkit-scrollbar { display: none; }
body[data-lang="ar"] .books-track { direction: rtl; }
body[data-lang="en"] .books-track { direction: ltr; }
.books-track li { flex: 0 0 auto; scroll-snap-align: start; }
.books-track img {
  display: block;
  width: auto;
  /* --cover-h is set by main.js so the section fits the screen under the top bar; the covers are 380 x 420 */
  height: var(--cover-h, clamp(200px, 22vw, 300px));
  border-radius: 4px;
  box-shadow: 0 8px 18px rgba(30, 27, 23, 0.22);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}
.books-track img:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(30, 27, 23, 0.28); }
.books-track:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

@media (max-width: 640px) {
  #activities.block { padding: 36px 0 32px; }
  .books-track { gap: 14px; padding-inline: 6vw; scroll-padding-inline: 6vw; }
}
@media (prefers-reduced-motion: reduce) {
  .books-track { scroll-behavior: auto; }
  .books-track img { transition: none; }
  .books-track img:hover { transform: none; }
}

/* ================================================================
   How to attend, under the dates: three short columns (on campus,
   live stream, Zoom), each an icon, a label and one line.
   ================================================================ */
.copy-bottom,
body[data-lang="en"] .copy-bottom { left: 6vw; right: 6vw; width: auto; max-width: none; }
.attend {
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.attend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 210px;
  text-align: center;
  padding-inline-end: 20px;
  margin-inline-end: 20px;
  border-inline-end: 1px solid rgba(30, 27, 23, 0.18);
}
.attend-item:last-child { padding-inline-end: 0; margin-inline-end: 0; border-inline-end: 0; }
.attend-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  margin-bottom: 6px;
  color: var(--wine);
}
.attend-icons svg { width: 23px; height: 23px; }
/* Live stream: the two platform names side by side */
.attend-platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.attend-platforms a { display: inline-flex; align-items: center; gap: 6px; }
.attend-label { font-weight: 800; font-size: 15px; color: var(--ink); }
a.attend-label { text-decoration: none; }
a.attend-label:hover { color: var(--wine); }
.attend-detail { font-size: 14px; line-height: 1.45; color: var(--muted); }
a.attend-detail,
.attend-detail a { color: inherit; text-decoration: underline; text-decoration-color: rgba(107, 30, 46, 0.35); text-underline-offset: 3px; }
a.attend-detail:hover,
.attend-detail a:hover { color: var(--wine); text-decoration-color: currentColor; }
.attend a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

@media (max-width: 820px) {
  .attend { margin-top: 4px; }
  .attend-item { flex: 1 1 0; min-width: 0; padding-inline-end: 12px; margin-inline-end: 12px; }
  .attend-label { font-size: 14px; }
  .attend-detail { font-size: 13px; }
}
/* Short laptop screens: keep the row inside the first screen */
@media (min-width: 821px) and (max-height: 640px) {
  .attend-icons { margin-bottom: 3px; }
  .attend-detail { line-height: 1.3; }
}
@media (min-width: 821px) and (max-height: 540px) {
  .attend-detail { display: none; }
}
