:root {
  --ink: #090a0c;
  --ink-soft: #101216;
  --ink-card: #121419;
  --paper: #e9e1d2;
  --paper-soft: #c9c0af;
  --muted: #8d887d;
  --muted-2: #65645e;
  --red: #e24b36;
  --red-bright: #ff6b4a;
  --jade: #5bd6c8;
  --gold: #d8ad62;
  --line: rgba(233, 225, 210, 0.14);
  --line-strong: rgba(233, 225, 210, 0.24);
  --serif: "FangSong", "STFangsong", "KaiTi", "STKaiti", "SimSun", "Songti SC", serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --max: 1480px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 12% 4%, rgba(226, 75, 54, 0.08), transparent 35%),
    radial-gradient(circle at 88% 22%, rgba(91, 214, 200, 0.05), transparent 38%),
    var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

::selection {
  color: #fff;
  background: var(--red);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

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

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

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

.skip-link:focus {
  z-index: 99999;
  width: auto;
  height: auto;
  margin: 12px;
  padding: 10px 18px;
  clip: auto;
  color: var(--ink);
  background: var(--paper);
}

.noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10001;
  max-width: 360px;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--paper);
  font-size: 12px;
  line-height: 1.7;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.cursor {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), opacity 0.2s ease;
}

.cursor--ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(233, 225, 210, 0.55);
  border-radius: 50%;
  mix-blend-mode: difference;
}

.cursor--dot {
  width: 4px;
  height: 4px;
  background: var(--red);
  border-radius: 50%;
}

body.cursor-active .cursor {
  opacity: 1;
}

body.cursor-active .cursor--ring.is-hovering {
  width: 54px;
  height: 54px;
  border-color: var(--red);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 100%;
  height: 2px;
  background: transparent;
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--jade));
  box-shadow: 0 0 12px rgba(226, 75, 54, 0.8);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 74px;
  padding: 0 4.5vw;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, height 0.4s ease;
}

.site-header.is-scrolled {
  height: 64px;
  border-bottom-color: var(--line);
  background: rgba(9, 10, 12, 0.78);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--paper);
  background: var(--red);
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1;
  box-shadow: 0 0 24px rgba(226, 75, 54, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.brand-text small {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.18em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.1vw, 34px);
}

.site-nav a {
  position: relative;
  color: var(--paper-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.site-nav a span {
  margin-right: 5px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 1px;
  background: var(--red);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--paper);
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 1px;
  margin: 5px auto;
  background: var(--paper);
  transition: transform 0.3s ease;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding: 120px 5vw 54px;
  overflow: hidden;
}

.hero::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(9, 10, 12, 0.92) 0%, rgba(9, 10, 12, 0.55) 48%, rgba(9, 10, 12, 0.2) 100%),
    radial-gradient(circle at 76% 42%, rgba(226, 75, 54, 0.11), transparent 24%),
    radial-gradient(circle at 55% 80%, rgba(91, 214, 200, 0.04), transparent 28%);
  content: "";
  pointer-events: none;
}

