:root {
  --md-primary-fg-color: #172b4d;
  --md-primary-fg-color--light: #3d6fb6;
  --md-primary-fg-color--dark: #10213d;
  --md-accent-fg-color: #3d6fb6;
  --research-bg: #f7f9fb;
  --research-surface: #ffffff;
  --research-soft: #f0f3f6;
  --research-text: #172b4d;
  --research-muted: #5b6573;
  --research-border: #d9e1e8;
  --research-accent: #3d6fb6;
  --research-teal: #168c7e;
  --research-warning: #a65f18;
  --research-radius: 0.55rem;
}

[data-md-color-scheme="default"] {
  --md-default-bg-color: #f7f9fb;
  --md-default-fg-color: #172b4d;
  --md-default-fg-color--light: #5b6573;
  --md-code-bg-color: #f0f3f6;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #172b4d;
  --md-primary-fg-color--light: #6f9bd1;
  --md-primary-fg-color--dark: #10213d;
  --md-accent-fg-color: #82addb;
  --research-bg: #0f1724;
  --research-surface: #172131;
  --research-soft: #1d2a3d;
  --research-text: #edf3f8;
  --research-muted: #aeb9c5;
  --research-border: #344258;
  --research-accent: #82addb;
  --research-teal: #5fc2b4;
  --research-warning: #e4a85f;
}

html {
  scroll-behavior: smooth;
}

body,
input {
  color: var(--research-text);
  background: var(--research-bg);
  font-family: Inter, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

code,
kbd,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

::selection {
  color: #ffffff;
  background: var(--research-accent);
}

.md-grid {
  max-width: 72rem;
}

.md-header,
.md-tabs {
  background: #172b4d;
  box-shadow: none;
}

.md-tabs {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.md-header__button.md-logo {
  padding: 0.18rem;
  border-radius: 0.45rem;
  background: #ffffff;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  width: 1.8rem;
  height: 1.8rem;
}

.md-nav__title .md-logo img,
.md-nav__title .md-logo svg {
  box-sizing: border-box;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0.18rem;
  border-radius: 0.5rem;
  background: #ffffff;
}

.md-tabs__link {
  font-weight: 600;
}

.md-main {
  background: var(--research-bg);
}

.md-content__inner {
  padding-bottom: 3rem;
}

.md-typeset {
  color: var(--research-text);
  font-size: 0.84rem;
  line-height: 1.72;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--research-text);
  font-weight: 700;
  letter-spacing: -0.018em;
}

.md-typeset h1 {
  margin-bottom: 1rem;
  font-size: clamp(1.9rem, 3.4vw, 2.65rem);
  line-height: 1.16;
}

.md-typeset h2 {
  margin-top: 2.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--research-border);
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  line-height: 1.28;
}

.md-typeset h3 {
  font-size: 1.02rem;
}

.md-typeset a:not(.md-button):not(.hero-button):not(.route-card):not(.demo-action) {
  color: var(--research-accent);
  text-decoration-color: color-mix(in srgb, var(--research-accent) 38%, transparent);
  text-underline-offset: 0.16em;
}

.md-typeset a:not(.md-button):not(.hero-button):not(.route-card):not(.demo-action):hover {
  text-decoration-color: currentColor;
}

.md-typeset .md-button,
.hero-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.62rem 1rem;
  border: 1px solid var(--research-border);
  border-radius: var(--research-radius);
  color: var(--research-text);
  background: var(--research-surface);
  box-shadow: none;
  font-weight: 700;
  text-decoration: none;
}

.md-typeset .md-button:is(:hover, :focus-visible),
.hero-button:is(:hover, :focus-visible) {
  border-color: var(--research-accent);
  color: var(--research-accent);
}

.md-typeset .md-button--primary,
.hero-button.primary {
  border-color: #172b4d;
  color: #ffffff;
  background: #172b4d;
}

[data-md-color-scheme="slate"] .md-typeset .md-button--primary,
[data-md-color-scheme="slate"] .hero-button.primary {
  border-color: var(--research-accent);
  background: #284a73;
}

.md-typeset .md-button--primary:is(:hover, :focus-visible),
.hero-button.primary:is(:hover, :focus-visible) {
  color: #ffffff;
}

.md-typeset table:not([class]) {
  border: 1px solid var(--research-border);
  border-radius: var(--research-radius);
  background: var(--research-surface);
  box-shadow: none;
}

.md-typeset table:not([class]) th {
  color: var(--research-text);
  background: var(--research-soft);
  font-weight: 700;
}

.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
  border-color: var(--research-border);
}

.md-typeset .highlight,
.md-typeset .highlighttable,
.md-typeset .tabbed-set,
.md-typeset .admonition,
.md-typeset details {
  border: 1px solid var(--research-border);
  border-radius: var(--research-radius);
  background: var(--research-surface);
  box-shadow: none;
}

.md-typeset .admonition,
.md-typeset details {
  border-left-width: 0.22rem;
}

.md-typeset .tabbed-labels {
  border-bottom: 1px solid var(--research-border);
  background: var(--research-soft);
}

.md-nav__link--active,
.md-nav__link:is(:focus, :hover) {
  color: var(--research-accent);
}

.md-nav__link--active {
  font-weight: 700;
}

.md-search__form {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--research-radius);
  background: rgba(255, 255, 255, 0.1);
}

.md-footer,
.md-footer-meta {
  background: #172b4d;
}

.md-typeset :focus-visible,
.md-header :focus-visible,
.md-tabs :focus-visible {
  outline: 3px solid color-mix(in srgb, var(--research-accent) 60%, transparent);
  outline-offset: 3px;
}

