﻿/* ==========================================================================
   PIXEL DESKTOP THEME — KAIYU.OS 95
   Loaded after style.css so the whole portfolio reads as one old computer.
   ========================================================================== */

@font-face {
  font-family: "Fusion Pixel";
  src: url("../fonts/fusion-pixel-zh.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}

@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/press-start-2p.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}

:root {
  --px-bg: #073b38;
  --px-bg-deep: #032421;
  --px-face: #d7ceb3;
  --px-face-hi: #f7f0dc;
  --px-face-lo: #847c66;
  --px-ink: #17150f;
  --px-navy: #182b58;
  --px-navy-hi: #35558b;
  --px-red: #a92f24;
  --px-shadow: #021817;
  --px-cn: "Fusion Pixel", "MS Gothic", "SimSun", monospace;
  --px-en: "Press Start 2P", "Courier New", monospace;

  --paper: #0b0b0b;
  --paper-light: #11110e;
  --paper-deep: #050505;
  --ink: #f2e7d8;
  --muted: #a6b3a4;
  --line: #3b4a44;
  --line-strong: #718176;
  --red: #d34b35;
  --red-deep: #7c1e18;
  --cn-serif: var(--px-cn);
  --serif: var(--px-en);
  --sans: var(--px-cn);
  --mono: var(--px-en);
  --hand: var(--px-cn);
  --header-h: 36px;
}

html {
  background: var(--px-bg);
  font-smooth: never;
  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
}

body {
  min-height: 100vh;
  padding: 44px 0 50px;
  background-color: var(--px-bg);
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, .10) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .10) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, .035) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .035) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  color: var(--ink);
  font-family: var(--px-cn);
  font-size: 14px;
  line-height: 1.85;
}

body.work-page {
  padding-top: 44px;
}

body::selection,
::selection {
  background: var(--red);
  color: var(--px-face-hi);
}

button,
input,
textarea,
select,
a {
  font-family: var(--px-cn);
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
li,
figcaption,
blockquote {
  font-family: var(--px-cn);
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b {
  font-weight: 400;
  letter-spacing: 0;
}

/* Make every English micro-label read like a machine label. */
.eyebrow,
.hero-topline,
.hero-kicker,
.hero-bottom,
.hero-portfolio-note em,
.chapter-tags,
.work-section-head,
.chapter-topline,
.px-title,
.px-taskbar,
.caption,
.film-label,
.site-experience-kicker,
.site-experience-url,
.contact-kicker,
.footer-kicker,
.resume-sheet-foot,
.resume-sheet-esc,
.work-noscript {
  font-family: var(--px-en);
  letter-spacing: .02em;
}

.paper-grain {
  z-index: 2190;
  opacity: .24;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, .25) 0,
    rgba(0, 0, 0, .25) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

/* Keyboard / accessibility remains visible through the pixel skin. */
:focus-visible {
  outline: 2px dashed var(--px-face-hi) !important;
  outline-offset: 3px !important;
}

.skip-link {
  font-family: var(--px-cn);
  background: var(--px-face);
  color: var(--px-ink);
}

/* --------------------------------------------------------------------------
   Top menu bar / work header
   -------------------------------------------------------------------------- */

.site-header,
.work-header {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  left: 0;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid var(--px-ink);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: inset 0 1px 0 var(--px-face-hi), inset 0 -1px 0 var(--px-face-lo);
  backdrop-filter: none;
}

.site-header.is-stuck {
  box-shadow: inset 0 1px 0 var(--px-face-hi), inset 0 -1px 0 var(--px-face-lo), 0 4px 0 rgba(0, 0, 0, .2);
}

.site-header .brand,
.work-header .brand {
  gap: 8px;
  color: var(--px-ink);
}

.brand-seal {
  width: 24px;
  height: 24px;
  border: 1px solid var(--px-ink);
  border-radius: 0;
  background: var(--px-red);
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: 18px;
  line-height: 22px;
  box-shadow: 2px 2px 0 var(--px-ink);
}

.brand-type b {
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 12px;
  line-height: 1.1;
}

.brand-type em {
  margin-top: 2px;
  color: #4f4a3d;
  font-family: var(--px-en);
  font-size: 5px;
  letter-spacing: .02em;
}

.site-nav {
  gap: 2px;
}

.site-nav a,
.work-nav a {
  padding: 5px 7px;
  border: 1px solid transparent;
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 11px;
  line-height: 1;
}

.site-nav a:hover,
.site-nav a.is-active,
.work-nav a:hover,
.work-nav a.is-active {
  border-color: var(--px-ink);
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.header-side {
  gap: 8px;
}

.header-side .header-time,
.header-side .header-loc {
  color: #4f4a3d;
  font-family: var(--px-en);
  font-size: 5px;
}

.header-side .chapter-reader-trigger,
.header-side .contact-jump,
.header-side .game-trigger,
.menu-toggle,
.work-back {
  min-height: 22px;
  padding: 4px 7px;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  border-radius: 0;
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 10px;
  line-height: 1;
  box-shadow: none;
}

.header-side .chapter-reader-trigger:hover,
.header-side .contact-jump:hover,
.header-side .game-trigger:hover,
.menu-toggle:hover,
.work-back:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.menu-toggle span {
  font-size: 10px;
}

.menu-toggle i {
  width: 12px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.work-nav {
  gap: 2px;
}

.work-nav a {
  font-size: 10px;
}

.work-back {
  color: var(--px-ink);
}

/* --------------------------------------------------------------------------
   OS windows
   -------------------------------------------------------------------------- */

.px-frame {
  position: relative;
  width: min(calc(100% - 24px), 1500px);
  margin: 10px auto 14px;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--px-shadow);
  animation: pxWindowIn .32s steps(4, end) both;
}

.px-frame[hidden] {
  display: none;
}

@keyframes pxWindowIn {
  from { opacity: 0; transform: translate(4px, 4px); }
  to { opacity: 1; transform: translate(0, 0); }
}

.px-frame > section,
.px-frame > footer {
  border: 0;
  background: var(--paper);
  box-shadow: none;
}

.px-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  padding: 0 3px 0 7px;
  background: linear-gradient(90deg, var(--px-navy), var(--px-navy-hi));
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: 10px;
  line-height: 1;
  user-select: none;
}

.px-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.px-title-mark {
  color: #cde4dc;
  font-family: var(--px-en);
  font-size: 7px;
  font-style: normal;
}

.px-controls {
  display: inline-flex;
  gap: 2px;
  flex: 0 0 auto;
}

.px-controls b {
  display: grid;
  place-items: center;
  width: 17px;
  height: 15px;
  border: 1px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 6px;
  font-weight: 400;
  line-height: 1;
}

.px-windowbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 17px;
  padding: 3px 6px;
  border-top: 1px solid var(--px-face-lo);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 5px;
  line-height: 1;
}

.px-windowbar span:first-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Hero: an application window inside the desktop
   -------------------------------------------------------------------------- */

.px-frame .hero {
  min-height: 0;
  padding: 16px clamp(20px, 3.4vw, 52px) 18px;
  overflow: hidden;
}

.hero::before,
.hero::after {
  display: none;
}

.hero-topline {
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 6px;
}

body.is-ready .hero h1 {
  animation: hero-headline-in .45s steps(7, end) .08s both;
}

.hero-stage {
  min-height: 0;
  align-items: start;
  padding: 2vh 0 1vh;
}

.hero-kicker {
  margin-bottom: 12px;
  color: var(--px-face);
  font-family: var(--px-en);
  font-size: 6px;
}

.hero-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 0;
  background: var(--px-red);
  box-shadow: 2px 0 0 var(--px-red), 0 2px 0 var(--px-red);
}

.hero h1 {
  margin: 0 0 16px;
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: clamp(48px, 7vw, 96px);
  line-height: 1.18;
  letter-spacing: -.02em;
  text-shadow: 4px 4px 0 #6f211a, 7px 7px 0 var(--px-shadow);
}

.hero h1 em {
  color: var(--red);
  font-style: normal;
  text-shadow: 4px 4px 0 #44100c;
}

.hero h1 .full-stop {
  color: var(--red);
  text-shadow: 3px 3px 0 var(--px-shadow);
}

.hero-intro-row {
  gap: 16px;
  padding-top: 18px;
}

.hero-portfolio-note {
  color: var(--px-face) !important;
  font-family: var(--px-cn);
  font-size: 13px !important;
}

.hero-portfolio-note em {
  color: var(--muted);
  font-size: 5px !important;
}

.hero-desc {
  max-width: 58ch;
  color: #d3ccb9;
  font-family: var(--px-cn);
  font-size: 13px;
  line-height: 1.95;
}

.hero-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 5px 8px;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 12px;
  text-decoration: none;
}

.hero-entry:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.hero-entry i {
  font-family: var(--px-en);
  font-size: 7px;
}

/* The six chapter tickets become folder shortcuts. */
.hero-gallery {
  max-width: 500px;
}

.hero-board {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 4px 4px 0 var(--px-shadow);
}

.hero-board-head,
.hero-board-foot {
  border-color: var(--px-face-lo);
  color: #4d493c;
  font-family: var(--px-en);
  font-size: 5px;
}

.hero-board-head {
  background: #c5bca5;
}

.hero-board-foot {
  background: #c5bca5;
}

.hero-board-reset {
  border: 1px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 9px;
}

.hero-cell-back {
  border: 1px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: #c8bfa8;
  color: var(--px-ink);
  box-shadow: none;
}

.hero-cell-back::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  width: 42%;
  height: 6px;
  border: 1px solid var(--px-face-lo);
  border-bottom: 0;
  background: var(--px-face-hi);
}

.hero-cell-top {
  color: #5e5747;
  font-family: var(--px-en);
  font-size: 5px;
}

.hero-cell-name {
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: clamp(15px, 1.35vw, 20px);
  line-height: 1.15;
}

.hero-cell-poke {
  color: #4d493c;
  font-family: var(--px-cn);
  font-size: 9px;
}

.hero-cell-front {
  border: 1px solid var(--px-face-lo);
}

.hero-cell-front img,
.catalogue-face--front img,
.about-card img,
.chapter-work-photo img {
  image-rendering: pixelated;
}

.hero-cell:hover .hero-cell-back {
  background: var(--px-navy);
  color: var(--px-face-hi);
}

.hero-cell:hover .hero-cell-name,
.hero-cell:hover .hero-cell-poke,
.hero-cell:hover .hero-cell-top {
  color: var(--px-face-hi);
}

.hero-cell-meta b {
  font-family: var(--px-cn);
}

.hero-cell-meta em {
  font-family: var(--px-en);
  font-size: 5px;
}

.hero-gallery figcaption {
  color: var(--muted);
  font-family: var(--px-en);
  font-size: 5px;
}

.hero-bottom {
  border-top: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 5px;
}

/* --------------------------------------------------------------------------
   Section labels and headings
   -------------------------------------------------------------------------- */

.index-section,
.about-section,
.contact-section,
.site-footer,
.chapter-section {
  padding: clamp(28px, 4vw, 58px) clamp(20px, 4vw, 58px);
}

.index-head h2,
.about-head h2,
.contact-head h2,
.chapter-hero h1,
.work-section-head,
.chapter-pager strong {
  font-family: var(--px-cn);
  font-weight: 400;
  letter-spacing: 0;
}

.index-head h2,
.about-head h2 {
  font-size: clamp(38px, 5vw, 72px);
  line-height: 1.08;
  text-shadow: 4px 4px 0 #4a1812;
}

.index-head h2 em,
.about-head h2 em,
.contact-head h2 em {
  color: var(--red);
  font-style: normal;
}

.index-head p,
.about-lead,
.contact-lead {
  font-family: var(--px-cn);
  line-height: 2;
}

.index-facts,
.about-stats,
.registry,
.chapter-tags,
.work-section-head {
  font-family: var(--px-en);
}

.index-facts b,
.about-stats b {
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  text-shadow: 2px 2px 0 #4a1812;
}

/* --------------------------------------------------------------------------
   Catalogue cards: file windows / thumbnails
   -------------------------------------------------------------------------- */

.index-grid {
  gap: 12px;
  align-items: stretch;
}

.catalogue-item {
  position: relative;
  min-width: 0;
  isolation: isolate;
}

.catalogue-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  box-shadow: 4px 4px 0 var(--px-shadow);
  perspective: 1000px;
  transition: transform .12s steps(2, end), box-shadow .12s steps(2, end);
}

.catalogue-inner {
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform .58s steps(7, end);
}

.catalogue-card:focus-visible .catalogue-inner,
.catalogue-item.is-flipped .catalogue-inner {
  transform: rotateY(180deg);
}

@media (hover: hover) {
  .catalogue-card:hover .catalogue-inner {
    transform: rotateY(180deg);
  }

  .catalogue-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--px-shadow);
  }
}

.catalogue-face {
  border: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.catalogue-face--back {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 12px 9px;
  background-color: var(--px-face);
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, .055) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .055) 75%);
  background-size: 6px 6px;
  color: var(--px-ink);
  transform: rotateY(0deg);
}

.catalogue-face--back::before {
  content: "C:\\KAIYU\\CHAPTER";
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: 15px;
  padding: 4px 5px 0;
  background: var(--px-navy);
  color: var(--px-face-hi);
  font-family: var(--px-en);
  font-size: 5px;
  line-height: 1;
}

.catalogue-face--front {
  transform: rotateY(180deg);
  background: #080807;
}

.catalogue-card::before {
  content: "";
  position: absolute;
  z-index: 4;
  top: 15px;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--px-red);
  opacity: 0;
  pointer-events: none;
}

.catalogue-item.is-flipped .catalogue-card::before,
.catalogue-card:hover::before,
.catalogue-card:focus-visible::before {
  animation: catalogueScan .56s steps(8, end) both;
}

@keyframes catalogueScan {
  0% { top: 15px; opacity: .9; }
  100% { top: calc(100% - 2px); opacity: 0; }
}

.catalogue-top,
.catalogue-bottom {
  border-color: rgba(21, 21, 15, .25);
  color: #544d3d;
  font-family: var(--px-en);
  font-size: 4.5px;
}

.catalogue-bottom {
  color: #544d3d;
  font-family: var(--px-cn);
  font-size: 8px;
}

.catalogue-bottom span:last-child {
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: 8px;
}

.catalogue-num {
  color: rgba(169, 47, 36, .32);
  font-family: var(--px-en);
  font-size: clamp(38px, 4vw, 58px);
  letter-spacing: -.04em;
}

.catalogue-name b {
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: clamp(22px, 2.3vw, 32px);
  font-weight: 400;
  letter-spacing: 0;
  text-shadow: 2px 2px 0 rgba(76, 23, 18, .12);
}

.catalogue-name em {
  color: #5a5343;
  font-family: var(--px-en);
  font-size: 5px;
}

.catalogue-watermark {
  color: rgba(21, 21, 15, .075);
  font-family: var(--px-en);
  font-size: clamp(18px, 2.2vw, 30px);
  letter-spacing: 0;
}

.catalogue-turn {
  position: absolute;
  z-index: 8;
  top: 3px;
  right: 3px;
  display: none;
  place-items: center;
  width: 24px;
  height: 17px;
  padding: 0;
  border: 1px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 9px;
  line-height: 1;
}

.catalogue-turn:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.catalogue-turn[aria-pressed="true"] {
  background: var(--px-red);
  color: var(--px-face-hi);
}

@media (hover: none), (pointer: coarse) {
  .catalogue-turn {
    display: grid;
  }
}

.catalogue-face--front::after {
  content: "C:\\KAIYU\\WORKS";
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  height: 15px;
  padding: 4px 5px 0;
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 5px;
  line-height: 1;
  pointer-events: none;
}

.catalogue-front-shade {
  top: 15px;
  background: linear-gradient(to top, rgba(0, 0, 0, .92), transparent 70%);
}

.catalogue-front-meta {
  right: 8px;
  bottom: 7px;
  left: 8px;
  gap: 2px;
}

.catalogue-front-meta > span:first-child {
  color: #b9e3d8;
  font-family: var(--px-en);
  font-size: 5px;
}

.catalogue-front-meta b {
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: clamp(18px, 1.8vw, 26px);
  line-height: 1.15;
  text-shadow: 2px 2px 0 #000;
}

.catalogue-front-meta em {
  color: var(--px-face);
  font-family: var(--px-en);
  font-size: 5px;
}

.catalogue-open {
  border-bottom: 0;
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: 9px;
}

.catalogue-card:hover .catalogue-open {
  color: #ffe6a3;
}

.catalogue-card:hover .catalogue-face--front img {
  transform: scale(1.015);
}

.catalogue-card:active {
  border-color: var(--px-face-lo) var(--px-face-hi) var(--px-face-hi) var(--px-face-lo);
}

/* --------------------------------------------------------------------------
   About / CV / resume modal
   -------------------------------------------------------------------------- */

.about-card {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  box-shadow: 4px 4px 0 var(--px-shadow);
}

.about-card::before,
.about-card::after {
  display: none;
}

.about-portrait,
.about-card .portrait-cutout {
  image-rendering: pixelated;
}

.about-flip-hint,
.about-back-hint {
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 5px;
}

.resume-card {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: #8e211a;
  box-shadow: 4px 4px 0 var(--px-shadow);
  transform: rotate(0);
}

.resume-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--px-shadow);
}

.resume-wax {
  border-radius: 0;
  border: 2px solid var(--px-face-hi);
  background: var(--px-ink);
  color: var(--px-face-hi);
  box-shadow: none;
}

.resume-wax::after {
  border-radius: 0;
  border-color: var(--px-face-lo);
}

.resume-top,
.resume-bottom {
  font-family: var(--px-en);
  font-size: 5px;
}

.resume-title {
  font-family: var(--px-cn);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  text-shadow: 3px 3px 0 #43100c;
}

.resume-postmark {
  border-radius: 0;
  font-family: var(--px-en);
  font-size: 5px;
}

.about-stats {
  border-top: 1px dashed var(--line-strong);
  border-bottom: 1px dashed var(--line-strong);
}

.about-block h3,
.honor-note .note-kicker {
  font-family: var(--px-en);
  font-size: 6px;
}

.cap-list,
.fact-list {
  font-family: var(--px-cn);
}

.honor-note {
  border: 2px solid;
  border-color: var(--px-face-lo) var(--px-face-hi) var(--px-face-hi) var(--px-face-lo);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 3px 3px 0 var(--px-shadow);
}

.honor-note .tape {
  background: var(--px-face-lo);
  border-radius: 0;
}

.resume-modal-scrim {
  background: rgba(3, 36, 33, .9);
}

.resume-sheet {
  width: min(860px, 94vw);
  padding: 42px 12px 14px;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  border-left-width: 2px;
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 8px 8px 0 var(--px-shadow);
  transform: rotate(0);
}

