@import "_mixins";

// ─── Zmienne ────────────────────────────────────────────────────────────────
$bg: hsl(210, 29%, 12%);
$bg-dark: hsl(210, 35%, 8%);
$bg-card: hsl(210, 29%, 15%);
$fg: hsl(210, 40%, 98%);
$primary: hsl(195, 100%, 45%);
$muted: hsl(210, 15%, 60%);
$border: hsl(210, 20%, 22%);
$radius: 0.5rem;

// ─── Reset & base ────────────────────────────────────────────────────────────
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: 'Open Sans', sans-serif;
  background: $bg;
  color: $fg;
  font-size: 16px;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

// ─── Kontener ────────────────────────────────────────────────────────────────
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

// ─── Navbar ──────────────────────────────────────────────────────────────────
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  @include transition(all, .3s, ease);
}

.nav-topbar {
  display: none;
  background: $bg-dark;
  border-bottom: 1px solid rgba($border, .6);

  @include respond-above(sm) {
    display: block;
  }

  .container {
    @include flexbox;
    @include align-items(center);
    padding-top: .5rem;
    padding-bottom: .5rem;
    font-size: .875rem;
    color: $muted;
    gap: 1.5rem;
  }

  a {
    @include flexbox;
    @include align-items(center);
    gap: .4rem;
    @include transition(color, .2s, ease);

    &:hover {
      color: $primary;
    }

    svg {
      flex-shrink: 0;
    }
  }
}

