/*
 * GIBIRA official-site typography system
 *
 * Loaded after the legacy page CSS so the homepage and every generated route
 * share one semantic scale without changing their structure or interactions.
 */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;

  --text-display: clamp(3.25rem, 5vw, 4.25rem);
  --text-h1: clamp(2.375rem, 4vw, 3.25rem);
  --text-h2: clamp(1.75rem, 2.8vw, 2.25rem);
  --text-h3: clamp(1.25rem, 1.8vw, 1.5625rem);
  --text-card-title: 1.0625rem;
  --text-lead: clamp(1rem, 1.25vw, 1.1875rem);
  --text-body: 0.9375rem;
  --text-card-body: 0.875rem;
  --text-small: 0.8125rem;
  --text-caption: 0.75rem;
  --text-micro: 0.6875rem;
  --text-nav: 0.8125rem;
  --text-button: 0.875rem;
  --text-kpi: clamp(1.875rem, 3vw, 2.75rem);
  --text-data: clamp(1.25rem, 1.8vw, 1.75rem);

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  --leading-display: 1.04;
  --leading-h1: 1.08;
  --leading-h2: 1.15;
  --leading-h3: 1.25;
  --leading-card-title: 1.3;
  --leading-lead: 1.55;
  --leading-body: 1.65;
  --leading-card-body: 1.55;
  --leading-small: 1.5;
  --leading-caption: 1.4;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  font-kerning: normal;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The legacy site used many numeric weights between 620 and 950. Normalize
   first, then opt semantic emphasis back into the approved three-weight set. */
body * {
  font-weight: var(--weight-regular) !important;
}

body :is(h1, h2, h3, h4, h5, h6) {
  font-weight: var(--weight-medium) !important;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

body :is(p, li, td, dd, figcaption, caption) {
  font-weight: var(--weight-regular) !important;
  text-wrap: pretty;
}

body :is(strong, b, th, dt) {
  font-weight: var(--weight-semibold) !important;
}

body :is(button, .button, [role="button"], nav a, [class*="trigger"]) {
  font-weight: var(--weight-medium) !important;
}

/* Motion wrappers must preserve the semantic type of the text they split. */
.site-main :is(.scroll-float-text, .char, .text-content),
.footer-inner :is(.scroll-float-text, .char, .text-content, .footer-title-line, .footer-title-break),
:is(h1, h2, h3, h4) > span:not(.thin),
:is(h1, h2, h3, h4) > span:not(.thin) > span {
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
}

/* Page hierarchy */
.page-home .home-hero .hero-title,
.page-home .hero-title-screen .hero-title {
  max-width: 18ch;
  font-size: var(--text-display) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-display) !important;
  letter-spacing: -0.035em !important;
  white-space: normal !important;
}

.page-shell:not(.page-home) .hero h1,
.page-shell:not(.page-home) .hero .hero-title,
.page-about-us h1,
.harness-detail-page-hero .hero-title,
.redirect-screen__panel h1,
.coming-soon-code {
  max-width: 20ch;
  font-size: var(--text-h1) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-h1) !important;
  letter-spacing: -0.025em !important;
  white-space: normal !important;
}

.page-qishu-ai .financing-hero-content h1,
.page-shell.project-secondary-page .hero .hero-title,
.page-shell.secondary-unified-page .hero .hero-title {
  max-width: 20ch;
  font-size: var(--text-h1) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-h1) !important;
  letter-spacing: -0.025em !important;
  white-space: normal !important;
}

.section > h2,
.section > .scroll-float,
.page-home .vertical-scroll-panel .harness-copy > .scroll-float,
.section :is(.financing-section__copy, .qishu-section__header, .qishu-data-copy, .qishu-data-page__intro, .qishu-revenue-page__intro, .cad-model-story__left) > h2,
.account-page-section :is(.login-panel, .qishu-registration-panel) h2,
.footer-copy > h2,
.page-about-us h2,
.coming-soon-panel h2 {
  max-width: 26ch;
  font-size: var(--text-h2) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-h2) !important;
  letter-spacing: -0.018em !important;
  white-space: normal !important;
}

