/* Infrastructure section: illustrated background, four layer tabs and panels.
   Desktop sizes use container units so the type tracks the artwork. */
.systems-section {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  overflow: hidden;
  min-height: 106.2cqw;
  padding-block: 13.275cqw 6cqw;
  background: var(--flow-paper);
  color: #111510;
  font-family: Arial, Helvetica, sans-serif;
}
.systems-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('../assets/infrastructure-background.png') center / 100% 100% no-repeat;
}
/* Dark fade from the hero above, and a paper fade into the blend below. */
.systems-section::before,
.systems-section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 0;
  pointer-events: none;
}
.systems-section::before {
  top: 0;
  height: clamp(60px, 7vw, 110px);
  background: linear-gradient(180deg, #101311 0%, #101311b8 20%, #10131145 55%, transparent 100%);
}
.systems-section::after {
  bottom: 0;
  height: clamp(35px, 5vw, 75px);
  background: linear-gradient(transparent, var(--flow-paper));
}
.systems-intro,
.systems-tabs,
.systems-panel { position: relative; z-index: 1; }

.systems-intro { width: 53%; margin-left: 5.75%; }
.systems-section h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 5.65cqw;
  font-weight: 400;
  line-height: 1.09;
  letter-spacing: -.055em;
}
.systems-section h2 em { font-family: inherit; font-weight: 400; letter-spacing: inherit; font-size: 1.15em; }
.systems-summary {
  max-width: 43cqw;
  margin: 3.45cqw 0 0;
  color: #353a35;
  font-size: 1.8cqw;
  line-height: 1.58;
}

.systems-tabs {
  width: 54.65%;
  margin: 3.5cqw 0 0 4%;
  padding: .55cqw 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5cqw;
  border-block: 1px solid #b9baa8;
}
.systems-tabs button {
  position: relative;
  min-width: 0;
  padding: 2.3cqw .4cqw;
  border: 0;
  background: transparent;
  color: #70796b;
  font: 400 1.65cqw/1.4 Arial, sans-serif;
  text-align: center;
}
.systems-tabs button[aria-selected="true"] { background: #182923; color: #fff; }
.systems-tabs button + button::before {
  content: '';
  position: absolute;
  left: -1.15cqw;
  top: 57%;
  width: 1.3cqw;
  height: 1px;
  background: #a9ac99;
}
.systems-tabs button:focus-visible { outline: 2px solid #9a680f; outline-offset: 2px; }

/* Once tabbed, every panel shares one grid cell, so the tallest sets a stable height. */
.systems-panel {
  width: 41.2%;
  margin: 8cqw 0 0 5.75%;
  overflow: hidden;
}
.systems-panel.is-tabbed { display: grid; }
.layer-content + .layer-content { margin-top: 4cqw; }
.is-tabbed > .layer-content + .layer-content { margin-top: 0; }
.is-tabbed > .layer-content {
  grid-area: 1 / 1;
  min-width: 0;
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease;
}
.layer-content[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 0s 180ms;
}
.layer-content h3 {
  margin: 0 0 2.1cqw;
  color: #10150f;
  font: 400 4.25cqw/1.08 Georgia, 'Times New Roman', serif;
  letter-spacing: -.045em;
}
.layer-content p {
  margin: 0 0 1.7cqw;
  color: #444a43;
  font: 400 1.65cqw/1.56 Arial, sans-serif;
}
.layer-features { list-style: none; padding: 0; margin: 0; }
.layer-features li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 1.05cqw 0;
  border-bottom: 1px solid #c1c2af;
  color: #444a43;
  font-size: 1.5cqw;
  line-height: 1.35;
}
.layer-features li:last-child { border: 0; }
.systems-mobile-map { display: none; }

@media (max-width: 600px) {
  .systems-section { min-height: 0; padding: 280px 6% 0; }
  .systems-art {
    height: 340px;
    background-size: auto 660px;
    background-position: right top;
    opacity: .95;
    mask-image: linear-gradient(#000 70%, transparent);
  }
  .systems-section::before {
    height: 155px;
    background: linear-gradient(180deg, #101311 0%, #101311c7 16%, #10131170 42%, #10131124 70%, transparent 100%);
  }
  .systems-section::after { display: none; }
  .systems-intro, .systems-tabs, .systems-panel { width: 100%; margin: 0; }
  .systems-section h2 { font-size: clamp(32px, 8.3vw, 49px); }
  .systems-summary { max-width: none; margin: 25px 0 30px; font-size: 16px; line-height: 1.65; }
  .systems-tabs { gap: 10px; padding: 6px 0; margin-bottom: 36px; }
  .systems-tabs button { padding: 18px 2px; font-size: 13px; }
  .systems-tabs button + button::before { display: none; }
  .layer-content h3 { font-size: 39px; margin-bottom: 22px; }
  .layer-content p { font-size: 16px; margin-bottom: 18px; }
  .layer-features li { font-size: 14px; padding: 15px 0; }
  .systems-mobile-map {
    display: block;
    aspect-ratio: 1379 / 1141;
    margin: 20px -6.9% 0;
    background: url('../assets/infrastructure-layers.png') center / contain no-repeat;
  }
}
@media (prefers-reduced-motion: reduce) {
  .layer-content, .layer-content[aria-hidden="true"] { transition: none; }
}