.resume-sheet::before {
  content: "RESUME.PNG — 郑铠妤的简历";
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  height: 22px;
  padding: 6px 8px 0;
  background: linear-gradient(90deg, var(--px-navy), var(--px-navy-hi));
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: 10px;
  line-height: 1;
}

.resume-sheet-close {
  top: 5px;
  right: 5px;
  left: auto;
  z-index: 4;
  border: 1px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 8px;
}

.resume-sheet-close:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.resume-sheet-preview img {
  border: 2px solid var(--px-face-lo);
  image-rendering: auto;
}

.resume-sheet-foot {
  color: #5a5445;
  font-family: var(--px-en);
  font-size: 5px;
}

.resume-modal.is-open .resume-sheet {
  animation: pxDialogIn .25s steps(4, end) both;
}

@keyframes pxDialogIn {
  from { opacity: 0; transform: translate(8px, 8px); }
  to { opacity: 1; transform: translate(0, 0); }
}

/* --------------------------------------------------------------------------
   Contact / mail client
   -------------------------------------------------------------------------- */

.contact-section {
  background: #7d201a;
}

.px-frame--contact > .contact-section {
  background: #7d201a;
}

.px-frame--contact .px-titlebar {
  background: linear-gradient(90deg, #5b1712, #9d2b22);
}

.contact-head h2,
.contact-title,
.contact-copy h2 {
  color: var(--px-face-hi);
  font-size: clamp(48px, 5.2vw, 72px);
  line-height: 1.14;
  letter-spacing: 0;
  text-shadow: 4px 4px 0 #3b0d0a;
}

.contact-copy h2 em {
  color: #f0c5a8;
  font-style: normal;
}

.contact-kicker,
.contact-head > span:first-child {
  color: #e8b9a0;
}

.email-copy,
.email-copy span {
  max-width: 100%;
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: clamp(15px, 1.7vw, 23px);
  line-height: 1.4;
  letter-spacing: 0;
  text-align: left;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.email-copy em {
  font-family: var(--px-en);
  font-size: 5px;
}

.postcard {
  min-width: 0;
}

.contact-lead,
.contact-note,
.contact-section p {
  color: #f0d8bd;
}

.postcard,
.contact-card,
.contact-form {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .38);
}

.postcard a,
.contact-card a {
  color: var(--px-ink);
}

.contact-links a,
.contact-mail,
.contact-phone {
  border-bottom: 1px dashed currentColor;
  font-family: var(--px-cn);
}

.contact-bottom {
  border-top: 1px dashed rgba(242, 231, 216, .35);
}

.contact-time,
.contact-bottom p,
.contact-bottom .contact-links {
  font-family: var(--px-en);
  font-size: 5px;
}

.manifesto {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: #1b1710;
}

.manifesto p {
  font-family: var(--px-cn);
  text-shadow: 3px 3px 0 #000;
}

/* --------------------------------------------------------------------------
   Chapter explorer
   -------------------------------------------------------------------------- */

.work-main {
  padding-top: 0;
}

.chapter-shell {
  width: 100%;
}

.px-frame .chapter-hero {
  padding: 22px clamp(20px, 4vw, 58px) 30px;
}

.chapter-topline {
  border-bottom: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 6px;
}

.chapter-title-wrap h1 {
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: clamp(52px, 7vw, 100px);
  line-height: 1;
  text-shadow: 4px 4px 0 #4a1812;
}

.chapter-num {
  color: var(--red);
  font-family: var(--px-en);
  font-size: clamp(28px, 4vw, 58px);
}

.chapter-hand {
  color: var(--red);
  font-family: var(--px-cn);
  font-size: 15px;
}

.chapter-copy > p {
  font-family: var(--px-cn);
  line-height: 2;
}

.chapter-tags li {
  border: 1px solid var(--line-strong);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 5px;
}

.chapter-works {
  gap: 18px;
}

.chapter-work {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 4px 4px 0 var(--px-shadow);
}

.chapter-work:hover {
  color: var(--px-ink);
}

.chapter-work-photo {
  border: 0;
  border-bottom: 1px solid var(--px-face-lo);
  background: #070707;
}

.chapter-work figcaption {
  padding: 7px 8px;
  color: var(--px-ink);
  font-family: var(--px-cn);
}

.work-index {
  color: #6b6250;
  font-family: var(--px-en);
  font-size: 5px;
}

.work-title b {
  font-family: var(--px-cn);
  font-size: 17px;
  font-weight: 400;
}

.work-title em {
  color: #5f5746;
  font-family: var(--px-cn);
  font-size: 10px;
}

.work-open {
  border: 1px solid var(--px-face-lo);
  background: var(--px-face-hi);
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 8px;
  line-height: 1;
}

.site-badge {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 9px;
}

.chapter-site-grid {
  gap: 12px;
}

.site-experience-card {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 4px 4px 0 var(--px-shadow);
}

.site-experience-card:hover {
  border-color: var(--px-ink);
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.site-experience-index {
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: 6px;
}

.site-experience-kicker,
.site-experience-body em,
.site-experience-url {
  color: #5f5746;
  font-family: var(--px-en);
  font-size: 5px;
}

.site-experience-body strong {
  font-family: var(--px-cn);
  font-size: clamp(21px, 2.2vw, 29px);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .3);
}

.site-experience-arrow {
  font-family: var(--px-cn);
  font-size: 9px;
}

.site-experience-card:hover .site-experience-kicker,
.site-experience-card:hover .site-experience-body em,
.site-experience-card:hover .site-experience-url {
  color: #d8cfb6;
}

.film-card {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 4px 4px 0 var(--px-shadow);
}

.film-frame {
  border-bottom: 1px solid var(--px-face-lo);
  background: #070707;
}

.film-meta {
  padding: 8px 9px;
}

.film-label {
  color: #6b6250;
  font-family: var(--px-en);
  font-size: 5px;
}

.film-meta h3 {
  font-family: var(--px-cn);
  font-size: 17px;
}

.film-meta h3 small,
.film-meta p {
  color: #5f5746;
  font-family: var(--px-cn);
  font-size: 10px;
}

.chapter-pager {
  width: min(calc(100% - 24px), 1500px);
  margin: 0 auto 14px;
  gap: 8px;
}

.chapter-pager-link {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 4px 4px 0 var(--px-shadow);
}

.chapter-pager-link:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.chapter-pager-link span {
  font-family: var(--px-en);
  font-size: 5px;
}

.chapter-pager strong {
  font-family: var(--px-cn);
  font-size: 19px;
}

.chapter-pager-link--next {
  text-align: right;
}

/* --------------------------------------------------------------------------
   Image viewer dialog
   -------------------------------------------------------------------------- */

.lightbox,
.chapter-lightbox {
  background-color: var(--px-bg-deep);
  background-image: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .025) 0 1px, transparent 1px 4px);
}

.lightbox-sheet,
.chapter-lightbox-sheet {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--paper);
  box-shadow: 6px 6px 0 #000;
}

.chapter-lightbox img,
.lightbox img {
  border: 2px solid var(--px-face-lo);
  image-rendering: auto;
}

.chapter-lightbox-close,
.lightbox-close,
.lightbox-tool {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  border-radius: 0;
}

.chapter-lightbox-close:hover,
.lightbox-close:hover,
.lightbox-tool:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.chapter-lightbox-meta,
.lightbox-meta {
  color: var(--px-face);
  font-family: var(--px-en);
  font-size: 5px;
}

/* --------------------------------------------------------------------------
   Menu / start menu
   -------------------------------------------------------------------------- */

.menu-overlay {
  background-color: var(--px-bg);
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, .12) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .12) 75%);
  background-size: 8px 8px;
  color: var(--px-face-hi);
}

.menu-top {
  border-bottom: 2px solid var(--px-face);
}

.menu-mark {
  color: var(--px-face-hi);
  font-family: var(--px-en);
  font-size: 6px;
}

.menu-close {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 11px;
  padding: 4px 6px;
}

.menu-close span {
  width: 20px;
  height: 20px;
  border: 1px solid var(--px-ink);
  border-radius: 0;
  font-family: var(--px-en);
  font-size: 8px;
}

.menu-links a {
  border-bottom: 1px dashed var(--px-face-lo);
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: clamp(30px, 8vw, 64px);
  line-height: 1.15;
}

.menu-links a:hover {
  padding-left: 0;
  background: var(--px-face);
  color: var(--px-ink);
}

.menu-links a span {
  color: #f0bca0;
  font-family: var(--px-en);
  font-size: 6px;
}

.menu-links a em {
  color: #b9cabc;
  font-family: var(--px-en);
  font-size: 6px;
}

.menu-bottom {
  border-top: 2px solid var(--px-face);
  color: #b9cabc;
  font-family: var(--px-en);
  font-size: 5px;
}

.menu-bottom a,
.menu-bottom span {
  color: var(--px-face-hi);
}

/* --------------------------------------------------------------------------
   Boot screen / loader
   -------------------------------------------------------------------------- */

.loader {
  background-color: var(--px-bg);
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, .12) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .12) 75%);
  background-size: 8px 8px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}

.loader::before {
  background:
    linear-gradient(to bottom, rgba(3, 36, 33, .98), rgba(3, 36, 33, 0) 12%, rgba(3, 36, 33, 0) 78%, rgba(3, 36, 33, .98)),
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px);
}

.loader::after {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
}

.loader-top,
.loader-bottom {
  border-color: rgba(247, 240, 220, .45);
  color: var(--px-face);
  font-family: var(--px-en);
  font-size: 5px;
}

.loader-top span:first-child::before {
  content: "KAIYU.OS 95  ";
}

.loader-bg {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  box-shadow: 4px 4px 0 #000;
}

.loader-bg::after {
  background: var(--px-red);
}

.loader-bg img {
  display: none !important;
}

.loader-fallback {
  z-index: 1;
  padding: 7% 8% 8%;
  background-color: #10100d;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, .025) 0 1px,
    transparent 1px 3px
  );
  font-family: var(--px-cn);
}

.loader-fallback::before {
  content: "C:\\KAIYU> TYPE INTRO.TXT";
  position: absolute;
  top: 12px;
  left: 14px;
  color: #7fa89a;
  font-family: var(--px-en);
  font-size: 5px;
  letter-spacing: 0;
}

.loader-fallback::after {
  content: "C:\\KAIYU\\PORTFOLIO> _";
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: 5px;
  animation: pxBlink 1s steps(2, end) infinite;
}

@keyframes pxBlink {
  50% { opacity: 0; }
}

.lf-year,
.lf-name,
.lf-quote,
.lf-script,
.lf-en {
  font-family: var(--px-cn);
}

.lf-year {
  color: var(--red);
  font-family: var(--px-en);
  font-size: clamp(14px, 2.4vw, 28px);
}

.lf-name {
  color: var(--px-face-hi);
}

.lf-quote {
  color: var(--px-face-hi);
  text-shadow: 3px 3px 0 #4b1712;
}

.lf-script {
  color: var(--red);
  font-family: var(--px-en);
  font-size: clamp(24px, 3.6vw, 46px);
  font-style: normal;
  transform: rotate(-2deg);
}

.lf-en {
  color: #b5c6b8;
  font-family: var(--px-en);
  font-size: 5px;
}

.loader-status {
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: clamp(22px, 3vw, 34px);
  text-shadow: 3px 3px 0 #44100c;
}

.loader-status em {
  color: #b5c6b8;
  font-family: var(--px-en);
  font-size: 5px;
}

.loader-seal {
  border-radius: 0;
  border: 2px solid var(--px-face-hi);
  background: var(--px-red);
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  box-shadow: 3px 3px 0 #000;
}

.loader-count {
  color: var(--px-face-hi);
  font-family: var(--px-en);
  font-size: 36px;
  text-shadow: 3px 3px 0 #44100c;
}

.loader-count sup {
  color: var(--px-face);
  font-family: var(--px-en);
  font-size: 8px;
}

.loader-line {
  height: 10px;
  border: 1px solid var(--px-face-hi);
  background: #0c1b18;
}

.loader-line span {
  background: repeating-linear-gradient(90deg, var(--px-red) 0 6px, #d9a07a 6px 8px);
}

.loader-enter {
  bottom: clamp(90px, 13vh, 150px);
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-red);
  color: var(--px-face-hi);
  border-radius: 0;
  box-shadow: 3px 3px 0 #000;
  font-family: var(--px-cn);
}

.loader-enter:hover {
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
}

.loader-enter-cn {
  font-family: var(--px-cn);
  font-size: clamp(16px, 2vw, 21px);
}

.loader-enter-en {
  font-family: var(--px-en);
  font-size: 5px;
}

.loader-enter i {
  font-family: var(--px-en);
  font-size: 9px;
}

/* --------------------------------------------------------------------------
   Reader and guessing-game dialogs
   -------------------------------------------------------------------------- */

.chapter-reader,
.fragment-game {
  background-color: var(--px-bg-deep);
  background-image: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .025) 0 1px, transparent 1px 4px);
}

.reader-sheet,
.game-sheet {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 7px 7px 0 #000;
}

.reader-top,
.game-top {
  padding: 5px 7px;
  border-bottom: 2px solid var(--px-ink);
  background: linear-gradient(90deg, var(--px-navy), var(--px-navy-hi));
  color: var(--px-face-hi);
}

.reader-top span,
.game-kicker,
.game-sub {
  color: var(--px-face-hi);
  font-family: var(--px-en);
  font-size: 5px;
}

.reader-close,
.game-close {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 10px;
}

.reader-close span,
.game-close span {
  width: 20px;
  height: 20px;
  border: 1px solid var(--px-ink);
  border-radius: 0;
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 7px;
}

.reader-close:hover,
.game-close:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.reader-head,
.reader-side,
.reader-foot {
  border-color: var(--px-face-lo);
}

.reader-heading h2 {
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: clamp(38px, 5vw, 66px);
  line-height: 1.08;
  text-shadow: 3px 3px 0 rgba(76, 23, 18, .25);
}

.reader-num {
  color: var(--px-red);
  font-family: var(--px-en);
}

.reader-hand {
  color: var(--px-red);
  font-family: var(--px-cn);
  font-size: 15px;
}

.reader-side p,
.reader-side #readerDesc {
  color: #403b2f;
  font-family: var(--px-cn);
  font-size: 12px;
  line-height: 1.9;
}

.reader-tags li {
  border: 1px solid var(--px-face-lo);
  background: var(--px-face-hi);
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 5px;
}

.reader-grid .catalogue-card {
  box-shadow: 3px 3px 0 var(--px-shadow);
}

.reader-foot button {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 11px;
}

.reader-foot button:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.reader-foot span {
  color: #645d4c;
  font-family: var(--px-en);
  font-size: 5px;
}

.game-body {
  background: var(--px-face);
}

.game-fragment {
  border: 2px solid;
  border-color: var(--px-face-lo) var(--px-face-hi) var(--px-face-hi) var(--px-face-lo);
  background: var(--px-ink);
  box-shadow: none;
}

.game-crop {
  image-rendering: pixelated;
}

.game-fragment-num,
.game-fragment-stamp,
.game-micro,
.game-key {
  color: #4d4738;
  font-family: var(--px-en);
  font-size: 5px;
}

.game-fragment-stamp {
  border: 1px solid #4d4738;
  background: var(--px-face);
  color: var(--px-red);
}

.game-meta {
  border-bottom: 1px dashed var(--px-face-lo);
  color: #4d4738;
  font-family: var(--px-en);
  font-size: 5px;
}

.game-title {
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: clamp(34px, 3.6vw, 50px);
  line-height: 1.1;
  letter-spacing: 0;
  text-shadow: 3px 3px 0 rgba(76, 23, 18, .2);
}

.game-title em {
  color: var(--px-red);
  font-style: normal;
}

.game-prompt {
  color: #403b2f;
  font-family: var(--px-cn);
  font-size: 12px;
  line-height: 1.9;
}

.game-choice {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 2px 2px 0 var(--px-face-lo);
}

