/* =========================================================================
   Research site — shared styles
   Palette : deep navy ink, cool off-white, restrained scholarly gold accent
   Type    : Fraunces (display) + Instrument Sans (body/UI)
   ========================================================================= */

:root {
  --ink:        #0c1322;   /* base background (a true deep navy, not black) */
  --ink-2:      #0f1830;   /* raised panels */
  --line:       #26304a;   /* hairline borders */
  --text:       #eaeefb;   /* primary text */
  --muted:      #94a1bd;   /* secondary text */
  --gold:       #f2c14e;   /* single accent — used sparingly */
  --gold-soft:  #f2c14e33;

  --maxw: 1120px;
  --gap: clamp(1.25rem, 4vw, 3rem);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 6rem; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);  /* keeps text readable over the bare video */
}

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

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

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* -------------------------------------------------------------------------
   Site-wide background: animated gradient base + optional video on top
   The gradient always shows, so the page looks finished even with no video.
   ------------------------------------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #000;   /* plain fallback, only seen if the video is missing */
}

.bg__video {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;          /* fills the screen; a portrait clip is centred and cropped */
  object-position: center;
  opacity: 1;
  /* Colour grading — dim it and mute it so text reads. Tune these:
     brightness < 1 = darker · contrast > 1 = punchier · saturate < 1 = less colourful */
  filter: brightness(1.5) contrast(1.15) saturate(0.95);
}

/* Light graded tint over the video — enough to read text, still see the clip.
   Raise the alpha values (e.g. 0.55) if text is still hard to read. */
.bg__scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 15, 30, 0.35) 0%, rgba(8, 12, 24, 0.5) 100%);
}

@keyframes drift {
  0%   { background-position: 0% 0%, 100% 100%, 0 0; }
  100% { background-position: 100% 50%, 0% 50%, 0 0; }
}

/* -------------------------------------------------------------------------
   Header / top navigation
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(11,17,32,0.55);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.brand b { color: var(--gold); font-weight: 600; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.25rem 0;
  position: relative;
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--gold);
  transition: width 0.2s ease;
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { width: 100%; }

/* Mobile menu button (hidden on desktop) */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1.1rem;
}

/* -------------------------------------------------------------------------
   Layout wrappers
   ------------------------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gap); }

/* Hero — the one bold moment: the name */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 10vw, 7rem) var(--gap) clamp(2rem, 6vw, 4rem);
}
.hero .eyebrow {
  color: var(--gold);
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.75rem, 9vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
}
.hero .role {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: var(--muted);
  max-width: 60ch;
  margin: 1.25rem 0 0;
}

/* Reveal the hero once on load */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s ease; }

/* Two-column body: sticky identity rail + scrolling content */
.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: start;
  padding-bottom: 5rem;
}

/* -------------------------------------------------------------------------
   Identity rail (photo, bio, social icons)
   ------------------------------------------------------------------------- */
.rail { position: sticky; top: 6rem; }

.avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--ink-2);
  margin-bottom: 1.25rem;
}

.rail h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 0.35rem;
}
.rail .affil { color: var(--muted); font-size: 0.95rem; margin: 0 0 1.1rem; }
.rail .bio { color: var(--muted); font-size: 0.95rem; margin: 0 0 1.5rem; }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 0; padding: 0;
}
.socials a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.socials a:hover {
  color: var(--gold);
  border-color: var(--gold);
  transform: translateY(-2px);
}
.socials svg { width: 20px; height: 20px; }

/* -------------------------------------------------------------------------
   Content sections
   ------------------------------------------------------------------------- */
.section { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; padding-top: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.7rem;
  margin: 0;
}
.section p { color: #cdd5e8; }

/* the single requested "arrow to full publications" link */
.link-more {
  color: var(--gold);
  font-size: 0.95rem;
  white-space: nowrap;
  transition: gap 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.link-more:hover { text-decoration: underline; }
.link-more .arrow { transition: transform 0.2s ease; }
.link-more:hover .arrow { transform: translateX(4px); }

/* Publications — hairline list, not shadowed cards */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub {
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.25rem;
}
.pub:first-child { border-top: 0; }
.pub .year { color: var(--gold); font-variant-numeric: tabular-nums; font-size: 0.95rem; padding-top: 0.15rem; }
.pub .title { font-weight: 500; margin: 0 0 0.25rem; }
.pub .title a:hover { color: var(--gold); }
.pub .meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
.pub .meta em { color: #b8c2db; font-style: italic; }

/* Experience — a real chronological timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.xp {
  position: relative;
  padding: 0 0 1.75rem 1.75rem;
  border-left: 1px solid var(--line);
}
.xp:last-child { padding-bottom: 0; }
.xp::before {
  content: "";
  position: absolute;
  left: -5px; top: 0.4rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gold);
}
.xp .when { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.2rem; }
.xp .what { font-weight: 500; margin: 0; }
.xp .where { color: var(--muted); margin: 0; }

/* CV block */
.cv-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  font-size: 0.95rem;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn--solid { background: var(--gold); color: #1a1204; border-color: var(--gold); font-weight: 600; }
.btn--solid:hover { background: #f6cd6a; color: #1a1204; }

/* -------------------------------------------------------------------------
   Full publications page
   ------------------------------------------------------------------------- */
.page-head { padding: clamp(3rem, 8vw, 5rem) var(--gap) 1.5rem; max-width: var(--maxw); margin: 0 auto; }
.page-head h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.25rem, 6vw, 3.5rem); margin: 0;
}
.page-head .back { color: var(--muted); font-size: 0.95rem; }
.page-head .back:hover { color: var(--gold); }

.year-group { padding: 2rem 0; border-top: 1px solid var(--line); }
.year-group > h2 {
  font-family: var(--serif); font-weight: 500;
  color: var(--gold); font-size: 1.4rem; margin: 0 0 1rem;
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem var(--gap);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .rail { position: static; margin-bottom: 1rem; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gap) 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.7rem 0; width: 100%; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
  .pub { grid-template-columns: 3.5rem 1fr; gap: 0.9rem; }
}

/* -------------------------------------------------------------------------
   Respect reduced-motion preferences
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg { animation: none; }
  .reveal, .reveal.in { transition: none; transform: none; opacity: 1; }
  * { transition: none !important; }
}
