/* =========================================================================
   Mohamed Embaby - Research Portfolio
   Editorial · Navy & Gold
   Display: Fraunces  ·  Body/UI: Hanken Grotesk
   ========================================================================= */

/* ----------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
img, picture, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }

/* ------------------------------------------------------------- Variables */
:root {
  /* palette */
  --paper:        #f6f2e9;
  --paper-2:      #fcfaf3;
  --paper-3:      #efe9da;
  --navy:         #14223b;
  --navy-soft:    #1f2f4d;
  --navy-deep:    #101d31;
  --ink:          #232c41;
  --muted:        #5b6377;
  --gold:         #b0832f;
  --gold-bright:  #cb9d3f;
  --gold-deep:    #8a6526;
  --line:         rgba(20, 34, 59, 0.14);
  --line-soft:    rgba(20, 34, 59, 0.08);

  /* type */
  --serif: "Fraunces", "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* fluid scale */
  --step--1: clamp(0.78rem, 0.74rem + 0.18vw, 0.88rem);
  --step-0:  clamp(1rem, 0.96rem + 0.22vw, 1.14rem);
  --step-1:  clamp(1.2rem, 1.12rem + 0.4vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.3rem + 0.95vw, 2.25rem);
  --step-3:  clamp(2rem, 1.6rem + 1.9vw, 3.4rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.3vw, 5.2rem);

  /* layout */
  --wrap: 1200px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------- Base */
body {
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  /* layered paper atmosphere */
  background-image:
    radial-gradient(120% 90% at 85% -10%, rgba(176, 131, 47, 0.10), transparent 55%),
    radial-gradient(90% 70% at -10% 0%, rgba(20, 34, 59, 0.06), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle film-grain overlay for editorial paper feel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

::selection { background: var(--navy); color: var(--paper); }

/* --------------------------------------------------------------- Layout */
.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }
[id] { scroll-margin-top: 5.5rem; }
.section { position: relative; z-index: 2; padding-block: clamp(4.5rem, 10vw, 9rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

/* Section header w/ editorial number */
.shead { display: flex; align-items: baseline; gap: 1rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.shead__num {
  font-family: var(--serif);
  font-size: var(--step-1);
  font-weight: 400;
  font-style: italic;
  color: var(--gold-deep);
  letter-spacing: 0.01em;
  flex: none;
  padding-top: 0.15em;
}
.shead__title {
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: var(--step-3);
  line-height: 1.04;
  letter-spacing: -0.018em;
  color: var(--navy);
}
.shead__rule { flex: 1 1 auto; height: 1px; background: var(--line); align-self: center; margin-left: 0.5rem; }

/* Eyebrow / kicker label */
.kicker {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 600;
  color: var(--gold-deep);
}

/* --------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  padding: 0.72em 1.3em;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: transform .35s var(--ease), background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
  will-change: transform;
}
.btn svg { width: 1em; height: 1em; }
.btn--solid { background: var(--navy); color: var(--paper); }
.btn--solid:hover { background: var(--navy-deep); transform: translateY(-2px); box-shadow: 0 12px 26px -14px rgba(20,34,59,.7); }
.btn--gold { background: transparent; color: var(--gold-deep); border: 1px solid var(--gold); }
.btn--gold:hover { background: var(--gold); color: #fff; transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgba(176,131,47,.8); }
.btn--ghost { border: 1px solid var(--line); color: var(--navy); }
.btn--ghost:hover { border-color: var(--navy); transform: translateY(-2px); }

/* Inline labelled link (with animated underline) */
.link {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.45em;
  font-weight: 500;
  color: var(--navy);
  transition: color .3s var(--ease);
}
.link::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.link:hover { color: var(--gold-deep); }
.link:hover::after { transform: scaleX(1); transform-origin: left; }
.link svg { width: 1.05em; height: 1.05em; opacity: .75; }

/* =====================================================================
   NAVBAR
   ===================================================================== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.6rem) var(--gutter);
  transition: padding .4s var(--ease), background-color .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  padding-block: 0.85rem;
  background: rgba(246, 242, 233, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom-color: var(--line);
}
.nav__brand {
  font-family: var(--serif);
  font-size: var(--step-1);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--navy);
  display: inline-flex; align-items: center; gap: 0.6rem;
}
.nav__brand .mono {
  display: inline-grid; place-items: center;
  width: 2.1rem; height: 2.1rem;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--gold-deep);
  font-family: var(--sans);
}
.nav__links { display: flex; align-items: center; gap: clamp(1.1rem, 2.2vw, 2.2rem); }
.nav__links a {
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  color: var(--navy-soft);
  position: relative;
  transition: color .3s var(--ease);
}
.nav__links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: right;
  transition: transform .35s var(--ease);
}
.nav__links a:not(.btn):hover { color: var(--navy); }
.nav__links a:not(.btn):hover::after { transform: scaleX(1); transform-origin: left; }

.nav__toggle { display: none; width: 2.5rem; height: 2.5rem; position: relative; z-index: 60; }
.nav__toggle span { position: absolute; left: 50%; top: 50%; width: 22px; height: 1.5px; background: var(--navy); transform: translate(-50%, -50%); transition: transform .35s var(--ease), opacity .25s var(--ease); }
.nav__toggle span:nth-child(1) { transform: translate(-50%, -7px); }
.nav__toggle span:nth-child(3) { transform: translate(-50%, 7px); }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translate(-50%, 0) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translate(-50%, 0) rotate(-45deg); }

/* =====================================================================
   HERO
   ===================================================================== */
.hero { position: relative; z-index: 2; padding-top: clamp(8rem, 16vh, 12rem); padding-bottom: clamp(3rem, 7vw, 6rem); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero__eyebrow { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.9rem; }
.hero__eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(176,131,47,0.16); }
.hero h1 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: var(--step-4);
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--navy);
}
.hero h1 em { font-style: italic; color: var(--gold-deep); }
.hero__lead {
  margin-top: 1.6rem;
  font-size: var(--step-1);
  line-height: 1.5;
  max-width: 34ch;
  color: var(--ink);
  font-weight: 400;
}
.hero__name { margin-top: 1.4rem; font-size: var(--step--1); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hero__name b { color: var(--navy); font-weight: 600; }

.hero__links { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.7rem 1.4rem; align-items: center; }
.hero__cta { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* portrait */
.hero__portrait { position: relative; justify-self: center; }
.hero__portrait .frame {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(20, 34, 59, 0.55);
}
.hero__portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; }
.hero__portrait .frame::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25); border-radius: 6px; }
.hero__portrait .tag {
  position: absolute; left: -1.2rem; bottom: 1.6rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  padding: 0.7rem 1rem;
  font-size: var(--step--1);
  line-height: 1.35;
  box-shadow: 0 18px 40px -24px rgba(20,34,59,.5);
  max-width: 15rem;
}
.hero__portrait .tag b { color: var(--navy); font-weight: 600; }
.hero__portrait .ornament { position: absolute; inset: -1.4rem auto auto -1.4rem; width: 5rem; height: 5rem; border-top: 1px solid var(--gold); border-left: 1px solid var(--gold); opacity: .6; }
.hero__portrait .ornament--br { inset: auto -1.4rem -1.4rem auto; border: none; border-bottom: 1px solid var(--gold); border-right: 1px solid var(--gold); }

.hero__scroll { margin-top: clamp(3rem, 6vw, 5rem); display: inline-flex; align-items: center; gap: 0.7rem; font-size: var(--step--1); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.hero__scroll .line { width: 46px; height: 1px; background: var(--navy); position: relative; overflow: hidden; }
.hero__scroll .line::after { content: ""; position: absolute; inset: 0; background: var(--gold); transform: translateX(-100%); animation: slide 2.6s var(--ease) infinite; }
@keyframes slide { 0% { transform: translateX(-100%);} 55%,100% { transform: translateX(100%);} }

/* =====================================================================
   ABOUT
   ===================================================================== */
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.about__lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.32;
  letter-spacing: -0.012em;
  color: var(--navy);
}
.about__lead .firstline { display: block; }
.about__body p { margin-bottom: 1.1rem; color: var(--ink); }
.about__body p:last-child { margin-bottom: 0; }
.about__quote {
  margin: 1.8rem 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--gold);
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--navy-soft);
}
.about__meta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  padding: 0.4em 0.9em;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--navy-soft);
  background: var(--paper-2);
}
.chip b { color: var(--gold-deep); font-weight: 600; }

