@font-face {
  font-family: "Lora";
  src: url("../fonts/lora-roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("../fonts/lora-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("../fonts/lato-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("../fonts/lato-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("../fonts/lato-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}


:root {
  color-scheme: light;
  --page: #f6f2ea;
  --surface: #fcfaf6;
  --ink: #202326;
  --muted: #5f6468;
  --accent: #7a3043;
  --accent-hover: #5e2433;
  --accent-border: #a5747d;
  --accent-underline: #be9b9f;
  --accent-wash: #eee5e4;
  --rule: #d8d2c7;
  --strong-rule: #b9b3a9;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  background: var(--page);
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--sans);
  font-size: 16px;
  font-synthesis: none;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration-color: var(--accent-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentcolor;
}

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

p,
h1,
h2,
h3,
figure,
ul {
  margin-top: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 9px 13px;
  color: var(--surface);
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  column-gap: clamp(44px, 4vw, 64px);
  align-items: start;
  width: min(1280px, calc(100% - 64px));
  min-height: 100vh;
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  min-width: 0;
  padding: 44px 30px 56px 0;
  border-right: 1px solid var(--strong-rule);
}

.portrait {
  width: 144px;
  margin: 0 0 28px;
  aspect-ratio: 1;
}

.portrait picture {
  display: block;
  width: 100%;
  height: 100%;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  background: var(--rule);
}

.introduction h1,
.section-heading h2,
.paper-entry h3,
.abstract-disclosure p {
  font-family: var(--serif);
  font-optical-sizing: auto;
}

.introduction h1,
.section-heading h2,
.paper-entry h3 {
  letter-spacing: -0.018em;
}

.introduction h1 {
  max-width: 7ch;
  margin-bottom: 24px;
  font-size: clamp(2.35rem, 3.4vw, 3.15rem);
  font-weight: 500;
  line-height: 0.94;
}

.biography {
  max-width: 31ch;
  font-size: 0.9rem;
  line-height: 1.52;
}

.biography p {
  margin-bottom: 12px;
}

.contact-groups {
  display: grid;
  justify-items: start;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.45;
}

.contact-group {
  min-width: 0;
  max-width: 100%;
}

.contact-group a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.cv-group .cv-link {
  justify-content: center;
  min-width: 64px;
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--surface);
  background: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.cv-group .cv-link:hover {
  border-color: var(--accent-hover);
  color: var(--surface);
  background: var(--accent-hover);
}

.email-group {
  margin-top: 13px;
}

.email-group .email-link {
  min-height: 30px;
}

.profile-links {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-items: start;
  gap: 5px 16px;
  margin-top: 16px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  min-width: 24px;
  min-height: 26px;
  color: var(--muted);
}

.profile-links a:hover {
  color: var(--accent-hover);
}

main {
  display: block;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 44px 0 130px;
}

.content-section {
  padding-bottom: 68px;
  scroll-margin-top: 24px;
}

.compatibility-anchor {
  position: relative;
  display: block;
  height: 0;
  overflow: hidden;
}

.section-heading {
  display: grid;
  grid-template-columns: auto minmax(36px, 1fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 26px;
}

.section-heading::after {
  height: 1px;
  background: var(--strong-rule);
  content: "";
}

.section-heading h2 {
  margin-bottom: 0;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
}

.section-content {
  min-width: 0;
  max-width: 840px;
}

.paper-entry {
  padding: 0 0 24px;
  border-bottom: 1px solid var(--rule);
}

.paper-entry + .paper-entry {
  padding-top: 24px;
}

.paper-entry h3 {
  margin-bottom: 7px;
  font-size: 1.34rem;
  font-weight: 500;
  line-height: 1.28;
}

.coauthors,
.status {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.93rem;
}

.status em {
  color: var(--ink);
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.resource-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.22rem 0.62rem;
  border: 1px solid var(--accent-border);
  border-radius: 2px;
  text-decoration: none;
}

.resource-links a:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.abstract-disclosure {
  max-width: 72ch;
  margin-top: 12px;
  color: var(--muted);
}

.abstract-disclosure summary {
  display: list-item;
  width: max-content;
  min-height: 44px;
  padding-block: 10px;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 650;
  list-style-position: inside;
}

.abstract-disclosure summary::marker {
  color: var(--accent);
}

.abstract-disclosure p {
  margin: 14px 0 0;
  padding-left: 18px;
  border-left: 2px solid var(--rule);
  font-size: 0.98rem;
  line-height: 1.68;
}

.compact-entry {
  padding-bottom: 22px;
}

.teaching-group + .teaching-group {
  margin-top: 30px;
}

.teaching-group h3 {
  margin-bottom: 13px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.teaching-group h3 span {
  color: var(--muted);
  font-weight: 600;
}

.teaching-course {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
}

.teaching-course h4 {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.35em;
  align-items: baseline;
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 550;
  line-height: 1.25;
}

.teaching-course h4 a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.teaching-course p {
  margin: 0;
  color: var(--muted);
  font-size: 0.89rem;
  line-height: 1.45;
}

.teaching-course-code {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.teaching-group ul {
  margin-bottom: 0;
  padding-left: 1.2em;
}

.teaching-group li + li {
  margin-top: 8px;
}

.teaching-note {
  display: block;
  margin-top: 5px;
}

@media (max-width: 1040px) and (min-width: 761px) {
  .page-shell {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    column-gap: 34px;
    width: min(100% - 48px, 960px);
  }

  .site-header {
    padding-right: 18px;
  }

  .portrait {
    width: 120px;
  }

  .introduction h1 {
    font-size: 2.3rem;
  }

  .biography {
    font-size: 0.84rem;
  }
}

@media (max-height: 840px) and (min-width: 761px) {
  .site-header {
    position: static;
  }
}

@media (max-width: 760px) {
  .page-shell {
    display: block;
    width: min(100% - 36px, 680px);
  }

  .site-header {
    position: static;
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 20px;
    padding: 34px 0 38px;
    border-right: 0;
  }

  .portrait {
    grid-column: 1;
    width: 100px;
    margin-bottom: 0;
  }

  .introduction {
    display: contents;
  }

  .introduction h1 {
    grid-column: 2;
    align-self: center;
    max-width: none;
    margin-bottom: 0;
    font-size: clamp(2.25rem, 12vw, 3.25rem);
  }

  .biography {
    grid-column: 1 / -1;
    max-width: 62ch;
    margin-top: 10px;
    font-size: 1rem;
    line-height: 1.6;
  }

  .contact-groups {
    grid-column: 1 / -1;
    margin-top: 2px;
    padding-top: 14px;
    font-size: 0.9rem;
  }

  .email-group {
    margin-top: 14px;
  }

  .profile-links {
    gap: 6px 16px;
    margin-top: 15px;
    font-size: 0.82rem;
  }

  .contact-group a,
  .profile-links a {
    min-height: 28px;
  }

  .profile-links a {
    min-width: 28px;
  }

  .cv-group .cv-link {
    min-width: 68px;
    min-height: 44px;
  }

  main {
    padding: 32px 0 90px;
  }

  .content-section {
    padding-bottom: 50px;
  }

  .section-heading {
    grid-template-columns: auto minmax(24px, 1fr);
    gap: 16px;
    margin-bottom: 22px;
  }

  .section-content {
    max-width: none;
  }

  .paper-entry h3 {
    font-size: 1.25rem;
  }

  .resource-links a {
    min-height: 44px;
  }

  .teaching-course {
    display: block;
  }

  .teaching-course h4 {
    margin-bottom: 4px;
  }

  .teaching-course h4 a {
    min-height: 44px;
  }
}

@media (max-width: 340px) {
  .site-header {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 14px;
  }

  .portrait {
    width: 82px;
  }

  .introduction h1 {
    font-size: 2.18rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .resource-links a {
    border-color: currentcolor;
  }
}

@media print {
  @page {
    margin: 16mm;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 10.5pt;
  }

  a {
    color: #000;
    text-decoration-color: #000;
  }

  .skip-link {
    display: none;
  }

  .page-shell {
    display: block;
    width: 100%;
  }

  .site-header {
    position: static;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 20px;
    padding: 0 0 26px;
    border: 0;
  }

  .portrait {
    width: 78px;
    margin: 0;
  }

  .introduction {
    display: block;
  }

  .introduction h1 {
    max-width: none;
    margin-bottom: 10px;
    font-size: 24pt;
  }

  .biography {
    max-width: 76ch;
    font-size: 9.5pt;
  }

  .biography p {
    margin-bottom: 6px;
  }

  .contact-groups {
    display: grid;
    margin-top: 6px;
    padding-top: 0;
    border: 0;
    font-size: 9pt;
  }

  .email-group {
    margin-top: 4px;
  }

  .profile-links {
    display: flex;
    gap: 4px 14px;
    margin-top: 4px;
    font-size: 9pt;
  }

  .cv-group .cv-link {
    min-width: 0;
    min-height: 0;
    padding: 1px 6px;
    border-color: #000;
    color: #000;
    background: transparent;
  }

  main {
    padding: 0;
  }

  .content-section {
    padding-bottom: 24px;
  }

  .section-heading {
    margin-bottom: 14px;
  }

  .paper-entry {
    padding-bottom: 14px;
  }

  .paper-entry + .paper-entry {
    padding-top: 14px;
  }

  .resource-links a {
    min-height: 0;
    padding: 1px 6px;
  }

  .abstract-disclosure:not([open]) > *:not(summary) {
    display: block;
  }

  .abstract-disclosure summary {
    min-height: 0;
    padding-block: 5px;
  }

  .section-heading,
  .teaching-group,
  .teaching-course {
    break-after: avoid;
  }
}

/* =========================================================
   Kaytan customization: brown right-hand identity panel
   (overrides, kept at end of file so they win by source order)
   ========================================================= */
:root {
  --panel: #39251f;            /* rich chocolate */
  --panel-ink: #f4ede1;        /* warm cream text on the panel      */
  --panel-muted: #cdbaac;      /* secondary text on the panel       */
  --panel-rule: rgba(244, 237, 225, 0.22);

  /* Retune the old red accent to the same muted-brown family:
     headings, links, rules and buttons on the cream side all follow these. */
  --accent: #39251f;
  --accent-hover: #241310;
  --accent-border: #a99a8f;
  --accent-underline: #b9a99d;
  --accent-wash: #ece3da;

  /* Typefaces: Lora (serif headings) + Lato (sans body) */
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Headings in Lora, a touch bolder */
.introduction h1 { font-weight: 700; }
.section-heading h2,
.paper-entry h3 { font-weight: 600; }

/* Full-bleed two-column grid: content left (cream), panel right (brown) */
.page-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  grid-template-columns: clamp(320px, 40vw, 500px) minmax(0, 1fr);
  column-gap: 0;
  align-items: stretch;
}

/* Right: main content column, cream, with its own comfortable padding */
main {
  grid-column: 2;
  grid-row: 1;
  padding: clamp(44px, 5vh, 64px) clamp(28px, 5vw, 88px) 120px;
}
.section-content {
  max-width: 760px;
}

/* Left: the brown identity panel — sticky, full height, bleeds to edge */
.site-header {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: clamp(40px, 6vh, 68px) clamp(28px, 2.6vw, 52px) 48px;
  background: var(--panel);
  color: var(--panel-ink);
  border-right: 0;
}

/* Rectangular (4:5) portrait, filling the panel width */
.portrait {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 4 / 5;
  margin: 0 0 26px;
  border-radius: 6px;
  overflow: hidden;
}
.portrait img {
  object-position: center 26%;
  background: rgba(255, 255, 255, 0.08);
}

/* Cream text + links throughout the panel */
.site-header .introduction h1 { color: var(--panel-ink); }
.site-header .biography { color: var(--panel-ink); max-width: 34ch; }
.site-header a { color: var(--panel-ink); }
.site-header .biography a { text-decoration: underline; text-decoration-color: var(--panel-rule); text-underline-offset: 2px; }
.site-header .biography a:hover,
.site-header .profile-links a:hover { color: #ffffff; }
.site-header .contact-groups { border-top-color: var(--panel-rule); }
.site-header .email-group .email-link { color: var(--panel-muted); }

/* CV button → cream outline on brown */
.site-header .cv-group .cv-link {
  color: var(--panel-ink);
  background: transparent;
  border-color: var(--panel-ink);
}
.site-header .cv-group .cv-link:hover {
  color: var(--panel);
  background: var(--panel-ink);
  border-color: var(--panel-ink);
}

/* Paper thumbnail figures */
.paper-figure { margin: 16px 0 4px; }
.paper-figure img {
  width: 100%;
  max-width: 600px;
  height: auto;
}

/* ---- Mobile (<=760px): brown banner on top, content below ---- */
@media (max-width: 760px) {
  .page-shell {
    display: block;
    width: 100%;
    max-width: none;
  }
  .site-header {
    position: static;
    height: auto;
    overflow: visible;
    background: var(--panel);
    color: var(--panel-ink);
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 18px;
    padding: 30px clamp(20px, 6vw, 34px) 36px;
    border-right: 0;
  }
  .portrait {
    width: 116px;
    max-width: 116px;
    aspect-ratio: 4 / 5;
    margin: 0;
  }
  .site-header .introduction h1,
  .site-header .biography,
  .site-header a { color: var(--panel-ink); }
  .site-header .biography { max-width: 60ch; }
  .site-header .email-group .email-link { color: var(--panel-muted); }
  .site-header .contact-groups { border-top-color: var(--panel-rule); }
  main {
    padding: 32px clamp(20px, 6vw, 34px) 80px;
  }
}

/* --- Final round: neutral-warm background + no divider lines --- */
:root {
  --page: #f5f3ee;   /* cream, more neutral but still faintly warm */
}
/* remove the horizontal line beside section headings */
.section-heading::after { content: none; }
/* remove separators between papers and teaching rows */
.paper-entry { border-bottom: 0; }
.teaching-course { border-bottom: 0; }

/* === Space/typography tuning === */
/* wider brown panel; trim its vertical padding so content fits without a scrollbar */
.page-shell { grid-template-columns: clamp(360px, 42vw, 560px) minmax(0, 1fr); }
.site-header {
  padding: clamp(32px, 4vh, 52px) clamp(28px, 2.6vw, 48px) 40px;
  scrollbar-width: none;            /* hide inner scrollbar (Firefox) */
}
.site-header::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* hide (WebKit) */
.portrait { margin-bottom: 20px; }

/* let content use the horizontal space so paper titles sit on one line */
main { padding: clamp(44px, 5vh, 64px) clamp(20px, 1.8vw, 36px) 120px clamp(24px, 3vw, 48px); }
.section-content { max-width: none; }
.abstract-disclosure p { max-width: 74ch; }   /* keep paragraphs readable */

/* heading hierarchy: name (largest) > section headings > paper titles (slightly smaller) */
.section-heading h2 { font-size: 1.85rem; }
.paper-entry h3 { font-size: 1.55rem; letter-spacing: -0.012em; }

/* small text up ~1px (panel + content) */
.biography { font-size: 0.96rem; }
.contact-groups { font-size: 0.94rem; }
.email-link { font-size: 0.98rem; }
.cv-link { font-size: 0.98rem; }
.profile-links { font-size: 0.86rem; }
.coauthors { font-size: 0.99rem; }
.status { font-size: 0.91rem; }
.abstract-disclosure summary { font-size: 0.9rem; }
.abstract-disclosure p { font-size: 1.04rem; }
.resource-links a { font-size: 0.88rem; }
.teaching-course p { font-size: 0.95rem; }

/* keep phones sensible (desktop tuning above shouldn't leak down) */
@media (max-width: 760px) {
  main { padding: 32px clamp(20px, 6vw, 34px) 80px; }
  .section-heading h2 { font-size: 1.5rem; }
  .paper-entry h3 { font-size: 1.3rem; }
}

/* === More tuning === */
/* name on one line (there's room in the wider panel) */
.introduction h1 { max-width: none; }
@media (min-width: 761px) { .introduction h1 { white-space: nowrap; } }

/* abstracts use the full content width */
.abstract-disclosure p { max-width: none; }

/* one divider line between teaching items */
.teaching-course + .teaching-course { border-top: 1px solid var(--rule); }

/* abstract container also full width */
.abstract-disclosure { max-width: none; }

/* === Balance pass === */
/* narrower brown panel, content vertically centered to use the space */
.page-shell { grid-template-columns: clamp(340px, 38vw, 520px) minmax(0, 1fr); }
@media (min-width: 761px) {
  .site-header { display: flex; flex-direction: column; justify-content: safe center; }
}

/* big titles down ~1px */
.section-heading h2 { font-size: 1.78rem; }
.paper-entry h3 { font-size: 1.48rem; }

/* metadata + abstracts up ~1px */
.coauthors { font-size: 1.05rem; }
.status { font-size: 0.97rem; }
.abstract-disclosure summary { font-size: 0.96rem; }
.abstract-disclosure p { font-size: 1.1rem; }

/* === Panel: narrower + content centered so margins are even === */
.page-shell { grid-template-columns: clamp(360px, 32vw, 450px) minmax(0, 1fr); }
@media (min-width: 761px) {
  .site-header {
    align-items: center;
    padding: clamp(32px, 5vh, 56px) clamp(22px, 1.6vw, 30px) 40px;
  }
  .portrait { max-width: 320px; }
  .introduction { width: 100%; max-width: 320px; }
  .site-header .biography { max-width: none; }
}

/* === Neutral background (clearly less yellow than before) === */
:root {
  --page: #f3f2ef;          /* neutral cream, only a faint warmth */
  --surface: #f9f8f6;
  --rule: #dcd9d3;
  --strong-rule: #bdbab4;
  --accent-wash: #eae6e1;
}
