/* ROUND S5 - FINAL PUBLIC SOLUTIONS POLISH */
:root {
  scroll-padding-top: 152px;
}

html {
  scroll-behavior: smooth;
}

.solutions-lazy-section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 920px;
}

.js [data-s5-animate] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity .56s ease,
    transform .56s cubic-bezier(.2,.72,.2,1);
}

.js [data-s5-animate].is-final-visible {
  opacity: 1;
  transform: none;
}

.solutions-anchor-nav a[aria-current="location"] {
  color: #ecfeff;
  border-color: rgba(94,234,212,.5);
  background: rgba(13,148,136,.18);
  box-shadow: inset 0 0 0 1px rgba(94,234,212,.08);
}

.solutions-final-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.solutions-final-cta::before {
  content: "";
  position: absolute;
  inset: -35% auto auto 58%;
  z-index: -1;
  width: 420px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,212,191,.2), transparent 66%);
  pointer-events: none;
}

.solutions-final-cta p {
  max-width: 720px;
  margin-inline: auto;
}

.solutions-button,
.solutions-header-cta,
.solutions-anchor-nav a,
.solutions-main-nav a {
  min-height: 44px;
}

:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid rgba(94,234,212,.82);
  outline-offset: 3px;
}

/* Complete responsive guardrails */
img,
video,
iframe,
svg,
canvas {
  max-width: 100%;
}

.solutions-section,
.solutions-shell,
.solutions-layout,
.solutions-portfolio-layout,
.solutions-domain-layout,
.solutions-contract-layout,
.solutions-proposal-layout {
  min-width: 0;
}

@media (max-width: 760px) {
  :root { scroll-padding-top: 136px; }

  .solutions-anchor-nav {
    scrollbar-width: thin;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
  }

  .solutions-anchor-nav a {
    scroll-snap-align: center;
    white-space: nowrap;
  }

  .solutions-final-cta .solutions-hero-actions {
    width: 100%;
  }

  .solutions-final-cta .solutions-button {
    width: 100%;
    justify-content: center;
  }
}

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

  .js [data-s5-animate] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ROUND S5B.2 - CRITICAL LAYOUT, ANCHOR AND PERFORMANCE REVIEW */
:root {
  --solutions-sticky-offset: 152px;
  scroll-padding-top: calc(var(--solutions-sticky-offset) + 16px);
}

main > section[id],
main > .solutions-section[id] {
  scroll-margin-top: calc(var(--solutions-sticky-offset) + 16px);
}