.game-choice:hover,
.game-choice[aria-pressed="true"] {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.game-choice-num,
.game-choice em {
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: 5px;
}

.game-choice b {
  font-family: var(--px-cn);
  font-size: 15px;
  font-weight: 400;
}

.game-verdict,
.game-work b {
  font-family: var(--px-cn);
  color: var(--px-ink);
}

.game-work em {
  color: #5d5544;
  font-family: var(--px-cn);
}

.game-work-link,
.game-next,
.game-replay,
.game-back {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
}

.game-work-link:hover,
.game-next:hover,
.game-replay:hover,
.game-back:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.game-summary-kicker,
.game-summary-score,
.game-summary-text,
.game-foot {
  color: #4d4738;
  font-family: var(--px-cn);
}

.game-summary-score {
  color: var(--px-red);
  font-family: var(--px-en);
}

/* Main lightbox becomes an image-viewer window. */
.lightbox-sheet {
  background: var(--px-face);
  color: var(--px-ink);
}

.lightbox-top {
  border-bottom: 2px solid var(--px-ink);
  background: linear-gradient(90deg, var(--px-navy), var(--px-navy-hi));
  color: var(--px-face-hi);
}

.lightbox-kicker,
.lightbox-top span {
  color: var(--px-face-hi);
  font-family: var(--px-en);
  font-size: 5px;
}

.lightbox-close {
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
}

.lightbox-bottom,
.lightbox-foot {
  border-color: var(--px-face-lo);
  background: var(--px-face);
  color: var(--px-ink);
}

.lightbox-caption h3 {
  color: var(--px-ink);
  font-family: var(--px-cn);
}

.lightbox-caption p,
.lightbox-foot {
  color: #5d5544;
  font-family: var(--px-cn);
}

.lightbox-foot a {
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: 5px;
}

.lightbox-controls button {
  border: 1px solid var(--px-face-lo);
  background: var(--px-face-hi);
  color: var(--px-ink);
  font-family: var(--px-cn);
}

/* --------------------------------------------------------------------------
   Taskbar
   -------------------------------------------------------------------------- */

.px-taskbar {
  position: fixed;
  z-index: 1100;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 3px 5px calc(3px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 0 -2px 0 var(--px-face-lo);
  font-family: var(--px-cn);
  font-size: 10px;
}

.px-start {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 8px;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  text-decoration: none;
  line-height: 1;
}

.px-start:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.px-start-flag {
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: 9px;
}

.px-start b {
  font-family: var(--px-cn);
  font-size: 11px;
  font-weight: 400;
}

.px-start em {
  color: #6b6250;
  font-family: var(--px-en);
  font-size: 5px;
  font-style: normal;
}

.px-tasklist {
  display: flex;
  flex: 1;
  gap: 3px;
  min-width: 0;
  margin-left: 5px;
}

.px-task {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 160px;
  height: 28px;
  padding: 0 6px;
  overflow: hidden;
  border: 2px solid;
  border-color: var(--px-face-lo) var(--px-face-hi) var(--px-face-hi) var(--px-face-lo);
  background: var(--px-face);
  color: #4f493b;
  font-family: var(--px-cn);
  font-size: 9px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.px-task.is-active {
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: #c2b9a1;
  color: var(--px-ink);
}

.px-task:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.px-task span {
  color: #6f6755;
  font-family: var(--px-en);
  font-size: 6px;
}

.px-task.is-active span {
  color: var(--px-red);
}

.px-tray {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 7px;
  border: 2px solid;
  border-color: var(--px-face-lo) var(--px-face-hi) var(--px-face-hi) var(--px-face-lo);
  background: #c8bfa8;
  font-family: var(--px-en);
  font-size: 6px;
  line-height: 1;
}

.px-tray-net {
  color: #305f52;
  font-size: 5px;
  letter-spacing: -1px;
}

body.is-loading .px-taskbar {
  display: none;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.px-frame > .site-footer {
  padding: 18px clamp(20px, 4vw, 46px);
}

.site-footer {
  color: var(--muted);
}

.footer-left p,
.footer-right,
.footer-links a,
.footer-bottom {
  font-family: var(--px-cn);
  font-size: 11px;
}

.footer-kicker,
.footer-bottom,
.footer-links {
  font-family: var(--px-en);
  font-size: 5px;
}

/* --------------------------------------------------------------------------
   Pixel cursor / touch fallbacks
   -------------------------------------------------------------------------- */

@media (hover: hover) and (pointer: fine) {
  .cursor,
  .cursor-tag,
  .chapter-cursor {
    display: none !important;
    opacity: 0 !important;
  }

  html,
  body {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='20' shape-rendering='crispEdges'%3E%3Cpath d='M1 1h3v2h2v2h2v2h2v2h2v2H7v2H5v2H3v2H1z' fill='%23f7f0dc' stroke='%2317150f' stroke-width='1'/%3E%3C/svg%3E") 1 1, auto;
  }

  a,
  button,
  [role="button"] {
    cursor: pointer;
  }
}

@media (prefers-reduced-motion: reduce) {
  .px-frame,
  .resume-modal.is-open .resume-sheet {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive old-computer mode
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .site-nav {
    display: none;
  }

  .site-header,
  .work-header {
    height: 40px;
    padding: 0 8px;
  }

  body {
    padding-top: 46px;
  }

  .header-side .header-time,
  .header-side .header-loc {
    display: none;
  }

  .header-side .chapter-reader-trigger {
    display: none;
  }

  .px-frame {
    width: calc(100% - 12px);
    margin: 6px auto 9px;
    box-shadow: 3px 3px 0 var(--px-shadow);
  }

  .px-titlebar {
    height: 21px;
    font-size: 9px;
  }

  .px-windowbar {
    min-height: 15px;
    font-size: 4.5px;
  }

  .px-frame .hero {
    min-height: auto;
    padding: 12px 14px 16px;
  }

  .hero h1 {
    font-size: 48px;
    line-height: 1.18;
    text-shadow: 3px 3px 0 #6f211a;
  }

  .hero-intro-row {
    padding-top: 14px;
  }

  .hero-desc {
    font-size: 12px;
  }

  .index-section,
  .about-section,
  .contact-section,
  .site-footer,
  .chapter-section,
  .px-frame .chapter-hero {
    padding: 22px 14px;
  }

  .index-head h2,
  .about-head h2 {
    font-size: clamp(32px, 9vw, 46px);
    text-shadow: 2px 2px 0 #4a1812;
  }

  .catalogue-card {
    aspect-ratio: 16 / 10;
  }

  .catalogue-face--front::after {
    height: 14px;
    font-size: 4.5px;
  }

  .chapter-title-wrap h1 {
    font-size: clamp(42px, 12vw, 60px);
    text-shadow: 3px 3px 0 #4a1812;
  }

  .chapter-num {
    font-size: 28px;
  }

  .chapter-works {
    gap: 12px;
  }

  .chapter-work figcaption {
    padding: 6px;
  }

  .work-title b {
    font-size: 15px;
  }

  .work-title em {
    font-size: 9px;
  }

  .site-experience-body strong {
    font-size: 21px;
  }

  .chapter-site-grid {
    gap: 8px;
  }

  .chapter-pager {
    width: calc(100% - 12px);
    margin-bottom: 9px;
  }

  .chapter-pager-link {
    padding: 10px 8px;
    box-shadow: 3px 3px 0 var(--px-shadow);
  }

  .chapter-pager strong {
    font-size: 16px;
  }

  .px-taskbar {
    height: 38px;
    font-size: 9px;
  }

  .px-tasklist {
    gap: 2px;
  }

  .px-task {
    max-width: 82px;
    height: 27px;
    font-size: 8px;
    padding: 0 4px;
  }

  .px-task:nth-child(n+3) {
    display: none;
  }

  .px-task span {
    display: none;
  }

  .px-start {
    height: 27px;
    padding: 0 6px;
  }

  .px-start em {
    display: none;
  }

  .px-tray {
    height: 27px;
    font-size: 5px;
    padding: 0 5px;
  }

  body {
    padding-bottom: 44px;
  }

  .resume-sheet {
    padding-top: 40px;
  }
}

@media (max-width: 600px) {
  .loader {
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .loader-top {
    font-size: 4.5px;
  }

  .loader-bg {
    min-height: 0;
  }

  .loader-status {
    font-size: 20px;
  }

  .loader-enter {
    max-width: none;
    box-shadow: 3px 3px 0 #000;
  }

  .loader-count {
    font-size: 34px;
  }

  .hero-kicker {
    font-size: 5px;
  }

  .hero-topline {
    font-size: 5px;
  }

  .hero-portfolio-note {
    font-size: 12px !important;
  }

  .hero-board-head,
  .hero-board-foot {
    font-size: 4.5px;
  }

  .hero-cell-name {
    font-size: 14px;
  }

  .hero-gallery figcaption {
    font-size: 4.5px;
  }

  .px-titlebar {
    font-size: 8px;
  }

  .px-controls b {
    width: 15px;
    height: 14px;
    font-size: 5px;
  }

  .contact-head h2,
  .contact-copy h2 {
    font-size: 38px;
    line-height: 1.16;
  }

  .contact-section {
    background: #7d201a;
  }

  .menu-links a {
    font-size: 31px;
  }

  .resume-wax {
    top: 70px;
    right: 12px;
  }
}

/* Dialogs own the whole screen while open. */
body:has(.resume-modal.is-open) .site-header,
body:has(.resume-modal.is-open) .work-header,
body:has(.resume-modal.is-open) .px-taskbar,
body:has(.fragment-game.is-open) .site-header,
body:has(.fragment-game.is-open) .work-header,
body:has(.fragment-game.is-open) .px-taskbar,
body:has(.chapter-reader.is-open) .site-header,
body:has(.chapter-reader.is-open) .work-header,
body:has(.chapter-reader.is-open) .px-taskbar,
body:has(.lightbox.is-open) .site-header,
body:has(.lightbox.is-open) .work-header,
body:has(.lightbox.is-open) .px-taskbar,
body.lightbox-open .work-header,
body.lightbox-open .px-taskbar {
  display: none !important;
}

/* BGM toggle in the system tray. */
.px-sound {
  display: grid;
  place-items: center;
  width: 24px;
  height: 22px;
  padding: 0;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.px-sound:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.px-sound.is-muted {
  color: #837a66;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.px-sound.is-waiting {
  color: var(--px-red);
  animation: pxSoundPulse 1.15s steps(2, end) infinite;
}

@keyframes pxSoundPulse {
  50% {
    background: var(--px-face-hi);
    color: var(--px-red);
  }
}

@media (max-width: 900px) {
  .px-tray-net {
    display: none;
  }

  .px-sound {
    width: 23px;
    height: 23px;
    font-size: 11px;
  }
}

/* The opening screen now shows the original portfolio cover inside a CRT. */
.loader-bg {
  inset: 0;
  display: grid;
  place-items: center;
  padding: 50px 0 180px;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.loader-bg::after {
  display: none;
}

.loader-bg img {
  position: relative;
  z-index: 1;
  display: block !important;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  transform: none;
  filter: saturate(.96) contrast(1.02);
}

.loader-fallback {
  display: none !important;
}

.loader-monitor {
  width: min(980px, 78vw, calc((100svh - 300px) * 1.721));
  padding: 8px 10px 7px;
  border: 3px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  box-shadow: 8px 8px 0 var(--px-shadow), inset 0 0 0 2px #b8af97;
}

.loader-monitor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 19px;
  padding: 0 6px;
  border: 1px solid var(--px-ink);
  background: linear-gradient(90deg, var(--px-navy), var(--px-navy-hi));
  color: var(--px-face-hi);
  font-family: var(--px-en);
  font-size: 5px;
  line-height: 1;
}

.loader-screen {
  position: relative;
  aspect-ratio: 2000 / 1162;
  margin: 5px 0 6px;
  overflow: hidden;
  border: 4px solid #16140f;
  background: #030303;
  box-shadow: inset 0 0 0 2px #050505, inset 0 0 34px rgba(207, 75, 50, .08);
}

.loader-screen::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, .18) 0,
    rgba(0, 0, 0, .18) 1px,
    transparent 1px,
    transparent 3px
  );
}

.loader-screen-nosignal {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  place-items: center;
  color: #6f8f83;
  font-family: var(--px-en);
  font-size: 8px;
  letter-spacing: .12em;
}

.loader-monitor-chin {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 3px;
  color: #4f493a;
  font-family: var(--px-en);
  font-size: 4.5px;
  line-height: 1;
}

.loader-monitor-led {
  width: 6px;
  height: 6px;
  background: var(--px-red);
  box-shadow: 0 0 0 1px #6f211a, 0 0 5px rgba(211, 75, 53, .5);
}

.loader-monitor-vents {
  flex: 1;
  height: 6px;
  margin: 0 4px;
  background: repeating-linear-gradient(
    to bottom,
    #9f9680 0,
    #9f9680 1px,
    transparent 1px,
    transparent 3px
  );
}

@media (max-width: 600px) {
  .loader-bg {
    position: relative;
    inset: auto;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: visible;
    transform: none;
  }

  .loader-monitor {
    width: 100%;
    max-width: 342px;
    padding: 5px 6px 4px;
    box-shadow: 4px 4px 0 var(--px-shadow), inset 0 0 0 1px #b8af97;
  }

  .loader-monitor-bar {
    height: 15px;
    padding: 0 4px;
    font-size: 3.8px;
  }

  .loader-screen {
    margin: 3px 0 4px;
    border-width: 3px;
  }

  .loader-screen-nosignal {
    font-size: 6px;
  }

  .loader-monitor-chin {
    height: 16px;
    font-size: 3.5px;
  }

  .loader-monitor-led {
    width: 5px;
    height: 5px;
  }

  .loader-monitor-vents {
    height: 4px;
  }
}

.loader-screen picture {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
}

.loader-bg img {
  object-fit: cover;
  animation: none !important;
  filter: brightness(1.1) saturate(.98) contrast(1.03);
}

.loader-screen::after {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, .14) 0,
    rgba(0, 0, 0, .14) 1px,
    transparent 1px,
    transparent 3px
  );
}

@media (max-width: 600px) {
  .loader-screen {
    aspect-ratio: 1170 / 1162;
  }

  .loader-monitor {
    max-width: 354px;
  }
}

@media (min-width: 601px) {
  .loader-monitor {
    width: min(980px, 78vw);
    max-width: calc((100svh - 300px) * 1.721);
  }
}

@media (hover: hover) {
  .catalogue-face--front::after {
    content: "C:\\KAIYU\\WORKS  ·  HOVER ↻";
  }
}

@media (hover: none) {
  .catalogue-face--front::after {
    content: "C:\\KAIYU\\WORKS  ·  TAP ↻";
  }
}

/* --------------------------------------------------------------------------
   CHAPTER PEEK — a small slice and contents list from a hero folder
   -------------------------------------------------------------------------- */

body.peek-open {
  overflow: hidden;
}

body.peek-open .site-header,
body.peek-open .work-header,
body.peek-open .px-taskbar {
  display: none !important;
}

.chapter-peek {
  position: fixed;
  z-index: 2200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vw, 34px);
}

.chapter-peek[hidden] {
  display: none;
}

.peek-scrim {
  position: absolute;
  inset: 0;
  background-color: rgba(3, 36, 33, .92);
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, .18) 0 1px,
    transparent 1px 4px
  );
}

.peek-sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1000px, 94vw);
  max-height: 90svh;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 8px 8px 0 #021817;
  transform: translateY(10px) scale(.985);
  opacity: 0;
}

.chapter-peek.is-open .peek-sheet {
  animation: peekSheetIn .2s steps(4, end) both;
}

@keyframes peekSheetIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.peek-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 25px;
  padding: 3px 4px 3px 8px;
  background: linear-gradient(90deg, var(--px-navy), var(--px-navy-hi));
  color: var(--px-face-hi);
  font-family: var(--px-en);
  font-size: 5px;
  line-height: 1.3;
}

.peek-close {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border: 1px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 9px;
  line-height: 1;
}

.peek-close span {
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border: 1px solid var(--px-ink);
  font-family: var(--px-en);
  font-size: 6px;
}

.peek-close:hover {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.peek-scroll {
  overflow: auto;
  padding: 16px 18px 18px;
}

.peek-head {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--px-face-lo);
}

.peek-index {
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: 58px;
  line-height: .9;
  text-shadow: 3px 3px 0 rgba(76, 18, 14, .18);
}

.peek-kicker {
  margin: 0 0 5px;
  color: #615948;
  font-family: var(--px-en);
  font-size: 5px;
  line-height: 1.7;
  text-transform: uppercase;
}

.peek-heading h2 {
  margin: 0;
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.peek-desc {
  max-width: 70ch;
  margin: 8px 0 0;
  color: #443e32;
  font-family: var(--px-cn);
  font-size: 12px;
  line-height: 1.85;
}

.peek-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.peek-tags li {
  padding: 2px 4px;
  border: 1px solid #8d846d;
  background: var(--px-face-hi);
  color: #4e4738;
  font-family: var(--px-en);
  font-size: 4.5px;
  line-height: 1.3;
}

.peek-slices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 13px 0;
}

.peek-slice {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 2px solid;
  border-color: var(--px-face-lo) var(--px-face-hi) var(--px-face-hi) var(--px-face-lo);
  background: #080706;
}

.peek-slice img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  image-rendering: pixelated;
}

.peek-slice--1 img { object-position: 16% 50%; }
.peek-slice--2 img { object-position: 50% 50%; }
.peek-slice--3 img { object-position: 82% 50%; }

.peek-slice figcaption {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 3px 5px;
  border-top: 1px solid var(--px-face-lo);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 9px;
  line-height: 1.3;
}

.peek-slice figcaption span {
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: 5px;
}

.peek-slice figcaption b {
  overflow: hidden;
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.peek-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 12px;
  align-items: stretch;
}

.peek-toc-wrap {
  min-width: 0;
  border: 2px solid;
  border-color: var(--px-face-lo) var(--px-face-hi) var(--px-face-hi) var(--px-face-lo);
  background: var(--px-face-hi);
}

.peek-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 6px;
  border-bottom: 1px solid var(--px-face-lo);
  color: #5b5343;
  font-family: var(--px-en);
  font-size: 4.5px;
  line-height: 1.4;
}

.peek-toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
  max-height: 208px;
  margin: 0;
  padding: 5px 7px 7px;
  overflow: auto;
  list-style: none;
}

.peek-toc li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-areas:
    "num title"
    "num role";
  column-gap: 4px;
  padding: 5px 0;
  border-bottom: 1px dashed #b8ae95;
}

.peek-toc-num {
  grid-area: num;
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: 6px;
  line-height: 1.5;
}

.peek-toc-title {
  grid-area: title;
  overflow: hidden;
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.peek-toc-role {
  grid-area: role;
  overflow: hidden;
  color: #655d4b;
  font-family: var(--px-cn);
  font-size: 8px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.peek-note {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 2px solid;
  border-color: var(--px-face-lo) var(--px-face-hi) var(--px-face-hi) var(--px-face-lo);
  background: #17140f;
  color: var(--px-face);
}

.peek-note-kicker {
  color: #e9b59c;
  font-family: var(--px-en);
  font-size: 4.5px;
  line-height: 1.6;
}

.peek-note p {
  margin: 8px 0 12px;
  color: #e4d8bf;
  font-family: var(--px-cn);
  font-size: 11px;
  line-height: 1.8;
}

.peek-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 7px 8px;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-red);
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: 11px;
  line-height: 1.2;
  text-decoration: none;
}

.peek-cta:hover {
  background: var(--px-face);
  color: var(--px-ink);
}

.peek-cta span {
  font-family: var(--px-en);
  font-size: 7px;
}

@media (max-width: 760px) {
  .chapter-peek {
    padding: 8px;
  }

  .peek-sheet {
    width: 100%;
    max-height: 94svh;
  }

  .peek-bar {
    min-height: 23px;
    font-size: 4.3px;
  }

  .peek-scroll {
    padding: 11px 12px 13px;
  }

  .peek-head {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 9px;
    padding-bottom: 9px;
  }

  .peek-index {
    font-size: 40px;
  }

  .peek-heading h2 {
    font-size: clamp(30px, 9vw, 42px);
  }

  .peek-desc {
    max-height: 5.4em;
    overflow: hidden;
    font-size: 11px;
  }

  .peek-tags li:nth-child(n+4) {
    display: none;
  }

  .peek-slices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 9px 0;
  }

  .peek-slice:first-child {
    grid-column: 1 / -1;
  }

  .peek-slice img {
    aspect-ratio: 16 / 6;
  }

  .peek-slice:first-child img {
    aspect-ratio: 16 / 7;
  }

  .peek-lower {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .peek-toc {
    grid-template-columns: 1fr;
    max-height: 146px;
  }

  .peek-note {
    padding: 9px;
  }

  .peek-note p {
    margin: 6px 0 9px;
    font-size: 10px;
  }
}

.peek-bar-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.peek-bar-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
}

