.site-header nav .active {
  color: white;
}

.functions-hero {
  position: relative;
  min-height: 76vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: clamp(92px, 13vw, 154px) clamp(20px, 6vw, 80px) clamp(70px, 9vw, 110px);
  background: #05020d;
}

.functions-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.48;
  filter: saturate(1.28) contrast(1.1);
}

.functions-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 2, 13, 0.96), rgba(5, 2, 13, 0.66) 58%, rgba(5, 2, 13, 0.34)),
    linear-gradient(180deg, rgba(5, 2, 13, 0.18), rgba(5, 2, 13, 0.92)),
    linear-gradient(135deg, rgba(255, 10, 139, 0.2), transparent 38%),
    linear-gradient(235deg, rgba(49, 93, 255, 0.22), transparent 40%);
}

.functions-hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: 930px;
}

.functions-hero h1 {
  max-width: 930px;
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: 0.96;
}

.function-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
  background: #080411;
}

.function-stats div {
  min-width: 0;
  padding: clamp(24px, 4vw, 42px);
  border-right: 1px solid var(--line);
}

.function-stats div:last-child {
  border-right: 0;
}

.function-stats strong {
  display: block;
  color: white;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1;
  text-shadow: 0 0 24px rgba(255, 10, 139, 0.44);
}

.function-stats span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.mission-intro,
.route-section,
.memory-section,
.safety-section,
.scan-section,
.control-section,
.functions-cta {
  padding: clamp(64px, 9vw, 116px) clamp(20px, 6vw, 80px);
}

#misje,
#prowadzenie,
#ochrona,
#skanowanie {
  scroll-margin-top: 76px;
}

.mission-intro {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(300px, 1.05fr);
  gap: clamp(32px, 7vw, 92px);
  align-items: end;
}

.mission-intro > p {
  max-width: 760px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 1.12rem;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  padding: 0 clamp(20px, 6vw, 80px) clamp(72px, 10vw, 126px);
}

.mission-grid article {
  min-width: 0;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 10, 139, 0.12), transparent 42%),
    linear-gradient(225deg, rgba(49, 93, 255, 0.1), transparent 44%),
    var(--surface);
}

.mission-grid article > span {
  display: block;
  margin-bottom: 34px;
  color: var(--pink-2);
  font-weight: 950;
}

.mission-grid p,
.route-copy p,
.memory-copy > p,
.safety-list p,
.scan-copy p,
.control-columns p,
.functions-cta p {
  color: var(--muted);
}

.route-section {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: clamp(42px, 7vw, 100px);
  align-items: center;
  border-block: 1px solid var(--line);
  background:
    linear-gradient(115deg, rgba(49, 93, 255, 0.14), transparent 42%),
    linear-gradient(245deg, rgba(255, 10, 139, 0.12), transparent 38%),
    #080411;
}

.feature-list {
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: rgba(255, 255, 255, 0.86);
}

.feature-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 14px rgba(255, 10, 139, 0.86);
}

.route-visual {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 72% 32%, rgba(49, 93, 255, 0.24), transparent 24%),
    radial-gradient(circle at 26% 74%, rgba(255, 10, 139, 0.2), transparent 24%),
    #070310;
  background-size: 40px 40px, 40px 40px, auto, auto, auto;
}

.route-line {
  position: absolute;
  height: 3px;
  transform-origin: left center;
}

.route-line.outward {
  left: 20%;
  top: 70%;
  width: 61%;
  transform: rotate(-28deg);
  background: linear-gradient(90deg, var(--pink), var(--blue));
  box-shadow: 0 0 18px rgba(255, 10, 139, 0.7);
}

.route-line.return {
  left: 22%;
  top: 76%;
  width: 58%;
  transform: rotate(-18deg);
  border-top: 2px dashed rgba(255, 255, 255, 0.48);
}

.route-node {
  position: absolute;
  min-width: 130px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(5, 2, 13, 0.86);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.34);
}

.route-node strong,
.route-node span {
  display: block;
}

.route-node span {
  color: var(--muted);
  font-size: 0.82rem;
}

.route-node.home {
  left: 6%;
  bottom: 7%;
}

.route-node.mark {
  left: 43%;
  top: 48%;
}

.route-node.target {
  right: 4%;
  top: 10%;
}

.route-boat {
  position: absolute;
  left: 54%;
  top: 37%;
  padding: 8px 12px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  font-weight: 950;
  transform: rotate(-28deg);
  box-shadow: 0 0 24px rgba(255, 10, 139, 0.5);
}

.memory-section {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 1fr);
  gap: clamp(38px, 7vw, 96px);
  align-items: center;
}

.memory-media {
  min-height: 560px;
  overflow: hidden;
  border-radius: 8px;
  background: #0b0614;
}

.memory-media img {
  width: 100%;
  height: 100%;
  min-height: 560px;
  display: block;
  object-fit: cover;
}