/* Heavy demos are contained without reserving artificial height for whole chapters. */
.solutions-lazy-section {
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

.solutions-lazy-demo {
  content-visibility: auto;
  contain-intrinsic-size: auto 760px;
}

/* The portfolio contains live controls and remains eager for stable keyboard and pointer interaction. */
[data-solutions-portfolio].solutions-lazy-demo {
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

.solutions-anchor-nav {
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.solutions-anchor-nav a {
  font-size: clamp(.78rem, .74rem + .14vw, .9rem);
  line-height: 1.25;
}

.solutions-site-footer,
.solutions-footer-inner,
.solutions-footer-links,
.solutions-footer-links a {
  font-size: clamp(.8rem, .76rem + .12vw, .9rem);
  line-height: 1.55;
}

/* Prevent accidental oversized gaps caused by section containment and anchor entry. */
main > section[id] + section[id] {
  margin-top: 0;
}

@media (max-width: 760px) {
  :root {
    --solutions-sticky-offset: 136px;
    scroll-padding-top: calc(var(--solutions-sticky-offset) + 12px);
  }

  main > section[id],
  main > .solutions-section[id] {
    scroll-margin-top: calc(var(--solutions-sticky-offset) + 12px);
  }
}

/* ROUND S5B.3 - STICKY ANCHOR STABILITY */
:root {
  --solutions-anchor-safe-gap: 20px;
  scroll-padding-top: calc(var(--solutions-sticky-offset) + var(--solutions-anchor-safe-gap));
}

main > section[id],
main > .solutions-section[id] {
  scroll-margin-top: calc(var(--solutions-sticky-offset) + var(--solutions-anchor-safe-gap));
}

/* ROUND S5B.4 - FINAL NAVIGATION OWNERSHIP */
.solutions-anchor-nav[data-s5-navigation-lock] a[aria-current="location"] {
  position: relative;
}
/* ROUND S5C.2 - HOME HEADER AND SCROLL RECOVERY */
html {
  scroll-behavior: auto !important;
  scroll-snap-type: none !important;
}

body {
  overscroll-behavior-y: auto;
}

/* Chapters stay in the natural document flow. This overrides the original
   content-visibility rules that caused estimated heights and scroll jumps. */
.solutions-section,
.solutions-lazy-section,
.solutions-lazy-demo,
[data-solutions-portfolio].solutions-lazy-demo {
  content-visibility: visible !important;
  contain-intrinsic-size: auto !important;
}

.js [data-s5-animate],
.js [data-s5-animate].is-final-visible {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.solutions-site-header,
.solutions-anchor-wrap {
  overflow-anchor: none;
}

.solutions-anchor-wrap {
  background: rgba(7, 7, 15, .985) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Same visual system and information architecture as the public home. */
.solutions-site-header.solutions-home-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 68px;
  border-bottom: 1px solid rgba(139, 92, 246, .18);
  background: rgba(7, 7, 15, .92);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.solutions-home-header .solutions-header-inner {
  position: relative;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.solutions-home-header .solutions-official-brand.cometai-brand-wordmark {
  width: 122px;
  height: 34px;
  flex: 0 0 122px;
}

.solutions-home-header .solutions-main-nav.nav-links {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: clamp(.75rem, 1.35vw, 1.7rem);
}

.solutions-home-header .solutions-main-nav.nav-links > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--solutions-muted);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease;
}

.solutions-home-header .solutions-main-nav.nav-links > a:hover,
.solutions-home-header .solutions-main-nav.nav-links > a:focus-visible {
  color: #fff;
}

.solutions-home-header-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: .62rem;
}

.public-channel-status.solutions-header-channels {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .24rem .34rem;
  border: 1px solid rgba(139, 92, 246, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
}

.solutions-header-channels .public-channel-status__item {
  position: relative;
  display: inline-flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 50%;
  color: #8bb4ff;
  background: rgba(255, 255, 255, .025);
  font-family: Arial, sans-serif;
  font-size: .85rem;
  font-weight: 800;
  line-height: 1;
}

.solutions-header-channels .public-channel-status__item::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 6px;
  height: 6px;
  border: 1px solid #07070f;
  border-radius: 50%;
  background: #34d399;
}

.solutions-header-channels .public-channel-status__glyph {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.solutions-channel-facebook {
  color: #60a5fa !important;
}

.solutions-header-language-switcher {
  position: relative;
  flex: 0 0 auto;
}

.solutions-header-language {
  display: inline-flex;
  min-width: 62px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  border: 1px solid rgba(139, 92, 246, .22);
  border-radius: 999px;
  padding: .45rem .72rem;
  color: #ece9ff;
  background: rgba(255, 255, 255, .035);
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

.solutions-header-language-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 220;
  width: 190px;
  padding: .38rem;
  border: 1px solid rgba(139, 92, 246, .24);
  border-radius: 14px;
  background: rgba(13, 13, 26, .99);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .45);
}

.solutions-header-language-menu[hidden] {
  display: none !important;
}

.solutions-header-language-menu a {
  display: flex;
  min-height: 42px;
  align-items: center;
  border-radius: 10px;
  padding: .55rem .65rem;
  color: #f1f0ff;
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
}

.solutions-header-language-menu a:hover,
.solutions-header-language-menu a:focus-visible {
  background: rgba(139, 92, 246, .14);
}

.solutions-home-header .solutions-header-cta.nav-cta {
  min-height: 42px;
  padding: .62rem 1.18rem;
  white-space: nowrap;
}

.solutions-header-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  gap: 4px;
  border: 1px solid rgba(139, 92, 246, .25);
  border-radius: 12px;
  padding: 10px;
  color: #fff;
  background: rgba(255, 255, 255, .035);
  cursor: pointer;
}

.solutions-header-menu-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}

.solutions-home-header.is-menu-open .solutions-header-menu-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.solutions-home-header.is-menu-open .solutions-header-menu-toggle span:nth-child(2) {
  opacity: 0;
}

.solutions-home-header.is-menu-open .solutions-header-menu-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.solutions-mobile-header-actions {
  display: none;
}

.solutions-anchor-nav {
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
}

@media (max-width: 1180px) {
  .solutions-home-header .solutions-main-nav.nav-links {
    gap: .72rem;
  }

  .solutions-home-header .solutions-main-nav.nav-links > a {
    font-size: .8rem;
  }

  .solutions-header-channels .public-channel-status__item {
    width: 25px;
    height: 25px;
  }
}

@media (max-width: 1020px) {
  .solutions-header-menu-toggle {
    display: grid;
  }

  .solutions-home-header .solutions-main-nav.nav-links {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    z-index: 210;
    display: none;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    padding: .8rem max(3vw, 1rem) 1rem;
    border-bottom: 1px solid rgba(139, 92, 246, .2);
    background: rgba(7, 7, 15, .995);
    box-shadow: 0 22px 50px rgba(0, 0, 0, .38);
  }

  .solutions-home-header.is-menu-open .solutions-main-nav.nav-links {
    display: grid;
  }

  .solutions-home-header .solutions-main-nav.nav-links > a {
    justify-content: center;
    min-height: 46px;
    border: 1px solid rgba(139, 92, 246, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
    font-size: .88rem;
  }

  .solutions-mobile-header-actions {
    display: none;
  }
}

@media (max-width: 760px) {
  .solutions-home-header .solutions-header-inner {
    width: min(94vw, 1180px);
    gap: .48rem;
  }

  .solutions-home-header .solutions-official-brand.cometai-brand-wordmark {
    width: 112px;
    flex-basis: 112px;
  }

  .solutions-home-header .solutions-header-cta,
  .solutions-header-language-switcher {
    display: none;
  }

  .solutions-header-channels .public-channel-status__item {
    width: 24px;
    height: 24px;
  }

  .solutions-header-channels .public-channel-status__glyph {
    width: 14px;
    height: 14px;
  }

  .solutions-mobile-header-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
    margin-top: .3rem;
  }

  .solutions-mobile-header-actions a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    font-size: .84rem;
    font-weight: 800;
    text-decoration: none;
  }

  .solutions-mobile-language {
    border: 1px solid rgba(139, 92, 246, .26);
    background: rgba(255, 255, 255, .04);
  }

  .solutions-mobile-start {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 0 22px rgba(139, 92, 246, .3);
  }
}

