:root {
  --bg-main: #f4f7fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-footer: #e9eef6;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --input-bg: #ffffff;
}

body.dark {
  --bg-main: #0f172a;
  --bg-secondary: #111827;
  --bg-card: #1e293b;
  --bg-footer: #0b1220;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  --accent: #6366f1;
  --accent-hover: #4f46e5;

  --input-bg: #1e293b;
}

a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: background 0.3s, color 0.3s;
  padding-top: 60px;
  background: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
}

body:not(.dark) {
  background-image:
    radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.12), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(56, 189, 248, 0.10), transparent 35%);
}

h2 {
  padding: 1rem;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--bg-secondary);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body.dark .navbar {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body:not(.dark) .navbar {
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.nav-container {
  max-width: 960px;
  margin: auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-main);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--text-main);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text-main);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.step-num {
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.5rem;
}

@media (max-width: 768px) {

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(99, 102, 241, 0.15);
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
  }

  .nav-links.active {
    max-height: 350px;
    opacity: 1;
  }

  .nav-links a {
    padding: 1rem 0;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .steps-grid {
    display: flex !important;
    flex-direction: column;
    gap: 2rem;
    align-items: stretch;
  }
}

ul {
  padding-top: 12px;
  list-style-type: none;
}

ul li {
  margin-bottom: 7px;
}

