/*
 * Homepage-only chrome layer for the published artboard design.
 * Restores the site-wide topbar dropdown navigation and the floating
 * consultation window on the published homepage without loading the full
 * site.css / design-refresh.css stack, whose legacy homepage rules would
 * collide with the approved artboard styles. Rules mirror the cumulative
 * cascade of chrome.css + experience.css + design-refresh.css + site-extras.css,
 * scoped under body.published-home.
 */

body.published-home {
  --blue: #1468df;
  --blue-deep: #0b4eaf;
  --text-dark: #0d1b2f;
  --muted-dark: #68788e;
  --line-dark: #dce5ef;
  --pad: clamp(24px, 5vw, 96px);
  --display: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  --refresh-line: rgba(25, 72, 126, 0.11);
  --refresh-shell: min(1280px, calc(100vw - 48px));
  --experience-blue: #0b63d8;
  --experience-blue-bright: #2f82e9;
  --experience-ink: #10243d;
  --experience-muted: #66778c;
  --experience-ease: cubic-bezier(0.2, 0.72, 0.2, 1);
}

/* Topbar: quiet, translucent, sticky (design-refresh final state) */

body.published-home .topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  height: 70px;
  color: var(--text-dark);
  border-bottom: 1px solid rgba(31, 79, 134, 0.08);
  background: rgba(249, 252, 255, 0.82);
  box-shadow: 0 8px 30px rgba(31, 72, 119, 0.055);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
}

body.published-home .topbar__inner {
  position: relative;
  z-index: 3;
  height: 100%;
  width: var(--refresh-shell);
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: clamp(22px, 3vw, 52px);
}

body.published-home .topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  transform: none;
}

body.published-home .topbar .brand__mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 7px 14px rgba(20, 104, 223, 0.16));
}

body.published-home .topbar .brand__copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

body.published-home .topbar .brand__copy strong {
  color: #0e1b2e;
  font-family: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
}

body.published-home .topbar .brand__copy span {
  color: #7c899a;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* Dropdown navigation */

body.published-home .nav {
  min-width: 0;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(22px, 2.5vw, 44px);
  font-size: 13px;
  font-weight: 720;
}

body.published-home .nav-menu {
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
}

body.published-home .nav-item {
  position: static;
  display: flex;
  align-items: stretch;
}

body.published-home .nav-trigger {
  position: relative;
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px;
  color: #35465c;
  background: transparent;
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

body.published-home .nav-trigger:hover,
body.published-home .nav-trigger:focus-visible,
body.published-home .nav-item.is-open .nav-trigger,
body.published-home .nav-item.is-current .nav-trigger {
  color: var(--experience-blue);
  background: rgba(11, 99, 216, 0.08);
}

body.published-home .nav-trigger:focus-visible {
  outline: 3px solid rgba(11, 99, 216, 0.22);
  outline-offset: 2px;
}

body.published-home .nav-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  width: min(1060px, calc(100vw - 40px));
  padding: 12px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--refresh-line);
  border-radius: 24px;
  color: var(--experience-ink);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 26px 80px rgba(19, 55, 98, 0.17);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
  transform: translate(-50%, -12px) scale(0.985);
  transform-origin: 50% 0;
  /* No visibility delay: the closing panel hides at once so switching
   * between nav items never shows two overlapping dropdown panels. */
  transition:
    opacity 220ms ease,
    transform 320ms var(--experience-ease);
}

body.published-home .nav-panel::before {
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 12px;
  content: "";
}

/* Hard guarantee: a closing or closed dropdown can never stay visible. */
body.published-home .nav-item:not(.is-open) .nav-panel {
  visibility: hidden !important;
}

body.published-home .nav-item.is-open .nav-panel {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  transition-delay: 0s;
}

body.published-home .nav-panel__content {
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(250px, 0.76fr) minmax(0, 2.24fr);
  gap: clamp(24px, 4vw, 64px);
}