.home-hero {
  max-width: 62rem;
  margin: 1rem 0 3rem;
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(2.2rem, 5vw, 4.2rem);
  border-top: 0.24rem solid #172b4d;
  border-bottom: 1px solid var(--research-border);
}

.hero-kicker,
.section-eyebrow,
.research-card-kicker,
.story-card-kicker,
.evidence-kicker,
.scenario-tag,
.route-card > span {
  display: block;
  margin: 0 0 0.65rem;
  color: var(--research-accent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-hero h1.paper-title {
  max-width: 29ch;
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.55rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero-lead,
.research-lead,
.section-lead,
.pipeline-summary {
  max-width: 52rem;
  color: var(--research-muted);
  font-size: 0.95rem;
  line-height: 1.72;
}

.hero-lead {
  margin: 1.2rem 0 1.5rem;
}

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

.record-transform,
.method-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin: 1.2rem 0 1.4rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--research-border);
  border-radius: var(--research-radius);
  background: var(--research-surface);
}

.record-transform span,
.method-chain span {
  color: var(--research-muted);
  font-weight: 700;
}

.record-transform code,
.method-chain code {
  color: var(--research-text);
  background: var(--research-soft);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1.4rem 0 1.8rem;
}

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

.metric {
  padding: 1rem 0.8rem;
  border: 1px solid var(--research-border);
  border-radius: var(--research-radius);
  text-align: center;
  background: var(--research-surface);
}

.metric strong,
.metric span {
  display: block;
}

.metric strong {
  color: var(--research-teal);
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.metric span {
  margin-top: 0.15rem;
  color: var(--research-muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.pipeline-frame,
.paper-figure {
  overflow-x: auto;
  margin: 1.35rem 0 1.7rem;
  padding: 0.65rem;
  border: 1px solid var(--research-border);
  border-radius: var(--research-radius);
  background: var(--research-surface);
  box-shadow: none;
}

.pipeline-frame img {
  display: block;
  min-width: 760px;
  margin: 0 auto;
}

.paper-figure img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  background: #ffffff;
}

.paper-figure.compact img {
  max-width: 62rem;
}

.paper-figure.portrait img {
  max-width: 38rem;
}

.paper-figure.demo-figure img {
  max-width: 58rem;
}

.pipeline-image-link {
  display: block;
}

.pipeline-caption {
  margin: 0.65rem 0.2rem 0.05rem;
  color: var(--research-muted);
  font-size: 0.69rem;
  line-height: 1.55;
  text-align: center;
}

.research-grid,
.feature-grid,
.scenario-grid,
.route-grid,
.story-grid,
.evidence-grid {
  display: grid;
  gap: 0.8rem;
  margin: 1.3rem 0 1.8rem;
}

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

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

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

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

.research-card,
.feature-card,
.scenario-card,
.route-card,
.story-card,
.evidence-card,
.story-moment div {
  padding: 1.05rem;
  border: 1px solid var(--research-border);
  border-radius: var(--research-radius);
  color: var(--research-text);
  background: var(--research-surface);
  box-shadow: none;
}

.research-card h3,
.feature-card h3,
.scenario-card h3,
.route-card h3,
.evidence-card h3 {
  margin: 0 0 0.4rem;
}

.research-card p,
.feature-card p,
.scenario-card p,
.route-card p,
.story-card p,
.evidence-card p,
.evidence-card ul,
.story-moment span {
  color: var(--research-muted);
}

.route-card {
  display: block;
  text-decoration: none;
}

.scenario-tag.established {
  color: var(--research-teal);
}

.scenario-tag.scoped,
.evidence-card.caution .evidence-kicker {
  color: var(--research-warning);
}

.scenario-tag.exploratory {
  color: var(--research-accent);
}

.process-step {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--research-accent);
  font-weight: 800;
}

.result-callout {
  margin: 1.1rem 0 1.8rem;
  padding: 0.9rem 1rem;
  border-left: 0.22rem solid var(--research-accent);
  color: var(--research-muted);
  background: var(--research-soft);
}

.result-callout strong {
  color: var(--research-text);
}

.session-story {
  display: grid;
  gap: 0.65rem;
  margin: 1.2rem 0;
}

.story-moment {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
}

.story-moment time {
  padding-top: 0.7rem;
  color: var(--research-accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
}

.story-moment strong,
.story-moment span {
  display: block;
}

.signal-token-list,
.record-list {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

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

.signal-token-list span,
.record-list div {
  padding: 0.5rem;
  border: 1px solid var(--research-border);
  border-radius: 0.35rem;
  background: var(--research-soft);
}

.story-caption {
  color: var(--research-muted);
  font-size: 0.68rem;
  font-style: italic;
}

.paper-home-cta,
.cta-panel {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin: 1.3rem 0 2rem;
  padding: 1rem;
  border: 1px solid var(--research-border);
  border-radius: var(--research-radius);
  background: var(--research-surface);
}

@media screen and (max-width: 54rem) {
  .research-grid,
  .feature-grid,
  .feature-grid.process-grid,
  .scenario-grid,
  .route-grid,
  .route-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 42rem) {
  .md-typeset {
    font-size: 0.8rem;
  }

  .home-hero h1.paper-title {
    font-size: clamp(1.75rem, 8.5vw, 2.45rem);
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-button {
    width: 100%;
  }

  .metric-strip,
  .metric-strip--three,
  .research-grid,
  .feature-grid,
  .feature-grid.process-grid,
  .scenario-grid,
  .scenario-grid.detailed,
  .route-grid,
  .route-grid.compact,
  .story-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .paper-home-cta,
  .cta-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .method-chain {
    align-items: flex-start;
    flex-direction: column;
  }
}

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