@font-face {
  font-family: "Archive Old Song";
  src:
    url("assets/fonts/JingHwaOldSong.ttf") format("truetype"),
    local("KingHwa_OldSong"),
    local("KingHwa Old Song"),
    local("京華老宋体"),
    local("京華老宋體");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Archive Hand Zh";
  src:
    url("assets/fonts/ChenYuluoyan-Thin.ttf") format("truetype"),
    local("ChenYuluoyan-Thin"),
    local("辰宇落雁體");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Archive Hand En";
  src:
    url("assets/fonts/MrsSaintDelafield-Regular.ttf") format("truetype"),
    local("Mrs Saint Delafield"),
    local("MrsSaintDelafield-Regular");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --stage: #171918;
  --stage-soft: #242624;
  --ink: #d8d7d0;
  --muted: #a2a39d;
  --line: rgba(216, 215, 208, .18);
  --line-strong: rgba(216, 215, 208, .38);
  --vellum: rgba(239, 239, 232, .72);
  --vellum-edge: rgba(248, 247, 240, .56);
  --paper: rgba(244, 240, 231, .97);
  --paper-ink: #3a3e3f;
  --paper-muted: #626866;
  --archive-label: #525858;
  --archive-label-shadow: rgba(255, 255, 255, .24);
  --accent: #819aa4;
  --accent-ink: #4c6770;
  --control-active: #e7e3da;
  --control-active-ink: #3d4344;
  --collage-paper: #f4f0e7;
  --collage-grid: #d8d2c2;
  --collage-ink: #2e2e30;
  --shadow: rgba(2, 3, 5, .55);
  --leather-image: url("assets/textures/leather-cover.jpg");
  --paper-image: url("assets/textures/paper-sheet.jpg");
  --leather-wash: rgba(20, 17, 17, .64);
  --shell-radius: 26px;
  --a6-page-ratio: 105 / 148;
  --binder-spine-ratio: 5.4%;
  --ease: cubic-bezier(.2, .75, .2, 1);
  --font-display: "Archive Old Song", "Songti TC", "Noto Serif TC", serif;
  --font-reading: "Helvetica Neue", "PingFang TC", "Noto Sans TC", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-hand-zh: "Archive Hand Zh", "Klee One", cursive;
  --font-hand-en: "Archive Hand En", cursive;
}

html[data-theme="light"] {
  color-scheme: light;
  --stage: #c9c5bc;
  --stage-soft: #e3dfd6;
  --ink: #3e4242;
  --muted: #5d6361;
  --line: rgba(48, 52, 52, .18);
  --line-strong: rgba(48, 52, 52, .36);
  --vellum: rgba(246, 246, 239, .78);
  --vellum-edge: rgba(255, 255, 250, .72);
  --paper: rgba(244, 240, 231, .98);
  --paper-ink: #3a3e3f;
  --paper-muted: #626866;
  --archive-label: #444948;
  --archive-label-shadow: rgba(255, 255, 255, .38);
  --accent: #819aa4;
  --accent-ink: #4c6770;
  --control-active: #efebe2;
  --control-active-ink: #3d4344;
  --shadow: rgba(28, 29, 30, .25);
  --leather-wash: rgba(226, 226, 220, .42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--stage);
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: linear-gradient(145deg, var(--stage-soft), var(--stage));
  color: var(--ink);
  font-family: var(--font-reading);
}

button,
a {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.ambient-texture {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .22;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0, rgba(255, 255, 255, .025) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: soft-light;
}

.app-header {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 40px), 1440px);
  margin-inline: auto;
  border-bottom: 1px solid var(--line);
}

.brand,
.header-tools {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 26px;
  object-fit: contain;
  filter: invert(1) grayscale(1);
}

html[data-theme="light"] .brand img {
  filter: grayscale(1);
}

.header-tools {
  gap: 22px;
}

.platform-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 30px);
  margin-inline: auto;
}

.platform-link {
  position: relative;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 5px 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease, transform 180ms var(--ease);
}

.platform-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(.18);
  transform-origin: right;
  transition: transform 200ms var(--ease);
}

.platform-link svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.platform-link:hover,
.platform-link:focus-visible {
  color: var(--ink);
  transform: translateY(-1px);
}

.platform-link:hover::after,
.platform-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.theme-switcher {
  --theme-position: 2;
  position: relative;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--stage-soft) 70%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  isolation: isolate;
}

.theme-switcher[data-value="light"] { --theme-position: 0; }
.theme-switcher[data-value="dark"] { --theme-position: 1; }
.theme-switcher[data-value="auto"] { --theme-position: 2; }

.theme-switcher::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 28px;
  border-radius: 999px;
  background: var(--control-active);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .22);
  transform: translateX(calc(var(--theme-position) * 32px));
  transition: transform 260ms var(--ease), background-color 220ms ease;
}

.theme-switcher button {
  display: grid;
  width: 30px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 180ms ease, transform 180ms var(--ease);
}

.theme-switcher button:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.theme-switcher button[aria-pressed="true"] {
  color: var(--control-active-ink);
}

.theme-switcher svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.prototype-label,
.text-button,
.profile-topline,
.page-footer,
.cover-brand,
.cover-subtitle,
.status-line,
.profile-facts dt,
.file-tabs button {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
}

.prototype-label {
  color: var(--muted);
}