.hero-chars {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-chars span {
  position: absolute;
  color: rgba(233, 225, 210, 0.035);
  font-family: var(--serif);
  line-height: 1;
  animation: floatChar 16s ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

.hero-orbit {
  position: absolute;
  z-index: 0;
  border: 1px solid rgba(233, 225, 210, 0.07);
  border-radius: 50%;
  pointer-events: none;
}

.hero-orbit--one {
  top: 12%;
  right: 2%;
  width: 72vw;
  height: 72vw;
  max-width: 1000px;
  max-height: 1000px;
  border-style: dashed;
  animation: spinSlow 90s linear infinite;
}

.hero-orbit--two {
  top: 25%;
  right: 14%;
  width: 44vw;
  height: 44vw;
  max-width: 620px;
  max-height: 620px;
  border-color: rgba(226, 75, 54, 0.1);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  gap: 4vw;
  align-items: center;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
}

.hero-copy {
  min-width: 0;
}

.eyebrow,
.section-kicker {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow span {
  color: var(--red);
}

.hero-title {
  display: flex;
  margin: 30px 0 22px;
  font-family: var(--serif);
  font-size: clamp(92px, 12.2vw, 196px);
  font-weight: 400;
  letter-spacing: -0.11em;
  line-height: 0.8;
}

.hero-title span {
  display: inline-block;
  animation: titleRise 1.1s var(--ease) both;
}

.hero-title span:nth-child(1) {
  animation-delay: 0.05s;
}

.hero-title span:nth-child(2) {
  color: var(--red);
  animation-delay: 0.14s;
}

.hero-title span:nth-child(3) {
  animation-delay: 0.23s;
}

.hero-title span:nth-child(4) {
  color: transparent;
  -webkit-text-stroke: 1px rgba(233, 225, 210, 0.82);
  animation-delay: 0.32s;
}

.hero-subtitle {
  margin: 0;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 34px);
  letter-spacing: 0.3em;
}

.hero-lede {
  max-width: 610px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  letter-spacing: 0.12em;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s var(--ease);
}

.button span {
  font-family: var(--mono);
  font-size: 14px;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 8px 44px rgba(226, 75, 54, 0.18);
}

.button--primary:hover {
  background: var(--red-bright);
}

.button--ghost:hover {
  border-color: var(--paper-soft);
  background: rgba(233, 225, 210, 0.05);
}

.hero-stats {
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.85fr 0.8fr;
  gap: 18px;
  max-width: 720px;
  margin-top: 58px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.hero-stats strong {
  display: block;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 400;
  line-height: 1.1;
}

.hero-stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: end;
  width: min(100%, 560px);
}

.hero-glyph-frame {
  position: relative;
  display: grid;
  width: min(74vw, 510px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(233, 225, 210, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(233, 225, 210, 0.07), transparent 57%),
    radial-gradient(circle at 50% 50%, rgba(226, 75, 54, 0.08), transparent 64%);
  box-shadow: inset 0 0 90px rgba(233, 225, 210, 0.025), 0 0 120px rgba(226, 75, 54, 0.06);
}

.hero-glyph-frame::before,
.hero-glyph-frame::after {
  position: absolute;
  width: 52%;
  height: 52%;
  border: 1px solid rgba(233, 225, 210, 0.08);
  border-radius: 50%;
  content: "";
}

.hero-glyph-frame::before {
  transform: rotate(45deg);
}

.hero-glyph-frame::after {
  width: 68%;
  height: 68%;
  border-style: dashed;
  opacity: 0.7;
  animation: spinSlow 55s linear infinite reverse;
}

.hero-glyph {
  position: relative;
  z-index: 2;
  width: 68%;
  height: 68%;
  color: var(--paper);
  filter: drop-shadow(0 0 22px rgba(233, 225, 210, 0.18));
}

.hero-coordinate {
  position: absolute;
  z-index: 2;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.hero-coordinate--top {
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
}

.hero-coordinate--bottom {
  bottom: 9%;
  left: 50%;
  transform: translateX(-50%);
}

.hero-seal {
  position: absolute;
  right: 4%;
  bottom: 13%;
  z-index: 3;
  display: grid;
  width: 52px;
  height: 86px;
  place-items: center;
  padding: 8px 0;
  color: #f6e9da;
  border: 1px solid rgba(255, 235, 220, 0.75);
  background: var(--red);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.12;
  text-align: center;
  box-shadow: 0 0 32px rgba(226, 75, 54, 0.28);
  transform: rotate(7deg);
}

.hero-cross {
  position: absolute;
  z-index: 3;
  width: 13px;
  height: 13px;
}

.hero-cross::before,
.hero-cross::after {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(233, 225, 210, 0.38);
  content: "";
}

.hero-cross::after {
  transform: rotate(90deg);
}

.hero-cross--a {
  top: 16%;
  left: 8%;
}

.hero-cross--b {
  top: 52%;
  right: 1%;
}

.hero-cross--c {
  bottom: 13%;
  left: 25%;
}

.hero-caption {
  margin: 22px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.hero-caption span {
  margin-right: 12px;
  color: var(--red);
  font-family: var(--serif);
  font-size: 17px;
}

.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  transform: translateX(-50%);
}

.scroll-cue i {
  display: block;
  width: 1px;
  height: 38px;
  background: linear-gradient(var(--muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

.section {
  position: relative;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 140px 5vw;
  scroll-margin-top: 70px;
}

.section--panel {
  max-width: none;
  background:
    radial-gradient(circle at 8% 12%, rgba(226, 75, 54, 0.06), transparent 28%),
    radial-gradient(circle at 90% 78%, rgba(91, 214, 200, 0.035), transparent 30%),
    rgba(233, 225, 210, 0.018);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section--panel > * {
  max-width: calc(var(--max) - 10vw);
  margin-right: auto;
  margin-left: auto;
}

.section--dark {
  max-width: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(91, 214, 200, 0.065), transparent 34%),
    radial-gradient(circle at 18% 70%, rgba(226, 75, 54, 0.04), transparent 24%),
    #0c0e11;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section--dark > * {
  max-width: calc(var(--max) - 10vw);
  margin-right: auto;
  margin-left: auto;
}

.section-head {
  max-width: 900px;
  margin-bottom: 64px;
}

.section-head .section-kicker {
  margin: 0 0 18px;
  color: var(--red);
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 78px);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 1.12;
}

.section-head--split h2 {
  font-size: clamp(40px, 5.2vw, 72px);
}

.section-lede,
.section-intro {
  max-width: 680px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}

.section-head--split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 8vw;
  max-width: none;
  align-items: end;
}

.section-head--split .section-intro {
  max-width: 520px;
  margin: 0 0 6px;
}

.section-intro p {
  margin: 0 0 14px;
}

.manifesto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.manifesto-card {
  position: relative;
  min-height: 300px;
  padding: 34px 30px 28px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  transition: background 0.35s ease;
}

.manifesto-card:last-child {
  border-right: 0;
}

.manifesto-card:hover {
  background: rgba(233, 225, 210, 0.025);
}

.card-index,
.lab-number {
  color: var(--red);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.manifesto-card h3 {
  margin: 28px 0 16px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
}

.manifesto-card p {
  position: relative;
  z-index: 2;
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}

.card-glyph {
  position: absolute;
  right: -6px;
  bottom: -46px;
  color: transparent;
  font-family: var(--serif);
  font-size: 190px;
  line-height: 1;
  -webkit-text-stroke: 1px rgba(233, 225, 210, 0.08);
  user-select: none;
}

.manifesto-quote {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 100px;
  text-align: center;
}

.quote-mark {
  height: 30px;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 64px;
  line-height: 1;
}

.manifesto-quote p {
  margin: 8px 0 12px;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: 0.14em;
}

.manifesto-quote cite {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.14em;
}

.char-search {
  position: relative;
  z-index: 10;
  max-width: 1040px;
  margin: 0 0 44px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.3s ease;
}

.search-box:focus-within {
  border-bottom-color: var(--red);
}

.search-icon {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 28px;
  line-height: 1;
}

.search-box input {
  min-width: 0;
  flex: 1;
  padding: 8px 0;
  color: var(--paper);
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 38px);
  letter-spacing: 0.06em;
}

.search-box input::placeholder {
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.search-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  color: #fff;
  border: 0;
  background: var(--red);
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.search-submit:hover {
  background: var(--red-bright);
  transform: translateY(-1px);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  display: none;
  width: min(620px, 100%);
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: rgba(16, 18, 22, 0.98);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.search-suggestions.is-open {
  display: block;
}

.suggestion {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  color: var(--paper-soft);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.suggestion:last-child {
  border-bottom: 0;
}

.suggestion:hover {
  background: rgba(233, 225, 210, 0.05);
}

.suggestion-char {
  color: var(--red);
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1;
}

.suggestion-main {
  color: var(--paper);
  font-size: 13px;
}

.suggestion-main small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.suggestion-rank {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
}

.quick-picks,
.compose-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.quick-picks button,
.compose-presets button {
  padding: 4px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.quick-picks button:hover,
.compose-presets button:hover {
  color: var(--paper);
  border-color: var(--red);
  background: rgba(226, 75, 54, 0.08);
}

.character-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(340px, 1.28fr) minmax(220px, 0.72fr);
  gap: 24px;
  align-items: start;
}

.character-visual,
.character-detail,
.stat-card,
.lab-panel,
.chart-card,
.method-aside-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(233, 225, 210, 0.035), rgba(233, 225, 210, 0.012));
}

.character-visual {
  position: sticky;
  top: 88px;
  padding: 20px;
}

.character-visual-top,
.character-visual-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-visual-top span:first-child {
  color: var(--red);
}

.detail-glyph-stage {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  margin: 18px 0;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(233, 225, 210, 0.08);
  background:
    radial-gradient(circle at 50% 50%, rgba(233, 225, 210, 0.09), transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(233, 225, 210, 0.035) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(233, 225, 210, 0.035) 39px 40px);
}

.detail-glyph-halo {
  position: absolute;
  width: 56%;
  height: 56%;
  border-radius: 50%;
  background: rgba(226, 75, 54, 0.13);
  filter: blur(34px);
}

.detail-glyph {
  position: relative;
  z-index: 2;
  width: 78%;
  height: 78%;
  color: var(--paper);
  filter: drop-shadow(0 0 18px rgba(233, 225, 210, 0.15));
}

.glyph-baseline {
  position: absolute;
  bottom: 16%;
  left: 18%;
  width: 64%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226, 75, 54, 0.55), transparent);
}

.glyph-controls {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.icon-button,
.small-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-button:hover,
.small-button:hover,
.small-button[aria-pressed="true"] {
  color: var(--paper);
  border-color: var(--line-strong);
  background: rgba(233, 225, 210, 0.05);
}

.icon-button span {
  color: var(--red);
}

.character-detail {
  min-height: 500px;
  padding: clamp(24px, 3.5vw, 46px);
}

.detail-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.detail-overline {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
}

.detail-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(72px, 8vw, 112px);
  font-weight: 400;
  line-height: 0.8;
}

.detail-pinyin {
  margin: 14px 0 0;
  color: var(--red);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.detail-gloss {
  max-width: 170px;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
  text-align: right;
}

.detail-rule {
  height: 1px;
  margin: 30px 0;
  background: linear-gradient(90deg, var(--red), var(--line) 30%, transparent);
}

.detail-section {
  margin-top: 28px;
}

.detail-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.detail-section-head span {
  font-family: var(--serif);
  font-size: 20px;
}

.detail-section-head small {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.composition-equation {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 48px;
}

.component-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px 10px;
  color: var(--paper);
  border: 1px solid var(--line-strong);
  background: rgba(233, 225, 210, 0.035);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.component-chip:hover {
  border-color: var(--red);
  background: rgba(226, 75, 54, 0.1);
}

.component-chip small {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
}

.composition-op {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 14px;
}

.composition-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 6px;
  color: var(--ink);
  background: var(--red);
  font-family: var(--serif);
  font-size: 26px;
}

.detail-note,
.detail-story {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}

.detail-story {
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.95;
}

.family-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.family-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.family-chip b {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
}

.family-chip:hover {
  color: var(--paper);
  border-color: var(--red);
}

.character-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat-card {
  padding: 20px;
}

.stat-label {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.stat-card strong {
  display: block;
  margin: 14px 0 12px;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
}

.rank-track {
  height: 4px;
  overflow: hidden;
  background: rgba(233, 225, 210, 0.1);
}

.rank-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 0.8s var(--ease);
}

.stat-card p {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 54px;
  margin-top: 18px;
}

.mini-bars i {
  display: block;
  flex: 1;
  min-height: 3px;
  background: rgba(233, 225, 210, 0.15);
  transition: background 0.2s ease;
}

.mini-bars i.is-on {
  background: var(--red);
}

.stat-card--quote {
  border-left: 2px solid var(--red);
}

.stat-card--quote p {
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.9;
}

.atlas-strip {
  margin-top: 44px;
  padding: 22px 24px 16px;
  border: 1px solid var(--line);
  background: rgba(233, 225, 210, 0.018);
}

.atlas-strip-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.atlas-strip-head span {
  display: block;
  color: var(--red);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.atlas-strip-head strong {
  display: block;
  margin-top: 5px;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
}

.atlas-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.atlas-filter {
  padding: 5px 9px;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.atlas-filter:hover,
.atlas-filter.is-active {
  color: var(--paper);
  border-color: var(--line-strong);
  background: rgba(233, 225, 210, 0.05);
}

.atlas-filter.is-active {
  color: var(--red);
}

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 1px;
  max-height: 370px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--muted-2) transparent;
}

.atlas-grid::-webkit-scrollbar {
  width: 8px;
}

.atlas-grid::-webkit-scrollbar-track {
  background: transparent;
}

.atlas-grid::-webkit-scrollbar-thumb {
  background: var(--muted-2);
}

.atlas-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  padding: 8px 4px 6px;
  border: 0;
  background: var(--ink);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.atlas-item:hover,
.atlas-item.is-active {
  background: rgba(226, 75, 54, 0.09);
}

.atlas-item b {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}

.atlas-item.is-active b {
  color: var(--red);
}

.atlas-item span {
  margin-top: 5px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
}

.atlas-hint {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.constellation-shell {
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 50%, rgba(91, 214, 200, 0.04), transparent 42%),
    rgba(4, 6, 8, 0.5);
}

.constellation-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.graph-filters,
.graph-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.graph-filter {
  padding: 5px 9px;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.graph-filter:hover,
.graph-filter.is-active {
  color: var(--paper);
  border-color: var(--line-strong);
  background: rgba(233, 225, 210, 0.05);
}

.graph-filter.is-active {
  color: var(--jade);
}

.constellation-canvas-wrap {
  position: relative;
  height: 720px;
  overflow: hidden;
}

#constellationCanvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}

#constellationCanvas:active {
  cursor: grabbing;
}

.graph-legend {
  position: absolute;
  right: 20px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.graph-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.legend-dot,
.legend-diamond,
.legend-line {
  display: inline-block;
  width: 7px;
  height: 7px;
}

.legend-dot {
  border-radius: 50%;
  background: var(--paper);
}

.legend-diamond {
  background: var(--jade);
  transform: rotate(45deg);
}

.legend-line {
  width: 14px;
  height: 1px;
  background: rgba(91, 214, 200, 0.6);
}

.graph-tooltip {
  position: absolute;
  z-index: 5;
  display: none;
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 12, 15, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.graph-tooltip.is-visible {
  display: block;
}

.graph-tooltip strong {
  display: block;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
}

.graph-tooltip span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.graph-inspector {
  position: absolute;
  bottom: 18px;
  left: 18px;
  max-width: 260px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(9, 11, 14, 0.82);
  backdrop-filter: blur(12px);
}

.inspector-label {
  display: block;
  color: var(--jade);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.graph-inspector strong {
  display: block;
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
}

.graph-inspector p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.graph-inspector button {
  margin-top: 10px;
  padding: 0;
  color: var(--red);
  border: 0;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.cluster-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--ink);
}

.cluster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  background: var(--ink);
  cursor: pointer;
  transition: background 0.2s ease;
}

.cluster-item:hover {
  background: rgba(233, 225, 210, 0.04);
}

.cluster-item b {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
}

.cluster-item span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

.lab-panel {
  padding: clamp(22px, 3vw, 40px);
}

.lab-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.lab-panel-head > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lab-panel-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
}

.lab-panel-head p {
  max-width: 220px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-align: right;
}

.lens-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.lens-chip {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--paper-soft);
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--serif);
  font-size: 26px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.lens-chip:hover,
.lens-chip.is-active {
  color: #fff;
  border-color: var(--red);
  background: rgba(226, 75, 54, 0.13);
  transform: translateY(-2px);
}

.lens-summary {
  min-height: 24px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
}

.lens-summary b {
  color: var(--red);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
}

.lens-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.lens-card {
  min-height: 128px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  background: rgba(233, 225, 210, 0.018);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.lens-card:hover {
  border-color: var(--line-strong);
  background: rgba(233, 225, 210, 0.045);
  transform: translateY(-2px);
}

.lens-card b {
  display: block;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 1;
}

.lens-card span {
  display: block;
  margin-top: 9px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 8px;
}

.lens-card small {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.1fr;
  gap: 10px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(233, 225, 210, 0.02);
}

.composer label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.composer select {
  width: 100%;
  margin-top: 7px;
  padding: 10px 8px;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: var(--ink-soft);
  font-family: var(--serif);
  font-size: 22px;
  cursor: pointer;
}

.composer-op {
  padding-bottom: 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 16px;
}

.compose-result {
  display: grid;
  min-height: 58px;
  place-items: center;
  color: var(--ink);
  background: var(--red);
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
}

.compose-result.is-empty {
  color: var(--muted);
  background: rgba(233, 225, 210, 0.06);
  font-family: var(--sans);
  font-size: 10px;
  text-align: center;
}

.lab-note {
  margin-top: 24px;
  padding: 18px;
  border-left: 2px solid var(--jade);
  background: rgba(91, 214, 200, 0.035);
}

.lab-note strong {
  color: var(--jade);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
}

.lab-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.evolution-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.evolution-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 64px;
  padding: 8px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--serif);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.evolution-tab span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.evolution-tab:hover,
.evolution-tab.is-active {
  color: var(--paper);
  border-color: var(--red);
  background: rgba(226, 75, 54, 0.08);
}

.evolution-tab.is-active span {
  color: var(--red);
}

.evolution-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(360px, 1.18fr);
  gap: 5vw;
  align-items: start;
}

.evolution-glyph-card {
  position: sticky;
  top: 88px;
  padding: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 38%, rgba(226, 75, 54, 0.08), transparent 48%),
    rgba(233, 225, 210, 0.02);
}

.evolution-glyph-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.evolution-glyph-head span:first-child {
  color: var(--red);
}

.evolution-glyph-stage {
  display: grid;
  aspect-ratio: 1;
  margin: 18px 0;
  place-items: center;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(0deg, transparent 0 43px, rgba(233, 225, 210, 0.03) 43px 44px),
    repeating-linear-gradient(90deg, transparent 0 43px, rgba(233, 225, 210, 0.03) 43px 44px);
}

.evolution-glyph {
  width: 75%;
  height: 75%;
  color: var(--paper);
}

.pictograph-card {
  display: flex;
  gap: 18px;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pictograph-svg {
  flex: 0 0 118px;
  width: 118px;
  height: 118px;
  color: var(--red);
}

.pictograph-svg svg {
  width: 100%;
  height: 100%;
}

.pictograph-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.pictograph-card p span {
  display: block;
  margin-bottom: 5px;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 16px;
}

.era-list {
  position: relative;
  padding-left: 34px;
}

.era-list::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 6px;
  width: 1px;
  background: linear-gradient(var(--red), var(--line), transparent);
  content: "";
}

.era-item {
  position: relative;
  padding: 0 0 34px 22px;
  opacity: 0.54;
  transition: opacity 0.3s ease;
}

.era-item:last-child {
  padding-bottom: 0;
}

.era-item.is-active,
.era-item:hover {
  opacity: 1;
}

.era-dot {
  position: absolute;
  top: 5px;
  left: -34px;
  width: 13px;
  height: 13px;
  border: 1px solid var(--muted-2);
  border-radius: 50%;
  background: var(--ink);
}

.era-item.is-active .era-dot {
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 0 18px rgba(226, 75, 54, 0.55);
}

.era-time {
  color: var(--red);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.era-item h3 {
  margin: 7px 0 6px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
}

.era-item p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.data-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--line);
}

.data-strip > div {
  padding: 16px 18px;
  background: var(--ink);
}

.data-strip span {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.data-strip strong {
  display: block;
  margin-top: 9px;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.data-panel {
  position: relative;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 90% 10%, rgba(226, 75, 54, 0.05), transparent 32%),
    rgba(233, 225, 210, 0.018);
}

.data-panel--structure {
  grid-column: span 5;
}

.data-panel--bubbles {
  grid-column: span 7;
}

.data-panel--heatmap {
  grid-column: span 7;
}

.data-panel--histogram {
  grid-column: span 5;
}

.data-panel--bands {
  grid-column: span 12;
}

.data-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 6px;
}

.data-panel-head span {
  display: block;
  color: var(--red);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.data-panel-head h3 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
}

.data-panel-head small {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  text-align: right;
}

.data-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 230px;
  margin-top: 8px;
  overflow: visible;
}

