:root {
  --navy: #0a0e1f;
  --navy-2: #121a3a;
  --kimi: #4D6BFE;
  --kimi-soft: #6B84FF;
  --light: #8BA2FF;
  --white: #EAF0FF;
  --muted: #9aa8d6;
  --card: #0f1530;
  --line: rgba(77, 107, 254, 0.35);
  --px: "Press Start 2P", monospace;
  --sans: "Noto Sans SC", sans-serif;
  --nav-h: 56px;
  --max: 880px;
}
* { box-sizing: border-box; }
html {
  margin: 0;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  background: var(--navy);
  color: var(--white);
}
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  background: var(--navy);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--light); text-decoration: none; }
a:hover { color: var(--white); }

/* ===== Top nav (scheme A: icon LEFT + text, compact) ===== */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  min-height: var(--nav-h);
  padding: 0 20px;
  padding-top: env(safe-area-inset-top);
  background: rgba(10, 14, 31, 0.92);
  border-bottom: 4px solid var(--navy-2);
  box-shadow: 0 4px 0 rgba(77, 107, 254, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nav-brand {
  font-family: var(--px); font-size: 12px; letter-spacing: 1px;
  color: var(--white);
  text-shadow: 2px 2px 0 var(--kimi), 3px 3px 0 #121a3a;
  flex-shrink: 0;
  white-space: nowrap;
}
.nav-menu {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end;
  align-items: stretch;
}
.nav-menu a {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: var(--sans); font-size: 14px; font-weight: 700;
  color: var(--white);
  border-bottom: 3px solid transparent;
  border-radius: 2px;
  transition: color 0.15s ease, text-shadow 0.15s ease, border-bottom-color 0.15s ease;
}
.nav-menu a .planet-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.nav-menu a .planet-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  shape-rendering: crispEdges;
}
.nav-menu a .nav-label {
  display: block;
  line-height: 1.2;
  white-space: nowrap;
}
/* Cyan glow underline via ::after (concept mock bloom) */
.nav-menu a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  background: transparent;
  border-radius: 1px;
  box-shadow: none;
  pointer-events: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  opacity: 0;
}
.nav-menu a:hover,
.nav-menu a:focus-visible {
  color: var(--light);
  border-bottom-color: transparent;
  outline: none;
}
.nav-menu a:hover .planet-icon,
.nav-menu a:focus-visible .planet-icon {
  filter: drop-shadow(0 0 4px rgba(139, 162, 255, 0.7));
}
.nav-menu a:hover::after,
.nav-menu a:focus-visible::after {
  opacity: 1;
  background: rgba(110, 220, 255, 0.55);
  box-shadow:
    0 0 6px 1px rgba(110, 220, 255, 0.55),
    0 0 14px 2px rgba(77, 107, 254, 0.45);
}
.nav-menu a.is-active {
  color: var(--white);
  border-bottom-color: transparent;
  text-shadow: 0 0 12px rgba(77, 107, 254, 0.7);
}
.nav-menu a.is-active .planet-icon {
  filter: drop-shadow(0 0 5px rgba(139, 162, 255, 0.95));
}
.nav-menu a.is-active::after {
  opacity: 1;
  background: #6EDCFF;
  box-shadow:
    0 0 4px 1px rgba(110, 220, 255, 0.95),
    0 0 10px 3px rgba(77, 200, 255, 0.7),
    0 0 18px 5px rgba(77, 107, 254, 0.55);
}
.nav-toggle {
  display: none;
  width: 40px; height: 40px; padding: 8px;
  border: 3px solid var(--kimi); background: var(--navy-2); cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block; height: 3px; margin: 5px 0; background: var(--white);
  transition: transform .15s ease, opacity .15s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-menu a { padding: 10px 8px; gap: 6px; font-size: 13px; }
  .nav-menu a::after { left: 8px; right: 8px; }
  .site-nav { padding-left: 14px; padding-right: 14px; gap: 10px; }
}

@media (max-width: 720px) {
  .site-nav { min-height: 56px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 0; }
  .nav-toggle { display: inline-block; }
  .nav-menu {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: row; flex-wrap: wrap; justify-content: center;
    align-items: stretch;
    gap: 8px;
    padding: 12px 12px 16px;
    background: rgba(10, 14, 31, 0.97);
    border-bottom: 4px solid var(--kimi);
  }
  .site-nav.is-open .nav-menu { display: flex; }
  .nav-menu a {
    flex: 1 1 40%;
    min-width: 120px;
    max-width: 180px;
    padding: 12px 10px;
    border-bottom: 3px solid transparent;
    background: rgba(18, 26, 58, 0.55);
  }
  .nav-menu a::after { left: 10px; right: 10px; }
}

