@font-face {
  font-family: "WwmoguPixelCore";
  src: url("../fonts/wwmogu-pixel.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "WwmoguPixelSym";
  src: url("../fonts/wwmogu-pixel-sym.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "WwmoguPixelCJK";
  src: url("../fonts/wwmogu-pixel-cjk.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+3000-303F, U+4E00-9FFF, U+FF01-FF60;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

/* Strict 3-color Monochrome 1-Bit Pixel Palette (Light default) */
.paper-shell {
  --paper: #FCFCFB;
  --ink: #111111;
  --stone: #737373;
  --line: rgba(17, 17, 17, 0.16);
  --line-strong: rgba(17, 17, 17, 0.36);
  --wash: rgba(17, 17, 17, 0.05);
  --bar-empty: rgba(17, 17, 17, 0.18);
  --shadow-px: rgba(17, 17, 17, 0.18);
  --dither-a: rgba(252, 252, 251, 0.90);
  --dither-b: rgba(17, 17, 17, 0.14);

  --font-pixel: "WwmoguPixelCore", "WwmoguPixelCJK", "WwmoguPixelSym", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Noto Serif CJK SC", "Songti SC", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  color-scheme: light;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 14px;
  line-height: 1.75;
  letter-spacing: 0.02em;
  min-height: 100vh;
  scrollbar-color: var(--ink) var(--paper);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: auto;
  transition: background-color 140ms steps(3), color 140ms steps(3);
}

/* Strict 3-color Monochrome 1-Bit Pixel Palette (Dark mode) */
html[data-theme="dark"] .paper-shell,
.paper-shell[data-theme="dark"] {
  --paper: #121316;
  --ink: #F2F2EE;
  --stone: #8E9096;
  --line: rgba(242, 242, 238, 0.18);
  --line-strong: rgba(242, 242, 238, 0.38);
  --wash: rgba(242, 242, 238, 0.065);
  --bar-empty: rgba(242, 242, 238, 0.22);
  --shadow-px: rgba(0, 0, 0, 0.62);
  --dither-a: rgba(18, 19, 22, 0.90);
  --dither-b: rgba(242, 242, 238, 0.11);
  color-scheme: dark;
}

.paper-shell ::selection {
  background: var(--ink);
  color: var(--paper);
}

.paper-shell a {
  color: inherit;
  text-decoration: none;
}

.paper-shell button {
  font-family: inherit;
}

.paper-shell a:focus-visible,
.paper-shell button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* 2px Notched Pixel Box Geometry */
.px-chip {
  clip-path: polygon(
    2px 0, calc(100% - 2px) 0,
    calc(100% - 2px) 2px, 100% 2px,
    100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px),
    calc(100% - 2px) 100%, 2px 100%,
    2px calc(100% - 2px), 0 calc(100% - 2px),
    0 2px, 2px 2px
  );
}

/* Responsive Two-Column Grid (Single-Column < 880px, Sticky Sidebar >= 880px) */
.page-column {
  max-width: 600px;
  margin: 0 auto;
  padding: clamp(36px, 6vh, 64px) 20px 72px;
}

.workspace-grid {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.profile-rail {
  min-width: 0;
}

.content-stream {
  min-width: 0;
}

.profile-card {
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--shadow-px);
}

.profile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 2px solid var(--ink);
  background: var(--wash);
}

.px-winbox {
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
  flex-shrink: 0;
}

.profile-body {
  padding: 16px 16px 14px;
}

@media (min-width: 880px) {
  .page-column {
    max-width: 980px;
    padding: clamp(52px, 8vh, 88px) 28px 84px;
  }

  .workspace-grid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: clamp(32px, 4vw, 46px);
    align-items: start;
  }

  .profile-rail {
    position: sticky;
    top: clamp(40px, 7vh, 76px);
  }
}

/* Header Identity + Framed Pixel Mascot */
.identity-reveal {
  min-width: 0;
  flex: 1 1 auto;
}

.site-name {
  margin: 0;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: var(--ink);
}

.name-trigger {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.name-label {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 2px dashed var(--line-strong);
  padding-bottom: 3px;
  transition: border-color 140ms steps(2);
}

.identity-reveal:hover .name-label,
.identity-reveal:focus-within .name-label,
.identity-reveal.is-pinned .name-label {
  border-bottom-color: var(--ink);
}

.name-sep {
  color: var(--stone);
}

.mascot-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 5px;
  border: 2px solid var(--line-strong);
  background: var(--wash);
  box-shadow: 2px 2px 0 var(--shadow-px);
  color: var(--stone);
  transition: color 120ms steps(2), border-color 120ms steps(2), transform 120ms steps(2), background-color 120ms steps(2);
}

.identity-reveal:hover .mascot-slot,
.identity-reveal:focus-within .mascot-slot,
.identity-reveal.is-pinned .mascot-slot {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--paper);
  transform: translateY(-1px);
}

