:root {
  --ground: #f2f3ef;
  --step: #e3e5df;
  --white: #ffffff;
  --ink: #0d162e;
  --ink-2: #48506a;
  --field: #1447d4;
  --field-deep: #0f38ab;
  --night: #0d162e;
  --ok: #0e7a4d;
  --warn: #8a4b00;
  --m: clamp(16px, 2.2vw, 32px);
  --gap: clamp(88px, 12vw, 190px);
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.5 var(--font); }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #ffb400; outline-offset: 2px; }
[hidden] { display: none !important; }
::selection { background: var(--field); color: #fff; }

h1 { font-weight: 800; font-size: clamp(46px, 7.4vw, 124px); line-height: .92; letter-spacing: -.04em; }
h2 { font-weight: 800; font-size: clamp(34px, 4.8vw, 76px); line-height: .98; letter-spacing: -.035em; max-width: 14em; }
h3 { font-weight: 700; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; }
.statement { font-size: clamp(19px, 1.9vw, 27px); line-height: 1.32; letter-spacing: -.01em; max-width: 30em; }
.note { font-size: 14px; color: var(--ink-2); }

/* przyciski: płaskie, proste narożniki */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 0; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .16s var(--ease), background-color .16s, color .16s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-big { min-height: 56px; padding: 14px 26px; font-size: 19px; }
.btn-light { background: var(--white); color: var(--field); }
.btn-light:hover { background: var(--ink); color: var(--white); }
.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover { background: var(--field); }
.btn-accent { background: var(--field); color: var(--white); }
.btn-accent:hover { background: var(--ink); }
.btn-quiet { background: var(--step); color: var(--ink); }
.btn-quiet:hover { background: var(--ink); color: var(--white); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.textlink { font-weight: 600; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.textlink:hover { text-decoration-thickness: 4px; }

/* nawigacja */
.nav { position: absolute; z-index: 5; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 28px; padding: 18px var(--m); color: var(--white); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 24px; letter-spacing: -.03em; text-decoration: none; margin-right: auto; }
.mark { width: 28px; height: 28px; }
.nav nav { display: flex; gap: 26px; }
.nav nav a { text-decoration: none; font-weight: 600; padding: 10px 0; }
.nav nav a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

/* pierwsze pole: niebieski arkusz, biały wydruk */
.hero { background: var(--field); color: var(--white); min-height: min(100svh, 980px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--m); padding: 96px var(--m) var(--m); align-items: stretch; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; gap: 30px; padding-bottom: 4vh; }
.lead { font-size: clamp(19px, 1.7vw, 25px); line-height: 1.35; max-width: 24em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px 28px; }
.hero-stage { position: relative; display: flex; flex-direction: column; min-height: 440px; }
.viewer { position: relative; flex: 1; min-height: 360px; touch-action: none; cursor: grab; }
.viewer:active { cursor: grabbing; }
.viewer canvas { display: block; position: absolute; inset: 0; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding-top: 12px; font-weight: 600; }
.swatches { display: flex; gap: 8px; }
.swatches button { width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 3px var(--field); outline: 2px solid transparent; transition: transform .16s var(--ease); }
.swatches button:hover { transform: scale(1.14); }
.swatches button[aria-pressed="true"] { outline-color: var(--white); }
.swatches-dark button { box-shadow: inset 0 0 0 3px var(--white); }
.swatches-dark button[aria-pressed="true"] { outline-color: var(--ink); }

.trust { font-size: 16px; font-weight: 600; max-width: 28em; }
/* arkusz z elewacją wsunięty pod model: skąd bierze się makieta */
.hero-sheet { position: absolute; left: 0; bottom: 64px; width: min(38%, 300px); margin: 0; background: var(--white); color: var(--ink); padding: 8px 8px 6px; transform: rotate(-4deg); transform-origin: left bottom; pointer-events: none; }
.hero-sheet canvas { display: block; width: 100%; height: auto; }
.hero-sheet figcaption { font-size: 13px; font-weight: 600; padding-top: 4px; }

/* ten sam model w kolorach filamentu */
.colors { padding: var(--gap) var(--m) 0; }
.colors-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 90px); align-items: end; margin-bottom: clamp(32px, 4vw, 56px); }
.color-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.color-grid a { display: block; background: var(--field); color: var(--white); text-decoration: none; overflow: hidden; }
.color-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s var(--ease); }
.color-grid a:hover img { transform: scale(1.06); }
.color-grid span { display: block; padding: 0 18px 16px; font-weight: 700; font-size: 20px; }

