/* Raluca L. Pahontu — personal site
   Modern academic minimal: high-contrast type, generous whitespace, one
   restrained accent, and a dark mode that follows the reader's system setting.

   Colours are defined once as tokens on :root and redefined under
   prefers-color-scheme, so nothing hard-codes a colour further down. */

:root {
  --bg: #ffffff;
  --bg-subtle: #f6f6f7;
  --text: #17171a;          /* near-black, not pure black: easier on the eye */
  --text-muted: #5c5c66;
  --border: #e5e5e8;
  --accent: #1f7396;        /* your site's blue, darkened to pass AA (5.32:1) */
  --accent-hover: #cc3311;  /* vermilion: max distance from the link colour */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.05);

  --container: 1080px;
  --measure: 68ch;          /* comfortable reading width for prose */
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101012;
    --bg-subtle: #17171b;
    --text: #ececf0;
    --text-muted: #a0a0ad;
    --border: #29292f;
    --accent: #9ac0d0;
    --accent-hover: #ff7f5c;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* Interface type — the name, the nav, buttons and the small section eyebrows —
   stays in Inter. Reading text is set in a serif, which separates "things you
   click" from "things you read". */
.site-title, .main-navigation, .btn, h4 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Helvetica, Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Gentium Book Plus', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.62;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover, a:focus-visible {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

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

/* ---------- Header ---------- */

/* Name on the left, nav on the right. Sticky with a translucent backdrop so
   navigation stays available on the long CV and research pages. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  -webkit-backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  flex-wrap: wrap;
}

.site-branding { margin: 0; }

.site-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.site-title a, .site-title a:hover {
  color: var(--text);
  text-decoration: none;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  color: var(--text-muted);
  font-size: 15px;
  text-decoration: none;
  padding: 4px 0;
  position: relative;
}
.main-navigation a:hover { color: var(--text); }

/* Active page marked with a short rule rather than bold text — quieter, and
   it does not shift layout the way a weight change does. */
.main-navigation a[aria-current="page"] { color: var(--text); }
.main-navigation a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Content ---------- */

.site-main { padding-bottom: 80px; }

.entry-title {
  color: var(--text);
  font-weight: 600;
  font-size: 36px;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 32px;
}

/* Section headings as small uppercase eyebrows: they separate groups without
   competing with the page title. */
h4 {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 44px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
h4:first-child { margin-top: 0; }

p { margin: 0 0 1.15em; max-width: var(--measure); }

/* ---------- Home ---------- */

/* The portrait is deliberately modest: it sits beside the opening text rather
   than dominating the page. */
.intro {
  display: flex;
  gap: 44px;
  align-items: flex-start;
}
.intro-photo { flex: 0 0 220px; }
.intro-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.intro-text { flex: 1 1 auto; min-width: 0; }

/* ---------- Social icons ---------- */

/* Neutral outlined pills that pick up the accent on hover, rather than each
   platform's brand colour — keeps the page calm and ages better. */
.social-links {
  list-style: none;
  display: flex;
  gap: 10px;
  padding: 0;
  margin: 28px 0 0;
}
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease,
              background 0.15s ease, transform 0.15s ease;
}
.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  transform: translateY(-2px);
}
.social-links svg { width: 19px; height: 19px; fill: currentColor; }

/* ---------- Research / listing pages ---------- */

.entry-list p { margin: 0 0 0.55em; max-width: var(--measure); }

/* Each publication is a block with a little breathing room beneath it. */
.entry-list > p:not(.coverage) {
  margin-bottom: 1.5em;
  line-height: 1.55;
}
.entry-list > p:not(.coverage):has(+ .coverage) { margin-bottom: 0.4em; }

.coverage {
  font-size: 14px;
  color: var(--text-muted);
  padding-left: 0;
  margin-top: 0;
  margin-bottom: 1.7em !important;
}
.coverage a { color: var(--text-muted); }
.coverage a:hover { color: var(--accent); }

/* ---------- Events page ---------- */

/* On Events the h4s are event names, not section labels, so the small
   uppercase eyebrow used elsewhere puts the heading below its own body text.
   Here they get a proper title treatment and the description steps down. */
.events-list h4 {
  font-family: 'Gentium Book Plus', Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  border-bottom: 0;
  padding-bottom: 0;
  margin: 36px 0 6px;
}
.events-list h4:first-of-type { margin-top: 40px; }

.events-list h4 + p {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ---------- Data page ---------- */

/* Replication rows keep the paper title as plain text and hang a small icon
   link off the end. A long title makes a poor link target, and the icon says
   "the files are over there" more clearly than underlining the whole line. */
.data-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  vertical-align: -3px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.data-icon:hover, .data-icon:focus-visible { color: var(--accent); }

/* Stroke rather than fill: a 15px solid glyph turns into a blob, and the open
   drawing sits better beside serif text. */
.data-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- CV page ---------- */

.pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 40px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { opacity: 0.86; color: var(--bg); }
.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn.secondary:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--text-muted);
  opacity: 1;
}

/* The CV is shown as pre-rendered page images rather than an embedded PDF
   viewer: it renders identically in every browser (including phones, where
   inline PDFs do not work) and needs no plugin. The real PDF is one click away.
   The images are regenerated by tools/build.py, which runs on every push. */
.cv-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.cv-preview img {
  display: block;
  width: 100%;
  max-width: 820px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}
.cv-preview a { display: block; width: 100%; max-width: 820px; }
.cv-preview a:hover img {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* ---------- Footer ---------- */

.site-footer { margin-top: 80px; }
.site-footer hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0 0 24px;
}
.site-info p {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 auto;
  padding-bottom: 40px;
  max-width: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  body { font-size: 16px; }

  .site-header {
    position: static;
    margin-bottom: 36px;
  }
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 18px;
    padding-bottom: 14px;
    min-height: 0;
  }
  /* Keep all six items on one line: they fit at this size, and a nav that
     wraps to a second line reads as an accident rather than a design. */
  .main-navigation { width: 100%; }
  .main-navigation ul {
    gap: 15px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .main-navigation ul::-webkit-scrollbar { display: none; }
  .main-navigation li { flex: 0 0 auto; }
  .main-navigation a { font-size: 13.5px; }

  .entry-title { font-size: 29px; margin-bottom: 24px; }

  .intro { flex-direction: column; gap: 28px; }
  .intro-photo { flex: none; width: 180px; }

  .site-main { padding-bottom: 56px; }
  .site-footer { margin-top: 56px; }
}

/* Readers who prefer less motion get no transitions or smooth scrolling. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