.alias-drawer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 160ms steps(4), opacity 160ms steps(4);
}

.alias-drawer-inner {
  overflow: hidden;
}

.alias-copy {
  margin: 0;
  padding-top: 8px;
  font-family: var(--font-pixel);
  font-size: 13px;
  line-height: 1.65;
  color: var(--stone);
}

.identity-reveal:hover .alias-drawer,
.identity-reveal:focus-within .alias-drawer,
.identity-reveal.is-pinned .alias-drawer {
  grid-template-rows: 1fr;
  opacity: 1;
}

.identity-reveal:hover .alias-copy,
.identity-reveal:focus-within .alias-copy,
.identity-reveal.is-pinned .alias-copy {
  font-family: var(--font-sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.alias-link {
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: 13px;
  border-bottom: 2px solid var(--line-strong);
  padding-bottom: 1px;
  transition: border-color 120ms steps(2), background-color 120ms steps(2);
}

.identity-reveal:hover .alias-link,
.identity-reveal:focus-within .alias-link,
.identity-reveal.is-pinned .alias-link {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.alias-link:hover {
  border-bottom-color: var(--ink);
  background: var(--wash);
}

.header-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  padding: 0;
  background: var(--paper);
  color: var(--stone);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--shadow-px);
  cursor: pointer;
  transition: border-color 90ms steps(2), color 90ms steps(2), background-color 90ms steps(2), transform 60ms steps(2), box-shadow 60ms steps(2);
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--wash);
}

.theme-toggle:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.lang-switch {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--stone);
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--shadow-px);
  padding: 0 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 90ms steps(2), color 90ms steps(2), background-color 90ms steps(2), transform 60ms steps(2), box-shadow 60ms steps(2);
}

.lang-switch:hover {
  color: var(--ink);
  background: var(--wash);
}

.lang-switch:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.lang-switch .is-current {
  color: var(--ink);
}

/* Integrated Bio Block Inside Sidebar Window */
.bio-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px dashed var(--line);
  cursor: pointer;
  transition: border-color 120ms steps(2);
}

.bio-box:hover,
.bio-box:focus-within,
.bio-box.is-decoded {
  border-top-color: var(--ink);
}

.bio-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
}

.meta-links-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-top: 12px;
  margin-top: 14px;
  border-top: 2px dashed var(--line);
}

.coords-label {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  color: var(--stone);
}

.px-led {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  background: var(--stone);
  flex-shrink: 0;
  animation: px-blink 1.6s steps(2, jump-none) infinite;
}

@keyframes px-blink {
  0%, 49% {
    background: var(--ink);
  }
  50%, 100% {
    background: var(--line-strong);
  }
}

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

.ext-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
}

.ext-link {
  color: var(--stone);
  border-bottom: 2px solid var(--line-strong);
  padding-bottom: 1px;
  transition: color 120ms steps(2), border-color 120ms steps(2);
}

.ext-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Pixel Section Headers with 1-Bit Dither Fill */
.section-block {
  margin-top: 0;
  margin-bottom: 48px;
}

.section-block:last-of-type {
  margin-bottom: 40px;
}

.ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

.ledger-title {
  margin: 0;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  flex-shrink: 0;
}