/* dla kogo */
.who { padding: var(--gap) var(--m) 0; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 90px); align-items: start; }
.who-head { display: grid; gap: 28px; position: sticky; top: 32px; }
.who-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.who-list li { background: var(--white); padding: clamp(22px, 3vw, 44px); display: grid; gap: 14px; }
.who-list li:nth-child(2) { background: var(--ink); color: var(--white); }
.who-list h3 { font-size: clamp(26px, 3vw, 44px); font-weight: 800; letter-spacing: -.03em; line-height: 1.02; }
.who-list p { max-width: 34em; font-size: 18px; }
.who-list .textlink { justify-self: start; }

/* wezwanie przed stopką */
.cta-band { background: var(--field); color: var(--white); padding: clamp(64px, 9vw, 150px) var(--m); display: grid; gap: clamp(28px, 4vw, 56px); overflow: hidden; }
.cta-band h2 { font-size: clamp(40px, 7.2vw, 128px); line-height: .92; letter-spacing: -.045em; max-width: 11em; }
.cta-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 90px); align-items: center; }
.cta-row .btn { justify-self: start; }
.limits { padding-bottom: var(--gap); }

/* sekcje */
section { scroll-margin-top: 24px; }
.how, .gen-section, .pricing, .limits { padding: var(--gap) var(--m) 0; }
.how { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 90px); align-items: start; }
.how-text { display: grid; gap: 28px; }
.steps { padding: 0; list-style: none; counter-reset: s; display: grid; gap: 22px; max-width: 34em; }
.steps li { padding-left: 0; }
.steps strong { display: block; font-size: 22px; letter-spacing: -.01em; }
.how-drawings { display: grid; grid-template-columns: 1.55fr 1fr; gap: 10px; background: var(--white); padding: 10px; }
.how-drawings canvas { width: 100%; height: auto; display: block; background: var(--white); }

.gen-head, .pricing-head, .limits-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 90px); align-items: end; margin-bottom: clamp(32px, 4vw, 56px); }