.text-button {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.archive-title-mark,
.archive-note-mark,
.creator-min-mark,
.creator-signature-mark {
  display: block;
  width: 100%;
  height: auto;
}

.archive-title-mark {
  aspect-ratio: 371.84 / 250.84;
  filter: none;
}

.archive-note-mark {
  aspect-ratio: 274 / 130;
  width: 52%;
  margin-inline: auto;
}

.creator-min-mark {
  aspect-ratio: 304 / 238;
}

.creator-signature-mark {
  aspect-ratio: 669 / 63;
}

html[data-theme="light"] .archive-title-mark {
  filter: none;
}

.archive-stage {
  display: grid;
  min-height: calc(100dvh - 68px);
  place-items: center;
  padding: 22px 24px 42px;
}

.archive-shell {
  position: relative;
  width: min(92vw, 1360px, calc((100dvh - 136px) * 1.5));
  aspect-ratio: 3 / 2;
}

.binder {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--binder-spine-ratio) minmax(0, 1fr);
  overflow: visible;
  filter: drop-shadow(0 34px 55px var(--shadow));
  transition: opacity 280ms ease, transform 360ms var(--ease), visibility 0s linear 0s;
}

.archive-shell:not(.is-open) .binder {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.book-page-nav {
  display: none;
}

.page {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .38);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .12), transparent 38%),
    linear-gradient(var(--leather-wash), var(--leather-wash)),
    var(--leather-image) center / cover;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .48),
    inset 0 -1px 0 rgba(255, 255, 255, .08),
    0 7px 18px rgba(0, 0, 0, .13);
}

.page-left {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.8vw, 24px);
  padding: clamp(22px, 3vmin, 42px);
  border-radius: var(--shell-radius) 8px 8px var(--shell-radius);
}

.page-punch {
  position: absolute;
  z-index: 3;
  top: 8%;
  width: clamp(16px, 2vw, 26px);
  height: 84%;
  object-fit: fill;
  opacity: .72;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(35, 31, 27, .18));
}

.page-punch-left {
  right: -2px;
}

.page-punch-right {
  left: -2px;
  transform: scaleX(-1);
}

.page-left::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 15px 13px 14px 16px;
  border: 1px solid var(--vellum-edge);
  background:
    repeating-linear-gradient(7deg, rgba(62, 59, 52, .025) 0 1px, transparent 1px 7px),
    linear-gradient(118deg, var(--vellum), rgba(255, 255, 252, .36) 43%, var(--vellum)),
    var(--paper-image) center / cover;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .46),
    0 9px 18px rgba(21, 18, 16, .12);
  opacity: .78;
  pointer-events: none;
  transform: rotate(-.18deg);
}

.page-right {
  padding: clamp(18px, 2.4vmin, 32px);
  border-radius: 8px var(--shell-radius) var(--shell-radius) 8px;
}

.page::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: calc(var(--shell-radius) - 8px);
}

.page-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(115deg, transparent 9%, rgba(255, 255, 255, .08) 25%, transparent 42%);
  mix-blend-mode: soft-light;
}

.vertical-index {
  position: absolute;
  z-index: 3;
  top: 50%;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .16em;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}

.vertical-index-left { left: 12px; }
.vertical-index-right { right: 12px; }

.index-heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 2px 4px clamp(10px, 1.2vw, 18px);
}

.index-heading h1 {
  order: -1;
  width: clamp(142px, 34%, 218px);
  margin: 0;
  color: var(--ink);
}

.index-instruction {
  position: relative;
  display: grid;
  width: min(230px, 42%);
  min-height: 82px;
  place-items: center;
  margin: 4px 6px -2px 0;
  transform: rotate(-1.15deg);
}

.index-note-paper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 6px 7px rgba(0, 0, 0, .2));
}

.index-instruction p {
  position: relative;
  z-index: 1;
  width: 78%;
  margin: 1px 0 0 10%;
  padding: 0;
  color: #4f5354;
}

.character-pockets {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 22px);
  padding: 4px 8px 9px 5px;
}

.archive-groups {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: end;
  gap: 20px;
  min-height: 28px;
  border-bottom: 1px solid rgba(35, 37, 38, .2);
}

.archive-groups button {
  position: relative;
  min-height: 28px;
  padding: 0 0 8px;
  border: 0;
  background: transparent;
  color: var(--archive-label);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
  text-shadow: 0 1px 1px var(--archive-label-shadow);
  cursor: pointer;
}

.archive-groups button span {
  margin-left: 5px;
  opacity: .76;
}

.archive-groups button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease);
}

.archive-groups button[aria-selected="true"] {
  color: var(--paper-ink);
}

.archive-groups button[aria-selected="true"]::after {
  transform: scaleX(1);
}

.character-pocket {
  --tilt: 0deg;
  --shift-x: 0px;
  --shift-y: 0px;
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: 38% minmax(0, 1fr);
  gap: clamp(10px, 1.1vw, 16px);
  align-items: center;
  overflow: visible;
  padding: clamp(11px, 1.15vw, 16px);
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(244, 243, 237, .86), rgba(236, 235, 229, .86)),
    var(--paper-image) center / cover;
  color: var(--paper-ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 15px rgba(33, 29, 26, .16), inset 0 1px 0 rgba(255, 255, 255, .62);
  transform: translate(var(--shift-x), var(--shift-y)) rotate(var(--tilt));
  transition: transform 240ms var(--ease), background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.character-pocket::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 46px;
  height: 12px;
  pointer-events: none;
  background:
    repeating-linear-gradient(8deg, rgba(78, 76, 68, .04) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(221, 224, 219, .58), rgba(245, 244, 235, .82), rgba(216, 220, 216, .56));
  box-shadow: 0 2px 4px rgba(46, 40, 34, .1);
  transform: translateX(-50%) rotate(calc(var(--tilt) * -1));
}

.character-pocket:hover {
  transform: translate(var(--shift-x), calc(var(--shift-y) - 4px)) rotate(0deg);
  box-shadow: 0 13px 22px rgba(33, 29, 26, .2), inset 0 1px 0 rgba(255, 255, 255, .7);
}

.character-pocket[aria-pressed="true"] {
  box-shadow:
    7px 7px 0 color-mix(in srgb, var(--accent) 44%, transparent),
    0 10px 22px rgba(0, 0, 0, .17),
    inset 2px 0 0 var(--accent);
}

