/* =====================================================================
   SITE STYLESHEET
   =====================================================================

   HOW THIS FILE IS ORGANISED (search for these headings):
     1. DESIGN TOKENS      — all colors & spacing live here
     2. RESET & BASE        — sensible defaults
     3. LAYOUT              — the .wrap max-width container
     4. NAVIGATION          — the sticky top bar, same on every page
     5. BUTTONS
     6. HOMEPAGE HERO        — big intro, index.html only
     7. PORTRAIT FRAME       — the square photo + corner brackets
     8. PAGE HERO            — smaller intro used on subpages
     9. SECTION LABEL        — small uppercase "eyebrow" headings
    10. CARDS                — the 3-up research highlight cards
    11. ENTRY LIST           — publications / talks / teaching rows
    12. BLOG TEASER
    13. FOOTER
    14. RESPONSIVE           — mobile adjustments
    15. FLIP MODAL            — research.html topic popups
    16. VIDEO EMBED           — YouTube / mp4 talk recordings
    16b. NOTION EMBED         — public Notion page framed in-page (test)
    17. BULLET LIST           — dot-marker list for prose (e.g. inside modals)
    18. PAPER CHIPS           — "Example Papers" pill row inside modals
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. DESIGN TOKENS
   --------------------------------------------------------------------- */
:root {
  /* Backgrounds */
  --paper:        #FBF8F3;  /* main background, warm off-white */
  --paper-deep:   #F4EFE6;  /* slightly darker panel background */
  --paper-dark:   #cdc3ad;  /* slightly darker panel background */

  /* Text */
  --ink:          #2B3542;  /* main text color */
  --ink-soft:     #5B6472;  /* secondary / muted text */

  /* Accent colors (your brand palette) */
  --blue:         #4C6E91;  /* primary accent — links, labels */
  --blue-soft:    #DCE6EE;  /* pale blue, used as a fill */
  --apricot:      #E8A05C;  /* secondary accent — highlights, dots,
                                underlines, borders, AND currently the
                                small uppercase text labels too
                                (.entry-meta, .card .tag) — you tried the
                                higher-contrast --apricot-text below for
                                those and preferred this brighter one, so
                                it's back. Worth knowing: at ~2:1 against
                                --paper this is below WCAG AA's 4.5:1 for
                                text that size, a deliberate trade-off. */
  --apricot-soft: #FAE6D2;  /* pale apricot, used as a fill */
  --apricot-text: #875D35;  /* unused for now — a darker, same-hue
                                variant (~5:1 contrast) kept here in case
                                you want the more accessible version back
                                for .entry-meta / .card .tag later */

  /* Lines */
  --rule: rgba(43, 53, 66, 0.12); /* faint dividing lines / borders */

  /* Card box colors - Default matches the page background,
     so boxes look "invisible" except for their thin border until you
     set a color. */
  --card-bg: var(--paper);
  --card-border: var(--rule);
}


/* ---------------------------------------------------------------------
   2. RESET & BASE
   --------------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* inline text links — for links embedded inside a sentence of prose
   (e.g. bio.html's Research Network paragraph). Visible at rest via
   color + a faint underline, brightens to apricot on hover — same
   language as the nav's underline-on-hover, just always-on enough
   to read as a link without hovering first. */
.text-link {
  color: var(--blue);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s;
}
.text-link:hover {
  border-color: var(--apricot);
}

/* Display font used for all headings — swap the font-family here
   (and in the Google Fonts <link> in each HTML file's <head>)
   if you want a different heading typeface site-wide. */
h1, h2, h3, .display-font {
  font-family: 'Fraunces', serif;
  font-weight: 500;
}


/* ---------------------------------------------------------------------
   3. LAYOUT
   .wrap centers content and caps its width.
   --------------------------------------------------------------------- */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}


/* ---------------------------------------------------------------------
   4. NAVIGATION
   --------------------------------------------------------------------- */
nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 248, 243, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.brand {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 22px;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
}

/* underline-on-hover effect for nav links */
.navlinks a {
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}
.navlinks a:hover {
  color: var(--blue);
}
.navlinks a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--apricot);
  transition: width 0.25s ease;
}
.navlinks a:hover::after {
  width: 100%;
}

/* highlights whichever page you're currently on —
   add class="active" to the matching link in each page's nav */
.navlinks a.active {
  color: var(--ink);
  font-weight: 700;
}
.navlinks a.active::after {
  width: 100%;
}

.nav-divider {
  width: 1px;
  height: 18px;
  align-self: center;
  background: var(--rule);
}


