/* Atrobot site-wide layout refinement — Stage 1
   Keeps existing HTML, content, branding and behavior; normalizes sizing,
   section rhythm, responsive grids, and sharp-edged media. */
:root {
  --wrap: 78rem;
  --space-section: clamp(2.8rem, 5vw, 4.75rem);
  --radius: 0;
}

html { scroll-behavior: smooth; }
body { font-size: 0.975rem; line-height: 1.6; }
.wrap { width: min(var(--wrap), calc(100% - 2.5rem)); }
@media (min-width: 768px) { .wrap { width: min(var(--wrap), calc(100% - 4rem)); } }

/* Media should be crisp-cornered everywhere, regardless of old component rules. */
img, video, picture, canvas, iframe,
figure, .hero-figure, .thumb, .media-frame, .media-card,
.thermal-cell, .surveillance-hover-card, .surveillance-image,
.kept-figure img, .kept-figure .reveal,
.thumb img, .thumb svg, .hero-figure img, .hero-figure svg {
  border-radius: 0 !important;
}
img, video { max-width: 100%; }
figure { margin-inline: 0; }

/* Header: compact and consistent without changing navigation behavior. */
.site-header { min-height: 3.65rem; }
.site-header .header-bar { min-height: 3.65rem; }
.site-header .brand img,
.site-footer .footer-brand img { border-radius: 0 !important; }
.site-header .nav-link { line-height: 1.2; }

/* Shared hero layout: balanced copy/media, less excessive vertical space. */
.page-hero {
  padding-block: clamp(2rem, 4vw, 3.5rem) clamp(1.75rem, 3.5vw, 3rem);
}
.page-hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.7rem);
  line-height: 1.04;
  max-width: 18ch;
  text-wrap: balance;
}
.page-hero p { max-width: 39rem; line-height: 1.62; }
.service-hero-grid {
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: clamp(1.5rem, 3.2vw, 3rem);
}
.service-hero .hero-figure { width: 100%; min-width: 0; }
.service-hero .hero-figure img,
.service-hero .hero-figure video {
  display: block;
  width: 100%;
  height: clamp(15rem, 29vw, 25rem);
  object-fit: cover;
  object-position: center;
}

/* Background-video heroes: shorter, with readable contrast. */
.media-hero {
  min-height: clamp(25rem, 57vh, 36rem);
  padding-block: clamp(2.25rem, 4.5vw, 4rem);
}
.media-hero .media-hero-video,
.media-hero .media-hero-still { width: 100%; height: 100%; object-fit: cover; }
.media-hero .media-hero-scrim {
  background: linear-gradient(90deg, rgba(20, 10, 38, .88) 0%, rgba(30, 14, 51, .68) 43%, rgba(40, 24, 72, .18) 100%);
}

/* Survey & Mapping video hero, added in the current working page. */
.survey-video-hero { min-height: 0; padding-block: 0; }
.survey-video-hero .survey-video-content {
  min-height: clamp(25rem, 55vh, 35rem);
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}
.survey-video-hero .survey-video-bg { width: 100%; height: 100%; object-fit: cover; }

/* Homepage hero: preserve cinematic media but keep the content viewport-aware. */
.hero { min-height: clamp(29rem, 69vh, 42rem); }
.hero .hero-media { height: 100%; }
.hero .hero-layout { min-height: clamp(29rem, 69vh, 42rem); padding-block: clamp(3rem, 6vw, 5.5rem); }
.hero h1 { font-size: clamp(2.5rem, 5.5vw, 5rem); line-height: 1.02; max-width: 13ch; text-wrap: balance; }
.hero .lead { max-width: 39rem; font-size: clamp(1rem, 1.3vw, 1.15rem); }