.character-pocket:active {
  transform: translate(var(--shift-x), calc(var(--shift-y) + 1px)) rotate(var(--tilt));
}

.character-thumb {
  --thumb-edge: clamp(4px, .4vw, 6px);
  --thumb-bottom: clamp(16px, 1.45vw, 22px);
  position: relative;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 88 / 107;
  overflow: hidden;
  padding: var(--thumb-edge) var(--thumb-edge) var(--thumb-bottom);
  border: 1px solid rgba(255, 255, 255, .5);
  background: #f3f3ef;
  box-shadow: 0 5px 10px rgba(0, 0, 0, .25);
  transition: transform 260ms var(--ease), box-shadow 220ms ease;
}

.character-pocket:hover .character-thumb,
.character-pocket[aria-pressed="true"] .character-thumb {
  transform: translateY(-3px) rotate(0deg);
  box-shadow: 0 9px 16px rgba(0, 0, 0, .28);
}

.character-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--position, 50% 30%);
  filter: saturate(.9) contrast(1.03);
  transition: transform 360ms var(--ease), filter 240ms ease;
}

.character-pocket:hover img,
.character-pocket[aria-pressed="true"] img {
  transform: scale(1.04);
  filter: saturate(1.02) contrast(1.04);
}

.character-number {
  position: absolute;
  z-index: 3;
  top: 7px;
  right: 8px;
  color: var(--paper-muted);
  font-family: var(--font-mono);
  font-size: 7px;
}

.character-pocket strong,
.character-pocket small {
  display: block;
}

.character-pocket strong {
  font-family: var(--font-display);
  font-size: clamp(12px, 1.15vw, 17px);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.2;
}

.character-pocket small {
  margin-top: 8px;
  color: var(--archive-label);
  font-family: var(--font-mono);
  font-size: clamp(7px, .65vw, 9px);
  line-height: 1.4;
  text-shadow: 0 1px 1px var(--archive-label-shadow);
}

.page-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(35, 37, 38, .2);
  color: var(--paper-muted);
}

.back-cover-trigger {
  position: relative;
  padding: 0 0 3px;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
  cursor: pointer;
}

.back-cover-trigger::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(.28);
  transform-origin: right;
  transition: transform 180ms var(--ease);
}

.back-cover-trigger:hover,
.back-cover-trigger:focus-visible {
  color: var(--ink);
}

.back-cover-trigger:hover::after,
.back-cover-trigger:focus-visible::after {
  transform: scaleX(1);
}

.binder-spine {
  position: relative;
  z-index: 8;
  background:
    linear-gradient(90deg, rgba(12, 10, 9, .62), rgba(88, 62, 51, .32) 48%, rgba(12, 10, 9, .66)),
    var(--leather-image) center / auto 100%;
  box-shadow:
    inset 1px 0 rgba(255, 255, 255, .12),
    inset -1px 0 rgba(0, 0, 0, .58),
    0 0 20px rgba(0, 0, 0, .3);
}

.spine-rail {
  position: absolute;
  top: 3%;
  bottom: 3%;
  left: 50%;
  width: 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 8px;
  background: linear-gradient(90deg, #4e5150 0 8%, #c5c4bd 22%, #f4f0e6 43%, #9b9992 58%, #e0ddd5 73%, #555958 100%);
  box-shadow:
    inset 1px 0 2px rgba(255, 255, 255, .78),
    inset -2px 0 2px rgba(28, 27, 25, .46),
    0 4px 9px rgba(0, 0, 0, .46);
}

.spine-rail::before,
.spine-rail::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(70, 68, 64, .88);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fffdf6 0 12%, #aaa69d 34%, #454745 72%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .45);
  transform: translateX(-50%);
}

.spine-rail::before { top: 2%; }
.spine-rail::after { bottom: 2%; }

.ring {
  position: absolute;
  left: 50%;
  z-index: 2;
  width: 66px;
  height: 22px;
  transform: translate(-50%, -50%);
  border: 5px solid #aaa9a3;
  border-top-color: #f0ede4;
  border-right-color: #545755;
  border-bottom-color: #7d7f7c;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, .66),
    0 2px 1px rgba(255, 255, 255, .16),
    0 4px 5px rgba(0, 0, 0, .48);
}

.ring::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -8px;
  width: 9px;
  height: 7px;
  border-radius: 1px 5px 5px 1px;
  background: linear-gradient(180deg, #eeeade, #777873 58%, #c5c2b9);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .38);
  transform: translateY(-50%);
}

.ring-a { top: 13%; }
.ring-b { top: 25%; }
.ring-c { top: 37%; }
.ring-d { top: 63%; }
.ring-e { top: 75%; }
.ring-f { top: 87%; }

.sheet-back,
.profile-sheet {
  position: absolute;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(255, 255, 255, .58), transparent 46%),
    linear-gradient(112deg, transparent 22%, rgba(109, 92, 68, .028) 48%, transparent 67%),
    repeating-linear-gradient(11deg, rgba(70, 62, 49, .012) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(0deg, rgba(20, 21, 22, .02) 0, rgba(20, 21, 22, .02) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(20, 21, 22, .018) 80px),
    linear-gradient(rgba(243, 242, 236, .78), rgba(239, 238, 232, .78)),
    var(--paper-image) center / cover;
  color: var(--paper-ink);
}

.profile-clipboard {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 4%;
  width: 92%;
  height: calc(100% - 24px);
  object-fit: fill;
  opacity: .42;
  pointer-events: none;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .22));
}

.profile-metal-clip {
  position: absolute;
  z-index: 8;
  top: clamp(8px, 1.1vw, 16px);
  left: 50%;
  width: clamp(190px, 43%, 310px);
  height: auto;
  pointer-events: none;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .28));
}