.peek-jump {
  padding: 3px 5px;
  border: 1px solid var(--px-face-hi);
  background: var(--px-red);
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: 8px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.peek-jump:hover {
  background: var(--px-face);
  color: var(--px-ink);
}

@media (max-width: 760px) {
  .peek-jump {
    padding: 3px 4px;
    font-size: 7px;
  }
}

.peek-scroll {
  flex: 1;
  min-height: 0;
}

.peek-slice img {
  image-rendering: auto;
}

.honor-note--wide {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  width: min(100%, 960px);
  margin: 28px auto 0;
  padding: 15px 18px;
  transform: none;
}

.honor-note--wide .note-kicker {
  margin: 0;
}

.honor-note--wide p:last-child {
  margin: 0;
  font-size: 10px;
  line-height: 1.8;
}

@media (max-width: 760px) {
  .honor-note--wide {
    grid-template-columns: 1fr;
    gap: 5px;
    width: 100%;
    padding: 13px 14px;
  }
}

.honor-note--wide .note-kicker {
  color: #514a3b;
}

.honor-note--wide p:last-child {
  color: #302c23;
  font-size: 10.5px;
}

/* Keep the CV seal clear of the title. */
.resume-title {
  max-width: calc(100% - 68px);
  font-size: clamp(26px, 2.3vw, 35px);
  line-height: 1.1;
}

@media (min-width: 601px) {
  .resume-wax {
    top: 54%;
    right: 16px;
    left: auto;
    width: 44px;
    height: 44px;
    font-size: 21px;
    transform: rotate(-8deg);
  }
}

.resume-card:hover .resume-wax {
  transform: rotate(-2deg) scale(1.06);
}

.resume-card.is-opening .resume-wax {
  transform: rotate(25deg) scale(.6);
}

/* Hover-erased artist portrait: paper and ink hide a real photo underneath. */
.about-face--front .about-photo {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: cover;
  object-position: 72% 38%;
  opacity: 0;
  filter: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  image-rendering: auto !important;
}

.about-scratch {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.about-face--front .about-ink {
  position: relative;
  z-index: 2;
}

.about-face-caption {
  position: relative;
  z-index: 3;
}

.about-card.is-scratch-ready .about-photo {
  opacity: 1;
}

.about-card.is-scratch-ready .about-scratch {
  display: block;
  opacity: 1;
}

.about-card.is-scratch-ready .about-ink {
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .about-card.is-scratch-ready .about-face--front {
    cursor: crosshair;
  }
}

.honor-note--wide {
  grid-template-columns: 190px minmax(0, 1fr);
  opacity: 1;
}

.honor-note--wide .note-kicker {
  color: #3c362a !important;
  font-size: 6px;
  line-height: 1.7;
  letter-spacing: .04em;
}

.honor-note--wide p:last-child {
  color: #17140e !important;
  font-family: var(--px-cn);
  font-size: 12px;
  line-height: 1.85;
}

@media (max-width: 760px) {
  .honor-note--wide {
    grid-template-columns: 1fr;
  }

  .honor-note--wide p:last-child {
    font-size: 11px;
  }
}

.honor-note--wide p:last-child {
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   Desktop mascot — waving from the teal gutter beside EXPLORER.EXE
   -------------------------------------------------------------------------- */

.desktop-mascot {
  position: fixed;
  z-index: 900;
  top: clamp(58px, 7vh, 78px);
  left: max(10px, calc((100vw - 1500px) / 2 - 190px));
  width: min(170px, calc((100vw - 1500px) / 2 - 20px));
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .3s steps(4, end), transform .3s steps(4, end);
}

.desktop-mascot.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.mascot-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  padding: 5px 4px 4px;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  box-shadow: 3px 3px 0 var(--px-shadow);
  text-align: center;
  animation: mascotBubble 2.4s steps(2, end) infinite;
}

.mascot-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 48%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--px-face-lo);
  border-bottom: 2px solid var(--px-face-lo);
  background: var(--px-face);
  transform: rotate(45deg);
}

.mascot-bubble b {
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 8px;
  font-weight: 400;
  line-height: 1;
}

.mascot-bubble i {
  color: var(--px-red);
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.mascot-art {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, .25));
}

.mascot-arm {
  transform-box: fill-box;
  transform-origin: 18% 90%;
  animation: mascotWave 1.7s steps(4, end) infinite;
}

.mascot-head {
  transform-box: fill-box;
  transform-origin: 50% 92%;
  animation: mascotNod 3.2s steps(3, end) infinite;
}

.mascot-eyes {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: mascotBlink 4.6s steps(1, end) infinite;
}

.mascot-tail {
  transform-box: fill-box;
  transform-origin: 10% 90%;
  animation: mascotTail 2.4s steps(3, end) infinite;
}

@keyframes mascotWave {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(12deg); }
}

@keyframes mascotNod {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1.5px); }
}

@keyframes mascotBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  94%, 96% { transform: scaleY(.08); }
}

@keyframes mascotTail {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(16deg); }
}

@keyframes mascotBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@media (max-width: 1740px) {
  .desktop-mascot {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-bubble,
  .mascot-arm,
  .mascot-head,
  .mascot-eyes,
  .mascot-tail {
    animation: none;
  }
}

/* The chapter card rests face-up; the work cover is revealed on hover. */
@media (hover: hover) {
  .catalogue-face--back::before {
    content: "C:\\KAIYU\\CHAPTER  ·  HOVER FOR COVER";
  }

  .catalogue-face--front::after {
    content: "C:\\KAIYU\\WORKS  ·  COVER";
  }
}

@media (hover: none) {
  .catalogue-face--back::before {
    content: "C:\\KAIYU\\CHAPTER  ·  TAP ↻ FOR COVER";
  }

  .catalogue-face--front::after {
    content: "C:\\KAIYU\\WORKS  ·  COVER";
  }
}

.catalogue-face--front::after {
  display: none !important;
}

.catalogue-front-bar {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  height: 15px;
  padding: 4px 5px 0;
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 5px;
  line-height: 1;
  pointer-events: none;
}

@media (max-width: 900px) {
  .catalogue-front-bar {
    height: 14px;
    font-size: 4.5px;
  }
}

/* Curated peek crops already choose the detail; keep their centre. */
.peek-slice--1 img,
.peek-slice--2 img,
.peek-slice--3 img {
  object-position: center;
}

.peek-slice img {
  height: auto;
}

@media (min-width: 761px) {
  .peek-slice img {
    aspect-ratio: 1 / 1;
  }
}

/* Align the honours strip with both about columns. */
.honor-note--wide {
  width: 100%;
  max-width: none;
  margin: 28px 0 0;
  grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr);
  gap: clamp(36px, 8vw, 130px);
}

@media (max-width: 760px) {
  .honor-note--wide {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* Desktop: the CV card shares the portrait's edges and sits on the column baseline. */
@media (min-width: 761px) {
  .about-grid {
    align-items: stretch;
  }

  .about-left {
    display: flex;
    flex-direction: column;
  }

  .resume-card {
    width: 100%;
    min-height: 262px;
    margin: auto 0 0;
  }
}

/* Two idle pixel familiars in the loader side gutters. */
.loader-familiars {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.loader-monitor {
  position: relative;
  z-index: 2;
}

.loader-familiar {
  position: absolute;
  width: clamp(36px, 10vw, 180px);
  margin: 0;
  opacity: .96;
}

.loader-familiar--demon {
  top: 42%;
  left: calc((100vw - min(980px, 78vw)) / 4);
  transform: translateX(-50%);
}

.loader-familiar--angel {
  top: 33%;
  right: calc((100vw - min(980px, 78vw)) / 4);
  transform: translateX(50%);
}

.loader-familiar-body {
  position: relative;
  animation: familiarBob 3.6s steps(2, end) infinite;
  filter: drop-shadow(4px 4px 0 rgba(0, 20, 18, .18));
}

.loader-familiar--angel .loader-familiar-body {
  animation-duration: 4.2s;
  animation-delay: -1.1s;
}

.loader-familiar svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.loader-familiar figcaption {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  color: #ece0c4;
  font-family: var(--px-en);
  font-size: 6px;
  line-height: 1.4;
  text-align: center;
  text-shadow: 1px 1px 0 #062f2a;
  letter-spacing: .04em;
}

.loader-familiar figcaption span {
  color: #b9c8b7;
  font-family: var(--px-cn);
  font-size: 7px;
  letter-spacing: 0;
}

.familiar-wing {
  transform-box: fill-box;
  animation: familiarWingL 1.8s steps(2, end) infinite;
}

.familiar-wing--l {
  transform-origin: right center;
}

.familiar-wing--r {
  transform-origin: left center;
  animation-name: familiarWingR;
}

.loader-familiar--angel .familiar-wing {
  animation-duration: 2.6s;
}

.familiar-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: familiarBlink 5.4s steps(1, end) infinite;
}

.familiar-halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: familiarHalo 3.2s steps(2, end) infinite;
}

.familiar-spark {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #ecd18c;
  box-shadow: 0 0 0 1px rgba(5, 30, 26, .18);
  animation: familiarSpark 2.8s steps(2, end) infinite;
}

.loader-familiar--demon .familiar-spark {
  background: #e7a46a;
}

.familiar-spark--1 {
  top: 24%;
  left: 6%;
}

.familiar-spark--2 {
  top: 47%;
  right: 3%;
  width: 2px;
  height: 2px;
  animation-delay: -1s;
}

.familiar-spark--3 {
  top: 2%;
  left: 54%;
  animation-delay: -1.9s;
}

@keyframes familiarBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@keyframes familiarWingL {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-11deg); }
}

@keyframes familiarWingR {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(11deg); }
}

@keyframes familiarBlink {
  0%, 91%, 100% { transform: scaleY(1); }
  93%, 96% { transform: scaleY(.12); }
}

@keyframes familiarHalo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes familiarSpark {
  0%, 100% { opacity: 0; transform: translateY(4px); }
  35% { opacity: 1; transform: translateY(0); }
  65% { opacity: 0; transform: translateY(-7px); }
}

@media (max-width: 900px) {
  .loader-familiar figcaption {
    display: none;
  }
}

@media (max-width: 760px) {
  .loader-familiar {
    width: clamp(32px, 9.5vw, 70px);
  }

  .loader-familiar--demon {
    top: 40%;
  }

  .loader-familiar--angel {
    top: 33%;
  }

  .loader-familiar-body {
    filter: drop-shadow(2px 2px 0 rgba(0, 20, 18, .16));
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-familiar-body,
  .familiar-wing,
  .familiar-eyes,
  .familiar-halo,
  .familiar-spark {
    animation: none;
  }
}

/* On narrower screens the familiars move below the monitor, where the gutter opens up. */
@media (max-width: 900px) {
  .loader-familiar {
    top: auto;
    width: clamp(64px, 14vw, 120px);
  }

  .loader-familiar--demon {
    left: 5vw;
    bottom: 17%;
    transform: none;
  }

  .loader-familiar--angel {
    right: 5vw;
    bottom: 25%;
    transform: none;
  }

  .loader-familiar figcaption {
    display: none;
  }
}

.familiar-shadow {
  transform-box: fill-box;
  transform-origin: center;
  animation: familiarShadow 3.6s steps(2, end) infinite;
}

.loader-familiar--angel .familiar-shadow {
  animation-duration: 4.2s;
  animation-delay: -1.1s;
}

@keyframes familiarShadow {
  0%, 100% { opacity: .8; transform: scaleX(1); }
  50% { opacity: .42; transform: scaleX(.82); }
}

@media (prefers-reduced-motion: reduce) {
  .familiar-shadow {
    animation: none;
  }
}

@media (max-width: 900px) {
  .loader-familiars {
    position: fixed;
  }
}

@media (max-width: 900px) {
  .loader-bg {
    transform: none;
  }

  .loader-familiars {
    position: fixed;
  }
}

@media (max-width: 600px) {
  .loader-familiar--demon {
    bottom: 26%;
  }

  .loader-familiar--angel {
    bottom: 24%;
  }
}

.loader-familiar figcaption {
  font-size: 7px;
}

.loader-familiar figcaption span {
  font-size: 8px;
}

.loader-motes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.loader-mote {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #d7c18b;
  opacity: .36;
  box-shadow: 0 0 0 1px rgba(4, 28, 24, .16);
  animation: familiarMote 4.6s steps(3, end) infinite;
}

.loader-mote:nth-child(even) {
  width: 3px;
  height: 3px;
  background: #c7785d;
  animation-duration: 5.4s;
  animation-delay: -1.4s;
}

.loader-mote--1 { top: 18%; left: 4vw; }
.loader-mote--2 { top: 33%; left: 9vw; animation-delay: -2.1s; }
.loader-mote--3 { top: 67%; left: 5vw; animation-delay: -.7s; }
.loader-mote--4 { top: 79%; left: 11vw; animation-delay: -3s; }
.loader-mote--5 { top: 22%; right: 4vw; animation-delay: -1.8s; }
.loader-mote--6 { top: 37%; right: 8vw; animation-delay: -.4s; }
.loader-mote--7 { top: 61%; right: 5vw; animation-delay: -2.7s; }
.loader-mote--8 { top: 76%; right: 11vw; animation-delay: -3.6s; }

@keyframes familiarMote {
  0%, 100% { opacity: .16; transform: translateY(0); }
  45% { opacity: .75; transform: translateY(-12px); }
  70% { opacity: .28; transform: translateY(-18px); }
}

@media (min-width: 1600px) {
  .loader-familiar {
    width: 220px;
  }
}

@media (max-width: 900px) {
  .loader-motes {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-mote {
    animation: none;
  }
}

/* Upper-body KAIYU sits in the bottom-left corner, cut by the taskbar. */
.desktop-mascot {
  top: auto;
  bottom: 0;
  left: clamp(8px, 1.5vw, 24px);
  width: clamp(146px, 11vw, 186px);
  transform: translateY(16px);
}

.desktop-mascot.is-visible {
  transform: translateY(0);
}

.desktop-mascot .mascot-art {
  margin-top: 6px;
}

.mascot-arm,
.mascot-head,
.mascot-eyes {
  animation: none;
}

.mascot-hand {
  transform-box: fill-box;
  transform-origin: 50% 86%;
  animation: mascotPalm 1.5s steps(3, end) infinite;
}

@keyframes mascotPalm {
  0%, 100% { transform: rotate(-9deg); }
  50% { transform: rotate(12deg); }
}

@media (min-width: 1100px) {
  .desktop-mascot {
    display: block;
  }
}

@media (max-width: 1099px) {
  .desktop-mascot {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-hand,
  .mascot-hand-art {
    animation: none;
  }
}

/* Chapter preview: one full-bleed section homepage instead of detail crops. */
.peek-home {
  margin: 14px 0;
  padding: 3px;
  border: 2px solid;
  border-color: var(--px-ink) var(--px-face-lo) var(--px-face-lo) var(--px-ink);
  background: var(--px-face-hi);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .32);
}

.peek-home picture {
  display: block;
  border: 1px solid var(--px-ink);
  background: #0e0b0a;
  overflow: hidden;
}

.peek-home img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: auto;
}

.peek-home figcaption {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  padding: 6px 6px 3px;
  color: var(--px-ink);
  font-family: var(--px-en);
  font-size: 5px;
  line-height: 1.3;
}

.peek-home figcaption span {
  color: var(--px-red);
  white-space: nowrap;
}

.peek-home figcaption b {
  font-family: var(--px-cn);
  font-size: 12px;
  font-weight: 400;
}

.peek-home figcaption em {
  color: #6f6758;
  font-family: var(--px-cn);
  font-size: 9px;
  font-style: normal;
  text-align: right;
}

@media (max-width: 600px) {
  .peek-home {
    margin: 9px 0;
  }

  .peek-home figcaption {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .peek-home figcaption em {
    grid-column: 1 / -1;
    text-align: left;
  }
}

@media (min-width: 761px) {
  .resume-card {
    min-height: 228px;
  }
}

/* Small front/back switch under the portrait. */
.about-flip-hint {
  align-items: center;
}

.about-flip-hint .about-flip-copy {
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 8px;
  letter-spacing: 0;
}

.about-face-toggle {
  flex: 0 0 auto;
  min-height: 20px;
  margin-left: auto;
  padding: 3px 6px 2px;
  border: 1px solid var(--px-ink);
  border-radius: 0;
  background: var(--px-face-hi);
  color: var(--px-ink);
  box-shadow: 1px 1px 0 var(--px-shadow);
  font-family: var(--px-cn);
  font-size: 8px;
  line-height: 1;
  cursor: pointer;
}

.about-face-toggle:hover,
.about-face-toggle:focus-visible {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.about-face-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

/* Ambient motion: a live cursor, idle scan sweeps, and a preview that breathes. */
.hero-statement h1::after {
  content: "";
  display: inline-block;
  width: .13em;
  height: .68em;
  margin-left: .08em;
  background: var(--px-red);
  vertical-align: -.02em;
  animation: heroCursor 1.15s steps(1, end) infinite;
}

@keyframes heroCursor {
  0%, 48% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero-kicker i {
  animation: heroDot 2.6s steps(2, end) infinite;
}

@keyframes heroDot {
  0%, 100% { box-shadow: 2px 0 0 var(--px-red), 0 2px 0 var(--px-red); }
  50% { box-shadow: 2px 0 0 var(--px-red), 0 2px 0 var(--px-red), 0 0 0 3px rgba(211, 75, 53, .16); }
}

.catalogue-card::after {
  content: "";
  position: absolute;
  z-index: 6;
  top: 15px;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(211, 75, 53, .5), transparent);
  opacity: 0;
  pointer-events: none;
  animation: catalogueIdle 9.5s steps(18, end) infinite;
}

.catalogue-item:nth-child(2) .catalogue-card::after { animation-delay: 1.35s; }
.catalogue-item:nth-child(3) .catalogue-card::after { animation-delay: 2.7s; }
.catalogue-item:nth-child(4) .catalogue-card::after { animation-delay: 4.05s; }
.catalogue-item:nth-child(5) .catalogue-card::after { animation-delay: 5.4s; }
.catalogue-item:nth-child(6) .catalogue-card::after { animation-delay: 6.75s; }

.catalogue-card:hover::after,
.catalogue-card:focus-visible::after,
.catalogue-item.is-flipped .catalogue-card::after {
  opacity: 0;
  animation-play-state: paused;
}

@keyframes catalogueIdle {
  0%, 76% { top: 15px; opacity: 0; }
  78% { opacity: .55; }
  90% { top: calc(100% - 2px); opacity: 0; }
  100% { top: calc(100% - 2px); opacity: 0; }
}

.catalogue-face--back::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 6px;
  width: 4px;
  height: 4px;
  background: var(--px-red);
  animation: pxBlink 1.7s steps(1, end) infinite;
}

.peek-home {
  animation: peekHomeIn .55s steps(6, end) both;
}

@keyframes peekHomeIn {
  0% { opacity: 0; clip-path: inset(0 0 100% 0); }
  100% { opacity: 1; clip-path: inset(0 0 0 0); }
}

.peek-home picture {
  position: relative;
  isolation: isolate;
}

.peek-home picture::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(3, 12, 10, .16) 0 1px, transparent 1px 3px);
  opacity: .32;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.peek-home picture::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(211, 75, 53, .8), transparent);
  opacity: 0;
  pointer-events: none;
  animation: peekScan 7.5s steps(30, end) infinite;
}