/* Section rhythm: clean whitespace, no oversized gaps between every block. */
.section { padding-block: var(--space-section); }
.section-intro { max-width: 48rem; margin-bottom: clamp(1.35rem, 2.7vw, 2.2rem); }
.section-intro h2 { font-size: clamp(1.8rem, 3.4vw, 2.75rem); line-height: 1.08; }
.section p, .page-hero p { max-width: 70ch; }
.section-light { background-color: #fff; }

/* Image and service cards: equal ratios, predictable sizes, clean alignment. */
.service-grid, .card-grid, .format-grid, .related-grid,
.decision-flow, .practice-grid, .value-grid { gap: clamp(.75rem, 1.5vw, 1.15rem); }
.service-grid, .card-grid.industries, .card-grid.platforms { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .format-grid article, .decision-flow li, .practice-art, .mock-mini {
  border-radius: 0 !important;
}
.card { min-width: 0; overflow: hidden; box-shadow: none; }
.card .thumb { overflow: hidden; }
.card .thumb img, .service-grid .thumb img {
  display: block; width: 100%; height: clamp(10.5rem, 15vw, 14.5rem); object-fit: cover; object-position: center;
}
.card > h3, .card > p, .card > .card-more,
.card > .text-link, .card .card-body { min-width: 0; }
.card h3 { font-size: clamp(1.15rem, 1.5vw, 1.4rem); line-height: 1.15; }
.card p { font-size: .94rem; line-height: 1.55; }

/* Make common media grids fill their columns instead of growing intrinsically. */
.hero-figure img, .thumb img, .media-hero img, .media-hero video,
.surveillance-image, .kept-figure img, .volume-art img {
  max-width: 100%;
}
.flow-diagram, .dm-arch-board, .compare, .architecture-board { max-width: 100%; }
pre, table, .table-wrap { max-width: 100%; }
.table-wrap { overflow-x: auto; }

/* Buttons stay on brand; only reduce oversized pill-like rounding. */
.btn, .nav-link-cta, .footer-cta, input, textarea, select,
.accordion-trigger, .prototype-banner { border-radius: 0 !important; }

/* Footer and content alignment. */
.site-footer { padding-top: clamp(2.5rem, 4vw, 3.5rem); }
.footer-grid { gap: clamp(1.5rem, 2.5vw, 2.5rem); }

@media (max-width: 900px) {
  .service-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); }
  .service-grid, .card-grid.industries, .card-grid.platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-hero .hero-figure img { height: clamp(14rem, 32vw, 20rem); }
}
@media (max-width: 680px) {
  body { font-size: .95rem; }
  .wrap { width: calc(100% - 2rem); }
  .service-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .service-hero .hero-figure img { height: 14.5rem; }
  .page-hero { padding-block: 1.8rem 1.6rem; }
  .page-hero h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .media-hero { min-height: 28rem; padding-block: 2rem; }
  .survey-video-hero .survey-video-content { min-height: 28rem; padding-block: 2.5rem; }
  .hero, .hero .hero-layout { min-height: 34rem; }
  .hero .hero-layout { padding-block: 3rem; }
  .hero h1 { font-size: clamp(2.5rem, 11vw, 3.7rem); }
  .service-grid, .card-grid, .card-grid.industries, .card-grid.platforms,
  .format-grid, .related-grid, .practice-grid, .value-grid { grid-template-columns: minmax(0, 1fr); }
  .card .thumb img, .service-grid .thumb img { height: 13rem; }
  .section { padding-block: 2.7rem; }
  .section-intro { margin-bottom: 1.35rem; }
}

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


/* =========================================
   ATROBOT HEADER — FINAL LAYOUT FIX
   Full-width translucent background,
   inset logo and CTA, no blur or border.
   ========================================= */

/* Header scrolls away with the page */
.site-header {
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;

  background: rgba(40, 24, 72, 0.58) !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Keep the background full-width while
   spacing the contents away from both edges */
.site-header .header-bar {
  width: 100%;
  max-width: 1600px;
  min-height: 88px;
  margin-inline: auto;

  padding: 12px clamp(24px, 4vw, 64px) !important;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;

  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Keep logo from touching the left edge */
.site-header .brand {
  flex: 0 0 auto;
  margin: 0 !important;
}

/* Navigation remains centered */
.site-header .site-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
}

/* Keep the menu aligned in one row */
.site-header .nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.2vw, 36px);
  margin: 0;
  padding: 0;
}

/* Keep Request a Demo inside the header's
   content area, with a filled lavender button */
.site-header .nav-item.nav-cta {
  flex: 0 0 auto;
  margin: 0 !important;
}

.site-header .nav-link.nav-link-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 52px;
  padding: 12px 24px !important;

  background: #9b6da3 !important;
  color: #ffffff !important;
  border: 1px solid #9b6da3 !important;
  border-radius: 0 !important;
  text-decoration: none;

  box-shadow: none !important;
  transition: background-color 180ms ease,
              border-color 180ms ease;
}

