:root {
  --bg: #070b12;
  --surface: #0f1623;
  --surface2: #151d2e;
  --text: #e8eef7;
  --muted: #8b9cb5;
  --dim: #5c6b82;
  --accent: #5b9cf5;
  --accent2: #7c6cf0;
  --accent-soft: rgba(91, 156, 245, 0.12);
  --gradient: linear-gradient(135deg, #5b9cf5 0%, #7c6cf0 55%, #a78bfa 100%);
  --border: #243044;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --header-h: 72px;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

/* Akapity — wyrównanie do obu krawędzi (desktop + mobile) */
main p,
.hero-lead,
.section-intro,
.card p,
.faq dd,
.form-success p {
  text-align: justify;
  text-wrap: pretty;
  hyphens: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(7, 11, 18, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap,
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.35rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.92;
}

.logo-mark {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(91, 156, 245, 0.18), rgba(124, 108, 240, 0.1)),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: 0 8px 24px rgba(91, 156, 245, 0.12);
}

.logo-wordmark {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.logo-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.logo-accent {
  color: var(--accent);
}

.logo-tagline {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.nav-cta {
  color: var(--text) !important;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none !important;
}

.nav-cta:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  filter: none;
}

.lang-switch {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--dim) !important;
  border: 1px solid var(--border);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  text-decoration: none !important;
}

.lang-switch:hover {
  color: var(--accent) !important;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

/* hero */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 3rem) 0 4.5rem;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(91, 156, 245, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 1.25rem;
  max-width: none;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 36rem;
  margin: 0 0 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  list-style: none;
  padding: 1.5rem 0 0;
  margin: 0;
  border-top: 1px solid var(--border);
}

.hero-stats li {
  font-size: 0.88rem;
  color: var(--muted);
}

.hero-stats strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 600;
}

.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.terminal-bar span:nth-child(1) { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }

.terminal-body {
  padding: 1.25rem 1.35rem 1.35rem;
}

.terminal-pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--muted);
  min-height: 11.5rem;
}

.terminal-pre code {
  font-family: inherit;
}

.terminal-cursor {
  display: inline-block;
  color: var(--accent);
  animation: terminal-blink 1s step-end infinite;
  font-weight: 400;
  margin-left: 1px;
}

.terminal-cursor[hidden] {
  display: none;
}

@keyframes terminal-blink {
  50% { opacity: 0; }
}

.terminal-run {
  margin: 0.85rem 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #98c379;
}

.terminal-success {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, #3fb950 12%, var(--surface2));
  border: 1px solid color-mix(in srgb, #3fb950 35%, var(--border));
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.terminal-success.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.terminal-success-icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  line-height: 1.35rem;
  text-align: center;
  border-radius: 50%;
  background: color-mix(in srgb, #3fb950 20%, transparent);
  color: #3fb950;
  font-size: 0.85rem;
  font-weight: 700;
}

.terminal-success-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
}

.t-comment { color: var(--dim); }
.t-kw { color: #c678dd; }
.t-fn { color: #61afef; }
.t-str { color: #98c379; }

@media (prefers-reduced-motion: reduce) {
  .terminal-cursor {
    animation: none;
    opacity: 0;
  }

  .terminal-success {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.steps {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--gradient);
  color: #fff !important;
  box-shadow: 0 8px 28px rgba(91, 156, 245, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(91, 156, 245, 0.45);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text) !important;
}

.btn-ghost:hover {
  border-color: var(--muted);
  background: var(--surface2);
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text) !important;
}

.btn-secondary:hover {
  border-color: var(--muted);
}

/* pillars */
.section {
  padding: 3rem 0;
}

.section-title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.section-intro {
  color: var(--muted);
  margin: 0 0 2rem;
  max-width: 40rem;
}

.pillars {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .pillars {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-num {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  line-height: 1.75rem;
  text-align: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

/* audience */
.audience-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.audience-list li {
  padding: 0.4rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* faq */
.faq dt {
  font-weight: 600;
  margin-top: 1.25rem;
}

.faq dd {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

/* cta band */
.cta-band {
  margin: 2rem 0 4rem;
  padding: 2.5rem;
  text-align: center;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cta-band h2 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}

.cta-band p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* footer */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

/* contact form */
#kontakt {
  padding-bottom: 4rem;
}

.contact-wrap {
  max-width: 42rem;
  margin-inline: auto;
}

#kontakt .section-head {
  margin-bottom: 2rem;
  text-align: center;
}

#kontakt .section-title,
#kontakt .section-intro {
  margin-inline: auto;
}

[hidden] {
  display: none !important;
}

.form-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-progress {
  height: 4px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.form-progress-bar {
  height: 100%;
  width: 50%;
  background: var(--gradient);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.form-step-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dim);
  margin: 0 0 1.25rem;
}

.form-step {
  display: none;
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.form-step.is-active {
  display: block;
}

.form-step legend {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding: 0;
  color: var(--text);
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath stroke='%238b9cb5' stroke-width='1.5' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--dim);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.field select:-webkit-autofill,
.field textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  box-shadow: 0 0 0 1000px var(--bg) inset;
  border: 1px solid var(--border);
  transition: background-color 9999s ease-out;
}

.field textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.55;
}

.field-full {
  grid-column: 1 / -1;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  pointer-events: none;
}

.form-error {
  margin-top: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, #f85149 12%, transparent);
  border: 1px solid color-mix(in srgb, #f85149 35%, transparent);
  color: #ff7b72;
  font-size: 0.88rem;
}

.form-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.form-success {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.success-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  background: color-mix(in srgb, #3fb950 15%, transparent);
  color: #3fb950;
  border: 1px solid color-mix(in srgb, #3fb950 35%, transparent);
}

.form-success h3 {
  margin: 0 0 0.5rem;
}

.form-success p {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

/* tablet */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-card {
    order: 2;
  }

  .hero-copy {
    order: 1;
  }
}

/* mobile */
@media (max-width: 720px) {
  :root {
    --header-h: 64px;
  }

  body {
    font-size: 1rem;
  }

  .wrap {
    width: calc(100% - 1.25rem);
  }

  .logo-tagline {
    display: none;
  }

  .hero {
    padding: calc(var(--header-h) + 1.5rem) 0 2.5rem;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(1.65rem, 7vw, 2.2rem);
  }

  .hero-lead {
    font-size: 1.05rem;
    margin-bottom: 1rem;
  }

  .section {
    padding: 2rem 0;
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 0;
    width: min(280px, 85vw);
    margin-left: auto;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 1.25rem 2rem;
    background: var(--surface);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 20;
  }

  .nav.open {
    transform: translateX(0);
  }

  .nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }

  .nav-cta {
    margin-top: 0.5rem;
    text-align: center;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .form-shell {
    padding: 1.15rem 1rem;
    border-radius: var(--radius);
  }

  .form-step legend {
    font-size: 1rem;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
    min-height: 48px;
  }

  .field textarea {
    min-height: 140px;
  }

  .form-nav {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }

  .form-nav .btn {
    width: 100%;
    min-height: 48px;
  }

  .card:hover {
    transform: none;
  }
}

@media (max-width: 380px) {
  .hero-badge {
    font-size: 0.72rem;
  }

  .form-shell {
    padding: 1rem;
  }
}
