/* ==========================================================================
   TechAbbot – interactive industry expertise
   Markup: partials/industries.html (generated by tools/build-industries.js)
   Behaviour: js/industries.js

   Dark split panel. Left: positioning, heading and call to action.
   Right: the industry explorer.

     below 960px     stacked: lead on top, industries expand in place
     960px and up    split: lead on the left (sticky), industries expand in place
     1280px and up   split: lead | industry list | selected industry panel

   Without JavaScript (<html> has no .js class) every industry panel is shown
   in full, one after another. With it, one industry is open at a time.
   ========================================================================== */

.industries {
  --ind-bg: #07172D;
  --ind-panel: #102A43;
  --ind-active: #123C52;
  --ind-text: #FFFFFF;
  --ind-muted: #C2CFDC;
  --ind-line: #28465D;
  --ind-green: #26965E;
  --ind-blue: #0871A7;

  position: relative;
  padding-block: clamp(52px, 6.5vw, 96px);
  background: var(--ind-bg);
  color: var(--ind-text);
  isolation: isolate;
}

/* Ambient blue and green light, plus a faint architecture grid on the left. */
.industries::before,
.industries::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.industries::before {
  background:
    radial-gradient(38% 55% at 0% 0%, rgba(8, 113, 167, 0.34), transparent 70%),
    radial-gradient(34% 50% at 100% 100%, rgba(38, 150, 94, 0.24), transparent 70%);
}

.industries::after {
  background-image:
    linear-gradient(rgba(194, 207, 220, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(194, 207, 220, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(60% 80% at 0% 100%, #000, transparent 75%);
  mask-image: radial-gradient(60% 80% at 0% 100%, #000, transparent 75%);
}

.industries :focus-visible {
  outline-color: #fff;
  outline-offset: 2px;
}

.industries__inner {
  display: grid;
  gap: clamp(32px, 4vw, 56px);
}

/* Lead (left) ------------------------------------------------------------- */

.industries__label { color: var(--c-blue-bright); }
.industries__label::after { content: none; }
.industries__label::before { background: var(--gradient-logo-bright); }

.industries__title {
  margin: 16px 0 0;
  font-size: clamp(1.875rem, 1.3rem + 2.4vw, 3rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.industries__accent { color: var(--c-green-bright); }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .industries__accent {
    background: var(--gradient-logo-bright);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    -webkit-text-fill-color: transparent;
  }
}

.industries__intro {
  max-width: 34em;
  margin: 20px 0 28px;
  color: var(--ind-muted);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
}

.industries__lead .btn { box-shadow: 0 14px 28px -14px rgba(86, 193, 234, 0.75); }

/* Explorer (right) ---------------------------------------------------------- */

.industries__explorer {
  min-width: 0;
  border-top: 1px solid var(--ind-line);
}

.industry { border-bottom: 1px solid var(--ind-line); }

.industry__heading { margin: 0; font: inherit; }

.industry__toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 12px 14px 12px 16px;
  border: 0;
  background: none;
  color: var(--ind-muted);
  font: inherit;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: color var(--ease), background-color var(--ease);
}

/* Accent bar on the open industry. */
.industry__toggle::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--c-green-bright), var(--c-blue-bright));
  transform: scaleY(0);
  transition: transform 220ms ease;
}

.industry__number {
  flex: none;
  width: 1.7em;
  color: var(--ind-line);
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  transition: color var(--ease);
}

.industry__icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.industry__name { flex: 1; min-width: 0; }

/* Expand indicator: a plus that becomes a minus. */
.industry__indicator {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ind-line);
  border-radius: 50%;
  transition: border-color var(--ease), background-color var(--ease);
}

.industry__indicator::before,
.industry__indicator::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 220ms ease;
}

.industry__indicator::after { transform: translate(-50%, -50%) rotate(90deg); }

.industry__toggle:hover { color: var(--ind-text); }
.industry__toggle:hover .industry__number { color: var(--c-green-bright); }
.industry__toggle:hover .industry__indicator { border-color: var(--c-green-bright); }

.js .industry.is-open .industry__toggle {
  background: var(--ind-active);
  color: var(--ind-text);
}

.js .industry.is-open .industry__toggle::before { transform: scaleY(1); }
.js .industry.is-open .industry__number { color: var(--c-green-bright); }

.js .industry.is-open .industry__indicator {
  border-color: var(--ind-green);
  background: var(--ind-green);
}

.js .industry.is-open .industry__indicator::after { transform: translate(-50%, -50%) rotate(0deg); }

/* Without JavaScript the headings are plain headings. */
html:not(.js) .industry__toggle { color: var(--ind-text); cursor: default; }
html:not(.js) .industry__number { color: var(--c-green-bright); }
html:not(.js) .industry__indicator { display: none; }

/* Panel ------------------------------------------------------------------- */

.js .industry:not(.is-open) .industry__panel { display: none; }

.industry__panel { background: var(--ind-panel); }

.js .industry.is-open .industry__panel { animation: industry-in 320ms ease both; }

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

.industry__panel-inner { padding: clamp(18px, 2.4vw, 28px); }

