/* Shared brand surface for public secondary pages. */
html {
  overflow-x: clip;
}

body.service-page {
  --page: #05070a;
  --page-soft: #080b10;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-solid: #090d12;
  --surface-quiet: rgba(255, 255, 255, 0.025);
  --line: rgba(218, 228, 239, 0.12);
  --line-strong: rgba(218, 228, 239, 0.24);
  --text: #f2f4f6;
  --muted: #8f9aa8;
  --muted-strong: #c1c8d0;
  --accent: #78b8ff;
  --accent-strong: #78b8ff;
  --shadow: none;
  position: relative;
  isolation: isolate;
  background: var(--page);
  overflow-x: clip;
}

body.service-page::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background-image: url("/assets/intelligence-fabric/mission-wave-hd-1280.webp");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  opacity: 0.09;
  filter: grayscale(1) sepia(0.12);
  mix-blend-mode: screen;
}

html[data-theme="light"] body.service-page {
  --page: #f2f4f6;
  --page-soft: #e9edf1;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-quiet: rgba(17, 24, 32, 0.025);
  --line: rgba(17, 24, 32, 0.12);
  --line-strong: rgba(17, 24, 32, 0.24);
  --text: #111820;
  --muted: #637080;
  --muted-strong: #374351;
  --accent: #1769c4;
  --accent-strong: #1769c4;
  background: var(--page);
}

html[data-theme="light"] body.service-page::before {
  opacity: 0.045;
  filter: invert(1) grayscale(1);
  mix-blend-mode: multiply;
}

.service-page .site-shell {
  position: relative;
  z-index: 1;
}

.service-page .site-shell,
.service-page main,
html[data-theme="light"] .service-page .site-shell,
html[data-theme="light"] .service-page main {
  background: transparent;
}

.service-page .topbar {
  background: rgba(5, 7, 10, 0.94);
  border-bottom-color: var(--line);
  transition:
    top 240ms ease,
    width 240ms ease,
    min-height 240ms ease,
    padding 240ms ease,
    border-color 240ms ease,
    border-radius 240ms ease,
    background-color 240ms ease,
    box-shadow 240ms ease;
}

html[data-theme="light"] .service-page .topbar {
  background: rgba(242, 244, 246, 0.94);
  border-bottom-color: var(--line);
}

.service-page .brand img {
  border-radius: 0;
}

.service-page .nav {
  font-weight: 600;
}

.service-page .hero {
  padding-top: 112px;
  padding-bottom: 92px;
}

.service-page .hero h1,
.service-page .section h2,
.service-page .section-heading h2,
.service-page .case-heading strong {
  font-family: "Noto Serif SC", "Songti SC", STSong, serif;
  font-weight: 600;
  letter-spacing: 0;
}

.service-page .hero h1 {
  max-width: 1040px;
  font-size: clamp(48px, 5vw, 70px);
  line-height: 1.2;
}

.service-page .hero-split h1 {
  font-size: clamp(48px, 4.25vw, 62px);
}

.service-page .hero .lead {
  max-width: 900px;
  color: var(--muted-strong);
  font-size: 18px;
}

.faq-page .hero .lead {
  max-width: 1040px;
}

.service-page .hero h1 span,
.service-page .section h2 span {
  color: var(--text);
}

.service-page .btn {
  min-height: 46px;
  border-radius: 4px;
  box-shadow: none;
}

.service-page .btn.primary,
.service-page .btn.experience {
  color: #05070a;
  background: var(--text);
  border-color: var(--text);
}

html[data-theme="light"] .service-page .btn.primary,
html[data-theme="light"] .service-page .btn.experience {
  color: #ffffff;
  background: #111820;
  border-color: #111820;
}

.service-page .section {
  position: relative;
  padding-top: 92px;
  padding-bottom: 92px;
}

.service-page .section h2 {
  font-size: clamp(34px, 3.4vw, 48px);
}

.service-page .card,
.service-page .table-wrap,
.service-page .answer-box,
.service-page .note {
  background: rgba(8, 11, 16, 0.54);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: none;
}

html[data-theme="light"] .service-page .card,
html[data-theme="light"] .service-page .table-wrap,
html[data-theme="light"] .service-page .answer-box,
html[data-theme="light"] .service-page .note {
  background: rgba(255, 255, 255, 0.62);
}

.service-page .card,
.service-page .screenshot-card,
.service-page .hero-preview,
.service-page .case-cta .answer-box {
  border-color: var(--line);
  border-radius: 6px;
  box-shadow: none;
}

.service-page .screenshot-card,
.service-page .hero-preview {
  background: var(--surface-solid);
}