/* ===== Hero (moon + bot) ===== */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 420px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: var(--navy);
}
#scene {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
  cursor: ew-resize;
}
.hero-hint {
  position: absolute; left: 50%; bottom: 18px; z-index: 4;
  transform: translateX(-50%);
  font-family: var(--px); font-size: 8px; letter-spacing: 1px;
  color: var(--muted); text-align: center;
  pointer-events: none;
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
}
.bubble {
  position: absolute; z-index: 5; width: max-content; max-width: min(320px, 86vw);
  padding: 10px 12px;
  font-family: var(--sans); font-size: 14px; font-weight: 700; line-height: 1.5;
  color: var(--navy); background: var(--white);
  border: 4px solid var(--navy);
  box-shadow: 0 0 0 4px var(--white), 4px 4px 0 4px var(--kimi);
  transform: translate(-50%, -100%);
  pointer-events: auto;
}
.bubble-text {
  max-height: 38vh; overflow-y: auto; overscroll-behavior: contain;
  white-space: pre-wrap; word-break: break-word;
  scrollbar-width: thin; scrollbar-color: var(--kimi) transparent;
}
.bubble .cursor {
  display: inline-block; width: 8px; height: 14px; margin-left: 2px; vertical-align: -2px;
  background: var(--kimi); animation: cur 0.8s steps(2) infinite;
}
@keyframes cur { 50% { opacity: 0; } }
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -16px; margin-left: -6px;
  width: 8px; height: 8px; background: var(--white);
  box-shadow: 4px 4px 0 var(--white), 0 0 0 4px var(--navy);
}
.bubble[hidden] { display: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ask {
  position: absolute; z-index: 6; display: flex; transform: translateX(-50%);
  width: min(300px, 86vw);
  border: 4px solid var(--navy);
  box-shadow: 0 0 0 4px var(--kimi), 4px 4px 0 4px #121a3a;
}
.ask[hidden] { display: none; }
.ask input {
  flex: 1; min-width: 0; padding: 8px 10px; border: 0; outline: 0;
  font: 700 14px var(--sans); color: var(--navy); background: var(--white);
}
.ask button {
  border: 0; padding: 0 12px; cursor: pointer;
  font: 12px var(--px); color: var(--white); background: var(--kimi);
}
.ask button:hover { background: var(--kimi-soft); }
.ask button:disabled { opacity: .6; cursor: wait; }

/* ===== Content sections ===== */
.page { position: relative; z-index: 1; background: var(--navy); }
.section {
  padding: 72px 20px;
  border-top: 4px solid var(--navy-2);
}
.section:nth-child(even) {
  background: linear-gradient(180deg, #0c1228 0%, var(--navy) 100%);
}
.section-inner { max-width: var(--max); margin: 0 auto; }
.section-kicker {
  margin: 0 0 10px;
  font-family: var(--px); font-size: 9px; letter-spacing: 1px;
  color: var(--kimi);
}
.section-title {
  margin: 0 0 10px;
  font-family: var(--px); font-size: clamp(14px, 3.2vw, 18px); line-height: 1.6;
  color: var(--white);
  text-shadow: 3px 3px 0 var(--kimi);
}
.section-lead {
  margin: 0 0 36px;
  font-size: 15px; font-weight: 500; color: var(--muted); line-height: 1.7;
}

/* Timeline details (used inside moon-node expand panels) */
.timeline-tag {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 8px;
  padding: 3px 7px;
  font-family: var(--px); font-size: 7px; letter-spacing: 0.5px;
  color: var(--white);
  background: var(--navy-2);
  border: 2px solid var(--line);
}
.timeline-item--edu .timeline-tag,
.moon-node.timeline-item--edu .timeline-tag { color: var(--navy); background: var(--light); border-color: var(--light); }
.timeline-item--work .timeline-tag,
.moon-node.timeline-item--work .timeline-tag { background: var(--kimi); border-color: var(--kimi); }
.timeline-item--future .timeline-tag,
.moon-node.timeline-item--future .timeline-tag { color: var(--navy); background: var(--white); border-color: var(--white); }
.timeline-when {
  display: block;
  font-family: var(--px); font-size: 8px; color: var(--light);
  margin-bottom: 8px;
  line-height: 1.5;
}
.timeline-role {
  margin: 0 0 6px;
  font-size: 16px; font-weight: 700; color: var(--white);
  line-height: 1.35;
}
.moon-node-detail--future .timeline-role {
  font-family: var(--px); font-size: 22px; color: var(--light);
  text-shadow: 2px 2px 0 var(--kimi);
}
.timeline-place {
  margin: 0 0 10px;
  font-size: 13px; font-weight: 700; color: var(--kimi-soft);
  line-height: 1.4;
}
.timeline-desc {
  margin: 0;
  font-size: 13px; font-weight: 500; line-height: 1.65; color: var(--muted);
}

/* ===== Moon-curve experience timeline ===== */
.moon-timeline {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}
.moon-timeline-arc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.moon-nodes {
  list-style: none;
  margin: 0;
  padding: 0;
}
.moon-node {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  pointer-events: auto;
  --tilt: 0deg;
  transform: translate(-50%, -100%) rotate(var(--tilt));
  transform-origin: 50% 100%;
  width: max-content;
  max-width: min(56vw, 220px);
}
.moon-node-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--white);
  -webkit-tap-highlight-color: transparent;
}
.moon-node-btn:focus-visible {
  outline: 3px solid var(--light);
  outline-offset: 4px;
}
.moon-node-dot {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background: var(--kimi);
  box-shadow: 0 0 0 3px var(--navy), 0 0 0 5px var(--light), 0 0 10px rgba(77, 107, 254, 0.45);
  image-rendering: pixelated;
}
.moon-node.timeline-item--edu .moon-node-dot {
  background: var(--light);
  box-shadow: 0 0 0 3px var(--navy), 0 0 0 5px var(--kimi), 0 0 10px rgba(139, 162, 255, 0.5);
}
.moon-node-dot--q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-family: var(--px);
  font-size: 11px;
  line-height: 1;
  color: var(--navy);
  background: var(--light);
  box-shadow: 0 0 0 3px var(--navy), 0 0 0 5px var(--kimi), 0 0 12px rgba(110, 220, 255, 0.55);
  animation: q-pulse 1.8s ease-in-out infinite;
}
@keyframes q-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--navy), 0 0 0 5px var(--kimi), 0 0 10px rgba(110, 220, 255, 0.35); }
  50% { box-shadow: 0 0 0 3px var(--navy), 0 0 0 6px var(--light), 0 0 18px rgba(110, 220, 255, 0.7); }
}
.moon-node-title {
  display: block;
  padding: 4px 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  text-align: center;
  color: var(--white);
  background: rgba(15, 21, 48, 0.88);
  border: 2px solid var(--kimi);
  box-shadow: 2px 2px 0 rgba(77, 107, 254, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-shadow: 0 1px 0 #000;
}
.moon-node.is-open .moon-node-title,
.moon-node.is-active .moon-node-title,
.moon-node-btn[aria-expanded="true"] .moon-node-title,
.moon-node-btn[aria-pressed="true"] .moon-node-title {
  color: var(--navy);
  background: var(--light);
  border-color: var(--white);
  box-shadow: 0 0 0 2px var(--kimi), 0 0 12px rgba(110, 220, 255, 0.55);
}
.moon-node.is-open .moon-node-dot,
.moon-node.is-active .moon-node-dot {
  box-shadow: 0 0 0 3px var(--navy), 0 0 0 6px var(--white), 0 0 14px rgba(110, 220, 255, 0.7);
}
/* Expand cards disabled — detail blocks are data-only for the ball bubble */
.moon-node-detail,
.moon-node-detail:not([hidden]) {
  display: none !important;
}
.moon-node-detail {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 6;
  width: min(280px, 78vw);
  padding: 12px 14px 14px;
  transform: translateX(-50%) rotate(calc(var(--tilt) * -1));
  transform-origin: 50% 100%;
  background: rgba(15, 21, 48, 0.94);
  border: 4px solid var(--navy-2);
  box-shadow: 6px 6px 0 var(--kimi);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: left;
  pointer-events: auto;
}
.moon-node-detail--future {
  border-style: dashed;
  border-color: var(--light);
  box-shadow: 6px 6px 0 rgba(139, 162, 255, 0.45);
  background: linear-gradient(180deg, rgba(77, 107, 254, 0.14), rgba(15, 21, 48, 0.94) 55%);
}
.moon-node-detail .timeline-tag { display: inline-block; }

.moon-node.is-off {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.moon-node.is-edge {
  opacity: 0.55;
}
.moon-node.is-edge .moon-node-btn {
  pointer-events: auto; /* dim only — still expandable */
}
.moon-timeline-nav {
  position: absolute;
  right: max(16px, 3vw);
  /* Clear the document footer (© / 回到月球) that sits over the fixed scene */
  bottom: max(96px, calc(4vh + 72px + env(safe-area-inset-bottom, 0px)));
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  pointer-events: auto;
  background: rgba(15, 21, 48, 0.82);
  border: 3px solid var(--kimi);
  box-shadow: 3px 3px 0 rgba(77, 107, 254, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.moon-nav-btn {
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--light);
  background: var(--navy-2);
  color: var(--white);
  font-family: var(--px);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  image-rendering: pixelated;
}
.moon-nav-btn:hover:not(:disabled) {
  background: var(--kimi);
  border-color: var(--white);
}
.moon-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.moon-nav-btn:focus-visible {
  outline: 3px solid var(--light);
  outline-offset: 2px;
}
.moon-nav-meta {
  min-width: 4.5em;
  text-align: center;
  font-family: var(--px);
  font-size: 8px;
  letter-spacing: 0.5px;
  color: var(--light);
  line-height: 1.4;
}

@media (max-width: 720px) {
  .moon-node {
    max-width: min(62vw, 200px);
  }
  .moon-timeline-nav {
    right: 12px;
    bottom: max(88px, calc(3vh + 64px + env(safe-area-inset-bottom, 0px)));
    padding: 4px 6px;
  }
  .moon-nav-btn {
    width: 30px;
    height: 30px;
  }
  .moon-node-title {
    font-size: 12px;
    padding: 3px 6px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }
  .moon-node-detail {
    width: min(260px, 86vw);
    /* Prefer opening toward viewport center on small screens via JS data attr */
  }
  .moon-node[data-side="left"] .moon-node-detail {
    left: 0;
    transform: translateX(0) rotate(calc(var(--tilt) * -1));
  }
  .moon-node[data-side="right"] .moon-node-detail {
    left: 100%;
    transform: translateX(-100%) rotate(calc(var(--tilt) * -1));
  }
}

@media (prefers-reduced-motion: reduce) {
  .moon-node-dot--q { animation: none; }
}

/* Works */
.works-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 720px) {
  .works-grid { grid-template-columns: 1fr; }
}
.product-card {
  position: relative;
  background: var(--card);
  border: 4px solid var(--kimi);
  box-shadow: 8px 8px 0 #1a2660;
  padding: 22px 22px 20px;
}
.product-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 8px;
  font-family: var(--px); font-size: 8px;
  color: var(--white); background: var(--kimi);
}
.product-name {
  margin: 0 0 8px;
  font-family: var(--px); font-size: 14px; line-height: 1.6; color: var(--white);
}
.product-tagline {
  margin: 0 0 14px;
  font-size: 15px; font-weight: 700; color: var(--light);
}
.product-desc {
  margin: 0 0 16px;
  font-size: 14px; font-weight: 500; line-height: 1.75; color: var(--muted);
}
.product-meta {
  list-style: none; margin: 0 0 18px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.product-meta li {
  padding: 4px 8px;
  font-size: 12px; font-weight: 700;
  color: var(--white);
  background: var(--navy-2);
  border: 2px solid var(--line);
}
.product-cta {
  display: inline-block;
  padding: 10px 14px;
  font-family: var(--px); font-size: 9px; line-height: 1.5;
  color: var(--white); background: var(--kimi);
  border: 3px solid var(--navy);
  box-shadow: 3px 3px 0 var(--white);
}
.product-cta:hover {
  background: var(--kimi-soft);
  color: var(--white);
}
.works-soon {
  display: flex; flex-direction: column; justify-content: center;
  gap: 10px;
  padding: 22px;
  border: 4px dashed var(--line);
  background: rgba(77, 107, 254, 0.06);
  min-height: 180px;
}
.soon-pixel {
  width: 24px; height: 24px;
  background:
    linear-gradient(90deg, var(--kimi) 0 8px, transparent 8px 16px, var(--light) 16px 24px),
    linear-gradient(90deg, transparent 0 8px, var(--kimi) 8px 16px, transparent 16px 24px);
  background-size: 24px 8px;
  background-repeat: repeat-y;
  image-rendering: pixelated;
}
.soon-title {
  margin: 0;
  font-family: var(--px); font-size: 11px; color: var(--white);
}
.soon-text {
  margin: 0;
  font-size: 14px; font-weight: 500; line-height: 1.7; color: var(--muted);
}

/* Post lists */
.post-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.post-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px;
  background: var(--card);
  border: 4px solid var(--navy-2);
  box-shadow: 5px 5px 0 rgba(77, 107, 254, 0.35);
}
.post-item.is-wip { opacity: 0.92; }
.post-status {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 4px 8px;
  font-family: var(--px); font-size: 8px;
  color: var(--navy); background: var(--light);
}
.post-title {
  margin: 0 0 6px;
  font-size: 16px; font-weight: 700; color: var(--white);
}
.post-meta {
  margin: 0;
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.post-list--notes .post-item {
  border-color: rgba(139, 162, 255, 0.35);
}


/* ===== Experience: full starfield + moon corner (dual-focus) ===== */
body.page-experience,
body.page-works,
body.page-blog,
body.page-notes {
  background: var(--navy);
}
body.page-experience .scene-bg,
body.page-works .scene-bg,
body.page-blog .scene-bg,
body.page-notes .scene-bg {
  position: fixed;
  inset: 0;
  /* z-index:auto so moon nodes/nav can stack above .page / footer */
  z-index: auto;
  overflow: visible; /* allow expand panels above nodes */
  pointer-events: none;
  background: var(--navy);
}
body.page-experience .scene-bg #scene,
body.page-works .scene-bg #scene,
body.page-blog .scene-bg #scene,
body.page-notes .scene-bg #scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: auto;
  cursor: pointer;
  /* Hit target biased to bottom-left moon/bot; content sits above */
  clip-path: none;
}
body.page-experience .scene-bg .bubble,
body.page-experience .scene-bg .ask,
body.page-works .scene-bg .bubble,
body.page-works .scene-bg .ask,
body.page-blog .scene-bg .bubble,
body.page-blog .scene-bg .ask,
body.page-notes .scene-bg .bubble,
body.page-notes .scene-bg .ask {
  pointer-events: auto;
  z-index: 15;
}
body.page-experience .page,
body.page-works .page,
body.page-blog .page,
body.page-notes .page {
  position: relative;
  z-index: 1;
  background: transparent;
  /* Leave bottom-left clear so moon/bot stay clickable */
  padding-bottom: max(18vh, 140px);
  pointer-events: none; /* empty/padding areas pass through to canvas */
}
body.page-experience .section--solo,
body.page-works .section--solo,
body.page-blog .section--solo,
body.page-notes .section--solo {
  background: transparent;
  border-top: 0;
  pointer-events: none;
  padding-top: 28px;
  padding-bottom: 0;
  min-height: 0;
}
body.page-experience .section-inner--experience {
  /* Keep copy clear of left moon arc + nodes */
  margin-left: auto;
  margin-right: max(12px, 3vw);
  max-width: min(460px, 48vw);
  text-align: right;
  pointer-events: auto;
}
body.page-experience .qa-hint,
body.page-works .qa-hint,
body.page-blog .qa-hint,
body.page-notes .qa-hint {
  pointer-events: auto;
}
body.page-experience .moon-timeline {
  z-index: 5; /* above .page (1) and footer (2) for hit-testing + visibility */
  pointer-events: none; /* nodes + nav opt in */
}
body.page-experience .scene-bg .moon-timeline .moon-node,
body.page-experience .scene-bg .moon-timeline .moon-node-detail,
body.page-experience .scene-bg .moon-timeline .moon-timeline-nav {
  pointer-events: auto;
}
body.page-experience .section-lead,
body.page-works .section-lead,
body.page-blog .section-lead,
body.page-notes .section-lead {
  margin-bottom: 14px;
}
body.page-experience .section:nth-child(even),
body.page-works .section:nth-child(even),
body.page-blog .section:nth-child(even),
body.page-notes .section:nth-child(even) {
  background: transparent;
}
body.page-experience .qa-hint,
body.page-works .qa-hint,
body.page-blog .qa-hint,
body.page-notes .qa-hint {
  margin: 0 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-family: var(--px);
  font-size: 8px;
  letter-spacing: 0.5px;
  line-height: 1.6;
  color: var(--white);
  background: rgba(18, 26, 58, 0.78);
  border: 3px solid var(--kimi);
  box-shadow: 3px 3px 0 rgba(77, 107, 254, 0.45);
}
@media (max-width: 720px) {
  body.page-experience .section-inner--experience {
    max-width: min(62vw, 260px);
    margin-right: 10px;
  }
  body.page-experience .section-title {
    font-size: clamp(12px, 3.4vw, 15px);
  }
  body.page-experience .section-lead {
    font-size: 13px;
  }
}
body.page-experience .qa-hint-dot,
body.page-works .qa-hint-dot,
body.page-notes .qa-hint-dot {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--kimi);
  box-shadow: 0 0 0 2px var(--navy), 0 0 8px rgba(77, 107, 254, 0.7);
  image-rendering: pixelated;
}
body.page-experience .site-footer,
body.page-works .site-footer,
body.page-blog .site-footer,
body.page-notes .site-footer {
  position: relative;
  z-index: 2;
  background: rgba(7, 11, 24, 0.92);
  pointer-events: auto;
  /* Keep a left gutter so the fixed moon/bot stay usable near page end */
  padding-left: max(20px, min(36vw, 260px));
}
body.page-works .site-footer {
  /* Works moon is smaller/lower — less left gutter needed */
  padding-left: max(16px, min(22vw, 160px));
}
body.page-blog .site-footer {
  /* Blog moon matches experience scale — same left gutter */
  padding-left: max(20px, min(36vw, 260px));
}


