:root {
  --ink: #171717;
  --muted: #6c6964;
  --paper: #fbfaf7;
  --warm: #f3f0e9;
  --line: #d8d3ca;
  --accent: #7a2733;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: rgba(122, 39, 51, .38); text-underline-offset: 4px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.shell { width: min(calc(100% - 48px), var(--max)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(23, 23, 23, .08);
  background: rgba(251, 250, 247, .94);
  backdrop-filter: blur(14px);
}
.nav-wrap {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.015em;
  text-decoration: none;
}
nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; }
nav a { font-size: .84rem; font-weight: 650; text-decoration: none; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) 300px;
  gap: 64px;
  padding-top: 92px;
  padding-bottom: 94px;
  align-items: start;
}
.kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, .paper h3, .course h3 { font-family: Georgia, "Times New Roman", serif; }
h1 {
  margin-bottom: 12px;
  font-size: clamp(3.5rem, 8vw, 6.4rem);
  line-height: .92;
  letter-spacing: -.055em;
  font-weight: 600;
}
.hero-role { margin-bottom: 28px; font-size: 1.05rem; font-weight: 650; }
.hero-intro {
  max-width: 730px;
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.12rem, 2vw, 1.32rem);
  line-height: 1.55;
}
.hero-bio { max-width: 730px; margin-bottom: 24px; color: var(--muted); font-size: .93rem; }
.text-links { display: flex; flex-wrap: wrap; gap: 17px; }
.text-links a { color: var(--ink); font-size: .84rem; font-weight: 650; text-decoration: none; }
.text-links a:hover { color: var(--accent); }
.hero-side { padding-top: 3px; }
.portrait-wrap { margin: 0 0 22px; }
.portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.07;
  object-fit: cover;
  object-position: center 26%;
  filter: saturate(.88) contrast(.98);
  border-radius: 2px;
}
.cfcs-mark {
  display: block;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  margin: 0;
  opacity: .52;
  text-decoration: none;
  transition: opacity .18s ease;
}
.cfcs-mark:hover { opacity: .78; }
.cfcs-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.affiliation { padding-top: 16px; border-top: 2px solid var(--ink); color: var(--muted); font-size: .86rem; }
.affiliation p { margin-bottom: 12px; }
.affiliation strong { color: var(--ink); font-weight: 650; }
.affiliation-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.affiliation-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.affiliation-heading p { margin: 0; }
.cfcs-qr {
  display: block;
  width: 72px;
  height: auto;
  flex: 0 0 72px;
  border: 1px solid var(--line);
  background: #fff;
}

.section { padding-top: 88px; padding-bottom: 88px; border-top: 1px solid var(--line); }
.section-label { margin-bottom: 38px; }
.section-label h2 { margin: 0; font-size: clamp(2.15rem, 4.7vw, 3.9rem); line-height: 1; letter-spacing: -.042em; font-weight: 600; }
.compact-label { margin-bottom: 28px; }

