:root {
  --bg: #070b12;
  --blue: #2f9dff;
  --text: #f4f7fb;
  --muted: #b7c3d1;
  --line: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.05rem/1.5 "Segoe UI", system-ui, sans-serif;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem 1.5rem;
  padding: 0.55rem 1.4rem;
  background:
    linear-gradient(90deg, rgba(47, 157, 255, 0.16), transparent 32%),
    rgba(6, 12, 22, 0.94);
  border-bottom: 1px solid rgba(47, 157, 255, 0.28);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

header::after,
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(47, 157, 255, 0.14) 18%, rgba(47, 157, 255, 0.55) 36%, #b9e6ff 48%, #2f9dff 52%, rgba(47, 157, 255, 0.55) 64%, rgba(47, 157, 255, 0.14) 82%, transparent 100%);
  background-size: 42% 100%;
  background-repeat: no-repeat;
  animation: carrier 4.8s ease-in-out infinite;
  pointer-events: none;
}

.hero::after { animation-direction: reverse; }

header > a {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin: 0.3rem 0 -6.1rem;
  line-height: 0;
  transition: margin 0.25s;
}

header.compact > a {
  align-self: center;
  margin: 0;
}

header img {
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(47, 157, 255, 0.5),
    0 14px 32px rgba(0, 0, 0, 0.5),
    0 0 26px rgba(47, 157, 255, 0.32);
  transition: width 0.25s, height 0.25s;
}

header.compact img {
  width: 3.25rem;
  height: 3.25rem;
}