.page-qishu-ai :is(
  .financing-section__copy > h2,
  .qishu-section__header > h2,
  .team-section > h2,
  .advisor-section > h2,
  .qishu-data-copy > h2,
  .qishu-data-page__intro > h2,
  .qishu-revenue-page__intro > h2,
  .cad-model-story__left > h2,
  .section.qishu-video-section > h2
) {
  max-width: 26ch;
  font-size: var(--text-h2) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-h2) !important;
  letter-spacing: -0.018em !important;
  white-space: normal !important;
}

.section :is(.detail-body, .qishu-data-copy, .qishu-data-page__intro, .qishu-revenue-page__intro) > h3,
.about-mission-card--lead h3,
.detail-emphasis,
.quote-panel > p,
.hero-experience-entry strong,
.qishu-building-demo__header h3 {
  font-size: var(--text-h3) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-h3) !important;
  letter-spacing: -0.01em !important;
}

/* Leads and long-form reading */
.section-lead,
.hero-copy > p,
.page-home > .hero-detail-screen .hero-copy > p,
.about-page-deck,
.detail-emphasis,
.qishu-data-conclusion-strip,
.qishu-data-value-conclusion p,
.qishu-data-investor-conclusion p {
  max-width: 68ch;
  font-size: var(--text-lead) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-lead) !important;
  letter-spacing: 0 !important;
}

.page-home #harness .harness-copy > :is(.section-lead, p:not(.section-kicker)),
.page-home :is(#harness-loop, #ecosystem, #team, #ai-research-team, #collaborative-research-team, #advisors, #projects, #contact) > .section-lead {
  max-width: 68ch;
  font-size: var(--text-lead) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-lead) !important;
  letter-spacing: 0 !important;
}

.home-hero .hero-copy > p,
.hero-title-screen + .hero-detail-screen .hero-copy > p {
  max-width: 680px;
}

.detail-body > p,
.about-page-intro :is(.about-page-deck, p),
.about-contact-section .section-lead,
.financing-narrative,
.qishu-body-copy > p,
.qishu-data-copy > p:not(.section-kicker):not(.section-lead),
.qishu-data-page__intro > p:not(.section-kicker):not(.section-lead),
.qishu-revenue-page__intro > p:not(.section-kicker):not(.section-lead),
.financing-note,
.financing-vdr-note,
.footer-copy > p {
  max-width: 68ch;
  font-size: var(--text-body) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-body) !important;
  letter-spacing: 0 !important;
}

.site-main .page-shell > .section > p:not(.section-kicker):not(.section-lead),
.site-main .page-shell .detail-body > p {
  max-width: 68ch;
  font-size: var(--text-body) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-body) !important;
  letter-spacing: 0 !important;
}

/* Card titles */
:is(
  .project-card,
  .info-card,
  .financing-card,
  .financing-market-visual,
  .financing-compare,
  .detail-card,
  .detail-example,
  .vertical-card,
  .timeline-item,
  .case-card,
  .architecture-node,
  .qishu-video-card,
  .qishu-module-video__copy,
  .about-mission-card,
  .about-team-card,
  .about-record-card,
  .qishu-revenue-chart,
  .qishu-revenue-panel,
  .qishu-revenue-conclusions,
  .qishu-revenue-tier-card,
  .qishu-revenue-charge-grid,
  .qishu-revenue-income-grid,
  .qishu-revenue-example-grid,
  .qishu-revenue-renewal-grid,
  .qishu-revenue-upgrade,
  .qishu-revenue-usage-band,
  .qishu-full-funding__table,
  [data-cad-step]
) :is(h3, h4),
.project-description > strong,
.process-node > strong,
.financing-flow-node > strong,
.qishu-data-asset-list strong,
.qishu-demo-slot__flow strong,
.qishu-flywheel article strong,
.about-service-band strong,
.qishu-data-asset-list > strong,
.qishu-revenue-type-strip strong,
.qishu-revenue-upgrade article strong,
.qishu-revenue-expansion-path article strong {
  font-size: var(--text-card-title) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-card-title) !important;
  letter-spacing: -0.005em !important;
}