.peek-home img {
  animation: peekHomeDrift 15s ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes peekScan {
  0%, 68% { top: 0; opacity: 0; }
  70% { opacity: .8; }
  86% { top: calc(100% - 2px); opacity: 0; }
  100% { top: calc(100% - 2px); opacity: 0; }
}

@keyframes peekHomeDrift {
  0% { transform: scale(1.025) translate3d(-.35%, 0, 0); }
  100% { transform: scale(1.025) translate3d(.35%, -.35%, 0); }
}

.peek-home figcaption span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 4px;
  background: var(--px-red);
  vertical-align: 0;
  animation: pxBlink 1.5s steps(1, end) infinite;
}

.film-frame {
  position: relative;
}

.film-card .film-frame::after {
  content: "● REC";
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 9px;
  padding: 2px 4px;
  background: rgba(5, 6, 5, .55);
  color: #e7b08c;
  font-family: var(--px-en);
  font-size: 4.5px;
  line-height: 1;
  letter-spacing: .06em;
  pointer-events: none;
  animation: pxBlink 1.9s steps(1, end) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hero-statement h1::after,
  .hero-kicker i,
  .catalogue-card::after,
  .catalogue-face--back::after,
  .peek-home,
  .peek-home img,
  .peek-home picture::after,
  .peek-home figcaption span::before,
  .film-card .film-frame::after {
    animation: none;
  }
}

/* Keep the motion felt, not shouted. */
.hero-statement h1::after {
  content: none;
}

.hero-bottom span:first-child::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 7px;
  margin-left: 4px;
  background: var(--px-red);
  vertical-align: -.08em;
  animation: pxBlink 1.2s steps(1, end) infinite;
}

.peek-home picture::before {
  background: repeating-linear-gradient(to bottom, rgba(3, 12, 10, .08) 0 1px, transparent 1px 3px);
  opacity: .18;
}

.film-card .film-frame::after {
  display: none;
}

.film-label::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 4px;
  background: var(--px-red);
  vertical-align: 0;
  animation: pxBlink 1.7s steps(1, end) infinite;
}

.work-photo {
  position: relative;
  overflow: hidden;
}

.work-photo::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(211, 75, 53, .72), transparent);
  opacity: 0;
  pointer-events: none;
}

@media (hover: hover) {
  .work-card:hover .work-photo::after {
    animation: workScan .7s steps(10, end);
  }
}

@keyframes workScan {
  0% { top: 0; opacity: 0; }
  12% { opacity: .8; }
  100% { top: calc(100% - 2px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bottom span:first-child::after,
  .film-label::before {
    animation: none;
  }

  .work-card:hover .work-photo::after {
    animation: none;
  }
}

@media (max-width: 600px) {
  .loader-enter {
    bottom: auto;
    margin-bottom: 18px;
  }
}

@media (max-width: 600px) {
  .loader-enter {
    margin-top: 8px;
  }
}

@media (max-width: 720px) {
  /* Phones use the hero folders as the only work index. */
  #works.index-section {
    display: none !important;
  }
}

@media (max-width: 720px) {
  .px-frame:has(> #works.index-section) {
    display: none !important;
  }
}

/* The portrait is scratchable with a finger as well as a mouse. */
.about-card.is-scratch-ready .about-face--front,
.about-card.is-scratch-ready .about-scratch {
  touch-action: none;
}

@media (max-width: 600px) {
  /* Keep the capability list compact on phones: two columns, not nine rows. */
  .cap-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
  }

  .cap-list li {
    padding-left: 12px;
    font-size: 11px;
  }

  .cap-list li::before {
    font-size: 8px;
  }
}

/* Awards: keep each prize intact on desktop and give every one its own line on narrow screens. */
.honor-note--wide p:last-child > span {
  white-space: nowrap;
}

.honor-note--wide p:last-child > .honor-sep {
  color: #6b6250;
}

@media (max-width: 760px) {
  .honor-note--wide p:last-child > span {
    display: block;
    white-space: normal;
  }

  .honor-note--wide p:last-child > .honor-sep {
    display: none;
  }
}

/* Awards: keep each prize intact, but allow the line to break between prizes. */
.honor-note--wide p:last-child > span:not(.honor-sep) {
  display: inline-block;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .honor-note--wide p:last-child > span:not(.honor-sep) {
    display: block;
    white-space: normal;
  }
}

.honor-note--wide p:last-child > span:not(:last-child) {
  margin-right: .55em;
}

.honor-note--wide p:last-child > span:not(:last-child)::after {
  content: " /";
  color: #6b6250;
}

@media (max-width: 760px) {
  .honor-note--wide p:last-child > span:not(:last-child) {
    margin-right: 0;
  }

  .honor-note--wide p:last-child > span:not(:last-child)::after {
    content: none;
  }
}

/* Little Mario-style props for the loader familiars. */
.familiar-game {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.loader-familiar svg {
  position: relative;
  z-index: 1;
  transform-origin: 50% 100%;
}

.familiar-coin {
  position: absolute;
  width: 9px;
  height: 13px;
  border: 1px solid #6b4214;
  background: #f6c84a;
  box-shadow: inset 2px 0 0 #fff0a5, 1px 1px 0 rgba(4, 28, 24, .35);
  animation: familiarCoinIdle 2.4s steps(4, end) infinite;
}

.familiar-coin::after {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 3px;
  width: 1px;
  background: #9b6420;
}

.familiar-coin--a {
  top: 28%;
  left: -2%;
}

.familiar-coin--b {
  top: 14%;
  right: 2%;
  animation-delay: -1.1s;
}

.familiar-block {
  position: absolute;
  bottom: -5px;
  width: 18px;
  height: 18px;
  border: 2px solid #2b160b;
  background: #c97a2c;
  box-shadow: inset 0 0 0 2px #eab05c, 2px 2px 0 rgba(4, 28, 24, .28);
}

.familiar-block::before {
  content: "?";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff0b8;
  font-family: var(--px-en);
  font-size: 8px;
  line-height: 1;
  text-shadow: 1px 1px 0 #6b3412;
}

.familiar-block--a {
  left: -3%;
}

.familiar-block--b {
  right: -3%;
}

.familiar-brick {
  position: absolute;
  right: 24%;
  bottom: -4px;
  left: 24%;
  height: 7px;
  border: 1px solid #2b160b;
  background-color: #985329;
  background-image:
    linear-gradient(90deg, transparent 0 8px, #2b160b 8px 9px),
    linear-gradient(0deg, transparent 0 3px, #2b160b 3px 4px);
  background-size: 9px 4px;
  box-shadow: 1px 1px 0 rgba(4, 28, 24, .3);
}

.loader-familiar.is-hopping svg {
  animation: familiarHop .7s steps(8, end);
}

.loader-familiar.is-hopping .familiar-coin {
  animation: familiarCoinPop .78s steps(9, end) both;
}

.loader-familiar.is-hopping .familiar-coin--b {
  animation-delay: .08s;
}

.loader-familiar.is-bumped .familiar-block {
  animation: familiarBlockBump .44s steps(4, end);
}

@keyframes familiarCoinIdle {
  0%, 100% { transform: translateY(0) scaleX(1); }
  50% { transform: translateY(-7px) scaleX(.55); }
}

@keyframes familiarCoinPop {
  0% { transform: translateY(0) scaleX(1); opacity: 0; }
  12% { opacity: 1; }
  38% { transform: translateY(-28px) scaleX(1); opacity: 1; }
  55% { transform: translateY(-34px) scaleX(.2); opacity: 1; }
  72% { transform: translateY(-28px) scaleX(1); opacity: 1; }
  100% { transform: translateY(-6px) scaleX(1); opacity: 0; }
}

@keyframes familiarBlockBump {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes familiarHop {
  0%, 100% { transform: translateY(0) scaleY(1); }
  14% { transform: translateY(3px) scaleY(.92); }
  38% { transform: translateY(-22px) scaleY(1.04); }
  58% { transform: translateY(-27px) scaleY(1); }
  80% { transform: translateY(0) scaleY(.94); }
  90% { transform: translateY(-3px) scaleY(1); }
}

@media (max-width: 760px) {
  .familiar-game {
    display: none;
  }

  .loader-familiar.is-hopping svg {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .familiar-game {
    display: none;
  }

  .loader-familiar.is-hopping svg,
  .loader-familiar.is-bumped .familiar-block {
    animation: none;
  }
}

/* Mascot: use the actual portrait, pixelated, instead of a generic pixel face. */
.desktop-mascot .mascot-art {
  display: none;
}

.mascot-portrait {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
}

.mascot-photo {
  display: block;
  width: auto;
  max-width: 100%;
  height: clamp(150px, 11vw, 178px);
  image-rendering: pixelated;
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, .25));
}

.mascot-hand-art {
  position: absolute;
  right: -5%;
  bottom: 12%;
  left: auto;
  width: 33%;
  height: auto;
  image-rendering: pixelated;
  transform-origin: 50% 90%;
  animation: mascotPalm 1.5s steps(3, end) infinite;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .2));
}

@media (prefers-reduced-motion: reduce) {
  .mascot-hand,
  .mascot-hand-art {
    animation: none;
  }
}

/* A fuller Mario-style gutter scene: blocks, coins, a pipe and a walking goomba. */
.familiar-game {
  z-index: auto;
}

.familiar-coin {
  z-index: 4;
  width: 12px;
  height: 16px;
  border-width: 2px;
}

.familiar-coin::after {
  left: 4px;
}

.familiar-coin--a {
  top: 24%;
  left: -14%;
}

.familiar-coin--b {
  top: 11%;
  right: -10%;
}

.familiar-block {
  z-index: 4;
  top: 16%;
  bottom: auto;
  width: 26px;
  height: 26px;
}

.familiar-block::before {
  font-size: 11px;
}

.familiar-block--a {
  left: -12%;
}

.familiar-block--b {
  right: -12%;
}

.familiar-pipe {
  position: absolute;
  z-index: 0;
  bottom: 2px;
  width: 28px;
  height: 38px;
  border: 2px solid #183d20;
  background: #4d8f4a;
  box-shadow: inset -6px 0 0 #35713a, inset 4px 0 0 #69ad58, 2px 2px 0 rgba(4, 28, 24, .3);
}

.familiar-pipe::before {
  content: "";
  position: absolute;
  top: 0;
  right: -4px;
  left: -4px;
  height: 10px;
  border: 2px solid #183d20;
  background: #59a152;
  box-shadow: inset 0 -3px 0 #35713a;
}

.loader-familiar--demon .familiar-pipe {
  left: -16%;
}

.loader-familiar--angel .familiar-pipe {
  right: -16%;
}

.familiar-goomba {
  position: absolute;
  z-index: 0;
  bottom: 7px;
  left: 10%;
  width: 22px;
  height: 18px;
  border: 2px solid #2a160e;
  background: #9b5a2f;
  box-shadow: inset 0 5px 0 #c9824c;
  animation: familiarGoomba 4.2s steps(2, end) infinite alternate;
}

.familiar-goomba::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 3px;
  width: 5px;
  height: 5px;
  background: #fff4df;
  box-shadow: 9px 0 0 #fff4df;
}

.familiar-goomba::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 7px;
  height: 4px;
  background: #2a160e;
  box-shadow: 12px 0 0 #2a160e;
}

.familiar-brick {
  z-index: 0;
  right: -8%;
  bottom: -6px;
  left: -8%;
  height: 11px;
}

.familiar-star {
  position: absolute;
  z-index: 4;
  top: 31%;
  right: -7%;
  width: 13px;
  height: 13px;
  background: #f7d35f;
  clip-path: polygon(50% 0, 62% 34%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 34%);
  filter: drop-shadow(1px 1px 0 #8a5a10);
  animation: familiarStar 2.6s steps(2, end) infinite;
}

.loader-familiar--demon .familiar-star {
  right: auto;
  left: -9%;
  top: 38%;
}

@keyframes familiarGoomba {
  0% { transform: translateX(0); }
  100% { transform: translateX(34px); }
}

@keyframes familiarStar {
  0%, 100% { opacity: .25; transform: scale(.7) rotate(0deg); }
  45% { opacity: 1; transform: scale(1) rotate(30deg); }
  70% { opacity: .6; transform: scale(.85) rotate(60deg); }
}

@media (max-width: 760px) {
  .familiar-star {
    display: none;
  }
}

/* Use the original Chapter 01 demon and angel character art in the loader. */
.loader-familiar .loader-familiar-body > svg,
.loader-familiar .familiar-game {
  display: none;
}

.familiar-portrait {
  position: relative;
  display: block;
  width: 100%;
  border: 2px solid var(--px-face);
  background: #1a1311;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .32);
  overflow: hidden;
}

.familiar-original {
  display: block;
  width: 100%;
  height: auto;
}

.familiar-portrait::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(5, 20, 18, .22) 0 1px, transparent 1px 3px);
  opacity: .3;
  pointer-events: none;
}

.loader-familiar.is-hopping .familiar-portrait {
  animation: familiarCardHop .7s steps(8, end);
}

@keyframes familiarCardHop {
  0%, 100% { transform: translateY(0) scaleY(1); }
  14% { transform: translateY(3px) scaleY(.97); }
  38% { transform: translateY(-14px) scaleY(1.02); }
  58% { transform: translateY(-18px) scaleY(1); }
  80% { transform: translateY(0) scaleY(.98); }
  90% { transform: translateY(-2px) scaleY(1); }
}

@media (max-width: 760px) {
  .loader-familiar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-familiar.is-hopping .familiar-portrait {
    animation: none;
  }
}

/* HELLO bubble: clickable, with pixel hearts. */
.mascot-bubble {
  pointer-events: auto;
  cursor: pointer;
  appearance: none;
  font: inherit;
}

.mascot-bubble:hover {
  filter: brightness(1.04);
}

.mascot-bubble:focus-visible {
  outline: 2px dashed var(--px-red);
  outline-offset: 4px;
}

.mascot-bubble.is-loved {
  animation: mascotLovePop .34s steps(3, end);
}

.mascot-heart {
  position: absolute;
  z-index: 5;
  bottom: 100%;
  width: 3px;
  height: 3px;
  color: var(--heart, #dd5b4b);
  background: currentColor;
  box-shadow:
    3px 0 0 currentColor, 9px 0 0 currentColor,
    0 3px 0 currentColor, 3px 3px 0 currentColor, 6px 3px 0 currentColor, 9px 3px 0 currentColor, 12px 3px 0 currentColor,
    0 6px 0 currentColor, 3px 6px 0 currentColor, 6px 6px 0 currentColor, 9px 6px 0 currentColor, 12px 6px 0 currentColor,
    3px 9px 0 currentColor, 6px 9px 0 currentColor, 9px 9px 0 currentColor,
    6px 12px 0 currentColor;
  pointer-events: none;
  animation: mascotHeartFloat 1.3s steps(11, end) forwards;
}

@keyframes mascotLovePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes mascotHeartFloat {
  0% { opacity: 0; transform: translate(0, 0) scale(.55); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift, 0), -78px) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-bubble,
  .mascot-bubble.is-loved,
  .mascot-heart {
    animation: none;
  }
}

.mascot-bubble .mascot-heart {
  color: var(--heart, #dd5b4b);
}

/* CV card: replace the soft gradient wash with a flat pixel lift and press. */
.resume-flap {
  background: #741812;
  border-bottom-color: rgba(242, 231, 216, .24);
}

.resume-card:hover {
  border-color: var(--px-face-hi);
  background: #a12a20;
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--px-shadow);
  filter: none;
}

.resume-card:active {
  background: #b53629;
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--px-shadow);
  filter: none;
}

/* The contact postcard gives a short paper wobble when the pointer enters. */
.postcard {
  transform-origin: 50% 100%;
  transition: box-shadow .18s steps(2, end);
}

.postcard:hover {
  animation: postcardWobble .72s steps(5, end) 2;
  box-shadow: 12px 14px 0 rgba(0, 0, 0, .34);
}

@keyframes postcardWobble {
  0%, 100% { transform: rotate(2.2deg); }
  16% { transform: rotate(1.2deg); }
  34% { transform: rotate(3.2deg); }
  52% { transform: rotate(1.4deg); }
  70% { transform: rotate(2.9deg); }
  86% { transform: rotate(1.9deg); }
}

@media (prefers-reduced-motion: reduce) {
  .postcard:hover {
    animation: none;
  }
}

/* Mobile legibility: show revealed copy immediately and strengthen the postcard text. */
@media (max-width: 760px) {
  .js [data-reveal] {
    opacity: 1 !important;
    translate: none !important;
    transition: none !important;
  }

  .postcard {
    background: #f6ecd9;
    border-color: #17110d;
  }

  .postcard .postcard-kicker {
    padding-right: 72px;
    color: #584a3c;
    font-size: 9px;
    line-height: 1.6;
    letter-spacing: .02em;
  }

  .postcard .postcard-hand {
    margin-top: 28px;
    color: #8f1b16;
    font-size: 28px;
    line-height: 1.15;
  }

  .postcard .email-copy span {
    color: #17110d;
    font-size: clamp(19px, 5.6vw, 25px);
  }

  .postcard .email-copy em {
    color: #584a3c;
    font-size: 9px;
  }

  .postcard .contact-more {
    margin-top: 20px;
    color: #584a3c;
    font-size: 10px;
    line-height: 1.6;
  }

  .postcard .contact-method {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 0;
  }

  .postcard .cm-label {
    color: #8f1b16;
    font-size: 10px;
    line-height: 1.5;
  }

  .postcard .cm-value {
    color: #17110d;
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0;
  }

  .postcard .cm-action {
    color: #584a3c;
    font-size: 10px;
  }

  .postcard .postcard-send {
    color: #17110d;
    font-size: 20px;
  }

  .postcard .postcard-send span {
    font-size: 16px;
  }

  .postcard .postcard-stamp em {
    font-size: 7px;
  }

  .contact-bottom {
    color: #f4e7d5;
    font-size: 10px;
    line-height: 1.65;
  }
}

/* The about stats now hold two figures, so let them share one row on every screen. */
.about-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.about-stats > div:last-child {
  grid-column: auto;
  border-top: 0;
  padding-top: 0;
}

/* Mario-style filler for the empty loader gutters. */
.loader-familiar {
  width: clamp(112px, 10vw, 172px);
}