/* Works: top-right title block (mirrors experience) */
body.page-works .section-inner--works {
  margin-left: auto;
  margin-right: max(12px, 3vw);
  max-width: min(460px, 48vw);
  text-align: right;
  pointer-events: auto;
}
@media (max-width: 720px) {
  body.page-works .section-inner--works {
    max-width: min(62vw, 260px);
    margin-right: 10px;
  }
  body.page-works .section-title {
    font-size: clamp(12px, 3.4vw, 15px);
  }
  body.page-works .section-lead {
    font-size: 13px;
  }
}

/* Works center stage: mock C — sparse ambient + active constellation */
.works-stage {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: min(560px, 86vw);
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: center;
  gap: 4px 2px;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.works-stage-core {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  max-width: 440px;
  pointer-events: auto;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}
.works-stage-core.is-dragging { cursor: grabbing; }
.works-stage-nav {
  grid-row: 1;
  pointer-events: auto;
  width: 32px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(110, 220, 255, 0.35);
  font-family: var(--px);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  text-shadow: 0 0 8px rgba(77, 107, 254, 0.25);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.works-stage-nav:hover,
.works-stage-nav:focus-visible {
  color: var(--light);
  text-shadow: 0 0 12px rgba(110, 220, 255, 0.7);
  outline: none;
}
#works-prev { grid-column: 1; }
#works-next { grid-column: 3; }

.works-sky {
  position: relative;
  width: min(100%, 418px);
  aspect-ratio: 360 / 200;
  flex-shrink: 0;
}
.works-sky-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  shape-rendering: crispEdges;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}
.works-sky.is-wipe-next .works-sky-svg {
  animation: works-sky-nudge-next 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.works-sky.is-wipe-prev .works-sky-svg {
  animation: works-sky-nudge-prev 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes works-sky-nudge-next {
  0% { transform: translateX(0); opacity: 1; }
  40% { transform: translateX(-14px); opacity: 0.45; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes works-sky-nudge-prev {
  0% { transform: translateX(0); opacity: 1; }
  40% { transform: translateX(14px); opacity: 0.45; }
  100% { transform: translateX(0); opacity: 1; }
}

.works-sky-amb {
  fill: rgba(160, 185, 230, 0.28);
  stroke: none;
  opacity: 0.55;
  transition: opacity 0.3s steps(4, end);
}
.works-sky-amb--dot {
  fill: rgba(160, 185, 230, 0.2);
}
.works-sky-amb.is-member {
  fill: rgba(160, 185, 230, 0.4);
  opacity: 0.75;
}
.works-sky-amb.is-lit {
  opacity: 0.12;
}

.works-sky-line {
  fill: #4D6BFE;
  stroke: none;
  opacity: 0;
  transition: opacity 0.28s steps(3, end);
  transition-delay: var(--sky-delay, 0ms);
}
.works-sky-line.is-on {
  opacity: 0.92;
}
.works-sky-star {
  fill: var(--light);
  stroke: none;
  opacity: 0;
  transition: opacity 0.28s steps(3, end);
  transition-delay: var(--sky-delay, 0ms);
}
.works-sky-star.is-on {
  opacity: 1;
}
.works-sky-star.is-core {
  fill: #fff;
}
.works-sky-star-glow {
  fill: rgba(77, 107, 254, 0.55);
  stroke: none;
  opacity: 0;
  transition: opacity 0.28s steps(3, end);
  transition-delay: var(--sky-delay, 0ms);
}
.works-sky-star.is-on + .works-sky-star-glow,
.works-sky-star-glow.is-on {
  opacity: 1;
}

.works-stage-meta {
  text-align: center;
  width: 100%;
  pointer-events: auto;
}
.works-stage-tag {
  margin: 0 0 4px;
  font-family: var(--px);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--light);
  text-shadow: 0 1px 0 #000;
}
.works-stage-title {
  margin: 0;
  display: inline-block;
  padding: 0;
  font-family: var(--sans);
  font-size: clamp(15px, 2.5vw, 18px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--white);
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: pointer;
  text-shadow: 0 1px 0 #000, 0 0 12px rgba(77, 107, 254, 0.35);
}
.works-stage-title:focus-visible {
  outline: 2px solid var(--kimi);
  outline-offset: 4px;
}
.works-stage-index {
  margin: 8px 0 0;
  font-family: var(--px);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
}
.works-stage-dots {
  grid-column: 1 / -1;
  grid-row: 2;
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  gap: 10px;
  justify-content: center;
  pointer-events: auto;
}
.works-stage-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(77, 107, 254, 0.35);
  box-shadow: none;
  cursor: pointer;
}
.works-stage-dot.is-active {
  background: var(--kimi);
  box-shadow: 0 0 8px rgba(77, 107, 254, 0.7);
}
.works-data { display: none; }

@media (max-width: 720px) {
  .works-stage {
    width: min(94vw, 400px);
    top: 50%;
    grid-template-columns: 28px 1fr 28px;
  }
  .works-stage-nav {
    width: 28px;
    height: 40px;
    font-size: 22px;
  }
  .works-sky { width: min(100%, 330px); }
  .works-stage-title { font-size: 14px; }
}
/* Works detail panel — mock C: right slide-in + dim overlay */
.works-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 12;
  background: rgba(4, 8, 22, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  -webkit-tap-highlight-color: transparent;
}
.works-detail-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.works-detail-panel {
  position: fixed;
  top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  right: 0;
  bottom: 0;
  z-index: 13;
  width: min(360px, 100vw);
  max-width: 100vw;
  padding: 18px 20px 28px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #0c1228 0%, #0a0e1f 55%, #070b18 100%);
  border-left: 3px dashed rgba(234, 240, 255, 0.28);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  color: var(--white);
  pointer-events: none;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--kimi) transparent;
}
.works-detail-panel.is-open {
  pointer-events: auto;
  transform: translateX(0);
  opacity: 1;
}
.works-detail-close {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 14px;
  padding: 6px 10px;
  border: 2px solid rgba(139, 162, 255, 0.35);
  background: rgba(15, 21, 48, 0.85);
  color: var(--light);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
  -webkit-tap-highlight-color: transparent;
}
.works-detail-close:hover,
.works-detail-close:focus-visible {
  color: var(--white);
  border-color: var(--kimi);
  outline: none;
  box-shadow: 0 0 0 2px rgba(77, 107, 254, 0.35);
}
.works-detail-tag {
  margin: 0 0 8px;
  font-family: var(--px);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--kimi);
  text-shadow: 0 0 10px rgba(77, 107, 254, 0.35);
}
.works-detail-title {
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--white);
  text-shadow: 0 1px 0 #000, 0 0 16px rgba(77, 107, 254, 0.25);
}
.works-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.works-detail-chip {
  display: inline-block;
  padding: 4px 10px;
  border: 2px solid rgba(77, 107, 254, 0.55);
  border-radius: 999px;
  background: rgba(77, 107, 254, 0.08);
  color: var(--light);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.works-detail-block {
  margin: 0 0 18px;
}
.works-detail-heading {
  margin: 0 0 8px;
  font-family: var(--px);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--kimi-soft);
}
.works-detail-focus {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
  color: rgba(234, 240, 255, 0.88);
}
.works-detail-points {
  margin: 0;
  padding: 0 0 0 1.1em;
  list-style: disc;
}
.works-detail-points li {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(234, 240, 255, 0.88);
}
.works-detail-points li::marker {
  color: var(--kimi);
}
.works-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.works-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.works-detail-link--primary {
  color: var(--kimi);
  border-color: rgba(77, 107, 254, 0.7);
  background: rgba(77, 107, 254, 0.12);
  box-shadow: 0 0 12px rgba(77, 107, 254, 0.18);
}
.works-detail-link--primary:hover,
.works-detail-link--primary:focus-visible {
  color: var(--white);
  background: rgba(77, 107, 254, 0.28);
  outline: none;
}
.works-detail-link--secondary {
  color: var(--muted);
  border-color: rgba(154, 168, 214, 0.35);
  background: rgba(15, 21, 48, 0.65);
}
.works-detail-link--secondary:hover,
.works-detail-link--secondary:focus-visible {
  color: var(--white);
  border-color: rgba(139, 162, 255, 0.55);
  outline: none;
}
.works-detail-links-block.is-empty,
#works-detail-links-block.is-empty {
  display: none;
}
body.page-works.works-detail-open {
  overflow: hidden;
}
/* scene-bg is position:fixed → own stacking context at auto(=0); .page is z-index:1,
   so the detail panel was trapped under the left copy. Lift the whole scene while open. */