html[data-theme="light"] .profile-clipboard {
  opacity: .58;
}

.sheet-back {
  inset: clamp(22px, 3vw, 44px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
}

.sheet-back-one {
  transform: translate(10px, -7px) rotate(1deg);
  opacity: .62;
}

.sheet-back-two {
  transform: translate(-5px, 8px) rotate(-.6deg);
  opacity: .48;
}

.profile-sheet {
  z-index: 3;
  inset: clamp(24px, 2.6vmin, 40px);
  display: grid;
  grid-template-rows: auto auto auto minmax(70px, 1fr) auto;
  gap: clamp(9px, 1.2vmin, 16px);
  padding: clamp(16px, 1.8vmin, 24px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .2);
  transform-origin: 12% 50%;
}

.profile-sheet:has(.mode-switch:not([hidden])) {
  grid-template-rows: auto auto auto auto minmax(54px, 1fr) auto;
}

.profile-folder-tab {
  position: absolute;
  top: -17px;
  right: 24px;
  display: grid;
  width: 112px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(17, 18, 19, .32);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: #deded8;
  color: #18191a;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .12em;
}

.profile-sheet.is-changing {
  animation: sheet-change 340ms var(--ease);
}

@keyframes sheet-change {
  0% { opacity: .35; transform: translateX(12px) rotateY(-3deg); }
  100% { opacity: 1; transform: translateX(0) rotateY(0); }
}

.profile-topline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(21, 23, 25, .28);
  color: var(--paper-muted);
}

.profile-topline span:last-child {
  text-align: right;
}

.mode-switch {
  display: flex;
  align-items: center;
  border: 1px solid rgba(17, 18, 19, .32);
}

.mode-switch[hidden] {
  display: none;
}

.mode-switch button {
  flex: 1;
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid rgba(17, 18, 19, .25);
  background: transparent;
  color: var(--paper-muted);
  font-family: var(--font-mono);
  font-size: 8px;
  cursor: pointer;
}

.mode-switch button:last-child { border-right: 0; }

.mode-switch button[aria-selected="true"] {
  background: var(--control-active);
  color: var(--control-active-ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.profile-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, .94fr) minmax(190px, 1.06fr);
  gap: clamp(16px, 2vw, 28px);
  padding-top: clamp(14px, 1.8vmin, 22px);
}

.profile-media {
  position: relative;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 88 / 107;
  align-self: start;
}

.tracing-paper-flap {
  position: absolute;
  z-index: 5;
  top: auto;
  right: auto;
  bottom: 3%;
  left: -5%;
  width: 64%;
  height: 14%;
  border: 1px solid rgba(255, 255, 250, .54);
  background:
    repeating-linear-gradient(9deg, rgba(58, 57, 52, .045) 0 1px, transparent 1px 6px),
    linear-gradient(125deg, rgba(255, 255, 252, .74), rgba(232, 233, 226, .56)),
    var(--paper-image) center / cover;
  box-shadow: 0 5px 12px rgba(49, 44, 38, .1);
  opacity: .42;
  pointer-events: none;
  transform: rotate(.7deg);
}

.tracing-paper-flap::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 25%;
  width: 38px;
  height: 12px;
  background: rgba(218, 215, 204, .66);
  box-shadow: 0 1px 3px rgba(49, 44, 38, .08);
  transform: rotate(-2deg);
}

.portrait-pocket {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 88 / 107;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 4% 4% 27%;
  border: 1px solid rgba(21, 23, 25, .18);
  border-radius: 0;
  background: #f7f7f3;
  box-shadow: 0 7px 14px rgba(0, 0, 0, .22), 0 1px 0 rgba(255, 255, 255, .8) inset;
  transform: rotate(-.35deg);
  cursor: zoom-in;
  transition: transform 300ms var(--ease), box-shadow 300ms ease;
}

.portrait-pocket:hover {
  transform: translateY(-3px) rotate(-.35deg);
  box-shadow: 0 11px 20px rgba(0, 0, 0, .24);
}

.portrait-pocket:active {
  transform: translateY(1px);
}

.portrait-pocket img,
.portrait-pocket video {
  position: absolute;
  top: 4%;
  left: 4%;
  display: block;
  width: 92%;
  height: auto;
  aspect-ratio: 1;
  transition: opacity 220ms ease;
}

.portrait-pocket img {
  opacity: 1;
  object-fit: cover;
  object-position: var(--dialog-position, 50% 30%);
  filter: saturate(.9) contrast(1.03);
}

.portrait-pocket video {
  opacity: 0;
  object-fit: cover;
  object-position: var(--dialog-position, 50% 30%);
  filter: saturate(.9) contrast(1.03);
}

.portrait-pocket.is-video-playing img {
  opacity: 0;
}

.portrait-pocket.is-video-playing video {
  opacity: 1;
}

.motion-file-label {
  position: absolute;
  z-index: 4;
  bottom: calc(27% + 4px);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .08em;
}

.motion-file-label {
  left: 13px;
  padding: 4px 5px;
  background: rgba(239, 233, 220, .82);
  color: var(--paper-ink);
  pointer-events: none;
}

.polaroid-caption {
  position: absolute;
  right: 9px;
  bottom: 9%;
  color: #555;
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: .08em;
}

.pocket-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .16), transparent 34%, transparent 72%);
  mix-blend-mode: soft-light;
}

.profile-copy {
  min-width: 0;
  align-self: center;
}

.profile-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 2.4vw, 38px);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.04;
  white-space: nowrap;
}

.profile-role {
  margin: 9px 0 16px;
  color: var(--paper-muted);
  font-size: clamp(10px, .9vw, 13px);
}

.profile-copy blockquote {
  margin: 0 0 clamp(14px, 2vw, 26px);
  font-size: clamp(12px, 1.1vw, 16px);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.55;
  white-space: pre-line;
}

