/* Platform pages. Colours are existing tokens. Layout classes for the
   hero, workflow and mock label come from services.css, which these
   pages also load. The display-font fallback is in that file. */

.arch {
  display: block;
  width: min(100%, 68rem);
  height: auto;
  margin: 0.4rem 0 1.4rem;
}

.arch text {
  font-family: var(--font-display);
}

.platform-flow {
  counter-reset: step;
}

@media (min-width: 1100px) {
  .platform-flow {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.mock-frame {
  max-width: 68rem;
  margin: 1rem 0 0;
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-text);
}

.mock-app {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.7rem;
  border-radius: 0.7rem;
  background: var(--color-light);
}

.mock-layers,
.mock-data,
.mock-tool {
  margin: 0;
  padding: 0.65rem 0.75rem;
  list-style: none;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
  color: var(--color-text);
}

.mock-layers li,
.mock-data p,
.mock-tool p {
  padding: 0.38rem 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.95rem;
}

.mock-layers li:last-child,
.mock-data p:last-child,
.mock-tool p:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mock-kicker {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mock-map {
  min-width: 0;
  padding: 0.45rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
}

.mock-map svg,
.data-flow svg {
  display: block;
  width: 100%;
  height: auto;
}

.mock-chart {
  min-width: 0;
  padding: 0.75rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
}

.mock-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  height: 8.5rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.mock-bars li {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  height: 100%;
}

.mock-bars span {
  color: var(--color-text);
  font-size: 0.875rem;
  text-align: center;
}

.mock-bar {
  width: 100%;
  border-radius: 0.35rem 0.35rem 0 0;
  background: var(--color-deep);
}

.mock-bar-a { height: 42%; }
.mock-bar-b { height: 74%; }
.mock-bar-c { height: 56%; }
.mock-bar-d { height: 33%; }

.data-flow {
  margin: 1rem 0 0;
}

.source-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.source-pills li {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--color-deep);
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-text);
  font-size: 0.95rem;
}

@media (min-width: 800px) {
  .mock-app {
    grid-template-columns: minmax(0, 12rem) minmax(0, 1fr) minmax(0, 12rem);
    grid-template-areas:
      "layers map tool"
      "chart chart chart";
  }

  .mock-layers { grid-area: layers; }
  .mock-map { grid-area: map; }
  .mock-tool { grid-area: tool; }
  .mock-chart { grid-area: chart; }

  .bdm-app {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "sources store boards";
  }

  .bdm-sources { grid-area: sources; }
  .bdm-store { grid-area: store; }
  .bdm-boards { grid-area: boards; }
}



/* Atrobot surveillance: top-to-bottom image reveal */

.surveillance-hover-grid {
  width: 100%;
  margin-top: 1.5rem;
}

.surveillance-hover-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #281848;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(40, 24, 72, 0.12);
  transition: box-shadow 350ms ease, transform 350ms ease;
}

.surveillance-hover-card .surveillance-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
}

/* Original is always visible initially */
.surveillance-hover-card .surveillance-image-primary {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* Second image starts hidden behind a top-to-bottom mask */
.surveillance-hover-card .surveillance-image-hover {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  clip-path: inset(0 0 100% 0);
  transform: scale(1);
  transition:
    clip-path 900ms cubic-bezier(.65, 0, .35, 1),
    transform 900ms ease;
}

/* Reveal the second image from top to bottom */
.surveillance-hover-card:hover .surveillance-image-hover {
  clip-path: inset(0 0 0 0);
  transform: scale(1.035);
}

/* Moving Atrobot purple / dark-pink reveal line */
.surveillance-hover-card::before {
  content: "";
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    #8b5cf6,
    #c026d3,
    #ec4899,
    #a855f7
  );
  box-shadow:
    0 0 10px rgba(168, 85, 247, .95),
    0 0 24px rgba(219, 39, 119, .75);
}

.surveillance-hover-card:hover::before {
  opacity: 1;
  animation: atrobotImageWipe 900ms
    cubic-bezier(.65, 0, .35, 1) forwards;
}

@keyframes atrobotImageWipe {
  from { top: 0; }
  to { top: calc(100% - 3px); }
}

/* Purple and pink glow around the image */
.surveillance-hover-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, .65),
    0 0 22px rgba(139, 92, 246, .35),
    0 0 36px rgba(219, 39, 119, .22),
    0 16px 40px rgba(40, 24, 72, .2);
}

/* Heading appears over the image */
.surveillance-hover-title {
  position: absolute;
  z-index: 5;
  inset: auto 0 0;
  padding: 70px 28px 24px;
  color: #fff;
  background: linear-gradient(
    to top,
    rgba(28, 13, 51, .96),
    rgba(63, 24, 82, .55) 60%,
    transparent
  );
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 350ms ease, transform 450ms ease;
  pointer-events: none;
}

.surveillance-hover-title h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.surveillance-hover-title p {
  margin: 0;
  color: rgba(255, 255, 255, .9);
}

.surveillance-hover-card:hover .surveillance-hover-title {
  opacity: 1;
  transform: translateY(0);
}

/* Keep headings visible on touch devices */
@media (hover: none) {
  .surveillance-hover-title {
    opacity: 1;
    transform: none;
  }

  .surveillance-hover-card::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .surveillance-hover-card,
  .surveillance-image-hover,
  .surveillance-hover-title {
    transition: none;
  }

  .surveillance-hover-card:hover::before {
    animation: none;
    top: calc(100% - 3px);
  }
}


/* Surveillance page: keep media visually balanced */
.page-surveillance-monitoring .surveillance-hover-grid {
  width: 100%;
  max-width: 900px;
  margin: 1.5rem auto 0;
}

.page-surveillance-monitoring .surveillance-hover-card {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  overflow: hidden;
}

.page-surveillance-monitoring .surveillance-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Monitoring dashboard screenshot */
.page-surveillance-monitoring .shot {
  width: 100%;
  max-width: 1050px;
  margin: 2rem auto;
}

.page-surveillance-monitoring .shot img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
  margin-inline: auto;
}

/* Smaller screens */
@media (max-width: 768px) {
  .page-surveillance-monitoring .surveillance-hover-grid {
    max-width: 100%;
  }

  .page-surveillance-monitoring .shot {
    max-width: 100%;
  }

  .page-surveillance-monitoring .shot img {
    max-height: 360px;
  }
}


/* Fix oversized screenshots on the Geospatial Visualisation page */
body.page-visualisation-analytics .media-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

body.page-visualisation-analytics .media-grid .shot {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
}

body.page-visualisation-analytics .media-grid .shot img {
  display: block;
  width: 100%;
  height: 300px;
  max-height: 300px;
  object-fit: contain;
  object-position: center;
  background: #f7f5fa;
}

/* Tablet and mobile layout */
@media (max-width: 768px) {
  body.page-visualisation-analytics .media-grid.cols-2 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  body.page-visualisation-analytics .media-grid .shot img {
    height: auto;
    max-height: 320px;
  }
}
