@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  /* Geoworks Theme mapping based on Antigravity aesthetics */
  --bg-color: #0e0e0e;
  --bg-secondary: #161616;
  --text-primary: #f5f5f5;
  --text-secondary: #888888;

  --accent-orange: #ff571f;
  --accent-orange-dim: #af3000;

  --border-color: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.25);

  --nav-height: 80px;

  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

:root[data-theme="light"] {
  --bg-color: #f5f5f7;
  --bg-secondary: #eaeaef;
  --text-primary: #111111;
  --text-secondary: #555555;
  --border-color: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: 'Manrope', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--accent-orange);
  color: #fff;
}

/* ==========================================================================
   Loading Screen
   ========================================================================== */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #161616;
  /* Ciemne tło */
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s var(--ease-out-expo), visibility 0.8s var(--ease-out-expo);
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  width: 120px;
  height: auto;
  animation: spin-logo 3s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.15));
}

@keyframes spin-logo {
  0% {
    transform: rotate(0deg) scale(0.9);
  }

  50% {
    transform: rotate(180deg) scale(1.1);
  }

  100% {
    transform: rotate(360deg) scale(0.9);
  }
}

/* ==========================================================================
   Typography (Antigravity Style)
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.title-huge {
  font-size: clamp(4rem, 10vw, 12rem);
  white-space: nowrap;
}

.title-lg {
  font-size: clamp(3rem, 6vw, 7rem);
}

.title-md {
  font-size: clamp(2rem, 4vw, 4rem);
}

.title-sm {
  font-size: clamp(1.2rem, 2vw, 2.5rem);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

p {
  line-height: 1.6;
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 600px;
}

/* ==========================================================================
   Layout & Sections
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 4vw;
}

section {
  padding: 15vh 0;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  z-index: 100;
  mix-blend-mode: difference;
  color: #fff;
  transition: transform 0.6s var(--ease-out-expo);
}

.navbar.hidden {
  transform: translateY(-100%);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.nav-brand img {
  height: 32px;
  filter: brightness(0) invert(1);
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-links a {
  text-decoration: none;
  color: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: translateX(-100%);
  transition: transform 0.4s var(--ease-out-expo);
}

.nav-links a:hover::after {
  transform: translateX(0);
}

.theme-toggle {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero {
  padding-top: var(--nav-height);
  align-items: flex-start;
  justify-content: flex-end;
  padding-bottom: 10vh;
}

.hero-sub {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  margin-top: 5vh;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.hero-sub .mono {
  max-width: 300px;
}

/* ==========================================================================
   Grid & Layout Utilities
   ========================================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4vw;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4vw;
}

/* ==========================================================================
   Services Section
   ========================================================================== */
.services-list {
  margin-top: 8vh;
}

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4vh 0;
  border-bottom: 1px solid var(--accent-orange);
  transition: background-color 0.4s;
  position: relative;
  overflow: hidden;
}

.service-item:first-child {
  border-top: 1px solid var(--accent-orange);
}

.service-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--accent-orange);
  transform: translateY(102%);
  transition: transform 0.5s var(--ease-out-expo);
  z-index: 0;
}

.service-item:hover::before {
  transform: translateY(0);
}

.service-item>* {
  position: relative;
  z-index: 1;
  transition: color 0.4s;
}

.service-item:hover>* {
  color: #fff;
}

.service-item h3 {
  font-size: clamp(1.5rem, 3vw, 3.5rem);
  margin: 0;
}

.service-item .mono {
  font-size: 1rem;
}

/* ==========================================================================
   Realizations / Images
   ========================================================================== */
/* ==========================================================================
   Realizations / Images (Immersive Clean Sticky Showcase Dashboard)
   ========================================================================== */
.realizacje-section {
  position: relative;
  background-color: var(--bg-color);
  height: 400vh;
  /* 4x window height for sticky scroll space */
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  transition: background-color 0.6s var(--ease-out-expo);
}

.realizacje-dashboard {
  display: grid;
  grid-template-columns: 1.15fr 1.85fr;
  /* clean 2-column layout */
  gap: 4vw;
  margin-top: 5vh;
  align-items: start;
  width: 100%;
}