.loader-familiar .loader-familiar-body,
.loader-familiar figcaption {
  display: none;
}

.loader-level {
  position: relative;
  display: block;
  width: 100%;
  height: 218px;
  image-rendering: pixelated;
}

.level-ground {
  position: absolute;
  z-index: 8;
  right: -6%;
  bottom: 0;
  left: -6%;
  height: 14px;
  border-top: 3px solid #2a140e;
  border-bottom: 3px solid #2a140e;
  background-color: #a65537;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 14px, #5c2a1c 14px 17px),
    repeating-linear-gradient(0deg, transparent 0 5px, #5c2a1c 5px 7px);
}

.level-hill {
  position: absolute;
  z-index: 1;
  bottom: 9px;
  width: 58%;
  height: 32%;
  background: #2f7549;
  filter: drop-shadow(2px 0 0 #153b27) drop-shadow(-2px 0 0 #153b27) drop-shadow(0 2px 0 #153b27);
  clip-path: polygon(0 100%, 0 70%, 16% 70%, 16% 52%, 32% 52%, 32% 36%, 50% 36%, 50% 52%, 68% 52%, 68% 70%, 100% 70%, 100% 100%);
}

.level-hill--a {
  left: -14%;
}

.level-hill--b {
  right: -10%;
  width: 42%;
  height: 23%;
  background: #28643e;
}

.level-cloud {
  position: absolute;
  z-index: 0;
  width: 11px;
  height: 8px;
  background: #eee2cc;
  box-shadow:
    11px -7px 0 #eee2cc,
    22px 0 0 #eee2cc,
    33px 0 0 #eee2cc,
    44px -7px 0 #eee2cc;
  animation: levelCloud 9s steps(2, end) infinite alternate;
}

.level-cloud--a {
  top: 12%;
  left: 2%;
}

.level-cloud--b {
  top: 29%;
  right: 2%;
  transform: scale(.72);
  animation-delay: -4s;
}

.level-coin {
  position: absolute;
  z-index: 5;
  width: 10px;
  height: 14px;
  border: 2px solid #6d430e;
  background: #f4c744;
  box-shadow: inset -2px 0 0 #d49119, inset 2px 0 0 #ffe27a;
  animation: levelCoin 2.1s steps(2, end) infinite;
}

.level-coin--a {
  top: 18%;
  left: 10%;
}

.level-coin--b {
  top: 10%;
  left: 37%;
  animation-delay: -.7s;
}

.level-coin--c {
  top: 17%;
  left: 64%;
  animation-delay: -1.3s;
}

.level-block {
  position: absolute;
  z-index: 6;
  top: 38%;
  width: 24px;
  height: 24px;
  border: 2px solid #3b1b0d;
  background: #c97732;
  box-shadow: inset 0 3px 0 #efb879, inset -3px 0 0 #8d421f;
  animation: levelBlock 2.8s steps(2, end) infinite;
}

.level-block--a {
  left: 5%;
}

.level-block--b {
  left: 31%;
  animation-delay: -.8s;
}

.level-block--c {
  left: 57%;
}

.level-block--q {
  display: grid;
  place-items: center;
  background: #e5a52f;
  color: #3b1b0d;
  font-family: var(--px-en);
  font-size: 11px;
  line-height: 1;
  text-shadow: 1px 1px 0 #f8d274;
}

.level-block--brick {
  background-color: #b35f36;
  background-image:
    linear-gradient(90deg, transparent 46%, #6b2e1c 46% 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, #6b2e1c 46% 54%, transparent 54%);
}

.level-pipe {
  position: absolute;
  z-index: 9;
  bottom: 10px;
  left: 2%;
  width: 30px;
  height: 44px;
  border: 2px solid #173d22;
  background: #3f8b48;
  box-shadow: inset -6px 0 0 #286a36, inset 4px 0 0 #69b75c;
}

.level-pipe::before {
  content: "";
  position: absolute;
  top: -8px;
  right: -4px;
  left: -4px;
  height: 9px;
  border: 2px solid #173d22;
  background: #4d9b50;
  box-shadow: inset 0 -3px 0 #286a36;
}

.loader-level--right .level-pipe {
  right: 2%;
  left: auto;
}

.level-goomba {
  position: absolute;
  z-index: 10;
  bottom: 11px;
  left: 39%;
  width: 22px;
  height: 18px;
  border: 2px solid #2a160e;
  background: #9b5a2f;
  box-shadow: inset 0 5px 0 #c9824c;
  animation: levelGoomba 3.7s steps(2, end) infinite alternate;
}

.loader-level--right .level-goomba {
  left: 18%;
  animation-duration: 4.4s;
  animation-delay: -1.1s;
}

.level-goomba::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 3px;
  width: 5px;
  height: 5px;
  background: #fff4df;
  box-shadow: 9px 0 0 #fff4df;
}

.level-goomba::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 7px;
  height: 4px;
  background: #2a160e;
  box-shadow: 12px 0 0 #2a160e;
}

.level-flag {
  position: absolute;
  z-index: 9;
  right: 5%;
  bottom: 10px;
  width: 3px;
  height: 72%;
  border: 1px solid #2a140e;
  background: #d8d2c1;
}

.level-flag::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -4px;
  width: 9px;
  height: 9px;
  border: 2px solid #2a140e;
  border-radius: 50%;
  background: #e5a52f;
}

.level-flag i {
  position: absolute;
  top: 5px;
  left: 3px;
  width: 26px;
  height: 18px;
  border: 2px solid #173d22;
  background: #3f8b48;
  clip-path: polygon(0 0, 100% 18%, 100% 82%, 0 100%);
  transform-origin: 0 50%;
  animation: levelFlag 1.8s steps(2, end) infinite alternate;
}

@keyframes levelCoin {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(.25); }
}

@keyframes levelBlock {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes levelGoomba {
  0% { transform: translateX(0); }
  100% { transform: translateX(26px); }
}

@keyframes levelFlag {
  0% { transform: skewY(0deg) scaleX(1); }
  100% { transform: skewY(2deg) scaleX(.86); }
}

@keyframes levelCloud {
  0% { translate: 0 0; }
  100% { translate: 8px 0; }
}

@media (max-width: 900px) {
  .loader-familiar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .level-coin,
  .level-block,
  .level-goomba,
  .level-flag,
  .level-cloud {
    animation: none;
  }
}

/* Fill more of the gutter and make the little level readable at a glance. */
.loader-familiar {
  width: min(180px, 13vw);
}

.loader-level {
  height: 240px;
}

.level-ground {
  height: 16px;
}

.level-block {
  top: 37%;
  width: 28px;
  height: 28px;
}

.level-block--q {
  font-size: 13px;
}

.level-coin {
  width: 12px;
  height: 17px;
}

.level-pipe {
  width: 34px;
  height: 50px;
}

.level-pipe::before {
  height: 10px;
}

.level-goomba {
  width: 25px;
  height: 20px;
}

.level-goomba::before {
  width: 6px;
  height: 6px;
  box-shadow: 10px 0 0 #fff4df;
}

.level-goomba::after {
  width: 8px;
  height: 4px;
  box-shadow: 13px 0 0 #2a160e;
}

.level-flag {
  height: 76%;
}

.level-flag i {
  width: 30px;
  height: 20px;
}

@keyframes levelGoomba {
  0% { transform: translateX(0); }
  100% { transform: translateX(30px); }
}

@media (max-width: 1199px) {
  .loader-familiar {
    display: none;
  }
}

/* Lift the mascot clear of the taskbar so the shoulder and paw stay visible. */
.desktop-mascot {
  bottom: 44px;
}

.mascot-hand-art {
  right: 1%;
  bottom: 5%;
  width: 31%;
}

/* On phones the brand sits on one line instead of wrapping into three. */
@media (max-width: 760px) {
  .site-header .brand-type {
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
  }

  .site-header .brand-type b,
  .site-header .brand-type em {
    white-space: nowrap;
  }

  .site-header .brand-type em {
    margin-top: 0;
    font-size: 6px;
  }
}

/* Two colour-coded, clickable mini levels: blue on the left, orange on the right. */
.loader-level--left {
  --lv-main: #4a86cf;
  --lv-light: #9cc8f5;
  --lv-dark: #1d4777;
  --lv-outline: #0b2747;
  --lv-ground: #4b78ab;
  --lv-hill: #3f78ad;
  --lv-hill-dark: #2b5b86;
  --lv-block: #4b7fb8;
  --lv-q: #639bdb;
  --lv-cloud: #d9e8f4;
  --lv-goomba: #3b5c86;
  --lv-goomba-light: #6f92bd;
}

.loader-level--right {
  --lv-main: #d57b2f;
  --lv-light: #f3b36a;
  --lv-dark: #7c3a13;
  --lv-outline: #4a210b;
  --lv-ground: #b35d2b;
  --lv-hill: #a9571f;
  --lv-hill-dark: #7f3d13;
  --lv-block: #bd632b;
  --lv-q: #e39a45;
  --lv-cloud: #f5dfc4;
  --lv-goomba: #8a4a27;
  --lv-goomba-light: #c47e4d;
}

.level-ground {
  border-color: var(--lv-outline);
  background-color: var(--lv-ground);
  background-image:
    repeating-linear-gradient(90deg, transparent 0 14px, var(--lv-dark) 14px 17px),
    repeating-linear-gradient(0deg, transparent 0 5px, var(--lv-dark) 5px 7px);
}

.level-hill {
  background: var(--lv-hill);
  filter: drop-shadow(2px 0 0 var(--lv-outline)) drop-shadow(-2px 0 0 var(--lv-outline)) drop-shadow(0 2px 0 var(--lv-outline));
}

.level-hill--b {
  background: var(--lv-hill-dark);
}

.level-cloud {
  background: var(--lv-cloud);
  box-shadow:
    11px -7px 0 var(--lv-cloud),
    22px 0 0 var(--lv-cloud),
    33px 0 0 var(--lv-cloud),
    44px -7px 0 var(--lv-cloud);
}

.level-block {
  border-color: var(--lv-outline);
  background: var(--lv-block);
  box-shadow: inset 0 3px 0 var(--lv-light), inset -3px 0 0 var(--lv-dark);
}

.level-block--q {
  background: var(--lv-q);
  color: var(--lv-outline);
  text-shadow: 1px 1px 0 var(--lv-light);
}

.level-block--brick {
  background-color: var(--lv-block);
  background-image:
    linear-gradient(90deg, transparent 46%, var(--lv-dark) 46% 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, var(--lv-dark) 46% 54%, transparent 54%);
}

.level-pipe {
  border-color: var(--lv-outline);
  background: var(--lv-main);
  box-shadow: inset -6px 0 0 var(--lv-dark), inset 4px 0 0 var(--lv-light);
}

.level-pipe::before {
  border-color: var(--lv-outline);
  background: var(--lv-main);
  box-shadow: inset 0 -3px 0 var(--lv-dark);
}

.level-flag {
  border-color: var(--lv-outline);
}

.level-flag i {
  border-color: var(--lv-outline);
  background: var(--lv-main);
}

.level-goomba {
  background: var(--lv-goomba);
  box-shadow: inset 0 5px 0 var(--lv-goomba-light);
}

.level-score {
  position: absolute;
  z-index: 20;
  top: -2px;
  left: 0;
  color: var(--lv-light);
  font-family: var(--px-en);
  font-size: 5px;
  letter-spacing: .06em;
  text-shadow: 1px 1px 0 var(--lv-outline);
  pointer-events: none;
}

.level-score.is-scored {
  animation: levelScore .26s steps(2, end);
}

.level-block--q,
.level-coin,
.level-goomba {
  cursor: pointer;
  pointer-events: auto;
}

.level-block--q:hover,
.level-coin:hover,
.level-goomba:hover {
  filter: brightness(1.16);
}

.level-block.is-hit {
  animation: levelBlockHit .32s steps(2, end);
}

.level-block.is-hit::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 10px;
  height: 14px;
  margin-left: -5px;
  border: 2px solid #6d430e;
  background: #f4c744;
  box-shadow: inset -2px 0 0 #d49119;
  animation: levelCoinPop .58s steps(5, end) forwards;
}

.level-coin.is-collected {
  animation: levelCoinGet .42s steps(4, end) forwards;
  pointer-events: none;
}

.level-goomba.is-stomped {
  animation: none;
  transform: translateY(8px) scaleY(.4);
  opacity: .55;
  transition: transform .12s steps(2, end), opacity .12s steps(2, end);
}

@keyframes levelBlockHit {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-8px); }
}

@keyframes levelCoinPop {
  0% { opacity: 0; transform: translateY(0) scale(.55); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-34px) scale(1); }
}

@keyframes levelCoinGet {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-28px) scale(.35); }
}

@keyframes levelScore {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.level-block--q:focus-visible,
.level-coin:focus-visible,
.level-goomba:focus-visible {
  outline: 2px solid var(--lv-light);
  outline-offset: 2px;
}

/* The levels keep the normal Mario palette; only the two little players differ. */
.loader-level--left,
.loader-level--right {
  --lv-main: #3f8b48;
  --lv-light: #69b75c;
  --lv-dark: #286a36;
  --lv-outline: #173d22;
  --lv-ground: #a65537;
  --lv-hill: #2f7549;
  --lv-hill-dark: #28643e;
  --lv-block: #c97732;
  --lv-q: #e5a52f;
  --lv-cloud: #eee2cc;
  --lv-goomba: #9b5a2f;
  --lv-goomba-light: #c9824c;
}

.level-score {
  color: #f2e7d5;
  text-shadow: 1px 1px 0 #173d22;
}

.level-player {
  position: absolute;
  z-index: 12;
  bottom: 14px;
  left: 72%;
  width: 22px;
  height: 28px;
  pointer-events: none;
  image-rendering: pixelated;
  animation: levelPlayerIdle 1.8s steps(2, end) infinite;
}

.loader-level--right .level-player {
  left: 48%;
}

.level-player--blue {
  --player: #4a86cf;
  --player-dark: #1d4777;
  --player-light: #9cc8f5;
}

.level-player--orange {
  --player: #d57b2f;
  --player-dark: #7c3a13;
  --player-light: #f3b36a;
}

@keyframes levelPlayerIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  .level-player {
    animation: none;
  }
}

.loader-level .level-player {
  position: absolute;
  width: 22px;
  height: 28px;
}

.loader-level .level-player {
  width: 24px;
  height: 30px;
}

.level-controls {
  position: absolute;
  z-index: 20;
  top: -2px;
  right: 0;
  color: #f2e7d5;
  font-family: var(--px-cn);
  font-size: 6px;
  letter-spacing: .02em;
  text-shadow: 1px 1px 0 #173d22;
  pointer-events: none;
}

.level-player.is-walking {
  animation: levelPlayerWalk .28s steps(2, end) infinite;
}

@keyframes levelPlayerWalk {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.level-controls {
  top: auto;
  right: 0;
  bottom: -16px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: .05em;
}

/* The decorative familiar layer was click-through; the playable levels must catch clicks. */
.loader-level {
  pointer-events: auto;
}

/* The transparent center column was intercepting game clicks; only its button should. */
.loader-center {
  pointer-events: none;
}

.loader-center .loader-enter {
  pointer-events: auto;
}

.mascot-hand-art {
  bottom: 1%;
}

.mascot-heart {
  bottom: calc(100% + 7px);
}

/* Make the plumber read as the hero and let a stomped goomba stay dead. */
.loader-level .level-player {
  width: 30px;
  height: 38px;
}

.level-goomba {
  width: 22px;
  height: 18px;
}

.level-goomba::before {
  width: 5px;
  height: 5px;
  left: 3px;
  box-shadow: 8px 0 0 #fff4df;
}

.level-goomba::after {
  width: 7px;
  height: 4px;
  box-shadow: 11px 0 0 #2a160e;
}

.level-goomba.is-stomped {
  animation: none;
  transform: translateY(12px) scaleY(.18);
  opacity: 0;
  transition: transform .2s steps(3, end), opacity .18s steps(2, end) .18s;
}

.level-goomba.is-dead {
  display: none;
}

/* Reaching 99 coins sets off a little star shower on that side. */
.level-99 {
  position: absolute;
  z-index: 30;
  top: 43%;
  left: 50%;
  color: #c77dff;
  font-family: var(--px-cn);
  font-size: 16px;
  line-height: 1;
  letter-spacing: -.04em;
  text-shadow: 2px 2px 0 #35104f, -1px -1px 0 #ecd9ff;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: level99Pop .8s steps(5, end) both;
}

.level-99 b {
  color: #f7d35f;
  font-weight: 400;
}

.level-star {
  position: absolute;
  z-index: 29;
  top: 48%;
  left: 50%;
  width: 9px;
  height: 9px;
  background: var(--star, #f4c744);
  clip-path: polygon(50% 0, 62% 34%, 98% 36%, 70% 58%, 80% 94%, 50% 72%, 20% 94%, 30% 58%, 2% 36%, 38% 34%);
  pointer-events: none;
  animation: levelStarFly 1.5s steps(8, end) forwards;
}

.loader-level.is-99 .level-ground {
  box-shadow: 0 0 0 2px #f4c744, 0 0 0 4px #8a5a10;
}

@keyframes level99Pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
  32% { opacity: 1; transform: translate(-50%, -50%) scale(1.22); }
  62% { transform: translate(-50%, -50%) scale(.92); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes levelStarFly {
  0% { opacity: 0; transform: translate(0, 0) scale(.4) rotate(0deg); }
  16% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0px), var(--dy, -60px)) scale(1) rotate(150deg); }
}

@media (prefers-reduced-motion: reduce) {
  .level-99,
  .level-star {
    animation: none;
  }
}

.level-99 {
  top: 26%;
}

/* The 99 burst belongs above the COINS readout, not in the middle of the level. */
.level-99 {
  top: -27px;
  left: 0;
  font-size: 15px;
  transform: none;
  animation-name: level99PopLeft;
}

.level-star {
  top: 2%;
  left: 8%;
}

