/* =====================================================================
   PIXEL THEME — shared by /prompt-timeline/, /research/ and /ai-trial/
   Brings the hero-valley pixel language to the inner pages without touching
   the root homepage: Space Mono (Latin) + Fusion Pixel (CJK) on the Material 3
   type scale, a pinned bar-less text nav with the animated ZH logo, sharp 0px
   pixel-dithered surfaces, 2px pixel corner ornaments with a TL -> BR shimmer,
   stepped pixel badges / buttons and pixel arrows. Loaded last on each page.
   ===================================================================== */

:root {
  --px-bg: #05070c;
  --px-c: 238 244 255;                          /* pixel ornament colour (rgb triplet) */
  --px-accent: rgb(62 108 232 / 64%);           /* hero cobalt */
  --px-font: "Space Mono", "Fusion Pixel", monospace;
  --font-pixel: var(--px-font);
  --font-sans: var(--px-font);
  --font-ui: var(--px-font);
  --font-display: var(--px-font);
  --font-hero: var(--px-font);
  --font-label: var(--px-font);
  /* Material Design 3 web type scale */
  --md-display-small: 2.25rem;   /* 36 / 44 */
  --md-headline-small: 1.5rem;   /* 24 / 32 */
  --md-title-medium: 1rem;       /* 16 / 24 */
  --md-body-large: 1rem;         /* 16 / 24 */
  --md-body-medium: 0.875rem;    /* 14 / 20 */
  --md-body-small: 0.75rem;      /* 12 / 16 */
  --md-label-large: 0.875rem;    /* 14 / 20 */
  --md-label-medium: 0.75rem;    /* 12 / 16 */
}

