:root {
  color-scheme: dark;
  --bg: #050816;
  --bg-elevated: rgba(10, 15, 31, 0.72);
  --bg-elevated-2: rgba(14, 20, 40, 0.84);
  --surface: rgba(15, 22, 44, 0.72);
  --surface-strong: rgba(19, 27, 53, 0.88);
  --surface-soft: rgba(16, 24, 48, 0.55);
  --border: rgba(159, 196, 255, 0.14);
  --border-strong: rgba(159, 196, 255, 0.24);
  --text: #f5f8ff;
  --text-strong: #ffffff;
  --text-soft: rgba(223, 233, 255, 0.92);
  --text-muted: rgba(194, 208, 238, 0.68);
  --accent: #8ff3ff;
  --accent-2: #88a4ff;
  --accent-3: #6ee0c6;
  --accent-4: #b8c4ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.24);
  --radius: 24px;
  --radius-lg: 32px;
  --radius-sm: 16px;
  --max-width: 1220px;
  --header-h: 84px;
  --grid-gap: clamp(1rem, 1.6vw, 1.4rem);
  --section-gap: clamp(4.4rem, 8vw, 7rem);
  --font-main: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --field-backdrop-1: rgba(8, 12, 24, 0.96);
  --field-backdrop-2: rgba(4, 8, 18, 0.96);
  --field-glow-a: rgba(143, 243, 255, 0.08);
  --field-glow-b: rgba(136, 164, 255, 0.06);
  --field-bond: rgba(143, 243, 255, 0.18);
  --field-bond-soft: rgba(136, 164, 255, 0.1);
  --field-bead: rgba(214, 246, 255, 0.74);
  --field-bead-core: rgba(255, 255, 255, 0.95);
  --field-particle: rgba(230, 244, 255, 0.58);
  --field-particle-soft: rgba(143, 243, 255, 0.18);
  --field-halo: rgba(143, 243, 255, 0.16);
  --game-bg: rgba(4, 8, 18, 0.92);
  --game-grid: rgba(143, 243, 255, 0.08);
  --game-ink: rgba(245, 248, 255, 0.95);
  --game-soft: rgba(194, 208, 238, 0.45);
  --game-accent: #8ff3ff;
  --game-accent-2: #88a4ff;
  --game-good: #6ee0c6;
  --game-warn: #ff8ea4;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background:
    radial-gradient(circle at 12% 18%, rgba(111, 231, 255, 0.18), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(136, 164, 255, 0.14), transparent 30%),
    radial-gradient(circle at 64% 82%, rgba(110, 224, 198, 0.1), transparent 30%),
    linear-gradient(180deg, #040714 0%, #060b1b 18%, #050816 48%, #060914 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -3;
}

body::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 40%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 120px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 120px
    );
  opacity: 0.18;
}

body::after {
  background:
    radial-gradient(circle at 30% 20%, rgba(143, 243, 255, 0.08), transparent 18%),
    radial-gradient(circle at 70% 80%, rgba(136, 164, 255, 0.08), transparent 22%);
  filter: blur(36px);
  opacity: 0.9;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: rgba(143, 243, 255, 0.22);
  color: #fff;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(8, 13, 29, 0.85);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(143, 243, 255, 0.35), rgba(136, 164, 255, 0.35));
  border: 2px solid rgba(8, 13, 29, 0.85);
  border-radius: 999px;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.96;
}

.site-shell {
  position: relative;
  min-height: 100vh;
}

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 1rem 0 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(8, 12, 26, 0.74);
  border: 1px solid rgba(173, 208, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(20px) saturate(130%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  color: #03131c;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background:
    radial-gradient(circle at 30% 30%, #f2fdff 0%, #9af0ff 34%, #7c90ff 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 34px rgba(143, 243, 255, 0.28);
  flex: 0 0 auto;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(143, 243, 255, 0.35);
  border-radius: 50%;
}

.brand-mark::before {
  inset: -6px;
  opacity: 0.75;
}

.brand-mark::after {
  inset: -13px;
  opacity: 0.25;
}

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

.brand-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-strong);
}

.brand-subtitle {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-muted);
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
  font-size: 0.95rem;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  border-color: rgba(173, 208, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-1px);
  outline: none;
}

.nav-link.active {
  color: var(--text-strong);
  background: linear-gradient(135deg, rgba(143, 243, 255, 0.18), rgba(136, 164, 255, 0.18));
  border-color: rgba(143, 243, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.site-main {
  padding: 1.5rem 0 4.5rem;
}

.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 5.3rem) 0 0;
}

.hero-shell {
  position: relative;
  padding: clamp(1.25rem, 2vw, 1.7rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(9, 13, 29, 0.58), rgba(9, 13, 29, 0.36));
  border: 1px solid rgba(173, 208, 255, 0.12);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-shell::before,
.hero-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-shell::before {
  width: 22rem;
  height: 22rem;
  right: -8rem;
  top: -9rem;
  background: radial-gradient(circle, rgba(143, 243, 255, 0.24), transparent 68%);
  filter: blur(6px);
}

.hero-shell::after {
  width: 18rem;
  height: 18rem;
  left: -6rem;
  bottom: -9rem;
  background: radial-gradient(circle, rgba(136, 164, 255, 0.18), transparent 70%);
  filter: blur(12px);
}

.hero-grid,
.page-hero-grid,
.detail-header-grid,
.playground-grid,
.detail-layout,
.section-split {
  display: grid;
  gap: clamp(1.3rem, 2vw, 2rem);
}

.hero-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.84fr);
  align-items: center;
}

.hero-copy,
.page-head,
.detail-head {
  position: relative;
  z-index: 1;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.45rem 0.78rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(173, 208, 255, 0.14);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(143, 243, 255, 0.45);
}

.hero-title,
.page-title,
.entry-title {
  margin: 0;
  font-size: clamp(2.7rem, 5.6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--text-strong);
}

.hero-title {
  max-width: 14ch;
}

.hero-subtitle,
.page-subtitle,
.entry-headline {
  margin: 1rem 0 0;
  font-size: clamp(1.04rem, 1.8vw, 1.28rem);
  line-height: 1.6;
  color: var(--text-soft);
}

.hero-subtitle {
  max-width: 60ch;
}

.page-title {
  font-size: clamp(2.4rem, 4.8vw, 4.2rem);
  max-width: 14ch;
}

.page-subtitle,
.entry-summary {
  max-width: 65ch;
}

.button-row,
.link-row,
.hero-actions,
.filter-strip,
.quick-links,
.entry-tags,
.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-actions,
.link-row,
.profile-links {
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.95rem;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
  white-space: nowrap;
}

