/* =====================================================================
   style.css — all the styling for the site.

   HOW THIS FILE IS ORGANISED
     1. Design settings (colours, fonts, sizes)  <- tweak these first
     2. Base / reset
     3. Top bar (header + navigation)
     4. Intro (photo, name, bio, buttons)
     5. Sections (headings shared by Publications and News)
     6. Publications list (+ the summary dropdown)
     7. News list
     8. Footer
     9. Small screens (phones)

   SIZES: almost everything is in "rem". 1rem = the browser's base
   text size (16px by default). To make the WHOLE site bigger or
   smaller at once, change --scale in section 1.
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. DESIGN SETTINGS
   --------------------------------------------------------------------- */
:root {
  /* Overall size. 1 = normal. Try 0.95 for smaller, 1.05 for larger. */
  --scale: 1;

  /* Main colour: top bar, buttons, links, venue tags.
     (Your tweaked colour from the design canvas.) */
  --accent: #3b5f5f; /*Previously #304d4d*/

  /* Light tint of the main colour, used behind the venue tags.
     color-mix blends the accent with white; lower % = paler. */
  --accent-tint: color-mix(in srgb, var(--accent) 14%, white);

  /* Page + text colours */
  --bg: #fbfaf7;            /* page background (warm off-white) */
  --surface: #ffffff;       /* photo ring, outline buttons */
  --text: #1d2321;          /* main text */
  --text-soft: #2e3533;     /* bio + summaries */
  --text-muted: #5a625f;    /* authors, years, dates, footer */
  --rule: #e4dfd5;          /* thin lines between items */
  --rule-strong: #d8d2c6;   /* line under section headings */
  --on-accent: #ffffff;     /* text sitting on the accent colour */
  --cream: #f6f1e7;         /* the CV button in the top bar */

  /* "Preprint" tag colours (a sand colour, so it reads differently
     from accepted papers) */
  --preprint-bg: #efe7d6;
  --preprint-text: #6a5526;

  /* Fonts: Fraunces (serif) for your name + headings,
     Figtree (sans) for everything else. Loaded in index.html. */
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  

  /* Layout */
  --content-width: 52rem;  /* width of the centre column (≈680px). Smaller = wider margins. */
  --side-gap: 1.5rem;        /* minimum margin on narrow screens */
  --bar-height: 3.75rem;     /* height of the top bar */
  --photo-size: 15rem;        /* diameter of the round photo; previously 9rem */
  --meta-col: 7rem;          /* left column holding venue tag + year */
  --section-gap: 3.75rem;     /* space between the big sections; previously 4.5 */
}


/* ---------------------------------------------------------------------
   2. BASE / RESET
   --------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* The browser default is 16px; --scale multiplies it. */
  font-size: calc(100% * var(--scale));
  -webkit-text-size-adjust: 100%;
}

/* Smooth scrolling for the nav links, unless the visitor has asked
   their system for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* Visible focus ring for keyboard users */
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Text that's read aloud by screen readers but not shown */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* "Skip to content" link: hidden until a keyboard user tabs to it */
.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  padding: 0.5rem 0.875rem;
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  z-index: 10;
}
.skip-link:focus { top: 0.75rem; }

/* The centred column everything sits in. It is --content-width wide,
   but never wider than the screen minus the side gaps. */
.container {
  width: min(var(--content-width), 100% - 2 * var(--side-gap));
  margin-inline: auto;
}

/* When a nav link jumps to a section, leave a little room above it */
section[id] { scroll-margin-top: 1.5rem; }


/* ---------------------------------------------------------------------
   3. TOP BAR (header + navigation)
   --------------------------------------------------------------------- */
.site-header {
  background: var(--accent);
  /* To keep the bar pinned to the top while scrolling, uncomment: */
  /* position: sticky; top: 0; z-index: 5; */
}

.header-inner {
  min-height: var(--bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Your name on the left of the bar */
.wordmark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--on-accent);
}
.wordmark:hover { text-decoration: none; }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(255 255 255 / 0.8);
}
.site-nav a:hover {
  color: var(--on-accent);
  text-decoration: none;
  background: rgb(255 255 255 / 0.08);
}

/* The page you're on gets the soft pill highlight.
   (Set with aria-current="page" in the HTML.) */
.site-nav a[aria-current="page"] {
  color: var(--on-accent);
  background: rgb(255 255 255 / 0.16);
}

/* The cream "CV" button at the end of the bar */
.site-nav a.nav-cv {
  margin-left: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: var(--cream);
  color: var(--accent);
  font-weight: 700;
}
.site-nav a.nav-cv:hover { filter: brightness(0.96); }


/* ---------------------------------------------------------------------
   4. INTRO (photo, name, bio, buttons)
   --------------------------------------------------------------------- */
main { padding-top: 4.5rem; }

.intro {
  display: grid;
  grid-template-columns: var(--photo-size) minmax(0, 1fr);
  column-gap: 2.5rem;
  align-items: center;
}

/* Round photo with a white ring and soft shadow */
.photo {
  width: var(--photo-size);
  height: var(--photo-size);
  border-radius: 50%;
  object-fit: cover;          /* crops the photo to fill the circle */
  object-position: center 30%; /* move the crop: lower % = show more of the top */
  border: 4px solid var(--surface);
  box-shadow:
    0 1px 2px rgb(29 35 33 / 0.06),
    0 8px 22px rgb(29 35 33 / 0.10);
  background: #e9e4da;
}