/* Card descriptions and compact modules */
:is(
  .project-card,
  .info-card,
  .financing-card,
  .financing-market-visual,
  .financing-compare,
  .financing-mini-row,
  .detail-card,
  .detail-example,
  .vertical-card,
  .timeline-item,
  .case-card,
  .architecture-node,
  .qishu-video-card,
  .qishu-module-video__copy,
  .about-mission-card,
  .about-team-card,
  .about-record-card,
  .about-service-band,
  .qishu-revenue-chart,
  .qishu-revenue-metrics,
  .qishu-revenue-type-strip,
  .qishu-revenue-conclusions,
  .qishu-revenue-tier-card,
  .qishu-revenue-charge-grid,
  .qishu-revenue-income-grid,
  .qishu-revenue-example-grid,
  .qishu-revenue-renewal-grid,
  .qishu-revenue-usage-band,
  .qishu-data-asset-list,
  .qishu-data-lift-band,
  [data-cad-step]
) :is(p, li, dd) {
  font-size: var(--text-card-body) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-card-body) !important;
  letter-spacing: 0 !important;
}

.detail-body > p,
.detail-example > p {
  max-width: 68ch;
}

/* People and advisor cards: names remain prominent; every other field stays
   at the approved 14px card-body size across core, R&D, lab and advisors. */
.page-home :is(#team, #ai-research-team, #collaborative-research-team, #advisors)
  .team-profile-copy h3 {
  font-size: var(--text-card-title) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-card-title) !important;
  letter-spacing: -0.005em !important;
}

.page-home :is(#team, #ai-research-team, #collaborative-research-team, #advisors)
  .team-profile-copy > :not(h3),
.page-home :is(#team, #ai-research-team, #collaborative-research-team, #advisors)
  .team-profile-copy > :not(h3) * {
  font-size: var(--text-card-body) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-card-body) !important;
  letter-spacing: 0 !important;
}

.page-home :is(#team, #ai-research-team, #collaborative-research-team, #advisors)
  .team-profile-content.chroma-info .team-profile-copy > :not(h3),
.page-home :is(#team, #ai-research-team, #collaborative-research-team, #advisors)
  .team-profile-content.chroma-info .team-profile-copy > :not(h3) * {
  font-size: var(--text-card-body) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-card-body) !important;
  letter-spacing: 0 !important;
}

.page-home :is(#team, #ai-research-team, #collaborative-research-team, #advisors)
  .team-profile-copy strong,
.page-home :is(#team, #ai-research-team, #collaborative-research-team, #advisors)
  :is(.team-profile-position, .team-profile-role) {
  font-weight: var(--weight-medium) !important;
}

.page-home #collaborative-research-team .collaborative-thumbnail span {
  font-size: var(--text-caption) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-caption) !important;
  letter-spacing: 0 !important;
}

/* Labels, captions and metadata */
.section-kicker,
.eyebrow,
[class*="__eyebrow"],
[class*="__label"],
[class*="-label"],
.team-profile-role,
.team-profile-position,
.project-index,
.project-title-en,
.project-tags,
.vertical-card :is(span, small),
.project-card > span,
.info-card > span,
.metric > span,
.process-node > span,
.financing-flow-node > span,
.financing-flow-node > small,
.detail-card > span,
.detail-example > span,
.timeline-item > span,
.case-card > span,
.architecture-node > span,
.qishu-video-card > span,
.qishu-module-video__copy > span,
.about-fact-strip dt,
.about-mission-card > span,
.about-service-band > span,
.about-team-card > span,
.about-record-card > span,
[data-cad-step] > span,
[data-cad-step] small,
.qishu-directory__group h2,
.qishu-directory__header span,
.qishu-directory__group a > span,
.qishu-opportunity-carousel__zoom-label,
.cad-model-visual__hud,
.cad-export,
.cad-label,
.cad-face {
  font-size: var(--text-caption) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-caption) !important;
  letter-spacing: 0.04em !important;
}

small,
figcaption,
caption,
.login-form__meta,
.login-form__status,
.qishu-revenue-note {
  font-size: var(--text-caption) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-caption) !important;
}

.site-main .page-shell :is(small, figcaption, caption),
.footer-inner :is(small, figcaption, caption) {
  font-size: var(--text-caption) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-caption) !important;
}

.site-main .page-shell figcaption span,
.site-main .page-qishu-ai .qishu-performance-summary article > span {
  font-size: var(--text-caption) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-caption) !important;
  letter-spacing: 0.04em !important;
}

/* Navigation, buttons and form controls */
.site-header :is(.nav-links a, .header-action, .header-login, .header-qishu-register, .nav-scenarios__trigger),
.nav-scenarios__panel :is(a, strong),
.page-toc :is(button, a, span, strong),
.qishu-directory :is(button, a, span, strong),
.qishu-directory-trigger,
.xlsx-sheet-tabs a {
  font-size: var(--text-nav) !important;
  font-weight: var(--weight-regular) !important;
  line-height: 1.3 !important;
  letter-spacing: 0 !important;
}