.nav-main {
  position: relative;
  background: rgba(#fff, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  @include transition(box-shadow, .3s, ease);

  &.scrolled {
    @include box-shadow(0 4px 24px rgba(#000, .12));
  }

  .container {
    @include flexbox;
    @include align-items(center);
    @include justify-content(space-between);
    padding-top: .75rem;
    padding-bottom: .75rem;
  }
}

.nav-logo img {
  height: 48px;
  width: auto;
  display: block;

  @include respond-below(sm) {
    height: 40px;
  }
}

// ─── Menu CMS (MENU_GLOWNE) ──────────────────────────────────────────────────
#main-menu {
  @include respond-above(sm) {
    display: block;
  }

  @include respond-below(sm) {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(#fff, .97);
    backdrop-filter: blur(8px);
    border-top: 1px solid #e5e5e5;
    z-index: 99;

    &.visible {
      display: block;
    }
  }

  ul {
    list-style: none;
    margin: 0;
    padding: 0;

    @include respond-above(sm) {
      @include flexbox;
      @include align-items(center);
      gap: 2rem;
    }

    @include respond-below(sm) {
      @include flexbox;
      @include flex-direction(column);
      padding: 1rem 1.5rem;
      gap: .25rem;
    }
  }

  li {
    list-style: none;
  }

  a {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: .8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #555;
    @include transition(color, .2s, ease);

    &:hover {
      color: $primary;
    }

    @include respond-below(sm) {
      padding: .6rem 0;
      font-size: .875rem;
      border-bottom: 1px solid #f0f0f0;
    }
  }

  li.active>a {
    color: $primary;
  }
}

#main-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  @include flex-direction(column);
  gap: 5px;

  @include respond-below(sm) {
    @include flexbox;
  }

  span {
    display: block;
    width: 24px;
    height: 2px;
    background: #444;
    @include transition(all, .3s, ease);
  }

  &.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  &.active span:nth-child(2) {
    opacity: 0;
  }

  &.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

// ─── Hero ─────────────────────────────────────────────────────────────────────
#home {
  position: relative;
  min-height: 100vh;
  @include flexbox;
  @include align-items(center);
  @include justify-content(center);
  overflow: hidden;

  video.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        hsl(210, 35%, 8%, .88) 0%,
        hsl(210, 29%, 12%, .75) 50%,
        hsl(210, 25%, 18%, .6) 100%);
  }

  .hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    padding: 0 1.5rem;
  }

  .hero-eyebrow {
    font-family: 'Montserrat', sans-serif;
    font-size: .875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3em;
    color: $primary;
    margin-bottom: 1.5rem;

    @include respond-above(sm) {
      font-size: 1rem;
    }
  }

  h1 {
    font-size: clamp(2.25rem, 7vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: $fg;
  }

  .text-gradient {
    background: linear-gradient(90deg, $primary, hsl(180, 80%, 55%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .hero-desc {
    font-size: 1rem;
    color: $muted;
    max-width: 560px;
    margin: 0 auto 2.5rem;
    line-height: 1.75;

    @include respond-above(sm) {
      font-size: 1.125rem;
    }
  }

  .hero-buttons {
    @include flexbox;
    @include flex-wrap(wrap);
    @include align-items(center);
    @include justify-content(center);
    gap: 1rem;
  }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: $primary;
  color: hsl(210, 29%, 8%);
  padding: 1rem 2rem;
  @include border-radius($radius);
  font-family: 'Montserrat', sans-serif;
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  @include box-shadow(0 4px 20px rgba($primary, .3));
  @include transition(filter, .2s, ease);

  &:hover {
    filter: brightness(1.1);
  }
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid rgba($fg, .3);
  color: $fg;
  padding: 1rem 2rem;
  @include border-radius($radius);
  font-family: 'Montserrat', sans-serif;
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  @include transition(all, .2s, ease);

  &:hover {
    border-color: $primary;
    color: $primary;
  }
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: $muted;
  @include transition(color, .2s, ease);
  animation: bounce 2s infinite;

  &:hover {
    color: $primary;
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

// ─── O nas ────────────────────────────────────────────────────────────────────
#about {
  padding: 6rem 0;
  background: $bg-dark;

  .about-grid {
    display: grid;
    gap: 4rem;
    @include align-items(center);

    @include respond-above(md) {
      grid-template-columns: 1fr 1fr;
    }
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.stat-card {
  background: $bg-card;
  padding: 1.5rem;
  @include border-radius($radius);
  border: 1px solid $border;
  text-align: center;

  .stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.875rem;
    font-weight: 800;
    color: $primary;
    margin-bottom: .25rem;
  }

  .stat-label {
    font-size: .875rem;
    color: $muted;
  }
}

.about-text {
  h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;

    span {
      color: $primary;
    }
  }

  p {
    color: $muted;
    line-height: 1.75;
    margin: 0 0 1.5rem;
  }
}

.highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  @include flexbox;
  @include flex-direction(column);
  gap: .75rem;

  li {
    @include flexbox;
    @include align-items(center);
    gap: .75rem;
    font-size: .9375rem;
    color: rgba($fg, .9);

    svg {
      flex-shrink: 0;
      color: $primary;
    }
  }
}

// ─── Usługi ──────────────────────────────────────────────────────────────────
#services {
  padding: 6rem 0;
  background: linear-gradient(180deg, $bg 0%, $bg-dark 100%);

  .section-header {
    text-align: center;
    margin-bottom: 4rem;

    h2 {
      font-size: clamp(1.75rem, 4vw, 2.5rem);
      font-weight: 700;
      margin-bottom: 1rem;

      span {
        color: $primary;
      }
    }
  }

  .services-grid {
    display: grid;
    gap: 1.5rem;

    @include respond-above(xs) {
      grid-template-columns: 1fr 1fr;
    }

    @include respond-above(md) {
      grid-template-columns: repeat(4, 1fr);
    }
  }
}

.service-card {
  background: $bg-card;
  padding: 2rem;
  @include border-radius($radius);
  border: 1px solid $border;
  @include transition(border-color, .3s, ease);

  &:hover {
    border-color: rgba($primary, .4);

    .service-icon {
      background: rgba($primary, .2);
    }
  }
}

.service-icon {
  width: 56px;
  height: 56px;
  @include border-radius($radius);
  background: rgba($primary, .1);
  @include flexbox;
  @include align-items(center);
  @include justify-content(center);
  margin-bottom: 1.25rem;
  @include transition(background, .3s, ease);
  color: $primary;
}

.service-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: .75rem;
}

.service-card p {
  font-size: .9375rem;
  color: $muted;
  line-height: 1.7;
  margin: 0;
}

// ─── Kontakt ─────────────────────────────────────────────────────────────────
#contact {
  padding: 6rem 0;
  background: linear-gradient(180deg, $bg 0%, $bg-dark 100%);

  .section-header {
    text-align: center;
    margin-bottom: 4rem;

    h2 {
      font-size: clamp(1.75rem, 4vw, 2.5rem);
      font-weight: 700;
      margin-bottom: 1rem;

      span {
        color: $primary;
      }
    }
  }

  .contact-grid {
    display: grid;
    gap: 2rem;
    max-width: 700px;
    margin: 0 auto;

    @include respond-above(xs) {
      grid-template-columns: repeat(3, 1fr);
    }
  }
}

