/* CHAPTER 02 · CREATION — black-and-white manga chapter.
   Paper, ink and screentone only; colour belongs to the works. */

@font-face {
  font-family: "MG Hei";
  src: url("./assets/creation/mg-hei.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MG Serif";
  src: url("./assets/creation/mg-serif.woff") format("woff");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MG Serif";
  src: url("./assets/creation/mg-serif-black.woff") format("woff");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EN Block";
  src: url("./assets/identity/en-block.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

.theme-space[data-theme="creation"] {
  --mg-paper: #f2efe7;
  --mg-paper-2: #e6e2d6;
  --mg-white: #fdfcf8;
  --mg-ink: #141414;
  --mg-ink-2: #2a2a2a;
  --mg-grey: #6f6b63;
  --mg-hei: "MG Hei", "EN Hei", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mg-block: "EN Block", Impact, "Arial Narrow Bold", sans-serif;
  --mg-serif: "MG Serif", "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --mg-text: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  --mg-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --mg-snap: cubic-bezier(0.2, 1.55, 0.35, 1);
  --mg-dots: radial-gradient(circle, var(--mg-ink) 0 1.05px, transparent 1.45px);
  background: var(--mg-paper);
}

.theme-space[data-theme="creation"] .theme-space__backdrop,
.theme-space[data-theme="creation"] .theme-heading {
  display: none;
}

.theme-space[data-theme="creation"] .theme-content {
  scrollbar-color: var(--mg-ink) transparent;
  scrollbar-width: thin;
}

.theme-space[data-theme="creation"] .theme-content::-webkit-scrollbar {
  width: 6px;
}

.theme-space[data-theme="creation"] .theme-content::-webkit-scrollbar-thumb {
  background: var(--mg-ink);
}

/* ---------- floating menu: an ink speech bubble ---------- */

.theme-space[data-theme="creation"] .fab {
  gap: 9px;
  transition: opacity 200ms ease;
}

.theme-space[data-theme="creation"].mg-viewer-open .fab {
  opacity: 0;
  pointer-events: none;
}

.theme-space[data-theme="creation"] .fab__trigger {
  width: 62px;
  height: 56px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  transition: transform 420ms var(--mg-snap);
}

/* an inked speech balloon: oval and tail are one outline */
.theme-space[data-theme="creation"] .fab__trigger::after {
  inset: -5px;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%27-5%20-5%2072%2066%27%3E%3Cpath%20d=%27M30%203.5C45%203.5%2056.5%2013%2056.5%2025C56.5%2031.5%2053.5%2037%2048.5%2040.8Q51.5%2047.5%2058.5%2052.5Q48.5%2050.5%2041.5%2045.2C38%2046.3%2034.2%2046.8%2030%2046.8C15.3%2046.8%203.5%2037.2%203.5%2025C3.5%2013%2015.3%203.5%2030%203.5Z%27%20fill=%27none%27%20stroke=%27%23141414%27%20stroke-width=%278.5%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M30%203.5C45%203.5%2056.5%2013%2056.5%2025C56.5%2031.5%2053.5%2037%2048.5%2040.8Q51.5%2047.5%2058.5%2052.5Q48.5%2050.5%2041.5%2045.2C38%2046.3%2034.2%2046.8%2030%2046.8C15.3%2046.8%203.5%2037.2%203.5%2025C3.5%2013%2015.3%203.5%2030%203.5Z%27%20fill=%27%23141414%27%20stroke=%27%23f2efe7%27%20stroke-width=%273%27%20stroke-linejoin=%27round%27/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  clip-path: none;
  opacity: 1;
  transform: none;
}

.theme-space[data-theme="creation"] .fab__trigger span {
  z-index: 1;
  top: 44.5%;
  left: 48.4%;
  width: 18px;
  height: 2.6px;
  margin: -1.3px 0 0 -9px;
  background: var(--mg-paper);
  transition: transform 380ms var(--mg-snap);
}

.theme-space[data-theme="creation"] .fab__trigger:hover {
  transform: scale(1.06) rotate(-5deg);
}

/* open: the balloon stays put, only the plus turns into a cross */
.theme-space[data-theme="creation"] .fab.is-open .fab__trigger {
  transform: scale(0.94);
  box-shadow: none;
}

.theme-space[data-theme="creation"] .fab.is-open .fab__trigger::after {
  opacity: 1;
  transform: none;
}

.theme-space[data-theme="creation"] .fab.is-open .fab__trigger span {
  transform: rotate(45deg);
}

.theme-space[data-theme="creation"] .fab.is-open .fab__trigger span:last-child {
  transform: rotate(135deg);
}

.theme-space[data-theme="creation"] .fab__actions button {
  gap: 8px;
  color: var(--mg-ink);
  box-shadow: none;
}

.theme-space[data-theme="creation"] .fab__actions i {
  width: 42px;
  height: 42px;
  border: 2.5px solid var(--mg-ink);
  border-radius: 50%;
  color: var(--mg-ink);
  background: var(--mg-white);
  box-shadow: 3px 3px 0 var(--mg-ink);
}

.theme-space[data-theme="creation"] .fab__actions button:hover i,
.theme-space[data-theme="creation"] .fab__actions button:focus-visible i {
  color: var(--mg-paper);
  background: var(--mg-ink);
}

.theme-space[data-theme="creation"] .fab__label {
  padding: 6px 14px 5px 11px;
  color: var(--mg-paper);
  background: var(--mg-ink);
  font-family: var(--mg-hei);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

/* ---------- root ---------- */

.mg {
  --mg-pad: clamp(16px, 3.4vw, 60px);
  --mg-pad-r: calc(var(--mg-pad) + 30px);
  --mg-gap: clamp(9px, 1.05vw, 16px);
  --mg-line: 3px;
  position: relative;
  min-height: 100%;
  overflow-x: clip;
  color: var(--mg-ink);
  background-color: var(--mg-paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  font-family: var(--mg-text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

:where(.mg) :is(h2, h3, h4, h5, p, ol, ul, dl, dd, figure) {
  margin: 0;
}

:where(.mg) :is(ol, ul) {
  padding: 0;
  list-style: none;
}

:where(.mg) button {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font: inherit;
  cursor: pointer;
}

.mg a {
  color: inherit;
}

.mg :focus-visible {
  outline: 3px solid var(--mg-ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--mg-paper);
}

.mg-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- speed lines when scrolling fast ---------- */

.mg-speed {
  --mg-speed: 0;
  position: fixed;
  z-index: 30;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--mg-speed);
}

.mg-speed span {
  position: absolute;
  top: -10%;
  width: clamp(70px, 13vw, 220px);
  height: calc(120% + 1120px);
  background-repeat: repeat;
  background-size: 220px 560px;
  will-change: transform;
}

.mg-speed span:first-child {
  left: 0;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent);
  mask-image: linear-gradient(90deg, #000, transparent);
}

.mg-speed span:last-child {
  right: 0;
  -webkit-mask-image: linear-gradient(270deg, #000, transparent);
  mask-image: linear-gradient(270deg, #000, transparent);
}

/* ---------- chapter thumb index on the page edge ---------- */

.mg-thumbs {
  position: fixed;
  z-index: 28;
  top: 50%;
  right: 0;
  display: grid;
  justify-items: end;
  gap: 6px;
  transform: translateY(-50%);
  transition: opacity 300ms ease, transform 420ms var(--mg-ease);
}

.mg[data-section="title"] .mg-thumbs,
.mg:not([data-section]) .mg-thumbs {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(30px, -50%);
  transition: opacity 300ms ease, transform 420ms var(--mg-ease), visibility 0s linear 420ms;
}

.mg-thumbs button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 34px;
  height: 44px;
  padding: 0 7px 0 0;
  overflow: hidden;
  color: var(--mg-paper);
  background: var(--mg-ink);
  clip-path: polygon(9px 0, 100% 0, 100% 100%, 0 100%);
  transition: width 360ms var(--mg-ease), background-color 200ms ease, color 200ms ease;
}

.mg-thumbs b {
  flex: 0 0 auto;
  font-family: var(--mg-block);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.mg-thumbs span {
  order: -1;
  flex: 0 0 auto;
  font-family: var(--mg-hei);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 200ms ease;
}

.mg-thumbs button[aria-current="true"] {
  width: 46px;
}

.mg-thumbs button:hover,
.mg-thumbs button:focus-visible {
  width: 128px;
}

.mg-thumbs button:hover span,
.mg-thumbs button:focus-visible span {
  opacity: 1;
}

.mg-thumbs button:focus-visible {
  outline: 3px solid var(--mg-paper);
  outline-offset: -6px;
  box-shadow: none;
}

.mg[data-tone="night"] .mg-thumbs button {
  color: var(--mg-ink);
  background: var(--mg-paper);
}

.mg[data-tone="night"] .mg-thumbs button:focus-visible {
  outline-color: var(--mg-ink);
}

/* ---------- panel: clipped body + inked frame ---------- */

.mg-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.mg-panel__body {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--mg-paper);
}

.mg-panel__ink {
  position: relative;
  height: 100%;
}

.mg-panel__frame {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.mg-panel__frame polygon {
  fill: none;
  stroke: var(--mg-ink);
  stroke-width: var(--mg-line);
  stroke-linejoin: miter;
  stroke-dasharray: 1 0;
}

.mg-panel--ink .mg-panel__body {
  background: var(--mg-ink);
}

/* frames draw first, then the panel prints */
.mg:not(.is-entered):not(.is-entering) .mg-title .mg-panel__frame polygon,
.mg-page .mg-panel:not(.is-inked) .mg-panel__frame polygon {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}

.mg-page .mg-panel:not(.is-inked) .mg-panel__ink {
  clip-path: inset(0 100% 0 0);
}

.mg-page .mg-panel.is-inked .mg-panel__frame polygon {
  stroke-dasharray: 1 1;
  animation: mg-draw 560ms cubic-bezier(0.55, 0.1, 0.25, 1) var(--ink-delay, 0ms) both;
}

.mg-page .mg-panel.is-inked .mg-panel__ink {
  animation: mg-print 520ms cubic-bezier(0.7, 0, 0.2, 1) calc(var(--ink-delay, 0ms) + 260ms) both;
}

@keyframes mg-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes mg-print {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* ---------- media: screentone print, colour bleeds in when read ---------- */

.mg-media {
  --mg-x: 50%;
  --mg-y: 50%;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--mg-paper);
}

.mg-panel--ink .mg-media {
  background: var(--mg-ink);
}

.mg-media__tone,
.mg-media__color {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: var(--fit, cover);
  object-position: var(--pos, 50% 50%);
  user-select: none;
  -webkit-user-drag: none;
}

.mg-media__color {
  clip-path: circle(0 at var(--mg-x) var(--mg-y));
  transition: clip-path 620ms cubic-bezier(0.5, 0, 0.75, 0);
}

.mg-media.is-lit .mg-media__color {
  clip-path: circle(150% at var(--mg-x) var(--mg-y));
  transition: clip-path 1100ms cubic-bezier(0.22, 0.9, 0.2, 1);
}

.mg-media__ring {
  position: absolute;
  z-index: 1;
  top: var(--mg-y);
  left: var(--mg-x);
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
  border: 2px solid var(--mg-ink);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.mg-panel--ink .mg-media__ring {
  border-color: var(--mg-paper);
}

.mg-media.is-lit .mg-media__ring {
  animation: mg-ring 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes mg-ring {
  0% {
    opacity: 1;
    transform: scale(0.04);
  }
  100% {
    opacity: 0;
    transform: scale(4.2);
  }
}

.mg-media__rec {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  border: 2.5px solid var(--mg-paper);
  border-radius: 50%;
  background: var(--mg-ink);
  pointer-events: none;
  transition: transform 360ms var(--mg-snap), opacity 240ms ease;
}

.mg-media__rec::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--mg-paper);
  transform: translate(-50%, -50%);
}

.mg-media.is-lit .mg-media__rec {
  opacity: 0;
  transform: scale(0.4);
}

.mg-media__open,
.mg-cell__open {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.mg-media__open:focus-visible,
.mg-cell__open:focus-visible {
  outline: 3px solid var(--mg-ink);
  outline-offset: -8px;
  box-shadow: inset 0 0 0 11px var(--mg-paper);
}

/* ---------- shared lettering ---------- */

.mg-tag {
  display: inline-flex;
  align-items: stretch;
  font-family: var(--mg-hei);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.mg-tag b {
  display: grid;
  place-items: center;
  min-width: 38px;
  padding: 6px 8px 5px;
  color: var(--mg-paper);
  background: var(--mg-ink);
  font-family: var(--mg-block);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.mg-tag span {
  display: grid;
  place-items: center;
  padding: 6px 10px 5px;
  border: 2px solid var(--mg-ink);
  border-left: 0;
  background: var(--mg-white);
  letter-spacing: 0.08em;
}

.mg-box {
  position: relative;
  padding: 0.62em 0.95em 0.66em;
  border: 2px solid var(--mg-ink);
  background: var(--mg-white);
  box-shadow: 4px 4px 0 var(--mg-ink);
  font-weight: 600;
}

.mg-bubble {
  --tail: 118;
  --lean: 14;
  --bend: 1;
  position: relative;
  display: inline-grid;
  place-items: center;
  max-width: 100%;
  padding: 1em 1.45em;
  border: 2.5px solid var(--mg-ink);
  border-radius: 50%;
  background: var(--mg-white);
  font-family: var(--mg-hei);
  font-weight: 900;
  line-height: 1.38;
  text-align: center;
}

.mg-bubble span {
  position: relative;
  z-index: 1;
  text-wrap: balance;
}

/* the balloon itself is drawn as one inked path (oval + tail) by the script */
.mg-bubble.has-shape {
  border-color: transparent;
  background: none;
}

.mg-bubble__shape {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

.mg-bubble__shade {
  fill: var(--mg-ink);
}

.mg-bubble__body {
  fill: var(--mg-white);
  stroke: var(--mg-ink);
  stroke-width: 2.6;
  stroke-linejoin: round;
}

.mg-bubble--reply {
  --tail: 62;
  --lean: -14;
  --bend: -1;
}

.mg-caption {
  position: absolute;
  z-index: 2;
  top: var(--c-tly, 0px);
  left: var(--c-lt, var(--c-tlx, 0px));
  display: flex;
  align-items: center;
  max-width: calc(100% - 28px);
  padding-right: 22px;
  color: var(--mg-paper);
  background: var(--mg-ink);
  font-family: var(--mg-hei);
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: 0.04em;
  pointer-events: none;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.mg-caption b {
  display: grid;
  place-items: center;
  align-self: stretch;
  margin-right: 10px;
  padding: 7px 8px 6px 12px;
  border-right: 2px solid var(--mg-paper);
  font-family: var(--mg-block);
  font-size: 14px;
  font-weight: 400;
}

.mg-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mg-stack li {
  padding: 4px 9px 3px;
  border: 1.5px solid var(--mg-ink);
  background: var(--mg-paper);
  font-family: var(--mg-block);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.mg-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.mg-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 8px 14px;
  color: var(--mg-paper);
  background: var(--mg-ink);
  font-family: var(--mg-hei);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  transition: transform 260ms var(--mg-snap), background-color 160ms ease;
}

.mg-links a span {
  font-family: var(--mg-text);
  font-weight: 700;
}

/* the "opens elsewhere" arrow and the video mark are small drawings */
.mg-out {
  display: block;
  width: 0.8em;
  height: 0.8em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.mg-play {
  display: block;
  width: 0.8em;
  height: 0.8em;
  fill: currentColor;
}

.mg-links a:hover {
  transform: translateX(4px) skewX(-6deg);
}

.mg-links a:focus-visible {
  outline-offset: 4px;
}

/* ---------- title spread ---------- */

.mg-title {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: max(620px, 100svh);
  padding: 16px var(--mg-pad-r) 20px var(--mg-pad);
}

.mg-title__kicker {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--mg-block);
  line-height: 1;
}

.mg-title__kicker span {
  font-size: 14px;
  letter-spacing: 0.32em;
}

.mg-title__kicker b {
  font-size: 30px;
  font-weight: 400;
  color: var(--mg-paper);
  -webkit-text-stroke: 3px var(--mg-ink);
  paint-order: stroke fill;
}

.mg-title__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) clamp(112px, 16.5vh, 164px);
  gap: var(--mg-gap);
}

.mg-title__splash {
  grid-column: 1 / 13;
  grid-row: 1;
  --cuty: 0 0 0 2.6;
}

.mg-focus {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.mg-title__tone {
  position: absolute;
  inset: 0 0 52% 0;
  background-image: var(--mg-dots);
  background-size: 7px 7px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 100%);
  opacity: 0.75;
}

.mg-title__name {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.mg-title__han {
  position: absolute;
  top: 5%;
  left: 3.2%;
  display: flex;
  flex-direction: column;
  font-family: var(--mg-hei);
  font-size: clamp(96px, min(15.5vh, 13vw), 200px);
  font-weight: 900;
  line-height: 0.92;
  -webkit-text-stroke: 0.09em var(--mg-paper);
  paint-order: stroke fill;
}

.mg-title__han i {
  display: block;
  font-style: normal;
}

.mg-title__han i:last-child {
  margin-left: 0.34em;
}

.mg-title__latin {
  position: absolute;
  bottom: calc(var(--c-bly, 80px) + 2.4%);
  left: 2.6%;
  font-family: var(--mg-block);
  font-size: clamp(64px, min(12.5vw, 19vh), 210px);
  line-height: 0.8;
  letter-spacing: -0.005em;
  color: var(--mg-ink);
  -webkit-text-stroke: 0.06em var(--mg-paper);
  paint-order: stroke fill;
  transform: rotate(var(--edge-b, 0deg)) skewX(-8deg);
  transform-origin: 0 100%;
}

.mg-title__bubble {
  position: absolute;
  z-index: 6;
  top: 9%;
  left: 39%;
  font-size: clamp(17px, 1.6vw, 26px);
  transform: rotate(-3deg);
}

.mg-title__bubble {
  --tail: 10;
  --lean: 12;
}

.mg-title__hero {
  position: absolute;
  z-index: 5;
  right: 1.5%;
  bottom: calc(clamp(112px, 16.5vh, 164px) + var(--mg-gap) - 6px);
  width: auto;
  height: calc(100% - clamp(112px, 16.5vh, 164px) - var(--mg-gap) + 9%);
  aspect-ratio: 1222 / 1287;
  pointer-events: none;
}

.mg-title__hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
}

.mg-title__index {
  grid-column: 1 / 13;
  grid-row: 2;
  margin-top: calc(-2.6 * var(--mg-s, 37px));
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--mg-gap);
}

.mg-title__slot {
  grid-row: 1;
}

.mg-title__slot--1 {
  grid-column: 1 / 5;
  --cut: 0 0 1 0;
  --cuty: 0 0.867 0 0;
}

.mg-title__slot--2 {
  grid-column: 5 / 9;
  --cut: 1 0 1 0;
  --cuty: 0.867 1.733 0 0;
}

.mg-title__slot--3 {
  grid-column: 9 / 13;
  --cut: 1 0 0 0;
  --cuty: 1.733 2.6 0 0;
}

.mg-title__slot--1 .mg-panel__body {
  background: var(--mg-ink);
}

.mg-title__slot--2 .mg-panel__body {
  background-color: var(--mg-paper);
  background-image: var(--mg-dots);
  background-size: 6px 6px;
}

.mg-title__slot--3 .mg-panel__body {
  background-color: var(--mg-paper);
  background-image: repeating-linear-gradient(90deg, transparent 0 9px, rgba(20, 20, 20, 0.85) 9px 10.5px, transparent 10.5px 15px, rgba(20, 20, 20, 0.55) 15px 16px, transparent 16px 26px);
}

.mg-title__jump {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto auto auto;
  align-items: end;
  column-gap: 14px;
  width: 100%;
  height: 100%;
  padding: 14px 26px 14px 22px;
  text-align: left;
  transition: transform 320ms var(--mg-snap);
}

.mg-title__jump b {
  grid-row: 1 / 5;
  align-self: end;
  margin-bottom: -0.04em;
  font-family: var(--mg-block);
  font-size: clamp(52px, min(6vw, 9vh), 92px);
  font-weight: 400;
  line-height: 0.8;
  color: var(--mg-paper);
  -webkit-text-stroke: 4px var(--mg-ink);
  paint-order: stroke fill;
}

.mg-title__slot--1 .mg-title__jump b {
  color: var(--mg-ink);
  -webkit-text-stroke-color: var(--mg-paper);
}

.mg-title__jump strong {
  grid-column: 2;
  grid-row: 3;
  justify-self: start;
  align-self: end;
  font-family: var(--mg-hei);
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 900;
  line-height: 1.05;
}

.mg-title__jump small {
  grid-column: 2;
  grid-row: 4;
  justify-self: start;
  font-family: var(--mg-block);
  font-size: 11px;
  letter-spacing: 0.22em;
}

.mg-title__jump em {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  margin-bottom: 6px;
  font-family: var(--mg-hei);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.mg-title__slot--1 .mg-title__jump {
  color: var(--mg-paper);
}

.mg-title__slot--2 .mg-title__jump strong,
.mg-title__slot--3 .mg-title__jump strong,
.mg-title__slot--2 .mg-title__jump small,
.mg-title__slot--3 .mg-title__jump small,
.mg-title__slot--2 .mg-title__jump em,
.mg-title__slot--3 .mg-title__jump em {
  padding: 2px 6px;
  background: var(--mg-paper);
}

.mg-title__jump:hover {
  transform: translateX(6px);
}

.mg-title__jump:focus-visible {
  outline-offset: -9px;
  box-shadow: inset 0 0 0 12px transparent;
}

/* entrance: ink lines → tone → he breaks the frame → title stamps */
.mg.is-entering .mg-title .mg-panel__frame polygon {
  stroke-dasharray: 1 1;
  animation: mg-draw 640ms cubic-bezier(0.55, 0.1, 0.25, 1) both;
}

.mg.is-entering .mg-title__slot--1 .mg-panel__frame polygon {
  animation-delay: 180ms;
}

.mg.is-entering .mg-title__slot--2 .mg-panel__frame polygon {
  animation-delay: 260ms;
}

.mg.is-entering .mg-title__slot--3 .mg-panel__frame polygon {
  animation-delay: 340ms;
}

.mg.is-entering .mg-title__tone {
  animation: mg-tone 700ms cubic-bezier(0.6, 0, 0.2, 1) 300ms both;
}

@keyframes mg-tone {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.mg.is-entering .mg-focus[data-mg-focus="title"] {
  animation: mg-flash 520ms steps(1, end) 760ms both;
}

@keyframes mg-flash {
  0% {
    opacity: 0;
  }
  1% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

.mg.is-entering .mg-title__hero img {
  animation: mg-slam 620ms cubic-bezier(0.2, 1.4, 0.35, 1) 760ms both;
}

@keyframes mg-slam {
  0% {
    opacity: 0;
    transform: translate3d(0, 16%, 0) scale(1.08);
  }
  1% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.mg.is-entering .mg-title__grid {
  animation: mg-shake 260ms steps(4, end) 780ms;
}

@keyframes mg-shake {
  0% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(-6px, 3px, 0);
  }
  50% {
    transform: translate3d(5px, -4px, 0);
  }
  75% {
    transform: translate3d(-3px, 2px, 0);
  }
  100% {
    transform: none;
  }
}

.mg.is-entering .mg-title__han i {
  animation: mg-stamp 420ms cubic-bezier(0.3, 1.6, 0.45, 1) both;
}

.mg.is-entering .mg-title__han i:first-child {
  animation-delay: 1000ms;
}

.mg.is-entering .mg-title__han i:last-child {
  animation-delay: 1130ms;
}

@keyframes mg-stamp {
  0% {
    opacity: 0;
    transform: scale(1.9) rotate(-6deg);
  }
  1% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.mg.is-entering .mg-title__latin {
  animation: mg-dash 520ms cubic-bezier(0.16, 1, 0.3, 1) 1220ms both;
}

@keyframes mg-dash {
  0% {
    clip-path: inset(0 100% 0 0);
    transform: rotate(var(--edge-b, 0deg)) skewX(-24deg) translateX(-6%);
  }
  100% {
    clip-path: inset(0 0 0 0);
    transform: rotate(var(--edge-b, 0deg)) skewX(-8deg);
  }
}

.mg.is-entering .mg-title__bubble {
  animation: mg-pop 420ms var(--mg-snap) 1560ms both;
}

@keyframes mg-pop {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-3deg);
  }
  1% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(-3deg);
  }
}

.mg.is-entering .mg-title__jump {
  animation: mg-cut 420ms cubic-bezier(0.7, 0, 0.2, 1) both;
}

.mg.is-entering .mg-title__slot--1 .mg-title__jump {
  animation-delay: 1380ms;
}

.mg.is-entering .mg-title__slot--2 .mg-title__jump {
  animation-delay: 1480ms;
}

.mg.is-entering .mg-title__slot--3 .mg-title__jump {
  animation-delay: 1580ms;
}

@keyframes mg-cut {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* ---------- chapter headers ---------- */

.mg-chapter {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 0 clamp(14px, 2vw, 30px);
  max-width: 1560px;
  margin: 0 auto;
  padding: clamp(64px, 11vh, 140px) var(--mg-pad-r) clamp(18px, 2.6vh, 30px) var(--mg-pad);
}

.mg-chapter::after {
  content: "";
  position: absolute;
  right: var(--mg-pad-r);
  bottom: 8px;
  left: var(--mg-pad);
  height: 5px;
  background: var(--mg-ink);
  clip-path: polygon(0 0, 100% 40%, 100% 100%, 0 100%);
}

.mg-chapter__no {
  font-family: var(--mg-block);
  font-size: clamp(88px, 12vw, 196px);
  line-height: 0.74;
  color: var(--mg-paper);
  -webkit-text-stroke: 6px var(--mg-ink);
  paint-order: stroke fill;
  transform: translateY(0.06em);
}

.mg-chapter__title {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  font-family: var(--mg-hei);
  font-size: clamp(40px, 5.4vw, 88px);
  font-weight: 900;
  line-height: 0.95;
}

.mg-chapter__title small {
  font-family: var(--mg-block);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.34em;
}

.mg-chapter__aside {
  display: grid;
  justify-items: end;
  gap: 10px;
  padding-bottom: 18px;
  text-align: right;
}

.mg-chapter__count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mg-hei);
  font-weight: 900;
}

.mg-chapter__count b {
  font-family: var(--mg-block);
  font-size: clamp(44px, 4.4vw, 72px);
  font-weight: 400;
  line-height: 0.8;
}

.mg-specs {
  display: grid;
  gap: 6px;
}

.mg-specs div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.mg-chapter__aside .mg-specs div {
  justify-content: flex-end;
}

.mg-specs dt {
  padding: 3px 8px 2px;
  color: var(--mg-paper);
  background: var(--mg-ink);
  font-family: var(--mg-hei);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.mg-specs dd {
  margin: 0;
  font-weight: 700;
}

/* ---------- pages ---------- */

.mg-page {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--mg-gap);
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 var(--mg-pad-r) clamp(56px, 9vh, 110px) var(--mg-pad);
}

.mg-head .mg-panel__ink,
.mg-story .mg-panel__ink,
.mg-list .mg-panel__ink {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: clamp(20px, 2.4vw, 36px) clamp(24px, 3vw, 48px);
}

.mg-head .mg-panel__body {
  background-color: var(--mg-paper);
  background-image: radial-gradient(circle, rgba(20, 20, 20, 0.9) 0 1px, transparent 1.4px);
  background-size: 6px 6px;
}

.mg-head .mg-panel__ink {
  align-content: space-between;
  background: linear-gradient(180deg, var(--mg-paper) 0%, var(--mg-paper) 46%, rgba(242, 239, 231, 0.78) 72%, rgba(242, 239, 231, 0) 100%);
}

.mg-head__name {
  font-family: var(--mg-hei);
  font-size: clamp(42px, 4.6vw, 84px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.01em;
}

.mg-head__en {
  margin-top: -6px;
  font-family: var(--mg-block);
  font-size: clamp(13px, 1.1vw, 17px);
  letter-spacing: 0.24em;
}

.mg-head__type {
  justify-self: start;
  font-family: var(--mg-hei);
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 900;
}

.mg-story__line {
  max-width: 34em;
  font-size: 15px;
  line-height: 1.75;
}

.mg-story__meta {
  font-family: var(--mg-hei);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.mg-story .mg-panel__body {
  background-color: var(--mg-paper);
}

/* page 1 · 人生未定式 */

.mg-p1 {
  grid-template-rows: minmax(400px, 62vh) minmax(200px, 29vh) minmax(320px, auto);
}

.mg-p1__hero {
  grid-column: 1 / 9;
  grid-row: 1;
  --cut: 0 0 1 0;
}

.mg-p1__head {
  grid-column: 9 / 13;
  grid-row: 1;
  --cut: 1 0 0 0;
}

.mg-p1__bubble {
  justify-self: start;
  margin: 4px 0 20px 6px;
  font-size: clamp(17px, 1.5vw, 24px);
  transform: rotate(-2deg);
}

.mg-p1__board--1 {
  grid-column: 1 / 4;
  grid-row: 2;
  --cut: 0 0 1 0;
}

.mg-p1__board--2 {
  grid-column: 4 / 7;
  grid-row: 2;
  --cut: 1 1 0 0;
}

.mg-p1__board--3 {
  grid-column: 7 / 10;
  grid-row: 2;
  --cut: 0 0 1 1;
}

.mg-p1__board--4 {
  grid-column: 10 / 13;
  grid-row: 2;
  --cut: 1 0 0 0;
}

.mg-p1__story {
  grid-column: 1 / 9;
  grid-row: 3;
  --cut: 0 1 0 0;
}

.mg-p1__story .mg-panel__ink {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 22px;
  align-content: center;
}

.mg-p1__story .mg-story__line--1 {
  grid-column: 1 / 3;
  justify-self: start;
  font-family: var(--mg-hei);
  font-size: clamp(18px, 1.7vw, 26px);
  font-weight: 900;
  line-height: 1.4;
}

.mg-p1__story .mg-story__line--2 {
  grid-column: 1 / 3;
  max-width: 46em;
  margin-left: clamp(0px, 4vw, 60px);
}

.mg-p1__story .mg-story__line--3 {
  transform: rotate(-0.6deg);
}

.mg-p1__story .mg-story__line--4 {
  align-self: center;
  justify-self: start;
  font-family: var(--mg-hei);
  font-weight: 900;
  color: var(--mg-paper);
  background: var(--mg-ink);
  box-shadow: 4px 4px 0 rgba(20, 20, 20, 0.28);
  transform: rotate(0.8deg);
}

.mg-p1__story .mg-story__meta,
.mg-p1__story .mg-stack,
.mg-p1__story .mg-links {
  grid-column: 1 / 3;
}

.mg-p1__phone {
  grid-column: 9 / 13;
  grid-row: 3;
  --cut: 0 0 0 1;
}

.mg-p1__phone .mg-panel__body {
  background-color: var(--mg-paper);
  background-image: radial-gradient(circle, rgba(20, 20, 20, 0.88) 0 1px, transparent 1.4px);
  background-size: 6px 6px;
}

.mg-phone {
  position: absolute;
  top: 12%;
  left: 54%;
  height: 112%;
  aspect-ratio: 780 / 1688;
  overflow: hidden;
  border: 6px solid var(--mg-ink);
  border-radius: 30px;
  background: var(--mg-ink);
  box-shadow: 12px 12px 0 var(--mg-ink);
  transform: translateX(-50%) rotate(-8deg);
  transform-origin: 50% 0;
}

.mg-phone .mg-media {
  border-radius: 22px;
}

.mg-p1__mobile {
  position: absolute;
  z-index: 3;
  top: calc(var(--c-tly, 0px) + 18px);
  left: calc(var(--c-blx, 0px) + 18px);
  font-family: var(--mg-hei);
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 900;
  transform: rotate(-3deg);
}

.mg-p1__last {
  position: absolute;
  z-index: 4;
  right: 6%;
  bottom: calc(var(--c-bry, 0px) + 7%);
  padding: 0.9em 1.2em;
  font-size: clamp(12px, 1vw, 15px);
  transform: rotate(3deg);
}

.mg-bubble--tail-down {
  --tail: -104;
  --lean: -10;
}

/* page 2 · 人生轨迹对比 */

.mg-p2 {
  grid-template-rows: minmax(380px, 58vh) minmax(300px, auto) auto;
}

.mg-p2__head {
  grid-column: 1 / 5;
  grid-row: 1;
  --cut: 0 1 0 0;
}

.mg-p2__video {
  grid-column: 5 / 13;
  grid-row: 1;
  --cut: 0 0 0 1;
}

.mg-p2__bubble {
  justify-self: stretch;
  margin-bottom: 18px;
  padding: 1.4em 1.9em;
  font-size: clamp(13px, 1.02vw, 16px);
  line-height: 1.55;
}

.mg-p2__cast {
  grid-column: 1 / 4;
  grid-row: 2;
  --cut: 0 0 1 0;
}

.mg-p2__metrics {
  grid-column: 4 / 8;
  grid-row: 2;
  --cut: 1 0 1 0;
}

.mg-p2__people {
  grid-column: 8 / 13;
  grid-row: 2;
  --cut: 1 0 0 0;
}

.mg-p2__story {
  grid-column: 1 / 13;
  grid-row: 3;
}

.mg-p2__story .mg-panel__ink {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 26px;
}

.mg-p2__story .mg-story__line:first-child {
  font-family: var(--mg-hei);
  font-size: clamp(16px, 1.4vw, 21px);
  font-weight: 900;
  line-height: 1.45;
}

.mg-p2__story .mg-stack {
  grid-column: 1 / 3;
}

.mg-p2__story .mg-links {
  grid-column: 3;
  grid-row: 1 / 3;
  justify-content: flex-end;
}

.mg-list__title {
  justify-self: start;
  padding: 6px 12px 5px;
  color: var(--mg-paper);
  background: var(--mg-ink);
  font-family: var(--mg-hei);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.1em;
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  padding-right: 20px;
}

.mg-metrics {
  display: grid;
  gap: 9px;
}

.mg-metrics li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 10px;
  align-items: baseline;
}

.mg-metrics b {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--mg-ink);
  border-radius: 50%;
  font-family: var(--mg-block);
  font-size: 13px;
  font-weight: 400;
}

.mg-metrics strong {
  font-family: var(--mg-hei);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.mg-metrics span {
  color: var(--mg-ink-2);
  font-size: 12.5px;
  line-height: 1.5;
}

.mg-p2__cast .mg-panel__body {
  background: var(--mg-ink);
  color: var(--mg-paper);
}

.mg-p2__cast .mg-list__title {
  color: var(--mg-ink);
  background: var(--mg-paper);
}

.mg-cast {
  display: grid;
  gap: 2px;
}

.mg-cast li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0 6px;
  border-bottom: 1.5px solid rgba(242, 239, 231, 0.28);
  font-family: var(--mg-hei);
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 900;
  line-height: 1.2;
}

.mg-cast b {
  font-family: var(--mg-block);
  font-size: 12px;
  font-weight: 400;
  opacity: 0.7;
}

/* page 3 · 黑洞音乐播放器 */

.mg-p3 {
  grid-template-rows: minmax(400px, 66vh) minmax(230px, auto);
}

.mg-p3__video {
  grid-column: 1 / 13;
  grid-row: 1;
  --cuty: 0 0 0 2.2;
}

.mg-p3__plate {
  position: absolute;
  z-index: 4;
  top: clamp(18px, 3vh, 34px);
  left: clamp(18px, 2.4vw, 36px);
  display: grid;
  justify-items: start;
  gap: 10px;
  pointer-events: none;
}

.mg-p3__plate .mg-head__name {
  padding: 8px 16px 10px;
  border: 2.5px solid var(--mg-ink);
  background: var(--mg-white);
  box-shadow: 5px 5px 0 var(--mg-ink);
  font-size: clamp(30px, 3.4vw, 58px);
}

.mg-p3__latin {
  position: absolute;
  z-index: 4;
  right: clamp(16px, 2vw, 32px);
  bottom: clamp(26px, 6vh, 64px);
  font-family: var(--mg-block);
  font-size: clamp(48px, 9vw, 150px);
  line-height: 0.8;
  color: var(--mg-ink);
  -webkit-text-stroke: 6px var(--mg-paper);
  paint-order: stroke fill;
  transform: skewX(-10deg);
  pointer-events: none;
}

.mg-p3__shot--1 {
  grid-column: 1 / 4;
  grid-row: 2;
  --cuty: 0 0.55 0 0;
}

.mg-p3__shot--2 {
  grid-column: 4 / 7;
  grid-row: 2;
  --cuty: 0.55 1.1 0 0;
}

.mg-p3__shot--3 {
  grid-column: 7 / 10;
  grid-row: 2;
  --cuty: 1.1 1.65 0 0;
}

.mg-p3__story {
  grid-column: 10 / 13;
  grid-row: 2;
  --cuty: 1.65 2.2 0 0;
}

.mg-p3__story .mg-panel__ink {
  padding-top: calc(var(--c-top, 40px) + 18px);
  gap: 12px;
}

.mg-p3__count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--mg-hei);
  font-weight: 900;
  line-height: 0.8;
}

.mg-p3__count b {
  font-family: var(--mg-block);
  font-size: clamp(64px, 6.6vw, 112px);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.mg-p3__count span {
  font-size: clamp(30px, 3vw, 48px);
}

.mg-p3__count small {
  margin-left: 8px;
  padding: 4px 8px 3px;
  color: var(--mg-paper);
  background: var(--mg-ink);
  font-size: 14px;
  letter-spacing: 0.1em;
  align-self: center;
}

.mg-p3__story .mg-box {
  font-size: 14px;
  line-height: 1.7;
}

/* page 4 · montage of the other works */

.mg-p4 {
  grid-template-rows: minmax(300px, 42vh) minmax(260px, 34vh) minmax(240px, 32vh);
}

.mg-p4__air {
  grid-column: 1 / 6;
  grid-row: 1;
  --cut: 0 0 1 0;
}

.mg-p4__avant {
  grid-column: 6 / 13;
  grid-row: 1;
  --cut: 1 0 0 0;
}

.mg-p4__emt {
  grid-column: 1 / 5;
  grid-row: 2;
  --cut: 0 1 0 0;
}

.mg-p4__recaply {
  grid-column: 5 / 9;
  grid-row: 2;
  --cut: 0 0 1 1;
}

.mg-p4__mori {
  grid-column: 9 / 13;
  grid-row: 2;
  --cut: 1 0 0 0;
}

.mg-p4__site {
  grid-column: 1 / 8;
  grid-row: 3;
  --cut: 0 1 0 0;
}

.mg-p4__chat {
  grid-column: 8 / 13;
  grid-row: 3;
  --cut: 0 0 0 1;
}

.mg-plate {
  position: absolute;
  z-index: 2;
  bottom: var(--c-bly, 0px);
  left: var(--c-blx, 0px);
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  max-width: calc(100% - 24px);
  padding: 10px 26px 9px 12px;
  border-top: 2.5px solid var(--mg-ink);
  border-right: 2.5px solid var(--mg-ink);
  background: var(--mg-white);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
  pointer-events: none;
  transition: transform 300ms var(--mg-snap);
}

.mg-plate b {
  grid-row: 1 / 3;
  font-family: var(--mg-block);
  font-size: clamp(28px, 2.6vw, 42px);
  font-weight: 400;
  line-height: 0.8;
  color: var(--mg-white);
  -webkit-text-stroke: 3px var(--mg-ink);
  paint-order: stroke fill;
}

.mg-plate strong {
  font-family: var(--mg-block);
  font-size: clamp(17px, 1.5vw, 24px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
}

.mg-plate small {
  justify-self: start;
  padding: 2px 6px 1px;
  color: var(--mg-paper);
  background: var(--mg-ink);
  font-family: var(--mg-hei);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.mg-p4__cell:hover .mg-plate,
.mg-p4__cell:focus-within .mg-plate {
  transform: translate(4px, -4px);
}

.mg-chat .mg-panel__body {
  background-color: var(--mg-paper);
  background-image: radial-gradient(circle, rgba(20, 20, 20, 0.85) 0 0.9px, transparent 1.3px);
  background-size: 5px 5px;
}

.mg-chat__talk {
  position: absolute;
  inset: 0 0 52px 0;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px clamp(20px, 2.6vw, 40px) 10px clamp(30px, 3.2vw, 52px);
}

.mg-chat__ask {
  justify-self: start;
  font-size: clamp(16px, 1.4vw, 21px);
}

.mg-chat__pick {
  justify-self: end;
  max-width: 90%;
  padding: 0.95em 1.75em;
  border-radius: 38% / 50%;
  font-size: clamp(11.5px, 0.9vw, 13.5px);
  font-weight: 700;
  text-align: left;
}

.mg-chat__pick b {
  display: block;
  font-size: 1.22em;
  font-weight: 900;
}

.mg-chat__pick--1 {
  margin-right: 8%;
}

.mg-chat:not(.is-talking) .mg-chat__talk > * {
  opacity: 0;
  transform: scale(0.4);
}

.mg-chat.is-talking .mg-chat__talk > * {
  animation: mg-pop-in 460ms var(--mg-snap) both;
}

.mg-chat.is-talking .mg-chat__pick--1 {
  animation-delay: 520ms;
}

.mg-chat.is-talking .mg-chat__pick--2 {
  animation-delay: 900ms;
}

@keyframes mg-pop-in {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  1% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* page 5 · 《无解的遗憾》 */

.mg-p5 {
  grid-template-rows: minmax(max(420px, 66vh), auto) auto;
}

.mg-p5__cover {
  grid-column: 1 / 6;
  grid-row: 1;
  --cut: 0 0 1 0;
}

.mg-cover__color,
.mg-cover__tone {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mg-cover__tone {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Ccircle cx='22' cy='22' r='19' fill='none' stroke='%23141414' stroke-width='2.5'/%3E%3Ccircle cx='22' cy='22' r='15' fill='none' stroke='%23f2efe7' stroke-width='2'/%3E%3C/svg%3E") 22 22, crosshair;
  touch-action: pan-y;
  opacity: 0;
  transition: opacity 300ms ease;
}

.mg-cover__tone.is-ready {
  opacity: 1;
}

.mg-p5__voice {
  grid-column: 6 / 13;
  grid-row: 1;
  --cut: 1 0 0 0;
}

.mg-p5__voice .mg-panel__body {
  background-color: var(--mg-paper);
  background-image: radial-gradient(circle, rgba(20, 20, 20, 0.9) 0 1px, transparent 1.4px);
  background-size: 7px 7px;
}

.mg-p5__voice .mg-panel__ink {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: clamp(22px, 3vh, 40px) clamp(22px, 2.8vw, 46px) clamp(22px, 3vh, 40px) clamp(48px, 5vw, 80px);
  background: linear-gradient(90deg, rgba(242, 239, 231, 0) 0%, rgba(242, 239, 231, 0.85) 32%, var(--mg-paper) 60%);
}

.mg-p5__name {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: start;
  justify-self: end;
  font-family: var(--mg-serif);
  font-size: clamp(40px, min(4.8vw, 7vh), 80px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: 0.04em;
  writing-mode: vertical-rl;
  -webkit-text-stroke: 0.08em var(--mg-paper);
  paint-order: stroke fill;
}

.mg-p5__tags {
  grid-column: 2;
  grid-row: 3;
  justify-self: end;
  align-self: end;
  padding: 3px 8px;
  color: var(--mg-paper);
  background: var(--mg-ink);
  font-family: var(--mg-hei);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.mg-voice {
  grid-column: 1;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 18px clamp(8px, 1.1vw, 18px);
  min-width: 0;
  padding-top: 4px;
}

.mg-voice__box {
  padding: 0.85em 0.48em;
  border: 2px solid var(--mg-ink);
  background: var(--mg-white);
  box-shadow: 3px 3px 0 var(--mg-ink);
  font-family: var(--mg-serif);
  font-size: clamp(15px, 1.35vw, 21px);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.16em;
  writing-mode: vertical-rl;
}

.mg-voice__box--2 {
  margin-top: 9%;
}

.mg-voice__box--3 {
  margin-top: 3%;
}

.mg-voice__box--4 {
  margin-top: 15%;
}

.mg-voice__box--5 {
  margin-top: 6%;
}

.mg-voice__box--6 {
  margin-top: 19%;
  color: var(--mg-paper);
  background: var(--mg-ink);
  box-shadow: 3px 3px 0 rgba(20, 20, 20, 0.3);
}

.mg-voice__box--7 {
  margin-top: 10%;
}

.mg-p5 .is-inked .mg-voice__box {
  animation: mg-cut-down 420ms cubic-bezier(0.7, 0, 0.2, 1) both;
}

.mg-p5 .is-inked .mg-voice__box--1 { animation-delay: 520ms; }
.mg-p5 .is-inked .mg-voice__box--2 { animation-delay: 640ms; }
.mg-p5 .is-inked .mg-voice__box--3 { animation-delay: 760ms; }
.mg-p5 .is-inked .mg-voice__box--4 { animation-delay: 880ms; }
.mg-p5 .is-inked .mg-voice__box--5 { animation-delay: 1000ms; }
.mg-p5 .is-inked .mg-voice__box--6 { animation-delay: 1120ms; }
.mg-p5 .is-inked .mg-voice__box--7 { animation-delay: 1240ms; }

@keyframes mg-cut-down {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.mg-p5__deck {
  grid-column: 1 / 13;
  grid-row: 2;
}

.mg-p5__deck .mg-panel__ink {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 18px 36px;
  align-items: center;
  padding: clamp(20px, 2.6vw, 34px) clamp(22px, 3vw, 46px);
}

.mg-player {
  grid-row: 1 / 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.mg-player__toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--mg-ink);
  box-shadow: 0 0 0 3px var(--mg-paper), 0 0 0 5.5px var(--mg-ink);
  transition: transform 300ms var(--mg-snap);
}

.mg-player__toggle:hover {
  transform: scale(1.07) rotate(-6deg);
}

.mg-player__icon {
  width: 0;
  height: 0;
  margin-left: 6px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 19px solid var(--mg-paper);
}

.mg-player.is-playing .mg-player__icon {
  width: 18px;
  height: 22px;
  margin-left: 0;
  border: 0;
  border-right: 6px solid var(--mg-paper);
  border-left: 6px solid var(--mg-paper);
}

.mg-player__wave {
  position: relative;
  height: 76px;
  cursor: pointer;
  touch-action: none;
}

.mg-player__wave svg {
  display: block;
  width: 100%;
  height: 100%;
}

.mg-player__bars rect {
  fill: rgba(20, 20, 20, 0.2);
}

.mg-player__bars.is-played rect {
  fill: var(--mg-ink);
}

.mg-player__head {
  --p: 0;
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: calc(var(--p) * 100%);
  width: 3px;
  margin-left: -1.5px;
  background: var(--mg-ink);
  pointer-events: none;
}

.mg-player__head::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  border-top: 9px solid var(--mg-ink);
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  transform: translateX(-50%);
}

.mg-player__wave:focus-visible {
  outline-offset: 6px;
}

.mg-player__time {
  display: flex;
  gap: 6px;
  font-family: var(--mg-block);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.mg-p5__deck .mg-specs dd {
  font-size: 14px;
}

.mg-p5__links {
  grid-column: 2;
}

.mg-p5__douyin {
  font-family: var(--mg-hei);
  font-size: 13px;
  font-weight: 900;
}

.mg-links a.mg-p5__douyin {
  padding: 8px 14px 7px 12px;
  color: var(--mg-ink);
  background: var(--mg-paper);
  box-shadow: inset 0 0 0 2px var(--mg-ink);
  font-size: 13px;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.mg-links a.mg-p5__douyin:hover,
.mg-links a.mg-p5__douyin:focus-visible {
  color: var(--mg-paper);
  background: var(--mg-ink);
}

/* ---------- night page: AIGC ---------- */

.mg-night {
  position: relative;
  z-index: 2;
  margin-top: clamp(80px, 14vh, 160px);
  padding-bottom: clamp(56px, 9vh, 110px);
  color: var(--mg-paper);
  background: var(--mg-ink);
}

/* the ink page now opens the chapter: leave room for the flood wedge above it
   and for its tail before the next chapter header */
.mg-title + .mg-night {
  margin-top: clamp(120px, 26vh, 260px);
}

.mg-night + .mg-chapter {
  padding-top: calc(clamp(70px, 14vh, 170px) + clamp(36px, 6vh, 72px));
}

.mg-night__tail {
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  left: 0;
  height: clamp(70px, 14vh, 170px);
  background: var(--mg-ink);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  pointer-events: none;
}

.mg-night__edge {
  --flood: 0;
  position: absolute;
  right: 0;
  bottom: calc(100% - 1px);
  left: 0;
  height: clamp(120px, 26vh, 260px);
  pointer-events: none;
}

.mg-night__edge::before,
.mg-night__edge span {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 100%, 100% calc((1 - var(--flood)) * 100%), 100% 100%);
}

.mg-night__edge::before {
  z-index: 1;
  background: var(--mg-ink);
}

.mg-night__edge span {
  top: -34px;
  bottom: 34px;
  background-image: radial-gradient(circle, var(--mg-ink) 0 1.6px, transparent 2px);
  background-size: 7px 7px;
  transform: translateY(0);
}

.mg-chapter--night::after {
  background: var(--mg-paper);
}

.mg-chapter--night .mg-chapter__no {
  color: var(--mg-ink);
  -webkit-text-stroke-color: var(--mg-paper);
}

.mg-chapter--night .mg-specs dt {
  color: var(--mg-ink);
  background: var(--mg-paper);
}

.mg-chapter--night {
  padding-top: clamp(28px, 6vh, 70px);
}

.mg-night__count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mg-block);
}

.mg-night__count b {
  font-size: clamp(44px, 4.4vw, 72px);
  font-weight: 400;
  line-height: 0.8;
}

.mg-night__count span {
  font-size: 15px;
  letter-spacing: 0.24em;
}

.mg-night__note {
  max-width: 24em;
  font-size: 13.5px;
  font-weight: 700;
  opacity: 0.82;
}

.mg-wall {
  position: relative;
  height: max(560px, 100svh);
  margin: clamp(10px, 2vh, 24px) 0 0;
}

.mg-wall__drift {
  position: absolute;
  inset: 0;
}

/* DriftWall (React Bits) — manga plates on an ink page */
.drift-wall {
  --dw-tile-w: 200px;
  --dw-gap: 18px;
  --dw-perspective: 1200px;
  --dw-lift: 64px;
  --dw-dim: 0.78;
  --dw-gray: 1;
  --dw-overlay: #0d0d0d;
  --dw-edge: 42%;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  perspective: var(--dw-perspective);
  perspective-origin: 50% 50%;
  -webkit-mask-image:
    radial-gradient(ellipse 80% 84% at 50% 48%, #000 var(--dw-edge), transparent 100%),
    linear-gradient(to top, #000 var(--dw-edge), transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(ellipse 80% 84% at 50% 48%, #000 var(--dw-edge), transparent 100%),
    linear-gradient(to top, #000 var(--dw-edge), transparent 100%);
  mask-composite: intersect;
}

.drift-wall__plane {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: row;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  cursor: zoom-in;
  will-change: transform;
}

.drift-wall__col {
  position: relative;
  width: calc(var(--dw-tile-w) + var(--dw-gap));
  transform-style: preserve-3d;
  pointer-events: none;
}

.drift-wall__track {
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  will-change: transform;
  pointer-events: none;
}

/* columns and tracks share the tiles' plane; only tiles take the pointer */
.drift-wall__tile {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: calc(var(--dw-tile-h) + var(--dw-gap));
  padding: 0;
  outline: none;
  transform-style: preserve-3d;
  pointer-events: auto;
}

.drift-wall__inner {
  position: absolute;
  inset: calc(var(--dw-gap) / 2);
  display: block;
  overflow: hidden;
  border: 2.5px solid var(--mg-paper);
  background: #050505;
  opacity: var(--dw-dim);
  transform: translateZ(0);
  pointer-events: none;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.drift-wall__tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(var(--dw-gray)) contrast(1.18) brightness(0.96);
  transition: filter 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  -webkit-user-drag: none;
}

.drift-wall__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(13, 13, 13, 0.06);
  background-image: radial-gradient(circle, rgba(13, 13, 13, 0.58) 0 1px, transparent 1.5px);
  background-size: 4px 4px;
  pointer-events: none;
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.drift-wall__tile.is-active .drift-wall__inner,
.drift-wall__tile:focus-visible .drift-wall__inner {
  opacity: 1;
  transform: translateZ(var(--dw-lift));
  box-shadow: 10px 10px 0 rgba(242, 239, 231, 0.2);
}

.drift-wall__tile.is-active img,
.drift-wall__tile:focus-visible img {
  filter: grayscale(0) saturate(1.05);
}

.drift-wall__tile.is-active .drift-wall__overlay,
.drift-wall__tile:focus-visible .drift-wall__overlay {
  opacity: 0;
}

.drift-wall__tile:focus-visible .drift-wall__inner {
  box-shadow:
    10px 10px 0 rgba(242, 239, 231, 0.2),
    0 0 0 4px var(--mg-ink),
    0 0 0 7px var(--mg-paper);
}

.mg-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mg-gap);
  max-width: 1560px;
  margin: clamp(20px, 4vh, 44px) auto 0;
  padding: 0 var(--mg-pad-r) 0 var(--mg-pad);
}

.mg-platform {
  flex: 1 1 calc((100% - 4 * var(--mg-gap)) / 5);
  min-width: 0;
}

.mg-platform a {
  position: relative;
  display: grid;
  align-content: end;
  gap: 4px;
  height: 100%;
  min-height: 132px;
  padding: 16px 18px;
  border: 2.5px solid var(--mg-paper);
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
  transition: background-color 180ms ease, color 180ms ease;
}

.mg-platform strong {
  font-family: var(--mg-hei);
  font-size: clamp(20px, 1.8vw, 28px);
  font-weight: 900;
  line-height: 1.1;
}

.mg-platform span {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.86;
  overflow-wrap: anywhere;
}

.mg-platform i {
  position: absolute;
  top: 14px;
  right: 16px;
  font-style: normal;
  font-weight: 900;
}

.mg-platform .mg-out {
  width: 13px;
  height: 13px;
}

.mg-platform a:hover,
.mg-platform a:focus-visible {
  color: var(--mg-ink);
  background: var(--mg-paper);
}

.mg-platform a:focus-visible {
  outline-color: var(--mg-paper);
  box-shadow: none;
}

/* ---------- end page ---------- */

.mg-end {
  position: relative;
  min-height: max(560px, 92svh);
  overflow: hidden;
  background: var(--mg-paper);
}

.mg-focus--speed {
  opacity: 0.9;
}

.mg-end__hero {
  position: absolute;
  z-index: 1;
  bottom: 0;
  left: 0;
  width: auto;
  height: min(96%, 62vw);
  max-width: none;
  aspect-ratio: 1;
  pointer-events: none;
}

.mg-end__exits {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: var(--mg-pad-r);
  display: grid;
  gap: clamp(14px, 2.4vh, 24px);
  width: min(44%, 560px);
  transform: translateY(-50%);
}

.mg-exit {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: clamp(96px, 15vh, 140px);
  padding: 18px 40px 18px 34px;
  color: var(--mg-paper);
  background: var(--mg-ink);
  font-family: var(--mg-hei);
  font-size: clamp(34px, 4.2vw, 68px);
  font-weight: 900;
  line-height: 1;
  clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
  transition: transform 340ms var(--mg-snap);
}

.mg-exit small {
  font-family: var(--mg-block);
  font-size: 0.42em;
  font-weight: 400;
  color: var(--mg-ink);
  -webkit-text-stroke: 3px var(--mg-paper);
  paint-order: stroke fill;
  align-self: flex-start;
}

.mg-exit i {
  margin-left: auto;
  font-family: var(--mg-text);
  font-size: 0.7em;
  font-style: normal;
}

.mg-exit--contact {
  color: var(--mg-ink);
  background: var(--mg-ink);
  margin-left: 12%;
}

.mg-exit--contact::before {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--mg-white);
  clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
}

.mg-exit--contact > * {
  position: relative;
}

.mg-exit:hover {
  transform: translateX(14px) skewX(-6deg);
}

.mg-exit:focus-visible {
  outline-offset: 6px;
}

.mg[data-kick="exploration"] .mg-exit--next,
.mg[data-kick="contact"] .mg-exit--contact {
  animation: mg-kick 560ms cubic-bezier(0.6, 0, 0.3, 1) both;
}

@keyframes mg-kick {
  0% {
    transform: none;
  }
  30% {
    transform: translateX(-18px) skewX(8deg);
  }
  100% {
    transform: translateX(120vw) skewX(-24deg);
  }
}

/* ---------- viewer ---------- */

.mg-viewer {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vh, 36px) clamp(10px, 3vw, 48px);
  background: rgba(20, 20, 20, 0.92);
}

.mg-viewer[hidden] {
  display: none;
}

.mg-viewer__sheet {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(1400px, 100%);
  height: min(900px, 100%);
  overflow: hidden;
  border: 3px solid var(--mg-paper);
  background: var(--mg-paper);
}

.mg-viewer__stage {
  position: relative;
  grid-row: 1;
  grid-column: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--mg-ink);
}

.mg-viewer__media {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.mg-viewer__media.is-tall {
  align-self: start;
  width: 100%;
  max-height: none;
}

video.mg-viewer__media {
  width: 100%;
  height: 100%;
}

.mg-viewer__talk {
  display: grid;
  gap: 16px;
  width: min(560px, 90%);
  padding: 30px;
  background-color: var(--mg-paper);
  background-image: radial-gradient(circle, rgba(20, 20, 20, 0.85) 0 0.9px, transparent 1.3px);
  background-size: 5px 5px;
}

.mg-viewer__talk .mg-bubble:first-child {
  justify-self: start;
  font-size: 22px;
}

.mg-viewer__talk .mg-bubble--reply {
  justify-self: end;
  max-width: 90%;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.mg-viewer__talk .mg-bubble--reply b {
  display: block;
  font-size: 1.2em;
}

.mg-viewer__info {
  grid-row: 1 / 3;
  grid-column: 2;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: clamp(24px, 4vh, 44px) clamp(20px, 2vw, 32px) 80px;
  border-left: 3px solid var(--mg-ink);
}

.mg-viewer__title {
  font-family: var(--mg-hei);
  font-size: clamp(30px, 2.8vw, 46px);
  font-weight: 900;
  line-height: 1.02;
}

.mg-viewer__en {
  margin-top: -6px;
  font-family: var(--mg-block);
  font-size: 13px;
  letter-spacing: 0.24em;
}

.mg-viewer__type {
  justify-self: start;
  font-family: var(--mg-hei);
  font-size: 13px;
  font-weight: 900;
}

.mg-viewer__line {
  font-size: 14.5px;
  line-height: 1.75;
}

.mg-viewer__meta {
  font-family: var(--mg-hei);
  font-size: 12.5px;
  font-weight: 900;
}

.mg-viewer__thumbs {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  gap: 8px;
  min-height: 0;
  padding: 10px 12px;
  overflow-x: auto;
  border-top: 3px solid var(--mg-ink);
  background: var(--mg-paper);
}

.mg-viewer__thumbs:empty {
  display: none;
}

.mg-viewer__thumbs button {
  position: relative;
  flex: 0 0 auto;
  width: 108px;
  height: 66px;
  border: 2px solid var(--mg-ink);
  overflow: hidden;
  opacity: 0.62;
  transition: opacity 180ms ease, transform 260ms var(--mg-snap);
}

.mg-viewer__thumbs button[aria-current="true"],
.mg-viewer__thumbs button:hover {
  opacity: 1;
  transform: translateY(-3px);
}

.mg-viewer__thumbs button[aria-current="true"] {
  box-shadow: 4px 4px 0 var(--mg-ink);
}

.mg-viewer__thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mg-viewer__thumbs i {
  position: absolute;
  right: 4px;
  bottom: 2px;
  color: var(--mg-paper);
  font-size: 12px;
  font-style: normal;
  filter: drop-shadow(0 0 2px var(--mg-ink));
}

.mg-viewer__count {
  position: absolute;
  z-index: 3;
  bottom: 14px;
  right: 18px;
  font-family: var(--mg-block);
  font-size: 15px;
  letter-spacing: 0.1em;
}

/* the buttons are paper plates cut like the panels: a pointed plate for each
   direction, a slanted one to close, each over a hard ink shadow */
.mg-viewer__nav,
.mg-viewer__close {
  position: absolute;
  z-index: 4;
  display: block;
  padding: 0;
  background: none;
  transition: transform 260ms var(--mg-snap);
}

.mg-vbtn {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mg-vbtn__shade {
  fill: var(--mg-ink);
  stroke: var(--mg-paper);
  stroke-width: 1.5;
  stroke-linejoin: miter;
}

.mg-vbtn__face {
  fill: var(--mg-paper);
  stroke: var(--mg-ink);
  stroke-width: 3;
  stroke-linejoin: miter;
  transition: fill 140ms ease, stroke 140ms ease;
}

.mg-vbtn__mark {
  fill: var(--mg-ink);
  transition: fill 140ms ease;
}

.mg-vbtn__top {
  transition: transform 90ms ease;
}

.mg-viewer__nav:hover .mg-vbtn__face,
.mg-viewer__close:hover .mg-vbtn__face,
.mg-viewer__nav:focus-visible .mg-vbtn__face,
.mg-viewer__close:focus-visible .mg-vbtn__face {
  fill: var(--mg-ink);
  stroke: var(--mg-paper);
}

.mg-viewer__nav:hover .mg-vbtn__mark,
.mg-viewer__close:hover .mg-vbtn__mark,
.mg-viewer__nav:focus-visible .mg-vbtn__mark,
.mg-viewer__close:focus-visible .mg-vbtn__mark {
  fill: var(--mg-paper);
}

.mg-viewer__nav--prev:hover {
  transform: translateX(-5px);
}

.mg-viewer__nav--next:hover {
  transform: translateX(5px);
}

.mg-viewer__close:hover {
  transform: rotate(-6deg);
}

/* pressed: the plate drops onto its shadow */
.mg-viewer__nav:active .mg-vbtn__top,
.mg-viewer__close:active .mg-vbtn__top {
  transform: translate(3px, 3px);
}

.mg-viewer__nav {
  top: 50%;
  width: 60px;
  height: 68px;
  margin-top: -34px;
}

.mg-viewer__nav--prev {
  left: 14px;
}

/* the words' column is 380px wide whenever it sits beside the picture */
.mg-viewer__nav--next {
  right: calc(380px + 14px);
}

.mg-viewer__close {
  top: 12px;
  right: 12px;
  width: 54px;
  height: 54px;
}

/* changing pictures: an ink slab with a dotted edge and a few speed lines
   cuts across the panel; the new picture comes up under a dot screen */
.mg-viewer__cut {
  position: relative;
  z-index: 2;
  grid-row: 1;
  grid-column: 1;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.mg-viewer__cut.is-cutting {
  visibility: visible;
}

.mg-viewer__tone {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(20, 20, 20, 0.9) 0 1.1px, transparent 1.5px) 0 0 / 5px 5px;
  opacity: 0;
}

.mg-viewer__slab {
  position: absolute;
  top: -12%;
  bottom: -12%;
  left: -30%;
  width: 160%;
  border-right: 3px solid var(--mg-paper);
  border-left: 3px solid var(--mg-paper);
  background:
    linear-gradient(90deg, transparent, var(--mg-paper) 22% 78%, transparent) 30% 17% / 34% 2px no-repeat,
    linear-gradient(90deg, transparent, var(--mg-paper) 22% 78%, transparent) 66% 31% / 22% 3px no-repeat,
    linear-gradient(90deg, transparent, var(--mg-paper) 22% 78%, transparent) 42% 49% / 46% 2px no-repeat,
    linear-gradient(90deg, transparent, var(--mg-paper) 22% 78%, transparent) 24% 68% / 26% 3px no-repeat,
    linear-gradient(90deg, transparent, var(--mg-paper) 22% 78%, transparent) 62% 84% / 38% 2px no-repeat,
    var(--mg-ink);
  transform: translateX(100%) skewX(-14deg);
  will-change: transform;
}

.mg-viewer__slab::before,
.mg-viewer__slab::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30px;
  background: radial-gradient(circle, var(--mg-ink) 0 1.7px, transparent 2.1px) 0 0 / 6px 6px;
}

.mg-viewer__slab::before {
  right: calc(100% + 3px);
}

.mg-viewer__slab::after {
  left: calc(100% + 3px);
}

.mg-viewer[data-mode="gallery"] .mg-viewer__sheet {
  grid-template-columns: minmax(0, 1fr);
  border-color: var(--mg-paper);
  background: var(--mg-ink);
}

.mg-viewer[data-mode="gallery"] .mg-viewer__info {
  position: absolute;
  z-index: 3;
  bottom: 12px;
  left: 16px;
  padding: 0;
  border: 0;
  overflow: visible;
}

.mg-viewer[data-mode="gallery"] .mg-viewer__title {
  padding: 6px 12px;
  color: var(--mg-ink);
  background: var(--mg-paper);
  font-family: var(--mg-block);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.mg-viewer[data-mode="gallery"] .mg-viewer__count {
  color: var(--mg-paper);
}

.mg-viewer[data-mode="gallery"] .mg-viewer__nav--next {
  right: 14px;
}

/* ---------- tablet ---------- */

@media (max-width: 1100px) {
  .mg-title__hero {
    right: 0;
    height: calc(100% - clamp(112px, 16.5vh, 164px) - var(--mg-gap) + 2%);
  }

  .mg-title__latin {
    font-size: clamp(56px, min(9.6vw, 19vh), 210px);
  }

  .mg-p1__hero {
    grid-column: 1 / 8;
  }

  .mg-p1__head {
    grid-column: 8 / 13;
  }

  .mg-p2__head {
    grid-column: 1 / 6;
  }

  .mg-p2__video {
    grid-column: 6 / 13;
  }

  .mg-p2__people {
    grid-column: 1 / 13;
    grid-row: 2;
    min-height: 46vw;
    --cut: 0 0 0 0;
  }

  .mg-p2__metrics {
    grid-column: 1 / 8;
    grid-row: 3;
    --cut: 0 1 0 0;
  }

  .mg-p2__cast {
    grid-column: 8 / 13;
    grid-row: 3;
    --cut: 0 0 0 1;
  }

  .mg-p2__story {
    grid-row: 4;
  }

  .mg-p2 {
    grid-template-rows: minmax(360px, 54vh) auto auto auto;
  }

  .mg-p2__story .mg-panel__ink {
    grid-template-columns: minmax(0, 1fr);
  }

  .mg-p2__story .mg-stack,
  .mg-p2__story .mg-links {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
  }

  .mg-p3__shot--3 {
    display: none;
  }

  .mg-p3__shot--1 {
    grid-column: 1 / 5;
    --cuty: 0 0.73 0 0;
  }

  .mg-p3__shot--2 {
    grid-column: 5 / 9;
    --cuty: 0.73 1.47 0 0;
  }

  .mg-p3__story {
    grid-column: 9 / 13;
    --cuty: 1.47 2.2 0 0;
  }

  .mg-platform {
    flex-basis: calc((100% - 2 * var(--mg-gap)) / 3);
  }

  .mg-p5__deck .mg-panel__ink {
    grid-template-columns: minmax(0, 1fr);
  }

  .mg-player {
    grid-row: auto;
  }

  .mg-p5__links {
    grid-column: 1;
  }
}

@media (max-width: 1023px) {
  .mg {
    --mg-pad-r: var(--mg-pad);
  }

  .mg-thumbs {
    display: none;
  }

  .mg-viewer__sheet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 52%) auto minmax(0, 1fr);
  }

  .mg-viewer__stage {
    grid-row: 1;
  }

  .mg-viewer__thumbs {
    grid-row: 2;
  }

  .mg-viewer__info {
    grid-row: 3;
    grid-column: 1;
    border-top: 3px solid var(--mg-ink);
    border-left: 0;
    padding-bottom: 40px;
  }

  .mg-viewer__nav {
    top: 26%;
  }

  .mg-viewer__nav--next {
    right: 14px;
  }

  .mg-viewer[data-mode="gallery"] .mg-viewer__sheet {
    grid-template-rows: minmax(0, 1fr);
  }

  .mg-viewer[data-mode="gallery"] .mg-viewer__nav {
    top: 50%;
  }
}

/* ---------- phone ---------- */

@media (max-width: 699px) {
  .mg {
    --mg-pad: 14px;
    --mg-gap: 8px;
    --mg-line: 2.5px;
    font-size: 14.5px;
  }

  .mg-title {
    min-height: max(600px, 100svh);
    padding-top: 14px;
    padding-bottom: 16px;
  }

  .mg-title__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(380px, 1fr) auto;
  }

  .mg-title__splash {
    grid-column: 1;
    --cuty: 0 0 0 1.6;
  }

  .mg-title__index {
    grid-column: 1;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--mg-gap);
  }

  .mg-title__index {
    margin-top: calc(-1.6 * var(--mg-s, 12px));
  }

  .mg-title__slot {
    grid-column: 1;
    grid-row: auto;
    height: 62px;
  }

  .mg-title__slot--1 {
    grid-column: 1;
    height: calc(62px + 1.6 * var(--mg-s, 12px));
    --cut: 0 0 0 0;
    --cuty: 0 1.6 0 0;
  }

  .mg-title__slot--2 {
    grid-column: 1;
    --cut: 0 0 0 0;
    --cuty: 0 0 0 0;
  }

  .mg-title__slot--3 {
    grid-column: 1;
    --cut: 0 0 0 0;
    --cuty: 0 0 0 0;
  }

  .mg-title__jump {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 1fr auto auto 1fr;
    align-items: center;
    column-gap: 12px;
    padding: 6px 18px 6px 16px;
  }

  .mg-title__slot--1 .mg-title__jump {
    padding-top: calc(6px + 1.6 * var(--mg-s, 12px));
  }

  .mg-title__jump b {
    grid-row: 1 / 5;
    align-self: center;
    margin: 0;
    font-size: 40px;
    -webkit-text-stroke-width: 3px;
  }

  .mg-title__jump strong {
    grid-column: 2;
    grid-row: 2;
    font-size: 20px;
  }

  .mg-title__jump small {
    grid-column: 2;
    grid-row: 3;
  }

  .mg-title__jump em {
    grid-column: 3;
    grid-row: 1 / 5;
    align-self: center;
    margin: 0;
    font-size: 12px;
  }

  .mg-title__slot--3 .mg-title__jump {
    padding-right: 80px;
  }

  .mg-title__slot--3 .mg-title__jump em {
    display: none;
  }

  .mg-title__jump strong,
  .mg-title__jump small {
    white-space: nowrap;
  }

  .mg-title__hero {
    right: -8%;
    bottom: calc(3 * 62px + 3 * var(--mg-gap) - 30px);
    height: auto;
    width: 82%;
  }

  .mg-title__latin {
    top: 3%;
    bottom: auto;
    left: 4%;
    font-size: clamp(40px, 14.5vw, 66px);
    transform: skewX(-8deg);
  }

  .mg.is-entering .mg-title__latin {
    animation-name: mg-cut;
  }

  .mg-title__han {
    top: calc(5% + clamp(40px, 14.5vw, 66px));
    left: 4%;
    font-size: clamp(70px, 22vw, 110px);
  }

  .mg-title__bubble {
    --tail: -30;
    --lean: -8;
    top: auto;
    bottom: calc(var(--c-bly, 20px) + 8%);
    left: 3%;
    right: auto;
    padding: 0.85em 1.1em;
    font-size: 14px;
  }

  .mg-chapter {
    grid-template-columns: auto minmax(0, 1fr);
    padding-top: 64px;
  }

  .mg-chapter__aside {
    grid-column: 1 / 3;
    justify-items: start;
    padding: 14px 0 20px;
    text-align: left;
  }

  .mg-chapter__aside .mg-specs div {
    justify-content: flex-start;
  }

  .mg-chapter__no {
    -webkit-text-stroke-width: 2px;
  }

  .mg-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none !important;
    grid-auto-rows: auto;
  }

  .mg-page > .mg-panel {
    grid-column: 1 / 3 !important;
    grid-row: auto !important;
    --cut: 0 0 0 0;
    --cuty: 0 0 0 0;
  }

  .mg-p1__hero,
  .mg-p2__video,
  .mg-p3__video {
    aspect-ratio: 16 / 10.6;
  }

  .mg-p3__video {
    aspect-ratio: 4 / 3.6;
    --cuty: 0 0 0 1.4 !important;
  }

  .mg-p1 > .mg-p1__board--1,
  .mg-p1 > .mg-p1__board--3,
  .mg-p3 > .mg-p3__shot--1,
  .mg-p4 > .mg-p4__emt {
    grid-column: 1 / 2 !important;
    --cut: 0 0 1 0;
  }

  .mg-p1 > .mg-p1__board--2,
  .mg-p1 > .mg-p1__board--4,
  .mg-p3 > .mg-p3__shot--2,
  .mg-p4 > .mg-p4__recaply {
    grid-column: 2 / 3 !important;
    --cut: 1 0 0 0;
  }

  .mg-p1__board,
  .mg-p3__shot {
    aspect-ratio: 4 / 3.4;
  }

  .mg-p3__shot--3 {
    display: none;
  }

  .mg-caption {
    font-size: 11px;
  }

  .mg-caption b {
    padding: 5px 6px 4px 9px;
  }

  .mg-p1__last {
    font-size: 11.5px;
  }

  .mg-p1__story .mg-panel__ink {
    grid-template-columns: minmax(0, 1fr);
  }

  .mg-p1__story .mg-story__line--1,
  .mg-p1__story .mg-story__line--2 {
    grid-column: 1;
    margin-left: 0;
  }

  .mg-p1__story .mg-story__meta,
  .mg-p1__story .mg-stack,
  .mg-p1__story .mg-links {
    grid-column: 1;
  }

  .mg-p1__phone {
    aspect-ratio: 4 / 3.4;
  }

  .mg-phone {
    height: 128%;
    border-width: 5px;
    border-radius: 24px;
    box-shadow: 8px 8px 0 var(--mg-ink);
  }

  .mg-p2__people {
    aspect-ratio: 16 / 11;
    min-height: 0;
  }

  .mg-p3__plate .mg-head__name {
    font-size: 26px;
  }

  .mg-p3__latin {
    bottom: 22px;
  }

  .mg-p4__air,
  .mg-p4__avant,
  .mg-p4__mori,
  .mg-p4__site {
    aspect-ratio: 16 / 11;
  }

  .mg-p4__emt,
  .mg-p4__recaply {
    aspect-ratio: 4 / 4.4;
  }

  .mg-p4__emt .mg-plate strong,
  .mg-p4__recaply .mg-plate strong {
    font-size: 15px;
  }

  .mg-p4__chat {
    min-height: 330px;
  }

  .mg-p5__cover {
    aspect-ratio: 1;
  }

  .mg-p5__voice .mg-panel__ink {
    padding: 22px 18px 24px 18px;
    background: linear-gradient(90deg, rgba(242, 239, 231, 0.55), var(--mg-paper) 70%);
  }

  .mg-p5__name {
    font-size: 44px;
  }

  .mg-voice {
    flex-wrap: wrap;
    gap: 14px 7px;
  }

  .mg-voice__box {
    font-size: 15px;
    letter-spacing: 0.1em;
  }

  .mg-voice__box--2,
  .mg-voice__box--4,
  .mg-voice__box--6 {
    margin-top: 18px;
  }

  .mg-voice__box--3,
  .mg-voice__box--5,
  .mg-voice__box--7 {
    margin-top: 6px;
  }

  .mg-player {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .mg-player__time {
    grid-column: 1 / 3;
    justify-self: end;
  }

  .mg-player__toggle {
    width: 56px;
    height: 56px;
  }

  .mg-player__wave {
    height: 64px;
  }

  .mg-wall {
    height: max(480px, 78svh);
  }

  .mg-platform {
    flex-basis: calc((100% - var(--mg-gap)) / 2);
  }

  .mg-platform a {
    min-height: 104px;
    padding: 12px 14px;
  }

  .mg-end {
    min-height: max(620px, 92svh);
  }

  .mg-end__hero {
    height: auto;
    width: 92%;
  }

  .mg-end__exits {
    top: 13%;
    right: var(--mg-pad);
    left: var(--mg-pad);
    width: auto;
    transform: none;
  }

  .mg-exit {
    min-height: 82px;
    font-size: 40px;
  }

  .mg-exit--contact {
    margin-left: 18%;
  }

  .mg-viewer {
    padding: 0;
  }

  .mg-viewer__sheet {
    width: 100%;
    height: 100%;
    border: 0;
  }

  .mg-viewer__nav {
    width: 46px;
    height: 52px;
    margin-top: -26px;
  }

  .mg-viewer__close {
    width: 46px;
    height: 46px;
  }

  .mg-viewer[data-mode="gallery"] .mg-viewer__nav--next {
    right: 10px;
  }

  .mg-viewer__nav--prev {
    left: 10px;
  }

  .mg-viewer__nav--next {
    right: 10px;
  }

  .mg-viewer__close {
    top: 10px;
    right: 10px;
  }
}

/* ---------- short landscape phones ---------- */

@media (max-height: 560px) and (orientation: landscape) {
  .mg-title {
    min-height: max(360px, 100svh);
    padding-top: 10px;
    padding-bottom: 12px;
  }

  .mg-title__kicker b {
    font-size: 22px;
  }

  .mg-title__grid {
    grid-template-rows: minmax(0, 1fr) 70px;
  }

  .mg-title__hero {
    bottom: calc(70px + var(--mg-gap) - 6px);
    height: calc(100% - 70px - var(--mg-gap) + 12%);
  }

  .mg-title__jump {
    padding: 8px 18px 8px 14px;
    column-gap: 10px;
  }

  .mg-title__jump b {
    font-size: 40px;
    -webkit-text-stroke-width: 3px;
  }

  .mg-title__jump strong {
    font-size: 18px;
  }

  .mg-title__jump em {
    margin-bottom: 2px;
    font-size: 11px;
  }

  .mg-title__slot--3 .mg-title__jump {
    padding-right: 72px;
  }

  .mg-title__jump em,
  .mg-title__jump small {
    display: none;
  }

  .mg-title__jump strong {
    white-space: nowrap;
  }

  .mg-title__bubble {
    font-size: 14px;
  }

  .mg-title__han {
    top: 4%;
    font-size: clamp(54px, 17vh, 200px);
  }

  .mg-title__latin {
    font-size: clamp(48px, min(11vw, 18vh), 210px);
  }

  .mg-p1 {
    grid-template-rows: 420px 240px minmax(300px, auto);
  }

  .mg-p2 {
    grid-template-rows: 400px auto auto auto;
  }

  .mg-p3 {
    grid-template-rows: 420px auto;
  }

  .mg-p4 {
    grid-template-rows: 300px 260px 240px;
  }

  .mg-p5 {
    grid-template-rows: minmax(420px, auto) auto;
  }

  .mg-wall {
    height: 560px;
  }
}

/* ---------- reduced motion ---------- */

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

  .mg *,
  .mg *::before,
  .mg *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }

  .mg-media__ring {
    display: none;
  }
}