/* =====================================================================
   RESEARCH
   ===================================================================== */
.research__intro { max-width: 60ch; font-size: var(--step-1); color: var(--ink); margin-bottom: clamp(2.5rem, 5vw, 4rem); }

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.feature + .feature { margin-top: clamp(3.5rem, 7vw, 6.5rem); }
.feature:nth-child(even) .feature__media { order: 2; }
.feature__media { position: relative; border-radius: 6px; overflow: hidden; box-shadow: 0 30px 60px -38px rgba(20,34,59,.5); }
.feature__media img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 1.1s var(--ease); }
.feature:hover .feature__media img { transform: scale(1.045); }
.feature__media .badge { position: absolute; top: 1rem; left: 1rem; z-index: 1; background: rgba(16,29,49,.82); color: var(--paper); font-size: var(--step--1); letter-spacing: .12em; text-transform: uppercase; padding: .4em .8em; border-radius: 3px; backdrop-filter: blur(4px); }
/* scientific figure: show it whole, no crop */
.feature__media--figure { background: #fff; }
.feature__media--figure img { object-fit: contain; }
/* calf is portrait - bias the gallery crop toward the head */
.gallery img.tall { object-position: center 28%; }

.feature__num { font-family: var(--serif); font-style: italic; font-size: var(--step-1); color: var(--gold-deep); }
.feature__title { font-family: var(--serif); font-weight: 400; font-size: var(--step-2); line-height: 1.1; letter-spacing: -0.015em; color: var(--navy); margin: 0.4rem 0 0.9rem; }
.feature__text { color: var(--ink); margin-bottom: 1.1rem; }
.feature__tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tag-sm { font-size: var(--step--1); padding: 0.3em 0.75em; border-radius: 100px; background: var(--paper-3); color: var(--navy-soft); border: 1px solid var(--line-soft); }

/* text-only feature (genomics) */
.feature--text { display: block; padding: clamp(1.8rem, 4vw, 3rem); background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; position: relative; overflow: hidden; }
.feature--text::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--gold), transparent); }
.feature--text .journals { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* earlier-career strip */
.earlier { margin-top: clamp(3rem, 6vw, 5rem); padding: clamp(1.4rem, 3vw, 2rem); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; }
.earlier__label { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold-deep); font-weight: 600; }
.earlier__text { color: var(--muted); }
.earlier__text b { color: var(--navy); font-weight: 600; }