/* Left Column: Technical Menu */
.showcase-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.showcase-menu-item {
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 1.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  color: var(--text-secondary);
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.showcase-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background-color: var(--accent-orange);
  transform: scaleY(0);
  transition: transform 0.4s var(--ease-out-expo);
  transform-origin: bottom center;
}

.showcase-menu-item:hover,
.showcase-menu-item.active {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom-color: var(--border-strong);
  padding-left: 1.5rem;
}

.showcase-menu-item.active::before {
  transform: scaleY(1);
}

.showcase-menu-item .item-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-orange);
  transition: transform 0.4s var(--ease-out-expo);
}

.showcase-menu-item:hover .item-num {
  transform: translateX(3px);
}

.showcase-menu-item .item-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(0.95rem, 1vw, 1.2rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* Right Column: Viewport */
.viewport-column {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.viewport-box {
  width: 100%;
  height: 520px;
  background-color: #050505;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.4s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.viewport-box:hover {
  border-color: var(--border-strong);
}

/* Image preview card with 3D tilt logic */
.viewport-preview-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(1.05) translateZ(-20px);
  pointer-events: none;
  z-index: 5;
}

.viewport-preview-card.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateZ(0);
}

.viewport-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}



/* Details layout */
.viewport-details {
  position: relative;
  min-height: 200px;
}

.viewport-detail-block {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  display: none;
  transition: opacity 0.6s ease;
}

.viewport-detail-block.active {
  opacity: 1;
  visibility: visible;
  display: block;
  position: relative;
}

.detail-title {
  font-size: clamp(1.6rem, 2.2vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}

.detail-desc {
  font-size: clamp(1rem, 1.1vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 900px;
  line-height: 1.65;
  margin: 0;
}

/* ==========================================================================
   About Section & Sticky Scroll
   ========================================================================== */
/* Default (Dark Mode active) -> About section is light (pure white) */
.about-section {
  position: relative;
  background-color: #ffffff;
  color: #111111;
  height: 300vh;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  /* Force block to prevent flexbox vertical centering gap */
  transition: background-color 0.6s var(--ease-out-expo), color 0.6s var(--ease-out-expo);
}

.sticky-content {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100vh;
  max-width: 1800px;
  margin: 0 auto;
  padding: 12vh 4vw;
}

.about-main-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 6vw;
  align-items: stretch;
  /* Rozciąga kolumny tak, aby miały dokładnie tę samą wysokość */
  width: 100%;
}

.about-text-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.about-text-col .mono {
  color: #555555 !important;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.about-text-col .title-md {
  font-size: clamp(2.2rem, 3.8vw, 4.5rem);
  line-height: 1.05;
  margin-bottom: 2rem;
  color: #111111 !important;
  letter-spacing: -0.04em;
  font-weight: 800;
  margin-top: 0;
}

.about-desc {
  font-size: clamp(0.95rem, 1.1vw, 1.15rem);
  line-height: 1.65;
  color: #444444 !important;
  max-width: 580px;
  margin-bottom: 0;
  text-align: justify;
}

.about-visual-col {
  position: relative;
  /* Relatywne pozycjonowanie, aby canvas odnosił się do tej kolumny */
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 420px;
  /* Prevent vertical canvas edge clipping */
}

#ratusz-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150vw !important;
  /* Huge width to prevent invisible box clipping */
  height: 150vh !important;
  /* Huge height to prevent invisible box clipping */
  z-index: 1;
  pointer-events: none;
}

.about-divider {
  width: 100%;
  height: 1px;
  background-color: rgba(255, 87, 31, 0.4);
  margin: 4vh 0;
}

.about-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 4vw;
  width: 100%;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-card .stat-number {
  font-size: clamp(4.5rem, 8vw, 8.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--accent-orange);
  margin-bottom: 1rem;
  font-feature-settings: "tnum";
}