.btn:hover,
.btn:focus-visible,
.chip-button:hover,
.chip-button:focus-visible,
.page-button:hover,
.page-button:focus-visible,
.copy-button:hover,
.copy-button:focus-visible,
.selector-row select:hover,
.selector-row select:focus-visible,
.text-input:hover,
.text-input:focus-visible,
.select-input:hover,
.select-input:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.btn.primary {
  color: #03131c;
  background: linear-gradient(135deg, #baf7ff, #94f2ff 40%, #a9b8ff 100%);
  box-shadow: 0 12px 26px rgba(143, 243, 255, 0.2);
}

.btn.secondary {
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(173, 208, 255, 0.16);
}

.btn.ghost {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(173, 208, 255, 0.1);
}

.btn.primary:hover,
.btn.primary:focus-visible {
  box-shadow: 0 18px 34px rgba(143, 243, 255, 0.28);
}

.btn.secondary:hover,
.btn.secondary:focus-visible,
.btn.ghost:hover,
.btn.ghost:focus-visible {
  border-color: rgba(143, 243, 255, 0.26);
  background: rgba(255, 255, 255, 0.07);
}

.tag-list,
.focus-tags,
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.tag,
.meta-chip,
.meta-label {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  font-size: 0.82rem;
  line-height: 1.2;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(173, 208, 255, 0.13);
  color: var(--text-soft);
}

.meta-chip {
  color: var(--accent);
  background: rgba(143, 243, 255, 0.08);
  border: 1px solid rgba(143, 243, 255, 0.18);
  font-weight: 700;
}

.meta-label {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-card {
  position: relative;
  padding: clamp(1.1rem, 2vw, 1.35rem);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    rgba(10, 16, 33, 0.72);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(132%);
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 40%, transparent 62%, rgba(143, 243, 255, 0.04));
  pointer-events: none;
}

.tilt-card {
  transform-style: preserve-3d;
  transition: transform 160ms ease, border-color 180ms ease, box-shadow 180ms ease;
  will-change: transform;
}

.tilt-card:hover,
.tilt-card:focus-within {
  border-color: rgba(143, 243, 255, 0.24);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
}

.card-title,
.repo-title,
.detail-section h2,
.card-number {
  margin: 0;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

.card-title {
  font-size: 1.25rem;
  line-height: 1.28;
}

.card-body,
.card-authors,
.card-citation,
.repo-headline,
.lead-paragraph,
.detail-copy,
.page-lead,
.panel-copy,
.empty-state p,
.hero-note {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.72;
}

.card-body + .tag-list,
.card-citation + .card-body,
.repo-headline + .card-body,
.detail-copy + .tag-list {
  margin-top: 1rem;
}

.card-authors {
  margin-top: 0.75rem;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.card-citation {
  margin-top: 0.42rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.section {
  margin-top: var(--section-gap);
}

.section-head,
.page-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.section-title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.section-copy {
  margin: 0.55rem 0 0;
  max-width: 60ch;
  color: var(--text-muted);
  line-height: 1.7;
}

.section-grid {
  display: grid;
  gap: var(--grid-gap);
}

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

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

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

.bio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.9fr);
  gap: var(--grid-gap);
  align-items: start;
}

.bio-paragraphs,
.bio-side {
  display: grid;
  gap: 1rem;
}

.lead-paragraph {
  font-size: 1rem;
}

.hero-side,
.bio-side,
.side-stack {
  display: grid;
  gap: 1rem;
}

.stat-grid,
.metric-strip,
.inline-stats {
  display: grid;
  gap: 0.9rem;
}

.metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1.35rem;
}

.stat-card {
  min-height: 6.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-value {
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  font-weight: 750;
  line-height: 1.2;
  color: var(--text-strong);
}

.hero-visual {
  position: relative;
  min-height: 100%;
}

.portrait-shell {
  position: relative;
  width: min(100%, 430px);
  margin-inline: auto;
  padding: 1rem;
  aspect-ratio: 0.92;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(8, 12, 28, 0.78);
  border: 1px solid rgba(173, 208, 255, 0.14);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.portrait-shell::before,
.portrait-shell::after,
.portrait-orbit,
.portrait-orbit--b,
.portrait-orbit--c {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.portrait-shell::before {
  inset: 10% 18%;
  border: 1px solid rgba(143, 243, 255, 0.12);
  animation: orbitSpin 18s linear infinite;
}

.portrait-shell::after {
  inset: 24% 10%;
  border: 1px dashed rgba(136, 164, 255, 0.14);
  animation: orbitSpinReverse 24s linear infinite;
}

.portrait-orbit {
  inset: -14%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0.7;
  animation: orbitSpin 32s linear infinite;
}

.portrait-orbit--b {
  inset: 7%;
  border: 1px solid rgba(110, 224, 198, 0.14);
  animation: orbitSpinReverse 20s linear infinite;
}

.portrait-orbit--c {
  inset: 30% 22%;
  border: 1px solid rgba(143, 243, 255, 0.18);
  animation: orbitSpin 12s linear infinite;
}

.orbit-dot,
.orbit-dot--b,
.orbit-dot--c {
  position: absolute;
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #d8fcff, #96f3ff 55%, #84a0ff 100%);
  box-shadow: 0 0 18px rgba(143, 243, 255, 0.4);
}

.orbit-dot {
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.orbit-dot--b {
  right: 20%;
  bottom: 18%;
  width: 0.56rem;
  height: 0.56rem;
}

.orbit-dot--c {
  left: 13%;
  bottom: 22%;
  width: 0.5rem;
  height: 0.5rem;
}

.portrait-image-wrap {
  position: absolute;
  inset: 11%;
  border-radius: 26px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(143, 243, 255, 0.06), rgba(136, 164, 255, 0.05)),
    rgba(7, 12, 22, 0.65);
  border: 1px solid rgba(173, 208, 255, 0.1);
}

.portrait-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.03);
}

.portrait-caption {
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 1.1rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(6, 11, 21, 0.68);
  border: 1px solid rgba(173, 208, 255, 0.1);
  backdrop-filter: blur(12px);
}

.portrait-caption strong {
  display: block;
  font-size: 0.96rem;
  color: var(--text-strong);
}

.portrait-caption span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.pillar-card,
.spotlight-card,
.publication-card,
.repo-card,
.info-card,
.detail-section,
.panel-card,
.playground-card {
  display: grid;
  gap: 0.9rem;
}

.publication-card.compact {
  min-height: 100%;
}

.repo-topline,
.card-meta,
.info-row,
.entry-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.repo-headline {
  font-weight: 600;
  color: var(--accent-4);
}

.page-hero,
.detail-header,
.leisure-hero {
  padding-top: clamp(2.7rem, 5vw, 4rem);
}

.page-hero-shell,
.detail-header-shell,
.playground-shell {
  position: relative;
  padding: clamp(1.2rem, 2vw, 1.6rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(9, 13, 29, 0.62), rgba(9, 13, 29, 0.42));
  border: 1px solid rgba(173, 208, 255, 0.12);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.page-hero-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.95fr);
  align-items: stretch;
}

.page-side-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.page-side-panel .glass-card,
.hero-side .glass-card,
.panel-card {
  min-height: 100%;
}

.list-block,
.section-list {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.7rem;
  color: var(--text-soft);
  line-height: 1.72;
}

.list-block li::marker,
.section-list li::marker {
  color: var(--accent);
}

.control-panel {
  display: grid;
  gap: 1rem;
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.55fr);
  gap: 1rem;
  align-items: end;
}

