@font-face {
  font-family: "Departure Mono";
  src: url("DepartureMono-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f8f0e3;
  --surface: #fff9ed;
  --ink: #162437;
  --gold: #8d510e;
  --frame: #bf8531;
  --muted: #2d3744;
  --line: #d9bf96;
  --panel: #f3e5cb;
  --accent: #e9b963;
  --shadow: 4px 4px 0 var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-block-start: var(--nav-clearance, 112px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 "Departure Mono", ui-monospace, monospace;
  font-synthesis: none;
}
a { color: inherit; text-underline-offset: .22em; }
a:hover { color: var(--gold); }
a:focus-visible { outline: 2px dashed var(--gold); outline-offset: 4px; }
h1, h2, h3, p, figure, ul { margin: 0; }
img { display: block; width: 100%; height: auto; }
.wrap { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.skip {
  position: fixed;
  z-index: 21;
  left: 16px;
  top: 16px;
  padding: 8px 16px;
  background: var(--surface);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px clamp(16px, 2.2vw, 30px);
  padding-block: 12px 32px;
  border-bottom: 2px solid var(--ink);
  background-color: var(--paper);
  transition: background-color 180ms ease-out, border-color 180ms ease-out;
}
.site-header.is-docked {
  pointer-events: none;
  background-color: transparent;
  border-bottom-color: transparent;
}
.site-header.is-docked .site-nav {
  pointer-events: auto;
  transform: translate(var(--dock-x, 0px), var(--dock-y, 0px));
}
.header-feature, .header-rubick-track {
  transition: opacity 180ms ease-out, translate 240ms ease-out, visibility 0s;
}
.site-header.is-docked :is(.header-feature, .header-rubick-track) {
  opacity: 0;
  translate: 18px 0;
  visibility: hidden;
  transition-delay: 0s, 0s, 180ms;
}
.header-rubick-track {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 42px;
  overflow: hidden;
  pointer-events: none;
}
.rubick-dog, .rubick-ball {
  position: absolute;
  height: auto;
  image-rendering: pixelated;
  pointer-events: none;
}
.rubick-dog {
  transform: translateX(-50%);
}
.rubick-ball {
  transform: translate(-50%, 50%);
}
.header-rubick-track .rubick-dog {
  bottom: -2px;
  width: clamp(46px, 5vw, 64px);
}
.header-rubick-track .rubick-ball {
  bottom: 6px;
  width: 12px;
}
.header-feature {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: clamp(10px, 1.4vw, 18px);
}
.header-quote blockquote {
  margin: 0;
  font-size: clamp(12px, 1.1vw, 15px);
  line-height: 1.45;
  white-space: nowrap;
}
.header-quote figcaption {
  margin-top: 4px;
  color: var(--gold);
  font-size: 11px;
  line-height: 1.3;
}
.header-quote cite { font-style: normal; }
.header-portal {
  --portal-edge: #218c61;
  --portal-light: #c4fbd0;
  --portal-spark: #4cbd7d;
  --portal-depth: #142c2f;
  --portal-shape: polygon(31% 0, 70% 0, 70% 8%, 83% 8%, 83% 17%, 92% 17%,
    92% 32%, 100% 32%, 100% 68%, 92% 68%, 92% 83%, 83% 83%, 83% 92%,
    70% 92%, 70% 100%, 31% 100%, 31% 92%, 17% 92%, 17% 83%, 8% 83%,
    8% 68%, 0 68%, 0 32%, 8% 32%, 8% 17%, 17% 17%, 17% 8%, 31% 8%);
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  flex: none;
  width: clamp(65px, 7vw, 92px);
  height: 62px;
}
.dock-portal { display: none; }
.header-portal-ring {
  position: absolute;
  inset: 0 26% 0 10%;
  opacity: .82;
  filter: drop-shadow(0 0 5px var(--portal-spark));
  animation: portal-open 1.65s ease-out both;
}
.header-portal-ring::before, .header-portal-ring::after {
  content: '';
  position: absolute;
  clip-path: var(--portal-shape);
}
.header-portal-ring::before {
  inset: 0;
  background: conic-gradient(from 42deg, var(--portal-light), var(--portal-edge),
    var(--portal-spark), var(--portal-light), var(--portal-edge), var(--portal-light));
}
.header-portal-ring::after {
  inset: 3px;
  background: repeating-linear-gradient(0deg, transparent 0 5px, #ffffff15 5px 6px),
    radial-gradient(ellipse at 75% 38%, var(--portal-edge), var(--portal-depth) 72%);
}
.header-portal-sparks {
  position: absolute;
  inset: 8px auto auto 11%;
  width: 2px;
  height: 2px;
  background: var(--portal-light);
  box-shadow: -3px 40px var(--portal-spark), 9px -5px var(--portal-spark),
    37px -5px var(--portal-edge), 49px 7px var(--portal-light),
    47px 39px var(--portal-light), 12px 46px var(--portal-edge);
  animation: portal-sparks 2.2s steps(5, end) infinite;
}
.header-mage-arrival {
  place-self: center end;
  z-index: 1;
  width: clamp(53px, 6vw, 76px);
  animation: portal-arrival 1.35s ease-out both;
}
.header-mage {
  height: 60px;
  object-fit: contain;
  image-rendering: pixelated;
  animation: portal-hover 3.6s ease-in-out 1.35s infinite;
}
/* Removing these animations while docked restarts the entrance on return. */
.site-header.is-docked .header-feature :is(.header-portal-ring, .header-portal-sparks, .header-mage-arrival, .header-mage) {
  animation: none;
}
@keyframes portal-open {
  0% { opacity: 0; scale: .06 .3; }
  22% { opacity: 1; scale: .12 .78; }
  52% { opacity: 1; scale: 1.08 1; }
  100% { opacity: .82; scale: 1; }
}
@keyframes portal-arrival {
  0%, 38% { opacity: 0; translate: -13px 1px; scale: .63; clip-path: inset(0 83% 0 0); }
  74% { opacity: 1; clip-path: inset(0 0 0 0); }
  100% { opacity: 1; translate: 0; scale: 1; clip-path: inset(0); }
}
@keyframes portal-sparks {
  0%, 100% { opacity: .38; translate: 0 2px; }
  50% { opacity: .92; translate: 1px -2px; }
}
@keyframes portal-hover {
  0%, 100% { translate: 0; }
  50% { translate: 0 -3px; }
}
.site-nav {
  position: relative;
  isolation: isolate;
  display: flex;
  gap: clamp(4px, .7vw, 10px);
  padding-inline-start: clamp(12px, 1.6vw, 22px);
  border-inline-start: 1px solid var(--line);
  font-size: 14px;
  transition: transform 280ms cubic-bezier(.2, .75, .25, 1), border-color 180ms ease-out;
}
.site-nav::before {
  position: absolute;
  z-index: -1;
  inset: -6px -10px;
  content: '';
  pointer-events: none;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 180ms ease-out;
}
.site-header.is-docked .site-nav { border-color: transparent; }
.site-header.is-docked .site-nav::before { opacity: 1; }
.site-nav:where(:has(> .dungeon-toggle:not([hidden]))) {
  padding-inline-start: 0;
  border-inline-start: 0;
}
.site-nav .dungeon-toggle {
  --mode-divider-gap: 12px;
  position: relative;
  justify-content: center;
  margin-inline: calc(var(--mode-divider-gap) + 2px);
}
.site-nav .dungeon-toggle::before,
.site-nav .dungeon-toggle::after {
  content: '';
  position: absolute;
  inset-block: 0;
  width: 1px;
  background: var(--line);
  pointer-events: none;
}
.site-nav .dungeon-toggle::before { inset-inline-end: calc(100% + var(--mode-divider-gap)); }
.site-nav .dungeon-toggle::after { inset-inline-start: calc(100% + var(--mode-divider-gap)); }
.site-nav a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 3px 6px;
  border: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:last-child { margin-inline-end: -6px; }
.site-nav .nav-short-label { display: none; }
.site-nav a:hover, .site-nav a:focus-visible { background: var(--panel); border-color: var(--ink); color: var(--ink); }

.home, .vision {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 4.5vw, 64px);
  padding-block: clamp(48px, 6vw, 80px);
}
.home {
  align-items: center;
  background: radial-gradient(ellipse at 79% 45%, #e9b9632b, transparent 66%);
}
.home h1 {
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 400;
  line-height: 1.15;
  text-wrap: balance;
}
.home-affiliation {
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
}
.home-tagline {
  margin-top: 26px;
  color: var(--gold);
  font-size: clamp(22px, 2.25vw, 30px);
  line-height: 1.3;
  text-wrap: balance;
}
.home-bio { margin-top: 16px; text-wrap: pretty; }
.home-bio p + p { margin-top: 12px; }
.home-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

#open-about, .about-dialog button { font: inherit; cursor: pointer; }
.about-dialog {
  box-sizing: border-box;
  width: min(920px, calc(100% - 28px));
  max-width: none;
  max-height: min(90dvh, 880px);
  padding: 0;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--frame);
  overflow: hidden;
}
.about-dialog[open] {
  display: flex;
  flex-direction: column;
}
.about-dialog::backdrop { background: #100b1bc9; }
body:has(.about-dialog[open]) { overflow: hidden; }
.about-dialog-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "title portraits close";
  align-items: center;
  gap: 8px clamp(8px, 2vw, 16px);
  padding: clamp(12px, 3vw, 24px) clamp(14px, 4vw, 30px);
  border-bottom: 1px solid var(--line);
}
.about-dialog-header h2 {
  grid-area: title;
  margin: 0;
  font-size: clamp(24.15px, 5.25vw, 37.8px);
}
.about-dialog-header form { grid-area: close; }
.about-pixel-portraits {
  --portrait-width: clamp(25.3px, 4.6vw, 36.8px);
  grid-area: portraits;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(9px, 1.4vw, 14px);
  min-height: calc(var(--portrait-width) * 2.5);
  padding: 0;
  list-style: none;
}
.about-pixel-portraits li {
  flex: none;
}
.about-pixel-portraits li img {
  width: auto;
  height: calc((var(--portrait-width) - 2px) * 2.113125);
  image-rendering: pixelated;
}
@media (max-width: 520px) {
  .about-dialog-header {
    grid-template-columns: 1fr auto;
    grid-template-areas: "title close" "portraits portraits";
  }
}
.about-dialog-header button { min-height: 44px; }
.about-dialog-copy {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(14px, 4vw, 30px);
  font-size: clamp(14px, 2.5vw, 16px);
  line-height: 1.65;
}
.about-dialog-copy p { margin: 0; }
.about-dialog-copy p + p { margin-top: 1em; }
.about-dialog-copy:focus-visible,
.about-dialog button:focus-visible, #open-about:focus-visible {
  outline: 2px dashed var(--gold);
  outline-offset: 3px;
}
.about-dialog-copy:focus-visible { outline-offset: -5px; }

.home-portrait {
  --home-sprite-width: min(150cqi, 760px);
  --home-floor: max(12px, calc(50% - var(--home-sprite-width) * .274));
  container-type: inline-size;
  position: relative;
  width: 100%;
  height: clamp(320px, 38vw, 520px);
  overflow: hidden;
  background: var(--panel) url("home-pixel-motif.webp") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  border: 2px solid var(--frame);
  box-shadow: 4px 4px 0 var(--line);
}
.home-portrait::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(var(--home-floor) - 7px);
  width: min(30.78%, 158px);
  height: 12px;
  transform: translateX(-50%);
  background: #4b37243b;
  clip-path: polygon(10% 0, 90% 0, 90% 25%, 100% 25%, 100% 75%, 90% 75%, 90% 100%, 10% 100%, 10% 75%, 0 75%, 0 25%, 10% 25%);
}
.home-character {
  position: absolute;
  bottom: var(--home-floor);
  left: 50%;
  width: calc(var(--home-sprite-width) * .81);
  transform: translate(-50%, 27%);
  image-rendering: pixelated;
  animation: outfit-breathe 3.6s steps(1, end) infinite;
}
.home-character > img { clip-path: inset(63% 0 0); }
.home-character-upper {
  position: absolute;
  inset: 0;
  transform: translateY(var(--outfit-breath-offset));
}
.home-character-upper img { clip-path: inset(0 0 36%); }
.home-eyelids {
  position: absolute;
  inset: 32.45% 0 auto;
  height: 2.7%;
  opacity: 0;
  animation: outfit-blink 11s steps(1, end) infinite;
}
.home-eyelids::before, .home-eyelids::after {
  content: '';
  position: absolute;
  top: 0;
  width: 2.35%;
  height: 100%;
  background: linear-gradient(#fdcfaf 46%, #804a30 46% 60%, #fdcfaf 60%);
}
.home-eyelids::before { left: 47.25%; }
.home-eyelids::after { left: 53.78%; }
.home-portrait .rubick-dog {
  /* Align the dog's paws with the portrait's feet in the original sprite. */
  --home-dog-width: clamp(121px, 31.625cqi, 199.375px);
  --home-dog-reach: min(32cqi, (100cqi - var(--home-dog-width)) / 2 - 2px);
  bottom: calc(var(--home-floor) - 5px);
  left: calc(50% + var(--home-dog-reach) * var(--home-dog-position, 1));
  width: var(--home-dog-width);
  transform: translateX(-50%) scaleX(var(--home-dog-facing, -1));
}
.button, .icon-link { display: inline-flex; align-items: center; gap: 8px; }
.button {
  gap: 16px;
  min-height: 48px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  box-shadow: 4px 4px 0 var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: var(--accent); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.icon { display: inline-block; width: 12px; height: 12px; flex: none; background: currentColor; }
.icon-out { clip-path: polygon(33.33% 0,100% 0,100% 66.67%,83.33% 66.67%,83.33% 33.33%,66.67% 33.33%,66.67% 50%,50% 50%,50% 66.67%,33.33% 66.67%,33.33% 83.33%,16.67% 83.33%,16.67% 100%,0 100%,0 66.67%,16.67% 66.67%,16.67% 50%,33.33% 50%,33.33% 33.33%,50% 33.33%,50% 16.67%,33.33% 16.67%); }
.icon-down, .icon-up { clip-path: polygon(41.67% 0,58.33% 0,58.33% 58.33%,75% 58.33%,75% 41.67%,91.67% 41.67%,91.67% 66.67%,75% 66.67%,75% 83.33%,58.33% 83.33%,58.33% 100%,41.67% 100%,41.67% 83.33%,25% 83.33%,25% 66.67%,8.33% 66.67%,8.33% 41.67%,25% 41.67%,25% 58.33%,41.67% 58.33%); }
.icon-up { transform: rotate(180deg); }

.vision {
  grid-template-areas: "character questions";
  align-items: center;
  border-top: 2px solid var(--ink);
  scroll-margin-top: 16px;
}
.vision-copy { grid-area: questions; }
.vision-subheading {
  margin-top: 12px;
  color: var(--gold);
  font-size: clamp(20px, 1.9vw, 26px);
  font-weight: 400;
  line-height: 1.35;
}
.vision-questions {
  display: grid;
  margin-top: 20px;
  padding-inline-start: 22px;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
  list-style-type: square;
}
.vision-questions li { padding-block: 10px; }
.vision-questions li + li { border-top: 1px solid var(--line); }
.vision-questions li::marker { color: var(--gold); }
.vision-visual { grid-area: character; display: grid; justify-self: center; width: min(100%, 680px); min-width: 0; }
.latest-publications { margin-bottom: 28px; }
.latest-publications > h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 20px);
  font-weight: 400;
}
.publication-summary {
  max-width: 78ch;
  margin-top: 6px;
  color: var(--ink);
  font-size: clamp(14px, 1.55vw, 16px);
  line-height: 1.5;
}
.publication-groups { display: grid; gap: 12px; }
.publication-group { min-width: 0; }
.topic-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(6px, 1.5vw, 16px);
  min-height: 54px;
  padding: 8px clamp(10px, 2vw, 18px);
  background: var(--surface);
  border: 2px solid var(--line);
  color: var(--ink);
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.3;
  list-style: none;
  cursor: pointer;
}
.topic-link::-webkit-details-marker { display: none; }
.topic-link:hover, .publication-group[open] > .topic-link {
  color: var(--gold);
  border-color: var(--frame);
  background: var(--panel);
}
.topic-link:focus-visible { outline: 2px dashed var(--gold); outline-offset: 3px; }
.publication-count { color: var(--muted); font-size: .86em; }
.topic-link::after { content: '+'; width: 1ch; color: var(--gold); }
.publication-group[open] > .topic-link::after { content: '−'; }
.publication-group[open] > .studies { border-top: 0; margin-bottom: 4px; }
.topic-icon {
  flex: none;
  height: 22px;
  width: 28px;
  background: url("research-topics.png") var(--icon-x) -7px / 181.775px 37.95px no-repeat;
  image-rendering: pixelated;
}
.topic-link[data-topic="artificial-intelligence"] .topic-icon {
  background: url("artificial-intelligence.png") center / auto 18px no-repeat;
}
.topic-link[data-topic="psychology"] { --icon-x: -36px; }
.topic-link[data-topic="biosignals"] { --icon-x: -71.5px; }
.topic-link[data-topic="xr-vr"] { --icon-x: -109px; }
.topic-link[data-topic="hci"] .topic-icon {
  position: relative;
  background: none;
}
.topic-link[data-topic="hci"] .topic-icon::before,
.topic-link[data-topic="hci"] .topic-icon::after {
  content: '';
  position: absolute;
}
.topic-link[data-topic="hci"] .topic-icon::before {
  inset: 2px auto auto 2px;
  width: 20px;
  height: 18px;
  background: linear-gradient(var(--panel), var(--panel)) 2px 2px / 16px 9px no-repeat, var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 60% 72%, 60% 89%, 80% 89%, 80% 100%, 20% 100%, 20% 89%, 40% 89%, 40% 72%, 0 72%);
}
.topic-link[data-topic="hci"] .topic-icon::after {
  inset: 8px 1px auto auto;
  width: 11px;
  height: 13px;
  background: var(--gold);
  clip-path: polygon(0 0, 18% 0, 18% 15%, 36% 15%, 36% 31%, 55% 31%, 55% 46%, 73% 46%, 73% 62%, 100% 62%, 100% 77%, 64% 77%, 64% 100%, 45% 100%, 45% 77%, 18% 77%, 18% 92%, 0 92%);
}
.outfit-board {
  display: grid;
  grid-template-columns: clamp(76px, 7vw, 91px) minmax(0, 1fr);
  gap: clamp(6px, 1vw, 12px);
  padding: clamp(5px, 1vw, 10px);
  background: var(--surface);
  border: 4px solid var(--ink);
  box-shadow: 4px 4px 0 var(--frame);
}
.outfit-picker {
  min-width: 0;
  align-self: center;
  margin: 0;
  padding: 0;
  border: 0;
}
.outfit-picker legend {
  width: 100%;
  margin-bottom: 9px;
  padding: 0 2px;
  font-size: clamp(14px, 1.15vw, 16px);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}
