/* Shared interface icons from the same-origin SVG sprite. */
.ui-icon {
  display: inline-block;
  width: 1.12em;
  height: 1.12em;
  flex: 0 0 auto;
  vertical-align: -.16em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.faq-minus,
details[open] > summary .faq-plus { display: none; }
details[open] > summary .faq-minus { display: inline-block; }

.about-penang-points li .about-point-check {
  width: 23px;
  height: 23px;
  padding: 5px;
  border-radius: 50%;
  background: #ddf7e9;
  color: #118650;
}

/* Shared header and navigation */
.site-header .nav-shell {
  position: relative;
}

.site-header .language-switcher {
  gap: 2px;
  flex: 0 0 auto;
}

.site-header .language-option {
  min-height: 44px;
  min-width: 36px;
  padding-inline: 5px;
  font-size: 12px;
}

.site-header .language-option:focus-visible,
.site-header .mobile-menu-toggle:focus-visible {
  outline: 2px solid #007db8;
  outline-offset: 2px;
}

.site-header .nav-dropdown-heading {
  color: #195677;
  font-size: 12px;
  letter-spacing: .02em;
}

.site-header .nav-dropdown-link {
  min-height: 44px;
}

main [id] {
  scroll-margin-top: 86px;
}

@media (min-width: 1081px) {
  .site-header .nav-shell {
    gap: 14px;
  }

  .site-header .primary-nav {
    gap: clamp(10px, 1vw, 19px);
  }

  .site-header .language-switcher {
    order: 1;
  }

  .site-header #primaryNav > .nav-services-dropdown {
    position: static;
  }

  /* Keep hover, focus and Escape in sync with the disclosure state. */
  .site-header #primaryNav .nav-dropdown:not(.is-open) > .nav-dropdown-panel {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

/* Mobile uses native disclosure elements. Desktop retains the mega menu. */
.site-header .mobile-navigation {
  display: none;
}

@media (max-width: 1080px) {
  .site-header { z-index: 500; }

  .site-header .nav-shell {
    min-height: 65px;
    gap: 8px;
  }

  .site-header .brand {
    flex: 0 1 145px;
    min-width: 0;
    margin-right: auto;
  }

  .site-header .brand img { max-width: 100%; }
  .site-header #primaryNav { display: none; }

  .site-header .mobile-navigation {
    display: block;
    flex: 0 0 44px;
  }

  .mobile-navigation summary {
    list-style: none;
    cursor: pointer;
    touch-action: manipulation;
  }

  .mobile-navigation summary::-webkit-details-marker { display: none; }

  .mobile-menu-toggle {
    position: relative;
    z-index: 530;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid #d8eaf6;
    border-radius: 50%;
    background: #fff;
  }

  .mobile-menu-toggle .ui-icon {
    width: 22px;
    height: 22px;
    pointer-events: none;
  }

  .mobile-menu-toggle .mobile-menu-close,
  .mobile-navigation[open] > .mobile-menu-toggle .mobile-menu-open {
    display: none;
  }

  .mobile-navigation[open] > .mobile-menu-toggle .mobile-menu-close {
    display: block;
  }

  .mobile-navigation[open] .mobile-nav-panel {
    display: block;
    position: absolute;
    z-index: 520;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 66px);
    max-height: calc(100dvh - 66px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 14px 14px;
    background: #fff;
    border: 1px solid #d8eaf6;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 16px 26px #07315b1a;
  }

  .mobile-nav-panel > a.nav-link,
  .mobile-nav-group > summary {
    display: flex;
    position: static;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 8px 3px;
    border-bottom: 1px solid #edf4f9;
    color: #1d3a60;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
  }

  .mobile-nav-panel > a.nav-link[aria-current="page"] { color: #006eaa; }
  .mobile-nav-panel > a.nav-link::after { display: none; }

  .mobile-nav-panel > a.nav-link,
  .mobile-nav-group > summary {
    justify-content: flex-start;
    gap: 10px;
    padding-inline: 7px;
  }

  .mobile-nav-panel .mobile-row-icon {
    width: 30px;
    height: 30px;
    padding: 6px;
    border-radius: 8px;
    background: #eaf5fd;
    color: #08689b;
  }

  .mobile-row-chevron {
    margin-inline-start: auto;
    color: #007ab4;
  }

  .mobile-nav-group[open] > summary .mobile-row-chevron {
    transform: rotate(180deg);
  }

  .mobile-nav-group-body { padding: 4px 0 8px; }

  .mobile-nav-group-body section {
    margin-bottom: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f2f8fd;
  }

  .mobile-nav-group-body p {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.4;
  }

  .mobile-nav-group-body .ds-menu-heading,
  .mobile-nav-group-body .nav-dropdown-heading {
    color: #006eaa;
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-nav-group-body a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 0;
    color: #173e68;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
  }

  .mobile-nav-panel > .nav-cta {
    width: 100%;
    margin-top: 8px;
  }
}

/* Homepage and portfolio */
.hero #heroTitle > span {
  display: block;
}

.hero .hero-actions > a,
.contact-page .service-hero-actions > a {
  min-height: 44px;
  white-space: normal;
  text-align: center;
}

.v48-featured {
  background: #f2f8fd;
  color: #143759;
}

.v48-featured h2 {
  margin: 0 0 24px;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.17;
}

.v48-case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.v48-case-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid #dcebf4;
  border-radius: 16px;
  background: #fff;
}

.v48-case-card h3,
.v48-case-card p {
  margin: 0;
}

.v48-case-card p {
  line-height: 1.55;
}

.v48-case-category {
  color: #285a7d;
  font-size: 14px;
  font-weight: 700;
}

