/* ═══════════════════════════════════════════════════════════════
   Om Dehlan — site styles.
   Design tokens at the top; everything derives from them.
   ═══════════════════════════════════════════════════════════════ */

:root{
  /* color */
  --paper:    #FDFDFB;
  --ink:      #1B2026;
  --muted:    #5B6570;
  --hairline: #E4E7E9;
  --carolina: #4B9CD3;   /* links, accents */
  --navy:     #13294B;   /* headings, strong accents */
  --tint:     #F2F7FB;   /* callouts, code blocks */
  --ochre:    #B8923E;
  --header-bg: rgba(253,253,251,.82);

  /* distribution segments (hero strip, thread dots, favicon) */
  --seg1: #13294B;
  --seg2: #4B9CD3;
  --seg3: #A9CEE8;
  --seg4: #B8923E;

  --sel-bg: #A9CEE8;
  --sel-fg: #13294B;

  /* aurora backdrop fields */
  --aur1: rgba(75, 156, 211, 0.16);   /* carolina */
  --aur2: rgba(169, 206, 232, 0.26);  /* sky */
  --aur3: rgba(184, 146, 62, 0.10);   /* ochre warmth */
  --aur4: rgba(19, 41, 75, 0.08);     /* navy depth */

  /* fluid type scale — phone → desktop */
  --fs--1: clamp(0.79rem, 0.76rem + 0.15vw, 0.86rem);
  --fs-0:  clamp(1.00rem, 0.95rem + 0.30vw, 1.13rem);
  --fs-1:  clamp(1.10rem, 1.04rem + 0.35vw, 1.25rem);
  --fs-2:  clamp(1.28rem, 1.18rem + 0.55vw, 1.55rem);
  --fs-3:  clamp(1.70rem, 1.45rem + 1.30vw, 2.20rem);
  --fs-4:  clamp(2.25rem, 1.75rem + 2.60vw, 3.00rem);

  --serif: "Newsreader", "Iowan Old Style", "Charter", Georgia, serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --header-h: 58px;

  /* wide-screen layout (≥1024px): label/photo gutter + reading column.
     Below that the site is a single centered column. */
  --aside-w:   200px;
  --col-gap:   56px;
  --content-w: 720px;
}

/* Dark theme — keep in sync with the media-query block below */
:root[data-theme="dark"]{
  --paper:    #14181D;
  --ink:      #E7EAEC;
  --muted:    #99A3AC;
  --hairline: #2A3138;
  --carolina: #6FB1DC;
  --navy:     #A6C8E8;
  --tint:     #1B222B;
  --ochre:    #C9A45A;
  --header-bg: rgba(20,24,29,.80);
  --seg1: #3F6FA8;
  --seg2: #5BA7DC;
  --seg3: #A9CEE8;
  --seg4: #C9A45A;
  --sel-bg: #35506B;
  --sel-fg: #E7EAEC;
  --aur1: rgba(91, 167, 220, 0.14);
  --aur2: rgba(63, 111, 168, 0.20);
  --aur3: rgba(201, 164, 90, 0.10);
  --aur4: rgba(169, 206, 232, 0.07);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --paper:    #14181D;
    --ink:      #E7EAEC;
    --muted:    #99A3AC;
    --hairline: #2A3138;
    --carolina: #6FB1DC;
    --navy:     #A6C8E8;
    --tint:     #1B222B;
    --ochre:    #C9A45A;
    --header-bg: rgba(20,24,29,.80);
    --seg1: #3F6FA8;
    --seg2: #5BA7DC;
    --seg3: #A9CEE8;
    --seg4: #C9A45A;
    --sel-bg: #35506B;
    --sel-fg: #E7EAEC;
  }
}

/* ── Base ────────────────────────────────────────────────── */

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; background: var(--paper); transition: background-color .2s ease; }
html.palette-lock{ overflow: hidden; }

body{
  margin: 0;
  background: transparent; /* html carries the paper so the field and grain can sit behind content */
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .2s ease, color .2s ease;
}

/* paper grain — barely there */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::before{ opacity: .055; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) body::before{ opacity: .055; }
}