@keyframes level99PopLeft {
  0% { opacity: 0; transform: translateY(8px) scale(.35); }
  32% { opacity: 1; transform: translateY(0) scale(1.22); }
  62% { transform: translateY(0) scale(.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Two solid brick tiers per side, with the goal pipe raised onto the upper tier. */
.level-platform {
  position: absolute;
  z-index: 4;
  height: 12px;
  border-top: 2px solid #2a140e;
  border-bottom: 2px solid #2a140e;
  background-color: #a65537;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 14px, #5c2a1c 14px 17px),
    repeating-linear-gradient(0deg, transparent 0 5px, #5c2a1c 5px 7px);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .28);
}

.loader-level--left .level-platform--a {
  left: 6%;
  bottom: 70px;
  width: 38%;
}

.loader-level--left .level-platform--b {
  left: 58%;
  bottom: 128px;
  width: 36%;
}

.loader-level--right .level-platform--a {
  right: auto;
  left: 44%;
  bottom: 66px;
  width: 36%;
}

.loader-level--right .level-platform--b {
  left: 8%;
  bottom: 126px;
  width: 34%;
}

.loader-level--left .level-pipe {
  right: auto;
  bottom: 140px;
  left: 64%;
}

.loader-level--right .level-pipe {
  right: auto;
  bottom: 138px;
  left: 14%;
}

.loader-level--right .level-block--a {
  left: 62%;
}

.loader-level--right .level-block--b {
  left: 80%;
}

.level-pipe--goal::before {
  box-shadow: 0 0 0 2px #f4c744, inset 0 -3px 0 var(--lv-dark);
}

.level-pipe--goal::after {
  content: "";
  position: absolute;
  top: -24px;
  left: 50%;
  width: 0;
  height: 0;
  margin-left: -5px;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  border-top: 7px solid #f4c744;
  animation: levelGoalArrow 1.1s steps(2, end) infinite;
}

.level-player.is-pipe {
  z-index: 14;
  animation: levelPlayerPipe .68s steps(7, end) forwards;
}

@keyframes levelGoalArrow {
  0%, 100% { transform: translateY(0); opacity: .7; }
  50% { transform: translateY(4px); opacity: 1; }
}

@keyframes levelPlayerPipe {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  55% { opacity: 1; transform: translateY(8px) scale(.78); }
  100% { opacity: 0; transform: translateY(28px) scale(.22); }
}

@media (prefers-reduced-motion: reduce) {
  .level-pipe--goal::after,
  .level-player.is-pipe {
    animation: none;
  }
}

/* Mobile folder labels: black titles, dark-grey tap hint, and no sticky cream hover. */
@media (max-width: 760px), (hover: none) {
  .hero-cell .hero-cell-name,
  .hero-cell:hover .hero-cell-name {
    color: #111111 !important;
  }

  .hero-cell .hero-cell-poke,
  .hero-cell:hover .hero-cell-poke {
    color: #4a4a4a !important;
  }

  .hero-cell:hover .hero-cell-back {
    background: #c8bfa8 !important;
    color: #17110d !important;
  }

  .hero-cell:hover .hero-cell-top {
    color: #5e5747 !important;
  }
}

.hero-board.is-all .hero-board-head span:last-child,
.hero-board.is-all .hero-board-reset {
  color: var(--px-red);
}

.hero-board.is-all .hero-board-reset {
  border-color: var(--px-red);
}

/* Both bricks and ? blocks are solid and can be bumped. */
.level-block {
  cursor: pointer;
  pointer-events: auto;
}

.level-block:hover {
  filter: brightness(1.16);
}

.level-block:focus-visible {
  outline: 2px solid var(--lv-light);
  outline-offset: 2px;
}

/* Coins sit directly over the brick row, clear of the drifting clouds. */
.level-coin--a {
  top: 22%;
  left: 10%;
}

.level-coin--b {
  top: 22%;
  left: 37%;
}

.level-coin--c {
  top: 22%;
  left: 64%;
}

.loader-level--right .level-coin--a {
  left: 62%;
}

.loader-level--right .level-coin--b {
  left: 80%;
}

/* Wider, overlapping tiers so the shorter jump can still climb them in two steps. */
.loader-level--left .level-platform--a {
  width: 42%;
}

.loader-level--left .level-platform--b {
  left: 50%;
  width: 46%;
}

.loader-level--right .level-platform--a {
  left: 40%;
  width: 44%;
}

.loader-level--right .level-platform--b {
  left: 4%;
  width: 44%;
}

/* Keep the left climb lane clear of the block row. */
.loader-level--left .level-block--b {
  left: 23%;
}

.loader-level--left .level-coin--b {
  left: 23%;
}

.loader-level--left .level-platform--b {
  left: 46%;
}

/* Bricks are rigid: no idle bob, no bump reaction, no payout. */
.level-block {
  animation: none;
}

.level-block--brick,
.level-block--brick:hover {
  pointer-events: none;
  cursor: default;
  filter: none;
}

/* The second collectible sits in a random safe spot in the open middle lane. */
.level-coin--b {
  top: 26%;
  left: 50%;
}

.loader-level--right .level-coin--b {
  left: 50%;
}

/* A question block pays once, then stays as an empty used block. */
.level-block--q.is-used {
  background: var(--lv-block);
  color: transparent;
  text-shadow: none;
  cursor: default;
}

.loader-level--left .level-coin--b {
  left: 45%;
}

.loader-level--right .level-coin--b {
  left: 40%;
}

/* The live CRT grain sits above dialogs; hide it while reading the CV. */
body.resume-open .paper-grain {
  display: none;
}

/* The contact postcard sways gently on its own; hovering steadies it. */
@media (prefers-reduced-motion: no-preference) {
  .postcard {
    animation: postcardIdle 5.6s ease-in-out infinite;
  }
}

.postcard:hover {
  animation: none;
}

@keyframes postcardIdle {
  0%, 100% { rotate: 0deg; }
  25% { rotate: -.45deg; }
  75% { rotate: .45deg; }
}

/* Chapter capability chips: tactile press, pixel burst and a pinned state. */
.chapter-tags li {
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: background .1s steps(2, end), color .1s steps(2, end),
    border-color .1s steps(2, end), transform .1s steps(2, end),
    box-shadow .1s steps(2, end);
}

.chapter-tags li::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid var(--px-red);
  opacity: 0;
  pointer-events: none;
}

.chapter-tags li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  background: var(--px-red);
  opacity: 0;
  pointer-events: none;
  box-shadow: none;
}

.chapter-tags li.is-poking::after {
  animation: tagPokeRing .46s steps(4, end);
}

.chapter-tags li.is-poking::before {
  animation: tagPokeSparks .46s steps(4, end);
}

.chapter-tags li.is-poking {
  animation: tagPokePress .4s steps(3, end);
}

.chapter-tags li.is-active {
  background: var(--px-red);
  border-color: var(--px-red);
  color: var(--px-face-hi);
  box-shadow: 2px 2px 0 var(--px-shadow);
  transform: translate(1px, 1px);
}

.chapter-tags li:active {
  box-shadow: none;
  transform: translate(2px, 2px);
}

@media (hover: hover) {
  .chapter-tags li:hover {
    background: var(--px-ink);
    border-color: var(--px-ink);
    color: var(--px-face-hi);
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 var(--px-shadow);
  }

  .chapter-tags li.is-active:hover {
    background: #b73528;
    border-color: #b73528;
  }
}

.chapter-tags li:focus-visible {
  outline: 2px solid var(--px-face-hi);
  outline-offset: 2px;
}

@keyframes tagPokePress {
  0% { transform: translate(0, 0); }
  30% { transform: translate(2px, 2px) scale(.96); }
  65% { transform: translate(-1px, -1px) scale(1.02); }
  100% { transform: translate(1px, 1px); }
}

@keyframes tagPokeRing {
  0% { opacity: .9; transform: scale(.72); }
  100% { opacity: 0; transform: scale(1.24); }
}

@keyframes tagPokeSparks {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(.5);
    box-shadow:
      -5px -4px 0 var(--px-red), 5px -3px 0 var(--px-red),
      -4px 5px 0 var(--px-red), 5px 4px 0 var(--px-red);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
    box-shadow:
      -14px -11px 0 var(--px-red), 13px -9px 0 var(--px-red),
      -11px 13px 0 var(--px-red), 14px 10px 0 var(--px-red);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-tags li.is-poking,
  .chapter-tags li.is-poking::after,
  .chapter-tags li.is-poking::before {
    animation: none;
  }
}

/* Keep the click sparks visible once the chip turns red. */
.chapter-tags li {
  --tag-spark: var(--px-red);
}

.chapter-tags li.is-active {
  --tag-spark: var(--px-face-hi);
}

.chapter-tags li::after {
  border-color: var(--tag-spark);
}

.chapter-tags li::before {
  background: var(--tag-spark);
}

@keyframes tagPokeSparks {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(.5);
    box-shadow:
      -5px -4px 0 var(--tag-spark), 5px -3px 0 var(--tag-spark),
      -4px 5px 0 var(--tag-spark), 5px 4px 0 var(--tag-spark);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
    box-shadow:
      -14px -11px 0 var(--tag-spark), 13px -9px 0 var(--tag-spark),
      -11px 13px 0 var(--tag-spark), 14px 10px 0 var(--tag-spark);
  }
}

/* Press-and-hold portrait peek: the real photo shows only while held. */
.about-card.is-scratch-ready .about-face--front {
  cursor: pointer;
}

.about-card.is-scratch-ready.is-peeking .about-face--front {
  cursor: grabbing;
}

.about-face--front,
.about-scratch {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Preview and reader tags get the same tactile click language. */
.peek-tags li,
.reader-tags li {
  --tag-spark: var(--px-red);
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: background .1s steps(2, end), color .1s steps(2, end),
    border-color .1s steps(2, end), transform .1s steps(2, end),
    box-shadow .1s steps(2, end);
}

.peek-tags li::after,
.reader-tags li::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid var(--tag-spark);
  opacity: 0;
  pointer-events: none;
}

.peek-tags li::before,
.reader-tags li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  background: var(--tag-spark);
  opacity: 0;
  pointer-events: none;
  box-shadow: none;
}

.peek-tags li.is-poking::after,
.reader-tags li.is-poking::after {
  animation: tagPokeRing .46s steps(4, end);
}

.peek-tags li.is-poking::before,
.reader-tags li.is-poking::before {
  animation: tagPokeSparks .46s steps(4, end);
}

.peek-tags li.is-poking,
.reader-tags li.is-poking {
  animation: tagPokePress .4s steps(3, end);
}

.peek-tags li.is-active,
.reader-tags li.is-active {
  --tag-spark: var(--px-face-hi);
  background: var(--px-red);
  border-color: var(--px-red);
  color: var(--px-face-hi);
  box-shadow: 2px 2px 0 var(--px-shadow);
  transform: translate(1px, 1px);
}

.peek-tags li:active,
.reader-tags li:active {
  box-shadow: none;
  transform: translate(2px, 2px);
}

@media (hover: hover) {
  .peek-tags li:hover,
  .reader-tags li:hover {
    background: var(--px-ink);
    border-color: var(--px-ink);
    color: var(--px-face-hi);
    box-shadow: 2px 2px 0 var(--px-shadow);
    transform: translate(-1px, -1px);
  }

  .peek-tags li.is-active:hover,
  .reader-tags li.is-active:hover {
    background: #b73528;
    border-color: #b73528;
  }
}

.peek-tags li:focus-visible,
.reader-tags li:focus-visible {
  outline: 2px solid var(--px-ink);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .peek-tags li.is-poking,
  .peek-tags li.is-poking::after,
  .peek-tags li.is-poking::before,
  .reader-tags li.is-poking,
  .reader-tags li.is-poking::after,
  .reader-tags li.is-poking::before {
    animation: none;
  }
}

/* The portrait hint is now a real button for pinning the real photo open. */
.about-peek-button {
  margin-left: 0;
}

.about-peek-button[aria-pressed="true"] {
  background: var(--px-red);
  border-color: var(--px-red);
  color: var(--px-face-hi);
  box-shadow: 1px 1px 0 var(--px-shadow);
}

.about-peek-button[aria-pressed="true"]:hover,
.about-peek-button[aria-pressed="true"]:focus-visible {
  background: #b73528;
  border-color: #b73528;
  color: var(--px-face-hi);
}

/* WHAT I DO rows: a small red sweep follows the pointer across each skill. */
.cap-list li {
  cursor: crosshair;
  transition: color .14s steps(2, end), background .14s steps(2, end),
    padding-left .14s steps(2, end);
}

.cap-list li::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--px-red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .2s steps(3, end);
}

.cap-list li:hover {
  background: linear-gradient(90deg, rgba(169, 47, 36, .2), rgba(169, 47, 36, 0) 72%);
  color: var(--px-face-hi);
  padding-left: 20px;
}

.cap-list li:hover::before {
  content: "↗";
  color: var(--px-face-hi);
  transform: translateY(-1px);
}

.cap-list li:hover::after {
  transform: scaleX(1);
}

@media (hover: none) {
  .cap-list li:active {
    background: linear-gradient(90deg, rgba(169, 47, 36, .2), rgba(169, 47, 36, 0) 72%);
    color: var(--px-face-hi);
    padding-left: 20px;
  }

  .cap-list li:active::before {
    content: "↗";
    color: var(--px-face-hi);
  }

  .cap-list li:active::after {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cap-list li,
  .cap-list li::after {
    transition: none;
  }
}

/* GPA tile and the 90+ transcript window. */
.about-stat--gpa {
  position: relative;
  cursor: pointer;
  outline: none;
}

.about-stat--gpa span i {
  display: inline-block;
  margin-left: 3px;
  color: var(--px-red);
  font-style: normal;
}

.about-stat--gpa b {
  transition: color .14s steps(2, end), transform .14s steps(2, end);
}

.about-stat--gpa:hover b,
.about-stat--gpa:focus-visible b {
  color: var(--px-red);
  transform: translate(1px, -1px);
}

.about-stat--gpa:focus-visible {
  box-shadow: inset 0 0 0 2px var(--px-red);
}

.gpa-modal {
  position: fixed;
  z-index: 2300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 34px);
  opacity: 0;
  transition: opacity .24s steps(3, end);
}

.gpa-modal[hidden] {
  display: none;
}

.gpa-modal.is-open {
  opacity: 1;
}

.gpa-modal-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 24, 22, .9);
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.gpa-sheet {
  position: relative;
  z-index: 1;
  width: min(720px, 94vw);
  max-height: 92vh;
  overflow: auto;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 8px 8px 0 var(--px-shadow);
  overscroll-behavior: contain;
}

.gpa-modal.is-open .gpa-sheet {
  animation: pxDialogIn .25s steps(4, end) both;
}

.gpa-titlebar {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  padding: 5px 7px;
  background: linear-gradient(90deg, var(--px-navy), var(--px-navy-hi));
  color: var(--px-face-hi);
  font-family: var(--px-en);
  font-size: 6px;
  letter-spacing: .03em;
}

.gpa-titlebar > span:nth-child(2) {
  margin-left: auto;
  opacity: .7;
}

.gpa-close {
  padding: 2px 6px;
  border: 1px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  font-family: var(--px-cn);
  font-size: 6px;
  line-height: 1.2;
  cursor: pointer;
}

.gpa-close:hover,
.gpa-close:focus-visible {
  background: var(--px-ink);
  color: var(--px-face-hi);
}

.gpa-body {
  padding: clamp(18px, 3vw, 30px);
}

.gpa-kicker {
  color: #6b6250;
  font-family: var(--px-en);
  font-size: 5px;
  letter-spacing: .08em;
}

.gpa-body h3 {
  margin-top: 12px;
  font-family: var(--px-cn);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -.03em;
}

.gpa-body h3 em {
  color: var(--px-red);
  font-style: normal;
}

.gpa-sub {
  margin-top: 10px;
  color: #6b6250;
  font-family: var(--px-cn);
  font-size: 9px;
}

.gpa-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px dashed var(--px-face-lo);
  border-bottom: 1px dashed var(--px-face-lo);
}

.gpa-summary > div {
  padding: 10px 10px 9px 0;
  border-right: 1px solid var(--px-face-lo);
}

.gpa-summary > div:last-child {
  border-right: 0;
  padding-left: 10px;
}

.gpa-summary > div:nth-child(2) {
  padding-left: 10px;
}

.gpa-summary b {
  display: block;
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: clamp(16px, 2.6vw, 24px);
  font-weight: 400;
  line-height: 1;
}

.gpa-summary span {
  display: block;
  margin-top: 5px;
  color: #6b6250;
  font-family: var(--px-cn);
  font-size: 7px;
}

.gpa-list {
  margin-top: 8px;
  counter-reset: gpa-course;
}

.gpa-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 4px;
  border-bottom: 1px dashed var(--px-face-lo);
  transition: background .12s steps(2, end), color .12s steps(2, end),
    padding-left .12s steps(2, end);
}

.gpa-list li > span {
  color: #8d846d;
  font-family: var(--px-en);
  font-size: 6px;
}

.gpa-list li b {
  font-family: var(--px-cn);
  font-size: 11px;
  font-weight: 400;
}

.gpa-list li em {
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: 14px;
  font-style: normal;
}

.gpa-list li:hover {
  background: var(--px-red);
  color: var(--px-face-hi);
  padding-left: 9px;
}

.gpa-list li:hover > span,
.gpa-list li:hover em {
  color: var(--px-face-hi);
}

.gpa-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: #6b6250;
  font-family: var(--px-en);
  font-size: 5px;
  line-height: 1.7;
}

body.gpa-open {
  overflow: hidden;
}

body.gpa-open .paper-grain {
  display: none;
}

body.gpa-open .cursor,
body.gpa-open .cursor-tag {
  opacity: 0 !important;
  visibility: hidden;
}

@media (max-width: 560px) {
  .gpa-sheet {
    width: min(100%, 460px);
    max-height: 88vh;
    box-shadow: 4px 4px 0 var(--px-shadow);
  }

  .gpa-titlebar > span:nth-child(2) {
    display: none;
  }

  .gpa-body {
    padding: 16px;
  }

  .gpa-summary > div {
    padding-right: 6px;
  }

  .gpa-summary > div:nth-child(2),
  .gpa-summary > div:last-child {
    padding-left: 6px;
  }

  .gpa-list li {
    grid-template-columns: 22px minmax(0, 1fr) auto;
  }

  .gpa-list li b {
    font-size: 10px;
  }

  .gpa-foot {
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gpa-modal,
  .gpa-modal.is-open .gpa-sheet {
    animation: none;
    transition: none;
  }
}

/* The transcript is a plain course list; no headline or summary block. */
.gpa-sheet {
  width: min(640px, 94vw);
}

.gpa-list {
  margin-top: 0;
}

.gpa-list li {
  padding-top: 11px;
  padding-bottom: 11px;
}

/* Bottom-left pixel fortune tube: click for a random +1 wish. */
.fortune-widget {
  position: fixed;
  z-index: 901;
  bottom: 54px;
  left: clamp(176px, 13.8vw, 232px);
  display: flex;
  width: 88px;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .24s steps(3, end), transform .24s steps(3, end);
  pointer-events: none;
}

.fortune-widget.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.fortune-tube {
  position: relative;
  display: block;
  width: 56px;
  height: 98px;
  padding: 0;
  border: 0;
  background: none;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .28));
  cursor: pointer;
  appearance: none;
  transform-origin: 50% 100%;
}