/* gallery strip */
.gallery { margin-top: clamp(3.5rem, 7vw, 6rem); }
.gallery__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: clamp(0.6rem, 1.4vw, 1rem); }
.gallery figure { position: relative; border-radius: 5px; overflow: hidden; box-shadow: 0 18px 40px -30px rgba(20,34,59,.5); }
.gallery img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 1s var(--ease); }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption { position: absolute; inset: auto 0 0 0; padding: 1.4rem 0.8rem 0.7rem; font-size: var(--step--1); color: #fff; background: linear-gradient(transparent, rgba(16,29,49,.85)); opacity: 0; transform: translateY(6px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.gallery figure:hover figcaption { opacity: 1; transform: translateY(0); }

/* =====================================================================
   PUBLICATIONS
   ===================================================================== */
.pubs__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 2.5rem; }
.pubs__intro { max-width: 52ch; color: var(--ink); }

/* featured */
.featured { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(0.9rem, 2vw, 1.4rem); margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.fcard {
  position: relative;
  padding: clamp(1.3rem, 2.5vw, 1.9rem);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
  display: flex; flex-direction: column; gap: 0.7rem;
}
.fcard:hover { transform: translateY(-4px); box-shadow: 0 26px 50px -30px rgba(20,34,59,.5); border-color: var(--gold); }
.fcard__venue { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--step--1); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--gold-deep); }
.fcard__venue .star { color: var(--gold); }
.fcard__title { font-family: var(--serif); font-size: var(--step-1); line-height: 1.22; color: var(--navy); letter-spacing: -0.01em; }
.fcard__meta { font-size: var(--step--1); color: var(--muted); margin-top: auto; }
.fcard__title a { background-image: linear-gradient(var(--gold), var(--gold)); background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .4s var(--ease); }
.fcard:hover .fcard__title a { background-size: 100% 1px; }