@media (max-width: 480px) {
  .solutions-header-channels {
    gap: .18rem !important;
    padding: .18rem .24rem !important;
  }

  .solutions-header-channels .public-channel-status__item {
    width: 22px;
    height: 22px;
  }

  .solutions-header-channels .public-channel-status__glyph {
    width: 13px;
    height: 13px;
  }

  .solutions-header-menu-toggle {
    width: 39px;
    height: 39px;
  }

  .solutions-home-header .solutions-main-nav.nav-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 365px) {
  .solutions-header-channels .public-channel-status__item:nth-child(4) {
    display: none;
  }
}
/* ROUND S5C.3 - HEADER ICON AND HOME FALLBACK FINISH */
.public-channel-status.solutions-header-channels {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.solutions-header-channels .public-channel-status__item {
  border: 1px solid rgba(255, 255, 255, .12) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.solutions-header-channels .public-channel-status__item::after {
  content: none !important;
  display: none !important;
}

.solutions-header-channels .public-channel-status__item:hover,
.solutions-header-channels .public-channel-status__item:focus-visible {
  border-color: rgba(167, 139, 250, .46) !important;
  background: rgba(139, 92, 246, .08) !important;
}

.solutions-anchor-nav a[aria-current="true"],
.solutions-anchor-nav a[aria-current="location"] {
  color: #ecfeff;
  border-color: rgba(94, 234, 212, .5);
  background: rgba(13, 148, 136, .18);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, .08);
}
