/*
 * Global interaction layer.
 * Loaded after page-specific styles so shared navigation geometry remains
 * identical when moving between the homepage and inner pages.
 */

body .topbar {
  height: 76px;
}

body .topbar .brand {
  gap: 12px;
  transform: none;
}

body .topbar .brand__mark {
  width: 36px;
  height: 36px;
}

body .topbar .brand__copy {
  align-items: baseline;
  gap: 10px;
}

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

body .topbar .brand__copy span {
  color: #78869a;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

/* The service explorer is a normal-height section; wheel/trackpad scrolling
 * never pins the viewport or uses scroll distance to change tabs. */
.home-page .services-section {
  min-height: 0;
  padding: clamp(86px, 9vw, 142px) 0;
  overflow: hidden;
}

.home-page .services-story-pin {
  position: relative;
  top: auto;
  height: auto;
  min-height: 0;
  padding: 0 var(--pad);
  display: block;
  overflow: visible;
}

.home-page .services-story-pin::before {
  right: -12vw;
  bottom: -22%;
  transform: rotate(18deg);
}

.home-page .services-story-pin .service-explorer {
  margin-top: clamp(34px, 5vw, 70px);
}

.home-page .services-story-pin .service-stage,
.home-page .services-story-pin .service-panels {
  min-height: clamp(390px, 42vw, 520px);
  height: clamp(390px, 42vw, 520px);
}

.home-page .services-story-pin .scope-note {
  margin-top: 18px;
}

/* Shichi's first-entry sequence uses a project ruler instead of a decorative
 * halo. It does not pin the page and keeps a CSS failsafe for no-JS visits. */
.site-entry {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #12345d;
  background:
    linear-gradient(rgba(69, 131, 202, .065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 131, 202, .065) 1px, transparent 1px),
    #edf6ff;
  background-size: 44px 44px;
  animation: site-entry-failsafe 0s 3.2s forwards;
}

.site-entry__panels {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  pointer-events: none;
}

.site-entry__panels > span {
  background:
    linear-gradient(rgba(69, 131, 202, .065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 131, 202, .065) 1px, transparent 1px),
    #edf6ff;
  background-size: 44px 44px;
}

.site-entry__panels > span:first-child {
  border-right: 1px solid rgba(39, 105, 184, .12);
}

.site-entry__content {
  position: relative;
  z-index: 2;
  width: min(820px, calc(100vw - 72px));
  padding: 28px 0;
  display: grid;
  gap: clamp(42px, 6vw, 76px);
}

.site-entry__brand {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 24px;
  align-items: center;
}

.site-entry__mark {
  width: 82px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 25px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 20px 58px rgba(32, 100, 179, .13);
}

.site-entry__mark img {
  width: 52px;
  height: 52px;
}

.site-entry__copy {
  display: grid;
}

.site-entry__copy > p {
  margin: 0 0 10px;
  color: #4f79a7;
  font-size: 9px;
  font-weight: 780;
  letter-spacing: .2em;
}

.site-entry__copy > strong {
  font-size: clamp(40px, 4.8vw, 68px);
  line-height: 1;
  letter-spacing: .06em;
}

.site-entry__copy > span {
  margin-top: 14px;
  color: #5d7590;
  font-size: clamp(13px, 1.2vw, 16px);
}

.site-entry__ruler {
  position: relative;
  padding-top: 13px;
}

.site-entry__line {
  height: 2px;
  transform-origin: left center;
  background: linear-gradient(90deg, #1469c9, #72baf3);
}

.site-entry__cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 42px;
  background: #0a5dbf;
  box-shadow: 0 0 0 6px rgba(33, 121, 213, .1), 0 0 32px rgba(13, 103, 199, .32);
}

.site-entry__ruler ol {
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
}

.site-entry__ruler li {
  position: relative;
  display: grid;
  gap: 6px;
}

.site-entry__ruler li::before {
  position: absolute;
  top: -20px;
  left: 0;
  width: 1px;
  height: 9px;
  content: "";
  background: #4d91d7;
}

.site-entry__ruler b {
  color: #2e73ba;
  font-size: 10px;
  letter-spacing: .12em;
}

.site-entry__ruler span {
  color: #25476e;
  font-size: 12px;
  font-weight: 760;
}

.site-entry__caption {
  margin: -40px 0 0;
  color: #7088a2;
  font-size: 12px;
  text-align: right;
}

.site-entry > button {
  position: absolute;
  z-index: 3;
  right: clamp(22px, 4vw, 58px);
  bottom: clamp(20px, 4vw, 48px);
  padding: 10px 0;
  color: #55779e;
  border: 0;
  border-bottom: 1px solid rgba(50, 105, 166, .3);
  background: transparent;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.site-entry > button:hover,
.site-entry > button:focus-visible {
  color: #0b60c4;
}

@keyframes site-entry-failsafe {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

/* Blue-white glass consultation window adapted to the Shichi visual system. */
.floating-contact {
  position: fixed;
  z-index: 90;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(14px, 2vw, 28px);
  width: 228px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 22px;
  color: #11243e;
  background: linear-gradient(145deg, rgba(255, 255, 255, .91), rgba(226, 241, 255, .82));
  box-shadow: 0 26px 74px rgba(18, 75, 145, .2), inset 0 1px 0 rgba(255, 255, 255, .92);
  backdrop-filter: blur(24px) saturate(150%);
  transition:
    width 260ms cubic-bezier(.22, 1, .36, 1),
    border-radius 260ms ease,
    background 260ms ease,
    box-shadow 260ms ease,
    transform 360ms cubic-bezier(.22, 1, .36, 1),
    opacity 240ms ease;
}

.floating-contact__toggle {
  width: 100%;
  min-height: 54px;
  padding: 0 17px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  color: white;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #0b63d8, #4a9bf0);
  box-shadow: 0 16px 36px rgba(14, 99, 210, .24);
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.floating-contact__toggle-icon {
  width: 32px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}

.floating-contact__toggle-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.floating-contact:not(.is-collapsed) .floating-contact__toggle {
  display: none;
}

.floating-contact__panel {
  display: grid;
  gap: 8px;
}

.floating-contact__panel > header {
  padding: 12px 10px 5px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.floating-contact__panel > header div {
  display: grid;
  gap: 5px;
}

.floating-contact__panel > header span {
  color: #6a8aad;
  font-size: 8px;
  font-weight: 780;
  letter-spacing: .16em;
}

.floating-contact__panel > header strong {
  font-size: 16px;
}

.floating-contact__panel > header button {
  width: 30px;
  aspect-ratio: 1;
  padding: 0;
  color: #5f7895;
  border: 0;
  border-radius: 50%;
  background: rgba(203, 225, 249, .58);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}

.floating-contact__wechat {
  padding: 13px 12px 12px;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 10px;
  border-radius: 17px;
  background: rgba(255, 255, 255, .72);
  text-align: center;
}

.floating-contact__wechat img {
  width: 116px;
  height: 116px;
  padding: 5px;
  border-radius: 14px;
  background: white;
}

.floating-contact__wechat p {
  margin: 0;
  display: grid;
  gap: 4px;
}

.floating-contact__wechat strong {
  font-size: 14px;
}

.floating-contact__wechat span {
  color: #6a7f98;
  font-size: 11px;
  line-height: 1.55;
}

.floating-contact__links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.floating-contact__links a {
  min-width: 0;
  min-height: 48px;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .64);
}

.floating-contact__links span {
  color: #6f89a6;
  font-size: 9px;
}

.floating-contact__links strong {
  font-size: 11px;
  white-space: nowrap;
}

.floating-contact__primary {
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  border-radius: 15px;
  background: linear-gradient(135deg, #0b63d8, #3f91ea);
  font-size: 12px;
  font-weight: 760;
}

.floating-contact__primary:hover,
.floating-contact__primary:focus-visible {
  color: white;
  background: linear-gradient(135deg, #084fae, #277edb);
}

.floating-contact__top {
  min-height: 34px;
  color: #617d9c;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.floating-contact.is-collapsed {
  width: 62px;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(145deg, #0a58c3, #4b9ff0);
  box-shadow: 0 20px 50px rgba(12, 89, 189, .27), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.floating-contact.is-collapsed .floating-contact__toggle {
  width: 62px;
  min-height: 62px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.floating-contact.is-collapsed .floating-contact__toggle > span:last-child,
.floating-contact.is-collapsed .floating-contact__panel {
  display: none;
}

.floating-contact.is-collapsed .floating-contact__toggle-icon {
  width: 62px;
  background: transparent;
}

.floating-contact.is-collapsed .floating-contact__toggle-icon svg {
  width: 28px;
  height: 28px;
}

.floating-contact.is-auto-opening {
  animation: floating-contact-open 520ms cubic-bezier(.22, 1, .36, 1);
}

@keyframes floating-contact-open {
  from {
    opacity: .25;
    transform: translateY(18px) scale(.94);
  }
}

@media (max-width: 920px) {
  body .topbar,
  body.home-page .topbar {
    height: 68px;
  }
}

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

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

  .home-page .services-section {
    padding-block: 76px;
  }

  .home-page .services-story-pin {
    padding-inline: 22px;
  }

  .home-page .services-story-pin .service-stage,
  .home-page .services-story-pin .service-panels {
    min-height: 520px;
    height: 520px;
  }

  .site-entry__content {
    width: calc(100vw - 44px);
    gap: 44px;
  }

  .site-entry__brand {
    grid-template-columns: 66px 1fr;
    gap: 16px;
  }

  .site-entry__mark {
    width: 66px;
    border-radius: 20px;
  }

  .site-entry__mark img {
    width: 42px;
    height: 42px;
  }

  .site-entry__copy > p {
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-entry__copy > strong {
    font-size: clamp(34px, 10vw, 44px);
  }

  .site-entry__copy > span {
    max-width: 220px;
    font-size: 12px;
    line-height: 1.6;
  }

  .site-entry__ruler span {
    font-size: 10px;
  }

  .site-entry__caption {
    margin-top: -24px;
    font-size: 10px;
    text-align: left;
  }

  .floating-contact {
    right: 14px;
    bottom: 14px;
    width: min(228px, calc(100vw - 28px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-entry {
    display: none;
  }

  .floating-contact,
  .floating-contact * {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}