.site-header .nav-link.nav-link-cta:hover {
  background: #87558f !important;
  border-color: #87558f !important;
  color: #ffffff !important;
}

/* Remove any divider line below the header */
.site-header::before,
.site-header::after,
.site-header .header-bar::before,
.site-header .header-bar::after {
  border: none !important;
  box-shadow: none !important;
}

/* Mobile layout */
@media (max-width: 767px) {
  .site-header .header-bar {
    min-height: 72px;
    padding: 10px 20px !important;
    gap: 12px;
  }

  .site-header .brand img {
    width: 125px;
    height: auto;
  }

  .site-header .nav-link.nav-link-cta {
    min-height: 44px;
    padding: 9px 12px !important;
    font-size: 0.85rem;
  }
}


/* Fix the gap above the homepage hero */
html,
body {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body:has(section.hero) {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body:has(section.hero) .site-header {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  margin-top: 0 !important;
  transform: none !important;
}

/* Ensure the hero background begins at the top */
body:has(section.hero) section.hero {
  margin-top: 0 !important;
  padding-top: 0;
}


/* Homepage header must not stick while scrolling */
body:has(section.hero) .site-header,
body:has(section.hero) .site-header.is-sticky,
body:has(section.hero) .site-header.scrolled,
body:has(section.hero) .site-header.sticky {
  position: absolute !important;
  top: 0 !important;
}

/* Prevent scroll-state styles from fixing the header */
body:has(section.hero) .site-header.is-fixed,
body:has(section.hero) .site-header.is-scrolled {
  position: absolute !important;
}


/* =========================================================
   HOME PAGE — THE INTELLIGENCE LOOP
   ========================================================= */

.home-intelligence-section {
  position: relative;
  overflow: hidden;
  background: #fbf9ff;
  background-image: radial-gradient(#ddd0f1 0.8px, transparent 0.8px);
  background-size: 22px 22px;
}

.home-intelligence-section .wrap {
  position: relative;
  z-index: 1;
}

.home-intelligence-intro {
  max-width: 880px;
  margin-bottom: 36px;
}

.home-intelligence-intro .eyebrow {
  color: #76528f;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.home-intelligence-intro h2 {
  max-width: 850px;
  margin: 12px 0;
  color: #2b1748;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.home-intelligence-intro .lead {
  max-width: 800px;
  color: #665773;
  font-size: 17px;
  line-height: 1.75;
}

/* Four connected stages */

.home-intelligence-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.intelligence-card {
  min-width: 0;
  height: 100%;
  padding: 18px 16px 15px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dfd0f2;
  box-shadow: 0 8px 26px rgba(65, 35, 105, 0.045);
  display: flex;
  flex-direction: column;
}

.intelligence-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
}

.intelligence-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  color: #6635a5;
  background: #eee4fc;
  border-radius: 50%;
}

.intelligence-icon svg {
  width: 34px;
  height: 34px;
}

.intelligence-step {
  margin: 0 0 8px;
  color: #6e3eb0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.intelligence-card h3 {
  margin: 0;
  color: #2b1748;
  font-size: 17px;
  line-height: 1.35;
}

.intelligence-description {
  margin: 14px 0 16px;
  color: #695b79;
  font-size: 13px;
  line-height: 1.65;
}

/* Visual panels use Atrobot's purple palette.
   Replace these gradients with real project images when available. */

.intelligence-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 150px;
  margin-top: auto;
  overflow: hidden;
  background-color: #34204f;
  background-size: cover;
  background-position: center;
}

.intelligence-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 35%,
    rgba(28, 12, 49, 0.76) 100%
  );
}

