/* Final public-site polish. Loaded after legacy and redesign layers. */
/* Keep the hero application strip and section navigation on one desktop
   canvas. The hero already starts after the fixed identity rail. */
@media (min-width: 921px) {
  .hero-shell,
  .section {
    margin-right: 56px;
  }

  .material-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    left: 0;
  }

  .material-strip span {
    min-width: 0;
    padding-inline: clamp(8px, 1.6vw, 28px);
    font-size: clamp(0.68rem, 0.84vw, 0.92rem);
    letter-spacing: 0.1em;
    text-align: center;
    white-space: nowrap;
  }

  .section-dock {
    width: auto;
    max-width: none;
    margin: 18px 56px 0;
  }
}

@media (max-width: 920px) {
  .hero-shell,
  .section {
    margin-right: 0;
  }
}

.hero-shell {
  min-height: clamp(620px, 68svh, 760px);
}

.hero-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  align-content: start;
  min-height: 0;
  padding: 0;
}

.hero-copy {
  max-width: 800px;
  align-self: start;
  min-width: 0;
}

.hero-copy .lead {
  max-width: min(610px, 100%);
  overflow-wrap: anywhere;
}

.hero-copy h1 {
  max-width: 720px;
  font-size: clamp(3.25rem, 5.45vw, 5.55rem);
}

.flow-grid {
  inset: 2svh -2vw auto auto;
  width: min(50vw, 690px);
  height: min(38svh, 360px);
  opacity: 0.58;
}

@media (min-width: 721px) {
  .hero-grid {
    position: absolute;
    top: clamp(132px, 18svh, 188px);
    left: 0;
    right: 0;
  }
}

.process-gallery figure,
.application-media figure,
.product-media-row figure {
  display: flex;
  flex-direction: column;
  aspect-ratio: auto;
  min-height: 0;
  overflow: hidden;
  clip-path: none !important;
}

.process-gallery img,
.process-gallery video,
.application-media img,
.product-media-row img {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.process-gallery figcaption,
.application-media figcaption,
.product-media-row figcaption {
  position: static;
  flex: 0 0 auto;
  min-height: 0;
  padding: 13px 15px;
  border: 0;
  border-top: 1px solid rgba(255, 248, 232, 0.16);
  border-radius: 0;
  color: var(--cream);
  background: var(--asphalt);
  backdrop-filter: none;
  font-size: 0.85rem;
  line-height: 1.42;
}

/* Reduce the oversized editorial rhythm used by the earlier concept pass. */
.section {
  padding-top: clamp(52px, 5.2vw, 78px);
  padding-bottom: clamp(52px, 5.2vw, 78px);
}

.section-index {
  grid-template-columns: 54px max-content minmax(0, 1fr);
  gap: 14px;
  margin-bottom: clamp(18px, 2.5vw, 30px);
}

.section-index strong {
  order: initial;
  grid-column: auto;
}

h2 {
  max-width: 690px;
  font-size: clamp(1.95rem, 2.9vw, 3.45rem);
  line-height: 1.05;
}

.products-head,
.wide-grid,
.unit-layout,
.unit-two-layout,
.clients-layout {
  gap: clamp(24px, 3.6vw, 46px);
}

/* A fixed 3+2 application map reads as a single technical register. */
.application-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--line-light);
}

.application-grid article {
  display: flex;
  grid-column: span 4;
  flex-direction: column;
  min-height: 246px;
  padding: 24px;
  border: 0;
  border-right: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
}

.application-grid article:nth-child(3n) {
  border-right: 0;
}

.application-grid article:nth-child(4),
.application-grid article:nth-child(5) {
  grid-column: span 6;
  border-bottom: 0;
}

.application-grid article:nth-child(4) {
  border-right: 1px solid var(--line-light);
}

.application-grid article:nth-child(5) {
  border-right: 0;
}

.application-grid span {
  margin-bottom: 28px;
}

.application-grid h3 {
  max-width: 18ch;
  font-size: clamp(1.35rem, 1.75vw, 1.8rem);
  line-height: 1.08;
  overflow-wrap: normal;
  word-break: normal;
}

.application-grid p {
  margin-top: 14px;
}

/* Ten products form five complete paired rows, with no empty register cells. */
.product-register {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(28px, 3.8vw, 46px);
}

.product-register article {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 23px 24px;
}

.product-register span {
  margin-bottom: 18px;
}

.product-register h3 {
  max-width: 24ch;
  font-size: clamp(1.35rem, 1.75vw, 1.85rem);
  line-height: 1.08;
}

.product-register p {
  margin-top: 14px;
}

