/* ============================================================
   mozaika.systems — paleta inspirowana polskimi mozaikami
   ceramicznymi lat 60.: porcelana, petrol, teal, ochra,
   cegła, kobalt.
   ============================================================ */

:root {
  --porcelana: #F5F6F3;
  --paper: #FFFFFF;
  --ink: #0F2E33;
  --ink-soft: #3E5A5F;
  --teal: #17766B;
  --teal-dark: #0F5A51;
  --ochre: #E0A32E;
  --brick: #C25532;
  --cobalt: #3055C6;
  --line: rgba(15, 46, 51, 0.14);
  --line-light: rgba(245, 246, 243, 0.18);

  --font-display: "Lato", sans-serif;
  --font-body: "Albert Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 4px;
  --container: 1160px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--porcelana);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(1.9rem, 4.2vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 2.8vw, 2rem); max-width: 21em; }

h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.35;
}

p.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 34em;
}

a { color: var(--teal); }

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
}

/* --- Kafelki (motyw przewodni) ------------------------------ */

.t {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.t-teal   { background: var(--teal); }
.t-ochre  { background: var(--ochre); }
.t-brick  { background: var(--brick); }
.t-cobalt { background: var(--cobalt); }

.tile-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--teal);
  margin-right: 10px;
  vertical-align: 1px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.eyebrow-light { color: rgba(245, 246, 243, 0.75); }

/* --- Przyciski ---------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--teal);
  color: #fff;
}
.btn-primary:hover { background: var(--teal-dark); }

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-small {
  padding: 9px 18px;
  font-size: 0.92rem;
  background: var(--teal);
  color: #fff;
}
.btn-small:hover { background: var(--teal-dark); }

.btn-large { padding: 16px 32px; font-size: 1.1rem; }

/* --- Nagłówek strony ---------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 246, 243, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 7px);
  gap: 2px;
}
.brand-mark .t {
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand-tld { color: var(--teal); font-weight: 700; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav a:not(.btn) {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:not(.btn):hover { color: var(--teal); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle i {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--line);
}
.mobile-nav a:not(.btn) {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  padding: 10px 0;
}
.mobile-nav .btn { margin-top: 8px; text-align: center; }
.mobile-nav.open { display: flex; }

/* --- Hero ---------------------------------------------------- */

.hero { padding: 72px 0 88px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero-copy .lead { margin: 22px 0 32px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-note {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* Mozaika w hero — kafelki generowane w JS */
.hero-visual { display: flex; justify-content: center; }

.mosaic {
  display: grid;
  grid-template-columns: repeat(11, 30px);
  grid-auto-rows: 30px;
  gap: 6px;
}

.mosaic .cell {
  width: 30px;
  height: 30px;
  border-radius: 3px;
  border: 1px solid var(--line);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.mosaic .cell.filled { border-color: transparent; }
.mosaic .cell.c-teal   { background: var(--teal); }
.mosaic .cell.c-teal2  { background: var(--teal-dark); }
.mosaic .cell.c-ochre  { background: var(--ochre); }
.mosaic .cell.c-brick  { background: var(--brick); }
.mosaic .cell.c-cobalt { background: var(--cobalt); }
.mosaic .cell.c-ink    { background: var(--ink); }

/* --- Sekcje -------------------------------------------------- */

.section { padding: 88px 0; }

.section h2 { margin-bottom: 40px; }

/* --- Problem ------------------------------------------------- */

.pain { background: var(--paper); border-top: 1px solid var(--line); }

.pain-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.pain-card {
  background: var(--porcelana);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
}
.pain-card h3 { margin-bottom: 10px; }
.pain-card p { font-size: 0.95rem; color: var(--ink-soft); }

/* --- Jak pracujemy (ciemna sekcja) --------------------------- */

.process {
  background: var(--ink);
  color: var(--porcelana);
}
.process h2 { color: var(--porcelana); }

.process-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  counter-reset: step;
}

.step {
  border-top: 1px solid var(--line-light);
  padding-top: 22px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ochre);
  display: block;
  margin-bottom: 14px;
}

.step h3 { color: #fff; margin-bottom: 10px; }
.step p { font-size: 0.95rem; color: rgba(245, 246, 243, 0.72); }

/* --- Moduły -------------------------------------------------- */

.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.module-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(15, 46, 51, 0.08);
}

.module-tile {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-bottom: 18px;
  transition: transform 0.25s ease;
}
.module-card:hover .module-tile { transform: rotate(45deg); }

.mt-teal   { background: var(--teal); }
.mt-ochre  { background: var(--ochre); }
.mt-brick  { background: var(--brick); }
.mt-cobalt { background: var(--cobalt); }

.module-card h3 { margin-bottom: 10px; }
.module-card p { font-size: 0.95rem; color: var(--ink-soft); }

/* --- Liczby -------------------------------------------------- */

.numbers {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 64px 0;
}

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.number-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  display: block;
  margin-bottom: 10px;
  color: var(--teal);
}

.number-item p { font-size: 0.95rem; color: var(--ink-soft); max-width: 26em; }

/* --- FAQ ----------------------------------------------------- */

.faq-container { max-width: 800px; }

.faq-list { display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 22px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 18px 0;
  list-style: none;
  position: relative;
  padding-right: 36px;
}
.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--teal);
  transform: translateY(-50%);
  transition: transform 0.25s ease;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }

