/**
 * industries.css — Industries page specific styles
 * Elevated to match the approved home design language:
 *   - dark blueprint hero header with image-set() background wash
 *   - bone-deep "ground" hosting elevated navy tiles (pillar-card depth)
 *   - 3D illustrations served full-colour (no destructive filter)
 *   - copper hairline, dual-layer shadow, hover lift, serif index numeral
 * Reuses global classes/tokens; no shared files touched.
 * Depends on: tokens.css, base.css, layout.css, components/*.css
 */

/* ============================================================
 * PAGE HEADER (dark hero band — eyebrow → headline → subhead)
 * ============================================================ */

.industries-header {
  background: var(--c-navy-deep);
  padding: calc(var(--sp-9) + var(--sp-8)) 0 var(--sp-8);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--c-white);
}

/* Decorative Americas background wash — optimized image-set (PNG fallback first) */
.industries-header::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: url('../../assets/images/H1-industries.png');
  background-image: image-set(
    url('../../assets/images/H1-industries.avif') type('image/avif'),
    url('../../assets/images/H1-industries.webp') type('image/webp'),
    url('../../assets/images/H1-industries.png') type('image/png')
  );
  background-size: cover;
  background-position: center;
  opacity: 0.16;
}

/* Bottom-weighted navy gradient + warm copper pocket (echoes hero overlay) */
.industries-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 72% 38%, var(--hero-warm-glow) 0%, transparent 55%),
    radial-gradient(ellipse at 18% 72%, rgba(91, 107, 124, 0.16) 0%, transparent 50%),
    linear-gradient(180deg, rgba(6, 20, 41, 0.10) 0%, rgba(6, 20, 41, 0.55) 100%);
}

.industries-header__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  position: relative;
  z-index: 1;
}

.industries-header__text {
  flex: 1 1 auto;
  max-width: 760px;
}

/* Scrim-chip eyebrow — copper-bright is AA-safe on the dark header */
.industries-header__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--c-copper-bright);
  margin-bottom: var(--sp-3);
}

.industries-header__eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--c-copper);
  flex: 0 0 auto;
}

.industries-header__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--c-white);
  max-width: 18ch;
}

.industries-header__sub {
  font-size: var(--fs-body);
  color: rgba(247, 248, 250, 0.72);
  max-width: 52ch;
  line-height: var(--leading-body);
  margin-top: var(--sp-4);
}

/* ============================================================
 * HERO RIGHT-SIDE EDITORIAL VISUAL — Americas-map contour motif
 * Same flex pattern as About (compass) / Services (gear); hidden ≤768px.
 * ============================================================ */

.industries-header__visual {
  flex: 0 0 40%;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  pointer-events: none;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity var(--dur-long) var(--ease-out) 0.6s,
              transform var(--dur-long) var(--ease-out) 0.6s;
}

.industries-header__visual.is-ready {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 768px) {
  .industries-header__visual { display: none; }
  .industries-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .industries-header__text { max-width: 100%; }
}

/* ============================================================
 * INDUSTRIES SECTION — bone-deep "ground" with blueprint wash
 * so the elevated navy tiles read as raised objects.
 * ============================================================ */

.industries-section {
  position: relative;
  isolation: isolate;
  background: var(--c-bone-deep);
  /* Tightened so the tiles sit close to the diagonal seam into the CTA. */
  padding-bottom: var(--sp-6);
}

/* Whisper-quiet blueprint grid wash (the home pillars recipe, verbatim) */
.industries-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(11, 30, 63, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 30, 63, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 40%, transparent 100%);
          mask-image: radial-gradient(120% 80% at 50% 0%, #000 40%, transparent 100%);
}

/* Dark → light diagonal seam (replicated from the home language with tokens) */
.section-divider--diagonal {
  position: relative;
  height: 80px;
  background: var(--c-bone-deep);
  clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 100%);
  margin-top: -2px;
}

/* Light → dark seam (tiles bone ground → navy CTA band). */
.section-divider--diagonal-dark {
  height: 80px;
  background: var(--c-navy);
  clip-path: polygon(0 0, 100% 40%, 100% 100%, 0 100%);
  margin-top: -2px;
}

/* ============================================================
 * CENTERED 8-TILE GRID — 6-col virtual grid, each tile spans 2.
 * Row 3 (tiles 7-8) is centred so there is no orphan empty cell.
 * ============================================================ */