.control {
  display: grid;
  gap: 0.5rem;
}

.control label,
.selector-label {
  color: var(--text-muted);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.text-input,
.select-input,
.selector-row select {
  appearance: none;
  width: 100%;
  min-height: 3.05rem;
  padding: 0.82rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(173, 208, 255, 0.14);
  background: rgba(9, 14, 27, 0.78);
  color: var(--text-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.text-input::placeholder {
  color: rgba(194, 208, 238, 0.46);
}

.text-input:focus-visible,
.select-input:focus-visible,
.selector-row select:focus-visible {
  border-color: rgba(143, 243, 255, 0.34);
  box-shadow: 0 0 0 4px rgba(143, 243, 255, 0.08);
}

.chip-wrap,
.pagination,
.selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.chip-button,
.page-button,
.copy-button {
  min-height: 2.55rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(173, 208, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.chip-button.active,
.page-button.active {
  color: #03131c;
  border-color: rgba(143, 243, 255, 0.35);
  background: linear-gradient(135deg, #baf7ff, #97f2ff 44%, #acbaff 100%);
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.results-grid,
.repo-grid {
  display: grid;
  gap: var(--grid-gap);
}

.software-map {
  display: grid;
  gap: 0.95rem;
}

.software-map-lane {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.software-map-lane::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(143, 243, 255, 0.14), transparent);
  transform: translateY(-50%);
  pointer-events: none;
}

.software-node {
  position: relative;
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(143, 243, 255, 0.09), rgba(136, 164, 255, 0.08)),
    rgba(8, 13, 25, 0.82);
  border: 1px solid rgba(143, 243, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.software-node strong {
  font-size: 1rem;
}

.software-node span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.software-node:hover,
.software-node:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(143, 243, 255, 0.28);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
  outline: none;
}

.software-map-notes {
  display: grid;
  gap: 0.75rem;
}

.software-edge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(173, 208, 255, 0.1);
}

.software-edge span,
.software-edge em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.software-edge em {
  justify-self: center;
  font-style: normal;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.empty-state {
  min-height: 15rem;
  place-items: center;
  text-align: center;
}

.empty-state h3 {
  font-size: 1.3rem;
}

.detail-header-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.78fr);
  align-items: start;
}

.detail-layout {
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.45fr);
  align-items: start;
}

.detail-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  display: grid;
  gap: 1rem;
}

.detail-main {
  display: grid;
  gap: 1rem;
}

.detail-section h2 {
  font-size: 1.32rem;
}

.code-grid {
  display: grid;
  gap: 0.85rem;
}

.code-block {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(173, 208, 255, 0.12);
  background: rgba(8, 12, 24, 0.82);
}

.code-block-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.78rem 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(173, 208, 255, 0.08);
}

.code-block-top span {
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.copy-button {
  min-height: 2.25rem;
  padding-inline: 0.8rem;
  font-size: 0.88rem;
}

.code-block pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  color: #def5ff;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.6;
}

.quick-links {
  margin-top: 0.3rem;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.pager-link {
  display: grid;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(173, 208, 255, 0.12);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.pager-link span {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pager-link strong {
  font-size: 1rem;
}

.pager-link:hover,
.pager-link:focus-visible {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(143, 243, 255, 0.22);
  outline: none;
}

.playground-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.62fr);
  align-items: stretch;
}

.playground-card {
  padding: 0;
  overflow: hidden;
  min-height: min(72vh, 720px);
}

.playground-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: min(72vh, 720px);
  background:
    radial-gradient(circle at 50% 30%, rgba(143, 243, 255, 0.05), transparent 45%),
    rgba(4, 8, 18, 0.88);
}

.panel-stack {
  display: grid;
  gap: 1rem;
}

.mode-panel {
  display: grid;
  gap: 1rem;
}

.mode-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.mode-subtitle {
  color: var(--accent);
  font-weight: 650;
  font-size: 0.96rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.selector-row {
  margin-top: 0.2rem;
}

.selector-row select {
  flex: 1 1 220px;
}

.footer {
  padding: 2rem 0 3.6rem;
}

.footer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 22px;
  background: rgba(8, 12, 24, 0.6);
  border: 1px solid rgba(173, 208, 255, 0.1);
}

.footer-copy {
  color: var(--text-muted);
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-soft);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 520ms ease, transform 520ms ease;
}

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

.helper-note {
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.mono-note {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(173, 208, 255, 0.16), transparent);
  margin: 0.3rem 0;
}

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

@keyframes orbitSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbitSpinReverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