body.page-works.works-detail-open .scene-bg {
  z-index: 10;
}
body.page-works.works-detail-open .page,
body.page-works.works-detail-open .site-footer {
  z-index: 0;
}
/* Keep moon/ball/bubble above the dim overlay on the left */
body.page-works .scene-bg .bubble,
body.page-works .scene-bg .ask {
  z-index: 15;
}

@media (max-width: 720px) {
  .works-detail-panel {
    width: min(100vw, 100%);
    border-left-width: 2px;
    padding: 16px 16px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .works-sky-svg,
  .works-sky-line,
  .works-sky-star,
  .works-sky-star-glow,
  .works-sky-amb { transition: none; }
  .works-sky.is-wipe-next .works-sky-svg,
  .works-sky.is-wipe-prev .works-sky-svg { animation: none; }
  .works-detail-overlay,
  .works-detail-panel {
    transition: none;
  }
}

/* ===== Inner pages (Scheme 1 multi-page) ===== */
body.page-inner .page {
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  min-height: calc(100dvh - var(--nav-h));
}
body.page-inner .section--solo {
  border-top: 0;
  padding-top: 36px;
}
body.page-inner.page-experience .section--solo,
body.page-inner.page-works .section--solo,
body.page-inner.page-blog .section--solo,
body.page-inner.page-notes .section--solo {
  padding-top: 28px;
  padding-bottom: 0;
}
body.page-home .site-footer {
  position: relative;
  z-index: 2;
}

body.page-blog .section-inner--blog {
  margin-left: auto;
  margin-right: max(12px, 3vw);
  max-width: min(520px, 54vw);
  text-align: right;
  pointer-events: auto;
}
body.page-blog .post-list {
  pointer-events: auto;
  text-align: left;
}
body.page-blog .post-item {
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}
body.page-blog .post-item:hover,
body.page-blog .post-item:focus-visible {
  border-color: var(--kimi);
  box-shadow: 5px 5px 0 rgba(77, 107, 254, 0.55);
  outline: none;
}
body.page-blog .post-item.is-source {
  opacity: 0.42;
}
body.page-blog .post-body-full {
  display: none;
}

/* Blog detail — style A: dim overlay + centered article (FLIP morph) */
.blog-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 12;
  background: rgba(4, 8, 22, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  -webkit-tap-highlight-color: transparent;
}
.blog-detail-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.blog-detail-panel {
  position: fixed;
  z-index: 13;
  top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 28px);
  left: 0;
  right: 0;
  width: min(640px, calc(100vw - 40px));
  max-height: min(72vh, calc(100dvh - var(--nav-h) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 56px));
  margin-left: auto;
  margin-right: auto;
  padding: 22px 24px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: none;
  transform-origin: top left;
  background: linear-gradient(180deg, #0c1228 0%, #0a0e1f 55%, #070b18 100%);
  border: 4px solid rgba(234, 240, 255, 0.55);
  box-shadow: 6px 6px 0 rgba(77, 107, 254, 0.4);
  color: var(--white);
  opacity: 0;
  pointer-events: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--kimi) transparent;
  will-change: transform, opacity;
}
.blog-detail-panel.is-open {
  opacity: 1;
  pointer-events: auto;
}
.blog-detail-panel.is-morphing {
  overflow: hidden;
  pointer-events: none;
}
.blog-detail-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 0 8px 12px;
  padding: 0;
  border: 3px solid rgba(139, 162, 255, 0.45);
  background: rgba(15, 21, 48, 0.92);
  color: var(--light);
  font-family: var(--px);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
  -webkit-tap-highlight-color: transparent;
}
.blog-detail-close:hover,
.blog-detail-close:focus-visible {
  color: var(--white);
  border-color: var(--kimi);
  outline: none;
  box-shadow: 0 0 0 2px rgba(77, 107, 254, 0.35);
}
.blog-detail-status {
  margin: 0 0 10px;
  font-family: var(--px);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--kimi);
  text-shadow: 0 0 10px rgba(77, 107, 254, 0.35);
}
.blog-detail-title {
  margin: 0 0 10px;
  clear: both;
  font-family: var(--sans);
  font-size: clamp(18px, 3.6vw, 26px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--white);
  text-shadow: 0 1px 0 #000, 0 0 16px rgba(77, 107, 254, 0.25);
  text-align: left;
}
.blog-detail-meta {
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
  text-align: left;
}
.blog-detail-divider {
  height: 3px;
  margin: 0 0 16px;
  background: repeating-linear-gradient(
    90deg,
    rgba(234, 240, 255, 0.45) 0 6px,
    transparent 6px 10px
  );
}
.blog-detail-body {
  text-align: left;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
  color: rgba(234, 240, 255, 0.9);
}
.blog-detail-body p {
  margin: 0 0 12px;
}
.blog-detail-body p:last-child {
  margin-bottom: 0;
}
body.page-blog.blog-detail-open {
  overflow: hidden;
}
/* Same stacking fix as works: lift scene so overlay/panel sit above .page copy */
body.page-blog.blog-detail-open .scene-bg {
  z-index: 10;
}
body.page-blog.blog-detail-open .page,
body.page-blog.blog-detail-open .site-footer {
  z-index: 0;
}
body.page-blog .scene-bg .bubble,
body.page-blog .scene-bg .ask {
  z-index: 15;
}

