/* ============ Pracujesz na mieszkanie — styles ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #faf6f1;
  --panel: #ffffff;
  --line: #eadfd2;
  --ink: #2b2118;
  --dim: #6f6151;
  --terra: #c96f4a;
  --terra-dark: #a2532f;
  --graphite: #3d332a;
  --green: #4a7c59;
  --red: #b33f2e;
  --radius: 20px;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --shadow: 0 10px 34px rgba(60, 40, 20, 0.09);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background:
    radial-gradient(700px 340px at 92% -5%, #c96f4a14, transparent 60%),
    radial-gradient(600px 320px at 0% 12%, #4a7c5910, transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: clamp(18px, 4vw, 48px); }

/* ---------- hero ---------- */
.hero { text-align: center; max-width: 780px; margin: 0 auto; padding-top: clamp(6px, 2.5vh, 26px); }
.kicker {
  display: inline-block;
  background: #c96f4a14;
  border: 1px solid #c96f4a35;
  color: var(--terra-dark);
  padding: 6px 16px; border-radius: 999px;
  font-weight: 500; font-size: 0.82rem;
}
.hero h1 {
  margin-top: 18px;
  font-size: clamp(1.9rem, 5.6vw, 3.3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--graphite);
}
.subtitle { margin-top: 14px; color: var(--dim); font-size: clamp(0.98rem, 2.3vw, 1.12rem); line-height: 1.6; }
.subtitle strong { color: var(--terra-dark); }

/* ---------- panel & controls ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 28px);
}
.controls { margin-top: clamp(26px, 4vh, 40px); }
.control-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 760px) { .control-grid { grid-template-columns: 1fr; } }
.label { display: block; font-size: 0.86rem; font-weight: 500; color: var(--dim); margin-bottom: 7px; }
.unit { color: #7c6e5c; font-size: 0.8em; }
select, input[type="number"] {
  width: 100%;
  background: #fbf8f4;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select { font-family: 'Outfit', sans-serif; cursor: pointer; }
select:focus, input[type="number"]:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 3px #c96f4a22; }
input[type="range"] { width: 100%; margin-top: 10px; accent-color: var(--terra); cursor: pointer; }
output { font-family: var(--mono); color: var(--terra-dark); font-weight: 700; }
.linklike {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.8rem; color: var(--terra-dark);
  margin-top: 6px; padding: 0; text-decoration: underline;
}

/* ---------- stats ---------- */
.stats {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px;
  margin-top: 20px;
}
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  text-align: center;
}
.stat-card.main {
  background: linear-gradient(160deg, var(--terra), var(--terra-dark));
  border: none;
  color: #fff;
}
.stat-label { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.95; font-weight: 500; }
.stat-num {
  display: block;
  font-family: var(--mono);
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  margin-top: 8px;
}
.stat-card:not(.main) .stat-num { color: var(--terra-dark); }
.stat-desc { display: block; margin-top: 6px; font-size: 0.88rem; opacity: 0.95; line-height: 1.4; }

.provoke {
  text-align: center;
  margin-top: 18px;
  color: var(--dim);
  font-size: 1.02rem;
  line-height: 1.6;
}
.provoke strong { color: var(--red); }

.share-row { display: flex; justify-content: center; margin-top: 20px; }
.btn {
  font-family: inherit; font-weight: 700; font-size: 1rem;
  border: none; border-radius: 999px; cursor: pointer;
  padding: 13px 28px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn.share {
  background: var(--graphite); color: #fff;
  box-shadow: 0 8px 24px rgba(61, 51, 42, 0.35);
}
.btn.share:hover { opacity: 0.93; transform: translateY(-1px); }

/* ---------- chart ---------- */
.chart-section { margin-top: clamp(46px, 7vh, 76px); }
.chart-section h2, .table-section h2, .method h2, .faq h2 {
  text-align: center; font-size: clamp(1.4rem, 3.6vw, 2rem);
  font-weight: 800; color: var(--graphite); margin-bottom: 10px;
}
.chart-sub { text-align: center; color: var(--dim); font-size: 0.92rem; margin-bottom: 22px; }
.chart {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.5vw, 26px);
}
.bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 74px;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s ease;
}
.bar-row:hover { background: #fbf3ec; }
.bar-row.selected { background: #c96f4a14; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 106px 1fr 64px; } }
.bar-name { text-align: right; font-size: 0.88rem; font-weight: 500; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row.selected .bar-name { color: var(--terra-dark); font-weight: 700; }
.bar-track { display: block; background: #f3ece3; border-radius: 999px; height: 22px; overflow: hidden; }
.bar-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #e2a184, var(--terra));
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-row.selected .bar-fill { background: linear-gradient(90deg, var(--terra), var(--terra-dark)); }
.bar-val { font-family: var(--mono); font-weight: 700; font-size: 0.88rem; color: var(--ink); white-space: nowrap; }

/* ---------- table ---------- */
.table-section { margin-top: clamp(46px, 7vh, 76px); }
.table-scroll { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--panel); min-width: 640px; }
th, td { padding: 12px 14px; text-align: right; font-size: 0.92rem; }
th:first-child, td:first-child { text-align: left; }
thead th {
  background: var(--graphite); color: #fff;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.74rem;
}
tbody tr { border-top: 1px solid #f3ece3; }
tbody tr:nth-child(even) { background: #fdfaf7; }
tbody tr.selected { background: #c96f4a14; font-weight: 700; }
td.num { font-family: var(--mono); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fbf3ec; }

/* ---------- method ---------- */
.method { margin-top: clamp(46px, 7vh, 76px); }
.method h2 { margin-bottom: 16px; }
.method ul { list-style: none; }
.method li {
  padding: 9px 0 9px 26px;
  position: relative;
  color: var(--dim); font-size: 0.94rem; line-height: 1.6;
}
.method li::before { content: '▸'; position: absolute; left: 6px; color: var(--terra); }
.method strong { color: var(--ink); }

/* ---------- FAQ ---------- */
.faq { margin-top: clamp(46px, 7vh, 76px); }
.faq h2 { margin-bottom: 20px; }
.faq details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 16px 20px;
  font-weight: 700; font-size: 0.98rem; color: var(--graphite);
  list-style: none; position: relative; padding-right: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute; right: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--terra); font-size: 1.3rem;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 20px 18px; color: var(--dim); line-height: 1.65; font-size: 0.93rem; }
.faq strong { color: var(--ink); }

/* ---------- footer ---------- */
.footer {
  margin-top: clamp(46px, 7vh, 76px);
  text-align: center;
  color: var(--dim); font-size: 0.88rem; line-height: 1.8;
  padding-bottom: 30px;
}
.footer .muted { color: #93836e; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--graphite); color: #fff;
  padding: 13px 26px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  box-shadow: 0 12px 32px rgba(43, 33, 24, 0.4);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 50;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ==== dodatki SEO/a11y ==== */
.noscript-note { background: #fff3cd; color: #5a4500; padding: 12px 16px; border-radius: 10px; margin: 16px auto; max-width: 720px; font-size: 0.95rem; }
.more-tools { margin-top: 14px; font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.more-tools a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.more-tools a:hover { opacity: 0.75; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto !important; }
}