/* Unit 2 now carries the documented pre-processing scope, not a generic workflow. */
.unit-two-details {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 16px;
  margin-top: 18px;
}

.unit-two-details > section {
  width: auto;
  max-width: none;
  margin: 0;
  padding: clamp(22px, 2.5vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.82);
}

.unit-two-details .kicker {
  color: var(--molten);
}

.unit-two-details h3 {
  max-width: 27ch;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.65vw, 1.8rem);
  line-height: 1.1;
}

.unit-industry-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.unit-industry-list span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
}

.unit-two-details ul {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.unit-two-details li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.unit-two-details li::before {
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 8px;
  height: 2px;
  background: var(--molten);
  content: "";
}

/* Verified marks and named references are separated so no ambiguous logo is implied. */
.client-logo-groups {
  display: grid;
  gap: 28px;
}

.reference-group,
.industry-reference-group {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.reference-label {
  margin: 0 0 12px;
  color: var(--molten);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.logo-wall.logo-wall--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logo-wall--compact .logo-card {
  grid-template-rows: 62px auto;
  min-height: 134px;
  padding: 14px;
}

.logo-wall--compact .logo-card img {
  width: 100%;
  max-width: 142px;
  height: 58px;
  object-fit: contain;
  object-position: left center;
}

.logo-wall--compact .logo-card img.logo-mark {
  width: 62px;
  max-width: 62px;
  height: 62px;
}

.logo-wall--compact .logo-card img.logo-wordmark {
  max-width: 160px;
}

.reference-name-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reference-name-grid span {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.72);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.25;
}

.contact-section {
  padding-top: clamp(50px, 4.5vw, 68px);
  padding-bottom: clamp(54px, 4.5vw, 74px);
}

.contact-section .section-index {
  display: none;
}

.contact-grid {
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  align-items: center;
}

.contact-grid > div:first-child {
  position: static;
}

.contact-grid h2 {
  max-width: 430px;
  font-size: clamp(1.8rem, 2.55vw, 2.7rem);
}

@media (max-width: 720px) {
  .hero-shell {
    min-height: auto;
  }

  .hero-grid {
    min-height: auto;
    width: var(--mobile-content);
    margin-left: var(--gutter);
    margin-right: auto;
    position: relative;
    padding: 104px 0 86px;
  }

  .hero-copy h1 {
    font-size: clamp(3rem, 15vw, 4.2rem);
  }

  .hero-copy .lead {
    max-width: 100%;
  }

  .flow-grid {
    inset: 5svh -40vw auto auto;
    width: 130vw;
    height: 34svh;
    opacity: 0.46;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid h2 {
    max-width: 100%;
  }

  .section {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .section-index {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
  }

  .section-index::after {
    display: none;
  }

  .application-grid,
  .product-register {
    grid-template-columns: 1fr;
  }

  .application-grid article,
  .application-grid article:nth-child(4),
  .application-grid article:nth-child(5) {
    grid-column: auto;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-light);
  }

  .application-grid article:last-child {
    border-bottom: 0;
  }

  .product-register article {
    min-height: 0;
  }

  .unit-two-details {
    grid-template-columns: 1fr;
  }

  .logo-wall.logo-wall--compact,
  .reference-name-grid {
    grid-template-columns: 1fr;
  }
}

/* Azure identity hero: text-led, centered, and free of a background photograph. */
.hero-shell {
  min-height: clamp(560px, 76svh, 720px);
  background: var(--hero-surface, var(--asphalt));
}

.hero-image,
.hero-shell::before,
.hero-shell::after {
  display: none;
}

.hero-grid {
  position: relative;
  inset: auto;
  display: grid;
  place-items: center;
  min-height: clamp(500px, calc(76svh - 72px), 650px);
  padding: 64px 0 104px;
  text-align: center;
}

.hero-copy {
  align-self: center;
  max-width: 760px;
}

.hero-copy .kicker {
  justify-content: center;
}

.hero-copy .lead {
  margin-right: auto;
  margin-left: auto;
}

.flow-grid {
  display: none;
}

.brij-route-drawing {
  position: absolute;
  top: -18svh;
  left: -4vw;
  right: auto;
  z-index: 0;
  width: min(100vw, 1400px);
  height: auto;
  opacity: 0.32;
  pointer-events: none;
}

.brij-route-drawing path {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 14 18;
  animation: brijRouteMove 11s linear infinite;
}

body.motion-ready .brij-route-drawing path {
  animation: none;
}

.brij-route-drawing path:nth-child(1) {
  stroke: #ff9933;
}

.brij-route-drawing path:nth-child(2) {
  stroke: rgba(255, 255, 255, 0.92);
}

.brij-route-drawing path:nth-child(3) {
  stroke: #138808;
  animation-duration: 20s;
}

@keyframes brijRouteMove {
  to {
    stroke-dashoffset: -320;
  }
}

@media (max-width: 720px) {
  .hero-shell {
    min-height: clamp(560px, 76svh, 700px);
  }

  .hero-grid {
    min-height: clamp(490px, calc(76svh - 66px), 630px);
    padding: 54px 0 96px;
  }

  .brij-route-drawing {
    top: -8svh;
    left: -48vw;
    width: 190vw;
    opacity: 0.22;
  }

}

/* Official Brij wordmark: a clear identity anchor on the navy hero surface. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-brand-logo {
  display: block;
  width: min(430px, 78vw);
  max-height: 180px;
  margin: 0 auto 24px;
  padding: 16px 28px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(248, 250, 254, 0.97);
  box-shadow: 0 16px 44px rgba(12, 20, 52, 0.2);
  object-fit: contain;
}

html[data-theme="brij"] .hero-brand-logo {
  border-bottom: 3px solid #d47b59;
}

@media (max-width: 720px) {
  .hero-brand-logo {
    width: min(370px, 82vw);
    margin-bottom: 18px;
    padding: 14px 20px;
  }
}

/* A transparent derived mark lets the Brij identity belong to the navy hero rather than sit on a pasted white panel. */
.hero-brand-logo,
html[data-theme="brij"] .hero-brand-logo {
  width: min(500px, 82vw);
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.unit-two-illustration {
  width: min(var(--max), calc(100% - (var(--side) * 2)));
  margin: clamp(30px, 4vw, 54px) auto 0;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.unit-two-illustration img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.unit-two-illustration figcaption {
  padding: 13px 16px;
  color: var(--cream);
  background: var(--asphalt);
  font-size: 0.84rem;
  line-height: 1.4;
}

.unit-two-illustration figcaption strong,
.unit-two-illustration figcaption span {
  display: block;
}

.unit-two-illustration figcaption strong {
  margin-bottom: 3px;
  color: var(--lime);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Brij's supplied master logo is graphite on white. Keep that identity intact
   and build the default site palette around it, rather than recolouring it. */
html[data-theme="brij"] {
  --ink: #44485b;
  --asphalt: #44485b;
  --asphalt-2: #62697d;
  --molten: #c97945;
  --gold: #d9dee6;
  --sage: #658270;
  --clay: #ae684d;
  --cream: #ffffff;
  --paper: #f6f7f9;
  --paper-2: #e7eaf0;
  --line: rgba(68, 72, 91, 0.17);
  --shadow: 0 28px 86px rgba(68, 72, 91, 0.14);
  --hero-surface: #ffffff;
}

html[data-theme="brij"] body {
  background:
    linear-gradient(90deg, rgba(68, 72, 91, 0.04) 1px, transparent 1px) 0 0 / 70px 70px,
    linear-gradient(180deg, rgba(68, 72, 91, 0.028) 1px, transparent 1px) 0 0 / 70px 70px,
    linear-gradient(135deg, #ffffff 0%, #f0f2f5 55%, #fafafa 100%);
}

html[data-theme="brij"] .hero-shell {
  background: #ffffff;
}

html[data-theme="brij"] .application-section,
html[data-theme="brij"] .unit-one-section,
html[data-theme="brij"] .contact-section {
  background: linear-gradient(180deg, #44485b, #62697d);
}

html[data-theme="brij"] .clients-section {
  background: linear-gradient(180deg, #f6f7f9, #e7eaf0);
}

html[data-theme="brij"] .process-gallery figcaption,
html[data-theme="brij"] .application-media figcaption,
html[data-theme="brij"] .product-media-row figcaption,
html[data-theme="brij"] .unit-two-illustration figcaption {
  background: #44485b;
}

html[data-theme="brij"] .hero-brand-logo,
html[data-theme="brij"] .hero-brand-logo--brij {
  width: min(510px, 82vw);
  background: #ffffff;
}

html[data-theme="brij"] .hero-copy .kicker,
html[data-theme="brij"] .hero-copy .lead {
  color: #44485b;
}

html[data-theme="brij"] .brij-route-drawing path,
html[data-theme="brij"] body.motion-ready .brij-route-drawing path {
  stroke: #c97945;
}

html[data-theme="brij"] .brij-route-drawing path:nth-child(2),
html[data-theme="brij"] body.motion-ready .brij-route-drawing path:nth-child(2) {
  stroke: #aeb5c1;
}

html[data-theme="brij"] .brij-route-drawing path:nth-child(3),
html[data-theme="brij"] body.motion-ready .brij-route-drawing path:nth-child(3) {
  stroke: #658270;
}

@media (max-width: 720px) {
  :root {
    --gutter: 18px;
    --mobile-content: calc(100% - (var(--gutter) * 2));
  }

  .identity-rail {
    display: none;
  }

  .hero-shell,
  .section,
  .hero-grid,
  .section > *,
  .section > * > *,
  .section-dock {
    min-width: 0;
  }

  .hero-grid {
    width: var(--mobile-content);
    max-width: var(--mobile-content);
    margin-inline: auto;
  }

  .section-dock {
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    margin: 0;
    transform: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .section-dock a {
    flex: 0 0 auto;
    padding-inline: 14px;
    white-space: nowrap;
  }

  .section-index,
  .section-index.light,
  .section-index.dark,
  .unit-two-illustration,
  .client-logo-groups,
  .reference-group,
  .reference-name-grid {
    width: var(--mobile-content);
    max-width: var(--mobile-content);
    margin-inline: auto;
  }

  .unit-two-illustration {
    margin-top: 26px;
  }

  .application-grid article,
  .product-register article,
  .workflow-board div,
  .logo-card {
    min-width: 0;
  }

  .hero-brand-logo,
  html[data-theme="brij"] .hero-brand-logo {
    width: min(260px, 74vw);
  }
}

/* Shared hero contract: the logo lockup and all copy always sit above the
   route drawing, while route colour, opacity, and movement match Vivek. */
.hero-shell {
  isolation: isolate;
}

.hero-grid {
  z-index: 2;
  min-height: clamp(500px, calc(76svh - 72px), 650px);
  padding: 64px 0 104px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  isolation: isolate;
  max-width: 760px;
}

.hero-copy::before {
  display: none;
}

.hero-brand-logo,
.hero-copy .kicker,
.hero-copy .lead {
  position: relative;
  z-index: 1;
}

.hero-copy .kicker {
  margin-bottom: 18px;
  font-size: 0.72rem;
}

.hero-copy .lead {
  max-width: 610px;
  font-size: 1.14rem;
  line-height: 1.5;
}

.brij-route-drawing {
  top: -18svh;
  left: -8vw;
  z-index: 0;
  width: 112vw;
  max-width: none;
  height: auto;
  opacity: 0.72;
}

.brij-route-drawing path,
body.motion-ready .brij-route-drawing path {
  fill: none;
  stroke: #ff9933;
  stroke-width: 3;
  stroke-dasharray: 14 18;
  stroke-linecap: square;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  animation: sharedHeroRouteMove 9s linear infinite;
}

.brij-route-drawing path:nth-child(2),
body.motion-ready .brij-route-drawing path:nth-child(2) {
  stroke: rgba(255, 255, 255, 0.92);
  animation-duration: 12s;
}

.brij-route-drawing path:nth-child(3),
body.motion-ready .brij-route-drawing path:nth-child(3) {
  stroke: #138808;
  animation-duration: 15s;
}

@keyframes sharedHeroRouteMove {
  to {
    stroke-dashoffset: -320;
  }
}

@media (max-width: 720px) {
  .hero-grid {
    min-height: clamp(490px, calc(76svh - 66px), 630px);
    padding: 54px 0 96px;
  }

  .brij-route-drawing {
    top: 5svh;
    left: -48vw;
    width: 190vw;
    opacity: 0.72;
  }

  .hero-brand-logo,
  html[data-theme="brij"] .hero-brand-logo {
    width: min(300px, 78vw);
  }
}

/* Phone layout: use the viewport itself as the containment boundary and make
   every route visible without a horizontal page scroll. */
@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  .hero-shell {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .hero-grid {
    width: calc(100vw - 36px) !important;
    max-width: calc(100vw - 36px) !important;
    margin-inline: auto !important;
  }

  .hero-copy,
  .hero-copy .lead {
    width: 100%;
    max-width: 100% !important;
  }

  .material-strip {
    display: none;
  }

  .section-dock {
    display: grid;
    width: calc(100% - 24px) !important;
    max-width: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 46px;
    gap: 4px;
    margin: 10px auto 0;
    padding: 4px;
    border: 1px solid rgba(49, 41, 30, 0.24);
    border-radius: 10px;
    background: rgba(255, 252, 245, 0.97);
    box-shadow: 0 10px 24px rgba(49, 41, 30, 0.1);
    overflow: hidden;
  }

  .section-dock a {
    display: grid;
    min-height: 0;
    min-width: 0;
    place-items: center;
    padding: 6px;
    border: 1px solid rgba(49, 41, 30, 0.14);
    border-radius: 6px;
    white-space: normal;
    font-size: 0.6rem;
    line-height: 1.1;
    text-align: center;
  }
}