.data-svg--heatmap {
  min-height: 300px;
}

.data-svg text {
  font-family: var(--sans);
}

.data-svg .svg-serif {
  font-family: var(--serif);
}

.data-panel--bubbles .bubble {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.data-panel--bubbles .bubble:hover {
  opacity: 0.78;
}

.data-note {
  margin: 16px 0 0;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.03em;
  line-height: 1.8;
}

.frequency-bands {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 26px;
}

.band-bar {
  display: flex;
  height: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(233, 225, 210, 0.04);
}

.band-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  transition: flex-grow 0.8s var(--ease);
}

.band-legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.band-legend div {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}

.band-legend i {
  width: 8px;
  height: 8px;
}

.band-legend b {
  grid-column: 2;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
}

.band-caption {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.frequency-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.65fr);
  gap: 22px;
}

.chart-card {
  padding: 24px;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.chart-head span {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.chart-head strong {
  display: block;
  margin-top: 6px;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
}

.chart-unit {
  text-align: right;
}

.freq-chart-wrap,
.scatter-wrap {
  position: relative;
}

.freq-chart,
.scatter-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  display: none;
  min-width: 130px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 12, 15, 0.95);
  pointer-events: none;
}

.chart-tooltip.is-visible {
  display: block;
}

.chart-tooltip strong {
  display: block;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
}

