* {
  font-family: 'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #080808;
  color: #f0f0f0;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  mix-blend-mode: overlay;
}

/* Odchudzenie renderu: mniej repaintów na słabszych urządzeniach */
@media (max-width: 1024px) {
  body::before {
    opacity: 0.012;
  }
}

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: #080808;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #00d4ff44, #00d4ff22);
  border-radius: 2px;
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #00d4ff 55%, #0099cc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-warm {
  background: linear-gradient(135deg, #f0f0f0 0%, #00d4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow-blue {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3), 0 0 60px rgba(0, 212, 255, 0.1);
}

.glow-blue-strong {
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.5), 0 0 80px rgba(0, 212, 255, 0.2);
}

.glass {
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-elevated {
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Na mobile redukujemy ciężkie blury i cienie */
@media (max-width: 1024px) {
  .glass,
  .glass-dark,
  .glass-elevated {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .glow-blue,
  .glow-blue-strong {
    box-shadow: none;
  }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.4); }
  50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.8), 0 0 80px rgba(0, 212, 255, 0.3); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-10px) rotate(1deg); }
  66% { transform: translateY(-5px) rotate(-1deg); }
}

@keyframes marquee-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes marquee-right {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.animate-pulse-glow {
  animation: pulse-glow 2.5s ease-in-out infinite;
}

.animate-float {
  animation: float 7s ease-in-out infinite;
}

.animate-marquee-left {
  animation: marquee-left 32s linear infinite;
  will-change: transform;
}

.animate-marquee-right {
  animation: marquee-right 28s linear infinite;
  will-change: transform;
}

/* Wolniejsze i płynniejsze animacje na tablet/mobile */
@media (max-width: 1024px) {
  .animate-pulse-glow {
    animation-duration: 4.2s;
  }

  .animate-marquee-left {
    animation-duration: 52s;
  }

  .animate-marquee-right {
    animation-duration: 46s;
  }
}

.marquee-row:hover .animate-marquee-left,
.marquee-row:hover .animate-marquee-right {
  animation-play-state: paused;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Usuwa białe obramowanie focus przy klikaniu menu na mobile/desktop */
button:focus,
button:focus-visible {
  outline: none;
  box-shadow: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

/* Twardy override dla przycisku menu (unikamy białej ramki przy toggle) */
button[class*="rounded-lg"]:focus,
button[class*="rounded-lg"]:focus-visible,
button[class*="rounded-lg"]:active {
  outline: none !important;
  box-shadow: none !important;
}

button[class*="rounded-lg"].glass:focus,
button[class*="rounded-lg"].glass:focus-visible,
button[class*="rounded-lg"].glass:active {
  border-color: rgba(255, 255, 255, 0.07) !important;
}

button[class*="w-10"][class*="h-10"][class*="glass"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  border-color: rgba(255, 255, 255, 0.07) !important;
}

button[class*="w-10"][class*="h-10"][class*="glass"]:focus,
button[class*="w-10"][class*="h-10"][class*="glass"]:focus-visible,
button[class*="w-10"][class*="h-10"][class*="glass"]:active {
  outline: none !important;
  box-shadow: none !important;
  border-color: rgba(255, 255, 255, 0.07) !important;
}

/* Usuwa białą kreskę na górze rozwijanego panelu menu mobile */
[class*="md:hidden"][class*="glass-dark"][class*="border-t"] {
  border-top-color: transparent !important;
}

/* Usuwa białe obramowanie sticky headera przy toggle i scrollu */
header[class*="fixed"][class*="top-0"] {
  border-color: transparent !important;
  box-shadow: none !important;
}

header[class*="fixed"][class*="top-0"][class*="glass-dark"] {
  border-bottom-color: transparent !important;
}

/* Hero: przesunięcie nagłówka "Digital Experiences" niżej */
section#hero h1 {
  transform: translateY(20px);
}

/* Full fallback dla urządzeń z preferencją mniejszego ruchu */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  body::before {
    display: none !important;
  }

  .glow-blue,
  .glow-blue-strong {
    box-shadow: none !important;
  }
}

/* Branding: ukryj tekst obok logo i daj więcej miejsca na samo logo */
header a[href="#hero"] > span,
footer a[href="#hero"] > span {
  display: none !important;
}

header a[href="#hero"] {
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  transform: translateX(-200px) !important;
}

header a[href="#hero"] > div:first-child {
  width: clamp(180px, 20vw, 250px) !important;
  height: clamp(68px, 7.5vw, 92px) !important;
  border-radius: 14px !important;
  padding: 0 !important;
  background: transparent !important;
  border-color: transparent !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 5 !important;
}

header a[href="#hero"] > div:first-child img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  transform: scale(2.25) !important;
  transform-origin: left center !important;
  will-change: transform !important;
}

footer a[href="#hero"] {
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
}

footer a[href="#hero"] > div:first-child {
  width: clamp(150px, 14vw, 190px) !important;
  height: clamp(56px, 5.6vw, 72px) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  background: transparent !important;
  border-color: transparent !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 2 !important;
}

