/* Faber — landing. Telefon (390 px) jest wersją główną; od 1280 px układ desktopowy z makiety. */

:root {
  --grafit: #1B1A18;
  --papier: #F3EFE6;
  --beton: #E6E1D6;
  --stal: #6B6760;
  --rec: #E03A1E;
  --hivis: #D4EE3A;
  --kafel: #CFC8BA;
  --linia: #D8D2C6;
  --noc: #2A2926;
  --jasny: #A8A298;
  --stencil: 'Saira Stencil One', Impact, 'Arial Narrow', sans-serif;
  --sans: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--papier); color: var(--grafit);
  font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
a { color: var(--grafit); }
a:hover { color: var(--stal); }
:focus-visible { outline: 3px solid var(--rec); outline-offset: 3px; }

.wrap { width: min(1200px, calc(100% - 40px)); margin-inline: auto; }
.mono { font-family: var(--mono); font-weight: 500; }
.eyebrow { font: 500 12px/1.4 var(--mono); letter-spacing: 1px; color: var(--stal); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); flex: none; }

/* --- znak i przyciski --- */
.brand { display: flex; align-items: center; gap: 10px; color: var(--grafit); text-decoration: none; }
.brand:hover { color: var(--grafit); }
.mark { width: 32px; height: 32px; flex: none; }
.mark path { fill: none; stroke: var(--grafit); stroke-width: 26; stroke-linejoin: miter; stroke-linecap: butt; }
.mark circle { fill: var(--rec); }
.mark-light path { stroke: var(--papier); }
.brand-dark .mark circle { fill: var(--grafit); }
.wordmark { font: 26px/1 var(--stencil); letter-spacing: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 6px; background: var(--grafit); color: var(--papier);
  font: 600 17px/1 var(--sans); text-decoration: none; white-space: nowrap;
}
.btn:hover { color: var(--papier); background: #000; }
.btn-sm { height: 44px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.pdf { font-size: 14px; color: var(--stal); }

/* --- nagłówek --- */
.top { background: var(--papier); border-bottom: 1px solid #DDD7CB; }
.top-in { height: 64px; display: flex; align-items: center; justify-content: space-between; }

/* --- hero: sam tekst --- */
.hero-in { padding: 40px 0 56px; display: flex; flex-direction: column; gap: 20px; }
/* najszersza fraza „ROBOTĘ BIUROWĄ.” ma 9,26 em — rozmiar tak, żeby zawsze mieściła się w szerokości ekranu */
h1 { font: 400 min(calc((100vw - 40px) / 9.6), 84px)/0.98 var(--stencil); }
h1 span { white-space: nowrap; }
.lead { max-width: 640px; font-size: 18px; line-height: 1.5; }

/* --- cienki pasek między hero a demo 1: frazy nie łamią się w środku --- */
.strip { background: var(--rec); color: var(--grafit); }  /* jak stopka: czerwień z grafitowym napisem */
.strip-in { padding: 14px 0; text-align: center; font: 400 17px/1.35 var(--stencil); letter-spacing: 1px; text-transform: uppercase; }
.strip-in span { white-space: nowrap; }

/* --- sekcje --- */
.sec { padding: 48px 0; }
.sec-beton { background: var(--beton); }
.sec-head { max-width: 780px; display: flex; flex-direction: column; gap: 12px; }
h2 { font: 400 clamp(34px, 9.5vw, 60px)/1 var(--stencil); }

/* --- elementy diagramów --- */
.card { border-radius: 12px; background: var(--papier); }
.card-beton { background: var(--beton); }
.doc { width: 100%; height: auto; background: #fff; border: 1px solid var(--linia); border-radius: 3px; }
.player { position: relative; display: block; overflow: hidden; border-radius: 10px; background: var(--kafel); }
.player-wide { aspect-ratio: 16 / 9; }
.player-tall { aspect-ratio: 9 / 16; }
.player img { width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%;
  background: var(--grafit); display: grid; place-items: center; box-shadow: 0 2px 14px rgba(27, 26, 24, .3);
  transition: transform .15s ease;
}
.player:hover .play { transform: scale(1.08); }
.play svg { width: 20px; height: 20px; margin-left: 3px; fill: var(--papier); }
.play-sm { width: 46px; height: 46px; }
.play-sm svg { width: 16px; height: 16px; }

/* dokumenty: tap otwiera pełny obraz — ikonka to sygnalizuje */
.doc-wrap, .doc-link, .doc-big { position: relative; display: block; }
.zoom {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(27, 26, 24, .85); display: grid; place-items: center;
}
.zoom svg { width: 14px; height: 14px; fill: none; stroke: var(--papier); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
figcaption { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 15px; line-height: 1.3; text-align: center; }
figcaption strong { font-weight: 600; }
figcaption .mono { font-size: 12px; color: var(--stal); }

.wires, .d2-fork-m, .arrow-down { pointer-events: none; }  /* strzałki leżą nad kartami — nie mogą łapać kliknięć */
.dotted, .dotted path {
  fill: none; stroke: var(--grafit); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 9;
  vector-effect: non-scaling-stroke;
}
.rec-line { fill: none; stroke: var(--rec); stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rec-fill { fill: var(--rec); }

.node { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.disc { width: 96px; height: 96px; border-radius: 50%; background: var(--grafit); display: grid; place-items: center; }
.disc .mark { width: 54px; height: 54px; }
.node-name { font: 18px/1 var(--stencil); letter-spacing: 1px; }

/* --- demo 1 (telefon): wejścia → jedna kropkowana strzałka → Faber → wycena --- */
.d1, .d2 { max-width: 440px; margin: 28px auto 0; }
.d1 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.d1-film { grid-column: 1 / -1; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.doc-card {
  padding: 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; text-decoration: none;
}
.doc-card .doc-wrap { width: 100px; }
.doc-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.35; }
.doc-text strong { font-weight: 600; }
.doc-text span { font-size: 13px; color: var(--stal); }
.d1-wires-m { grid-column: 1 / -1; width: 100%; height: 90px; margin: -6px 0 -2px; }
.d1-wires-d { display: none; }
.d1-node, .d1-arrow-m, .d1-result { grid-column: 1 / -1; }
.d1-node { justify-self: center; }
.d1-arrow-m { justify-self: center; width: 40px; height: 70px; }
.result { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.doc-big img { width: 100%; height: auto; background: #fff; border: 1px solid var(--linia); border-radius: 6px; }
.result-title { font-size: 18px; font-weight: 600; }
.result-meta { margin-top: -8px; font-size: 13px; color: var(--stal); }
.result-actions { display: flex; align-items: center; gap: 16px; }

/* --- demo 2 (telefon): film → Faber → rozwidlenie na dwie karty jedna pod drugą --- */
.d2 { display: flex; flex-direction: column; align-items: center; }
.d2-film { width: min(240px, 72%); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.d2-wires-m { width: 100%; height: 70px; }
.d2-wires-d { display: none; }
.d2-outs { position: relative; width: 100%; margin-top: 4px; padding-left: 26px; }
.d2-fork-m { position: absolute; left: 0; top: 0; width: 100%; height: 70px; }
.d2-outs::before {  /* lewa szyna rozwidlenia: do połowy karty „Dla zarządcy” (min-height 240) */
  content: ""; position: absolute; left: calc(100% * 8 / 350 - 2px); top: 62px; bottom: 120px;
  width: 4px; border-radius: 2px; background: var(--rec);
}
.out { padding: 20px; display: grid; gap: 12px; }
.out .eyebrow { grid-area: eye; }
.doc-link { grid-area: doc; position: relative; display: block; align-self: start; }
.out .doc { width: 110px; }
.out .player { grid-area: vid; }
.out-text { grid-area: text; font-size: 15px; line-height: 1.45; }
.out-title { margin-bottom: 6px; font-weight: 600; line-height: 1.35; }
.d2-ekipa { margin-top: 70px; grid-template-columns: 110px 1fr; grid-template-areas: "eye eye" "doc text" "vid vid"; }
.d2-zarzadca {
  position: relative; margin-top: 40px; min-height: 240px; align-content: start;
  grid-template-columns: 110px 1fr; grid-template-areas: "eye eye" "doc text";
}
.d2-zarzadca::before { content: ""; position: absolute; left: -20px; top: calc(50% - 2px); width: 12px; height: 4px; background: var(--rec); }
.d2-zarzadca::after {
  content: ""; position: absolute; left: -10px; top: calc(50% - 7px);
  border-left: 10px solid var(--rec); border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.stamp {
  position: absolute; right: 8px; bottom: 10px; width: 44px; height: 44px; border: 3px solid var(--rec); border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .7); transform: rotate(-12deg);
}
.stamp svg { width: 24px; height: 24px; }
.stamp path { fill: none; stroke: var(--rec); stroke-width: 30; }

/* --- demo 3 i 4 (telefon): wejścia → Faber → wynik z obrazami --- */
.d3, .d4 { max-width: 440px; margin: 28px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.d3 > *, .d4 > * { grid-column: 1 / -1; }
.d3-node, .d4-node, .d3-arrow-m, .d4-arrow-m { justify-self: center; }
.d3-arrow-m, .d4-arrow-m { width: 40px; height: 70px; }
.d3-wires-m { width: 100%; height: 70px; }
.d4-wires-m { width: 100%; height: 90px; margin: -6px 0 -2px; }
.d3-wires-d, .d4-wires-d { display: none; }
.view { position: relative; display: block; }
.view img { width: 100%; height: auto; border-radius: 6px; background: #fff; }
.view-tag {
  position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 4px;
  background: rgba(27, 26, 24, .85); color: var(--papier); font: 500 11px/1.4 var(--mono); letter-spacing: .5px;
}
.zoom-sm { width: 24px; height: 24px; top: 4px; right: 4px; }
.zoom-sm svg { width: 12px; height: 12px; }

.d3-film { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.d3-pomiary { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chips { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 4px 9px; border-radius: 4px; background: var(--hivis); font: 500 15px/1.3 var(--mono); }
.chips-note { font-size: 14px; line-height: 1.4; color: var(--stal); }
.d3-plan img { border: 1px solid var(--linia); }
.d3-iso img { border: 1px solid var(--linia); }
.d3-text { display: flex; flex-direction: column; gap: 12px; }
.d3-text .result-meta { margin-top: -8px; }
.formats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; }
.formats-label { width: 100%; }  /* telefon: podpis nad plakietkami, żeby PDF nie spadał sam do nowej linii */
.fmt { padding: 3px 8px; border: 1.5px solid var(--grafit); border-radius: 4px; font: 500 13px/1.3 var(--mono); }

.in-card { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.in-card figcaption { font-size: 14px; }
.in-card .view img { aspect-ratio: 16 / 9; object-fit: cover; }  /* kadr 16:9 i model 16:10 — równe karty */
.d4-kadr { grid-column: 1; }
.d4-model { grid-column: 2; }
.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.swatch {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; border-radius: 6px;
  border: 1.5px solid var(--linia); background: var(--papier); color: var(--grafit);
  font: 500 15px/1 var(--sans); text-align: left; cursor: pointer;
}
.swatch:hover { border-color: var(--stal); }
.swatch[aria-pressed="true"] { border-color: var(--grafit); box-shadow: inset 0 0 0 1.5px var(--grafit); font-weight: 600; }
.swatch i { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.sw-zielony { background: #1E3B2C; }
.sw-ocynk { background: linear-gradient(135deg, #D5D8DA 0%, #9DA3A7 55%, #C4C8CA 100%); }
.sw-antracyt { background: #383E42; }
.sw-drewno { background: repeating-linear-gradient(100deg, #8A5A33 0 4px, #A06D40 4px 7px, #7A4E2B 7px 10px); }
.d4-second { display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: center; font-size: 14px; line-height: 1.4; }
.d4-second strong { font-weight: 600; }

/* --- sprzęt --- */
.sec-dark { background: var(--grafit); color: var(--papier); }
.sec-dark .eyebrow { color: var(--jasny); }
.gear { margin-top: 28px; display: grid; gap: 12px; }
.gear-card { padding: 20px; border-radius: 12px; background: var(--noc); display: flex; flex-direction: column; gap: 12px; }
.gear-card svg { width: 160px; height: auto; }
.gear-card h3 { font-size: 18px; font-weight: 600; }
.gear-card p { font-size: 15px; line-height: 1.45; color: var(--linia); }
.gear-core { align-items: center; text-align: center; }
.gear-core svg { width: 240px; }
.gear-core p { font-size: 16px; color: var(--papier); }
.tag { align-self: flex-start; padding: 4px 8px; border-radius: 4px; background: var(--hivis); color: var(--grafit); font: 500 12px/1.3 var(--mono); }

/* --- stopka --- */
.sec-rec { background: var(--rec); color: var(--grafit); }
.foot-in { padding: 56px 0 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 56px; }
.call { font: 400 clamp(60px, 17vw, 140px)/0.9 var(--stencil); }
.call-sub { margin-top: 16px; font-size: 20px; line-height: 1.3; }
.foot-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.foot-bar .mono { font-size: 13px; }

/* --- modal z filmem --- */
html.modal-open { overflow: hidden; }
.vmodal {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(20, 19, 17, .95); color: var(--papier);
}
.vmodal[open] { display: flex; align-items: center; justify-content: center; }
.vmodal::backdrop { background: transparent; }
.vmodal-body { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 72px 16px 24px; }
.vmodal video {
  display: block; aspect-ratio: 16 / 9; width: min(100vw - 32px, (100dvh - 150px) * 16 / 9, 1280px); height: auto;
  border-radius: 10px; background: #000;
}
.vmodal.is-tall video { aspect-ratio: 9 / 16; width: min(100vw - 32px, (100dvh - 150px) * 9 / 16, 720px); }
.vmodal-title { font-size: 13px; color: var(--jasny); text-align: center; }
.vmodal-x {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%; background: var(--papier); color: var(--grafit); display: grid; place-items: center; cursor: pointer;
}
.vmodal-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

/* --- tablet --- */
@media (min-width: 640px) {
  .gear { grid-template-columns: repeat(3, 1fr); }
  .gear-core { grid-column: 1 / -1; }
  .sec-head p { font-size: 18px; }
}
@media (min-width: 900px) {
  .hero-in { padding: 88px 0 96px; gap: 28px; }
}

/* --- desktop: diagramy poziomo, jak w makiecie (1200 px) --- */
@media (min-width: 1280px) {
  .top-in { height: 88px; }
  .top .mark { width: 40px; height: 40px; }
  .top .wordmark { font-size: 32px; }
  .btn-sm { height: 48px; padding: 0 22px; font-size: 16px; }
  .eyebrow { font-size: 14px; }

  .hero-in { padding: 140px 0 128px; }
  h1 { font-size: 76px; }  /* dwie linie po 12,3 i 15,3 em w 1200 px */
  .lead { max-width: none; font-size: 22px; }  /* na desktopie akapit na całą szerokość */
  .btn { height: 56px; padding: 0 26px; font-size: 18px; }
  .btn-sm { height: 48px; padding: 0 22px; font-size: 16px; }

  .strip-in { padding: 20px 0; font-size: 26px; letter-spacing: 1.5px; }

  .sec { padding: 100px 0; }
  .sec-head { gap: 16px; }
  .sec-head p { font-size: 20px; }

  .d1, .d2, .d3, .d4 { position: relative; width: 1200px; max-width: none; margin-top: 56px; }
  .d1 > *, .d2 > *, .d3 > *, .d4 > * { position: absolute; }
  .d3-wires-m, .d3-arrow-m, .d4-wires-m, .d4-arrow-m,
  .d1-wires-m, .d1-arrow-m, .d2-wires-m, .d2-fork-m, .d2-outs::before,
  .d2-zarzadca::before, .d2-zarzadca::after { display: none; }
  .disc { width: 128px; height: 128px; }
  .disc .mark { width: 72px; height: 72px; }
  .node { gap: 16px; }
  .node-name { font-size: 22px; }

  .d1 { display: block; height: 760px; }
  .d1-wires-d { display: block; left: 0; top: 0; width: 1200px; height: 760px; }
  .d1-film { left: 0; top: 30px; width: 300px; padding: 16px; gap: 12px; }
  .doc-card { flex-direction: row; gap: 14px; width: 300px; height: 160px; padding: 16px; text-align: left; }
  .doc-card .doc-wrap { width: 90px; flex: none; }
  .doc-text strong { font-size: 16px; }
  .doc-text span { font-size: 14px; }
  .d1-szablon { left: 0; top: 330px; }
  .d1-cennik { left: 0; top: 540px; }
  .d1-node { left: 496px; top: 316px; }
  .d1-result { left: 800px; top: 0; width: 400px; height: 760px; padding: 24px; gap: 16px; }
  .d1-result .doc-big img { width: 352px; height: 498px; object-fit: cover; object-position: top; }
  .result-title { font-size: 20px; }
  .result-actions .btn-block { width: auto; }

  .d2 { display: block; height: 660px; }
  .d2-wires-d { display: block; left: 0; top: 0; width: 1200px; height: 660px; }
  .d2-film { left: 0; top: 120px; width: 260px; padding: 16px; align-items: center; }
  .d2-film .player { width: 190px; }
  .d2-node { left: 496px; top: 266px; }
  .d2-outs { left: 760px; top: 0; width: 440px; height: 660px; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: space-between; }
  .out { height: 300px; padding: 20px; column-gap: 16px; align-content: start; }
  .out .doc { width: 130px; }
  .d2-ekipa { margin: 0; grid-template-columns: 130px 1fr; grid-template-areas: "eye eye" "doc vid" "doc text"; }
  .d2-ekipa .player { width: 234px; }
  .d2-zarzadca { margin: 0; min-height: 0; grid-template-columns: 130px 1fr; }
  .out-title { font-size: 17px; }
  .stamp { right: 10px; bottom: 12px; width: 52px; height: 52px; }

  /* demo 3 i 4: wejścia z lewej, Faber, duży wynik z prawej (obrazy potrzebują miejsca) */
  .d3, .d4 { display: block; }
  .d3-wires-d, .d4-wires-d { display: block; left: 0; top: 0; width: 1200px; }
  .d3-node, .d4-node { left: 400px; }
  .d3-result, .d4-result { left: 620px; top: 0; width: 580px; padding: 24px; gap: 16px; }

  .d3 { height: 500px; }
  .d3-wires-d { height: 500px; }
  .d3-film { left: 0; top: 0; width: 300px; padding: 16px; gap: 12px; }
  .d3-pomiary { left: 0; top: 272px; width: 300px; height: 228px; padding: 20px; }
  .d3-node { top: 186px; }
  .d3-result {
    height: 500px; display: grid; grid-template-columns: 270px 1fr; column-gap: 20px; row-gap: 14px;
    grid-template-areas: "eye eye" "plan iso" "plan text" "fmt fmt"; grid-template-rows: auto auto 1fr auto; align-content: start;
  }
  .d3-result .eyebrow { grid-area: eye; }
  .d3-plan { grid-area: plan; align-self: start; }
  .d3-iso { grid-area: iso; }
  .d3-text { grid-area: text; }
  .d3-text .result-title { text-wrap: balance; }
  .d3-result .formats { grid-area: fmt; margin-top: 2px; }
  .formats-label { width: auto; margin-right: 4px; }

  .d4 { height: 560px; }
  .d4-wires-d { height: 560px; }
  .in-card { width: 300px; padding: 16px; gap: 12px; }
  .in-card figcaption { font-size: 15px; }
  .d4-kadr { left: 0; top: 0; }
  .d4-model { left: 0; top: 280px; }
  .d4-node { top: 216px; }
  .d4-result { height: 560px; }
  .swatches { grid-template-columns: repeat(4, 1fr); }
  .d4-second { grid-template-columns: 170px 1fr; gap: 16px; font-size: 15px; }

  .gear { display: flex; gap: 24px; margin-top: 56px; }
  .gear-card { width: 250px; padding: 24px; gap: 16px; }
  .gear-card svg { width: 200px; }
  .gear-core { width: 360px; flex: none; justify-content: center; }
  .gear-core svg { width: 300px; }

  .foot-in { min-height: 620px; padding: 110px 0 80px; }
  .call-sub { margin-top: 24px; font-size: 28px; }
  .foot-bar .mark { width: 36px; height: 36px; }
  .foot-bar .wordmark { font-size: 28px; }
  .foot-bar .mono { font-size: 14px; }
}