/* ---------------------------------------------------------------------
   5. BUTTONS
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--ink);
  transition: all 0.2s ease;
}
.btn.primary {
  background: var(--ink);
  color: var(--paper);
}
.btn.primary:hover {
  background: var(--blue);
  border-color: var(--blue);
}
.btn.ghost {
  border-color: var(--rule);
}
.btn.ghost:hover {
  border-color: var(--ink);
}

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}


/* ---------------------------------------------------------------------
   6. HOMEPAGE HERO
   --------------------------------------------------------------------- */
.hero {
  padding: 64px 0 52px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr; 
  gap: 56px;
  align-items: center;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--apricot);
  display: inline-block;
}

.hero h1 {
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--blue);
}

.hero-statement {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.4;
  color: var(--ink);
  max-width: 46ch;
  margin-bottom: 22px;
}

.lede {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 100ch;
  margin-bottom: 32px;
}

.hero .lede {
  max-width: 46ch;
  font-size: 19px;
}


/* ---------------------------------------------------------------------
   7. PORTRAIT FRAME  (square photo + corner brackets)
   --------------------------------------------------------------------- */
.portrait-stage {
  position: relative;
  width: 100%;
  max-width: 260px; 
  aspect-ratio: 1 / 1;  
  justify-self: center;
}

/* faint offset square behind the photo, for depth */
.portrait-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translate(14px, 14px);
  border: 1px solid var(--apricot);
  opacity: 0.5;
}

/* the two corner brackets, top-left and bottom-right */
.portrait-photo::before,
.portrait-photo::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--blue);
}
.portrait-photo::before { /* top-left corner mark */
  top: -1px;
  left: -1px;
  border-top: 2px solid;
  border-left: 2px solid;
}
.portrait-photo::after { /* bottom-right corner mark */
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid;
  border-right: 2px solid;
}

.portrait-photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(150deg, var(--blue-soft), var(--apricot-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 24px 48px -18px rgba(43, 53, 66, 0.28);
}

.portrait-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-photo .initials {
  font-family: 'Fraunces', serif;
  font-size: 52px;
  color: var(--ink);
  opacity: 0.55;
}

.frame-caption {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 18px;
  letter-spacing: 0.02em;
}


/* ---------------------------------------------------------------------
   8. PAGE HERO
   --------------------------------------------------------------------- */
.page-hero {
  padding: 56px 0 20px;
}
.page-hero h1 {
  font-size: clamp(32px, 4vw, 44px);
  margin-bottom: 14px;
}
.page-hero .lede {
  margin-bottom: 0;
}


/* ---------------------------------------------------------------------
   9. SECTION LABEL
   --------------------------------------------------------------------- */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 36px;
}
.section-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--apricot);
}

.section-heading {
  font-size: clamp(24px, 2.6vw, 30px);
  margin-bottom: 36px;
}

section { padding: 56px 0; }
section.alt {
  background: var(--paper-deep);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

body.compact section:not(.page-hero) {
  padding: 36px 0;
}
body.compact .page-hero {
  padding: 44px 0 16px;
}

.intro-text {
  max-width: 64ch;
  color: var(--ink-soft);
  font-size: 16px;
  margin-bottom: 8px;
}


/* ---------------------------------------------------------------------
   10. CARDS
   --------------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 44px;
}
.card {
  appearance: none;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  margin: 0;

  cursor: pointer;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 28px 26px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -24px rgba(43, 53, 66, 0.35);
}
.card .tag {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--apricot);
  font-weight: 600;
  margin-bottom: 12px;
}
.card h3 {
  font-size: 19px;
  margin-bottom: 10px;
  line-height: 1.3;
}
.card p {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.card .read-more {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--blue);
}


/* ---------------------------------------------------------------------
   11. ENTRY LIST
   --------------------------------------------------------------------- */
.entry-list {
  display: flex;
  flex-direction: column;
}
.entry {
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
.entry:last-child {
  border-bottom: 1px solid var(--rule);
}
.entry-meta {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--apricot);
  font-weight: 600;
  margin-bottom: 8px;
}
.entry h3 {
  font-size: 18px;
  margin-bottom: 6px;
  line-height: 1.35;
}
.entry p {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 100ch;
}
.entry-date {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
  padding-top: 2px;
}
.entry-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  border-bottom: 1px solid var(--blue);
  white-space: nowrap;
  padding-bottom: 1px;
  margin-left: auto; 
}