.industries-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-5);
}

.industry-tile { grid-column: span 2; }
.industry-tile:nth-child(7) { grid-column: 2 / span 2; }
.industry-tile:nth-child(8) { grid-column: 4 / span 2; }

@media (max-width: 1024px) {
  .industries-grid { grid-template-columns: repeat(4, 1fr); }
  .industry-tile,
  .industry-tile:nth-child(7),
  .industry-tile:nth-child(8) { grid-column: span 2; }
}

@media (max-width: 640px) {
  .industries-grid { grid-template-columns: 1fr; }
  .industry-tile,
  .industry-tile:nth-child(7),
  .industry-tile:nth-child(8) { grid-column: 1; }
}

/* ============================================================
 * INDUSTRY TILE — elevated navy object (pillar-card depth language)
 * ============================================================ */

.industry-tile {
  background: var(--c-navy);
  border: 1px solid rgba(184, 115, 51, 0.10);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-3);
  position: relative;
  overflow: hidden;
  cursor: default;
  /* dual-layer shadow: tight contact + soft ambient */
  box-shadow:
    0 1px 3px rgba(6, 20, 41, 0.30),
    0 12px 32px rgba(6, 20, 41, 0.28);
  transition:
    transform var(--dur-short) var(--ease-out),
    box-shadow var(--dur-short) var(--ease-out),
    border-color var(--dur-medium) var(--ease-out);
}

/* Resting copper top-hairline that grows on hover (pillar card cue) */
.industry-tile::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--c-copper);
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  transition: width var(--dur-medium) var(--ease-out);
}

/* Subtle inner glow on hover */
.industry-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(184, 115, 51, 0.10) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-medium) var(--ease-out);
}

.industry-tile:hover {
  transform: translateY(-7px) scale(1.012);
  box-shadow:
    0 2px 6px rgba(6, 20, 41, 0.38),
    0 26px 60px rgba(6, 20, 41, 0.44),
    0 0 0 1px rgba(184, 115, 51, 0.32),
    0 0 28px -12px rgba(184, 115, 51, 0.22);
  border-color: rgba(184, 115, 51, 0.36);
}

.industry-tile:hover::before { opacity: 1; }
.industry-tile:hover::after { width: 72px; }

/* Illustration area — full-colour 3D render, real presence (NO filter) */
.industry-tile__illustration {
  width: 100%;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin-top: var(--sp-2);
  transition: transform var(--dur-short) var(--ease-out);
}

.industry-tile__illustration picture {
  display: contents;
}

.industry-tile__illustration img {
  width: auto;
  height: 100%;
  max-width: 132px;
  max-height: 132px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 8px 18px rgba(6, 20, 41, 0.45));
  transform-origin: center;
  transition:
    transform var(--dur-medium) var(--ease-out),
    filter    var(--dur-medium) var(--ease-out);
  will-change: transform;
}

/* Discreet floating loop — small vertical breathing + micro-tilt (< 1°).
 * Restrained so it reads as a live element, not a mascot. */
.industry-tile:hover .industry-tile__illustration img {
  animation: industryTileFloat 3.6s ease-in-out infinite;
  filter:
    drop-shadow(0 12px 20px rgba(6, 20, 41, 0.5))
    drop-shadow(0 2px 10px rgba(184, 115, 51, 0.2));
}

@keyframes industryTileFloat {
  0% {
    transform: translateY(-4px) scale(1.03) rotate(-0.6deg);
  }
  50% {
    transform: translateY(-8px) scale(1.04) rotate(0.6deg);
  }
  100% {
    transform: translateY(-4px) scale(1.03) rotate(-0.6deg);
  }
}

.industry-tile__name {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  font-weight: 500;
  color: var(--c-white);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  position: relative;
  z-index: 1;
}

.industry-tile__sub {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  color: var(--c-steel);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* ============================================================
 * REDUCED MOTION — escape hatch for every bespoke transition here.
 * (data-animate reveals inherit their own reduce rule from layout.css.)
 * ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .industries-header__visual {
    transition: none;
  }
  .industry-tile,
  .industry-tile::before,
  .industry-tile::after,
  .industry-tile__illustration img {
    transition: none;
  }
  .industry-tile:hover {
    transform: none;
  }
  .industry-tile:hover .industry-tile__illustration img {
    transform: none;
    animation: none;
  }
  /* keep the resting copper hairline (decorative, static) */
}