footer a[href="#hero"] > div:first-child img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  transform: scale(2.25) !important;
  transform-origin: left center !important;
  will-change: transform !important;
}

@media (max-width: 768px) {
  header a[href="#hero"] {
    transform: translateX(-120px) !important;
  }

  header a[href="#hero"] > div:first-child {
    width: clamp(150px, 42vw, 190px) !important;
    height: clamp(56px, 15.5vw, 72px) !important;
    border-radius: 11px !important;
    padding: 0 !important;
  }

  footer a[href="#hero"] > div:first-child {
    width: clamp(130px, 34vw, 170px) !important;
    height: clamp(48px, 12.5vw, 64px) !important;
    border-radius: 10px !important;
    padding: 0 !important;
  }
}

/* Ekran ładowania: duże logo z animacją wjazdu i wyjazdu */
#boot-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 600px at 50% 38%, rgba(0, 212, 255, 0.12), #080808 58%);
  opacity: 1;
  transition: opacity 0.62s ease, background 0.45s ease;
  contain: strict;
}

/* Pierwsza sekunda: słabsze świetlenie tła i cienia — mniej mikroprzycięć na starcie */
#boot-splash.boot-splash--early {
  background: radial-gradient(1000px 520px at 50% 40%, rgba(0, 212, 255, 0.06), #080808 62%);
}

#boot-splash.boot-splash--early #boot-splash-logo {
  filter: drop-shadow(0 4px 14px rgba(0, 212, 255, 0.14));
}

#boot-splash.boot-splash--early #boot-splash-progress {
  text-shadow: 0 1px 6px rgba(0, 212, 255, 0.12);
  color: rgba(220, 240, 248, 0.88);
}

#boot-splash-logo {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translate3d(-50%, -50%, 0) scale(1);
  width: min(70vw, 940px);
  max-height: 48vh;
  object-fit: contain;
  filter: drop-shadow(0 10px 26px rgba(0, 212, 255, 0.24));
  opacity: 0;
  will-change: transform, opacity, filter;
}

#boot-splash-logo.is-ready {
  animation: boot-logo-in 0.95s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

#boot-splash.is-exit #boot-splash-logo.is-ready {
  animation: boot-logo-out 0.64s cubic-bezier(0.7, 0, 0.84, 0) both;
}

#boot-splash.is-exit {
  opacity: 0;
}

#boot-splash-progress {
  position: absolute;
  left: 50%;
  top: calc(30% + min(30vw, 220px));
  transform: translateX(-50%);
  margin: 0;
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: rgba(224, 246, 255, 0.94);
  text-shadow: 0 2px 10px rgba(0, 212, 255, 0.22);
  user-select: none;
  pointer-events: none;
  will-change: opacity, transform;
}

@keyframes boot-logo-in {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -36%, 0) scale(0.96);
    filter: drop-shadow(0 4px 14px rgba(0, 212, 255, 0.12));
  }
  55% {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) scale(1.008);
    filter: drop-shadow(0 8px 22px rgba(0, 212, 255, 0.2));
  }
  100% {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) scale(1);
    filter: drop-shadow(0 10px 26px rgba(0, 212, 255, 0.24));
  }
}

@keyframes boot-logo-out {
  0% {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) scale(1);
    filter: drop-shadow(0 10px 26px rgba(0, 212, 255, 0.24));
  }
  100% {
    opacity: 0;
    transform: translate3d(-50%, -72%, 0) scale(0.9);
    filter: drop-shadow(0 4px 12px rgba(0, 212, 255, 0.12));
  }
}

@media (max-width: 768px) {
  #boot-splash-logo {
    top: 28%;
    width: min(88vw, 740px);
  }

  #boot-splash-progress {
    top: calc(28% + min(36vw, 210px));
    font-size: clamp(14px, 4.2vw, 18px);
  }
}

/* Stabilizacja licznika ładowania: brak skakania cyfr i układu */
div[class*="fixed"][class*="inset-0"][class*="z-[100]"] p[class*="font-mono"] {
  display: inline-block !important;
  min-width: 3.5ch !important;
  text-align: center !important;
  font-variant-numeric: tabular-nums !important;
}

/* Stopka: „Ghoosty.pl” + dopisek po najechaniu (fade-in) */
.mm-footer-brand-hover .mm-footer-ghost-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15em;
}

.mm-footer-brand-hover .mm-footer-ghost-suffix {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.38s ease, max-width 0.5s ease;
}

.mm-footer-brand-hover .mm-footer-ghost-line:hover .mm-footer-ghost-suffix,
.mm-footer-brand-hover .mm-footer-ghost-line:focus-within .mm-footer-ghost-suffix {
  opacity: 1;
  max-width: 22rem;
}

@media (hover: none) {
  .mm-footer-brand-hover .mm-footer-ghost-suffix {
    opacity: 1;
    max-width: none;
    white-space: normal;
  }
}