.faq-item p {
  padding: 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* --- CTA ----------------------------------------------------- */

.cta-final {
  background: var(--ink);
  color: var(--porcelana);
  text-align: center;
}

.cta-inner { max-width: 720px; }

.cta-mosaic {
  display: inline-grid;
  grid-template-columns: repeat(3, 14px);
  gap: 5px;
  margin-bottom: 28px;
}
.cta-mosaic .t { width: 14px; height: 14px; }

.cta-final h2 { color: #fff; margin: 0 auto 18px; }
.cta-final .lead { color: rgba(245, 246, 243, 0.75); margin: 0 auto 32px; }

/* --- Formularz kontaktowy ------------------------------------ */

.contact-form {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

.form-row { margin-bottom: 18px; }

.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: rgba(245, 246, 243, 0.9);
}

.form-row input,
.form-row textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--porcelana);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color 0.15s ease;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--ochre);
}
.form-row textarea { resize: vertical; min-height: 120px; }

.captcha-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.captcha-line img {
  border-radius: var(--radius);
  display: block;
}
.captcha-line input {
  flex: 1;
  min-width: 120px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-family: var(--font-mono);
}

.captcha-refresh {
  background: none;
  border: 2px solid var(--line-light);
  border-radius: var(--radius);
  color: var(--porcelana);
  font-size: 1.2rem;
  line-height: 1;
  width: 42px;
  height: 48px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.captcha-refresh:hover { border-color: var(--ochre); }

/* honeypot — niewidoczny dla ludzi, boty go wypełniają */
.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form .btn { width: 100%; border: none; cursor: pointer; }
.contact-form .btn:disabled { opacity: 0.6; cursor: wait; }

.form-status {
  margin-top: 14px;
  font-size: 0.95rem;
  min-height: 1.4em;
  text-align: center;
}
.form-status.ok { color: #7BD8A8; }
.form-status.error { color: #F0A18A; }

.cta-alt {
  margin-top: 26px;
  font-size: 0.92rem;
  color: rgba(245, 246, 243, 0.6);
}
.cta-alt a { color: rgba(245, 246, 243, 0.85); }

/* --- Stopka -------------------------------------------------- */

.site-footer {
  background: var(--porcelana);
  border-top: 1px solid var(--line);
  padding: 48px 0 24px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-brand { max-width: none; }
.footer-brand p { white-space: nowrap; }
.footer-brand .brand-mark { margin-bottom: 8px; }
.footer-brand .brand-name { display: block; margin-bottom: 8px; }
.footer-brand p { font-size: 0.9rem; color: var(--ink-soft); }

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer-nav a:hover { color: var(--teal); }

.footer-legal {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.footer-legal p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* --- Animacje wejścia ---------------------------------------- */

/* Ukrywanie do animacji tylko gdy działa JS — bez JS treść jest widoczna */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .mosaic .cell { transition: none; }
  .btn:hover, .module-card:hover { transform: none; }
}

/* --- Responsywność ------------------------------------------- */

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { order: -1; }
  .mosaic {
    grid-template-columns: repeat(11, 24px);
    grid-auto-rows: 24px;
    gap: 5px;
  }
  .mosaic .cell { width: 24px; height: 24px; }
  .pain-grid { grid-template-columns: repeat(2, 1fr); }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
  .modules-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }

  .section { padding: 64px 0; }
  .hero { padding: 40px 0 64px; }

  .pain-grid,
  .process-steps,
  .modules-grid,
  .numbers-grid { grid-template-columns: 1fr; }

  .mosaic {
    grid-template-columns: repeat(11, 20px);
    grid-auto-rows: 20px;
    gap: 4px;
  }
  .mosaic .cell { width: 20px; height: 20px; }

  .footer-inner { flex-direction: column; }
  .footer-brand p { white-space: normal; }
}
