/* ============================================================
   m-rami.org — site stylesheet
   Palette: Nile blue, river teal, Egyptian sand, warm paper.
   Edit the variables below to re-theme the whole site.
   ============================================================ */

:root {
  --paper: #FBFAF7;   /* page background */
  --card:  #FFFFFF;   /* card background */
  --mist:  #EFF4F6;   /* tinted section band */
  --ink:   #1D2B35;   /* main text */
  --muted: #56646E;   /* secondary text */
  --nile:  #0B4D6E;   /* deep Nile blue — headings, footer */
  --river: #10739A;   /* links, accents */
  --sand:  #B3934F;   /* Egyptian sand-gold — small accents only */
  --line:  #DEE5E8;   /* hairlines and borders */
  --radius: 12px;
  --wrap: 1060px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .stat b {
  font-family: "Marcellus", "Palatino Linotype", Georgia, serif;
  font-weight: 400;
  color: var(--nile);
  line-height: 1.18;
  margin: 0 0 .4em;
}
h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); letter-spacing: .01em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; color: var(--ink); }

p { margin: 0 0 1em; }
a { color: var(--river); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--river); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

/* ---------- Eyebrow labels ---------- */
.eyebrow {
  display: block;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: .55em;
}

/* ---------- Header / navigation ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px;
}
.brand { font-size: 1.05rem; color: var(--nile); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .95rem; }
.site-nav a { color: var(--ink); padding: 4px 2px; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--river); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--nile); border-bottom-color: var(--sand); }
.site-nav a.ext::after { content: " \2197"; color: var(--sand); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 48px; }
.hero .wrap { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: center; }
.hero .role { font-size: 1.12rem; color: var(--muted); margin: .2em 0 1em; }
.hero .lede { max-width: 56ch; }
.portrait {
  width: 100%; max-width: 340px; justify-self: end;
  align-self: start; height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  outline: 6px solid #fff;
  box-shadow: 0 14px 34px rgba(11, 77, 110, .14);
}

/* Signature flow-line under the name */
.flowline { width: min(340px, 80%); height: 26px; display: block; margin: 6px 0 14px; }
.flowline path { stroke-dasharray: 460; stroke-dashoffset: 460; animation: draw 1.6s ease-out forwards; }
.flowline path:nth-child(2) { animation-delay: .25s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .flowline path { animation: none; stroke-dashoffset: 0; }
  html { scroll-behavior: auto; }
}

/* Profile chips (ORCID, Scholar, …) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding: 0; list-style: none; }
.chips a {
  display: inline-block; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); font-size: .88rem;
}
.chips a:hover { border-color: var(--sand); color: var(--nile); text-decoration: none; }

/* ---------- Key facts strip ---------- */
.facts { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.facts .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-top: 26px; padding-bottom: 26px; }
.stat b { display: block; font-size: 1.9rem; color: var(--nile); }
.stat span { font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Sections ---------- */
section { padding: 58px 0; }
section.tint { background: var(--mist); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 28px; }

/* Flow divider between plain sections */
.divider {
  height: 30px; margin: 0 auto; max-width: var(--wrap);
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 30"><path d="M0 15c20-14 40 14 60 0s40 14 60 0 40 14 60 0 40 14 60 0 40 14 60 0" fill="none" stroke="%23B3934F" stroke-width="1.6" opacity="0.7"/><path d="M0 22c20-14 40 14 60 0s40 14 60 0 40 14 60 0 40 14 60 0 40 14 60 0" fill="none" stroke="%230B4D6E" stroke-width="1.2" opacity="0.35"/></svg>') center / 320px 30px no-repeat;
}

/* ---------- Cards ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 22px 18px;
}
.card h3 { margin-top: 0; }
.card .meta { font-size: .86rem; color: var(--muted); margin: -2px 0 10px; }
.card p:last-child { margin-bottom: 0; }
.card .amount { color: var(--sand); font-weight: 600; }

/* Feature card (WSJ archive, calls to action) */
.card.feature { border-left: 4px solid var(--sand); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 18px; }
.timeline li:last-child { padding-bottom: 4px; }
.timeline li::before {
  content: ""; position: absolute; left: -29px; top: .42em;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--sand); border: 2px solid var(--paper);
}
.timeline b { color: var(--nile); }
.timeline .meta { color: var(--muted); font-size: .92rem; }

/* ---------- Generic lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 0 0 10px 22px; position: relative; }
.list li::before { content: "\2013"; position: absolute; left: 0; color: var(--sand); }

/* ---------- Publications ---------- */
.pubs { list-style: none; margin: 0; padding: 0; counter-reset: pub; }
.pubs > li {
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.pubs > li:first-child { border-top: 1px solid var(--line); }
.pub-title { font-weight: 600; color: var(--ink); }
.pub-meta { color: var(--muted); font-size: .93rem; margin-top: 2px; }
.pub-links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.pub-links a {
  font-size: .82rem; padding: 3px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
}
.pub-links a:hover { border-color: var(--sand); text-decoration: none; }
.badge { display: inline-block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sand); border: 1px solid var(--sand); border-radius: 999px; padding: 1px 9px; margin-left: 8px; vertical-align: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; margin-top: 8px; padding: 10px 20px;
  background: var(--nile); color: #fff; border-radius: 8px; font-size: .95rem;
}
.btn:hover { background: var(--river); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--nile); border: 1px solid var(--nile); }
.btn.ghost:hover { border-color: var(--river); color: var(--river); }

/* ---------- Two-column blocks ---------- */
.cols { display: grid; gap: 32px; grid-template-columns: 1fr 1fr; }

/* ---------- Gallery ---------- */
.gallery { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gallery figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery a { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .gallery img { transition: transform .35s ease; }
  .gallery figure:hover img { transform: scale(1.035); }
}
.year-mark { font-family: 'Marcellus', serif; color: var(--nile); font-size: 1.5rem; margin: 40px 0 16px; padding-bottom: 6px; border-bottom: 2px solid var(--sand); display: inline-block; }
.gallery-note { color: var(--muted); font-size: .92rem; margin-top: 6px; }
.gallery figcaption { padding: 12px 16px; font-size: .9rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-foot { background: var(--nile); color: #D8E6EE; margin-top: 40px; }
.site-foot .wrap { padding: 44px 22px 30px; display: grid; gap: 28px; grid-template-columns: 1.4fr 1fr 1fr; }
.site-foot h3 { color: #fff; font-size: 1.05rem; }
.site-foot a { color: #BFE0EF; }
.site-foot a:hover { color: #fff; }
.site-foot .fine { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.18); padding-top: 16px; font-size: .84rem; color: #9FBCCB; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .portrait { justify-self: start; max-width: 260px; order: -1; }
  .facts .wrap { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .site-foot .wrap { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */
@media print {
  .site-head, .site-foot, .btn, .divider { display: none; }
  body { background: #fff; }
  section { padding: 18px 0; }
}