/* filter */
.filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.filter button {
  font-size: var(--step--1); letter-spacing: 0.04em;
  padding: 0.5em 1.05em; border-radius: 100px;
  border: 1px solid var(--line); color: var(--navy-soft);
  transition: all .3s var(--ease);
}
.filter button:hover { border-color: var(--navy); }
.filter button.is-active { background: var(--navy); color: var(--paper); border-color: var(--navy); }

/* list */
.publist { border-top: 1px solid var(--line); }
.pub {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  transition: background-color .3s var(--ease);
}
.pub__year { font-family: var(--serif); font-style: italic; font-size: var(--step-1); color: var(--gold-deep); }
.pub__main { }
.pub__title { font-size: var(--step-0); font-weight: 600; color: var(--navy); line-height: 1.35; }
.pub__title a { background-image: linear-gradient(var(--gold), var(--gold)); background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .35s var(--ease); }
.pub__title a:hover { background-size: 100% 1px; color: var(--gold-deep); }
.pub__authors { font-size: calc(var(--step-0) * .94); color: var(--muted); margin-top: 0.25rem; }
.pub__authors b { color: var(--ink); font-weight: 700; }
.pub__venue { font-style: italic; color: var(--navy-soft); }
.pub__cat { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-deep); white-space: nowrap; align-self: center; }
.pub.is-hidden { display: none; }
.pubs__count { margin-top: 1.5rem; font-size: var(--step--1); color: var(--muted); letter-spacing: 0.04em; }

/* =====================================================================
   EXPERIENCE / EDUCATION
   ===================================================================== */
.cv__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); }
.cv__col h3 { font-family: var(--serif); font-weight: 500; font-size: var(--step-1); color: var(--navy); margin-bottom: 1.6rem; display: flex; align-items: center; gap: .7rem; }
.cv__col h3::before { content: ""; width: 1.4rem; height: 1px; background: var(--gold); }
.timeline { position: relative; }
.tl { position: relative; padding: 0 0 1.7rem 1.6rem; border-left: 1px solid var(--line); }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: -4.5px; top: 0.45rem; width: 8px; height: 8px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--gold); transition: background-color .3s var(--ease); }
.tl:hover::before { background: var(--gold); }
.tl__when { font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; }
.tl__what { font-size: var(--step-0); font-weight: 600; color: var(--navy); margin-top: 0.2rem; line-height: 1.3; }
.tl__where { font-size: calc(var(--step-0) * .95); color: var(--muted); margin-top: 0.1rem; }

/* =====================================================================
   GRANTS & HONORS
   ===================================================================== */
.grants__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(0.8rem, 2vw, 1.2rem); }
.grant {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
  transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.grant:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 22px 44px -30px rgba(20,34,59,.45); }
.grant__mark { font-family: var(--serif); font-style: italic; color: var(--gold-deep); font-size: var(--step-1); line-height: 1; }
.grant__title { font-weight: 600; color: var(--navy); line-height: 1.3; }
.grant__org { font-size: var(--step--1); color: var(--muted); margin-top: 0.3rem; }
.grant__role { display: inline-block; margin-top: 0.5rem; font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-deep); border: 1px solid var(--line); border-radius: 100px; padding: 0.15em 0.7em; }

/* =====================================================================
   CONTACT  (dark navy block)
   ===================================================================== */