.profile-facts {
  display: grid;
  margin: 0;
  gap: 7px;
}

.profile-facts div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(17, 18, 19, .13);
}

.profile-facts dt {
  color: var(--paper-muted);
}

.profile-facts dd {
  margin: 0;
  font-size: clamp(9px, .78vw, 12px);
}

.file-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(21, 23, 25, .22);
}

.file-tabs button {
  min-height: 28px;
  padding: 0 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--paper-muted);
  cursor: pointer;
}

.file-tabs button:hover {
  color: var(--paper-ink);
}

.file-tabs button[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--paper-ink);
}

.profile-film-mark {
  position: absolute;
  z-index: 2;
  right: 7%;
  bottom: 19%;
  width: clamp(54px, 9%, 78px);
  height: auto;
  opacity: .62;
  pointer-events: none;
  transform: rotate(1.2deg);
}

.profile-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(120px, .7fr);
  gap: 18px;
  align-items: start;
  min-height: 70px;
}

.profile-panel.is-changing {
  animation: panel-change 240ms ease;
}

@keyframes panel-change {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-panel p {
  margin: 0;
  color: var(--paper-muted);
  font-size: clamp(9px, .78vw, 12px);
  line-height: 1.65;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-row span {
  padding: 4px 6px;
  border: 1px solid rgba(21, 23, 25, .25);
  font-family: var(--font-mono);
  font-size: 8px;
}

.profile-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  width: 100%;
  min-height: 52px;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid rgba(48, 51, 53, .42);
  border-radius: 0;
  background-color: transparent;
  background-image: linear-gradient(color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 22%, transparent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 0;
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: .08em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms ease, background-size 220ms var(--ease), color 180ms ease;
}

.primary-action::before,
.secondary-action::before {
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: .18em;
  opacity: .68;
}

.primary-action::before { content: "OPEN / 02"; }
.secondary-action::before { content: "RETURN / 01"; }

.primary-action {
  border-bottom-color: var(--accent-ink);
  color: var(--accent-ink);
}

.secondary-action {
  color: var(--paper-ink);
}

.primary-action:hover {
  background-size: 100% 100%;
  color: var(--paper-ink);
}

.secondary-action:hover {
  background-size: 100% 100%;
  color: var(--accent-ink);
}

.entry-actions,
.entry-menu {
  position: relative;
  width: 100%;
}

.entry-menu summary {
  list-style: none;
}

.entry-menu summary::-webkit-details-marker {
  display: none;
}

.entry-menu-panel {
  position: absolute;
  z-index: 12;
  right: 0;
  bottom: calc(100% + 7px);
  width: 100%;
  min-width: 156px;
  border: 1px solid rgba(48, 51, 53, .58);
  background: var(--paper);
  box-shadow: 0 9px 20px rgba(0, 0, 0, .22);
}

.entry-menu-panel a {
  display: block;
  min-height: 34px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(17, 18, 19, .16);
  color: var(--paper-ink);
  font-family: var(--font-mono);
  font-size: 9px;
  text-decoration: none;
}

.entry-menu-panel a:last-child { border-bottom: 0; }
.entry-menu-panel a:hover { background: #deded8; }

.primary-action:active,
.secondary-action:active {
  transform: translateY(1px);
}

.creator-back-cover {
  position: absolute;
  inset: 0 auto 0 50%;
  z-index: 13;
  width: calc((100% - var(--binder-spine-ratio)) / 2);
  padding: clamp(18px, 2.8vw, 38px);
  overflow: hidden;
  border-radius: var(--shell-radius);
  background:
    radial-gradient(circle at 22% 13%, rgba(229, 190, 164, .16), transparent 32%),
    linear-gradient(145deg, rgba(45, 31, 27, .36), rgba(18, 14, 13, .68)),
    var(--leather-image) center / cover;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 0 0 12px rgba(36, 20, 16, .16),
    0 30px 60px var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-47%) scale(.985);
  transition: opacity 260ms ease, transform 380ms var(--ease), visibility 0s linear 380ms;
}

.creator-back-cover::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(47, 23, 17, .68);
  border-radius: calc(var(--shell-radius) - 9px);
  box-shadow:
    inset 0 1px rgba(235, 194, 164, .2),
    0 1px rgba(235, 194, 164, .12);
}

.archive-shell.show-back-cover .binder {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-3%) scale(.985);
  transition: opacity 220ms ease, transform 340ms var(--ease), visibility 0s linear 340ms;
}

.archive-shell.show-back-cover .creator-back-cover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
  transition: opacity 260ms ease 80ms, transform 380ms var(--ease) 40ms, visibility 0s;
}

.back-cover-index {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 11px;
  color: rgba(239, 239, 234, .48);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .15em;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}

.creator-paper {
  position: absolute;
  background:
    radial-gradient(ellipse at 18% 10%, rgba(255, 255, 255, .6), transparent 45%),
    repeating-linear-gradient(9deg, rgba(64, 57, 46, .014) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(0deg, rgba(42, 44, 45, .024) 0 1px, transparent 1px 4px),
    linear-gradient(rgba(239, 237, 229, .74), rgba(236, 234, 226, .74)),
    var(--paper-image) center / cover;
  box-shadow:
    inset 0 0 24px rgba(91, 73, 50, .045),
    0 16px 34px rgba(0, 0, 0, .3);
}

.creator-paper-back {
  inset: clamp(34px, 4.4vw, 62px) clamp(28px, 4vw, 56px) clamp(25px, 3.5vw, 49px) clamp(46px, 5vw, 72px);
  opacity: .68;
  transform: rotate(-.7deg) translate(-5px, 4px);
}

.creator-paper-front {
  inset: clamp(22px, 2.7vmin, 38px);
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.35vmin, 18px);
  padding: clamp(18px, 2.4vmin, 32px);
  color: var(--paper-ink);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.creator-paper-front::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 18%, rgba(255, 255, 255, .35) 32%, transparent 48%);
  opacity: .4;
}