.stat-card .mono {
  font-size: clamp(0.7rem, 0.8vw, 0.9rem);
  color: #555555 !important;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Kiedy włączony jest tryb jasny (data-theme="light") -> Sekcja "O nas" ma tło czarne */
:root[data-theme="light"] .about-section {
  background-color: #0e0e0e;
  color: #f5f5f5;
}

:root[data-theme="light"] .about-section .about-text-col .title-md {
  color: #ffffff !important;
}

:root[data-theme="light"] .about-section .about-text-col .mono {
  color: #aaaaaa !important;
}

:root[data-theme="light"] .about-section .about-desc {
  color: #cccccc !important;
}

:root[data-theme="light"] .about-section .about-divider {
  background-color: rgba(255, 255, 255, 0.15);
}

:root[data-theme="light"] .about-section .stat-card .mono {
  color: #aaaaaa !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 10vh 0 5vh;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.footer-huge {
  font-size: clamp(3rem, 8vw, 10rem);
  text-align: center;
  letter-spacing: -0.05em;
  margin-bottom: 5vh;
}

/* Stylizacja wielkiego minimalistycznego przycisku KONTAKT */
.kontakt-btn-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 8vh;
}

.huge-kontakt-btn {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: clamp(2rem, 3.5vw, 4.5rem);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  border: 1px solid var(--border-color);
  padding: 1.5rem 4rem;
  border-radius: 0;
  /* flat/sharp edges */
  transition: all 0.5s var(--ease-out-expo);
  background-color: transparent;
  cursor: pointer;
  letter-spacing: -0.02em;
}

.huge-kontakt-btn .arrow {
  color: var(--accent-orange);
  transition: transform 0.5s var(--ease-out-expo);
}

.huge-kontakt-btn:hover {
  border-color: var(--accent-orange);
  background-color: rgba(255, 87, 31, 0.03);
  padding-left: 5rem;
  padding-right: 3rem;
}

.huge-kontakt-btn:hover .arrow {
  transform: translateY(10px);
}

/* Stylizacja ultra-minimalistycznego formularza kontaktowego */
.contact-form-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2vw;
  scroll-margin-top: 120px;
  /* offset for smooth scrolling to section */

  /* Hidden by default for interactive reveal */
  display: none;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1), transform 0.8s cubic-bezier(0.19, 1, 0.22, 1), margin-bottom 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  position: relative;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.form-group {
  position: relative;
  display: flex;
  flex-direction: column;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 0;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  outline: none;
  transition: border-color 0.3s ease;
}

.form-group textarea {
  resize: none;
}

.form-group label {
  position: absolute;
  left: 0;
  top: 12px;
  pointer-events: none;
  transition: all 0.4s var(--ease-out-expo);
  color: var(--text-secondary);
  transform-origin: left top;
}

/* Floating label effect on focus or when input is not empty */
.form-group input:focus~label,
.form-group input:not(:placeholder-shown)~label,
.form-group textarea:focus~label,
.form-group textarea:not(:placeholder-shown)~label {
  transform: translateY(-26px) scale(0.8);
  color: var(--accent-orange);
  font-weight: 700;
}

.input-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background-color: var(--accent-orange);
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-out-expo);
  transform-origin: left center;
}

.form-group input:focus~.input-bar,
.form-group textarea:focus~.input-bar {
  transform: scaleX(1);
}

.submit-btn {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 1.2rem 3rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
  border-radius: 0;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--accent-orange);
  transform: translateY(102%);
  transition: transform 0.5s var(--ease-out-expo);
  z-index: 0;
}

.submit-btn:hover::before {
  transform: translateY(0);
}

.submit-btn:hover {
  border-color: var(--accent-orange);
  color: #fff;
}

.submit-btn span {
  position: relative;
  z-index: 1;
}

/* Success notification message */
.form-success-message {
  text-align: center;
  padding: 4rem 2rem;
  border: 1px solid var(--accent-orange);
  background-color: rgba(255, 87, 31, 0.02);
  display: none;
  animation: formFadeIn 0.8s var(--ease-out-expo) forwards;
}

.form-success-message h3 {
  font-size: 2.2rem;
  color: var(--accent-orange);
  margin-bottom: 1.5rem;
}

.form-success-message p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 auto;
  max-width: 500px;
}

@keyframes formFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  .huge-kontakt-btn {
    width: 100%;
    justify-content: center;
    padding: 1.2rem 2.5rem;
  }
}

/* ==========================================================================
   Animations (Intersection Observer Classes)
   ========================================================================== */
.reveal-text-mask {
  overflow: hidden;
  display: inline-block;
  vertical-align: top;
}

.reveal-text-inner {
  display: inline-block;
  transform: translateY(110%) rotate(5deg);
  opacity: 0;
  transform-origin: left bottom;
  transition: transform 1.2s var(--ease-out-expo), opacity 1s var(--ease-out-expo);
}