.site-header :is(a[aria-current="page"], .is-active),
.nav-scenarios__panel a:focus-visible,
.page-toc a.is-active,
.qishu-directory a[aria-current="page"],
.xlsx-sheet-tabs a[aria-current="page"] {
  font-weight: var(--weight-medium) !important;
}

.button,
button,
[role="button"] {
  font-size: var(--text-button) !important;
  font-weight: var(--weight-medium) !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}

.site-main :is(.button, button, [role="button"]),
.footer-inner :is(.button, button, [role="button"]) {
  font-size: var(--text-button) !important;
  font-weight: var(--weight-medium) !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}

.page-home #projects .vertical-card .project-title-cn,
.project-return .vertical-card .project-title-cn {
  font-size: var(--text-card-title) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-card-title) !important;
  letter-spacing: -0.005em !important;
}

.site-main :is(.page-home #projects, .project-return) .vertical-card .project-title-en {
  font-size: var(--text-caption) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-caption) !important;
  letter-spacing: 0.04em !important;
}

.page-home #projects .vertical-card :is(.project-description p, .project-tags),
.project-return .vertical-card :is(.project-description p, .project-tags) {
  font-size: var(--text-card-body) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-card-body) !important;
  letter-spacing: 0 !important;
}

.page-home #harness-loop .harness-card-list .info-card h3,
.page-home #ecosystem .ecosystem-card-list .info-card h3 {
  font-size: var(--text-card-title) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-card-title) !important;
  letter-spacing: -0.005em !important;
}

.page-home #harness-loop .harness-card-list .info-card p,
.page-home #ecosystem .ecosystem-card-list .info-card p,
.page-home #ecosystem .ecosystem-evidence-note {
  font-size: var(--text-card-body) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-card-body) !important;
  letter-spacing: 0 !important;
}

.page-home #harness-loop .harness-card-list .info-card > span,
.page-home #ecosystem .ecosystem-card-list .info-card > span {
  font-size: var(--text-caption) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-caption) !important;
  letter-spacing: 0.04em !important;
}

/* Keep the animated marquee visually clipped without allowing its duplicated
   off-screen track to enlarge the page's horizontal scroll range. */
.page-home .partner-logo-loop {
  contain: inline-size paint;
  overflow: clip !important;
}

.login-form label,
form label {
  font-size: var(--text-small) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-small) !important;
}

:is(input, textarea, select) {
  font: var(--weight-regular) var(--text-body) / var(--leading-body) var(--font-sans) !important;
  letter-spacing: 0 !important;
}

/* Data and tables */
:is(.metric, [class*="metric"], .xlsx-investor-summary) > strong,
.qishu-revenue-example-grid header > strong,
.qishu-data-flywheel-core > strong {
  font-size: var(--text-kpi) !important;
  font-weight: var(--weight-medium) !important;
  line-height: 1 !important;
  letter-spacing: -0.025em !important;
  font-variant-numeric: tabular-nums;
}

:is(
  .qishu-funding-donut,
  .qishu-stage-chart,
  .financing-funding-item,
  .qishu-funnel,
  .qishu-revenue-core,
  .qishu-revenue-lanes,
  .qishu-revenue-donut,
  .qishu-revenue-engine__core,
  .qishu-investment-summary
) > strong {
  font-size: var(--text-data) !important;
  font-weight: var(--weight-medium) !important;
  line-height: 1.15 !important;
  letter-spacing: -0.015em !important;
  font-variant-numeric: tabular-nums;
}

table {
  font-size: var(--text-card-body) !important;
  line-height: var(--leading-card-body) !important;
  font-variant-numeric: tabular-nums;
}

table th {
  font-size: var(--text-small) !important;
  font-weight: var(--weight-semibold) !important;
  line-height: var(--leading-small) !important;
  letter-spacing: 0.02em !important;
}

table td {
  font-size: var(--text-card-body) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-card-body) !important;
  letter-spacing: 0 !important;
}

table tr.is-total :is(th, td) {
  font-weight: var(--weight-semibold) !important;
}

/* The official Qishu route carries a dense legacy information layer. These
   scoped selectors keep its cards, body copy and tables on the same system as
   the rest of the official site. */