.ledger-dither {
  flex: 1 1 20px;
  height: 10px;
  background-image: repeating-conic-gradient(var(--line-strong) 0% 25%, transparent 0% 50%);
  background-size: 4px 4px;
}

.ledger-meta {
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  color: var(--stone);
  flex-shrink: 0;
}

/* Touch-Safe Focus Dimming */
.focus-list {
  display: flex;
  flex-direction: column;
}

.focus-item {
  transition: opacity 140ms steps(3);
}

@media (hover: hover) and (pointer: fine) {
  .focus-list:hover .focus-item:not(:hover) {
    opacity: 0.44;
  }
}

/* Flagship AI Native 100 2px Notched Specimen Card + Segmented Pixel Meter */
.specimen-wrap {
  margin-bottom: 12px;
  filter: drop-shadow(4px 4px 0 var(--shadow-px));
  transition: opacity 140ms steps(3), filter 120ms steps(2);
}

.specimen-wrap:hover,
.specimen-wrap:focus-within {
  filter: drop-shadow(4px 4px 0 var(--line-strong));
}

.specimen-card {
  border: 2px solid var(--ink);
  padding: 16px 16px 14px;
  background: var(--paper);
  clip-path: polygon(
    2px 0, calc(100% - 2px) 0,
    calc(100% - 2px) 2px, 100% 2px,
    100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px),
    calc(100% - 2px) 100%, 2px 100%,
    2px calc(100% - 2px), 0 calc(100% - 2px),
    0 2px, 2px 2px
  );
  transition: border-color 120ms steps(2);
}

.specimen-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.specimen-title {
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.specimen-wrap:hover .specimen-title,
.specimen-title:hover,
.specimen-title:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.specimen-counter {
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  color: var(--stone);
  flex-shrink: 0;
}

.specimen-desc {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1.65;
  color: var(--stone);
}

/* Segmented 100-Bar 1-Bit Pixel Meter */
.vernier-bars {
  display: grid;
  grid-template-columns: repeat(100, minmax(0, 1fr));
  gap: 2px;
  height: 26px;
  align-items: end;
  margin: 14px 0 12px;
}

.vernier-bar-btn {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  height: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: pointer;
}

.vernier-bar {
  width: 100%;
  height: 4px;
  background: var(--bar-empty);
  transition: height 100ms steps(4), background-color 100ms steps(2);
}

.vernier-bar-btn.is-decade .vernier-bar {
  height: 8px;
}

.vernier-bar-btn.is-live .vernier-bar {
  height: 20px;
  background: repeating-linear-gradient(
    to top,
    var(--ink) 0 3px,
    var(--paper) 3px 4px
  );
}

.vernier-bar-btn.is-demo .vernier-bar {
  height: 16px;
  background: repeating-linear-gradient(
    to top,
    var(--stone) 0 3px,
    var(--paper) 3px 4px
  );
}

.vernier-bar-btn.is-progress .vernier-bar {
  height: 12px;
  border: 1px solid var(--ink);
  background: repeating-linear-gradient(
    to top,
    var(--ink) 0 2px,
    transparent 2px 4px
  );
}

.vernier-bar-btn:hover .vernier-bar,
.vernier-bar-btn:focus-visible .vernier-bar,
.vernier-bar-btn.is-selected .vernier-bar {
  height: 24px;
  border-color: var(--ink);
  background: repeating-linear-gradient(
    to top,
    var(--ink) 0 3px,
    var(--paper) 3px 4px
  );
}

.slot-bar {
  padding-top: 10px;
  border-top: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  min-width: 0;
}

.slot-readout {
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.slot-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.slot-step-btn {
  appearance: none;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line-strong);
  box-shadow: 2px 2px 0 var(--shadow-px);
  width: 24px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color 90ms steps(2), border-color 90ms steps(2), background-color 90ms steps(2), transform 60ms steps(2), box-shadow 60ms steps(2);
}

.slot-step-btn:hover {
  border-color: var(--ink);
  background: var(--wash);
}

.slot-step-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.slot-open-link {
  color: var(--stone);
  padding-left: 4px;
  white-space: nowrap;
  transition: color 120ms steps(2);
}

.slot-open-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Stacked 1-Bit Pixel Work Cards (zero nested <a> tags) */
.work-row {
  position: relative;
  border: 2px solid var(--line-strong);
  background: var(--paper);
  padding: 14px 16px;
  margin: 0 0 10px 0;
  box-shadow: 3px 3px 0 var(--wash);
  transition: opacity 120ms steps(3), transform 90ms steps(2), border-color 90ms steps(2), box-shadow 90ms steps(2), background-color 90ms steps(2);
}

.work-row:last-child {
  margin-bottom: 0;
}

.work-row:hover,
.work-row:focus-within {
  background: var(--paper);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--shadow-px);
  transform: translate(-1px, -1px);
}