@media (max-width: 1100px) {
  .hero-grid,
  .page-hero-grid,
  .detail-header-grid,
  .playground-grid,
  .detail-layout,
  .bio-grid {
    grid-template-columns: 1fr;
  }

  .detail-sidebar {
    position: static;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    border-radius: 28px;
    padding: 1rem;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
  }

  .site-main {
    padding-top: 1rem;
  }

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

  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .pager,
  .software-map-lane {
    grid-template-columns: 1fr;
  }

  .software-map-lane::before {
    display: none;
  }

  .footer-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  .hero-shell,
  .page-hero-shell,
  .detail-header-shell,
  .playground-shell,
  .glass-card {
    border-radius: 22px;
  }

  .hero-title,
  .page-title,
  .entry-title,
  .mode-title {
    letter-spacing: -0.045em;
  }

  .btn,
  .nav-link {
    width: 100%;
  }

  .button-row,
  .link-row,
  .profile-links,
  .hero-actions,
  .quick-links,
  .footer-links {
    display: grid;
    width: 100%;
  }

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

  .playground-card,
  .playground-canvas {
    min-height: 56vh;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}


body,
body::before,
body::after {
  transition: background 280ms ease, color 220ms ease, opacity 220ms ease, filter 280ms ease;
}

.topbar,
.hero-shell,
.page-hero-shell,
.detail-header-shell,
.playground-shell,
.glass-card,
.footer-card,
.text-input,
.select-input,
.selector-row select,
.chip-button,
.page-button,
.copy-button,
.btn,
.nav-link,
.software-node,
.software-edge,
.code-block,
.code-block-top,
.playground-canvas,
.portrait-shell,
.portrait-image-wrap,
.portrait-caption {
  transition:
    background 260ms ease,
    border-color 220ms ease,
    color 220ms ease,
    box-shadow 260ms ease,
    transform 180ms ease;
}

.theme-toggle {
  appearance: none;
  gap: 0.55rem;
  padding-inline: 0.92rem;
  background: transparent;
}

.theme-toggle [data-theme-icon] {
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle [data-theme-label] {
  font-size: 0.92rem;
  font-weight: 650;
}

.playground-canvas {
  background: radial-gradient(circle at 50% 30%, var(--game-grid), transparent 45%), var(--game-bg);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7ff;
  --bg-elevated: rgba(255, 255, 255, 0.82);
  --bg-elevated-2: rgba(247, 250, 255, 0.94);
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: rgba(252, 253, 255, 0.96);
  --surface-soft: rgba(237, 243, 255, 0.72);
  --border: rgba(58, 92, 160, 0.14);
  --border-strong: rgba(58, 92, 160, 0.22);
  --text: #16233a;
  --text-strong: #0a1528;
  --text-soft: rgba(22, 35, 58, 0.9);
  --text-muted: rgba(62, 82, 118, 0.72);
  --accent: #1f72ff;
  --accent-2: #5b7cff;
  --accent-3: #0fb99a;
  --accent-4: #2f56b7;
  --shadow: 0 24px 60px rgba(109, 133, 180, 0.18);
  --shadow-soft: 0 14px 34px rgba(109, 133, 180, 0.14);
  --field-backdrop-1: rgba(251, 253, 255, 0.96);
  --field-backdrop-2: rgba(239, 245, 255, 0.96);
  --field-glow-a: rgba(31, 114, 255, 0.08);
  --field-glow-b: rgba(15, 185, 154, 0.06);
  --field-bond: rgba(31, 114, 255, 0.18);
  --field-bond-soft: rgba(91, 124, 255, 0.1);
  --field-bead: rgba(67, 100, 180, 0.34);
  --field-bead-core: rgba(255, 255, 255, 0.98);
  --field-particle: rgba(21, 44, 92, 0.32);
  --field-particle-soft: rgba(31, 114, 255, 0.14);
  --field-halo: rgba(31, 114, 255, 0.12);
  --game-bg: rgba(247, 250, 255, 0.96);
  --game-grid: rgba(31, 114, 255, 0.08);
  --game-ink: rgba(10, 21, 40, 0.95);
  --game-soft: rgba(67, 92, 132, 0.38);
  --game-accent: #1f72ff;
  --game-accent-2: #5b7cff;
  --game-good: #0fb99a;
  --game-warn: #ea5b73;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 10% 16%, rgba(93, 150, 255, 0.16), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(91, 124, 255, 0.12), transparent 30%),
    radial-gradient(circle at 65% 82%, rgba(15, 185, 154, 0.08), transparent 28%),
    linear-gradient(180deg, #f9fbff 0%, #f4f8ff 18%, #eef5ff 50%, #ecf4ff 100%);
}

:root[data-theme="light"] body::before {
  background:
    linear-gradient(135deg, rgba(20, 36, 68, 0.035) 0%, transparent 40%),
    repeating-linear-gradient(
      90deg,
      rgba(20, 36, 68, 0.025) 0,
      rgba(20, 36, 68, 0.025) 1px,
      transparent 1px,
      transparent 120px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(20, 36, 68, 0.018) 0,
      rgba(20, 36, 68, 0.018) 1px,
      transparent 1px,
      transparent 120px
    );
  opacity: 0.36;
}

:root[data-theme="light"] body::after {
  background:
    radial-gradient(circle at 28% 18%, rgba(31, 114, 255, 0.12), transparent 18%),
    radial-gradient(circle at 72% 80%, rgba(15, 185, 154, 0.08), transparent 22%);
  filter: blur(36px);
  opacity: 0.92;
}

:root[data-theme="light"] ::selection {
  background: rgba(31, 114, 255, 0.16);
  color: #071222;
}

:root[data-theme="light"] ::-webkit-scrollbar-track {
  background: rgba(233, 240, 255, 0.9);
}

:root[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(31, 114, 255, 0.28), rgba(91, 124, 255, 0.28));
  border: 2px solid rgba(233, 240, 255, 0.9);
}

:root[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(58, 92, 160, 0.12);
  box-shadow: 0 12px 34px rgba(119, 143, 185, 0.16);
}

:root[data-theme="light"] .brand-mark {
  color: #ffffff;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #7fc0ff 30%, #4f66ff 100%);
  box-shadow:
    0 0 0 1px rgba(31, 114, 255, 0.08),
    0 0 28px rgba(31, 114, 255, 0.18);
}

:root[data-theme="light"] .brand-mark::before,
:root[data-theme="light"] .brand-mark::after {
  border-color: rgba(31, 114, 255, 0.18);
}

:root[data-theme="light"] .nav-link:hover,
:root[data-theme="light"] .nav-link:focus-visible {
  color: var(--text-strong);
  border-color: rgba(31, 114, 255, 0.16);
  background: rgba(31, 114, 255, 0.06);
}

:root[data-theme="light"] .nav-link.active {
  color: var(--text-strong);
  background: linear-gradient(135deg, rgba(31, 114, 255, 0.14), rgba(91, 124, 255, 0.13));
  border-color: rgba(31, 114, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

:root[data-theme="light"] .hero-shell,
:root[data-theme="light"] .page-hero-shell,
:root[data-theme="light"] .detail-header-shell,
:root[data-theme="light"] .playground-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(248, 251, 255, 0.72));
  border-color: rgba(58, 92, 160, 0.12);
}

:root[data-theme="light"] .hero-shell::before {
  background: radial-gradient(circle, rgba(31, 114, 255, 0.16), transparent 68%);
}

:root[data-theme="light"] .hero-shell::after {
  background: radial-gradient(circle, rgba(15, 185, 154, 0.1), transparent 70%);
}

:root[data-theme="light"] .glass-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 250, 255, 0.74)),
    rgba(255, 255, 255, 0.76);
  border-color: rgba(58, 92, 160, 0.12);
  box-shadow: 0 16px 34px rgba(109, 133, 180, 0.12);
}

:root[data-theme="light"] .glass-card::before {
  background: linear-gradient(135deg, rgba(31, 114, 255, 0.05), transparent 40%, transparent 62%, rgba(15, 185, 154, 0.03));
}

:root[data-theme="light"] .portrait-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 255, 0.8)),
    rgba(255, 255, 255, 0.84);
  border-color: rgba(58, 92, 160, 0.12);
  box-shadow: 0 22px 48px rgba(109, 133, 180, 0.14);
}

:root[data-theme="light"] .portrait-shell::before,
:root[data-theme="light"] .portrait-orbit--c {
  border-color: rgba(31, 114, 255, 0.18);
}

:root[data-theme="light"] .portrait-shell::after,
:root[data-theme="light"] .portrait-orbit,
:root[data-theme="light"] .portrait-orbit--b {
  border-color: rgba(91, 124, 255, 0.12);
}