.paper-list { border-top: 2px solid var(--ink); }
.paper-list .paper { padding: 24px 0 25px; border-bottom: 1px solid var(--line); }
.paper h3 { margin-bottom: 6px; font-size: 1.09rem; line-height: 1.34; font-weight: 600; }
.paper h3 a { text-decoration: none; }
.authors, .venue { margin: 2px 0 0; font-size: .88rem; }
.authors { color: #383735; }
.venue { color: var(--muted); }
.paper-link { margin-left: 8px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; font-size: .76rem; font-weight: 700; }

.paper-with-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 28px;
  align-items: start;
}
.paper-inline-visual { margin: 0; }
.paper-inline-visual a { display: block; border: 1px solid var(--line); background: #fff; }
.paper-inline-visual img {
  display: block;
  width: 100%;
  height: 118px;
  object-fit: cover;
  object-position: center 42%;
}
.paper-inline-visual figcaption { margin-top: 6px; color: var(--muted); font-size: .68rem; line-height: 1.3; text-align: right; }

.pub-group {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 34px;
  padding: 28px 0 5px;
  border-top: 1px solid var(--line);
}
.pub-group:first-of-type { border-top: 2px solid var(--ink); }
.year { padding-top: 3px; font-size: .77rem; font-weight: 760; letter-spacing: .075em; text-transform: uppercase; }
.papers .paper { padding: 0 0 25px; }
.papers .paper + .paper { padding-top: 1px; }
.archive { margin-top: 26px; border-top: 1px solid var(--line); }
.archive summary { cursor: pointer; padding: 22px 0; font-size: .85rem; font-weight: 700; }
.archive[open] summary { border-bottom: 1px solid var(--line); }
.archive-body { padding-top: 4px; }
.archive-body .pub-group:first-child { border-top: 0; }

.talk-list .paper h3 { font-size: 1.06rem; }

.service-item { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 30px; align-items: center; }
.service-logo { display: flex; width: 112px; height: 82px; padding: 7px; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; text-decoration: none; }
.service-logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.service-item-wide-logo .service-logo { padding: 10px 4px; }
.service-logo-pair { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 6px; }
.service-logo-pair img { width: 100%; height: 100%; object-fit: contain; }
.service-badge { display: grid; width: 82px; height: 82px; place-items: center; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-size: 1.1rem; letter-spacing: .08em; }
.service-copy h3:last-child, .service-copy p:last-child { margin-bottom: 0; }
.service-item-text { align-items: start; }
.service-item-text .service-logo { margin-top: 2px; }
.activity-banners { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.activity-banners img {
  display: block;
  height: 44px;
  width: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.teaching { background: var(--warm); }
.teaching-grid { display: grid; grid-template-columns: minmax(220px, .62fr) minmax(0, 1.38fr); gap: 76px; }
.teaching .section-label { margin-bottom: 0; }
.course-list { border-top: 2px solid var(--ink); }
.course { padding: 26px 0 30px; border-bottom: 1px solid #c9c3b8; }
.course-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 12px; }
.course-heading h3 { margin: 0; font-size: 1.42rem; line-height: 1.25; font-weight: 600; }
.course-heading span { color: var(--muted); white-space: nowrap; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.course > p { max-width: 740px; margin-bottom: 12px; color: #44413d; font-size: .91rem; }
.course .source { margin-bottom: 0; color: var(--muted); font-size: .84rem; }
.course .course-project { margin: 20px 0 0; }
.course-project a { display: inline-flex; padding: 11px 14px; flex-direction: column; border: 1px solid rgba(122, 39, 51, .28); color: var(--ink); background: rgba(255, 255, 255, .45); font-weight: 650; line-height: 1.35; text-decoration: none; }
.course-project a:hover { border-color: var(--accent); background: #fff; }
.course-project span { margin-bottom: 2px; color: var(--accent); font-size: .66rem; font-weight: 780; letter-spacing: .09em; text-transform: uppercase; }
.previous { margin: 23px 0 0; color: var(--muted); font-size: .84rem; }

.random-section { color: var(--ink); background: #f3f0e9; }
.random-section .section-label h2 { color: var(--ink); }
.random-section .kicker { color: var(--accent); }
.random-block + .random-block { margin-top: 42px; padding-top: 34px; border-top: 1px solid #c9c3b8; }
.random-label {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.random-intro {
  max-width: 42em;
  margin: -6px 0 18px;
  color: #44413d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .98rem;
  line-height: 1.58;
}
.random-intro a { font-style: inherit; }
.drawing-list { display: flex; flex-direction: column; gap: 40px; }
.drawing {
  display: grid;
  grid-template-columns: minmax(220px, 420px) minmax(0, 36em);
  gap: 8px 36px;
  align-items: start;
  margin: 0;
}
.drawing img { display: block; width: 100%; height: auto; border: 1px solid #d8d3ca; background: #fff; }
.drawing h3 { margin: 0 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; line-height: 1.25; font-weight: 600; }
.drawing-credit { margin: 0 0 12px; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.drawing-lines p { margin: 0 0 8px; color: #44413d; font-family: Georgia, "Times New Roman", serif; font-size: .86rem; line-height: 1.48; }
.drawing-lines p:last-child { margin-bottom: 0; }
.drawing-lines p:nth-child(2) { color: var(--accent); font-style: italic; }
.lab-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 48px;
  align-items: start;
}
.lab-stack { min-width: 0; max-width: 38em; }
.lab-copy { padding-top: 2px; }
.lab-qr { margin-top: 22px; }
.lab-copy h3 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 600;
}
.lab-copy > p {
  margin: 0;
  color: #44413d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .98rem;
  line-height: 1.58;
}
.lab-qr img {
  display: block;
  width: 58px;
  height: 58px;
  border: 1px solid #c9c3b8;
  background: #fff;
}
.lab-preview-wrap { margin: 0; }
.lab-preview {
  display: block;
  width: 100%;
  height: 392px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid #c9c3b8;
  background: #fff;
}
.anim-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.anim-grid a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.anim-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 42%;
  border: 1px solid #d8d3ca;
  background: #111;
}
.anim-meta {
  display: block;
  margin-top: 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .9rem;
  line-height: 1.35;
}
.anim-meta span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .66rem;
  letter-spacing: .14em;
}
.anim-grid a:hover img { border-color: var(--accent); }
.mafia {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 340px);
  gap: 16px 36px;
  align-items: center;
}
.mafia-deal {
  display: block;
  background: #1b1815;
  color: inherit;
  text-decoration: none;
}
.mafia-table {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 210px;
  padding: 28px 18px 8px;
  background:
    radial-gradient(ellipse at 50% 125%, rgba(122, 39, 51, .42), transparent 58%),
    transparent;
}
.mafia-credit {
  margin: 0;
  padding: 0 12px 14px;
  color: rgba(231, 220, 200, .55);
  font-size: .62rem;
  letter-spacing: .04em;
  text-align: center;
}
.role-card {
  width: 108px;
  height: auto;
  aspect-ratio: 320 / 460;
  margin-left: -34px;
  background: transparent;
  transform-origin: 50% 120%;
  transition: transform .35s ease;
}
.role-card:first-child { margin-left: 0; }
.role-card:nth-child(1) { transform: rotate(-13deg) translateY(14px); }
.role-card:nth-child(2) { transform: rotate(-8deg) translateY(6px); }
.role-card:nth-child(3) { transform: rotate(-3deg) translateY(1px); }
.role-card:nth-child(4) { transform: rotate(3deg) translateY(1px); }
.role-card:nth-child(5) { transform: rotate(8deg) translateY(6px); }
.role-card:nth-child(6) { transform: rotate(13deg) translateY(14px); }
.mafia-table:hover .role-card:nth-child(1) { transform: rotate(-18deg) translate(-10px, 10px); }
.mafia-table:hover .role-card:nth-child(2) { transform: rotate(-11deg) translate(-4px, 2px); }
.mafia-table:hover .role-card:nth-child(3) { transform: rotate(-4deg) translateY(-2px); }
.mafia-table:hover .role-card:nth-child(4) { transform: rotate(4deg) translateY(-2px); }
.mafia-table:hover .role-card:nth-child(5) { transform: rotate(11deg) translate(4px, 2px); }
.mafia-table:hover .role-card:nth-child(6) { transform: rotate(18deg) translate(10px, 10px); }
.mafia-film {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
}
.mafia-film img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #1b1815;
}
.mafia-film span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 8px;
  background: rgba(251, 250, 247, .92);
  color: var(--ink);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.mafia-film:hover span { color: var(--accent); }
.mafia-copy {
  grid-column: 1 / -1;
  max-width: 40em;
  margin: 2px 0 0;
  color: #44413d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .98rem;
  line-height: 1.58;
}

/* Fiction */
.fiction-section {
  background: #f1f2ef;
}

.fiction-group { padding-top: 26px; }
.fiction-note {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 720px;
  margin: 16px 0 0 139px;
  color: var(--muted);
  font-size: .86rem;
}
.fiction-note p { margin: 0; }
.fiction-note img {
  display: block;
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  border: 1px solid var(--line);
  background: #fff;
}

footer { padding: 31px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; color: var(--muted); font-size: .8rem; }
.footer-inner p { margin: 0; }
.footer-inner a { color: inherit; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding-top: 72px; padding-bottom: 76px; }
  .hero-side { display: grid; grid-template-columns: 210px 1fr; gap: 28px; align-items: start; max-width: 640px; }
  .portrait-wrap { margin: 0; }
  .portrait-wrap { grid-row: 1 / span 2; }
  .affiliation { grid-column: 2; }
  .section { padding-top: 70px; padding-bottom: 70px; }
  .teaching-grid { grid-template-columns: 1fr; gap: 36px; }
  .teaching .section-label { margin-bottom: 0; }
  .anim-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .mafia { grid-template-columns: 1fr; }
  .mafia-film { max-width: 420px; }
}

@media (max-width: 620px) {
  .shell { width: min(calc(100% - 30px), var(--max)); }
  .site-header { position: static; }
  .nav-wrap { align-items: flex-start; padding-top: 14px; padding-bottom: 14px; }
  nav { max-width: 250px; gap: 10px 15px; }
  h1 { font-size: clamp(3.45rem, 18vw, 5.4rem); }
  .hero-side { display: block; max-width: none; }
  .portrait-wrap { width: 148px; margin: 0 0 18px; }
  .cfcs-mark { width: 42px; height: 42px; flex-basis: 42px; }
  .affiliation-heading { gap: 10px; }
  .pub-group { grid-template-columns: 1fr; gap: 11px; }
  .year { padding-top: 0; }
  .service-item { grid-template-columns: 78px minmax(0, 1fr); gap: 18px; align-items: start; }
  .service-logo { width: 78px; height: 66px; }
  .service-badge { width: 66px; height: 66px; font-size: .9rem; }
  .course-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .drawing { grid-template-columns: 1fr; gap: 12px; }
  .anim-grid { grid-template-columns: 1fr 1fr; gap: 18px 12px; }
  .anim-meta { font-size: .82rem; }
  .mafia-table { min-height: 0; padding: 18px 8px 12px; }
  .role-card { width: 72px; margin-left: -26px; }
  .mafia-film { max-width: none; }
  .lab-note { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
  .lab-stack { display: contents; }
  .lab-copy { order: 1; }
  .lab-preview-wrap { order: 2; width: min(100%, 210px); }
  .lab-qr { order: 3; margin-top: 0; }
  .lab-preview { height: 320px; }
  .lab-copy h3 { font-size: 1.28rem; }
  .affiliation-row { align-items: flex-start; }
  .cfcs-qr { width: 60px; flex-basis: 60px; }
  .activity-banners img { height: 36px; }
  .paper-with-image { grid-template-columns: minmax(0, 1fr) 108px; gap: 16px; }
  .paper-inline-visual img { height: 84px; }
  .fiction-note { align-items: flex-start; margin-left: 0; }
  .footer-inner { flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .role-card { transition: none; }
}

.student-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, .75fr);
  gap: 68px;
  border-top: 2px solid var(--ink);
  padding-top: 8px;
}
.student-group h3 {
  margin: 18px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 600;
}
.student-list { border-top: 1px solid var(--line); }
.student {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.student p { margin: 0; }
.student-name { font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
.student-meta { color: var(--muted); font-size: .86rem; }
.student-avatar { --avatar-a: #7a2733; --avatar-b: #d7b9bd; position: relative; display: grid; width: 46px; height: 46px; overflow: hidden; place-items: center; border: 2px solid rgba(255, 255, 255, .92); border-radius: 50%; outline: 1px solid var(--line); color: #fff; background: linear-gradient(145deg, var(--avatar-a), var(--avatar-b)); isolation: isolate; }
.student-avatar::before { content: ""; position: absolute; width: 38px; height: 38px; right: -15px; bottom: -13px; border-radius: 50%; background: rgba(255, 255, 255, .2); z-index: -1; }
.student-avatar img { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.student-avatar span { position: relative; z-index: 1; font-size: .69rem; font-weight: 780; letter-spacing: .045em; }
.avatar-blue { --avatar-a: #315a73; --avatar-b: #9fc3d1; }
.avatar-ochre { --avatar-a: #8d5e20; --avatar-b: #d9bb7f; }
.avatar-forest { --avatar-a: #315f50; --avatar-b: #9dbdb0; }
.avatar-ink { --avatar-a: #313743; --avatar-b: #9da6b8; }
.avatar-plum { --avatar-a: #5f3b5d; --avatar-b: #bfa5bc; }

@media (max-width: 820px) {
  .student-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 620px) {
  .student { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; }
  .student-avatar { width: 42px; height: 42px; }
}