.memory-items {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.memory-items div {
  min-width: 0;
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.memory-items strong,
.memory-items span {
  display: block;
}

.memory-items strong {
  margin-bottom: 6px;
  color: white;
}

.memory-items span {
  color: var(--muted);
  font-size: 0.92rem;
}

.safety-section {
  border-block: 1px solid rgba(255, 10, 139, 0.2);
  background:
    linear-gradient(145deg, rgba(255, 10, 139, 0.12), transparent 36%),
    #080411;
}

.section-heading-inline {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(280px, 0.7fr);
  gap: clamp(30px, 7vw, 88px);
  align-items: end;
}

.section-heading-inline > p {
  color: var(--muted);
}

.safety-list {
  margin-top: 42px;
  border-top: 1px solid var(--line);
}

.safety-list article {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(300px, 1fr);
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.safety-list strong {
  color: white;
  font-size: 1.06rem;
}

.safety-list p {
  margin-bottom: 0;
}

.scan-section {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr);
  gap: clamp(42px, 7vw, 100px);
  align-items: center;
}

.feature-note {
  margin-top: 26px;
  padding-left: 16px;
  border-left: 2px solid var(--pink);
  font-size: 0.94rem;
}

.scan-visual {
  position: relative;
  min-height: 550px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(49, 93, 255, 0.22), rgba(5, 2, 13, 0.6)),
    url("/assets/hero-lake.webp") center / cover no-repeat;
}

.scan-visual::before {
  content: "";
  position: absolute;
  inset: 12% 13%;
  border: 2px solid rgba(255, 255, 255, 0.68);
  background: rgba(49, 93, 255, 0.14);
  transform: rotate(-5deg);
}

.scan-grid-lines {
  position: absolute;
  inset: 15% 15%;
  transform: rotate(-5deg);
}

.scan-grid-lines i {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pink), #8ab4ff);
  box-shadow: 0 0 12px rgba(255, 10, 139, 0.4);
}

.scan-grid-lines i:nth-child(1) { top: 8%; }
.scan-grid-lines i:nth-child(2) { top: 22%; }
.scan-grid-lines i:nth-child(3) { top: 36%; }
.scan-grid-lines i:nth-child(4) { top: 50%; }
.scan-grid-lines i:nth-child(5) { top: 64%; }
.scan-grid-lines i:nth-child(6) { top: 78%; }
.scan-grid-lines i:nth-child(7) { top: 92%; }

.scan-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 18px rgba(255, 10, 139, 0.8);
}

.scan-corner.c1 { left: 11%; top: 10%; }
.scan-corner.c2 { right: 11%; top: 5%; }
.scan-corner.c3 { right: 10%; bottom: 8%; }
.scan-corner.c4 { left: 13%; bottom: 3%; }

.scan-label {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(5, 2, 13, 0.86);
  backdrop-filter: blur(12px);
}

.scan-label strong,
.scan-label span {
  display: block;
}

.scan-label span {
  color: var(--muted);
}

.control-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.28fr);
  gap: clamp(40px, 7vw, 96px);
  border-top: 1px solid var(--line);
  background: #070310;
}

.control-columns {
  display: grid;
  gap: 1px;
}

.control-columns article {
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.control-columns p {
  margin-bottom: 0;
}

.functions-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  border-block: 1px solid rgba(255, 10, 139, 0.28);
  background:
    linear-gradient(110deg, rgba(255, 10, 139, 0.22), transparent 42%),
    linear-gradient(250deg, rgba(49, 93, 255, 0.2), transparent 44%),
    #0b0515;
}

.functions-cta > div:first-child {
  max-width: 760px;
}

.functions-cta h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

@media (max-width: 980px) {
  .function-stats,
  .mission-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .function-stats div:nth-child(2) {
    border-right: 0;
  }

  .function-stats div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .route-section,
  .memory-section,
  .scan-section,
  .control-section {
    grid-template-columns: 1fr;
  }

  .route-visual,
  .scan-visual {
    min-height: 500px;
  }

  .memory-media,
  .memory-media img {
    min-height: 440px;
  }
}

@media (max-width: 720px) {
  .functions-hero {
    min-height: 680px;
  }

  .functions-hero > img {
    object-position: 58% center;
  }

  .functions-hero h1 {
    max-width: 100%;
    font-size: clamp(2.55rem, 12.5vw, 4rem);
    overflow-wrap: normal;
  }

  .functions-hero .eyebrow {
    max-width: 30ch;
    font-size: 0.7rem;
  }

  .function-stats,
  .mission-grid,
  .mission-intro,
  .section-heading-inline,
  .safety-list article,
  .memory-items {
    grid-template-columns: 1fr;
  }

  .function-stats div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .function-stats div:last-child {
    border-bottom: 0;
  }

  .mission-grid {
    gap: 10px;
  }

  .route-visual,
  .scan-visual {
    min-height: 430px;
  }

  .route-node {
    min-width: 112px;
    padding: 9px 10px;
    font-size: 0.82rem;
  }

  .route-node.home {
    left: 3%;
  }

  .route-node.mark {
    left: 34%;
  }

  .route-node.target {
    right: 2%;
  }

  .route-boat {
    left: 48%;
    font-size: 0.8rem;
  }

  .memory-media,
  .memory-media img {
    min-height: 360px;
  }

  .safety-list article {
    gap: 8px;
  }

  .functions-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .cta-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