:root[data-theme="light"] .orbit-dot,
:root[data-theme="light"] .orbit-dot--b,
:root[data-theme="light"] .orbit-dot--c {
  background: linear-gradient(180deg, #ffffff, #8fd0ff 55%, #5b7cff 100%);
  box-shadow: 0 0 14px rgba(31, 114, 255, 0.22);
}

:root[data-theme="light"] .portrait-image-wrap {
  background:
    linear-gradient(180deg, rgba(31, 114, 255, 0.04), rgba(91, 124, 255, 0.04)),
    rgba(255, 255, 255, 0.9);
  border-color: rgba(58, 92, 160, 0.08);
}

:root[data-theme="light"] .portrait-caption {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(58, 92, 160, 0.1);
}

:root[data-theme="light"] .tag,
:root[data-theme="light"] .meta-label {
  background: rgba(31, 114, 255, 0.05);
  border-color: rgba(58, 92, 160, 0.1);
}

:root[data-theme="light"] .kicker {
  background: rgba(31, 114, 255, 0.05);
  border-color: rgba(58, 92, 160, 0.12);
}

:root[data-theme="light"] .meta-chip {
  background: rgba(31, 114, 255, 0.08);
  border-color: rgba(31, 114, 255, 0.14);
}

:root[data-theme="light"] .btn.secondary,
:root[data-theme="light"] .btn.ghost,
:root[data-theme="light"] .chip-button,
:root[data-theme="light"] .page-button,
:root[data-theme="light"] .copy-button {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(58, 92, 160, 0.12);
  color: var(--text-soft);
}

:root[data-theme="light"] .btn.secondary:hover,
:root[data-theme="light"] .btn.secondary:focus-visible,
:root[data-theme="light"] .btn.ghost:hover,
:root[data-theme="light"] .btn.ghost:focus-visible,
:root[data-theme="light"] .chip-button:hover,
:root[data-theme="light"] .chip-button:focus-visible,
:root[data-theme="light"] .page-button:hover,
:root[data-theme="light"] .page-button:focus-visible,
:root[data-theme="light"] .copy-button:hover,
:root[data-theme="light"] .copy-button:focus-visible {
  border-color: rgba(31, 114, 255, 0.2);
  background: rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .chip-button.active,
:root[data-theme="light"] .page-button.active {
  color: #ffffff;
  border-color: rgba(31, 114, 255, 0.28);
  background: linear-gradient(135deg, #1f72ff, #5b7cff);
}

:root[data-theme="light"] .text-input,
:root[data-theme="light"] .select-input,
:root[data-theme="light"] .selector-row select {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(58, 92, 160, 0.12);
  color: var(--text-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

:root[data-theme="light"] .text-input::placeholder {
  color: rgba(62, 82, 118, 0.5);
}

:root[data-theme="light"] .software-node {
  background:
    linear-gradient(180deg, rgba(31, 114, 255, 0.08), rgba(91, 124, 255, 0.06)),
    rgba(255, 255, 255, 0.84);
  border-color: rgba(31, 114, 255, 0.12);
}

:root[data-theme="light"] .software-edge,
:root[data-theme="light"] .pager-link {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(58, 92, 160, 0.1);
}

:root[data-theme="light"] .code-block {
  background: rgba(246, 249, 255, 0.96);
  border-color: rgba(58, 92, 160, 0.1);
}

:root[data-theme="light"] .code-block-top {
  background: rgba(31, 114, 255, 0.05);
  border-bottom-color: rgba(58, 92, 160, 0.08);
}

:root[data-theme="light"] .code-block pre {
  color: #10203d;
}

:root[data-theme="light"] .footer-card {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(58, 92, 160, 0.1);
}

:root[data-theme="light"] .playground-canvas {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}


/* --- v3 minimal upgrade: publication figures + richer leisure UI --- */
.results-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.publication-card {
  align-content: start;
}

.publication-figure-shell {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 18% 18%, rgba(143, 243, 255, 0.14), transparent 34%),
    radial-gradient(circle at 82% 72%, rgba(136, 164, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    rgba(8, 13, 25, 0.74);
  border: 1px solid rgba(173, 208, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.publication-figure {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.publication-figure-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.55rem;
  padding: 1.2rem;
  text-align: center;
}

.figure-slot-title {
  display: block;
  font-size: 1rem;
  color: var(--text-strong);
}

.figure-slot-path {
  display: inline-flex;
  justify-self: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(173, 208, 255, 0.14);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.4;
  max-width: min(100%, 40ch);
  word-break: break-all;
}

.figure-slot-note,
.publication-figure-note {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.publication-figure-note {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  left: 0.8rem;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  background: rgba(6, 11, 21, 0.62);
  border: 1px solid rgba(173, 208, 255, 0.12);
  backdrop-filter: blur(12px);
}

.publication-card.compact .publication-figure-shell {
  display: none;
}

.panel-row,
.leaderboard-head,
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.panel-row,
.leaderboard-head {
  justify-content: space-between;
}

.player-id-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(143, 243, 255, 0.12), rgba(136, 164, 255, 0.08)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(143, 243, 255, 0.18);
  color: var(--text-soft);
}

.player-id-chip strong {
  color: var(--text-strong);
}

.leaderboard-scope {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.leaderboard-item {
  justify-content: space-between;
  padding: 0.8rem 0.9rem;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(143, 243, 255, 0.08), rgba(136, 164, 255, 0.05)),
    rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(173, 208, 255, 0.12);
}

.leaderboard-rank {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(143, 243, 255, 0.22), rgba(136, 164, 255, 0.16));
  color: var(--text-strong);
  font-weight: 800;
}

.leaderboard-main {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
  flex: 1 1 auto;
}

.leaderboard-name {
  color: var(--text-strong);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-score {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 7, 16, 0.56);
  backdrop-filter: blur(14px);
}

.modal-shell[hidden] {
  display: none !important;
}

.modal-card {
  width: min(100%, 460px);
  padding: 1.2rem;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(8, 13, 25, 0.92), rgba(8, 13, 25, 0.78));
  border: 1px solid rgba(173, 208, 255, 0.14);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.modal-title {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.modal-copy {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.modal-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.modal-actions .btn {
  width: auto;
}

.small-note {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.btn.inline-btn {
  width: auto;
  min-height: 2.6rem;
  padding-inline: 0.95rem;
}

:root[data-theme="light"] .publication-figure-shell {
  background:
    radial-gradient(circle at 16% 18%, rgba(31, 114, 255, 0.14), transparent 34%),
    radial-gradient(circle at 82% 76%, rgba(15, 185, 154, 0.11), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.36)),
    rgba(245, 249, 255, 0.88);
  border-color: rgba(58, 92, 160, 0.15);
}

:root[data-theme="light"] .figure-slot-path,
:root[data-theme="light"] .player-id-chip,
:root[data-theme="light"] .leaderboard-item {
  border-color: rgba(58, 92, 160, 0.15);
}

:root[data-theme="light"] .publication-figure-note,
:root[data-theme="light"] .modal-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(58, 92, 160, 0.14);
}

@media (max-width: 980px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .leaderboard-item {
    align-items: flex-start;
  }

  .leaderboard-score {
    margin-left: 2.75rem;
  }

  .modal-actions {
    display: grid;
  }

  .modal-actions .btn {
    width: 100%;
  }
}


/* --- v4 minimal refinements: compact home, package logos, cleaner leisure panels --- */
.compact-home-shell {
  padding-block: clamp(1.05rem, 1.8vw, 1.4rem);
}

.repo-brand,
.entry-brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
}

.repo-brand-copy,
.entry-brand-copy,
.software-node-copy {
  min-width: 0;
  display: grid;
  gap: 0.22rem;
}

.repo-logo,
.entry-logo,
.software-node-logo {
  flex: 0 0 auto;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 18px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(173, 208, 255, 0.2);
  box-shadow: 0 12px 24px rgba(3, 8, 20, 0.12);
  padding: 0.3rem;
}

.entry-brand {
  margin-bottom: 1rem;
}

.entry-logo {
  width: 4rem;
  height: 4rem;
  border-radius: 22px;
  padding: 0.42rem;
}

.repo-brand .repo-headline {
  margin-top: 0;
}

.software-node {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.software-node-logo {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 14px;
  padding: 0.22rem;
}

.software-node-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px rgba(143, 243, 255, 0.3);
}

#software-preview {
  align-content: start;
}

#software-preview .repo-card {
  min-height: 100%;
}

.results-grid {
  align-items: start;
}

.publication-card {
  align-content: start;
}

.playground-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.8fr);
}

.panel-stack {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.mode-panel .selector-row {
  margin-top: 0.25rem;
}

.mode-panel .helper-note {
  margin: 0;
}

:root[data-theme="light"] .repo-logo,
:root[data-theme="light"] .entry-logo,
:root[data-theme="light"] .software-node-logo {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(58, 92, 160, 0.16);
}

@media (max-width: 1180px) {
  .playground-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .repo-brand,
  .entry-brand {
    align-items: flex-start;
  }

  .entry-logo {
    width: 3.5rem;
    height: 3.5rem;
  }
}

/* --- v5 minimal refinements: wormlike field, lean subpages, full-window leisure --- */
body.subpage .site-main {
  padding-bottom: clamp(2.8rem, 5vw, 4rem);
}

.page-hero-compact {
  padding-top: clamp(1.4rem, 3vw, 2.2rem);
}

.compact-shell {
  padding: clamp(0.95rem, 1.7vw, 1.25rem);
}

.compact-page-head {
  display: grid;
  gap: 0.55rem;
  max-width: 760px;
}

.compact-page-subtitle {
  margin: 0;
  max-width: 72ch;
}

.compact-page-summary {
  color: var(--text-muted);
}

.compact-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.1rem;
}

.compact-meta-row .meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(173, 208, 255, 0.14);
}

.compact-meta-row .meta-chip strong {
  color: var(--text-strong);
}

.section-tight {
  padding-top: 1rem;
}

.section-tight-bottom {
  padding-top: 1rem;
  padding-bottom: 0;
}

.compact-control-panel {
  padding: 1rem 1.05rem;
}

.compact-control-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.48fr);
}