.intelligence-visual span {
  position: relative;
  z-index: 1;
  margin: 0 10px 10px;
  padding: 5px 7px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* Temporary abstract visuals — no external images required */

.intelligence-visual-observe {
  background-image:
    radial-gradient(ellipse at 50% 25%, rgba(207, 177, 255, 0.7), transparent 35%),
    linear-gradient(145deg, #b9a4df 0%, #7160a3 40%, #34204f 100%);
}

.intelligence-visual-understand {
  background-image:
    radial-gradient(ellipse at 25% 30%, #b99aff 0%, transparent 28%),
    radial-gradient(ellipse at 75% 60%, #8253d1 0%, transparent 32%),
    linear-gradient(135deg, #221337, #6840a0 58%, #b7a1e7);
}

.intelligence-visual-decide {
  background-image:
    linear-gradient(145deg, transparent 45%, rgba(205, 182, 255, 0.4) 46%, transparent 48%),
    linear-gradient(35deg, transparent 45%, rgba(224, 211, 255, 0.45) 46%, transparent 48%),
    radial-gradient(ellipse at center, #8f75c0, #35204f);
}

.intelligence-visual-improve {
  background-image:
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(223, 207, 255, 0.13) 25px 26px),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(223, 207, 255, 0.13) 25px 26px),
    linear-gradient(135deg, #4b267b, #241139);
}

.intelligence-card-featured {
  background: linear-gradient(155deg, #3d1c65, #582a91);
  border-color: #6f43a5;
  box-shadow: 0 14px 32px rgba(59, 27, 95, 0.16);
}

.intelligence-card-featured .intelligence-icon {
  background: #7444b2;
  color: #fff;
}

.intelligence-card-featured .intelligence-step {
  color: #e0c9ff;
}

.intelligence-card-featured h3 {
  color: #fff;
}

.intelligence-card-featured .intelligence-description {
  color: #e3d7f0;
}

.intelligence-connector {
  display: flex;
  align-items: center;
  justify-content: center;
}

.intelligence-connector span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #6635a5;
  background: #fff;
  border: 1px solid #e7dcf5;
  border-radius: 50%;
  font-size: 21px;
}

/* Connected data layers */

.home-intelligence-layers {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 36px;
  align-items: center;
  margin-top: 32px;
  padding: 26px;
  border: 1px solid #e4d8f3;
  background: linear-gradient(110deg, #f2eafb, #fff 70%);
}

.intelligence-layer-labels {
  display: grid;
  gap: 10px;
}

.intelligence-layer-labels span {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #4e2c78;
  background: #fff;
  border: 1px solid #e3d5f2;
  font-size: 12px;
  font-weight: 700;
}

.intelligence-layer-labels i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #8050b5;
}

.intelligence-layer-message .eyebrow {
  color: #76528f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.intelligence-layer-message h3 {
  margin: 8px 0;
  color: #2b1748;
  font-size: clamp(23px, 2.6vw, 34px);
  line-height: 1.2;
}

.intelligence-layer-message > p:last-child {
  max-width: 600px;
  color: #695b79;
  font-size: 14px;
  line-height: 1.75;
}

/* Responsive layout */

@media (max-width: 1100px) {
  .home-intelligence-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .intelligence-connector {
    display: none;
  }

  .intelligence-card {
    min-height: 340px;
  }
}

@media (max-width: 640px) {
  .home-intelligence-intro {
    margin-bottom: 24px;
  }

  .home-intelligence-intro .lead {
    font-size: 15px;
  }

  .home-intelligence-flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .intelligence-card {
    min-height: 0;
    padding: 16px;
  }

  .intelligence-visual {
    min-height: 170px;
  }

  .home-intelligence-layers {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-top: 22px;
    padding: 16px;
  }
}


/* TEMPORARY DIAGNOSTIC: isolate duplicate spatial-layer text */
.home-intelligence-section .home-intelligence-layers .intelligence-layer-message {
  position: relative !important;
  isolation: isolate !important;
  text-shadow: none !important;
  filter: none !important;
}

.home-intelligence-section .home-intelligence-layers .intelligence-layer-message h3,
.home-intelligence-section .home-intelligence-layers .intelligence-layer-message p {
  text-shadow: none !important;
  -webkit-text-stroke: 0 transparent !important;
  filter: none !important;
  transform: none !important;
}

.home-intelligence-section .home-intelligence-layers .intelligence-layer-message h3::before,
.home-intelligence-section .home-intelligence-layers .intelligence-layer-message h3::after,
.home-intelligence-section .home-intelligence-layers .intelligence-layer-message p::before,
.home-intelligence-section .home-intelligence-layers .intelligence-layer-message p::after {
  content: none !important;
  display: none !important;
}


/* Keep consultation email and phone visible */
a[href^="mailto:"],
a[href^="tel:"] {
  color: #32195A !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-decoration: none;
}

a[href^="mailto:"]:hover,
a[href^="mailto:"]:focus,
a[href^="tel:"]:hover,
a[href^="tel:"]:focus {
  color: #5B3A88 !important;
  opacity: 1 !important;
  text-decoration: underline;
}
