/* Shared visual motion. Every image and section stays visible without JavaScript. */
.hero-image-caption {
  position: absolute;
  z-index: 3;
  right: 24px;
  top: 130px;
  padding: 6px 10px;
  color: rgba(255,255,255,.85);
  background: rgba(2,43,56,.72);
  font-size: 10px;
  line-height: 1.5;
}

@view-transition {
  navigation: auto;
}

@media (max-width: 620px) {
  .hero-image-caption { top: 108px; right: 18px; font-size: 9px; }
}

::view-transition-old(root) {
  animation: ubismed-page-out 240ms ease-out both;
}

::view-transition-new(root) {
  animation: ubismed-page-in 420ms cubic-bezier(.22, .61, .36, 1) both;
}

@keyframes ubismed-page-out {
  to { opacity: 0; }
}

@keyframes ubismed-page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ubismed-scene-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.075); }
}

@keyframes ubismed-content-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="paused"]):not([data-motion="reduced"])
    :is(.hero-content, .segment-hero-content, .article-heading-inner, .blog-intro-grid, .hero-text) {
    animation: ubismed-content-in 650ms cubic-bezier(.2,.7,.25,1) both;
  }
}

.hero-media,
.segment-hero-media,
.scene-media,
.article-photo img {
  transform-origin: center;
}

html[data-motion-ready="true"]:is([data-motion="running"], [data-motion="paused"])
  :is(.hero-media, .segment-hero-media, .scene-media, .article-photo img) {
  animation: ubismed-scene-zoom 24s ease-in-out infinite alternate;
}

html[data-motion-ready="true"][data-motion="paused"]
  :is(.hero-media, .segment-hero-media, .scene-media, .article-photo img),
html[data-motion-ready="true"][data-motion-hidden="true"]
  :is(.hero-media, .segment-hero-media, .scene-media, .article-photo img),
html[data-motion-ready="true"]
  :is(.hero-media, .segment-hero-media, .scene-media, .article-photo img)[data-in-viewport="false"] {
  animation-play-state: paused;
}

html[data-motion-ready="true"][data-motion="running"] [data-reveal="pending"] {
  opacity: 0;
  transform: translateY(22px);
}

/* Keep light text readable while allowing the right-hand photograph to show. */
.hero-overlay {
  background:
    linear-gradient(90deg, rgba(3,31,42,.96) 0%, rgba(3,31,42,.88) 38%, rgba(3,31,42,.5) 62%, rgba(3,31,42,.08) 100%),
    linear-gradient(0deg, rgba(3,31,42,.48), transparent 60%);
}

.segment-hero-overlay {
  background:
    linear-gradient(90deg, rgba(2,43,56,.96) 0%, rgba(2,43,56,.88) 40%, rgba(2,43,56,.48) 72%, rgba(2,43,56,.12) 100%),
    linear-gradient(0deg, rgba(2,43,56,.3), transparent 55%);
}

.condo-image,
.incompany-image {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.scene-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.scene-caption {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: 18px;
  max-width: calc(100% - 36px);
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(2,43,56,.9);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .015em;
}

.incompany-image .scene-caption {
  top: 18px;
  bottom: auto;
}

/* A photographic introduction to the existing services, without replacing them. */
.service-visuals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 0 0 48px;
}

.service-visuals figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
}

.service-visuals img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.service-visuals figcaption {
  display: block;
  padding: 18px 20px;
  color: #fff;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.45;
}

.service-visuals figcaption span {
  display: block;
  margin-top: 8px;
  color: #c0d8dc;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.5;
}

.article-photo figcaption {
  position: relative;
  z-index: 1;
  background: #f1f6f3;
}

.post-photo img {
  transition: transform 600ms cubic-bezier(.22, .61, .36, 1);
}

@media (hover: hover) and (pointer: fine) {
  html:not([data-motion="paused"]):not([data-motion="reduced"]) .post-card:hover .post-photo img,
  html:not([data-motion="paused"]):not([data-motion="reduced"]) .featured-copy:hover > .post-photo img {
    transform: scale(1.035);
  }
}

/* A persistent pause option, positioned opposite the existing WhatsApp button. */
.motion-preferences {
  position: fixed;
  z-index: 85;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 100px);
}

.motion-preferences[hidden],
.motion-preferences [hidden] {
  display: none !important;
}

#motion-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 15px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 24px;
  background: #053746;
  color: #fff;
  box-shadow: 0 4px 18px rgba(2,25,33,.2);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#motion-toggle:hover {
  background: #075465;
}

#motion-toggle:focus-visible {
  outline: 3px solid #71ddd8;
  outline-offset: 4px;
}

#motion-toggle svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: currentColor;
}

@media (max-width: 800px) {
  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(3,31,42,.94), rgba(3,31,42,.67)),
      linear-gradient(0deg, rgba(3,31,42,.76), transparent 75%);
  }

  .segment-hero-overlay {
    background:
      linear-gradient(90deg, rgba(2,43,56,.94), rgba(2,43,56,.7)),
      linear-gradient(0deg, rgba(2,43,56,.65), transparent 75%);
  }

  .service-visuals {
    gap: 14px;
    margin-bottom: 34px;
  }

  .service-visuals figcaption {
    padding: 14px;
    font-size: 14px;
  }
}

@media (max-width: 620px) {
  .service-visuals {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .service-visuals img {
    aspect-ratio: 16 / 9;
  }

  .service-visuals figcaption {
    padding: 15px 18px;
    font-size: 16px;
  }

  .scene-caption {
    left: 14px;
    bottom: 14px;
    max-width: calc(100% - 28px);
    font-size: 9px;
  }

  .incompany-image .scene-caption {
    top: 14px;
    bottom: auto;
  }

  .motion-preferences {
    left: max(14px, env(safe-area-inset-left));
    bottom: max(14px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 88px);
  }

  #motion-toggle {
    padding: 10px 13px;
    font-size: 10px;
  }
}

html[data-motion="reduced"] {
  scroll-behavior: auto !important;
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html[data-motion="reduced"]
  :is(.hero-media, .segment-hero-media, .scene-media, .article-photo img, .post-photo img, [data-reveal]) {
  transform: none !important;
  opacity: 1 !important;
}

html[data-motion="paused"]::view-transition-group(*),
html[data-motion="paused"]::view-transition-old(*),
html[data-motion="paused"]::view-transition-new(*),
html[data-motion="reduced"]::view-transition-group(*),
html[data-motion="reduced"]::view-transition-old(*),
html[data-motion="reduced"]::view-transition-new(*) {
  animation: none !important;
  transform: none !important;
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .hero-media,
  .segment-hero-media,
  .scene-media,
  .article-photo img,
  .post-photo img,
  [data-reveal] {
    transform: none !important;
    opacity: 1 !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
    transform: none !important;
  }
}