.compact-control-grid-single {
  grid-template-columns: 1fr;
}

body.subpage .publication-card,
body.subpage .repo-card,
body.subpage .detail-section-compact {
  gap: 0.72rem;
}

body.subpage .publication-card .card-title,
body.subpage .repo-card .card-title {
  font-size: 1.04rem;
}

body.subpage .publication-card .card-authors,
body.subpage .publication-card .card-body,
body.subpage .repo-headline,
body.subpage .repo-card .card-body,
body.subpage .compact-page-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.subpage .publication-card .card-authors {
  -webkit-line-clamp: 2;
}

body.subpage .publication-card .card-body,
body.subpage .repo-card .card-body,
body.subpage .repo-headline,
body.subpage .compact-page-summary {
  -webkit-line-clamp: 3;
}

body.subpage .publication-card .tag-list,
body.subpage .repo-card .tag-list {
  gap: 0.45rem;
}

body.subpage .publication-card .button-row,
body.subpage .repo-card .button-row {
  gap: 0.6rem;
}

body.subpage .repo-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-main-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
  align-items: start;
}

.command-section {
  grid-column: 1 / -1;
}

.compact-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.compact-command-title {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  color: var(--text-soft);
}

body.subpage .detail-section-compact .section-list {
  gap: 0.55rem;
}

body.leisure-page {
  min-height: 100dvh;
  overflow: hidden;
}

body.leisure-page::before,
body.leisure-page::after {
  opacity: 0.55;
}

body.leisure-page .site-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

body.leisure-page .site-main,
.leisure-main {
  min-height: 0;
  height: 100%;
  padding: 0 0 1rem;
}

.leisure-stage {
  position: relative;
  width: min(calc(100% - 2rem), var(--max-width));
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(9, 13, 29, 0.46), rgba(9, 13, 29, 0.3));
  border: 1px solid rgba(173, 208, 255, 0.12);
  box-shadow: var(--shadow);
}