.contact {
  position: relative; z-index: 2;
  background: var(--navy-deep);
  color: var(--paper);
  overflow: hidden;
}
.contact::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(80% 60% at 80% 0%, rgba(203,157,63,0.16), transparent 60%),
    radial-gradient(60% 50% at 0% 100%, rgba(203,157,63,0.08), transparent 55%);
}
.contact .shead__title, .contact .shead__num { color: var(--paper); }
.contact .shead__num { color: var(--gold-bright); }
.contact .shead__rule { background: rgba(255,255,255,0.16); }
.contact__grid { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: end; }
.contact h2.big { font-family: var(--serif); font-weight: 400; font-size: var(--step-3); line-height: 1.08; letter-spacing: -0.02em; color: #fff; max-width: 18ch; }
.contact h2.big em { font-style: italic; color: var(--gold-bright); }
.contact__email { margin-top: 1.8rem; display: inline-block; font-family: var(--serif); font-size: var(--step-1); color: var(--gold-bright); }
.contact__email::after { background: var(--gold-bright); }
.contact__side { display: flex; flex-direction: column; gap: 1rem; }
.contact__side .clink { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,0.14); color: rgba(255,255,255,0.86); transition: color .3s var(--ease), padding .3s var(--ease); }
.contact__side .clink:hover { color: var(--gold-bright); padding-left: 0.4rem; }
.contact__side .clink span:first-child { letter-spacing: 0.04em; }
.contact__side .clink .arr { transition: transform .3s var(--ease); }
.contact__side .clink:hover .arr { transform: translate(3px,-3px); }
.contact__meta { position: relative; margin-top: clamp(2.5rem, 5vw, 4rem); font-size: var(--step--1); color: rgba(255,255,255,0.55); letter-spacing: 0.04em; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.footer { position: relative; z-index: 2; background: var(--navy-deep); color: rgba(255,255,255,0.6); border-top: 1px solid rgba(255,255,255,0.1); }
.footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 2rem; }
.footer a { color: rgba(255,255,255,0.78); }
.footer a:hover { color: var(--gold-bright); }
.footer__brand { font-family: var(--serif); color: #fff; font-size: var(--step-0); }
.footer__top { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase; }
.footer__top .circ { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 1px solid rgba(255,255,255,0.3); border-radius: 50%; transition: transform .4s var(--ease), border-color .4s var(--ease); }
.footer__top:hover .circ { transform: translateY(-3px); border-color: var(--gold-bright); }

/* =====================================================================
   SCROLL REVEAL
   ===================================================================== */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in-view { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

/* hero intro animation */
.js .hero [data-anim] { opacity: 0; transform: translateY(20px); }
.hero.ready [data-anim] { animation: rise .95s var(--ease) forwards; }
.hero.ready [data-anim="1"] { animation-delay: .05s; }
.hero.ready [data-anim="2"] { animation-delay: .15s; }
.hero.ready [data-anim="3"] { animation-delay: .25s; }
.hero.ready [data-anim="4"] { animation-delay: .35s; }
.hero.ready [data-anim="5"] { animation-delay: .45s; }
.hero.ready [data-anim="6"] { animation-delay: .55s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { order: -1; max-width: 360px; }
  .about__grid { grid-template-columns: 1fr; }
  .featured { grid-template-columns: 1fr; }
  .cv__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .grants__grid { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 760px) {
  .nav__links { position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 1.6rem; background: rgba(246,242,233,0.97); backdrop-filter: blur(14px); transform: translateX(100%); transition: transform .5s var(--ease); padding: 2rem; }
  .nav__links a { font-size: var(--step-2); font-family: var(--serif); letter-spacing: -0.01em; }
  .nav.is-open .nav__links { transform: none; }
  .nav__toggle { display: block; }
  .feature { grid-template-columns: 1fr; }
  .feature:nth-child(even) .feature__media { order: 0; }
  .feature__media { margin-bottom: 0.5rem; }
  .pub { grid-template-columns: 3.2rem 1fr; }
  .pub__cat { display: none; }
  .hero__cta { width: 100%; }
  .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 460px) {
  .hero__portrait .tag { left: 0; }
}

/* print niceties (cv link target page handles full print) */
@media print { .nav, .hero__scroll, body::before { display: none !important; } }