.work-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 6px;
}

.work-row-title-group {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.px-cursor {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1;
  color: var(--stone);
  flex-shrink: 0;
  transition: color 90ms steps(2), transform 90ms steps(2);
}

.work-row:hover .px-cursor,
.work-row:focus-within .px-cursor,
.note-row-btn:hover .px-cursor,
.note-row-btn:focus-visible .px-cursor {
  color: var(--ink);
  transform: translateX(2px);
}

.work-primary-link {
  font-family: var(--font-pixel);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.work-primary-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.work-row:hover .work-primary-link {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.work-secondary-pill {
  position: relative;
  z-index: 2;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  line-height: 1.25;
  color: var(--stone);
  border: 2px solid var(--line-strong);
  box-shadow: 2px 2px 0 var(--shadow-px);
  padding: 2px 8px;
  background: var(--paper);
  transition: color 90ms steps(2), border-color 90ms steps(2), background-color 90ms steps(2), transform 60ms steps(2), box-shadow 60ms steps(2);
}

.work-secondary-pill:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--wash);
}

.work-secondary-pill:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.work-row-tag {
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  color: var(--stone);
  flex-shrink: 0;
}

.work-row-desc {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1.68;
  color: var(--stone);
}

/* Framed 1-Bit Notes Filter Chips & Directory Ledger */
.notes-filter-bar {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.note-filter-btn {
  appearance: none;
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--paper);
  color: var(--stone);
  border: 2px solid var(--line-strong);
  box-shadow: 2px 2px 0 var(--shadow-px);
  padding: 4px 9px;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: color 90ms steps(2), border-color 90ms steps(2), background-color 90ms steps(2), transform 60ms steps(2), box-shadow 60ms steps(2);
}

.note-filter-btn[hidden],
.notes-more-wrap[hidden],
.notes-more-menu[hidden],
.note-more-item[hidden] {
  display: none !important;
}

.note-filter-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--wash);
}

.note-filter-btn.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.note-filter-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.notes-more-wrap {
  position: relative;
  flex-shrink: 0;
}

.note-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.more-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 90ms steps(2);
}

.note-more-btn[aria-expanded="true"] .more-caret {
  transform: rotate(180deg);
}

.notes-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 176px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--paper);
  border: 2px solid var(--line-strong);
  box-shadow: 3px 3px 0 var(--shadow-px);
}

.notes-more-menu.align-left {
  right: auto;
  left: 0;
}

.note-more-item {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  white-space: nowrap;
  text-align: left;
  background: var(--paper);
  color: var(--stone);
  border: 1px solid transparent;
  padding: 5px 8px;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: color 90ms steps(2), border-color 90ms steps(2), background-color 90ms steps(2);
}

.note-more-item:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--wash);
}

.note-more-item.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.notes-ledger {
  border: 2px solid var(--line-strong);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--shadow-px);
}

.note-row-btn {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--line);
  text-align: left;
  padding: 12px 14px;
  margin: 0;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  transition: opacity 120ms steps(3), background-color 90ms steps(2);
}

.note-row-btn:last-child {
  border-bottom: 0;
}

.note-row-btn:hover,
.note-row-btn:focus-visible {
  background: var(--wash);
}