/* ambient aurora backdrop (config: BACKDROP in data.js) */
.aurora{
  position: fixed;
  inset: 0;
  z-index: -2;               /* behind content and the paper grain */
  overflow: hidden;
  pointer-events: none;
}
.aurora span{
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.aurora .a1{
  width: 60vmax; height: 60vmax; left: -15vmax; top: -22vmax;
  background: radial-gradient(closest-side, var(--aur1), transparent 72%);
  animation: aur-a 47s ease-in-out infinite alternate;
}
.aurora .a2{
  width: 52vmax; height: 52vmax; right: -14vmax; top: -6vmax;
  background: radial-gradient(closest-side, var(--aur2), transparent 72%);
  animation: aur-b 59s ease-in-out infinite alternate;
}
.aurora .a3{
  width: 46vmax; height: 46vmax; left: 8vmax; bottom: -20vmax;
  background: radial-gradient(closest-side, var(--aur3), transparent 72%);
  animation: aur-c 71s ease-in-out infinite alternate;
}
.aurora .a4{
  width: 40vmax; height: 40vmax; right: 2vmax; bottom: -14vmax;
  background: radial-gradient(closest-side, var(--aur4), transparent 72%);
  animation: aur-d 83s ease-in-out infinite alternate;
}
@keyframes aur-a{ to{ transform: translate3d(9vmax, 6vmax, 0) scale(1.12); } }
@keyframes aur-b{ to{ transform: translate3d(-7vmax, 9vmax, 0) scale(0.92); } }
@keyframes aur-c{ to{ transform: translate3d(10vmax, -7vmax, 0) scale(1.10); } }
@keyframes aur-d{ to{ transform: translate3d(-9vmax, -5vmax, 0) scale(1.08); } }
@media (prefers-reduced-motion: reduce){
  .aurora span{ animation: none; }
}

.page{
  max-width: 700px;
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-left)) 48px
             max(24px, env(safe-area-inset-right));
  /* stretch to the viewport so the footer sits at the bottom on short pages */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.page > main{ flex: 1 0 auto; min-width: 0; }
.page > .site-footer{ flex-shrink: 0; }

[id]{ scroll-margin-top: calc(var(--header-h) + 20px); }
[hidden]{ display: none !important; }