.industry__overview {
  margin: 0;
  color: var(--ind-text);
  font-size: clamp(1rem, 0.97rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
}

.industry__more { margin: 10px 0 0; }

.industry__more a,
.industry__cta a,
.industry-project__link {
  color: var(--c-green-bright);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}

.industry__more a::after,
.industry__cta a::after,
.industry-project__link::after {
  content: "\2192";
  display: inline-block;
  margin-left: 8px;
  transition: transform var(--ease);
}

.industry__more a:hover,
.industry__cta a:hover,
.industry-project__link:hover { text-decoration: underline; text-underline-offset: 4px; }

.industry__more a:hover::after,
.industry__cta a:hover::after,
.industry-project__link:hover::after { transform: translateX(4px); }

.industry__columns {
  display: grid;
  gap: 20px 28px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--ind-line);
}

.industry__subhead {
  margin: 0;
  color: var(--c-blue-bright);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.industry__list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ind-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.industry__list li {
  position: relative;
  padding-left: 18px;
}

.industry__list li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 8px;
  height: 2px;
  background: var(--c-green-bright);
}

.industry__cta {
  margin: 22px 0 0;
  padding: 16px 18px;
  border: 1px dashed var(--ind-line);
  color: var(--ind-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Featured project */

.industry-project {
  display: grid;
  gap: 18px;
  margin-top: 22px;
  border: 1px solid var(--ind-line);
  background: var(--ind-bg);
  box-shadow: 0 22px 36px -26px rgba(0, 0, 0, 0.9);
}

.industry-project__media {
  aspect-ratio: 3 / 2;
  background: var(--ind-panel);
  overflow: hidden;
}

.industry-project__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.industry-project:hover .industry-project__media img { transform: scale(1.04); }

.industry-project__body {
  min-width: 0;
  padding: 0 18px 18px;
}

.industry-project--no-media .industry-project__body { padding-top: 18px; }

.industry-project__title {
  margin: 8px 0 0;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.industry-project__text {
  margin: 8px 0 0;
  color: var(--ind-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.industry-project__facts {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.industry-project__facts div {
  padding-left: 12px;
  border-left: 2px solid var(--c-blue-bright);
}

.industry-project__facts div + div { border-left-color: var(--c-green-bright); }

.industry-project__facts dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.industry-project__facts dd {
  margin: 2px 0 0;
  color: var(--ind-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.industry-project__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.industry-project__tech li {
  padding: 3px 10px;
  border: 1px solid var(--ind-line);
  border-radius: 999px;
  color: var(--ind-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.industry-project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 12px 0 0;
}

.industry-project__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.industry-project__link + .industry-project__link { color: var(--c-blue-bright); }

/* Layout ------------------------------------------------------------------ */

@media (min-width: 600px) {
  .industry__columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .industry-project__media { aspect-ratio: 2 / 1; }

  .industry-project__media img { object-position: center top; }

  .industry-project__body { padding: 0 22px 20px; }

  .industry-project--no-media .industry-project__body { padding-top: 20px; }

  .industry-project__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

/* Split: lead on the left, explorer on the right. */
@media (min-width: 960px) {
  .industries__inner {
    grid-template-columns: minmax(0, 34fr) minmax(0, 66fr);
    align-items: start;
  }

  .industries__lead {
    position: sticky;
    top: 96px;
  }
}

/* Split panel proper: industry list beside the selected industry's panel. */
@media (min-width: 1280px) {
  .industries__inner { grid-template-columns: minmax(0, 32fr) minmax(0, 68fr); }

  .js .industries__explorer {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    grid-template-rows: repeat(6, auto) 1fr;
    border: 1px solid var(--ind-line);
    background: rgba(16, 42, 67, 0.45);
  }

  .js .industry { display: contents; }

  .js .industry__heading {
    grid-column: 1;
    border-bottom: 1px solid var(--ind-line);
  }

  .js .industry__panel {
    grid-column: 2;
    grid-row: 1 / -1;
    border-left: 1px solid var(--ind-line);
  }

  .js .industry__toggle {
    gap: 10px;
    min-height: 68px;
    padding: 12px 34px 12px 16px;
    font-size: 0.9375rem;
  }

  .js .industry__icon { width: 20px; height: 20px; }

  /* The indicator becomes an arrow pointing at the panel. */
  .js .industry__indicator {
    position: absolute;
    top: 50%;
    right: 10px;
    margin-top: -9px;
    width: 18px;
    height: 18px;
    border: 0;
    background: none !important;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity var(--ease), transform var(--ease);
  }

  .js .industry__indicator::before {
    width: 12px;
    background: var(--c-green-bright);
  }

  .js .industry__indicator::after {
    top: 50%;
    left: auto;
    right: 2px;
    width: 7px;
    height: 7px;
    border: solid var(--c-green-bright);
    border-width: 1.5px 1.5px 0 0;
    background: none;
    transform: translateY(-50%) rotate(45deg) !important;
  }

  .js .industry.is-open .industry__indicator,
  .js .industry__toggle:hover .industry__indicator {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .industry.is-open .industry__panel { animation: none; }

  .industry__toggle::before,
  .industry__indicator,
  .industry__indicator::before,
  .industry__indicator::after,
  .industry-project__media img { transition: none; }

  .industry-project:hover .industry-project__media img { transform: none; }
}