/* ---------------------------------------------------------------------
   12. BLOG TEASER - currently not in use
   --------------------------------------------------------------------- */
.blog-teaser {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 52px;
  align-items: center;
}
.blog-visual {
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background:
    repeating-linear-gradient(135deg, rgba(76, 110, 145, 0.07) 0 2px, transparent 2px 26px),
    linear-gradient(160deg, var(--apricot-soft), var(--blue-soft));
  position: relative;
}
.blog-visual::after {
  content: "Notion for Physics PhDs";
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--ink);
}

.post-link {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.post-link:first-of-type {
  padding-top: 0;
}
.post-link .pt {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  margin-bottom: 4px;
  transition: color 0.2s;
}
.post-link:hover .pt {
  color: var(--blue);
}
.post-link .pd {
  font-size: 13px;
  color: var(--ink-soft);
}


/* ---------------------------------------------------------------------
   13. FOOTER
   --------------------------------------------------------------------- */
footer {
  padding: 44px 0 52px;
  border-top: 1px solid var(--rule);
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
footer .flinks {
  display: flex;
  gap: 26px;
  font-size: 13px;
  color: var(--ink-soft);
}
footer .fnote {
  font-size: 12px;
  color: var(--ink-soft);
}


/* ---------------------------------------------------------------------
   14. RESPONSIVE
   --------------------------------------------------------------------- */
@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; }
  .hero .wrap { grid-template-columns: 1fr; }
  .portrait-stage { order: -1; max-width: 220px; }
  .blog-teaser { grid-template-columns: 1fr; }
  .notion-embed { --notion-embed-h: 600px; }
}

@media (max-width: 720px) {
  .navlinks { display: none; }
}


/* =====================================================================
   15. FLIP MODAL
   =====================================================================
   HOW IT WORKS, IN PLAIN TERMS:
   - Each topic box is a <button class="card">, not a link — it
     triggers JS, it doesn't navigate anywhere.
   - Each topic has a matching .topic-modal, hidden by default.
   - Clicking a topic box adds the class "is-open" to its matching
     .topic-modal AND to the shared #modal-backdrop (see the <script>
     at the bottom of research.html for the few lines that do this).
   - Adding "is-open" is what triggers the CSS transition below —
     nothing here needs editing when you swap the text content.
   ===================================================================== */

/* --- dimmed background shown behind an open panel --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 53, 66, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 20;
}
.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto; /* only clickable once visible, so it can close the modal */
}

/* --- the enlarged panel itself --- */
.topic-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(600px, 88vw);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 8px;
  padding: 44px 40px;
  box-shadow: 0 40px 80px -20px rgba(43, 53, 66, 0.45);
  z-index: 21;

  /* hidden state: shrunk, rotated, and see-through — this is the
     "flip" starting point that animates in when .is-open is added */
  transform: translate(-50%, -50%) perspective(1200px) rotateY(-18deg) scale(0.85);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s ease, opacity 0.3s ease;
}
.topic-modal.is-open {
  transform: translate(-50%, -50%) perspective(1200px) rotateY(0deg) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.topic-modal .eyebrow { margin-bottom: 14px; }
.topic-modal h3 {
  font-size: 26px;
  margin-bottom: 18px;
}
.topic-modal p {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.topic-modal .dot-list li {
  font-size: 15.5px;
  color: var(--ink-soft);
}
.topic-modal .modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}
.topic-modal .modal-close:hover {
  background: var(--paper-deep);
}

@media (max-width: 600px) {
  .topic-modal { padding: 36px 26px; }
}


/* =====================================================================
   16. VIDEO EMBED
   ===================================================================== */
   .video-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    max-width: 720px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--rule);
    margin: 20px 0;
  }
  .video-embed iframe,
  .video-embed video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
  }


/* =====================================================================
   16b. NOTION EMBED  
   ===================================================================== */
.notion-embed {
  --notion-embed-h: 900px;
  width: 100%;
  max-width: 720px;
  height: var(--notion-embed-h);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--rule);
  margin: 20px 0;
}
.notion-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}


/* =====================================================================
   17. BULLET LIST
   ===================================================================== */
.dot-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.dot-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: inherit;
  color: inherit;
  line-height: 1.5;
}
.dot-list li:last-child {
  margin-bottom: 0;
}
.dot-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--apricot);
}


/* =====================================================================
   18. PAPER CHIPS
   ===================================================================== */
.paper-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.paper-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 100px;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
  font-size: 13px;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}
.paper-chip:hover {
  border-color: var(--apricot);
  background: var(--apricot-soft);
}