.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; background: var(--step); padding: 14px 22px; font-weight: 700; font-size: 18px; cursor: pointer; transition: background-color .16s, color .16s; }
.tabs button:hover { background: #d3d6ce; }
.tabs button[aria-selected="true"] { background: var(--white); color: var(--field); }

/* generator: wnętrze narzędzia rządzi się zasadami aplikacji */
.gen { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 4px; }
.gen-edit, .gen-out { background: var(--white); padding: clamp(14px, 1.6vw, 24px); min-width: 0; }
.gen-out { display: grid; gap: 18px; align-content: start; }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; background: #fff3c9; color: #3d2900; padding: 14px 16px; margin-bottom: 12px; }
.demo-bar.busy::after { content: 'Analizuję rysunki…'; font-weight: 700; }
.demo-bar.own { background: var(--ground); color: var(--ink); }
.demo-bar p { flex: 1 1 280px; font-size: 16px; }
.demo-acts { display: flex; flex-wrap: wrap; gap: 6px; }
#paneA.over { outline: 4px solid var(--field); outline-offset: 4px; }
.slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.slot { display: grid; gap: 6px; padding: 8px; border: 0; background: var(--ground); cursor: pointer; text-align: left; font-size: 14px; font-weight: 600; line-height: 1.2; transition: background-color .16s; }
.slot:hover { background: var(--step); }
.slot[aria-pressed="true"] { background: var(--field); color: var(--white); }
.slot canvas { width: 100%; aspect-ratio: 4 / 3; background: var(--white); display: block; }
.slot small { font-weight: 400; opacity: .8; display: block; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; margin-bottom: 10px; }
.modes, .acts { display: flex; flex-wrap: wrap; gap: 4px; }
.toolbar .inl { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; background: var(--ground); padding: 0 10px; min-height: 40px; }
.toolbar .inl input { width: 4.5em; min-height: 32px; padding: 2px 6px; }
.toolbar select { border: 0; background: var(--ground); padding: 9px 10px; min-height: 40px; font-size: 15px; font-weight: 600; cursor: pointer; }
.toolbar button, .filebtn { border: 0; background: var(--ground); padding: 9px 12px; min-height: 40px; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; transition: background-color .16s, color .16s; }
.toolbar button:hover, .filebtn:hover { background: var(--step); }
.modes button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.stage { position: relative; background: var(--ground); min-height: 280px; }
.stage canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }
.drop { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; background: var(--ground); }
.stage.over { outline: 4px solid var(--field); outline-offset: -4px; }
.hint { margin-top: 10px; font-size: 15px; color: var(--ink-2); min-height: 3em; }
.scaleform { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #fff3c9; padding: 10px 12px; margin-bottom: 10px; font-weight: 600; }
.scaleform input { width: 6.5em; }
.viewer-gen { min-height: 0; height: clamp(300px, 34vw, 460px); background: var(--field); flex: none; }
.dims { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.dims span { display: block; font-weight: 400; font-size: 15px; color: var(--ink-2); }
.warnings { list-style: none; padding: 0; display: grid; gap: 6px; }
.warnings li { background: #fff3c9; color: #4d3200; padding: 10px 12px; font-size: 15px; }
.warnings li.err { background: #ffd9d4; color: #6b1206; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.gen-out .fields { margin: 0; }
.fields label, .order label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="number"], select, textarea { width: 100%; min-height: 42px; padding: 8px 10px; border: 2px solid var(--step); border-radius: 0; background: var(--white); font-weight: 400; font-size: 16px; }
input:focus, select:focus, textarea:focus { border-color: var(--field); outline: 0; }
.unit { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.check { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px; font-weight: 400 !important; font-size: 15px !important; }
.check input { width: 20px; height: 20px; accent-color: var(--field); flex: none; }
input[type="range"] { accent-color: var(--field); width: 100%; }
.exports { display: flex; flex-wrap: wrap; gap: 6px; }
.order { display: grid; gap: 12px; background: var(--ground); padding: 18px; }
.variants { display: grid; gap: 4px; }
.variant { display: grid !important; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px !important; background: var(--white); padding: 12px; cursor: pointer; font-size: 16px !important; }
.variant input { width: 20px; height: 20px; accent-color: var(--field); }
.variant small { display: block; font-weight: 400; color: var(--ink-2); }
.variant:has(input:checked) { background: var(--ink); color: var(--white); }
.variant:has(input:checked) small { color: #c9cfe0; }
.total { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.total small { font-size: 15px; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }

/* cennik */
.price-table { width: 100%; border-collapse: collapse; font-size: clamp(17px, 1.5vw, 21px); }
.price-table th { text-align: left; font-weight: 600; font-size: 15px; color: var(--ink-2); padding: 0 16px 12px 0; }
.price-table td { padding: 26px 16px 26px 0; vertical-align: top; border-top: 3px solid var(--ink); }
.price-table td:first-child { font-weight: 800; font-size: clamp(24px, 2.6vw, 40px); letter-spacing: -.03em; line-height: 1.05; width: 30%; }
.price-table td:last-child { font-weight: 800; font-size: clamp(24px, 2.6vw, 40px); letter-spacing: -.03em; line-height: 1.05; text-align: right; white-space: nowrap; padding-right: 0; font-variant-numeric: tabular-nums; }
.price-table th:last-child { text-align: right; padding-right: 0; }

/* pytania */
.limits { padding-bottom: var(--gap); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; align-items: start; }
.faq details { background: var(--white); padding: 22px 24px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 21px; letter-spacing: -.01em; line-height: 1.25; list-style-position: outside; }
.faq summary:hover { color: var(--field); }
.faq details p { margin-top: 12px; max-width: 36em; }

/* stopka */
.footer { background: var(--night); color: var(--white); padding: clamp(40px, 6vw, 90px) var(--m) var(--m); overflow: hidden; }
.footer-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 90px); margin-top: 24px; }
.footer-cols p { max-width: 26em; }
.footer-name { font-weight: 800; font-size: clamp(64px, 17.5vw, 300px); line-height: .85; letter-spacing: -.05em; margin-left: -.04em; white-space: nowrap; }
.footer a { text-underline-offset: 4px; line-height: 1.9; }

/* wejścia sekcji */
.js .reveal > * { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in > * { opacity: 1; transform: none; }
.js .reveal.in > *:nth-child(2) { transition-delay: .08s; }
.js .reveal.in > *:nth-child(3) { transition-delay: .16s; }
.js .reveal.in > *:nth-child(4) { transition-delay: .24s; }
.js .reveal.in > *:nth-child(n+5) { transition-delay: .3s; }
.js .hero-copy > * { animation: rise .8s var(--ease) both; }
.js .hero-copy > *:nth-child(2) { animation-delay: .09s; }
.js .hero-copy > *:nth-child(3) { animation-delay: .18s; }
.js .hero-stage { animation: rise 1s .15s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal > *, .js .hero-copy > *, .js .hero-stage { opacity: 1; transform: none; animation: none; transition: none; }
  .btn:hover, .swatches button:hover { transform: none; }
}

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding-top: 88px; min-height: 0; }
  .hero-copy { padding-bottom: 0; }
  .hero-stage { min-height: 0; }
  .hero .viewer { height: min(92vw, 460px); flex: none; }
  .how, .gen-head, .pricing-head, .limits-head, .footer-cols, .who, .cta-row, .colors-head { grid-template-columns: 1fr; }
  .who-head { position: static; }
  .hero-sheet { width: min(44%, 220px); bottom: 70px; }
  .gen { grid-template-columns: 1fr; }
  .faq { grid-template-columns: 1fr; }
  .viewer-gen { height: min(84vw, 440px); }
}
@media (max-width: 720px) {
  .toolbar button, .toolbar select, .filebtn { min-height: 44px; }
  body { font-size: 16px; }
  .nav nav { display: none; }
  .nav .btn { min-height: 40px; padding: 8px 14px; }
  .slots { grid-template-columns: repeat(5, minmax(84px, 1fr)); overflow-x: auto; }
  .tabs button { flex: 1; padding: 12px 10px; font-size: 16px; }
  .gen-edit, .gen-out { padding: 12px; }
  .gen-section { padding-left: 0; padding-right: 0; }
  .gen-head, .tabs { padding: 0 var(--m); }
  .price-table thead { display: none; }
  .price-table, .price-table tbody, .price-table tr, .price-table td { display: block; width: 100% !important; }
  .price-table tr { border-top: 3px solid var(--ink); padding: 18px 0; }
  .price-table td { border: 0; padding: 4px 0; text-align: left !important; }
  .fields { grid-template-columns: 1fr; }
  .how-drawings { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .color-grid span { font-size: 16px; padding: 0 12px 12px; }
  .hero-sheet figcaption { font-size: 11px; }
}

/* pasek stron PDF */
.page-strip { background: var(--ground); padding: 12px; margin-bottom: 12px; display: grid; gap: 10px; }
.page-strip p { font-size: 15px; }
.page-strip .btn { justify-self: start; }
.strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.strip figure { flex: 0 0 132px; margin: 0; padding: 6px; background: var(--white); display: grid; gap: 6px; opacity: .55; transition: opacity .16s; }
.strip figure.used { opacity: 1; outline: 3px solid var(--field); outline-offset: -3px; }
.strip canvas { width: 100%; height: auto; display: block; background: #fff; }
.strip select { font-size: 13px; min-height: 34px; padding: 4px; border: 2px solid var(--step); }