@media (max-width: 720px) {
  .blog-detail-panel {
    top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 16px);
    width: min(100vw - 24px, 100%);
    max-height: min(78vh, calc(100dvh - var(--nav-h) - 40px));
    padding: 16px 16px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-detail-overlay,
  .blog-detail-panel {
    transition: none;
  }
  body.page-blog .post-item {
    transition: none;
  }
}

/* Footer */
.site-footer {
  border-top: 4px solid var(--kimi);
  padding: 22px 20px 28px;
  background: #070b18;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-family: var(--px); font-size: 8px; color: var(--muted);
}
.footer-inner a { color: var(--light); }
.footer-inner a:hover { color: var(--white); }
.footer-left {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0;
  min-width: 0; max-width: 100%;
}
.footer-beian {
  color: var(--muted); text-decoration: none; white-space: nowrap;
}
.footer-beian:hover { color: var(--light); }
@media (max-width: 720px) {
  .footer-inner {
    flex-wrap: wrap; row-gap: 8px;
  }
  .footer-left { line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}


/* ===== Notes N2: bottom moon + upper sky title chips + center expand ===== */
body.page-notes .site-footer {
  /* Moon centered bottom like home — no left ship gutter */
  padding-left: max(16px, 3vw);
  padding-right: max(16px, 3vw);
}

body.page-notes .page {
  /* Clear the large bottom moon + rim bot */
  padding-bottom: max(30vh, 220px);
}

body.page-notes .section-inner--notes {
  margin-left: auto;
  margin-right: max(12px, 3vw);
  max-width: min(420px, 46vw);
  text-align: right;
  pointer-events: auto;
  position: relative;
  z-index: 4;
}

/* Notes orbit: titles on a shallow arc above the bottom moon (no drawn ring) */
.notes-sky {
  list-style: none;
  margin: 0;
  padding: 0;
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  max-width: 100vw;
}

.notes-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.notes-ring--far {
  z-index: 1;
}
.notes-ring--near {
  z-index: 4;
}
.notes-ring path,
.notes-ring circle,
.notes-ring rect {
  vector-effect: non-scaling-stroke;
  shape-rendering: crispEdges;
}

.notes-orbit {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.notes-chip {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  padding: 6px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 9px; /* logo +20%: slight extra room, no orbit change */
  max-width: min(280px, 34vw);
  cursor: pointer;
  pointer-events: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--white);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%);
  will-change: left, top, opacity;
  transition: opacity 0.18s ease, color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.notes-chip.is-on-arc {
  opacity: 1;
  visibility: visible;
}

.notes-chip:hover,
.notes-chip:focus-visible {
  outline: none;
  background: transparent;
  border: none;
  box-shadow: none;
  /* no big hover frame — only text brightens */
}

.notes-chip:hover .post-title,
.notes-chip:focus-visible .post-title {
  color: var(--light);
  text-shadow: 0 1px 0 #000, 0 0 12px rgba(77, 107, 254, 0.45);
}

.notes-chip:focus-visible .notes-chip-logo {
  filter: drop-shadow(0 0 3px rgba(139, 162, 255, 0.8));
}

.notes-chip.is-source {
  opacity: 0.32;
}

.notes-chip.is-clone {
  /* optional loop clones — always aria-hidden / nontabbable in JS */
}

.notes-chip-logo {
  flex: 0 0 auto;
  display: inline-flex;
  width: 21.6px; /* 18 * 1.2 */
  height: 21.6px;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
}

.notes-chip-logo--sat {
  width: 26.4px; /* 22 * 1.2 */
  height: 26.4px;
}

.notes-chip-logo svg {
  display: block;
  width: 19.2px; /* 16 * 1.2 */
  height: 19.2px;
  image-rendering: pixelated;
}

.notes-chip-logo--sat svg {
  width: 22.8px; /* 19 * 1.2 */
  height: 22.8px;
}

.notes-chip-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.notes-chip .post-title {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--white);
  text-shadow: 0 1px 0 #000, 0 0 10px rgba(10, 14, 31, 0.85);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: min(260px, 30vw);
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}