.contact-card {
  background: $bg-card;
  padding: 2rem;
  @include border-radius($radius);
  border: 1px solid $border;
  text-align: center;
  @include transition(border-color, .3s, ease);
  display: block;

  &:hover {
    border-color: rgba($primary, .4);

    svg {
      transform: scale(1.1);
    }
  }

  svg {
    color: $primary;
    @include transition(transform, .3s, ease);
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }

  .contact-label {
    font-size: .875rem;
    color: $muted;
    margin-bottom: .25rem;
  }

  .contact-value {
    font-size: .9375rem;
    font-weight: 600;
    color: $fg;
    display: block;
  }
}

// ─── Glow line ───────────────────────────────────────────────────────────────
.glow-line {
  width: 64px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba($primary, .6), transparent);
  margin: 0 auto;
}

// ─── Footer ──────────────────────────────────────────────────────────────────
footer {
  background: $bg;
  border-top: 1px solid rgba($border, .5);
  padding: 2.5rem 0;

  .footer-main {
    @include flexbox;
    @include flex-direction(column);
    @include align-items(center);
    gap: 1.5rem;
    text-align: center;

    @include respond-above(sm) {
      @include flex-direction(row);
      @include justify-content(space-between);
      text-align: left;
    }
  }

  .footer-logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.02em;

    span:first-child {
      color: $fg;
    }

    span.accent {
      color: $primary;
    }
  }

  .footer-tagline {
    font-size: .75rem;
    color: $muted;
    margin-top: .25rem;
  }

  .footer-links {
    @include flexbox;
    @include align-items(center);
    gap: 1.5rem;
    font-size: .9375rem;
    color: $muted;

    a {
      @include flexbox;
      @include align-items(center);
      gap: .4rem;
      @include transition(color, .2s, ease);

      &:hover {
        color: $primary;
      }
    }
  }

  .footer-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba($border, .5);
    @include flexbox;
    @include flex-direction(column);
    @include align-items(center);
    gap: .5rem;
    text-align: center;
    font-size: .8125rem;
    color: $muted;

    @include respond-above(sm) {
      @include flex-direction(row);
      @include justify-content(space-between);
    }

    a:hover {
      color: $primary;
    }
  }
}

// ─── Cookie bar (CMS) ────────────────────────────────────────────────────────
#cookie-information {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: $bg-card;
  border-top: 1px solid $border;
  padding: 1rem 1.5rem;
  @include flexbox;
  @include align-items(center);
  @include justify-content(space-between);
  gap: 1rem;
  font-size: .875rem;
  color: $muted;

  @include flexbox;
  @include flex-wrap(wrap);

  a {
    color: $primary;
  }

  button,
  .cookie-accept {
    background: $primary;
    color: hsl(210, 29%, 8%);
    border: none;
    padding: .5rem 1.25rem;
    @include border-radius($radius);
    font-family: 'Montserrat', sans-serif;
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
}