.v48-case-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #075d8e;
  font-weight: 800;
}

.v48-case-card .v48-case-link {
  margin-top: auto;
}

.v48-all-cases {
  margin-top: 20px;
}

.work-project[hidden],
.work-preview-fallback[hidden] {
  display: none !important;
}

.work-preview-caption {
  display: none;
}

.work-preview:has(.work-browser-screen .work-preview-fallback[hidden]) .work-preview-caption {
  display: block;
}

.work-project.v48-featured-project {
  border-color: #a8cee4;
}

.work-project .work-copy a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: 14px;
}

.work-project .work-copy a + a {
  margin-left: 0;
}

.work-filter {
  min-height: 44px;
}

.work-detail .work-detail-info {
  margin-top: 24px;
}

.v48-case-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
}

.v48-case-actions p {
  margin: 0;
}

.work-detail .v48-case-actions .button {
  color: #fff;
  min-height: 44px;
}

@media (max-width: 720px) {
  .v48-case-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero #heroTitle {
    font-size: clamp(30px, 8.5vw, 43px);
  }
}

/* Contact */
.contact-page .service-hero-actions,
.contact-page .contact-office-actions {
  flex-wrap: wrap;
}

.contact-page .contact-enquiry-form select {
  max-width: 100%;
}

/* Partner badges: identical display areas, distinct optical sizing. */
main.about-page .ebox-partner-card .ebox-partner-image {
  border: 1px solid #e5eef6;
  border-radius: 12px;
  background: #fff;
}

main.about-page .ebox-partner-card .ebox-partner-image > img[src*="claude-code"] {
  max-width: calc(100% - 24px) !important;
  max-height: 158px !important;
}

main.about-page .ebox-partner-card .ebox-partner-image > img[src*="google-partner"] {
  max-width: min(192px, calc(100% - 32px)) !important;
  max-height: 112px !important;
}

@media (max-width: 700px) {
  main.about-page .ebox-partner-card .ebox-partner-image > img[src*="claude-code"] {
    max-height: 132px !important;
  }

  main.about-page .ebox-partner-card .ebox-partner-image > img[src*="google-partner"] {
    max-width: min(164px, calc(100% - 32px)) !important;
  }
}

/* A short reflection across the header wordmark, clipped to its silhouette. */
.brand-mark {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  @supports ((mask-image: url("/assets/ebox-logo.png")) or (-webkit-mask-image: url("/assets/ebox-logo.png"))) {
    .brand-mark::after {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      -webkit-mask: url("/assets/ebox-logo.png") center / 100% 100% no-repeat;
      mask: url("/assets/ebox-logo.png") center / 100% 100% no-repeat;
      background: linear-gradient(112deg, transparent 43%, rgba(255,255,255,.68) 50%, transparent 57%) 100% 0 / 260% 100% no-repeat;
      animation: ebox-logo-sweep 1.25s ease-out .45s both;
    }

    .brand:hover .brand-mark::after,
    .brand:focus-visible .brand-mark::after {
      animation: ebox-logo-sweep-interaction 1s ease-out both;
    }
  }
}

@keyframes ebox-logo-sweep {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

@keyframes ebox-logo-sweep-interaction {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* WhatsApp is available on arrival; the return-to-top control follows scroll. */
#floatingActions {
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  align-items: center;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: none;
}

#floatingActions .float-whatsapp {
  width: 50px;
  height: 50px;
  background: #087a43;
  color: #fff;
}

#floatingActions .float-whatsapp:hover { background: #066136; }

#floatingActions .float-whatsapp svg {
  width: 28px;
  height: 28px;
}

#floatingActions .float-top { display: none; }
#floatingActions.is-visible .float-top { display: grid; }

#floatingActions .float-action:focus-visible {
  outline: 2px solid #092b56;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  #floatingActions .float-action { transition: none; }
  #floatingActions .float-action:hover { transform: none; }
}

/* Reading progress on the existing back-to-top button. */
#floatingActions .float-top {
  position: relative;
  width: 46px;
  height: 46px;
}

#floatingActions .float-top > .ui-icon {
  width: 20px;
  height: 20px;
}

#floatingActions .float-progress-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  fill: none;
  stroke-width: 3;
  pointer-events: none;
}

#floatingActions .float-progress-track { stroke: rgba(255,255,255,.28); }
#floatingActions .float-progress-value { stroke: #9eeeff; }

/* The sticky header moves with the viewport; use a stable document-top target. */
#page-start { display: block; height: 0; }

/* The icon shares only the heading row. Service copy uses the full card. */
#growth .growth-grid .growth-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0 !important;
}

#growth .growth-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

#growth .growth-card-title { min-width: 0; }

#growth .growth-card .growth-card-copy {
  display: flex;
  flex-direction: column;
  max-width: none;
  padding-top: 0;
}

#growth .growth-card-copy .stage-services { margin-top: 0; }

#growth .growth-card-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(46px, 5vw, 72px);
  align-items: end;
  gap: 10px;
  margin-top: auto;
  padding-top: 13px;
}

/* Let the longer label set the width of the two buttons, up to the available space. */
#growth .growth-card .growth-card-foot .growth-service-buttons {
  grid-template-columns: auto !important;
  justify-self: start;
  width: fit-content !important;
  max-width: 100% !important;
  margin: 0 !important;
}

#growth .growth-card .growth-card-foot .growth-service-buttons > a {
  width: auto !important;
  min-height: 44px !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
}

#growth .growth-card-foot > :is(.stage-mascot, .search-visual, .ads-visual) {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: 100%;
  pointer-events: none;
}

@media (max-width: 360px) {
  #growth .growth-card-foot { gap: 7px; }
}