.is-visible .reveal-text-inner {
  transform: translateY(0) rotate(0);
  opacity: 1;
}

.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease-out-quart), transform 1s var(--ease-out-quart);
}

.is-visible .fade-up,
.is-visible.fade-up {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  transition-delay: 0.1s;
}

.delay-2 {
  transition-delay: 0.2s;
}

.delay-3 {
  transition-delay: 0.3s;
}

/* Custom Cursor - Desktop hover only to prevent mobile top-left dot */
.custom-cursor {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  * {
    cursor: none !important;
  }

  .custom-cursor {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--accent-orange);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background-color 0.3s;
    mix-blend-mode: difference;
  }

  .custom-cursor.hover {
    width: 60px;
    height: 60px;
    background-color: #fff;
  }
}

@media (max-width: 1100px) {
  .hide-mobile {
    display: none !important;
  }

  /* Enforce Full-Height Hero Section on Mobile to prevent premature services section view */
  .hero {
    height: 100vh !important;
    min-height: 100vh !important;
    padding-top: var(--nav-height) !important;
    padding-bottom: 6vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  /* Nav Actions & Mobile Menu Toggle */
  .nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 102;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 105;
  }

  .hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transition: transform 0.4s var(--ease-out-expo), opacity 0.4s var(--ease-out-expo);
  }

  /* Hamburger Active Animation */
  .menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Mobile Fullscreen Glassmorphic Menu Overlay */
  .nav-links {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(14, 14, 14, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 95;
    gap: 3.5rem;
    transform: translateY(-100%);
    transition: transform 0.6s var(--ease-out-expo);
    padding: 20vh 8vw 10vh;
  }

  :root[data-theme="light"] .nav-links {
    background: rgba(245, 245, 247, 0.97);
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .nav-links a {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s var(--ease-out-quart), transform 0.5s var(--ease-out-quart);
  }

  /* Cascade link reveal animation when active */
  .nav-links.active a {
    opacity: 1;
    transform: translateY(0);
  }

  .nav-links.active a:nth-child(1) {
    transition-delay: 0.1s;
  }

  .nav-links.active a:nth-child(2) {
    transition-delay: 0.18s;
  }

  .nav-links.active a:nth-child(3) {
    transition-delay: 0.26s;
  }

  .nav-links.active a:nth-child(4) {
    transition-delay: 0.34s;
  }

  /* Grid System on Mobile */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 6vh;
  }

  section {
    padding: 10vh 0;
    min-height: auto;
  }

  /* RESTORE AND TIGHTEN STICKY SCROLL ON MOBILE - PREVENT TOP/BOTTOM CLIPPING */
  .about-section {
    height: 300vh !important;
    display: block !important;
  }

  .realizacje-section {
    height: 400vh !important;
    display: block !important;
  }

  .sticky-content {
    position: sticky !important;
    top: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    /* Use dvh to account for mobile browser UI */
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .about-container {
    padding: 12vh 6vw 10vh 6vw !important;
    /* Explicitly guarantees space above the first text and below the last stats */
    width: 100% !important;
    height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 2vh !important;
  }

  .about-main-row {
    grid-template-columns: 1fr;
    gap: 2vh;
    flex: 1;
    /* take remaining space */
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .about-text-col {
    z-index: 2;
    /* keep text above canvas */
  }

  .about-visual-col {
    position: relative !important;
    width: 100%;
    flex: 1;
    /* flex to take up middle space */
    min-height: 200px;
    /* Safe minimum */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0;
  }

  #ratusz-canvas {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 150vw !important;
    /* Prevent invisible box clipping */
    height: 80vh !important;
    /* Prevent invisible box clipping */
  }

  .about-text-col .mono {
    margin-bottom: 0.4rem !important;
    /* Tighten for mobile viewports */
  }

  .about-text-col .title-md {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: 0.6rem !important;
    /* Tighten for mobile viewports */
    margin-top: 0 !important;
  }

  .about-desc {
    font-size: clamp(0.78rem, 2.2vw, 0.9rem) !important;
    /* Slightly more compact to guarantee stats fit */
    line-height: 1.45 !important;
  }

  .about-divider {
    margin: 1.2vh 0 !important;
    /* Compact spacing */
  }

  .about-stats-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 2vw;
  }

  .stat-card .stat-number {
    font-size: clamp(2rem, 7vw, 3.8rem);
    margin-bottom: 0.2rem;
  }

  .stat-card .mono {
    font-size: clamp(0.55rem, 1.5vw, 0.75rem);
  }

  /* Responsive Dashboard: Restore Sticky and keep fit */
  .realizacje-section .container {
    padding: 12vh 6vw 10vh 6vw !important;
    height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  .realizacje-dashboard {
    grid-template-columns: 1fr;
    gap: 1.5vh;
    margin-top: 1vh;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .showcase-menu {
    flex-direction: row;
    display: flex;
    overflow: visible;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: max-content !important;
    will-change: transform;
    pointer-events: none;
    /* Prevent manual swiping from interfering */
  }

  .showcase-menu-item {
    pointer-events: auto;
    /* allow clicks on items */
  }

  .showcase-menu::-webkit-scrollbar {
    display: none;
  }

  .showcase-menu-item {
    flex: 0 0 auto;
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    width: auto;
    white-space: nowrap;
    background: rgba(10, 10, 10, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .showcase-menu-item::before {
    display: none;
  }

  .showcase-menu-item:hover,
  .showcase-menu-item.active {
    padding-left: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-orange);
  }

  /* Clean smaller viewport box height on mobile to prevent clipping */
  .viewport-box {
    height: 180px;
  }

  .viewport-column {
    gap: 1vh;
  }

  .viewport-details {
    min-height: auto;
  }

  .detail-title {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    margin-bottom: 0.5rem;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .detail-desc,
  .about-desc {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    line-height: 1.5;
    text-align: justify !important;
    text-justify: inter-word !important;
    word-break: break-word !important;
    hyphens: auto !important;
    -webkit-hyphens: auto !important;
    -ms-hyphens: auto !important;
  }
}

/* Specific Phone Responsiveness fixes */
@media (max-width: 768px) {

  /* Fix vertical container centering inside Full-Height Hero Section */
  .hero .container {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    /* Center vertically on mobile */
    align-items: flex-start !important;
    padding-top: var(--nav-height) !important;
    padding-bottom: 4vh !important;
  }

  /* Prevent title clipping/overflow - Majestic Big Font */
  .title-huge {
    font-size: clamp(2.6rem, 10.5vw, 4.5rem) !important;
    line-height: 1.05;
    white-space: nowrap;
    letter-spacing: -0.04em;
    margin-bottom: 1.5vh;
  }

  .reveal-text-mask {
    display: inline-block;
    width: 100%;
    overflow: visible;
  }

  .reveal-text-inner {
    display: inline-block;
    width: 100%;
    transform: none !important;
    opacity: 1 !important;
  }

  /* Stacking Hero sub details vertically */
  .hero-sub {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
    margin-top: 2vh;
    padding-top: 1.2rem;
  }

  .hero-sub .mono {
    max-width: 100%;
    font-size: 0.8rem;
    line-height: 1.4;
  }

  /* Reflow Service Items list layout */
  .service-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 2.5vh 0;
  }

  .service-item h3 {
    font-size: clamp(1.2rem, 5vw, 1.6rem) !important;
  }

  .service-item .mono {
    font-size: 0.8rem;
  }

  /* Contact Form spacing */
  .contact-form {
    gap: 2.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .huge-kontakt-btn {
    width: 100%;
    justify-content: center;
    padding: 1.2rem 2rem;
  }

  /* Showcase Menu Item card-based wrapping on small screens to prevent clipping */
  .showcase-menu-item {
    white-space: normal !important;
    max-width: 190px !important;
    flex: 0 0 180px !important;
    /* give it a fixed flex width so they are equal cards! */
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding: 0.6rem 0.8rem !important;
    gap: 6px !important;
    min-height: 82px !important;
    /* fluid minimum height instead of locked height to prevent vertical clipping */
    height: auto !important;
  }

  .showcase-menu-item .item-title {
    font-size: 0.65rem !important;
    line-height: 1.25 !important;
  }

  .showcase-menu-item .item-num {
    font-size: 0.75rem !important;
    margin-bottom: 2px !important;
  }
}

@media (min-width: 1101px) {
  .showcase-menu {
    transform: none !important;
    /* Reset inline JS transform when resizing back to desktop */
  }
}