.site-main .page-qishu-ai :is(
  .financing-card,
  .financing-market-visual,
  .financing-compare,
  .financing-mini-row,
  .qishu-module-video__copy,
  .qishu-video-card,
  .case-card,
  .architecture-node,
  [data-cad-step],
  .qishu-revenue-chart,
  .qishu-revenue-metrics,
  .qishu-revenue-type-strip,
  .qishu-revenue-conclusions,
  .qishu-revenue-tier-card,
  .qishu-revenue-charge-grid,
  .qishu-revenue-income-grid,
  .qishu-revenue-example-grid,
  .qishu-revenue-renewal-grid,
  .qishu-revenue-usage-band,
  .qishu-data-asset-list,
  .qishu-data-lift-band
) :is(p, li, dd) {
  font-size: var(--text-card-body) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-card-body) !important;
  letter-spacing: 0 !important;
}

.site-main .page-qishu-ai :is(
  .section-lead,
  .qishu-data-conclusion-strip,
  .qishu-data-value-conclusion p,
  .qishu-data-investor-conclusion p
) {
  max-width: 68ch;
  font-size: var(--text-lead) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-lead) !important;
  letter-spacing: 0 !important;
}

.site-main .page-qishu-ai :is(
  .financing-narrative,
  .qishu-body-copy p,
  .qishu-data-copy > p:not(.section-kicker):not(.section-lead),
  .qishu-data-page__intro > p:not(.section-kicker):not(.section-lead),
  .qishu-revenue-page__intro > p:not(.section-kicker):not(.section-lead),
  .financing-note,
  .financing-vdr-note
) {
  max-width: 68ch;
  font-size: var(--text-body) !important;
  font-weight: var(--weight-regular) !important;
  line-height: var(--leading-body) !important;
  letter-spacing: 0 !important;
}

.site-main .page-qishu-ai :is(.table-wrap, .qishu-full-funding, .qishu-table, .detail-data-table, .qishu-revenue-detail-table) :is(th, td) {
  font-size: var(--text-card-body) !important;
  line-height: var(--leading-card-body) !important;
  letter-spacing: 0 !important;
}

.site-main .page-qishu-ai :is(.table-wrap, .qishu-full-funding, .qishu-table, .detail-data-table, .qishu-revenue-detail-table) th {
  font-weight: var(--weight-semibold) !important;
}

.site-main .page-qishu-ai :is(.table-wrap, .qishu-full-funding, .qishu-table, .detail-data-table, .qishu-revenue-detail-table) td {
  font-weight: var(--weight-regular) !important;
}

/* Status and footer copy */
.site-loader__text {
  font-size: var(--text-body) !important;
  font-weight: var(--weight-medium) !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

.contact-stack :is(a, span),
.footer-line,
.footer-meta {
  font-size: var(--text-small) !important;
  font-weight: var(--weight-medium) !important;
  line-height: var(--leading-small) !important;
  letter-spacing: 0 !important;
}

.page-shell.page-home {
  overflow-x: clip;
}

/* The giant GIBIRA wordmark is a brand graphic, not reading text. Its existing
   scale and animation intentionally remain untouched. */

@media (max-width: 900px) {
  .section > h2,
  .section > .scroll-float,
  .page-shell:not(.page-home) .hero h1,
  .page-shell:not(.page-home) .hero .hero-title {
    max-width: 24ch;
  }

  .section-lead,
  .hero-copy > p,
  .detail-body > p {
    max-width: 60ch;
  }
}

@media (max-width: 640px) {
  :root {
    --text-display: clamp(2.25rem, 10vw, 2.75rem);
    --text-h1: clamp(1.875rem, 8.5vw, 2.375rem);
    --text-h2: clamp(1.5rem, 7vw, 1.875rem);
    --text-h3: clamp(1.1875rem, 5.5vw, 1.375rem);
  }

  .page-home .home-hero .hero-title,
  .page-home .hero-title-screen .hero-title {
    max-width: 12ch;
  }

  .section > h2,
  .section > .scroll-float,
  .page-shell:not(.page-home) .hero h1,
  .page-shell:not(.page-home) .hero .hero-title {
    max-width: 20ch;
  }

  .section-lead,
  .hero-copy > p,
  .detail-body > p,
  .about-page-deck {
    max-width: 100%;
  }
}