.playground-canvas-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.leisure-hud {
  position: absolute;
  z-index: 4;
  max-width: min(420px, calc(100% - 2rem));
  padding: 0.75rem 0.9rem;
  border-radius: 22px;
  background: rgba(8, 13, 25, 0.62);
  border: 1px solid rgba(173, 208, 255, 0.14);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.leisure-hud-primary {
  top: 1rem;
  left: 1rem;
  width: min(430px, calc(100% - 2rem));
  display: grid;
  gap: 0.35rem;
}

.leisure-hud-metrics {
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hud-chip {
  display: grid;
  gap: 0.12rem;
  min-width: 76px;
}

.hud-chip span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hud-chip strong {
  font-size: 1.15rem;
  line-height: 1;
  color: var(--text-strong);
}

.leisure-hud-controls {
  top: 6.35rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.leisure-hud-controls select {
  appearance: none;
  min-width: 220px;
  min-height: 2.55rem;
  padding: 0.65rem 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(173, 208, 255, 0.14);
  background: rgba(9, 14, 27, 0.8);
  color: var(--text-strong);
}

.leisure-hud-note {
  left: 1rem;
  bottom: 1rem;
  width: min(470px, calc(100% - 2rem));
  display: grid;
  gap: 0.35rem;
}

.hud-copy,
.hud-note {
  margin: 0;
}

.hud-copy {
  color: var(--text-soft);
  line-height: 1.55;
}

.hud-note {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.leisure-page .mode-title {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}

.leisure-page .inline-btn {
  min-height: 2.55rem;
}

:root[data-theme="light"] .compact-meta-row .meta-chip,
:root[data-theme="light"] .leisure-hud,
:root[data-theme="light"] .leisure-hud-controls select {
  border-color: rgba(58, 92, 160, 0.15);
}

:root[data-theme="light"] .leisure-stage {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.36));
  border-color: rgba(58, 92, 160, 0.14);
}

:root[data-theme="light"] .leisure-hud,
:root[data-theme="light"] .leisure-hud-controls select {
  background: rgba(255, 255, 255, 0.84);
}

@media (max-width: 980px) {
  body.subpage .repo-grid,
  .detail-main-compact,
  .compact-command-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .leisure-stage {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  .leisure-hud-primary,
  .leisure-hud-note,
  .leisure-hud-metrics,
  .leisure-hud-controls {
    max-width: calc(100% - 1rem);
  }

  .leisure-hud-primary,
  .leisure-hud-note {
    left: 0.5rem;
  }

  .leisure-hud-metrics,
  .leisure-hud-controls {
    right: 0.5rem;
  }

  .leisure-hud-controls {
    top: auto;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    justify-content: space-between;
  }

  .leisure-hud-controls select {
    min-width: 0;
    flex: 1 1 auto;
  }

  .leisure-hud-note {
    bottom: 4.4rem;
  }
}

@media (max-width: 620px) {
  .compact-control-grid {
    grid-template-columns: 1fr;
  }

  .leisure-hud-primary,
  .leisure-hud-note,
  .leisure-hud-metrics,
  .leisure-hud-controls {
    max-width: calc(100% - 1rem);
  }

  .leisure-hud-metrics {
    top: auto;
    left: 0.5rem;
    right: auto;
    bottom: 8.1rem;
  }

  .leisure-hud-primary {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
  }

  .leisure-hud-note {
    bottom: 4.6rem;
  }

  .leisure-hud-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
  }
}


.publication-figure[hidden],
.publication-figure-placeholder[hidden],
.publication-figure-note[hidden] {
  display: none !important;
}

.compact-home-section {
  padding-top: 1.5rem;
}

.compact-home-shell .hero-copy {
  max-width: 39rem;
}

.compact-home-shell .metric-strip {
  margin-top: 1.1rem;
}

body.leisure-page .site-main,
.leisure-main {
  padding: 0;
}

.leisure-stage {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.leisure-hud {
  padding: 0.62rem 0.78rem;
}

.leisure-hud-primary {
  width: min(360px, calc(100% - 2rem));
}

.leisure-hud-note {
  width: min(400px, calc(100% - 2rem));
}

/* --- v6 compact-home + leisure refinements --- */
.hero-summary {
  margin: 0.95rem 0 0;
  max-width: 43rem;
  color: var(--text-soft);
  line-height: 1.72;
}

.compact-hero {
  padding-top: clamp(2.1rem, 4.8vw, 3.9rem);
}

.compact-hero-grid {
  align-items: center;
}

.compact-hero-copy {
  max-width: 42rem;
}

.compact-metric-strip {
  margin-top: 0.95rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-link-row {
  margin-top: 0.9rem;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hero-link-row .btn {
  min-height: 2.45rem;
  padding: 0.58rem 0.95rem;
}

.compact-home-section-tight {
  padding-top: 0.9rem;
  padding-bottom: 3rem;
}

.compact-section-head {
  margin-bottom: 1rem;
}

.compact-copy {
  max-width: 40rem;
}

.compact-grid {
  gap: 1rem;
}

.compact-pillar {
  padding: 1rem 1.05rem;
}

.compact-pillar .card-title {
  margin: 0.55rem 0 0.42rem;
  font-size: 1.06rem;
}

.compact-portrait-shell {
  max-width: 23rem;
}

.compact-portrait-caption {
  max-width: 17rem;
}

body.leisure-page {
  overscroll-behavior: none;
}

.leisure-hud {
  padding: 0.5rem 0.64rem;
  max-width: min(320px, calc(100% - 1rem));
}

.leisure-hud-primary {
  top: 0.75rem;
  left: 0.75rem;
  width: min(312px, calc(100% - 1.5rem));
}

.leisure-hud-metrics {
  top: 0.75rem;
  right: 0.75rem;
  gap: 0.45rem;
}

.leisure-hud-controls {
  top: 0.75rem;
  right: 8.8rem;
  gap: 0.4rem;
}

.leisure-hud-controls select {
  min-width: 196px;
  min-height: 2.2rem;
  padding: 0.5rem 0.66rem;
  font-size: 0.84rem;
}

.leisure-hud-note {
  left: 0.75rem;
  bottom: 0.75rem;
  width: min(332px, calc(100% - 1.5rem));
}

.hud-chip {
  min-width: 60px;
}

.hud-chip span {
  font-size: 0.66rem;
}

.hud-chip strong {
  font-size: 1rem;
}

.leisure-page .mode-title {
  font-size: 1.08rem;
}

.leisure-page .inline-btn {
  min-height: 2.2rem;
  padding: 0.5rem 0.76rem;
}

.hud-copy {
  font-size: 0.9rem;
  line-height: 1.46;
}

.hud-note {
  font-size: 0.78rem;
  line-height: 1.38;
}

@media (max-width: 980px) {
  .compact-metric-strip {
    grid-template-columns: 1fr;
  }

  .leisure-hud-controls {
    top: auto;
    bottom: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
  }

  .leisure-hud-metrics {
    right: 0.75rem;
  }

  .leisure-hud-note {
    bottom: 4.3rem;
  }
}

@media (max-width: 640px) {
  .hero-link-row .btn {
    flex: 1 1 calc(50% - 0.3rem);
  }

  .leisure-hud-primary,
  .leisure-hud-note,
  .leisure-hud-metrics,
  .leisure-hud-controls {
    left: 0.5rem;
    right: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .leisure-hud-metrics {
    top: auto;
    bottom: 8rem;
    left: 0.5rem;
    right: auto;
  }

  .leisure-hud-controls {
    bottom: 0.5rem;
  }

  .leisure-hud-note {
    bottom: 4.5rem;
  }
}

/* --- v7 publication / wiki / leisure refinements --- */
.publication-figure-shell {
  display: block;
  position: relative;
  isolation: isolate;
}

.publication-figure {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.publication-figure-placeholder,
.publication-figure-note {
  z-index: 2;
}

.publication-figure-shell.has-image .publication-figure-note {
  background: rgba(6, 11, 21, 0.58);
}

body.subpage .repo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.leisure-hud {
  max-width: min(286px, calc(100% - 1rem));
  padding: 0.44rem 0.58rem;
}

.leisure-hud-primary {
  width: min(282px, calc(100% - 1.5rem));
}

.leisure-hud-note {
  width: min(298px, calc(100% - 1.5rem));
}

.leisure-hud-controls {
  right: 7.7rem;
}

.leisure-hud-controls select {
  min-width: 184px;
  min-height: 2.05rem;
  padding: 0.42rem 0.6rem;
}

@media (max-width: 1180px) {
  body.subpage .repo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body.subpage .repo-grid {
    grid-template-columns: 1fr;
  }
}

/* --- v14 minimal refinements: stronger hero readability, research page, larger figures, better package logos, cleaner leisure HUD --- */
.hero-shell-strong,
.page-hero-shell.hero-shell-strong {
  background: linear-gradient(180deg, rgba(7, 11, 22, 0.86), rgba(7, 11, 22, 0.74));
  border-color: rgba(173, 208, 255, 0.16);
  box-shadow: 0 20px 46px rgba(2, 6, 18, 0.32);
}

.hero-shell-strong::before {
  background: radial-gradient(circle, rgba(143, 243, 255, 0.18), transparent 70%);
}

.hero-shell-strong::after {
  background: radial-gradient(circle, rgba(136, 164, 255, 0.14), transparent 72%);
}

.home-hero-grid {
  align-items: start;
}

.compact-focus-tags {
  gap: 0.5rem;
}

.compact-focus-tags .tag {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(173, 208, 255, 0.14);
}

.hero-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.compact-metric-strip-fit {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.experience-panel {
  display: grid;
  gap: 0.95rem;
  margin-top: 1rem;
  padding: 1rem 1.05rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.02)),
    rgba(7, 11, 22, 0.84);
  border-color: rgba(173, 208, 255, 0.14);
}

.experience-panel-head {
  display: grid;
  gap: 0.35rem;
}

.experience-panel-copy {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.experience-list {
  display: grid;
  gap: 0.72rem;
}

.experience-item {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 0.9rem;
  padding: 0.82rem 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(173, 208, 255, 0.1);
}

.experience-period {
  align-self: start;
  padding-top: 0.1rem;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.experience-body {
  display: grid;
  gap: 0.18rem;
}

.experience-body strong {
  color: var(--text-strong);
  font-size: 1rem;
}

.experience-body span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.experience-body p {
  margin: 0.28rem 0 0;
  color: var(--text-soft);
  line-height: 1.68;
}

.experience-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.compact-profile-links {
  margin-top: 1rem;
}

.portrait-shell-strong {
  background: linear-gradient(180deg, rgba(15, 22, 42, 0.9), rgba(11, 17, 33, 0.82));
  border-color: rgba(173, 208, 255, 0.14);
}

.portrait-caption-strong {
  background: rgba(5, 9, 18, 0.82);
  border-color: rgba(173, 208, 255, 0.14);
}

.research-directions-stack {
  display: grid;
  gap: 1rem;
}

.research-direction-card {
  padding: clamp(1.2rem, 2vw, 1.45rem);
}

.research-direction-shell {
  grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.92fr);
  align-items: start;
  gap: 1.35rem;
}

.research-direction-shell.reverse .research-direction-copy {
  order: 2;
}

.research-direction-shell.reverse .research-figure-panel {
  order: 1;
}

.research-direction-title {
  margin-bottom: 0.5rem;
}

.research-direction-lead {
  margin: 0 0 0.95rem;
  font-size: 1.08rem;
  line-height: 1.72;
  color: var(--text);
}

.research-prose {
  display: grid;
  gap: 0.85rem;
  color: var(--text-soft);
  line-height: 1.78;
}

.research-prose p {
  margin: 0;
}

.research-chip-wrap {
  margin: 0.95rem 0 1rem;
}

.research-question-card {
  padding: 0.95rem 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(173, 208, 255, 0.1);
}

.research-question-list {
  margin-top: 0.65rem;
}

.research-figure-panel {
  display: grid;
  gap: 0.7rem;
}

.research-figure-media {
  min-height: clamp(20rem, 36vw, 27rem);
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(143, 243, 255, 0.14), transparent 36%),
    radial-gradient(circle at 82% 72%, rgba(136, 164, 255, 0.12), transparent 32%),
    rgba(7, 11, 22, 0.88);
  border: 1px solid rgba(173, 208, 255, 0.14);
  display: grid;
  place-items: center;
}

.research-figure-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.research-figure-caption {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.publication-figure-shell {
  border-radius: 24px;
  aspect-ratio: 5 / 4;
  min-height: clamp(15.5rem, 20vw, 18.5rem);
}

.publication-figure {
  object-fit: cover;
  object-position: center;
}

.publication-figure-note {
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.7rem;
  background: rgba(5, 9, 18, 0.8);
}

.repo-logo,
.entry-logo,
.software-node-logo {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(173, 208, 255, 0.12);
}

.repo-logo,
.entry-logo {
  width: 4rem;
  height: 4rem;
  border-radius: 22px;
  padding: 0.24rem;
}

.entry-logo {
  width: 4.85rem;
  height: 4.85rem;
  padding: 0.34rem;
}

.software-node-logo {
  width: 3rem;
  height: 3rem;
  border-radius: 16px;
  padding: 0.18rem;
}

.leisure-hud-primary {
  width: min(334px, calc(100% - 1.2rem));
  padding: 0.62rem 0.72rem;
  background: rgba(7, 11, 22, 0.84);
}

.leisure-control-cluster {
  right: 1rem;
  left: auto;
  top: calc(var(--header-h) + 0.95rem);
  width: min(390px, calc(100% - 1.2rem));
  display: grid;
  gap: 0.55rem;
  padding: 0.56rem 0.6rem;
  background: rgba(7, 11, 22, 0.84);
}

.leisure-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.leisure-metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.leisure-bottom-note {
  left: 1rem;
  bottom: 1rem;
  width: min(320px, calc(100% - 1.2rem));
  padding: 0.68rem 0.78rem;
  background: rgba(7, 11, 22, 0.84);
}

.leisure-bottom-note .hud-copy,
.leisure-bottom-note .hud-note {
  margin: 0;
}

.leisure-bottom-note .hud-note {
  margin-top: 0.45rem;
}

:root[data-theme="light"] .hero-shell-strong,
:root[data-theme="light"] .page-hero-shell.hero-shell-strong {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.84));
}

:root[data-theme="light"] .experience-panel,
:root[data-theme="light"] .leisure-hud-primary,
:root[data-theme="light"] .leisure-control-cluster,
:root[data-theme="light"] .leisure-bottom-note {
  background: rgba(255, 255, 255, 0.93);
}

:root[data-theme="light"] .research-figure-media {
  background:
    radial-gradient(circle at 18% 18%, rgba(31, 114, 255, 0.08), transparent 36%),
    radial-gradient(circle at 82% 72%, rgba(15, 185, 154, 0.07), transparent 32%),
    rgba(255, 255, 255, 0.96);
  border-color: rgba(58, 92, 160, 0.14);
}

:root[data-theme="light"] .publication-figure-note,
:root[data-theme="light"] .portrait-caption-strong {
  background: rgba(255, 255, 255, 0.92);
}

@media (max-width: 1100px) {
  .research-direction-shell {
    grid-template-columns: 1fr;
  }

  .research-direction-shell.reverse .research-direction-copy,
  .research-direction-shell.reverse .research-figure-panel {
    order: initial;
  }
}

@media (max-width: 820px) {
  .experience-item {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .leisure-control-cluster {
    width: min(350px, calc(100% - 1rem));
  }
}

@media (max-width: 640px) {
  .leisure-control-cluster {
    right: 0.5rem;
    top: calc(var(--header-h) + 0.6rem);
    width: min(330px, calc(100% - 1rem));
  }

  .leisure-select-row {
    grid-template-columns: 1fr;
  }

  .leisure-bottom-note {
    left: 0.5rem;
    bottom: 0.5rem;
    width: min(288px, calc(100% - 1rem));
  }

  .publication-figure-shell {
    min-height: 14.2rem;
  }
}