.note-row-main {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.note-row-title {
  font-family: var(--font-pixel);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  min-width: 0;
}

.note-row-btn:hover .note-row-title {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.note-row-leader {
  flex: 1 1 24px;
  min-width: 16px;
  border-bottom: 2px dotted var(--line-strong);
  transform: translateY(-3px);
}

.note-row-date {
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  color: var(--stone);
  white-space: nowrap;
  flex-shrink: 0;
}

.notes-empty {
  margin: 0;
  padding: 14px;
  font-size: 12px;
  color: var(--stone);
  font-family: var(--font-pixel);
  font-synthesis: none;
}

.notes-pager {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
}

.notes-pager-info {
  color: var(--stone);
  white-space: nowrap;
}

.notes-pager-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.note-page-btn:disabled,
.note-page-btn:disabled:hover,
.note-page-btn:disabled:active {
  opacity: 0.42;
  color: var(--stone);
  border-color: var(--line);
  background: var(--paper);
  box-shadow: none;
  transform: none;
  cursor: default;
}

/* Colophon Footer */
.colophon-footer {
  padding-top: 24px;
  border-top: 2px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  color: var(--stone);
}

/* =========================================================================
   Global Pixel -> Normal Typography Reveal on Hover / Focus / Click / Decode
   ========================================================================= */
.bio-box.is-decoded .bio-copy,
.bio-box.is-decoded .ext-link,
.page-column.is-measuring-sans .bio-copy,
.page-column.is-measuring-sans .ext-link {
  font-family: var(--font-sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-column.is-measuring-sans .specimen-title,
.specimen-wrap:focus-within .specimen-title {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-column.is-measuring-sans .specimen-desc,
.specimen-wrap:focus-within .specimen-desc,
.page-column.is-measuring-sans .slot-readout,
.specimen-wrap:focus-within .slot-readout,
.page-column.is-measuring-sans .slot-open-link,
.specimen-wrap:focus-within .slot-open-link {
  font-family: var(--font-sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-column.is-measuring-sans .work-primary-link,
.work-row:focus-within .work-primary-link {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-column.is-measuring-sans .work-secondary-pill,
.work-row:focus-within .work-secondary-pill,
.page-column.is-measuring-sans .work-row-desc,
.work-row:focus-within .work-row-desc {
  font-family: var(--font-sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-column.is-measuring-sans .note-row-title,
.note-row-btn:focus-visible .note-row-title {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-column.is-measuring-sans .colophon-footer {
  font-family: var(--font-sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (hover: hover) and (pointer: fine) {
  .profile-card:hover .bio-copy,
  .profile-card:hover .ext-link,
  .bio-box:hover .bio-copy,
  .bio-box:hover .ext-link {
    font-family: var(--font-sans);
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .specimen-wrap:hover .specimen-title {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: -0.015em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .specimen-wrap:hover .specimen-desc,
  .specimen-wrap:hover .slot-readout,
  .specimen-wrap:hover .slot-open-link {
    font-family: var(--font-sans);
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .work-row:hover .work-primary-link {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .work-row:hover .work-secondary-pill,
  .work-row:hover .work-row-desc {
    font-family: var(--font-sans);
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .note-row-btn:hover .note-row-title {
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .colophon-footer:hover {
    font-family: var(--font-sans);
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

@media (max-width: 540px) {
  .vernier-bars {
    grid-template-columns: repeat(50, minmax(0, 1fr));
    row-gap: 6px;
    height: auto;
  }
  .note-row-leader {
    display: none;
  }
  .note-row-btn {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 12px;
  }
  .note-row-date {
    padding-left: 16px;
  }
}

/* Centered 1-Bit Pixel Reading Window with Checkerboard Dither (Normal Prose Inside) */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  background-image: repeating-conic-gradient(var(--dither-b) 0% 25%, var(--dither-a) 0% 50%);
  background-size: 4px 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms steps(4);
}

.sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sheet-card {
  width: 100%;
  max-width: 640px;
  max-height: min(86vh, 760px);
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px);
  transition: transform 160ms steps(5);
  box-shadow: 6px 6px 0 var(--shadow-px);
}

.sheet-backdrop.is-open .sheet-card {
  transform: translateY(0);
}

.sheet-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 2px solid var(--ink);
  background: var(--wash);
  flex-shrink: 0;
}

.sheet-date {
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}

.sheet-pinstripe {
  flex: 1 1 20px;
  height: 10px;
  min-width: 12px;
  background: repeating-linear-gradient(
    to bottom,
    var(--line-strong) 0 1px,
    transparent 1px 3px
  );
}

.sheet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sheet-permalink-btn {
  appearance: none;
  background: var(--paper);
  color: var(--stone);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--shadow-px);
  padding: 3px 10px;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  cursor: pointer;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 90ms steps(2), background-color 90ms steps(2), transform 60ms steps(2), box-shadow 60ms steps(2);
}

.sheet-permalink-btn:hover {
  color: var(--ink);
  background: var(--wash);
}

.sheet-permalink-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.sheet-close-btn {
  appearance: none;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--shadow-px);
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 90ms steps(2), color 90ms steps(2), transform 60ms steps(2), box-shadow 60ms steps(2);
}

.sheet-close-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.sheet-close-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.sheet-body {
  padding: 30px 26px 26px;
  overflow-y: auto;
  flex: 1 1 auto;
  font-family: var(--font-sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sheet-title {
  margin: 0 0 22px;
  font-family: var(--font-sans);
  font-size: clamp(22px, 3vw, 25px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sheet-prose {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.85;
  letter-spacing: 0;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sheet-prose > :first-child {
  margin-top: 0;
}

.sheet-prose > :last-child {
  margin-bottom: 0;
}

.sheet-prose p {
  margin: 0 0 18px;
}

.sheet-prose h3 {
  margin: 28px 0 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.4;
  color: var(--ink);
}

.sheet-prose h4 {
  margin: 22px 0 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}

.sheet-prose ul,
.sheet-prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.sheet-prose li {
  margin-bottom: 6px;
}

.sheet-prose hr {
  border: 0;
  height: 2px;
  background: var(--line);
  margin: 26px 0;
}

.sheet-prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.sheet-prose a:hover {
  text-decoration-color: var(--ink);
  background: var(--wash);
}

.sheet-prose strong {
  font-weight: 600;
}

.sheet-prose em {
  font-style: italic;
}

.sheet-prose blockquote {
  margin: 22px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--ink);
  background: var(--wash);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.72;
  color: var(--ink);
}

.sheet-prose blockquote p:last-child {
  margin-bottom: 0;
}

.sheet-prose pre {
  margin: 20px 0;
  padding: 14px 16px;
  background: var(--wash);
  border: 2px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  overflow-x: auto;
  color: var(--ink);
}

.sheet-prose code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--wash);
  padding: 1px 5px;
}

.sheet-prose pre code {
  background: transparent;
  padding: 0;
}

.sheet-status-note {
  margin: 0;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  color: var(--stone);
}

.sheet-footer {
  padding: 14px 20px;
  border-top: 2px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
}

.sheet-footer[hidden] {
  display: none;
}

.sheet-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-nav-btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-family: var(--font-pixel);
  font-synthesis: none;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-nav-btn:hover,
.sheet-nav-btn:focus-visible {
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sheet-nav-btn:disabled {
  color: var(--stone);
  opacity: 0.45;
  cursor: default;
  text-decoration: none;
}

.sheet-nav-btn:disabled:hover {
  font-family: var(--font-pixel);
}

@media (max-width: 640px) {
  .sheet-backdrop {
    padding: 14px 10px;
  }
  .sheet-topbar {
    padding: 10px 14px;
  }
  .sheet-topbar .sheet-pinstripe {
    display: none;
  }
  .sheet-body {
    padding: 24px 16px;
  }
  .sheet-footer {
    padding: 12px 14px;
  }
  .sheet-permalink-btn {
    max-width: 145px;
  }
}