.fortune-tube:hover {
  filter: drop-shadow(4px 3px 0 rgba(0, 0, 0, .3)) brightness(1.04);
}

.fortune-tube:focus-visible {
  outline: 2px dashed var(--px-face-hi);
  outline-offset: 4px;
}

.fortune-sticks {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 7px;
  left: 7px;
  height: 38px;
}

.fortune-sticks i {
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 28px;
  border: 1px solid #5d4328;
  background: #e5cca0;
  box-shadow: inset 0 0 0 1px #f7e6c6;
  transform-origin: 50% 100%;
}

.fortune-sticks i:nth-child(1) {
  left: 4px;
  height: 24px;
  transform: rotate(-13deg);
}

.fortune-sticks i:nth-child(2) {
  left: 15px;
  height: 31px;
  transform: rotate(-5deg);
  background: #f0d9ae;
}

.fortune-sticks i:nth-child(3) {
  left: 27px;
  height: 27px;
  transform: rotate(4deg);
}

.fortune-sticks i:nth-child(4) {
  left: 37px;
  height: 33px;
  transform: rotate(12deg);
  background: #d8b882;
}

.fortune-sticks i:nth-child(5) {
  left: 46px;
  height: 23px;
  transform: rotate(20deg);
}

.fortune-sticks i::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  left: -1px;
  height: 4px;
  background: var(--px-red);
}

.fortune-cup {
  position: absolute;
  z-index: 2;
  right: 3px;
  bottom: 0;
  left: 3px;
  height: 66px;
  border: 2px solid #48231b;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .18) 0 12%, transparent 12% 78%, rgba(0, 0, 0, .2) 78% 100%),
    linear-gradient(90deg, #9c3528, #d96648 46%, #ad3b2c);
  box-shadow: inset 2px 0 #ef9b7c, inset -2px 0 #79251c;
}

.fortune-cup-rim {
  position: absolute;
  top: -7px;
  right: -3px;
  left: -3px;
  height: 10px;
  border: 2px solid #48231b;
  background: linear-gradient(180deg, #f2e3c1, #c9ae7e);
}

.fortune-cup-label {
  position: absolute;
  top: 15px;
  left: 50%;
  color: #f7e8ca;
  font-family: var(--px-cn);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 2px;
  text-shadow: 1px 1px 0 #6d2119;
  writing-mode: vertical-rl;
  transform: translateX(-50%);
}

.fortune-cup-mark {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  color: #f3d8b1;
  font-family: var(--px-en);
  font-size: 4px;
  letter-spacing: .12em;
  text-align: center;
}

.fortune-cup::before,
.fortune-cup::after {
  content: "";
  position: absolute;
  top: 16px;
  width: 3px;
  height: 3px;
  background: #f2c9a7;
}

.fortune-cup::before {
  left: 5px;
}

.fortune-cup::after {
  right: 5px;
}

.fortune-pop {
  position: absolute;
  z-index: 3;
  bottom: 62px;
  left: 50%;
  width: 5px;
  height: 42px;
  border: 1px solid #5d4328;
  background: linear-gradient(180deg, #f7e7c7, #d9bb8e);
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
}

.fortune-tube.is-drawing {
  animation: fortuneShake .52s steps(4, end);
}

.fortune-tube.is-drawing .fortune-pop {
  animation: fortuneStickPop .58s steps(6, end) forwards;
}

.fortune-caption {
  margin-top: 7px;
  color: #d9cfb9;
  font-family: var(--px-cn);
  font-size: 7px;
  line-height: 1.2;
  text-align: center;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .55);
  white-space: nowrap;
}

.fortune-caption em {
  display: block;
  margin-top: 3px;
  color: #ef9b7c;
  font-family: var(--px-en);
  font-size: 4px;
  font-style: normal;
  letter-spacing: .06em;
}

.fortune-results {
  position: absolute;
  bottom: 62px;
  left: 58px;
  width: 130px;
  pointer-events: none;
}

.fortune-result {
  position: absolute;
  bottom: 0;
  left: 0;
  display: block;
  min-width: 92px;
  padding: 7px 8px 6px;
  border: 2px solid #5a241b;
  background: #f4e6c8;
  color: #9b2c20;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .32);
  font-family: var(--px-cn);
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
  animation: fortuneResult 2.2s steps(10, end) forwards;
}

.fortune-result small {
  display: block;
  margin-top: 4px;
  color: #6b6250;
  font-family: var(--px-en);
  font-size: 4px;
  letter-spacing: .08em;
}

@keyframes fortuneShake {
  0%, 100% { transform: rotate(0deg); }
  18% { transform: rotate(-7deg); }
  38% { transform: rotate(6deg); }
  58% { transform: rotate(-4deg); }
  78% { transform: rotate(2deg); }
}

@keyframes fortuneStickPop {
  0% { opacity: 0; transform: translateX(-50%) translateY(12px); }
  22% { opacity: 1; }
  55% { opacity: 1; transform: translateX(-50%) translateY(-13px) rotate(-4deg); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-24px) rotate(5deg); }
}

@keyframes fortuneResult {
  0% { opacity: 0; transform: translateY(8px) scale(.94); }
  12% { opacity: 1; transform: translateY(0) scale(1); }
  78% { opacity: 1; transform: translateY(-2px) scale(1); }
  100% { opacity: 0; transform: translateY(-18px) scale(.98); }
}

@media (max-width: 1099px) {
  .fortune-widget {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fortune-widget {
    transition: none;
  }

  .fortune-tube.is-drawing,
  .fortune-tube.is-drawing .fortune-pop,
  .fortune-result {
    animation: none;
  }
}

/* Fortune tube sits in the bottom-right corner, cup bottom aligned with the mascot. */
.fortune-widget {
  right: clamp(16px, 2vw, 30px);
  bottom: 44px;
  left: auto;
}

.fortune-caption {
  position: absolute;
  right: calc(100% + 8px);
  bottom: 4px;
  margin-top: 0;
  text-align: right;
}

.fortune-results {
  right: 58px;
  left: auto;
  width: 130px;
}

.fortune-result {
  right: 0;
  left: auto;
  text-align: right;
}


/* Bigger fortune cup, with wooden 签 slips tucked inside the rim. */
.fortune-widget {
  width: 112px;
}

.fortune-tube {
  width: 74px;
  height: 126px;
}

.fortune-sticks {
  top: 2px;
  right: 9px;
  left: 9px;
  height: 50px;
}

.fortune-sticks i {
  width: 7px;
  height: 42px;
  border: 1px solid #5d4328;
  background: linear-gradient(90deg, #d8b982, #f0d9ae 42%, #c9a66f);
  clip-path: polygon(0 5px, 50% 0, 100% 5px, 100% 100%, 0 100%);
  box-shadow: none;
}

.fortune-sticks i::after {
  content: "签";
  top: 7px;
  right: auto;
  left: 50%;
  width: auto;
  height: auto;
  background: none;
  color: #9d3225;
  font-family: var(--px-cn);
  font-size: 5px;
  line-height: 1;
  transform: translateX(-50%);
}

.fortune-sticks i:nth-child(1) {
  left: 4px;
  height: 36px;
  transform: rotate(-9deg);
}

.fortune-sticks i:nth-child(2) {
  left: 14px;
  height: 46px;
  transform: rotate(-5deg);
  background: linear-gradient(90deg, #d8b982, #f3dfb8 45%, #c9a66f);
}

.fortune-sticks i:nth-child(3) {
  left: 25px;
  height: 41px;
  transform: rotate(0deg);
}

.fortune-sticks i:nth-child(4) {
  left: 37px;
  height: 48px;
  transform: rotate(4deg);
  background: linear-gradient(90deg, #cfae79, #ecd3a5 42%, #bd9962);
}

.fortune-sticks i:nth-child(5) {
  left: 48px;
  height: 35px;
  transform: rotate(8deg);
}

.fortune-cup {
  right: 2px;
  left: 2px;
  height: 86px;
  border-radius: 3px 3px 8px 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .2) 0 10%, transparent 10% 80%, rgba(0, 0, 0, .22) 80% 100%),
    linear-gradient(90deg, #973326, #d96648 46%, #a83a2b);
}

.fortune-cup-rim {
  top: -8px;
  right: -3px;
  left: -3px;
  height: 12px;
}

.fortune-cup-label {
  top: 18px;
  font-size: 11px;
  letter-spacing: 3px;
}

.fortune-cup-mark {
  bottom: 6px;
  font-size: 5px;
}

.fortune-pop {
  bottom: 80px;
  width: 7px;
  height: 54px;
  clip-path: polygon(0 5px, 50% 0, 100% 5px, 100% 100%, 0 100%);
}

.fortune-pop::after {
  content: "签";
  position: absolute;
  top: 8px;
  left: 50%;
  color: #9d3225;
  font-family: var(--px-cn);
  font-size: 5px;
  line-height: 1;
  transform: translateX(-50%);
}

.fortune-caption {
  right: calc(100% + 10px);
  bottom: 6px;
  font-size: 8px;
}

.fortune-caption em {
  font-size: 5px;
}

.fortune-results {
  right: 76px;
  bottom: 80px;
  width: 160px;
}

.fortune-result {
  min-width: 104px;
  padding: 8px 9px 7px;
  font-size: 11px;
}

.fortune-result small {
  font-size: 5px;
}

/* Wider bamboo slips, all tucked inside the rim; no dangling right stick. */
.fortune-sticks i {
  width: 9px;
}

.fortune-sticks i::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 5px;
  left: 2px;
  width: 1px;
  background: rgba(107, 75, 42, .32);
}

.fortune-sticks i::after {
  font-size: 6px;
}

.fortune-sticks i:nth-child(1) {
  left: 5px;
  height: 38px;
  transform: rotate(-8deg);
}

.fortune-sticks i:nth-child(2) {
  left: 18px;
  height: 46px;
  transform: rotate(-4deg);
}

.fortune-sticks i:nth-child(3) {
  left: 31px;
  height: 42px;
  transform: rotate(1deg);
}

.fortune-sticks i:nth-child(4) {
  left: 44px;
  height: 48px;
  transform: rotate(6deg);
}

.fortune-sticks i:nth-child(5) {
  display: none;
}

/* Draw a long wooden fortune slip from the cup, with the wish written down it. */
.fortune-pop {
  display: none;
}

.fortune-results {
  right: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.fortune-draw {
  position: absolute;
  z-index: 6;
  bottom: 78px;
  left: 50%;
  display: flex;
  width: 40px;
  height: 214px;
  flex-direction: column;
  align-items: center;
  border: 2px solid #5d4328;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(93, 67, 40, .09) 8px 9px),
    linear-gradient(90deg, #dfc393, #f5e6c4 46%, #d3b17a);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .32);
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  animation: fortuneStickRise 3s steps(12, end) forwards;
}

.fortune-draw-head {
  display: grid;
  width: 100%;
  flex: 0 0 42px;
  place-items: center;
  border-bottom: 2px solid #5d4328;
  background: var(--tier, #a92f24);
  color: #f7e8ca;
  font-family: var(--px-cn);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .25);
}

.fortune-draw[data-tier="小吉"] .fortune-draw-head {
  color: #3a2a20;
  text-shadow: none;
}

.fortune-draw-head::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(40, 25, 18, .7);
  transform: translateX(-50%);
}

.fortune-draw-text {
  flex: 1;
  padding: 11px 0 8px;
  color: #3a2a20;
  font-family: var(--px-cn);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 4px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;
}

.fortune-draw-mark {
  padding-bottom: 7px;
  color: #6b4b2a;
  font-family: var(--px-en);
  font-size: 4px;
  letter-spacing: .06em;
  white-space: nowrap;
}

@keyframes fortuneStickRise {
  0% {
    opacity: 0;
    transform: translate(-50%, 72px) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  26% {
    opacity: 1;
    transform: translate(-50%, -2px) rotate(-4deg);
  }
  78% {
    opacity: 1;
    transform: translate(-50%, -5px) rotate(-4deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -48px) rotate(-7deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fortune-draw {
    animation: none;
  }
}

/* A short-visit retention prompt; the close control asks twice. */
.stay-modal {
  position: fixed;
  z-index: 2450;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  transition: opacity .2s steps(3, end);
}

.stay-modal[hidden] {
  display: none;
}

.stay-modal.is-open {
  opacity: 1;
}

.stay-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 28, 25, .86);
  backdrop-filter: blur(5px);
}

.stay-card {
  position: relative;
  z-index: 1;
  width: min(520px, 92vw);
  padding: 26px 26px 22px;
  border: 2px solid;
  border-color: var(--px-face-hi) var(--px-face-lo) var(--px-face-lo) var(--px-face-hi);
  background: var(--px-face);
  color: var(--px-ink);
  box-shadow: 8px 8px 0 var(--px-shadow);
}

.stay-modal.is-open .stay-card {
  animation: pxDialogIn .25s steps(4, end) both;
}

.stay-kicker {
  color: var(--px-red);
  font-family: var(--px-en);
  font-size: 6px;
  letter-spacing: .08em;
}

.stay-card h2 {
  margin-top: 14px;
  font-family: var(--px-cn);
  font-size: clamp(28px, 4.4vw, 42px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.03em;
}

.stay-card h2 em {
  color: var(--px-red);
  font-style: normal;
}

.stay-copy {
  max-width: 34ch;
  margin-top: 14px;
  color: #6b6250;
  font-family: var(--px-cn);
  font-size: 10px;
  line-height: 1.8;
}

.stay-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
}

.stay-keep,
.stay-close {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--px-ink);
  border-radius: 0;
  background: var(--px-ink);
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
}

.stay-keep:hover,
.stay-keep:focus-visible {
  background: var(--px-red);
  border-color: var(--px-red);
}

.stay-close {
  margin-left: auto;
  background: var(--px-face-hi);
  color: var(--px-ink);
}

.stay-close:hover,
.stay-close:focus-visible {
  background: var(--px-red);
  border-color: var(--px-red);
  color: var(--px-face-hi);
}

.stay-modal.is-armed .stay-close {
  background: var(--px-red);
  border-color: var(--px-red);
  color: var(--px-face-hi);
}

.stay-hint {
  margin-top: 10px;
  color: var(--px-red);
  font-family: var(--px-cn);
  font-size: 7px;
  text-align: right;
}

body.stay-open {
  overflow: hidden;
}

body.stay-open .paper-grain {
  display: none;
}

body.stay-open .cursor,
body.stay-open .cursor-tag {
  opacity: 0 !important;
  visibility: hidden;
}

@media (max-width: 520px) {
  .stay-card {
    padding: 20px 18px 18px;
  }

  .stay-close {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stay-modal,
  .stay-modal.is-open .stay-card {
    animation: none;
    transition: none;
  }
}

/* First confirmation snaps the card upward with a soft red flash. */
.stay-modal.is-armed .stay-card {
  animation: stayFlash .44s steps(4, end);
}

@keyframes stayFlash {
  0% { opacity: 1; transform: translateY(0); }
  22% { opacity: .48; transform: translateY(-8px); border-color: var(--px-red); }
  48% { opacity: 1; transform: translateY(-3px); border-color: var(--px-red); }
  72% { opacity: .78; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .stay-modal.is-armed .stay-card {
    animation: none;
  }
}

/* Keep the longer, softer stay-prompt headline readable. */
.stay-card h2 {
  font-size: clamp(23px, 3.3vw, 33px);
  line-height: 1.26;
}

.stay-card h2 em {
  display: block;
  margin-top: .18em;
  font-size: .82em;
  line-height: 1.45;
}

/* Stay prompt: text on the left, a pixelated pleading cat on the right. */
.stay-card {
  display: grid;
  width: min(660px, 94vw);
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 20px;
  align-items: center;
}

.stay-main {
  min-width: 0;
}

.stay-media {
  width: 100%;
  margin: 0;
  padding: 4px;
  border: 2px solid #5d4328;
  background: #e6d5b6;
  box-shadow: 4px 4px 0 var(--px-shadow);
  transform: rotate(1deg);
}

.stay-media img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #8d846d;
  image-rendering: pixelated;
}

@media (max-width: 560px) {
  .stay-card {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .stay-media {
    width: 118px;
    grid-row: 1;
    justify-self: end;
  }

  .stay-main {
    grid-row: 2;
  }
}

/* Full-coverage pixel subset so every character in the stay headline matches. */
@font-face {
  font-family: "Fusion Pixel Stay";
  src: url("../fonts/fusion-pixel-stay.woff2?v=2") format("woff2");
  font-display: swap;
  font-weight: 400;
}

.stay-card h2 {
  font-family: "Fusion Pixel Stay", var(--px-cn);
  font-synthesis: none;
}


.stay-card h2 em {
  font-family: "Fusion Pixel Stay", var(--px-cn);
}

/* Two navigation actions in the idle prompt. */
.stay-keep,
.stay-about {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--px-ink);
  border-radius: 0;
  background: var(--px-ink);
  color: var(--px-face-hi);
  font-family: var(--px-cn);
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
}

.stay-keep:hover,
.stay-keep:focus-visible,
.stay-about:hover,
.stay-about:focus-visible {
  background: var(--px-red);
  border-color: var(--px-red);
  color: var(--px-face-hi);
}

.stay-about {
  margin-left: auto;
  background: var(--px-face-hi);
  color: var(--px-ink);
}

.stay-about:hover,
.stay-about:focus-visible {
  color: var(--px-face-hi);
}

@media (max-width: 520px) {
  .stay-about {
    margin-left: 0;
  }
}

/* Keep the tenth capability full-width on the desktop three-column grid. */
@media (min-width: 601px) {
  .cap-list li:last-child {
    grid-column: 1 / -1;
  }
}


/* Mobile folder board: darken only the text, leaving surfaces and borders unchanged. */
@media (max-width: 600px) {
  .hero-entry {
    color: #111111 !important;
  }

  .hero-cell-name {
    color: #000000 !important;
  }

  .hero-cell-poke {
    color: #17130d !important;
  }

  .hero-cell-top {
    color: #2f291f !important;
  }

  .hero-board-head,
  .hero-board-foot,
  .hero-board-note,
  .hero-board-reset {
    color: #221e16 !important;
  }
}

/* Contact on phones: move the arrow beside the copy and trim vertical gaps. */
@media (max-width: 600px) {
  .contact-section {
    padding-top: 28px;
    padding-bottom: 18px;
  }

  .contact-grid {
    gap: 24px;
    margin-top: 28px;
  }

  .contact-copy {
    position: relative;
    padding-bottom: 2px;
  }

  .contact-lead {
    padding-right: 68px;
  }

  .contact-arrow {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 54px;
    height: 54px;
    margin-top: 0;
    font-size: 20px;
  }
}