a{
  color: var(--carolina);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
a:hover{ border-bottom-color: var(--carolina); }
a:focus-visible, button:focus-visible, input:focus-visible{
  outline: 2px solid var(--carolina);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection{ background: var(--sel-bg); color: var(--sel-fg); }

p{ margin: 0 0 16px; }
p:last-child{ margin-bottom: 0; }

.sc{ font-variant: small-caps; }

kbd{
  font-family: var(--mono);
  font-size: .82em;
  border: 1px solid var(--hairline);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
}

.skip{
  position: absolute;
  left: -9999px;
  background: var(--navy);
  color: var(--paper);
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 13px;
  z-index: 60;
}
.skip:focus{ left: 12px; top: 12px; }

/* ── Sticky site header ──────────────────────────────────── */

.site-header{
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--header-h);
  margin: 0 0 36px;
  padding: 8px 2px;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  view-transition-name: site-header;
}

.brand{
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}
.brand:hover{ border-bottom-color: transparent; color: var(--carolina); }

.site-nav{
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 13px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.site-nav::-webkit-scrollbar{ display: none; }
.site-nav a{
  color: var(--muted);
  padding: 8px 0;            /* comfortable touch target */
  white-space: nowrap;
}
.site-nav a:hover{ color: var(--carolina); }
.site-nav a[aria-current="page"]{
  color: var(--ink);
  border-bottom-color: var(--carolina);
}

.theme-toggle{
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  padding: 8px 6px;
}
.theme-toggle:hover{ color: var(--carolina); }

@media (max-width: 640px){
  .site-nav{
    mask-image: linear-gradient(90deg, #000 0, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 90%, transparent);
  }
}

/* ── Hero (index) ────────────────────────────────────────── */

.hero{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  margin-top: 10px;
}

.masthead h1{
  font-size: var(--fs-4);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin: 0 0 6px;
  color: var(--navy);
  text-wrap: balance;
}

.masthead .role{
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
}
.masthead .role a{ color: var(--muted); }
.masthead .role a:hover{ color: var(--carolina); }

.tagline{
  font-style: italic;
  font-size: var(--fs-1);
  margin: 0 0 20px;
  max-width: 30em;
  text-wrap: pretty;
}

.headshot{ flex-shrink: 0; }
.headshot img,
.photo-fallback{
  width: clamp(104px, 9vw + 80px, 150px);
  aspect-ratio: 1;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  object-fit: cover;
  display: block;
}
.photo-fallback{
  background: var(--tint);
  color: var(--navy);
  font-family: var(--mono);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* hero photo rotator (activates with 2+ PHOTOS entries) */
.photo-rotor{
  display: block;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 8px;
}
.photo-rotor img{ transition: opacity .25s ease; }
.photo-dots{
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 8px;
}
.photo-dots span{
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--hairline);
  transition: background-color .2s ease;
}
.photo-dots span.active{ background: var(--carolina); }
.visually-hidden{
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}



.threads-line{
  font-family: var(--mono);
  font-size: 12.5px;
  margin: 4px 0 0;
}
.threads-line a{ color: var(--muted); padding: 4px 0; }
.threads-line a:hover{ color: var(--carolina); }
.threads-line .sep{ color: var(--hairline); margin: 0 7px; user-select: none; }

.links{
  font-family: var(--mono);
  font-size: 13px;
  margin: 22px 0 0;
}
.links a{ color: var(--ink); padding: 6px 0; }
.links a:hover{ color: var(--carolina); }
.links .sep{ color: var(--hairline); margin: 0 7px; user-select: none; }

.now{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 0;
  line-height: 1.8;
}
.now-label{
  color: var(--paper);
  background: var(--ochre);
  border-radius: 3px;
  padding: 1px 6px;
  margin-right: 6px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 10px;
}

/* ── Page titles (inner pages) ───────────────────────────── */

.page-title{
  font-size: var(--fs-3);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 10px 0 8px;
  text-wrap: balance;
}
.page-intro{
  font-style: italic;
  font-size: var(--fs-1);
  margin: 0 0 8px;
  max-width: 32em;
  text-wrap: pretty;
}

/* ── Sections ────────────────────────────────────────────── */

section{
  margin-top: 52px;
  padding-top: 36px;
  border-top: 1px solid var(--hairline);
}
section.first{
  margin-top: 36px;
  padding-top: 0;
  border-top: none;
}

.eyebrow{
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 20px;
}

.callout{
  border-left: 3px solid var(--navy);
  background: var(--tint);
  padding: 12px 18px;
  margin: 22px 0 0;
  font-size: var(--fs-0);
  border-radius: 0 6px 6px 0;
}
.callout em{ font-weight: 500; }

.empty{
  border: 1px dashed var(--hairline);
  border-radius: 6px;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.section-foot{
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 18px;
}

/* ── News ────────────────────────────────────────────────── */

.news{ list-style: none; margin: 0; padding: 0; }
.news li{
  display: flex;
  gap: 20px;
  padding: 7px 0;
  align-items: baseline;
}
.news time{
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  flex-shrink: 0;
  width: 76px;
}
.news .item{ font-size: var(--fs-0); }

.news-more{
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--carolina);
  padding: 10px 0 0;
}
.news-more:hover{ text-decoration: underline; }

/* ── Publications ────────────────────────────────────────── */

.filters{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
}
.chip{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.chip:hover{ border-color: var(--carolina); color: var(--carolina); }
.chip.active{
  background: var(--navy);
  border-color: var(--navy);
  color: var(--paper);
}

.pub-year{
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 30px 0 18px;
}
.pub-year:first-child{ margin-top: 0; }

.pub{
  margin-bottom: 30px;
  padding-left: 14px;
  border-left: 2px solid transparent;
  transition: border-color .2s ease;
}
.pub:hover{ border-left-color: var(--hairline); }
.pub:last-child{ margin-bottom: 0; }
.pub:target{ animation: flash 1.6s ease 1; }
@keyframes flash{
  0%{ background: var(--tint); }
  100%{ background: transparent; }
}

.venue{
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 3px;
  padding: 2px 7px;
  margin-bottom: 8px;
}

.pub h3{
  font-size: var(--fs-1);
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 6px;
  text-wrap: pretty;
}
.pub h3 a{ color: var(--ink); }
.pub h3 a:hover{ color: var(--carolina); border-bottom-color: var(--carolina); }

.authors{ font-size: 16px; color: var(--muted); margin: 0 0 6px; }
.authors .me{ color: var(--ink); font-weight: 600; }

.tldr{ font-size: 16px; margin: 0 0 8px; }
.tldr strong{ font-weight: 600; }

.pub-links{ font-family: var(--mono); font-size: 12.5px; }
.pub-links a{ margin-right: 14px; padding: 6px 0; }

.bib{ position: relative; margin-top: 10px; }
.bib pre{
  background: var(--tint);
  border-left: 3px solid var(--navy);
  border-radius: 0 6px 6px 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  padding: 14px 16px;
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}
.bib-copy{
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 3px 9px;
  cursor: pointer;
}
.bib-copy:hover{ color: var(--carolina); border-color: var(--carolina); }

.equal-note{
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 14px;
}

/* ── Research threads & projects ─────────────────────────── */

.thread{ display: flex; gap: 14px; margin-bottom: 26px; }
.thread:last-child{ margin-bottom: 0; }

.dot{
  width: 11px; height: 11px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 9px;
}
.dot-1{ background: var(--seg1); }
.dot-2{ background: var(--seg2); }
.dot-3{ background: var(--seg3); }
.dot-4{ background: var(--seg4); }

.thread h3{ font-size: var(--fs-1); font-weight: 600; margin: 0 0 4px; }
.thread p{ font-size: 16.5px; margin: 0 0 8px; }
.thread .rep{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.thread .rep a{ color: var(--carolina); }

.projects-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 860px){
  .projects-grid{ grid-template-columns: 1fr 1fr; }
}

.project{
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 0;
  transition: border-color .2s ease, transform .2s ease;
}
.project:hover{ border-color: var(--carolina); transform: translateY(-2px); }
.project h3{ font-size: 17px; font-weight: 600; margin: 0 0 2px; }
.project .meta{
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin: 0 0 8px;
}
.project p{ font-size: 15.5px; margin: 0; }

/* ── Entries (teaching page) ─────────────────────────────── */

.entry{ margin-bottom: 18px; }
.entry:last-child{ margin-bottom: 0; }
.entry h3{ font-size: 17.5px; font-weight: 600; margin: 0 0 2px; }
.entry .meta{
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin: 0 0 4px;
}
.entry p{ font-size: 16px; margin: 0; }

/* ── Notes ───────────────────────────────────────────────── */

.note-item{ margin-bottom: 22px; }
.note-item time{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.note-item h3{ font-size: var(--fs-1); font-weight: 600; margin: 2px 0 4px; }
.note-item p{ font-size: 16px; color: var(--muted); margin: 0; }

.prose h2{ font-size: var(--fs-2); font-weight: 600; color: var(--navy); margin: 36px 0 12px; }
.prose blockquote{
  border-left: 3px solid var(--hairline);
  margin: 0 0 16px;
  padding: 2px 18px;
  color: var(--muted);
  font-style: italic;
}
.prose code{
  font-family: var(--mono);
  font-size: .82em;
  background: var(--tint);
  padding: 1px 5px;
  border-radius: 3px;
}
.prose pre{
  background: var(--tint);
  padding: 14px 16px;
  overflow-x: auto;
  border-left: 3px solid var(--navy);
  border-radius: 0 6px 6px 0;
}
.prose pre code{ background: none; padding: 0; font-size: 13px; }
.article-meta{
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 28px;
}

/* ── Footer ──────────────────────────────────────────────── */

.site-footer{
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.palette-hint-footer{
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  padding: 0;
  cursor: pointer;
}
.palette-hint-footer:hover{ color: var(--carolina); }
@media (hover: none){
  .palette-hint-footer{ display: none; }
}

/* ── Toast ───────────────────────────────────────────────── */

.toast{
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: var(--navy);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 70;
}
.toast.show{ opacity: 1; transform: translate(-50%, 0); }

/* ── Command palette ─────────────────────────────────────── */

.palette{
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}
.palette.open{ display: block; }
.palette-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 26, .35);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.palette-box{
  position: relative;
  max-width: 560px;
  margin: 12vh auto 0;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(10, 16, 26, .25);
  overflow: hidden;
  width: calc(100% - 32px);
  animation: palette-in .16s ease-out both;
}
@keyframes palette-in{
  from{ opacity: 0; transform: translateY(6px) scale(.99); }
  to  { opacity: 1; transform: none; }
}
.palette-box input{
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  padding: 15px 18px;
}
.palette-box input:focus{ outline: none; }
.palette-box ul{
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: min(46vh, 380px);
  overflow-y: auto;
}
.palette-box li{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 15px;
  cursor: pointer;
}
.palette-box li span{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.palette-box li.active,
.palette-box li:hover{ background: var(--tint); }
.palette-box li.palette-none{
  cursor: default;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.palette-box li.palette-none:hover{ background: none; }
.palette-hint{
  margin: 0;
  padding: 9px 16px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ── 404 ─────────────────────────────────────────────────── */

.lost{ text-align: center; padding: 80px 0 40px; }
.lost-eyes{ display: flex; gap: 14px; justify-content: center; margin: 0 auto 26px; }
.lost-eyes span{
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--tint); border: 2px solid var(--navy);
  position: relative; overflow: hidden;
}
.lost-eyes span::after{
  content: ""; position: absolute; top: 11px; left: 12px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--navy);
  animation: look 4.5s ease-in-out infinite;
}
@keyframes look{
  0%, 18%{ transform: translateX(0); }
  26%, 44%{ transform: translateX(-7px); }
  52%, 72%{ transform: translateX(7px); }
  80%, 100%{ transform: translateX(0); }
}
.lost h1{ font-size: var(--fs-4); color: var(--navy); margin: 0 0 8px; }
.lost p{ font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ── Scroll reveal ───────────────────────────────────────── */

.reveal{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.in{ opacity: 1; transform: none; }

/* ── Cross-page view transitions ─────────────────────────── */

@view-transition{ navigation: auto; }
::view-transition-old(root),
::view-transition-new(root){ animation-duration: .18s; }

/* ── Wide screens (laptops, landscape) ───────────────────── */
/* Above 1024px the single column gives way to a two-column grid:
   a narrow gutter on the left (hero photo, section labels, years)
   and a reading column on the right. The reading column keeps a
   book-like measure, so lines never get long; the page as a whole
   uses the width instead of floating in empty margins. */

@media (min-width: 1024px){
  .page{
    max-width: calc(var(--aside-w) + var(--col-gap) + var(--content-w) + 48px);
  }

  /* main is the grid; every direct child lives in the reading column
     unless it is a section or the hero, which span both columns and
     repeat the same column template so their contents line up. */
  #main{
    display: grid;
    grid-template-columns: var(--aside-w) minmax(0, var(--content-w));
    column-gap: var(--col-gap);
    align-content: start;
  }
  #main > *{ grid-column: 2; min-width: 0; }
  #main > section,
  #main > .hero{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: var(--aside-w) minmax(0, var(--content-w));
    column-gap: var(--col-gap);
    align-items: start;
  }
  #main > section > *,
  #main > .hero > *{ grid-column: 2; min-width: 0; }

  /* section label sits in the gutter, level with the first line */
  #main > section > .eyebrow{
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    padding-top: 4px;
  }

  /* hero: portrait in the gutter, name and links beside it
     (selectors carry #main so they outrank the column-2 default) */
  #main > .hero > .headshot{ grid-column: 1; grid-row: 1; }
  #main > .hero > .masthead{ grid-column: 2; grid-row: 1; }
  .headshot img,
  .photo-fallback{ width: 100%; max-width: var(--aside-w); }
  .photo-rotor{ width: 100%; }
  .photo-fallback{ font-size: 36px; }

  /* publications: years in the gutter, papers beside them */
  [data-pubs="full"]{ display: contents; }
  [data-pubs="full"] > .pub-year{
    grid-column: 1;
    margin: 0;
    padding-top: 4px;
  }
  [data-pubs="full"] > .pub{ grid-column: 2; }
  [data-pubs="full"] > .pub:last-child{ margin-bottom: 30px; }
  [data-pubs="full"] > .empty,
  [data-pubs="full"] > noscript,
  [data-pubs="full"] > p{ grid-column: 2; }

  /* news dates get a little more room */
  .news time{ width: 84px; }
}

@media (min-width: 1280px){
  :root{
    --aside-w:   220px;
    --col-gap:   64px;
    --content-w: 740px;
  }
}

/* ── Motion, print ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  @view-transition{ navigation: none; }
  .reveal{ opacity: 1; transform: none; }
}

@media print{
  .site-nav, .theme-toggle, .news-more, .filters, .skip,
  .toast, .palette, .palette-hint-footer{ display: none !important; }
  .site-header{ position: static; background: none; }
  body{ font-size: 12pt; }
  body::before{ display: none; }
  a{ color: inherit; }
}