body.published-home .nav-panel__intro {
  position: relative;
  min-height: 220px;
  padding: 30px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid rgba(34, 104, 188, 0.08);
  border-radius: 18px;
  background:
    radial-gradient(circle at 86% 14%, rgba(53, 139, 239, 0.16), transparent 34%),
    #f3f8fe;
}

body.published-home .nav-panel__intro::after {
  position: absolute;
  right: -54px;
  bottom: -62px;
  width: 180px;
  aspect-ratio: 1;
  content: "";
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(25, 108, 218, 0.24), rgba(95, 170, 248, 0.06));
  transition: transform 560ms var(--experience-ease);
}

body.published-home .nav-item.is-open .nav-panel__intro::after {
  transform: translate(-10px, -8px) scale(1.08);
}

body.published-home .nav-panel__intro > span,
body.published-home .nav-panel__group > p {
  color: var(--experience-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.published-home .nav-panel__intro > strong {
  max-width: 260px;
  margin-top: 18px;
  font-family: var(--display);
  font-size: clamp(23px, 2vw, 31px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

body.published-home .nav-panel__intro > p {
  max-width: 290px;
  margin: 14px 0 26px;
  color: var(--experience-muted);
  font-size: 12px;
  line-height: 1.72;
}

body.published-home .nav .nav-panel__intro > a {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 10px 14px;
  border-radius: 999px;
  color: white;
  background: var(--experience-blue);
  font-size: 11px;
  font-weight: 760;
  transition: background 180ms ease, transform 180ms ease;
}

body.published-home .nav .nav-panel__intro > a:hover,
body.published-home .nav .nav-panel__intro > a:focus-visible {
  color: white;
  background: var(--experience-blue-bright);
  transform: translateY(-2px);
}

body.published-home .nav-panel__groups {
  padding: 18px 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 42px);
  align-content: center;
}

body.published-home .nav-panel__group {
  min-width: 0;
}

body.published-home .nav-panel__group > p {
  margin-bottom: 16px;
}

body.published-home .nav-panel__group > div {
  display: grid;
  gap: 6px;
}

body.published-home .nav .nav-panel__group a {
  min-height: 42px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  border-radius: 12px;
  color: #42546b;
  font-size: 13px;
  font-weight: 610;
  line-height: 1.45;
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 220ms var(--experience-ease);
}

body.published-home .nav .nav-panel__group a:hover,
body.published-home .nav .nav-panel__group a:focus-visible {
  color: var(--experience-blue);
  background: rgba(11, 99, 216, 0.075);
  transform: translateX(4px);
}

body.published-home .nav .nav-panel__group a::after,
body.published-home .nav .nav-panel__intro > a::after {
  display: none;
}

body.published-home .header-cta {
  min-height: 42px;
  padding: 0 17px;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: white;
  border: 0;
  border-radius: 999px;
  background: #0b63d8;
  box-shadow: 0 10px 25px rgba(11, 99, 216, 0.2);
  font-size: 11px;
  font-weight: 720;
  transition: background 180ms ease;
}

body.published-home .header-cta:hover,
body.published-home .header-cta:focus-visible {
  color: white;
  background: var(--blue);
}

body.published-home .nav-scrim {
  position: fixed;
  z-index: 1;
  inset: 70px 0 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(20, 42, 70, 0.18);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}

body.published-home .topbar.has-nav-open .nav-scrim {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

body.published-home .nav-toggle {
  display: none;
  border: 0;
  background: #edf4fc;
  box-shadow: none;
}

/* Compact and mobile navigation */

@media (max-width: 1240px) {
  body.published-home .nav-trigger {
    padding-inline: 9px;
    font-size: 11px;
  }
}

@media (max-width: 1180px) {
  body.published-home .topbar__inner {
    grid-template-columns: 1fr auto auto;
    gap: 12px;
  }

  body.published-home .nav-toggle {
    position: relative;
    z-index: 5;
    width: 42px;
    height: 42px;
    padding: 0;
    display: grid;
    place-content: center;
    gap: 7px;
    border-radius: 50%;
  }

  body.published-home .nav-toggle span:not(.sr-only) {
    width: 18px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: #24405f;
    transition: transform 220ms var(--experience-ease);
  }

  body.published-home .nav-toggle[aria-expanded="true"] span:not(.sr-only) {
    position: absolute;
    top: 50%;
    left: 50%;
  }

  body.published-home .nav-toggle[aria-expanded="true"] span:not(.sr-only):nth-of-type(2) {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  body.published-home .nav-toggle[aria-expanded="true"] span:not(.sr-only):nth-of-type(3) {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  body.published-home .nav {
    position: fixed;
    z-index: 4;
    inset: 70px 0 0;
    width: auto;
    height: calc(100dvh - 70px);
    padding: 24px clamp(20px, 5vw, 54px) 60px;
    display: none;
    overflow-y: auto;
    color: var(--experience-ink);
    background:
      radial-gradient(circle at 92% 8%, rgba(67, 148, 241, 0.16), transparent 25%),
      rgba(246, 250, 255, 0.985);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
  }

  body.published-home .nav.is-open {
    display: block;
  }

  body.published-home .nav-menu {
    width: min(100%, 900px);
    height: auto;
    margin: 0 auto;
    display: grid;
    gap: 10px;
  }

  body.published-home .nav-item {
    display: block;
  }

  body.published-home .nav-trigger {
    width: 100%;
    min-height: 62px;
    padding: 0 20px;
    justify-content: flex-start;
    border-radius: 18px;
    font-size: 19px;
    text-align: left;
  }

  body.published-home .nav-panel {
    position: static;
    width: auto;
    max-height: 0;
    padding: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    border: 0;
    border-radius: 22px;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transform: none;
    transition:
      max-height 540ms var(--experience-ease),
      opacity 240ms ease,
      visibility 0s linear 540ms;
  }

  body.published-home .nav-item.is-open .nav-panel {
    max-height: 1100px;
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
  }

  body.published-home .nav-panel::before {
    display: none;
  }

  body.published-home .nav-panel__content {
    padding: 10px 0 20px;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  body.published-home .nav-panel__intro {
    min-height: 0;
    padding: 24px;
  }

  body.published-home .nav-panel__intro > p {
    margin-bottom: 18px;
  }

  body.published-home .nav-panel__groups {
    padding: 8px 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
  }

  body.published-home .nav .nav-panel__group a {
    border: 0;
  }
}

@media (max-width: 920px) {
  body.published-home .topbar {
    height: 68px;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  body.published-home .nav {
    inset: 68px 0 0;
    height: calc(100dvh - 68px);
  }
}

@media (max-width: 760px) {
  body.published-home .header-cta {
    display: none;
  }

  body.published-home .topbar__inner {
    grid-template-columns: 1fr auto;
  }

  body.published-home .nav-panel__groups {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  body.published-home .nav-panel__intro {
    display: none;
  }
}

@media (max-width: 640px) {
  body.published-home .topbar .brand__mark {
    width: 32px;
    height: 32px;
  }

  body.published-home .topbar .brand__copy strong {
    font-size: 18px;
  }
}

/* Reduced motion: keep navigation and floating window instant and still */

/* The artboard reset sets button{cursor:default}; restore pointer affordance. */
body.published-home .topbar button,
body.published-home .topbar a,
body.published-home .floating-contact button,
body.published-home .floating-contact a {
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  body.published-home .topbar,
  body.published-home .nav,
  body.published-home .nav-panel,
  body.published-home .nav-panel__intro::after,
  body.published-home .nav .nav-panel__group a,
  body.published-home .nav-trigger,
  body.published-home .header-cta {
    transition: none !important;
    animation: none !important;
  }
}