.creator-heading,
.creator-footer,
.creator-identity,
.referral-heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.creator-heading {
  display: grid;
  grid-template-columns: minmax(86px, 108px) minmax(0, 1fr);
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(48, 51, 53, .26);
}

.creator-kicker,
.creator-section-code,
.creator-footer {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .14em;
}

.creator-heading h2 {
  width: min(100%, 106px);
  margin: -4px 0 -8px;
  color: var(--accent);
}

.creator-kicker {
  color: var(--accent);
}

.creator-signature,
.creator-note {
  margin: 0;
  color: var(--paper-muted);
  font-family: var(--font-hand-zh);
  font-size: clamp(17px, 1.5vw, 24px);
  letter-spacing: .03em;
}

.creator-signature {
  width: 100%;
  align-self: center;
}

.creator-layout {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(140px, .72fr) minmax(210px, 1.28fr);
  gap: clamp(16px, 1.8vmin, 24px);
  align-items: start;
}

.creator-polaroid {
  position: relative;
  width: min(100%, 174px);
  margin: 0 auto;
  padding: 12px 12px 36px;
  background: #f7f6f0;
  box-shadow: 0 15px 26px rgba(29, 31, 31, .2);
  transform: rotate(-1.2deg);
}

.creator-polaroid::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 62px;
  height: 22px;
  background: rgba(157, 179, 188, .43);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .07);
  transform: translateX(-50%) rotate(2deg);
}

.creator-photo-window {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #fff;
}

.creator-photo-window img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: saturate(.92) contrast(1.02);
}

.creator-polaroid figcaption {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .1em;
}

@media (min-width: 601px) {
  .creator-layout {
    container-type: size;
  }

  .creator-polaroid {
    width: min(100%, 174px);
    max-width: 174px;
    height: auto;
    max-height: none;
    aspect-ratio: .7335;
    display: flex;
    flex-direction: column;
  }

  .creator-photo-window {
    min-height: 0;
    flex: 1;
    aspect-ratio: auto;
  }
}

.creator-information {
  display: grid;
  gap: clamp(12px, 1.5vmin, 20px);
  align-self: stretch;
  align-content: start;
}

.creator-identity {
  align-items: flex-start;
}

.creator-identity h3,
.referral-heading h3 {
  margin: 3px 0 0;
  font-family: var(--font-display);
  font-size: clamp(21px, 2vmin, 28px);
  font-weight: 400;
}

.creator-identity p:not(.creator-section-code) {
  max-width: 46ch;
  margin: 9px 0 0;
  color: var(--paper-muted);
  font-size: 10px;
  line-height: 1.65;
}

.creator-socials {
  display: flex;
  gap: 6px;
}

.creator-social-link {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--paper-muted);
  transition: color 160ms ease, background-color 180ms ease, transform 160ms ease;
}

.creator-social-link:hover,
.creator-social-link:focus-visible {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent-ink);
  transform: translateY(-2px);
}

.creator-social-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.referral-section {
  position: relative;
  padding-top: 12px;
  border-top: 1px solid rgba(48, 51, 53, .22);
}

.referral-heading {
  align-items: center;
}

.creator-note {
  color: var(--accent-ink);
  font-size: clamp(14px, 1.25vmin, 18px);
  transform: rotate(-2deg);
}

.referral-list {
  display: grid;
  margin-top: 10px;
}

.referral-code {
  display: grid;
  min-height: 38px;
  grid-template-columns: 22px minmax(64px, .65fr) minmax(92px, 1fr) 20px;
  gap: 7px;
  align-items: center;
  padding: 4px 2px;
  border: 0;
  border-bottom: 1px solid rgba(48, 51, 53, .18);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 23%, transparent), transparent) 0 0 / 0 100% no-repeat;
  color: var(--paper-ink);
  text-align: left;
  cursor: pointer;
  transition: color 170ms ease, background-size 240ms var(--ease), transform 160ms ease;
}

.referral-code:hover,
.referral-code:focus-visible,
.referral-code.is-copied {
  background-size: 100% 100%;
  color: var(--accent-ink);
}

.referral-code:active {
  transform: translateY(1px);
}

.referral-number {
  color: var(--paper-muted);
  font-family: var(--font-mono);
  font-size: 7px;
}

.referral-platform {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.referral-code code {
  font-family: var(--font-mono);
  font-size: clamp(10px, 1vmin, 13px);
  letter-spacing: .12em;
}

.referral-code svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
}

.referral-code.is-copied svg {
  transform: scale(.9);
}

.copy-status {
  min-height: 16px;
  margin: 6px 0 0;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 8px;
}

.creator-footer {
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(48, 51, 53, .22);
  color: var(--paper-muted);
}

.return-to-archive {
  position: relative;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--paper-ink);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
  cursor: pointer;
}

.return-to-archive::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(.25);
  transform-origin: right;
  transition: transform 180ms var(--ease);
}

.return-to-archive:hover,
.return-to-archive:focus-visible {
  color: var(--accent-ink);
}

.return-to-archive:hover::after,
.return-to-archive:focus-visible::after {
  transform: scaleX(1);
}

.binder-cover {
  position: absolute;
  inset: 0 auto 0 50%;
  z-index: 14;
  width: calc((100% - var(--binder-spine-ratio)) / 2);
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: start;
  padding: clamp(34px, 6vw, 90px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--shell-radius);
  background:
    radial-gradient(circle at 22% 14%, rgba(236, 194, 166, .18), transparent 33%),
    linear-gradient(145deg, rgba(45, 31, 27, .34), rgba(18, 14, 13, .68)),
    var(--leather-image) center / cover;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .25),
    inset 0 0 0 12px rgba(36, 20, 16, .14),
    0 30px 60px var(--shadow);
  color: #eef0ed;
  text-align: left;
  cursor: pointer;
  transform-origin: left center;
  transform: translateX(-50%);
  transform-style: preserve-3d;
  transition: transform 820ms var(--ease), opacity 340ms ease, visibility 0s linear 0s;
}

