  :root{
    --bg: #FAFAF7;
    --bg-alt: #F3F1EA;
    --ink: #1B1F2B;
    --ink-soft: #4A4F5E;
    --ink-faint: #8B8F9C;
    --accent-blue: #2C5F7C;
    --accent-blue-dim: #C7D8E1;
    --accent-gold: #A9822E;
    --line: #DEDACC;
    --card-bg: #FFFFFF;
    --max-w: 1100px;
  }

  *{ box-sizing: border-box; }
  html{ scroll-behavior: smooth; }

  body{
    margin:0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  a{ color: var(--accent-blue); text-decoration: none; }
  a:hover{ text-decoration: underline; }
  a:focus-visible, button:focus-visible{ outline: 2px solid var(--accent-blue); outline-offset: 3px; }

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

  h1, h2, h3{
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
  }

  .mono{
    font-family: 'IBM Plex Mono', monospace;
  }

  .eyebrow{
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin: 0 0 14px 0;
  }

  /* ---------- Signature wave divider (quasiperiodic interference) ---------- */
  .wave-divider{
    width: 100%;
    height: 46px;
    display: block;
    opacity: 0.55;
  }
  .wave-divider path{
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 1.3;
  }
  .wave-divider path.secondary{
    stroke: var(--accent-gold);
    opacity: 0.6;
  }

  /* ---------- Header / nav ---------- */
  header{
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
  }
  header .wrap{
    display:flex;
    align-items:center;
    justify-content: space-between;
  }
  .brand{
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--ink);
  }
  nav ul{
    list-style:none;
    display:flex;
    gap: 28px;
    margin:0; padding:0;
  }
  nav a{
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 500;
  }
  nav a:hover{ color: var(--accent-blue); text-decoration: none; }

  /* ---------- News ticker ---------- */
  .news-ticker{
    background: var(--ink);
    color: var(--bg);
    padding: 16px 0;
  }
  .ticker-inner{
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .ticker-label{
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16.5px;
    letter-spacing: 0.14em;
    color: var(--accent-gold);
    flex: 0 0 auto;
  }
  .ticker-track{
    position: relative;
    flex: 1 1 auto;
    height: 27px;
    overflow: hidden;
  }
  .ticker-item{
    position: absolute;
    inset: 0;
    display: block;
    color: var(--bg);
    font-size: 20px;
    line-height: 27px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
  }
  .ticker-item.active{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .ticker-item:hover{ text-decoration: underline; }
  .ticker-dots{
    display: flex;
    gap: 9px;
    flex: 0 0 auto;
  }
  .ticker-dots .dot{
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(250,250,247,0.35);
    border: none;
    padding: 0;
    cursor: pointer;
  }
  .ticker-dots .dot.active{ background: var(--accent-gold); }
  .ticker-dots .dot:focus-visible{ outline: 2px solid var(--accent-gold); outline-offset: 2px; }

  @media (max-width: 640px){
    .ticker-label{ display: none; }
  }

  /* ---------- Hero ---------- */
  .hero{
    padding: 72px 0 40px;
    position: relative;
    overflow: hidden;
  }
  .hero-pattern{
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }
  .hero-pattern svg{
    width: 100%;
    height: 100%;
    display: block;
  }
  .hero > .wrap{
    position: relative;
    z-index: 1;
  }
  .hero-grid{
    display:flex;
    gap: 40px;
    align-items: flex-start;
  }
  .avatar{
    flex: 0 0 128px;
    width: 128px; height: 128px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue-dim), var(--bg-alt));
    display:flex; align-items:center; justify-content:center;
    font-family: 'Fraunces', serif;
    font-size: 40px;
    font-weight: 600;
    color: var(--accent-blue);
    border: 1px solid var(--line);
  }
  .hero-text h1{
    font-size: 40px;
    line-height: 1.1;
    margin-bottom: 10px;
  }
  .hero-role{
    color: var(--ink-soft);
    font-size: 16px;
    margin-bottom: 18px;
  }
  .hero-role strong{ color: var(--ink); font-weight: 600; }
  .hero-desc{
    font-size: 16.5px;
    color: var(--ink-soft);
    max-width: 58ch;
    margin-bottom: 24px;
  }
  .cta-row{
    display:flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 22px;
  }
  .btn{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding: 10px 18px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--ink);
  }
  .btn-primary{
    background: var(--ink);
    color: var(--bg);
  }
  .btn-primary:hover{ background: var(--accent-blue); border-color: var(--accent-blue); text-decoration:none; }
  .btn-ghost{
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
  }
  .btn-ghost:hover{ border-color: var(--accent-blue); color: var(--accent-blue); text-decoration:none; }

  .profile-links{
    display:flex;
    gap:18px;
    flex-wrap: wrap;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
  }
  .profile-links a{ color: var(--ink-soft); }
  .profile-links a:hover{ color: var(--accent-blue); }

  /* ---------- Section shell ---------- */
  section{ padding: 52px 0; }
  section.alt{ background: var(--bg-alt); }
  .section-head{ margin-bottom: 30px; }
  .section-head h2{ font-size: 26px; }

  /* ---------- Research cards ---------- */
  .research-grid{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .r-card{
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 22px 24px;
  }
  .r-card h3{
    font-size: 18px;
    margin-bottom: 8px;
  }
  .r-card p{
    color: var(--ink-soft);
    font-size: 14.5px;
    margin: 0;
  }
  .r-tag{
    display:inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--accent-gold);
    margin-bottom: 10px;
  }
  .pub-links{
    list-style:none;
    margin: 14px 0 0 0;
    padding: 10px 0 0 0;
    border-top: 1px solid var(--line);
  }
  .pub-links li{ margin-bottom: 6px; }
  .pub-links li:last-child{ margin-bottom: 0; }
  .pub-links a{
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--accent-blue);
  }

  /* ---------- News ---------- */
  .news-item{
    display:grid;
    grid-template-columns: 100px 1fr;
    gap: 20px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
  }
  .news-item:first-child{ padding-top: 0; }
  .news-item:last-child{ border-bottom:none; }
  .news-date{
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    color: var(--accent-gold);
    padding-top: 3px;
  }
  .news-title{
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--ink);
  }
  .news-body{
    color: var(--ink-soft);
    font-size: 14.5px;
    margin: 0 0 8px 0;
  }
  .news-link{
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
  }
  .placeholder-flag{
    display:inline-block;
    font-family:'IBM Plex Mono', monospace;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-blue);
    background: var(--accent-blue-dim);
    padding: 2px 7px;
    border-radius: 2px;
    margin-left: 8px;
    vertical-align: middle;
  }

  /* ---------- About ---------- */
  .about-body{
    color: var(--ink-soft);
    font-style: italic;
    border-left: 2px solid var(--accent-blue-dim);
    padding-left: 18px;
    max-width: 62ch;
  }

  /* ---------- Publications ---------- */
  .pub-summary{
    display:flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 22px;
  }
  .pub-stat{
    font-family: 'Fraunces', serif;
    font-size: 30px;
    font-weight: 600;
    color: var(--ink);
  }
  .pub-stat span{
    display:block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-top: 4px;
  }

  /* ---------- Footer ---------- */
  footer{
    padding: 40px 0 60px;
    border-top: 1px solid var(--line);
  }
  .footer-row{
    display:flex;
    justify-content: space-between;
    align-items:center;
    flex-wrap: wrap;
    gap: 12px;
  }
  .footer-note{
    color: var(--ink-faint);
    font-size: 13px;
  }

  @media (max-width: 640px){
    .hero-grid{ flex-direction: column; }
    .research-grid{ grid-template-columns: 1fr; }
    nav ul{ gap: 16px; }
    .hero-text h1{ font-size: 32px; }
    .news-item{ grid-template-columns: 1fr; gap: 6px; }
  }

  @media (prefers-reduced-motion: reduce){
    html{ scroll-behavior: auto; }
  }

  /* ---------- Sub-pages (Team / About / Publications) ---------- */
  .page-hero{
    padding: 56px 0 8px;
  }
  .page-hero .eyebrow{ margin-bottom: 10px; }
  .page-hero h1{
    font-size: 34px;
  }
  .back-link{
    display:inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 18px;
  }
  .back-link:hover{ color: var(--accent-blue); }

  .paper-list{
    list-style:none;
    margin: 28px 0 0 0;
    padding: 0;
  }
  .paper-entry{
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
  }
  .paper-entry:first-child{ padding-top: 0; }
  .paper-entry:last-child{ border-bottom: none; }
  .paper-title{
    font-size: 15.5px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 4px 0;
  }
  .paper-title a{ color: var(--ink); }
  .paper-title a:hover{ color: var(--accent-blue); }
  .paper-meta{
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    color: var(--ink-faint);
    margin: 0;
  }

  /* ---------- Current page in nav / sub-page headings ---------- */
  nav a[aria-current="page"]{ color: var(--accent-blue); }
  .subhead{
    font-size: 20px;
    margin: 0 0 18px 0;
  }


  /* ---------- News page (news.html) ---------- */
  /* Entries alternate automatically between the two section backgrounds. */
  .news-entry{
    padding: 52px 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
  .news-entry:nth-of-type(odd){ background: var(--bg-alt); }
  .news-entry h2{
    font-size: 24px;
    line-height: 1.25;
    margin: 0 0 14px 0;
    max-width: 48ch;
  }
  .news-entry .news-date{ margin: 0 0 10px 0; padding: 0; }
  .news-lead{
    font-size: 16.5px;
    color: var(--ink);
    max-width: 62ch;
    margin: 0 0 14px 0;
  }
  .news-longtext{
    color: var(--ink-soft);
    font-size: 15px;
    max-width: 62ch;
  }
  .news-longtext p{ margin: 0 0 12px 0; }
  .news-figure{ margin: 24px 0 22px 0; }
  .news-figure img{
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--card-bg);
  }
  .news-figure-placeholder{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    max-width: 560px;
    border: 1px dashed var(--ink-faint);
    border-radius: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    color: var(--ink-faint);
    background: var(--card-bg);
  }
  .news-figure figcaption{
    font-size: 13px;
    color: var(--ink-faint);
    margin-top: 8px;
    max-width: 62ch;
  }
  .news-title a{ color: var(--ink); }
  .news-title a:hover{ color: var(--accent-blue); }
  .all-news{ margin-top: 22px; }


  /* ---------- Large "Latest" carousel on the home page ---------- */
  .latest{
    background: var(--bg-alt);
    color: var(--ink);
    padding: 56px 0 48px;
  }
  .latest-head{
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 26px;
  }
  .latest .ticker-label{ display: inline; font-size: 14px; }
  /* All slides share one grid cell, so the section is as tall as the longest slide. */
  .latest-track{ display: grid; }
  .latest-slide{
    grid-area: 1 / 1;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    visibility: hidden;
  }
  .latest-slide.active{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
  }
  .latest-date{
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--accent-gold);
    margin: 0 0 12px 0;
  }
  .latest-slide h2{
    font-size: 30px;
    line-height: 1.2;
    max-width: 32ch;
    margin: 0 0 16px 0;
  }
  .latest-slide h2 a{ color: var(--ink); }
  .latest-slide h2 a:hover{ color: var(--accent-blue); text-decoration: none; }
  .latest-body{
    font-size: 17px;
    color: var(--ink-soft);
    max-width: 62ch;
    margin: 0 0 18px 0;
  }
  .latest-link, .latest-all a{
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--accent-blue);
  }
  .latest-all{ margin: 30px 0 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
  .latest .ticker-dots .dot{ background: var(--ink-faint); opacity: 0.5; }
  .latest .ticker-dots .dot.active{ opacity: 1; }
  .latest .ticker-dots .dot.active{ background: var(--accent-gold); }
  @media (max-width: 640px){
    .latest-slide h2{ font-size: 24px; }
    .latest-body{ font-size: 15.5px; }
  }

  .avatar{ overflow: hidden; }
  .avatar img{ width: 100%; height: 100%; object-fit: cover; display: block; }

  /* ---------- About page: contact block, short CV ---------- */
  .about-contact{ font-size: 14.5px; color: var(--ink-soft); margin-bottom: 30px; }
  .about-contact p{ margin: 0 0 6px 0; }
  .about-name{ font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; color: var(--ink); }
  .about-h{ margin-top: 44px; }
  .cv-list{ list-style: none; margin: 0 0 16px 0; padding: 0; }
  .cv-list li{
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    color: var(--ink-soft);
  }
  .cv-list li:last-child{ border-bottom: none; }
  .cv-list strong{ color: var(--ink); font-weight: 600; }
  .cv-years{ font-size: 12.5px; color: var(--accent-gold); padding-top: 2px; }
  @media (max-width: 640px){
    .cv-list li{ grid-template-columns: 1fr; gap: 4px; }
  }

  /* Larger dots in the home-page "Latest" section (30% bigger than the 9px default). */
  .latest .ticker-dots{ gap: 12px; }
  .latest .ticker-dots .dot{ width: 12px; height: 12px; }

  /* Teaching page: supervision sub-headings */
  .sup-h{ font-size: 17px; margin: 26px 0 4px 0; }

  /* Teaching page: section titles at the same size as the News page title */
  .subhead.page-title{ font-size: 34px; margin-bottom: 22px; }

  /* News page: citation line under a news title */
  .news-cite{
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--ink-faint);
    max-width: 70ch;
    margin: 0 0 18px 0;
  }

  /* News page: all figures shown at the same width */
  .news-figure img{ width: 100%; max-width: 480px; }

  /* ---------- Use the full page width for text on every page ---------- */
  .hero-desc, .about-body, .news-lead, .news-longtext, .news-cite,
  .news-entry h2, .news-figure figcaption, .latest-slide h2, .latest-body{
    max-width: none;
  }
  /* News page: on wide screens the figure sits beside the text */
  @media (min-width: 900px){
    .news-entry .news-figure{
      float: left;
      width: 420px;
      margin: 4px 36px 12px 0;
    }
    .news-entry .news-figure img{ max-width: 100%; }
    .news-entry .news-figure-placeholder{ max-width: none; height: 220px; }
    .news-entry .wrap::after{ content: ""; display: block; clear: both; }
  }

  /* Teaching page: PhD / Master's / Other projects headings, more prominent */
  .sup-h{
    font-size: 22px;
    margin: 40px 0 6px 0;
    padding: 4px 0 4px 14px;
    border-left: 4px solid var(--accent-gold);
    color: var(--ink);
  }

  /* About me page: Short CV / Projects headings, same emphasis as on Teaching */
  .subhead.about-h{
    font-size: 22px;
    margin: 44px 0 10px 0;
    padding: 4px 0 4px 14px;
    border-left: 4px solid var(--accent-gold);
  }

  /* Phones: put the name on its own line above the menu so they don't run together */
  @media (max-width: 640px){
    header{ padding: 14px 0 12px; }
    header .wrap{ flex-direction: column; align-items: flex-start; gap: 10px; }
    .brand{ font-size: 20px; }
    nav ul{ gap: 16px; flex-wrap: wrap; row-gap: 6px; }
    nav a{ font-size: 14.5px; }
  }

  /* ---------- Hero: photo beside the name, text below at full column width ---------- */
  .hero-grid{ align-items: center; }
  .hero-text .hero-role{ margin-bottom: 0; }
  .hero-body{ margin-top: 32px; }
  .hero-body .hero-desc{ margin: 0 0 8px; }

  /* ---------- Research word cloud: same width as the text ---------- */
  .hero-cloud-wide{
    display: block;
    width: 100%;
    max-width: 680px;
    height: auto;
    margin: 24px auto 24px;
  }

  /* ---------- Research intro (above the cards) ---------- */
  .research-intro{
    color: var(--ink-soft);
    font-size: 16.5px;
    margin-bottom: 30px;
  }
  .research-intro p{ margin: 0 0 12px; }
  .research-intro strong{ color: var(--ink); }
  .research-intro .research-lines{ margin: 0; }