.chart-tooltip span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.chart-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.chart-foot span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-foot b {
  color: var(--paper-soft);
  font-weight: 400;
}

.chart-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.chart-dot--red {
  background: var(--red);
}

.chart-dot--jade {
  background: var(--jade);
}

.frequency-insights {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insight-card {
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(233, 225, 210, 0.022);
}

.insight-card strong {
  display: block;
  margin: 13px 0 8px;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
}

.insight-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.insight-card--accent {
  border-color: rgba(226, 75, 54, 0.5);
  background: rgba(226, 75, 54, 0.06);
}

.insight-card--accent strong {
  color: var(--red);
}

.chart-card--scatter {
  margin-top: 22px;
}

.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 22px;
}

.method-main,
.method-aside {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(233, 225, 210, 0.02);
}

.pipeline-step {
  padding: 16px;
  border: 1px solid var(--line);
}

.pipeline-step span {
  color: var(--red);
  font-family: var(--mono);
  font-size: 9px;
}

.pipeline-step strong {
  display: block;
  margin: 10px 0 4px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
}

.pipeline-step p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.pipeline > i {
  display: none;
}

.method-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.source-card {
  padding: 20px;
  background: var(--ink);
}

.source-card h3 {
  margin: 0 0 8px;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
}

.source-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.source-card a,
.text-link {
  color: var(--red);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.source-card a:hover,
.text-link:hover {
  color: var(--red-bright);
}

.method-aside-card {
  padding: 24px;
}

.method-aside-card ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.method-aside-card li {
  position: relative;
  padding: 0 0 13px 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.method-aside-card li::before {
  position: absolute;
  top: 9px;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  content: "";
}

.method-aside-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
}

.method-aside-card--license {
  border-color: rgba(91, 214, 200, 0.3);
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px 5vw 48px;
  border-top: 1px solid var(--line);
}

.footer-mark {
  color: var(--red);
  font-family: var(--serif);
  font-size: 62px;
  line-height: 0.7;
}

.footer-copy {
  flex: 1;
}

.footer-copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.footer-copy span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.footer-copy p {
  margin: 20px 0 0;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.footer-meta a {
  color: var(--red);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 500;
  padding: 10px 16px;
  color: var(--ink);
  background: var(--paper);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.stroke-median,
.stroke-fill {
  animation-fill-mode: both;
}

.stroke-median {
  fill: none;
  stroke: currentColor;
  stroke-width: 26;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.58;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: strokeDraw 0.52s cubic-bezier(0.45, 0, 0.2, 1) forwards;
  animation-delay: calc(var(--i) * 0.115s);
}

.stroke-fill {
  fill: currentColor;
  opacity: 0;
  animation: inkIn 0.3s ease forwards;
  animation-delay: calc(var(--i) * 0.115s + 0.18s);
}

.no-animate .stroke-median {
  opacity: 0;
  animation: none;
}

.no-animate .stroke-fill {
  opacity: 1;
  animation: none;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes titleRise {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatChar {
  from {
    transform: translate3d(0, 0, 0) rotate(-2deg);
  }
  to {
    transform: translate3d(0, -18px, 0) rotate(2deg);
  }
}

@keyframes spinSlow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scrollPulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scaleY(0.7);
    transform-origin: top;
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
    transform-origin: top;
  }
}

@keyframes strokeDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes inkIn {
  from {
    opacity: 0;
    filter: blur(5px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@media (max-width: 1180px) {
  .site-nav {
    gap: 14px;
  }

  .site-nav a {
    font-size: 11px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  }

  .character-layout {
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  }

  .character-sidebar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .frequency-grid {
    grid-template-columns: 1fr;
  }

  .frequency-insights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .data-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .data-panel--structure,
  .data-panel--bubbles,
  .data-panel--heatmap,
  .data-panel--histogram {
    grid-column: span 6;
  }
}

@media (max-width: 920px) {
  .site-nav {
    position: fixed;
    top: 74px;
    right: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 16px 5vw 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(9, 10, 12, 0.98);
    transform: translateY(-130%);
    visibility: hidden;
    transition: transform 0.35s var(--ease), visibility 0.35s;
  }

  .site-nav.is-open {
    transform: translateY(0);
    visibility: visible;
  }

  .site-nav a {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }

  .site-nav a::after {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .hero {
    padding-top: 120px;
  }

  .hero-visual {
    justify-self: center;
  }

  .hero-glyph-frame {
    width: min(76vw, 440px);
  }

  .section-head--split {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .character-layout {
    grid-template-columns: 1fr;
  }

  .character-visual {
    position: relative;
    top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .character-visual-top {
    grid-column: 1 / -1;
  }

  .detail-glyph-stage {
    grid-row: span 3;
    margin: 0;
  }

  .glyph-controls,
  .character-visual-foot {
    align-self: end;
  }

  .character-sidebar {
    grid-template-columns: 1fr 1fr;
  }

  .character-sidebar .stat-card--quote {
    grid-column: 1 / -1;
  }

  .lab-grid,
  .evolution-layout,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }

  .data-panel--structure,
  .data-panel--bubbles,
  .data-panel--heatmap,
  .data-panel--histogram,
  .data-panel--bands {
    grid-column: auto;
  }

  .evolution-glyph-card {
    position: relative;
    top: auto;
  }

  .lab-panel-head {
    flex-direction: column;
    gap: 10px;
  }

  .lab-panel-head p {
    max-width: none;
    text-align: left;
  }

  .constellation-canvas-wrap {
    height: 580px;
  }

  .method-sources {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .site-header {
    height: 64px;
    padding: 0 5vw;
  }

  .site-nav {
    top: 64px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 20px;
  }

  .brand-text {
    font-size: 17px;
  }

  .brand-text small {
    display: none;
  }

  .hero {
    padding: 104px 5vw 40px;
  }

  .hero-title {
    margin-top: 24px;
    font-size: clamp(64px, 19.5vw, 108px);
    letter-spacing: -0.13em;
  }

  .hero-subtitle {
    font-size: 18px;
    letter-spacing: 0.18em;
  }

  .hero-lede {
    font-size: 12px;
    line-height: 1.9;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 36px;
  }

  .hero-stats strong {
    font-size: 20px;
  }

  .hero-visual {
    width: 100%;
  }

  .hero-glyph-frame {
    width: min(86vw, 360px);
  }

  .hero-seal {
    width: 42px;
    height: 70px;
    font-size: 12px;
  }

  .hero-caption {
    font-size: 8px;
  }

  .scroll-cue {
    display: none;
  }

  .section {
    padding: 82px 5vw;
  }

  .section-head {
    margin-bottom: 42px;
  }

  .section-head h2 {
    font-size: clamp(38px, 11vw, 56px);
  }

  .manifesto-grid {
    grid-template-columns: 1fr;
  }

  .manifesto-card {
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .manifesto-card:last-child {
    border-bottom: 0;
  }

  .manifesto-quote {
    margin-top: 60px;
  }

  .manifesto-quote p {
    font-size: 21px;
  }

  .search-box {
    gap: 10px;
  }

  .search-box input {
    font-size: 18px;
  }

  .search-submit {
    padding: 10px 12px;
    font-size: 10px;
  }

  .character-visual {
    display: block;
  }

  .detail-glyph-stage {
    margin: 18px 0;
  }

  .glyph-controls {
    margin-bottom: 14px;
  }

  .character-detail {
    padding: 22px 18px;
  }

  .detail-heading h3 {
    font-size: 74px;
  }

  .detail-gloss {
    max-width: 120px;
    font-size: 16px;
  }

  .detail-story {
    font-size: 15px;
  }

  .character-sidebar {
    grid-template-columns: 1fr;
  }

  .character-sidebar .stat-card--quote {
    grid-column: auto;
  }

  .constellation-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .constellation-canvas-wrap {
    height: 620px;
  }

  .graph-inspector {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }

  .graph-legend {
    display: none;
  }

  .cluster-index {
    grid-template-columns: 1fr 1fr;
  }

  .lens-results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .composer {
    grid-template-columns: 1fr auto 1fr;
  }

  .composer-op:nth-of-type(2) {
    display: none;
  }

  .compose-result {
    grid-column: 1 / -1;
  }

  .evolution-tabs {
    gap: 5px;
  }

  .evolution-tab {
    min-width: 54px;
    padding: 6px 8px;
    font-size: 17px;
  }

  .evolution-tab span {
    display: none;
  }

  .pictograph-card {
    align-items: flex-start;
  }

  .pictograph-svg {
    flex-basis: 88px;
    width: 88px;
    height: 88px;
  }

  .chart-card {
    padding: 16px;
  }

  .chart-head {
    flex-direction: column;
    gap: 8px;
  }

  .chart-unit {
    text-align: left;
  }

  .frequency-insights {
    grid-template-columns: 1fr;
  }

  .data-strip {
    grid-template-columns: 1fr 1fr;
  }

  .data-strip > div {
    padding: 12px 14px;
  }

  .data-strip strong {
    font-size: 24px;
  }

  .data-panel {
    padding: 16px;
  }

  .data-panel-head h3 {
    font-size: 21px;
  }

  .band-legend {
    grid-template-columns: 1fr 1fr;
  }

  .pipeline {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .pipeline > i {
    display: none;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 44px 5vw 36px;
  }

  .footer-meta {
    align-items: flex-start;
  }
}

@media (pointer: coarse) {
  .cursor {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .stroke-median {
    opacity: 0;
  }

  .stroke-fill {
    opacity: 1;
  }

  .hero-chars span,
  .hero-orbit,
  .scroll-cue i {
    animation: none;
  }
}