.outfit-options { display: grid; gap: 6px; }
.outfit-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.outfit-options label {
  display: grid;
  place-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
}
.outfit-options label:hover { border-color: var(--frame); }
.outfit-options input:checked + label {
  border-color: var(--ink);
  background: var(--panel);
  box-shadow: 2px 2px 0 var(--frame);
}
.outfit-options input:focus-visible + label { outline: 2px dashed var(--gold); outline-offset: 2px; }
.outfit-icon {
  width: min(100%, 54px);
  aspect-ratio: 1;
  background: url("outfit-icons.png") no-repeat;
  background-size: 200% 200%;
  image-rendering: pixelated;
}
.outfit-options [for="outfit-original"] .outfit-icon { background-position: 3.35% 4.23%; }
.outfit-options [for="outfit-hoodie"] .outfit-icon { background-position: 93% 5.34%; }
.outfit-options [for="outfit-suit"] .outfit-icon { background-position: 4.78% 97.13%; }
.outfit-options [for="outfit-beach"] .outfit-icon { background-position: 93.78% 97.77%; }
.outfit-preview {
  display: grid;
  min-width: 0;
  border: 1px solid var(--frame);
  background: var(--panel);
}
/* Source rows for the leg split and floor in each outfit image. */
[data-outfit="original"] {
  --outfit-backdrop: #f2dfbf;
  --outfit-sprite: url("can-original.png");
  --leg-row: 1129;
  --floor-row: 1265;
}
[data-outfit="hoodie"] {
  --outfit-backdrop: #e2e9e2;
  --outfit-sprite: url("can-hoodie.png");
  --leg-row: 1124;
  --floor-row: 1271;
}
[data-outfit="suit"] {
  --outfit-backdrop: #e4e6ec;
  --outfit-sprite: url("can-suit.png");
  --leg-row: 1124;
  --floor-row: 1299;
}
[data-outfit="beach"] {
  --outfit-backdrop: #f3e0bd;
  --outfit-sprite: url("can-beach.png");
  --leg-row: 1205;
  --floor-row: 1352;
}
.outfit-portrait {
  container-type: inline-size;
  position: relative;
  min-height: clamp(252px, 24vw, 324px);
  overflow: hidden;
  background-color: var(--outfit-backdrop);
  background-image: linear-gradient(#6d60451a 1px, transparent 1px), linear-gradient(90deg, #6d60451a 1px, transparent 1px);
  background-size: 14px 14px;
  transition: background-color 180ms ease-out;
}
.outfit-portrait::before {
  content: '';
  position: absolute;
  bottom: 7%;
  left: 50%;
  width: 48%;
  height: 5%;
  transform: translateX(-50%);
  background: #493d3329;
  clip-path: polygon(12% 0, 88% 0, 88% 25%, 100% 25%, 100% 75%, 88% 75%, 88% 100%, 12% 100%, 12% 75%, 0 75%, 0 25%, 12% 25%);
}
.outfit-portrait .rubick-dog {
  z-index: 1;
  bottom: 5%;
  left: 80%;
  width: clamp(103.75px, 13.5vw, 175px);
}
.outfit-portrait .rubick-ball {
  z-index: 2;
  bottom: calc(5% + var(--ball-height, 5px + clamp(9px, 1vw, 13px)));
  width: clamp(18px, 2vw, 26px);
}
@property --outfit-breath-offset {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}
.outfit-character {
  /* The original sprite supplies the 1053px height and the shared head. */
  --sprite-pixel: calc(min(clamp(192px, 20vw, 254px), 81cqi) / 1053);
  --torso-height: calc(423 * var(--sprite-pixel));
  --leg-height: calc(136 * var(--sprite-pixel));
  position: absolute;
  bottom: 9%;
  left: 50%;
  width: calc(1067 * var(--sprite-pixel));
  height: calc(1053 * var(--sprite-pixel));
  transform: translateX(-50%);
  image-rendering: pixelated;
  animation: outfit-breathe 3.6s steps(1, end) infinite;
}
.outfit-head,
.outfit-body::before,
.outfit-body::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  background-repeat: no-repeat;
}
.outfit-body {
  position: absolute;
  inset: 0;
}
.outfit-head {
  top: 0;
  height: calc(521 * var(--sprite-pixel));
  z-index: 1;
  background-image: url("can-original.png");
  background-size: 100% calc(1474 * var(--sprite-pixel));
  background-position: center calc(-212 * var(--sprite-pixel));
  /* Keep the shared beard while letting the selected collar show around it. */
  clip-path: polygon(0 0, 100% 0, 100% 94.82%, 63.3% 94.82%, 63.3% 100%, 40.1% 100%, 40.1% 94.82%, 0 94.82%);
  transform: translateY(var(--outfit-breath-offset)) scaleX(var(--dog-look-direction, 1));
}
.outfit-eyelids {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: outfit-blink 11s steps(1, end) infinite;
}
.outfit-eyelids::before,
.outfit-eyelids::after {
  content: '';
  position: absolute;
  top: calc(304 * var(--sprite-pixel));
  width: calc(53 * var(--sprite-pixel));
  height: calc(59 * var(--sprite-pixel));
  background: linear-gradient(#fdcfaf 46%, #804a30 46% 60%, #fdcfaf 60%);
}
.outfit-eyelids::before { left: calc(482 * var(--sprite-pixel)); }
.outfit-eyelids::after { left: calc(625 * var(--sprite-pixel)); }
@keyframes outfit-blink {
  0%, 29.5%, 77%, 79.5% { opacity: 0; }
  28%, 29.1%, 75.5%, 76.6%, 78%, 79.1% { opacity: 1; clip-path: inset(0 0 34%); }
  28.4%, 75.9%, 78.4% { opacity: 1; clip-path: inset(0); }
}
@keyframes outfit-breathe {
  0%, 83%, 100% { --outfit-breath-offset: 0px; }
  24%, 68% { --outfit-breath-offset: -1px; }
  40% { --outfit-breath-offset: -2px; }
}
.outfit-body::before,
.outfit-body::after {
  background-image: var(--outfit-sprite);
  background-size: 100% calc(1474 * var(--layer-pixel));
  background-position: center calc(-1 * var(--source-row) * var(--layer-pixel));
}
.outfit-body::before {
  --source-row: 706;
  --layer-pixel: calc(var(--torso-height) / (var(--leg-row) - var(--source-row)));
  bottom: calc(var(--leg-height) - 2px);
  height: calc(var(--torso-height) + 2px);
  transform: translateY(var(--outfit-breath-offset));
}
.outfit-body::after {
  --source-row: var(--leg-row);
  --layer-pixel: calc(var(--leg-height) / (var(--floor-row) - var(--leg-row)));
  bottom: 0;
  height: var(--leg-height);
}
.research, .news { border-top: 2px solid var(--ink); padding-block: 32px 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.news-list .study-meta { padding-top: 3px; }
.news-role { margin-bottom: 5px; color: var(--gold); font-size: 14px; font-weight: 650; line-height: 1.4; }
h2 { font-size: clamp(28px, 3.6vw, 46px); font-weight: 400; line-height: 1.15; }
.text-link { font-weight: 600; }
.studies { list-style: none; padding: 0; border: 2px solid var(--ink); box-shadow: var(--shadow); }
.studies li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
}
.studies li + li { border-top: 1px solid var(--line); }
.news-list > li + li { border-top-width: 2px; }
.studies li:has(a):hover, .studies li:focus-within { background: var(--panel); }
.study-meta { color: var(--muted); font-size: 15px; line-height: 1.45; }
.study-meta span { display: block; }
.studies h3 { font-size: clamp(15px, 1.65vw, 20px); font-weight: 400; line-height: 1.35; overflow-wrap: anywhere; }
.news-list h3 { font-size: clamp(18px, 2.1vw, 25px); font-weight: 650; line-height: 1.25; }
.news-list h3 + p {
  max-width: 68ch;
  margin-top: 7px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  text-wrap: pretty;
}
.studies h3 a { text-decoration: none; }
.studies h3 a::after { position: absolute; inset: 0; content: ''; }
.studies h3 a:hover { color: var(--ink); text-decoration: underline; }
.studies h3 a:focus-visible { outline: none; }
.studies li:focus-within { z-index: 1; outline: 2px dashed var(--gold); outline-offset: -4px; }
.research .study-meta { margin-top: 4px; font-size: clamp(12px, 1.4vw, 15px); }
.arrow { display: grid; width: 36px; height: 36px; place-items: center; border: 2px solid var(--line); color: var(--gold); }
.studies li:hover .arrow, .studies li:focus-within .arrow { border-color: var(--ink); background: var(--accent); color: var(--ink); }

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: clamp(20px, 4vw, 40px);
  background: var(--panel);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
}
.contact-intro { display: flex; align-items: center; gap: clamp(12px, 2vw, 24px); }
.portrait-nazar {
  position: relative;
  flex: none;
  width: clamp(40px, 5vw, 65px);
  aspect-ratio: 1 / 2;
  overflow: hidden;
}
.portrait-nazar img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: 179%;
  transform: translate(-49.9%, -46%);
  clip-path: inset(18.7% 36.8% 26.6% 36.7%);
  image-rendering: pixelated;
}
.contact p { margin-top: 8px; color: var(--muted); }
.contact address { margin-top: 4px; color: var(--muted); font-style: normal; }
.contact-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 24px; color: var(--muted); font-size: 16px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }

@media (max-width: 920px) {
  .wrap { width: calc(100% - 56px); }
  .home { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 32px; }
  .home-copy { width: min(100%, 680px); }
  .home-portrait {
    --home-sprite-width: min(150cqi, 680px);
    height: clamp(260px, 69vw, 430px);
    width: min(100%, 640px);
  }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 40px); }
  .home, .vision { gap: 24px; padding-block: 40px; }
  .home h1 { font-size: clamp(32px, 6.5vw, 48px); }
  .vision {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "questions" "character";
    justify-items: center;
  }
  .vision-copy { width: min(100%, 680px); }
  .research, .news { padding-block: 24px 40px; }
}

@media (max-width: 820px) {
  .site-header { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .site-nav { flex-wrap: wrap; justify-content: center; padding: 0; border: 0; }
  .site-nav a:last-child { margin-inline-end: 0; }
  .site-header.is-docked .site-nav {
    width: max-content;
    max-width: calc(100vw - 16px);
    gap: 0;
    padding-inline: 3px;
    font-size: clamp(11px, 2.9vw, 13px);
    transform: translateY(var(--dock-y, 0px));
  }
  .site-header.is-docked .site-nav::before {
    inset: -2px 0;
    box-shadow: 2px 3px 0 var(--ink);
  }
  .site-header.is-docked .site-nav > :is(a, .dungeon-toggle:not([hidden])) {
    justify-content: center;
    min-inline-size: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0 1px;
  }
  .site-header.is-docked .site-nav a { border-width: 1px; }
  .site-header.is-docked .dungeon-toggle::before,
  .site-header.is-docked .dungeon-toggle::after { display: none; }
  .site-header.is-docked .dungeon-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .site-header.is-docked .site-nav .nav-full-label { display: none; }
  .site-header.is-docked .site-nav .nav-short-label { display: inline; }
}

@media (min-width: 501px) {
  .news-list > li { grid-template-columns: 148px minmax(0, 1fr) 36px; }
}

@media (max-width: 500px) {
  .header-feature { flex-direction: column; gap: 5px; text-align: center; }
  .header-quote blockquote { font-size: clamp(9px, 3.05vw, 12px); }
  .site-nav { gap: 0 4px; font-size: 13px; }
  .outfit-options label { min-height: 48px; }
  .outfit-icon { width: min(100%, 46px); }
  .outfit-portrait .rubick-dog { width: min(103.75px, 38%); }
  .studies li { grid-template-columns: minmax(0, 1fr) 32px; gap: 8px; padding: 12px; }
  .study-meta span { display: inline; }
  .study-meta span::before { content: '· '; }
  .arrow { grid-column: 2; width: 32px; height: 32px; }
  .news-list .arrow { grid-row: 1 / span 2; }
  .contact .button { font-size: 16px; gap: 8px; padding-inline: 9px; }
}

@media (min-width: 1401px) {
  .site-header { column-gap: 12px; }
}

@media (min-width: 1401px) and (max-width: 1450px) {
  .header-feature { gap: 10px; }
  .header-quote blockquote { font-size: 13px; }
  .site-header:not(.is-docked) .site-nav:not(:has(> .dungeon-toggle:not([hidden]))) {
    padding-inline-start: 10px;
  }
}

@media (min-width: 821px) and (min-height: 410px) {
  :root {
    --dock-width: clamp(148px, 12.5vw, 164px);
    --dock-right: clamp(16px, 2vw, 36px);
    --dock-gutter: calc(var(--dock-width) + var(--dock-right) + 28px);
  }

  .site-header.wrap, main.wrap, .site-footer.wrap {
    width: min(1200px, calc(100% - var(--dock-gutter) - 28px));
  }

  :is(main, .site-footer).wrap {
    --page-gutter: max(calc((100% - 1200px) / 2), calc((var(--dock-gutter) + 28px) / 2));
    margin-inline: var(--page-gutter);
  }

  body:has(> .site-header.is-docked) > :is(main, .site-footer).wrap {
    margin-inline-start: min(var(--page-gutter), calc(2 * var(--page-gutter) - var(--dock-gutter)));
    margin-inline-end: max(var(--page-gutter), var(--dock-gutter));
  }

  @media (prefers-reduced-motion: no-preference) {
    :is(main, .site-footer).wrap { transition: margin-inline 240ms ease-out; }
  }

  .site-header.is-docked { min-height: var(--header-height, 100px); }

  .site-header.is-docked .site-nav {
    position: fixed;
    inset-block-start: max(45%, 205px);
    inset-inline-end: var(--dock-right);
    width: var(--dock-width);
    padding: 13px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border: 0;
    font-size: 13px;
    transform: translateY(-50%);
    transition: none;
    pointer-events: none;
  }

  .site-header.is-docked .site-nav::before { display: none; }

  .site-header.is-docked .site-nav::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background: var(--paper);
    box-shadow: inset 0 0 0 1.1px var(--line);
  }

  .site-header.is-docked .site-nav > :is(a, .dungeon-toggle) { pointer-events: auto; }

  @media (prefers-reduced-motion: no-preference) {
    .site-header.is-docked:not(.is-dock-ready) .site-nav::after { content: none; }
    .site-header.is-docked:not(.is-dock-ready) .site-nav > :is(a, .dungeon-toggle) { visibility: hidden; }

    .site-header.is-docked.is-dock-ready .site-nav::after,
    .site-header.is-docked.is-dock-ready .site-nav > :is(a, .dungeon-toggle) {
      animation: dock-slide-in 300ms cubic-bezier(.2, .75, .25, 1) both;
    }
  }

  .site-header.is-docked .dock-portal {
    display: grid;
    align-self: center;
    margin-bottom: 6px;
  }

  .site-header.is-docked .site-nav a {
    margin: 0;
    min-height: 38px;
    padding-inline: 5px;
  }

  .site-header.is-docked .dungeon-toggle {
    min-inline-size: 0;
    padding-inline: 4px;
    margin-inline: 0;
    margin-block-end: 8px;
  }

  .site-header.is-docked .dungeon-toggle::before { display: none; }

  .site-header.is-docked .dungeon-toggle::after {
    inset: calc(100% + 6px) 0 auto;
    width: auto;
    height: 1px;
  }
}

@keyframes dock-slide-in {
  from { opacity: 0; translate: 18px 0; visibility: hidden; }
  to { opacity: 1; translate: 0; visibility: visible; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .outfit-portrait { transition: none; }
  .site-header, .header-feature, .header-rubick-track, .site-nav, .site-nav::before { transition: none; }
  .home-character, .home-eyelids, .outfit-character, .outfit-eyelids { animation: none; }
  .header-portal-ring, .header-portal-sparks, .header-mage-arrival,
  .header-mage { animation: none; }
}