/* ---------- canvas: deep twilight black + hero pixel dither (also fixes the white scrollbar-gutter strips) ---------- */
html {
  /* the dither lives on the root canvas so it also covers the scrollbar-gutter strips */
  background:
    radial-gradient(rgb(138 178 248 / 7%) 1px, transparent 1px) 0 0 / 4px 4px,
    var(--px-bg) !important;
  color-scheme: dark;
}
html body {
  background: transparent !important;
  color: #fff;
  font-family: var(--px-font) !important;
}
html body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' shape-rendering='crispEdges'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.65' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='64' height='64' filter='url(%23p)'/%3E%3C/svg%3E");
  background-size: 64px 64px;
  image-rendering: pixelated;
  mix-blend-mode: screen;
}
/* Strict type rule: Space Mono for Latin, Fusion Pixel for CJK — everywhere on these pages */
html body *:not(svg):not(svg *):not(#px-type-guard) { font-family: var(--px-font) !important; }  /* :not(#id) lifts specificity above legacy .a .b !important rules */

/* Pixel surfaces are sharp: no rounded corners anywhere on these pages */
html body *:not(svg):not(svg *) { border-radius: 0 !important; }

/* ---------- navigation: identical to hero-valley (pinned, no bar, no pill morph) ---------- */
html body .site-nav,
html body .site-nav.site-nav--work,
html body .site-nav.site-nav--case {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 76px !important;
  z-index: 40;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 0 clamp(24px, 5vw, 64px) !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  /* a soft legibility fade, not a bar */
  background: linear-gradient(to bottom, rgb(5 7 12 / 88%), rgb(5 7 12 / 0%)) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html body .site-nav .site-nav__menu-label { display: none !important; }
html body .site-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: auto;
  min-width: 0;
  padding: 0;
  color: #fff !important;
  font-size: var(--md-title-medium) !important;
  line-height: 1.5 !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
}
html body .site-nav .brand .brand-label {
  display: inline-block !important;
  font: 700 var(--md-title-medium) / 1.5 var(--px-font) !important;
  letter-spacing: 0.02em;
  color: #fff !important;
}
html body .site-nav .brand::before {
  content: "";
  flex: none;
  width: 28px;
  height: 28px;
  background: url("brand/zh-logo-animated.svg") center / contain no-repeat;
  animation: px-logo-glow 5.2s linear infinite;
}
html body .site-nav .brand.brand--avatar > :not(.brand-label) { display: none !important; }
@keyframes px-logo-glow {
  0%   { filter: drop-shadow(-1px -1px 4px rgb(220 236 255 / 32%)); }
  44%  { filter: drop-shadow(-1.5px -1.5px 6px rgb(230 242 255 / 44%)); }
  60%  { filter: drop-shadow(-1px -1px 3px rgb(210 230 255 / 26%)); }
  70%  { filter: drop-shadow(-1.5px -1.5px 7px rgb(235 245 255 / 56%)); }
  76%  { filter: drop-shadow(-1px -1px 3px rgb(200 224 255 / 24%)); }
  81%  { filter: drop-shadow(-2px -2px 9px rgb(245 250 255 / 68%)); }
  86%  { filter: drop-shadow(-1px -1px 4px rgb(215 234 255 / 30%)); }
  100% { filter: drop-shadow(-1px -1px 4px rgb(220 236 255 / 32%)); }
}
html body .site-nav > .nav-links,
html body .site-nav .nav-links {
  position: static !important;
  transform: none !important;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.4vw, 34px) !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
html body .site-nav .nav-links a,
html body .site-nav .nav-links a[aria-current="page"] {
  padding: 6px 2px !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: rgb(242 246 255 / 56%) !important;
  font-size: var(--md-label-large) !important;
  line-height: 1.429 !important;
  font-weight: 400 !important;
  letter-spacing: 0.03em;
  opacity: 1 !important;
  animation: none !important;
  transform: none !important;
  transition: color 240ms ease, text-shadow 240ms ease;
}
html body .site-nav .nav-links a:hover { color: rgb(255 255 255 / 92%) !important; }
html body .site-nav .nav-links a[aria-current="page"] {
  color: #fff !important;
  font-weight: 700 !important;
  text-shadow: 0 0 0.55px rgb(255 255 255 / 90%);
}
/* language toggle: two quiet pixel text buttons, weight shows the state (no pill) */
html body .site-nav .language-switch,
html body .site-nav .language-switch[data-language] {
  position: static !important;
  transform: none !important;
  margin-left: clamp(22px, 2.6vw, 38px);
  display: inline-flex;
  gap: 10px;
  padding: 0 0 0 clamp(16px, 1.6vw, 22px) !important;
  border: 0 !important;
  border-left: 2px solid rgb(255 255 255 / 14%) !important;
  background: none !important;
  box-shadow: none !important;
  height: 14px;
  align-items: center;
}
html body .site-nav .language-switch[data-language]::before { display: none !important; }
html body .site-nav .language-switch button,
html body .site-nav .language-switch[data-language] button {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 2px !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: rgb(242 246 255 / 44%) !important;
  font-size: var(--md-label-medium) !important;
  line-height: 1.333 !important;
  font-weight: 400 !important;
  cursor: pointer;
}
html body .site-nav .language-switch button:hover { color: rgb(255 255 255 / 86%) !important; }
html body .site-nav .language-switch button[aria-pressed="true"],
html body .site-nav .language-switch[data-language] button[aria-pressed="true"] { color: #fff !important; font-weight: 700 !important; }

/* ---------- 2px pixel corner ornaments (same pixel map as the hero cards) ---------- */
html body .research-project__media,
html body .trial-cell__frame,
html body .figma-case--slides .figma-artboard { position: relative; }
html body .research-project__media::after,
html body .trial-cell__frame::after,
html body .figma-case--slides .figma-artboard::after,
html body .research-project__media::before,
html body .trial-cell__frame::before,
html body .figma-case--slides .figma-artboard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    linear-gradient(rgb(var(--px-c) / 1), rgb(var(--px-c) / 1)) left 0px top 0px / 6px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 1), rgb(var(--px-c) / 1)) left 0px top 2px / 2px 4px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.78), rgb(var(--px-c) / 0.78)) left 4px top 4px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.64), rgb(var(--px-c) / 0.64)) left 8px top 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.64), rgb(var(--px-c) / 0.64)) left 0px top 8px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.4), rgb(var(--px-c) / 0.4)) left 12px top 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.4), rgb(var(--px-c) / 0.4)) left 0px top 12px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.22), rgb(var(--px-c) / 0.22)) left 16px top 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.22), rgb(var(--px-c) / 0.22)) left 0px top 16px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 1), rgb(var(--px-c) / 1)) right 0px top 0px / 6px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 1), rgb(var(--px-c) / 1)) right 0px top 2px / 2px 4px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.78), rgb(var(--px-c) / 0.78)) right 4px top 4px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.64), rgb(var(--px-c) / 0.64)) right 8px top 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.64), rgb(var(--px-c) / 0.64)) right 0px top 8px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.4), rgb(var(--px-c) / 0.4)) right 12px top 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.4), rgb(var(--px-c) / 0.4)) right 0px top 12px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.22), rgb(var(--px-c) / 0.22)) right 16px top 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.22), rgb(var(--px-c) / 0.22)) right 0px top 16px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 1), rgb(var(--px-c) / 1)) left 0px bottom 0px / 6px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 1), rgb(var(--px-c) / 1)) left 0px bottom 2px / 2px 4px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.78), rgb(var(--px-c) / 0.78)) left 4px bottom 4px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.64), rgb(var(--px-c) / 0.64)) left 8px bottom 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.64), rgb(var(--px-c) / 0.64)) left 0px bottom 8px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.4), rgb(var(--px-c) / 0.4)) left 12px bottom 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.4), rgb(var(--px-c) / 0.4)) left 0px bottom 12px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.22), rgb(var(--px-c) / 0.22)) left 16px bottom 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.22), rgb(var(--px-c) / 0.22)) left 0px bottom 16px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 1), rgb(var(--px-c) / 1)) right 0px bottom 0px / 6px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 1), rgb(var(--px-c) / 1)) right 0px bottom 2px / 2px 4px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.78), rgb(var(--px-c) / 0.78)) right 4px bottom 4px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.64), rgb(var(--px-c) / 0.64)) right 8px bottom 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.64), rgb(var(--px-c) / 0.64)) right 0px bottom 8px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.4), rgb(var(--px-c) / 0.4)) right 12px bottom 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.4), rgb(var(--px-c) / 0.4)) right 0px bottom 12px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.22), rgb(var(--px-c) / 0.22)) right 16px bottom 0px / 2px 2px no-repeat,
    linear-gradient(rgb(var(--px-c) / 0.22), rgb(var(--px-c) / 0.22)) right 0px bottom 16px / 2px 2px no-repeat;
}
/* resting ornaments */
html body .research-project__media::after,
html body .trial-cell__frame::after,
html body .figma-case--slides .figma-artboard::after { opacity: 0.42; }
/* bright shimmer copy revealed by a diagonal band that travels TL -> BR (slow breathing) */
html body .research-project__media::before,
html body .trial-cell__frame::before,
html body .figma-case--slides .figma-artboard::before {
  --px-c: 255 255 255;
  opacity: 0;
  filter: drop-shadow(0 0 6px rgb(206 226 255 / 55%));
  -webkit-mask-image: linear-gradient(135deg, transparent 38%, #000 47%, #000 53%, transparent 62%);
  mask-image: linear-gradient(135deg, transparent 38%, #000 47%, #000 53%, transparent 62%);
  -webkit-mask-size: 300% 300%;
  mask-size: 300% 300%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition: opacity 420ms ease;
}
html body .research-project:hover .research-project__media::before,
html body .research-project:focus-visible .research-project__media::before,
html body .trial-cell:hover .trial-cell__frame::before,
html body .figma-case--slides .figma-artboard.is-active::before,
html body .figma-case--slides .figma-artboard:hover::before {
  opacity: 1;
  animation: px-corner-sweep 5.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
@keyframes px-corner-sweep {
  0%   { -webkit-mask-position: 100% 100%; mask-position: 100% 100%; }
  70%  { -webkit-mask-position: 0% 0%; mask-position: 0% 0%; }
  100% { -webkit-mask-position: 0% 0%; mask-position: 0% 0%; }
}

/* ---------- stepped pixel blocks (badges / buttons) ---------- */
html body .research-project__badge {
  padding: 4px 8px !important;
  color: rgb(255 255 255 / 72%) !important;
  background: rgb(150 180 255 / 10%) !important;
  clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px), 0 2px, 2px 2px);
  font: 400 var(--md-label-medium) / 1.333 var(--px-font) !important;
  letter-spacing: 0.04em;
  transition: background 320ms ease, color 320ms ease;
}
html body .research-project:hover .research-project__badge { color: #fff !important; background: var(--px-accent) !important; }

/* ---------- pixel arrows ---------- */
html body .research-project__arrow {
  width: 20px;
  height: 20px;
  font-size: 0 !important;
  color: rgb(255 255 255 / 42%);
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' shape-rendering='crispEdges'%3E%3Crect x='14' y='4' width='2' height='2'/%3E%3Crect x='12' y='6' width='2' height='2'/%3E%3Crect x='10' y='8' width='2' height='2'/%3E%3Crect x='8' y='10' width='2' height='2'/%3E%3Crect x='6' y='12' width='2' height='2'/%3E%3Crect x='4' y='14' width='2' height='2'/%3E%3Crect x='2' y='16' width='2' height='2'/%3E%3Crect x='8' y='2' width='10' height='2'/%3E%3Crect x='16' y='2' width='2' height='10'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' shape-rendering='crispEdges'%3E%3Crect x='14' y='4' width='2' height='2'/%3E%3Crect x='12' y='6' width='2' height='2'/%3E%3Crect x='10' y='8' width='2' height='2'/%3E%3Crect x='8' y='10' width='2' height='2'/%3E%3Crect x='6' y='12' width='2' height='2'/%3E%3Crect x='4' y='14' width='2' height='2'/%3E%3Crect x='2' y='16' width='2' height='2'/%3E%3Crect x='8' y='2' width='10' height='2'/%3E%3Crect x='16' y='2' width='2' height='10'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  transition: color 240ms ease, transform 240ms steps(4, end) !important;
}
html body .research-project:hover .research-project__arrow { color: #fff; transform: translate(4px, -4px); }

html body .case-deck__button {
  position: relative;
  width: 40px !important;
  height: 40px !important;
  font-size: 0 !important;
  color: rgb(255 255 255 / 78%) !important;
  background: rgb(255 255 255 / 8%) !important;
  clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px), 0 2px, 2px 2px);
  transition: background 220ms ease, color 220ms ease;
}
html body .case-deck__button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='16' viewBox='0 0 24 16' shape-rendering='crispEdges'%3E%3Crect x='0' y='7' width='2' height='2' opacity='0.45'/%3E%3Crect x='4' y='7' width='14' height='2'/%3E%3Crect x='14' y='3' width='2' height='2'/%3E%3Crect x='16' y='5' width='2' height='2'/%3E%3Crect x='18' y='7' width='2' height='2'/%3E%3Crect x='16' y='9' width='2' height='2'/%3E%3Crect x='14' y='11' width='2' height='2'/%3E%3C/svg%3E") center / 18px 12px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='16' viewBox='0 0 24 16' shape-rendering='crispEdges'%3E%3Crect x='0' y='7' width='2' height='2' opacity='0.45'/%3E%3Crect x='4' y='7' width='14' height='2'/%3E%3Crect x='14' y='3' width='2' height='2'/%3E%3Crect x='16' y='5' width='2' height='2'/%3E%3Crect x='18' y='7' width='2' height='2'/%3E%3Crect x='16' y='9' width='2' height='2'/%3E%3Crect x='14' y='11' width='2' height='2'/%3E%3C/svg%3E") center / 18px 12px no-repeat;
}
html body .case-deck__button[data-slide-prev]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='16' viewBox='0 0 24 16' shape-rendering='crispEdges'%3E%3Cg transform='translate%2824 0%29 scale%28-1 1%29'%3E%3Crect x='0' y='7' width='2' height='2' opacity='0.45'/%3E%3Crect x='4' y='7' width='14' height='2'/%3E%3Crect x='14' y='3' width='2' height='2'/%3E%3Crect x='16' y='5' width='2' height='2'/%3E%3Crect x='18' y='7' width='2' height='2'/%3E%3Crect x='16' y='9' width='2' height='2'/%3E%3Crect x='14' y='11' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='16' viewBox='0 0 24 16' shape-rendering='crispEdges'%3E%3Cg transform='translate%2824 0%29 scale%28-1 1%29'%3E%3Crect x='0' y='7' width='2' height='2' opacity='0.45'/%3E%3Crect x='4' y='7' width='14' height='2'/%3E%3Crect x='14' y='3' width='2' height='2'/%3E%3Crect x='16' y='5' width='2' height='2'/%3E%3Crect x='18' y='7' width='2' height='2'/%3E%3Crect x='16' y='9' width='2' height='2'/%3E%3Crect x='14' y='11' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
}
html body .case-deck__button:hover { color: #fff !important; background: var(--px-accent) !important; }
html body .case-deck__pager span { font: 400 var(--md-label-medium) / 1.333 var(--px-font) !important; letter-spacing: 0.08em; }
/* project pager: crisp 2px pixel bars, square ends */
html body .case-project-nav__item span { height: 2px !important; border-radius: 0 !important; image-rendering: pixelated; }
html body .case-project-nav__item.is-active span { background: #fff !important; box-shadow: 0 0 6px rgb(206 226 255 / 50%); }

/* ---------- /research/: no decorative page background (chromatic dot waves / backdrop image) ---------- */
html body[data-page="home"] .chromatic-waves { display: none !important; }

/* ---------- /research/ typography on the M3 scale ---------- */
html body .research-projects__eyebrow { font: 400 var(--md-label-large) / 1.429 var(--px-font) !important; letter-spacing: 0.06em; color: rgb(255 255 255 / 56%) !important; }
html body .research-projects__intro h1 { font: 400 var(--md-display-small) / 1.222 var(--px-font) !important; letter-spacing: 0.02em; }
html body .research-project__details strong { font: 400 var(--md-headline-small) / 1.333 var(--px-font) !important; letter-spacing: 0.015em; }
html body .research-project__authors { font: 400 var(--md-body-medium) / 1.429 var(--px-font) !important; color: rgb(255 255 255 / 52%) !important; }
html body .research-project__summary { font: 400 var(--md-body-medium) / 1.6 var(--px-font) !important; color: rgb(255 255 255 / 80%) !important; }
html body .research-project__keywords,
html body .research-project__links { font: 400 var(--md-label-medium) / 1.333 var(--px-font) !important; letter-spacing: 0.03em; color: rgb(255 255 255 / 56%) !important; }
html body .research-project { border-bottom: 2px dotted rgb(150 180 255 / 14%) !important; }
html body .research-project__media {
  background-color: #020306 !important;
  background-image: radial-gradient(rgb(138 178 248 / 9%) 1px, transparent 1px) !important;
  background-size: 4px 4px !important;
}

/* ---------- /ai-trial/ pixel cards & captions ---------- */
html body .trial-cell__frame:not(.trial-cell__frame--film) {
  background-color: #020306 !important;
  background-image: radial-gradient(rgb(138 178 248 / 9%) 1px, transparent 1px) !important;
  background-size: 4px 4px !important;
}
html body .trial-cell.is-visible:hover .trial-cell__frame { box-shadow: 0 38px 96px rgb(0 0 0 / 70%), 0 10px 30px rgb(0 0 0 / 50%) !important; }
html body .trial-caption { font-family: var(--px-font) !important; font-size: var(--md-body-small) !important; line-height: 1.333 !important; }
html body .trial-caption__title { font-size: var(--md-title-medium) !important; line-height: 1.5 !important; font-weight: 700 !important; }
html body .trial-caption p { min-height: 1.4em; }
html body body[data-page="ai-trial"] main, html body[data-page="ai-trial"] main { padding-top: 96px; }

/* ---------- /prompt-timeline/ deck ---------- */
html body.figma-case-page .figma-case { padding-top: 0; }

@media (max-width: 760px) {
  html body .site-nav .nav-links { gap: 14px !important; }
  html body .site-nav .nav-links a { font-size: var(--md-label-medium) !important; }
  html body .site-nav .language-switch { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  html body .site-nav .brand::before,
  html body .research-project:hover .research-project__media::before,
  html body .trial-cell:hover .trial-cell__frame::before,
  html body .figma-case--slides .figma-artboard.is-active::before { animation: none !important; }
}

/* ---------- pure black canvas on every inner page (no dither, no grain veil) ---------- */
html { background: #000 !important; }
html body::after { display: none !important; }
html body .site-nav,
html body .site-nav.site-nav--work,
html body .site-nav.site-nav--case { background: linear-gradient(to bottom, rgb(0 0 0 / 88%), rgb(0 0 0 / 0%)) !important; }
html body main.figma-case { background: #000 !important; }

/* ---------- pinned nav never collapses into the legacy "work pill" (ai-trial scroll state) ---------- */
html body .site-nav.site-nav--work .nav-links,
html body .site-nav.site-nav--work .language-switch {
  opacity: 1 !important; pointer-events: auto !important; width: auto !important; overflow: visible !important;
  flex: none !important; justify-content: flex-end !important;
}
html body .site-nav.site-nav--work .brand-label { display: inline !important; }
html body .site-nav.site-nav--work .nav-links { margin-left: auto !important; }

/* ---------- mobile: logo-only brand, compact links, language toggle kept ---------- */
@media (max-width: 760px) {
  html body .site-nav, html body .site-nav.site-nav--work { height: 64px !important; padding: 0 16px !important; }
  html body .site-nav .brand .brand-label, html body .site-nav.site-nav--work .brand .brand-label { display: none !important; }
  html body .site-nav .nav-links { gap: 12px !important; margin-left: auto !important; }
  html body .site-nav .nav-links a { font-size: var(--md-label-medium) !important; padding: 4px 0 !important; }
  html body .site-nav .language-switch { display: inline-flex !important; margin-left: 12px !important; padding-left: 12px !important; gap: 6px !important; }
}
html body .site-nav .nav-links a,
html body .site-nav .nav-links a[aria-current="page"],
html body .site-nav .nav-links a:hover { background: none !important; }

/* ======================================================================
   DAYTIME LIGHT MODE (html.theme-light, set by assets/tod-theme.js from the sun over Beijing)
   ====================================================================== */
html.theme-light { background: #f3f4f7 !important; color-scheme: light; }
html.theme-light body { color: #0b1330 !important; }
html.theme-light body .site-nav,
html.theme-light body .site-nav.site-nav--work,
html.theme-light body .site-nav.site-nav--case { background: linear-gradient(to bottom, rgb(243 244 247 / 92%), rgb(243 244 247 / 0%)) !important; }
html.theme-light body main.figma-case,
html.theme-light body.figma-case-page,
html.theme-light body .figma-case--slides.is-deck { background: #f3f4f7 !important; }
/* nav */
html.theme-light body .site-nav .brand,
html.theme-light body .site-nav .brand .brand-label { color: #0b1330 !important; }
html.theme-light body .site-nav .brand::before { animation: none; filter: brightness(0.14); }
html.theme-light body .site-nav .nav-links a { color: rgb(11 19 48 / 56%) !important; }
html.theme-light body .site-nav .nav-links a:hover { color: rgb(11 19 48 / 92%) !important; }
html.theme-light body .site-nav .nav-links a[aria-current="page"] { color: #0b1330 !important; text-shadow: 0 0 0.55px rgb(11 19 48 / 90%) !important; }
html.theme-light body .site-nav .language-switch { border-left-color: rgb(11 19 48 / 16%) !important; }
html.theme-light body .site-nav .language-switch button { color: rgb(11 19 48 / 46%) !important; }
html.theme-light body .site-nav .language-switch button:hover { color: rgb(11 19 48 / 86%) !important; }
html.theme-light body .site-nav .language-switch[data-language] button[aria-pressed="true"] { color: #0b1330 !important; }
/* research */
html.theme-light body .research-projects__eyebrow { color: rgb(11 19 48 / 56%) !important; }
html.theme-light body .research-projects__intro h1,
html.theme-light body .research-project__title,
html.theme-light body .research-project__details strong { color: #0b1330 !important; }
html.theme-light body .research-project__authors { color: rgb(11 19 48 / 56%) !important; }
html.theme-light body .research-project__summary { color: rgb(11 19 48 / 80%) !important; }
html.theme-light body .research-project__keywords,
html.theme-light body .research-project__links { color: rgb(11 19 48 / 56%) !important; }
html.theme-light body .research-project { border-bottom-color: rgb(40 70 160 / 16%) !important; }
html.theme-light body .research-project__badge { color: rgb(11 19 48 / 72%) !important; background: rgb(40 70 160 / 8%) !important; }
html.theme-light body .research-project:hover .research-project__badge { color: #fff !important; }
html.theme-light body .research-project__arrow { color: rgb(11 19 48 / 40%); }
html.theme-light body .research-project:hover .research-project__arrow { color: #0b1330; }
html.theme-light body .research-project__media {
  background-color: #ffffff !important;
  background-image: radial-gradient(rgb(40 70 160 / 7%) 1px, transparent 1px) !important;
}
html.theme-light body .research-project__media,
html.theme-light body .figma-case--slides .figma-artboard { --px-c: 11 19 48; }
/* project deck controls */
html.theme-light body .case-deck-controls { color: rgb(11 19 48 / 80%) !important; }
html.theme-light body .case-deck__button { color: rgb(11 19 48 / 78%) !important; background: rgb(11 19 48 / 6%) !important; }
html.theme-light body .case-deck__button:hover { color: #fff !important; }
html.theme-light body .case-deck__pager span { color: rgb(11 19 48 / 56%) !important; }
html.theme-light body .case-project-nav__item span { background: rgb(11 19 48 / 32%) !important; }
html.theme-light body .case-project-nav__item.is-active span { background: #0b1330 !important; box-shadow: none !important; }
html.theme-light body .figma-case--slides .figma-artboard { box-shadow: 0 30px 70px -34px rgb(20 30 70 / 30%); }