.binder-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(106deg, rgba(255, 255, 255, .08), transparent 24%, rgba(0, 0, 0, .18) 73%),
    radial-gradient(ellipse at center, transparent 48%, rgba(20, 11, 9, .28));
  mix-blend-mode: soft-light;
}

.binder-cover::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(47, 23, 17, .68);
  border-radius: calc(var(--shell-radius) - 9px);
  box-shadow:
    inset 0 1px rgba(235, 194, 164, .2),
    0 1px rgba(235, 194, 164, .12);
}

.archive-shell.is-open .binder-cover {
  visibility: hidden;
  opacity: 0;
  transform: translateX(-50%) perspective(1400px) rotateY(-102deg) translateX(-8%);
  transition: transform 820ms var(--ease), opacity 300ms ease 360ms, visibility 0s linear 820ms;
}

.cover-line {
  position: absolute;
  top: 9%;
  bottom: 9%;
  left: 7%;
  width: 2px;
  border-left: 1px solid rgba(39, 17, 13, .72);
  background: rgba(232, 185, 154, .14);
  box-shadow: 1px 0 rgba(236, 197, 170, .12);
}

.cover-brand,
.cover-title,
.cover-subtitle,
.cover-action {
  position: relative;
  z-index: 1;
  margin-left: 5%;
}

.cover-brand {
  margin-bottom: 28px;
  color: #b9ced6;
  text-shadow: 0 1px 2px rgba(20, 12, 10, .72);
}

.cover-title {
  font-family: var(--font-display);
  font-size: clamp(46px, 5.8vw, 82px);
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: .82;
  color: rgba(56, 28, 20, .55);
  -webkit-text-stroke: .35px rgba(37, 17, 13, .26);
  text-shadow:
    0 -1.25px .8px rgba(30, 12, 9, .72),
    0 1.4px .8px rgba(238, 189, 158, .3),
    0 2.5px 6px rgba(22, 10, 8, .14);
}

.cover-subtitle {
  margin-top: 24px;
  color: #b9ced6;
  text-shadow: 0 1px 2px rgba(20, 12, 10, .72);
}

.cover-action {
  margin-top: 54px;
  padding-bottom: 5px;
  border-bottom: 1px solid currentColor;
  color: #b9ced6;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(20, 12, 10, .72);
}

.binder-cover:hover .cover-action {
  color: #fff;
}

.binder-cover:active {
  transform: translateX(-50%) scale(.995);
}

.status-line {
  position: absolute;
  right: 28px;
  bottom: 16px;
  margin: 0;
  color: var(--muted);
}

.image-dialog {
  width: min(88vw, 920px);
  max-height: 88dvh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--stage-soft);
  color: var(--ink);
  box-shadow: 0 38px 80px rgba(0, 0, 0, .56);
}

.image-dialog::backdrop {
  background: rgba(5, 6, 8, .76);
  backdrop-filter: blur(8px);
}