header svg {
  flex: 1;
  width: auto;
  height: 1.85rem;
  min-width: 5rem;
  margin: 0 0.4rem 0 0.2rem;
  color: #7ec8ff;
  filter: drop-shadow(0 0 4px rgba(47, 157, 255, 0.9));
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

header svg :is(.jacket, .core, .signal) {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

header svg .jacket { stroke-width: 6.5; opacity: 0.4; }
header svg .core { stroke: #dff3ff; stroke-width: 1.3; }
header svg .signal { stroke: #fff; stroke-width: 1.55; }

header svg .packet {
  fill: #fff;
  stroke: none;
  cx: -8%;
}

header svg .packet.go { animation: packet 1s linear; }

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.28rem;
  border: 1px solid rgba(47, 157, 255, 0.35);
  border-radius: 999px;
  background: rgba(8, 20, 36, 0.72);
  box-shadow: inset 0 0 16px rgba(47, 157, 255, 0.08);
}

nav a {
  position: relative;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: 0.04em;
  color: #d5e6f5;
}

nav a:hover,
nav a:focus-visible {
  color: #fff;
  background: rgba(47, 157, 255, 0.22);
  box-shadow: 0 0 14px rgba(47, 157, 255, 0.35);
  outline: none;
}

main section {
  scroll-margin-top: 5.25rem;
  padding: 4rem 1.25rem;
  max-width: 1120px;
  margin: 0 auto;
}

h1, h2, h3 { line-height: 1.15; font-weight: 650; }

h2 { margin: 0 0 1.5rem; font-size: 1.75rem; }

.hero {
  position: relative;
  scroll-margin-top: 0;
  max-width: none;
  margin: 0;
  min-height: min(calc(100vw * 1100 / 1600), calc(100dvh - 5.5rem));
  padding: 1.5rem 1.5rem 1.5rem 7vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  background:
    linear-gradient(90deg, rgba(7, 11, 18, 0.62) 0%, rgba(7, 11, 18, 0.12) 38%, rgba(7, 11, 18, 0.05) 100%),
    url("images/hero.jpg?v=2") center 62% / cover no-repeat;
}

.hero > div {
  max-width: 34rem;
  align-self: center;
}

.hero #uslugi {
  flex: 0 0 48%;
  width: auto;
  margin: 0;
  padding: 1.4rem 1.25rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 5.5rem;
  background: linear-gradient(165deg, rgba(10, 18, 32, 0.62), rgba(7, 12, 22, 0.48));
  border: 1px solid rgba(47, 157, 255, 0.35);
  border-left: 3px solid var(--blue);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.hero h2 {
  margin: 0 0 1rem;
  font-size: 1.65rem;
}

.hero h2::after,
.intro h2::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 2px;
  margin-top: 0.55rem;
  background: linear-gradient(90deg, var(--blue), transparent);
}

.hero .cards article {
  display: grid;
  grid-template-columns: 10.5rem 1fr;
  background: rgba(5, 9, 16, 0.45);
  border-color: rgba(255, 255, 255, 0.1);
}

.hero .cards img {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 100%;
  height: 0;
  min-height: 100%;
}

.hero .cards h3,
.hero .cards p { margin-left: 1rem; margin-right: 1rem; }

.hero .cards h3 {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  margin-top: 0.7rem;
  margin-bottom: 0.35rem;
}

.hero .cards p { grid-column: 2; grid-row: 2; margin-top: 0; margin-bottom: 0.7rem; }

.hero > div p:first-child {
  margin: 0 0 0.65rem;
  letter-spacing: 0.12em;
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
  color: #e8f4ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 16px rgba(0, 0, 0, 0.55);
}

.hero > div h1 {
  margin: 0 0 0.8rem;
  max-width: 14ch;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
}

.hero > div p:last-of-type {
  margin: 0 0 1.4rem;
  max-width: 46rem;
  color: var(--muted);
}

.intro {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
  gap: 1.25rem 3.25rem;
  padding-top: 3.25rem;
  padding-bottom: 1.5rem;
}

.intro h2 {
  margin: 0 0 0.9rem;
  max-width: 8.2em;
  font-size: clamp(1.65rem, 2.5vw, 2.05rem);
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.intro h2::after { margin-top: 0.75rem; }

.intro p { margin: 0; color: var(--muted); }

.intro > div:first-child p { text-wrap: balance; }

.intro > div:last-child {
  padding-left: 1.35rem;
  border-left: 3px solid var(--blue);
}

.intro > div:last-child p + p { margin-top: 0.9rem; }

.intro > div:last-child p:first-child {
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.45;
}

.button {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.button:hover { background: var(--blue); color: #041018; }

.cards {
  display: grid;
  gap: 0.75rem;
}

.cards article {
  background: #0d1420;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.cards img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.cards h3,
.cards p { margin: 0.85rem 1rem; }

.cards h3 {
  font-size: 1.15rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--blue);
  display: inline-block;
}

.cards p {
  margin-top: 0.7rem;
  margin-bottom: 1.15rem;
  color: var(--muted);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.gallery figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.2s ease;
}

.gallery button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: zoom-in;
}

.gallery button:focus-visible { outline: none; }

.gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.gallery figure:hover,
.gallery figure:focus-within {
  box-shadow:
    0 0 0 1px rgba(47, 157, 255, 0.85),
    0 14px 32px rgba(0, 0, 0, 0.38);
}

.gallery figure:hover img,
.gallery figure:focus-within img { transform: scale(1.05); }

.gallery figcaption {
  position: absolute;
  z-index: 1;
  left: 0.6rem;
  bottom: 0.55rem;
  padding: 0.1rem 0.45rem;
  background: rgba(7, 11, 18, 0.72);
  border-radius: 3px;
  font-size: 0.85rem;
  pointer-events: none;
}

html:has(#lightbox[open]) { overflow: hidden; }

#lightbox {
  width: fit-content;
  max-width: calc(100vw - 1.5rem);
  max-height: calc(100vh - 1.5rem);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
  opacity: 0;
  transition: opacity 0.18s ease, display 0.18s allow-discrete, overlay 0.18s allow-discrete;
}

#lightbox[open] { opacity: 1; }

#lightbox:focus { outline: none; }

@starting-style {
  #lightbox[open] { opacity: 0; }
}

#lightbox::backdrop {
  background: rgba(4, 8, 14, 0.88);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.18s ease, display 0.18s allow-discrete, overlay 0.18s allow-discrete;
}

#lightbox[open]::backdrop { opacity: 1; }

@starting-style {
  #lightbox[open]::backdrop { opacity: 0; }
}

#lightbox figure {
  position: relative;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(47, 157, 255, 0.38),
    0 28px 70px rgba(0, 0, 0, 0.55);
}

#lightbox img {
  width: auto;
  height: auto;
  max-width: min(1040px, calc(100vw - 2rem));
  max-height: calc(100vh - 2.5rem);
}

#lightbox button {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(7, 12, 20, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

#lightbox button:hover,
#lightbox button:focus-visible {
  background: var(--blue);
  color: #041018;
  border-color: transparent;
  outline: none;
}