.notes-chip .post-meta {
  display: none;
}

.notes-chip .post-body-full {
  display: none;
}

.notes-chip .post-index,
.notes-chip .post-status {
  display: none;
}

/* Notes detail — mirror blog style A: dim overlay + centered article (FLIP morph) */
.notes-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 12;
  background: rgba(4, 8, 22, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  -webkit-tap-highlight-color: transparent;
}
.notes-detail-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.notes-detail-panel {
  position: fixed;
  z-index: 13;
  top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 28px);
  left: 0;
  right: 0;
  width: min(640px, calc(100vw - 40px));
  max-height: min(72vh, calc(100dvh - var(--nav-h) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 56px));
  margin-left: auto;
  margin-right: auto;
  padding: 22px 24px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: none;
  transform-origin: top left;
  background: linear-gradient(180deg, #0c1228 0%, #0a0e1f 55%, #070b18 100%);
  border: 4px solid rgba(139, 162, 255, 0.55);
  box-shadow: 6px 6px 0 rgba(77, 107, 254, 0.4);
  color: var(--white);
  opacity: 0;
  pointer-events: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--kimi) transparent;
  will-change: transform, opacity;
}
.notes-detail-panel.is-open {
  opacity: 1;
  pointer-events: auto;
}
.notes-detail-panel.is-morphing {
  overflow: hidden;
  pointer-events: none;
}
.notes-detail-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 0 8px 12px;
  padding: 0;
  border: 3px solid rgba(139, 162, 255, 0.45);
  background: rgba(15, 21, 48, 0.92);
  color: var(--light);
  font-family: var(--px);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
  -webkit-tap-highlight-color: transparent;
}
.notes-detail-close:hover,
.notes-detail-close:focus-visible {
  color: var(--white);
  border-color: var(--kimi);
  outline: none;
  box-shadow: 0 0 0 2px rgba(77, 107, 254, 0.35);
}
.notes-detail-status {
  margin: 0 0 10px;
  font-family: var(--px);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--kimi);
  text-shadow: 0 0 10px rgba(77, 107, 254, 0.35);
}
.notes-detail-title {
  margin: 0 0 10px;
  clear: both;
  font-family: var(--sans);
  font-size: clamp(18px, 3.6vw, 26px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--white);
  text-shadow: 0 1px 0 #000, 0 0 16px rgba(77, 107, 254, 0.25);
  text-align: left;
}
.notes-detail-meta {
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
  text-align: left;
}
.notes-detail-divider {
  height: 3px;
  margin: 0 0 16px;
  background: repeating-linear-gradient(
    90deg,
    rgba(139, 162, 255, 0.55) 0 6px,
    transparent 6px 10px
  );
}
.notes-detail-body {
  text-align: left;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
  color: rgba(234, 240, 255, 0.9);
}
.notes-detail-body p {
  margin: 0 0 12px;
}
.notes-detail-body p:last-child {
  margin-bottom: 0;
}
body.page-notes.notes-detail-open {
  overflow: hidden;
}
body.page-notes.notes-detail-open .scene-bg {
  z-index: 10;
}
body.page-notes.notes-detail-open .page,
body.page-notes.notes-detail-open .site-footer {
  z-index: 0;
}
body.page-notes.notes-detail-open .notes-sky {
  z-index: 11;
}
/* Keep #scene under the dim overlay (do NOT raise the whole canvas).
   Side-park visibility uses a DOM .notes-bot-proxy above the overlay instead. */