.image-dialog[open] {
  animation: dialog-in 300ms var(--ease);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.image-dialog-bar {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
}

.image-dialog img {
  display: block;
  width: 100%;
  max-height: calc(88dvh - 53px);
  object-fit: contain;
  background: var(--stage);
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .prototype-label,
  .page-footer span:last-child,
  .vertical-index {
    display: none;
  }

  .platform-nav {
    gap: 15px;
  }

  .platform-link {
    font-size: 7px;
  }

  .archive-stage {
    display: grid;
    min-height: calc(100dvh - 68px);
    place-items: start center;
    padding: 58px 14px 48px;
  }

  .archive-shell {
    width: min(100%, 680px);
    min-height: 0;
    aspect-ratio: var(--a6-page-ratio);
  }

  .binder {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    grid-template-columns: 100% 0 100%;
    grid-template-rows: 100%;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    filter: drop-shadow(0 24px 36px var(--shadow));
  }

  .binder::-webkit-scrollbar {
    display: none;
  }

  .archive-shell:not(.is-open) .binder {
    position: absolute;
    inset: 0;
    height: 100%;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
  }

  .page-left,
  .page-right {
    grid-row: 1;
    height: 100%;
    min-height: 0;
    border-radius: 18px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overscroll-behavior: contain;
  }

  .page-left {
    grid-column: 1;
    grid-template-rows: max-content max-content max-content max-content;
    align-content: start;
    overflow-y: auto;
  }

  .page-right {
    grid-column: 3;
    overflow-y: auto;
  }

  .binder-spine {
    grid-column: 2;
    display: none;
  }

  .binder-cover {
    inset: 0;
    width: 100%;
    min-height: 0;
    transform: none;
  }

  .binder-cover:active {
    transform: scale(.995);
  }

  .archive-shell.is-open .binder-cover {
    pointer-events: none;
    transform: translateY(-2%) scale(.985);
  }

  .profile-sheet {
    position: relative;
    inset: auto;
    min-height: 0;
    margin: 32px 22px 24px;
  }

  .creator-back-cover {
    inset: 0;
    width: 100%;
    min-height: 0;
    transform: translateX(3%) scale(.985);
  }

  .archive-shell.show-back-cover .binder {
    position: absolute;
    inset: 0;
  }

  .archive-shell.show-back-cover .creator-back-cover {
    transform: translateX(0) scale(1);
  }

  .archive-shell.is-open:not(.show-back-cover) .book-page-nav {
    display: grid;
  }

  .book-page-nav {
    position: absolute;
    z-index: 16;
    top: -42px;
    left: 50%;
    width: min(calc(100% - 28px), 280px);
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: color-mix(in srgb, var(--stage-soft) 88%, transparent);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--shadow) 72%, transparent);
    transform: translateX(-50%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .book-page-nav button {
    min-height: 30px;
    padding: 5px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: .08em;
    cursor: pointer;
  }

  .book-page-nav button[aria-pressed="true"] {
    background: var(--control-active);
    color: var(--control-active-ink);
    box-shadow: inset 0 -2px 0 var(--accent);
  }

  .status-line {
    display: none;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .profile-sheet {
    height: calc(100% - 56px);
  }

  .profile-film-mark {
    display: none;
  }

  .page-punch-right {
    display: none;
  }
}

@media (max-width: 600px) {
  .app-header {
    width: calc(100% - 28px);
  }

  .brand span {
    display: none;
  }

  .platform-nav {
    max-width: 54vw;
    gap: 12px;
  }

  .platform-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .platform-link svg {
    width: 15px;
    height: 15px;
  }

  .archive-shell {
    min-height: 0;
  }

  .page-left {
    min-height: 0;
    padding: 22px 18px;
  }

  .page-left:has(.character-pocket:nth-child(6)) {
    min-height: 0;
  }

  .index-heading {
    display: grid;
    grid-template-columns: minmax(96px, .72fr) minmax(180px, 1.4fr);
    gap: 10px;
    align-items: start;
  }

  .index-heading h1 {
    width: clamp(112px, 34vw, 145px);
  }

  .index-instruction {
    width: 100%;
    min-height: 0;
    aspect-ratio: 2.1 / 1;
    margin: 0;
  }

  .index-instruction p {
    width: 82%;
    margin: 0 0 0 9%;
    padding: 0;
  }

  .character-pockets {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .character-pocket {
    min-height: 132px;
    grid-template-columns: 92px minmax(0, 1fr);
    align-content: center;
    gap: 14px;
    padding: 12px;
  }

  .character-thumb {
    min-height: 0;
    aspect-ratio: 88 / 107;
  }

  .character-pocket strong {
    font-size: 15px;
  }

  .character-pocket small {
    display: block;
    margin-top: 6px;
    font-size: 8px;
  }

  .page-right {
    min-height: 0;
    padding: 10px;
  }

  .profile-sheet {
    position: relative;
    inset: auto;
    min-height: 0;
    margin: 28px 8px 14px;
    padding: 16px;
  }

  .profile-film-mark {
    display: none;
  }

  .page-punch {
    width: 14px;
    opacity: .58;
  }

  .page-punch-right {
    display: none;
  }

  .sheet-back {
    inset: 20px 13px 8px;
  }

  .profile-clipboard {
    top: 8px;
    height: calc(100% - 16px);
  }

  .profile-metal-clip {
    top: 8px;
    width: min(54%, 250px);
  }

  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding-top: 14px;
  }

  .profile-media {
    width: min(66%, 220px);
    justify-self: center;
  }

  .tracing-paper-flap {
    right: auto;
    bottom: 4%;
    left: -2%;
    width: 56%;
    height: 12%;
    opacity: .3;
  }

  .profile-copy h2 {
    font-size: clamp(24px, 7vw, 34px);
    white-space: normal;
  }

  .profile-copy blockquote {
    font-size: 14px;
    line-height: 1.65;
  }

  .profile-panel {
    grid-template-columns: 1fr;
  }

  .tag-row {
    display: none;
  }

  .profile-footer {
    align-items: stretch;
  }

  .primary-action,
  .secondary-action {
    flex: 1;
    padding-inline: 10px;
  }

  .cover-title {
    max-width: 100%;
    font-size: clamp(40px, 12.2vw, 56px);
    line-height: .9;
    overflow-wrap: normal;
  }

  .binder-cover {
    padding: 32px 24px;
  }

  .cover-brand {
    margin-bottom: 18px;
  }

  .cover-subtitle {
    margin-top: 18px;
  }

  .cover-action {
    margin-top: 42px;
  }

  .creator-back-cover {
    padding: 12px;
  }

  .back-cover-index,
  .creator-paper-back {
    display: none;
  }

  .archive-shell.show-back-cover .creator-back-cover {
    position: absolute;
    inset: 0;
    min-height: 0;
    overflow: hidden;
  }

  .archive-shell.show-back-cover .creator-paper-front {
    position: absolute;
    inset: 12px;
    grid-template-rows: max-content max-content max-content;
    align-content: start;
    gap: 18px;
    padding: 24px 20px;
    overflow-y: auto;
  }

  .creator-heading {
    align-items: start;
  }

  .creator-heading h2 {
    width: 132px;
    margin-bottom: -8px;
  }

  .creator-signature {
    width: min(48vw, 220px);
    text-align: right;
  }

  .creator-layout {
    grid-template-columns: 1fr;
    gap: 22px;
    align-content: start;
  }

  .creator-polaroid {
    width: min(72%, 240px);
  }

  .creator-identity {
    gap: 12px;
  }

  .referral-heading {
    align-items: end;
  }

  .referral-code {
    grid-template-columns: 22px minmax(74px, .7fr) minmax(104px, 1fr) 20px;
    gap: 6px;
  }

  .referral-code code {
    font-size: 10px;
    letter-spacing: .1em;
  }

  .creator-footer span {
    max-width: 18ch;
    line-height: 1.5;
  }
}

@media (hover: none), (pointer: coarse) {
  .character-pocket:hover,
  .portrait-pocket:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .archive-shell {
    transform: none !important;
  }

  .archive-shell.is-open .binder-cover {
    display: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .page {
    background:
      linear-gradient(var(--leather-wash), var(--leather-wash)),
      var(--leather-image) center / cover;
  }


  .page-left::after {
    opacity: .96;
  }

  .tracing-paper-flap {
    display: none;
  }
}