/* Small coloured line above your name */
.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.intro h1 {
  margin: 0.625rem 0 0;
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.affiliation {
  margin: 0.625rem 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
}

.bio {
  margin: 0.875rem 0 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-soft);
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.125rem;
}

/* Pill buttons (Email, Google Scholar) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.5rem;
  padding: 0 1.05rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.btn--filled {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--filled:hover { filter: brightness(1.12); }

.btn--outline {
  background: var(--surface);
  border-color: var(--rule-strong);
  color: var(--text);
}
.btn--outline svg { color: var(--accent); }
.btn--outline:hover { border-color: var(--accent); }


/* ---------------------------------------------------------------------
   5. SECTIONS (shared by Publications and News)
   --------------------------------------------------------------------- */
.section { margin-top: var(--section-gap); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule-strong);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* The small "All research →" style link on the right of a heading */
.section-link {
  font-size: 0.875rem;
  font-weight: 600;
}


/* ---------------------------------------------------------------------
   6. PUBLICATIONS
   --------------------------------------------------------------------- */
.pub-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* One publication = two columns: [venue + year] [title, authors, links] */
.pub {
  position: relative;          /* the round dropdown button is placed relative to this */
  display: grid;
  grid-template-columns: var(--meta-col) minmax(0, 1fr);
  column-gap: 1.5rem;
  padding: 1.375rem 3.5rem 1.375rem 0;  /* right padding leaves room for the button */
  border-bottom: 1px solid var(--rule);
}

.pub-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding-top: 0.125rem;
}

/* Venue tag, e.g. CRYPTO */
.venue {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
}
/* Add class="venue venue--preprint" for unpublished work */
.venue--preprint {
  background: var(--preprint-bg);
  color: var(--preprint-text);
}

.year {
  padding-left: 0.125rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pub-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
}

.pub-authors {
  margin: 0.3rem 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}
/* Your own name in the author list */
.pub-authors .me {
  font-weight: 600;
  color: var(--text);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ---- The summary dropdown ----
   Built with the browser's own <details>/<summary> element, so it works
   with no JavaScript and with the keyboard. The <summary> is the round
   arrow button; we lift it out of the text flow and pin it to the top
   right of the publication. */
.pub-summary > summary {
  position: absolute;
  top: 1.25rem;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  list-style: none;              /* hides the default ▶ marker */
  transition: border-color 150ms ease, background-color 150ms ease;
}
.pub-summary > summary::-webkit-details-marker { display: none; } /* Safari */
.pub-summary > summary:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.pub-summary > summary svg {
  width: 1.05rem;
  height: 1.05rem;
  transition: transform 150ms ease;
}
/* Flip the arrow when open */
.pub-summary[open] > summary svg { transform: rotate(180deg); }

/* The text that appears when opened */
.pub-summary p {
  margin: 0.75rem 0 0.125rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-soft);
}


/* ---------------------------------------------------------------------
   7. NEWS
   --------------------------------------------------------------------- */
.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-list li {
  display: grid;
  grid-template-columns: var(--meta-col) minmax(0, 1fr);
  column-gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.news-list time {
  padding-top: 0.1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
}


/* ---------------------------------------------------------------------
   8. FOOTER
   --------------------------------------------------------------------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: var(--section-gap);
  padding: 1.25rem 0 3.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}


/* ---------------------------------------------------------------------
   9. SMALL SCREENS (phones, narrow windows)
   --------------------------------------------------------------------- */
@media (max-width: 40rem) {
  :root {
    --side-gap: 1.25rem;
    --photo-size: 6.5rem;
    --section-gap: 3.5rem;
  }

  /* Name on one line, links underneath */
  .header-inner {
    flex-wrap: wrap;
    padding: 0.75rem 0 0.5rem;
    row-gap: 0.4rem;
  }
  .site-nav { width: 100%; margin-left: -0.75rem; }
  .site-nav ul { flex-wrap: wrap; }

  main { padding-top: 2.5rem; }

  /* Photo above the text */
  .intro { grid-template-columns: 1fr; row-gap: 1.5rem; }
  .intro h1 { font-size: 2.25rem; }

  /* Venue + year sit in a row above the title instead of in a column */
  .pub,
  .news-list li { grid-template-columns: 1fr; }
  .pub-meta {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
  }
  .news-list time { padding-top: 0; }
}


/* =====================================================================
   10. UPDATES (at the end so they override the rules above)
   ===================================================================== */

/* Heading font: Lora instead of Fraunces (better capital J).
   If you picked Faustina, write "Faustina" instead of "Lora". */
/* :root {
  --font-display: "New Spirit", Georgia, serif;
} */

/* Underline links in the page content so they stand out from text.
   Buttons and "All research →" style links are left alone. */
main a:not(.btn):not(.section-link) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
main a:not(.btn):not(.section-link):hover {
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
}

/* No white ring around the round photo.
   (Add "box-shadow: none;" inside the braces to drop the shadow too.) */
.photo {
  border: none;
}

/* Keep the top bar pinned to the top of the screen while scrolling */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
}

/* Stop the pinned bar from covering headings when a nav link jumps to them */
section[id] {
  scroll-margin-top: calc(var(--bar-height) + 1.5rem);
}
@media (max-width: 40rem) {
  section[id] { scroll-margin-top: 7rem; }
}