#lightbox [data-close] { top: 0.75rem; right: 0.75rem; }

#lightbox [data-dir="-1"] { left: 0.75rem; top: 50%; transform: translateY(-50%); }

#lightbox [data-dir="1"] { right: 0.75rem; top: 50%; transform: translateY(-50%); }

#lightbox svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#lightbox figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 2.5rem 1rem 0.85rem;
  background: linear-gradient(transparent, rgba(4, 8, 14, 0.88));
  font-size: 0.95rem;
  line-height: 1.35;
  pointer-events: none;
}

#lightbox [data-count] {
  flex: none;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.partners {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.partners a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 1rem 1.4rem;
  background: #f4f6f8;
  border-radius: 8px;
}

.partners img { height: 42px; width: auto; }

#kontakt p { margin: 0.35rem 0; color: var(--muted); }

footer {
  padding: 1.5rem 1.25rem 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

footer p { margin: 0; }

@keyframes carrier {
  /* % is relative to (100% − background-size); these clear a 42% streak off both edges */
  from { background-position: -75% 0; }
  to { background-position: 175% 0; }
}

@keyframes packet {
  from { cx: -8%; }
  50% { cx: 92%; }
  to { cx: -8%; }
}

@media (prefers-reduced-motion: reduce) {
  header::after,
  .hero::after,
  header svg .packet.go { animation: none; }
  header > a,
  header img,
  .gallery figure,
  .gallery img,
  #lightbox,
  #lightbox::backdrop { transition: none; }
  .gallery figure:hover img,
  .gallery figure:focus-within img { transform: none; }
}

@media (max-width: 980px) {
  header svg { display: none; }
  nav { margin-left: auto; }
}

@media (max-width: 1040px) {
  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .hero #uslugi { width: 100%; flex: none; }

  .hero > div p:last-of-type {
    color: var(--text);
    padding: 0.4rem 0.65rem;
    background: rgba(7, 11, 18, 0.78);
    border-radius: 6px;
  }
}

@media (max-width: 800px) {
  header > a { align-self: center; margin: 0; }
  header img { width: 4.75rem; height: 4.75rem; }

  .hero { padding: 3rem 1.25rem; }

  .hero .cards article { grid-template-columns: 1fr; }

  .hero .cards :is(img, h3, p) { grid-column: auto; grid-row: auto; }

  .hero .cards img {
    width: 100%;
    height: 150px;
    min-height: 0;
  }

  .hero .cards h3 { margin-top: 0.85rem; }
  .hero .cards p { margin-bottom: 1rem; }

  .intro { grid-template-columns: 1fr; gap: 1.35rem; }
  .intro h2 { max-width: 11em; }
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.pager a,
.pager span {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
}

.pager a:hover,
.pager .current {
  border-color: var(--blue);
  color: var(--blue);
}

body.admin header > a { align-self: center; margin: 0; }
body.admin header img { width: 3.25rem; height: 3.25rem; }
body.admin main section { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.admin .error { color: #ffb4b4; }

.admin form.stack {
  display: grid;
  gap: 0.75rem;
  max-width: 36rem;
  margin: 0 0 1.5rem;
}

.admin form.stack label { display: grid; gap: 0.3rem; }

.admin form.stack :is(input[type="text"], input[type="password"], textarea) {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0d1420;
  color: var(--text);
  font: inherit;
}

.admin form.stack textarea { min-height: 7rem; resize: vertical; }

.admin-object {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.admin-object h3 { margin: 0 0 0.3rem; }
.admin-object p { margin: 0 0 0.55rem; color: var(--muted); }
.admin-object form { display: inline; margin: 0 0 0 0.4rem; }

.admin-shot {
  width: 8rem;
  height: 6rem;
  object-fit: cover;
  border-radius: 4px;
}