.theme-toggle {
  font-size: 1.2rem;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  outline: none;
  transition: color 0.3s, outline 0.2s;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

/* Hero */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("pics/tech-bg.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: color-burn;
}

@supports (-webkit-touch-callout: none) {
  .hero::before {
    background-attachment: scroll;
  }
}

.hero {
  position: relative;
  min-height: calc(100vh - 60px);
  min-height: calc(100svh - 60px);
  min-height: calc(100dvh - 60px);
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(110deg, #6366f1, #8b5cf6, #b14279, #e63a93, #60a5fa);
  background-size: 600% 600%;
  animation: gradientMove 15s ease-in-out infinite;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-photo {
  position: absolute;
  right: 5%;
  bottom: 0;
  height: 90%;
  display: flex;
  align-items: flex-end;
  z-index: 1;
  pointer-events: none;
}

.hero-photo img {
  height: 100%;
  max-height: 1000px;
  object-fit: contain;
  opacity: 0.9;
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

@media (max-width: 1500px) {
  .hero {
    flex-direction: column-reverse;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 3rem 1.5rem;
    height: auto;
    min-height: calc(100vh - 60px);
    min-height: calc(100svh - 60px);
    min-height: calc(100dvh - 60px);
  }

  .hero::before {
    mix-blend-mode: normal;
    opacity: 0.15;

  }

  .hero-content {
    max-width: 100%;
    z-index: 2;
  }

  .hero-photo {
    position: relative;
    right: auto;
    bottom: auto;
    height: auto;
    margin-bottom: 2rem;
    justify-content: center;
  }

  .hero-photo img {
    height: 700px;
    max-height: none;
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
  }
}

@media (max-width: 768px) {
  .hero-photo img {
    height: min(62vh, 480px);
    height: min(62svh, 480px);
    height: min(62dvh, 480px);
    max-width: 90vw;
  }

  .hero-content h1 {
    font-size: 2.6rem;
  }

  .hero-content p {
    font-size: 1.2rem;
  }
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }

  20% {
    background-position: 60% 40%;
  }

  40% {
    background-position: 90% 60%;
  }

  60% {
    background-position: 40% 80%;
  }

  80% {
    background-position: 70% 30%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.hero-content h1 {
  font-size: 3.5rem;
}

.hero-content p {
  font-size: 1.5rem;
  margin: 1rem 0 2rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.3s ease, transform 0.2s ease;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

body:not(.dark) .btn {
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.18);
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* Layout */
.section {
  padding: 1rem 0;
  border-radius: 1rem;
}

.section h2 {
  margin-bottom: 1rem;
}

.bg-alt {
  transition: background 0.3s ease;
}

.container {
  max-width: 960px;
  margin: 2rem auto;
  text-align: center;
  padding: 0 2rem;
}

.container.wide {
  max-width: 1200px;
  padding: 0 2rem;
}

.project-grid,
.steps-grid,
.pricing-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: stretch;
}

.project-card-s {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 280px;
}

.project-grid {
  justify-content: center;
  cursor: default;
}

.portfolio-grid {
  text-align: center;
}

.portfolio-grid>a {
  display: flex;
  justify-content: center;
  flex: 1 1 280px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  align-items: stretch;
}

.project-card-s p {
  max-width: 95%;
}

.projects-border {
  overflow: hidden;
  border-radius: 1rem;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

body:not(.dark) .projects-border {
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.project-card-s {
  background: var(--bg-card);
  cursor: default;
  color: white;
  border-radius: 1rem;
  flex: 1;
  min-height: 280px;
  height: auto;
  position: relative;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.55),
      rgba(0, 0, 0, 0.55)),
    var(--bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 1.75rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.portfolio-card {
  background-image:
    linear-gradient(rgba(10, 18, 34, 0.62), rgba(10, 18, 34, 0.62)),
    var(--bg, url("pics/tech-bg.webp"));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #f8fafc;
  padding: 2rem;
  border-radius: 1rem;
  min-height: 300px;
  flex: 1 1 auto;
  min-width: 250px;
  max-width: none;
  width: 100%;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(99, 102, 241, 0.15);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.portfolio-card>* {
  position: relative;
  z-index: 1;
}

.portfolio-grid>a:nth-child(1) .portfolio-card {
  --bg: url("pics/server.jpg");
}

.portfolio-grid>a:nth-child(2) .portfolio-card {
  --bg: url("pics/swim.jpg");
}

.portfolio-grid>a:nth-child(3) .portfolio-card {
  --bg: url("pics/globe.webp");
}

body:not(.dark) .portfolio-card,
body:not(.dark) .pricing-card {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  border-color: rgba(99, 102, 241, 0.18);
}

body:not(.dark) .pricing-card.recommended {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.2);
}

body:not(.dark) .portfolio-card:hover,
body:not(.dark) .pricing-card:hover {
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.16);
}

.portfolio-card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 15px rgba(99, 102, 241, 0.5);
}

a {
  text-decoration: none;
}

.cookie-link,
.footer-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-link:hover,
.footer-link:hover {
  color: var(--accent-hover);
}

/* Contact */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 1rem;
  border: none;
  border-radius: 0.5rem;
  background-color: var(--input-bg);
  color: var(--text-main);
  font-size: 1rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #9ca3af;
}

.footer {
  background: var(--bg-footer);
  color: var(--text-muted);
  padding: 2rem 0;
  text-align: center;
  border-radius: 1rem;
  font-size: 0.9rem;
}

.footer-link {
  margin-left: 0.7rem;
}

.policy-page {
  padding: 2rem 0 3rem;
}

.policy-card {
  max-width: 960px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.policy-card h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.policy-card h2 {
  padding: 0;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.policy-card p,
.policy-card li {
  color: var(--text-muted);
  line-height: 1.65;
}

.policy-card ul {
  list-style: disc;
  padding-left: 1.2rem;
  padding-top: 0.3rem;
}

body.dark .policy-card {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%) translateY(120%);
  width: min(960px, calc(100% - 2rem));
  background: var(--bg-secondary);
  color: var(--text-main);
  border-radius: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.cookie-banner.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-banner h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.cookie-banner p {
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.9rem;
}

.cookie-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.cookie-btn {
  padding-inline: 1.35rem;
}

.cookie-btn-secondary {
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--text-main);
  background: transparent;
  border-radius: 999px;
  padding: 0.75rem 1.35rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}

.cookie-btn-secondary:hover {
  background: rgba(99, 102, 241, 0.12);
  transform: translateY(-2px);
}

.cookie-manage {
  display: inline-block;
  margin-left: 0.7rem;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: none;
  vertical-align: middle;
}

body.dark .cookie-banner,
body.dark .cookie-manage {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}

/* Pricing */
.pricing-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 1rem;
  flex: 1 1 280px;
  min-width: 250px;
  min-height: 380px;
  height: auto;
  max-width: none;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(99, 102, 241, 0.15);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.35);
}

.pricing-card h3 {
  margin-bottom: 1rem;
}

.price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
}

.pricing-card ul {
  margin-bottom: 1.5rem;
}

.pricing-card li {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.recommended {
  border: 2px solid var(--accent);
  transform: scale(1.05);
}

.recommended:hover {
  transform: scale(1.08);
}

/* Benefits section */

.section-soft {
  padding: 6rem 2rem;
}

/* Dark mode gradient */
body.dark .section-soft {
  background: linear-gradient(180deg,
      #0f172a 0%,
      #111827 40%,
      #0b1220 100%);
}

/* Light mode gradient */
body:not(.dark) .section-soft {
  background: linear-gradient(180deg,
      var(--bg-main) 0%,
      #f8fbff 60%,
      #ffffff 100%);
}

.benefits-wrapper {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.benefits-intro h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.benefits-intro p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.benefits-grid-apple {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem 2rem;
}

.benefit-apple h3 {
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.benefit-apple p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 1rem;
}

/* Responzivita */
@media (max-width: 900px) {
  .benefits-wrapper {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .benefits-grid-apple {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .project-grid {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  .pricing-grid {
    flex-direction: column;
    align-items: stretch;
  }

  #portfolio .container.wide,
  #cenik.container.wide {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #portfolio .projects-border,
  #cenik .projects-border {
    padding: 0.9rem;
  }

  .portfolio-grid>a {
    width: 100%;
    justify-content: center;
  }

  #cenik .pricing-grid {
    align-items: center;
  }

  #cenik .pricing-grid>.pricing-card {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
  }

  #portfolio .portfolio-card,
  #cenik .pricing-card {
    width: 100%;
    max-width: 100%;
  }

  .portfolio-card,
  .pricing-card {
    margin-inline: auto;
  }

  .pricing-card {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 420px;
  }

  .pricing-card:hover,
  .recommended:hover {
    transform: none;
  }

  .cookie-banner {
    width: calc(100% - 1rem);
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    transform: translateY(120%);

  }

  .cookie-banner.is-visible {
    transform: translateY(0);
  }

  .cookie-actions {
    flex-direction: column;
  }

  .cookie-btn,
  .cookie-btn-secondary {
    width: 100%;
    text-align: center;
  }

  .recommended {
    transform: none;
  }
}