.service-page .grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.service-page .footer {
  position: relative;
  width: 100%;
  min-height: clamp(340px, 24vw, 420px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: clamp(88px, 7vw, 116px) max(24px, calc((100vw - var(--max)) / 2)) clamp(132px, 9vw, 168px);
  background: linear-gradient(to bottom, transparent, rgba(5, 7, 10, 0.82) 34%);
  border-top: 0;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.service-page .footer::before {
  content: "";
  position: absolute;
  top: 0;
  right: max(24px, calc((100vw - var(--max)) / 2));
  left: max(24px, calc((100vw - var(--max)) / 2));
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 14%, var(--line-strong) 86%, transparent);
}

.service-page .footer > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.service-page .footer .footer-links {
  margin-top: 18px;
}

html[data-theme="light"] .service-page .footer {
  color: var(--text);
  background: linear-gradient(to bottom, transparent, rgba(233, 237, 241, 0.9) 34%);
}

.service-page.scroll-continuity-ready .scroll-chapter {
  opacity: 0.7;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.service-page.scroll-continuity-ready .scroll-chapter.is-scroll-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 1081px) {
  .service-page.page-scrolled .topbar {
    top: 14px;
    width: min(1240px, calc(100% - 48px));
    min-height: 64px;
    margin-inline: auto;
    padding: 9px 24px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(5, 7, 10, 0.78);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  }

  html[data-theme="light"] .service-page.page-scrolled .topbar {
    background: rgba(242, 244, 246, 0.82);
    box-shadow: 0 18px 48px rgba(17, 24, 32, 0.1);
  }
}

@media (min-width: 1600px) {
  body.service-page::before {
    background-image: url("/assets/intelligence-fabric/mission-wave-hd-2560.webp");
  }
}

@media (max-width: 640px) {
  body.service-page::before {
    background-position: 72% bottom;
    background-size: auto 72vh;
    opacity: 0.065;
  }

  html[data-theme="light"] body.service-page::before {
    opacity: 0.035;
  }

  .service-page .footer {
    min-height: 330px;
    padding-top: 76px;
    padding-bottom: 124px;
  }

  .service-page .hero {
    padding-top: 72px;
    padding-bottom: 56px;
  }

  .service-page .hero h1 {
    font-size: 42px;
  }

  .service-page .hero .lead {
    font-size: 16px;
  }

  .service-page .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .service-page .grid.five {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-page .topbar,
  .service-page.scroll-continuity-ready .scroll-chapter {
    transition: none;
  }

  .service-page.scroll-continuity-ready .scroll-chapter {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 641px) and (max-width: 1100px) {
  .service-page .footer {
    min-height: 360px;
    padding-bottom: 136px;
  }

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

/* Shared chapter navigation for long-form public pages. */
.page-guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1000px) minmax(0, 1fr);
  position: relative;
}

.page-guide-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.page-guide-content .section {
  width: 100%;
  margin-inline: 0;
}

.page-guide-content .section[id] {
  scroll-margin-top: 12px;
}

.page-toc {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  position: sticky;
  top: calc(var(--header) + 30px);
  width: min(168px, calc(100% - 32px));
  margin: 84px 32px 0 0;
  color: var(--muted);
}

.page-toc-head {
  display: grid;
  gap: 7px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.page-toc-head span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.page-toc-head strong {
  color: var(--text);
  font-family: "Noto Serif SC", "Songti SC", STSong, serif;
  font-size: 18px;
  font-weight: 600;
}

.page-toc-list {
  border-left: 1px solid var(--line);
}

.page-toc-link {
  display: block;
  margin-left: -1px;
  padding: 10px 0 10px 15px;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease;
}

.page-toc-link:hover {
  color: var(--text);
}

.page-toc-link[aria-current="location"] {
  border-left-color: var(--accent);
  color: var(--text);
}

@media (max-width: 1360px) {
  .page-guide-layout {
    display: block;
  }

  .page-guide-content .section {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
  }

  .page-toc {
    position: sticky;
    top: var(--header);
    z-index: 12;
    width: 100%;
    margin: 0;
    padding: 0 max(20px, calc((100vw - 1120px) / 2));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--page);
  }

  .page-toc-head {
    display: none;
  }

  .page-toc-list {
    display: flex;
    gap: 26px;
    overflow-x: auto;
    border-left: 0;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
  }

  .page-toc-list::-webkit-scrollbar {
    display: none;
  }

  .page-toc-link {
    flex: 0 0 auto;
    margin: 0;
    padding: 15px 0 13px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }

  .page-toc-link[aria-current="location"] {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }

  .page-guide-content .section[id] {
    scroll-margin-top: 58px;
  }
}

@media (max-width: 640px) {
  .page-guide-content .section {
    width: min(100% - 32px, var(--max));
  }

  .page-toc {
    padding-inline: 16px;
  }

  .page-toc-list {
    gap: 22px;
  }

  .page-toc-link {
    padding-block: 13px 11px;
    font-size: 12px;
  }

  .page-guide-content .section[id] {
    scroll-margin-top: 58px;
  }
}