body.page-notes.notes-detail-open .scene-bg #scene {
  z-index: 0;
}
body.page-notes.notes-detail-open .notes-detail-overlay {
  z-index: 12;
}
body.page-notes.notes-detail-open .notes-bot-proxy.is-on {
  z-index: 15;
}
body.page-notes.notes-detail-open .notes-detail-panel {
  z-index: 16;
}
body.page-notes .scene-bg .bubble,
body.page-notes .scene-bg .ask {
  z-index: 15;
}

/* Pixel blue ball stand-in while the detail panel is open (canvas ball hidden). */
.notes-bot-proxy {
  position: fixed;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
  display: none;
  /* Dock only: left/top = ball CENTER. Never put hop/breathe here. */
  transform: translate(-50%, -50%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 15;
  overflow: visible;
}
.notes-bot-proxy.is-on {
  display: block;
}
.notes-bot-proxy-motion {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  /* Hop/breathe applied in JS as translateY only; squash lives in painted sy. */
  transform: translateY(0);
  will-change: transform;
}
.notes-bot-proxy-canvas {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  /* Center the bitmap on the dock point */
  transform: translate(-50%, -50%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

/* Legacy ship markup — keep inert if leftover */
.notes-ship,
.notes-ship-pin,
.notes-ship-bob,
.notes-flame,
.notes-ship-body,
.notes-ship-img,
.notes-bot-seat {
  display: none !important;
}

@media (max-width: 720px) {
  body.page-notes .section-inner--notes {
    max-width: min(88vw, 420px);
    margin-right: 10px;
  }
  body.page-notes .section-title {
    font-size: clamp(12px, 3.4vw, 15px);
  }
  body.page-notes .section-lead {
    font-size: 13px;
  }
  body.page-notes .site-footer {
    padding-left: max(12px, 3vw);
  }
  .notes-chip {
    max-width: min(220px, 70vw);
    padding: 8px 6px;
    gap: 8px; /* was 7; +1 for larger logos */
  }
  .notes-chip .post-title {
    font-size: 15px;
    max-width: min(280px, 78vw);
  }
  .notes-chip.is-primary {
    max-width: min(320px, 78vw);
  }
  .notes-chip.is-primary .post-title {
    font-size: 15px;
    line-height: 1.35;
    white-space: normal;
    overflow: visible;
    word-break: normal;
    overflow-wrap: break-word;
  }
  .notes-chip.is-peek {
    max-width: 72px;
    overflow: hidden;
    padding-left: 4px;
    padding-right: 4px;
  }
  .notes-chip.is-peek .post-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    max-width: 56px;
  }
  .notes-chip.is-peek .notes-chip-logo {
    display: none;
  }
  .notes-chip-logo--sat {
    width: 26.4px;
    height: 26.4px;
  }
  .notes-chip-logo--sat svg {
    width: 22.8px;
    height: 22.8px;
  }
  .notes-detail-panel {
    top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 16px);
    width: min(100vw - 24px, 100%);
    max-height: min(78vh, calc(100dvh - var(--nav-h) - 40px));
    padding: 16px 16px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notes-detail-overlay,
  .notes-detail-panel,
  .notes-chip {
    transition: none;
  }
}
