/* Shared project contract: narrative copy 400, named headings 500. */
@font-face {
  font-family: "Portfolio PingFang";
  src:
    local("PingFangSC-Regular"),
    local("PingFang SC Regular"),
    local("PingFang HK Regular"),
    local("PingFang TC Regular"),
    local("Noto Sans CJK SC Regular"),
    local("Noto Sans SC Regular"),
    local("Microsoft YaHei UI"),
    local("Microsoft YaHei");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Portfolio PingFang";
  src:
    local("PingFangSC-Medium"),
    local("PingFang SC Medium"),
    local("PingFang HK Medium"),
    local("PingFang TC Medium"),
    local("Noto Sans CJK SC Medium"),
    local("Noto Sans SC Medium"),
    local("Microsoft YaHei UI"),
    local("Microsoft YaHei");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

html.portfolio-project-page {
  font-synthesis: none !important;
}

body {
  font-family: "Portfolio PingFang", "PingFang SC", "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 400 !important;
  font-variation-settings: "wght" 400 !important;
  font-synthesis: none !important;
}

h1,
h2 {
  font-weight: 500 !important;
  font-variation-settings: "wght" 500 !important;
}

/*
  One family owns both real local faces. Local component rules can therefore
  choose 400 or 500 without the browser synthesizing a missing weight.
*/
html.portfolio-project-page main h2,
html.portfolio-project-page main h3,
html.portfolio-project-page main h4,
html.portfolio-project-page main h5,
html.portfolio-project-page main h6 {
  font-family: "Portfolio PingFang", "PingFang SC", "Helvetica Neue", Arial, sans-serif !important;
}

html.portfolio-project-page main h2,
html.portfolio-project-page main .section-kicker,
html.portfolio-project-page main .section-label,
html.portfolio-project-page main .chapter-kicker,
html.portfolio-project-page main .scene-number {
  font-family: "Portfolio PingFang", "PingFang SC", "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 500 !important;
  font-variation-settings: "wght" 500 !important;
}

/* Copy placed below a card remains body/caption copy, even when it contains a heading tag. */
figure > figcaption,
figure > figcaption *,
article > h3,
article > h4,
article [class$="-copy"] h3,
article [class$="-copy"] h4,
.open-grid h3,
.open-grid h4,
.result-grid h3,
.result-grid h4,
.summary-open-grid h3,
.summary-open-grid h4,
.statement-cards h3,
.statement-cards h4,
.gallery-copy,
.gallery-copy *,
.artifact-copy,
.artifact-copy *,
.comparison-copy,
.comparison-copy *,
.statement-copy,
.statement-copy *,
.result-copy,
.result-copy *,
.evidence-card-copy,
.evidence-card-copy *,
.competitor-copy,
.competitor-copy *,
.support-model-head h3,
.support-model-principle-copy h4,
.metric h3,
.metric h4 {
  font-family: "Portfolio PingFang", "PingFang SC", "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 400 !important;
  font-variation-settings: "wght" 400 !important;
}

/*
  The inner content track stays fixed at 1200px and remains centered. Chapter
  surfaces keep their project-defined full-width behavior so light/dark themes
  always cover the complete viewport. Below 1248px (1200px content + two 24px
  minimum gutters), the page keeps its desktop geometry and scrolls horizontally.
*/
html.portfolio-project-page {
  --content: 1200px !important;
  --portfolio-site-frame-content-width: 1200px !important;
  --portfolio-site-header-content-width: 1200px !important;
  --portfolio-site-frame-side-gutter: 24px !important;
  --rail-distance: calc(var(--content) / 2 - 0.5px) !important;
  --rail-center-distance: calc(var(--content) / 2 - 0.5px) !important;
  --outer-rail-center: calc(var(--content) / 2 - 0.5px) !important;
  min-width: 1248px !important;
  overflow-x: auto !important;
}

html.portfolio-project-page body {
  min-width: 1248px !important;
  overflow-x: visible !important;
}

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .portfolio-project-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
      opacity 0.7s cubic-bezier(0.215, 0.61, 0.355, 1),
      transform 0.7s cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  .portfolio-project-reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}
