@font-face { font-family: "Barlow"; src: url(/fonts/Barlow-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
  @font-face { font-family: "Barlow"; src: url(/fonts/Barlow-Medium.ttf) format("truetype"); font-weight: 500; font-display: swap; }
  @font-face { font-family: "Barlow Condensed"; src: url(/fonts/BarlowCondensed-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }
  @font-face { font-family: "Barlow Condensed"; src: url(/fonts/BarlowCondensed-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }

  /* Świat: plan rozkroju płyty meblowej. Hala (ciemne tło), płyta (jasna melamina),
     rzaz piły (szczelina między formatkami), okleina (kolor krawędzi = rodzaj oferty). */
  :root {
    --floor: #2B2A27;
    --floor-text: #C9C2B5;
    --board: #EDEAE3;
    --board-hi: #F5F3EE;
    --ink: #22201C;
    --soft: #625D55;
    --edge-ai: #E2602A;
    --edge-wood: #3A5A8C;
    --kerf: 5px;
    --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
    --body: "Barlow", system-ui, sans-serif;
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
  body { margin: 0; background: var(--floor); color: var(--ink); font: 400 17px/1.55 var(--body); caret-color: var(--edge-ai); }
  ::selection { background: var(--edge-ai); color: #fff; }
  :focus-visible { outline: 3px solid var(--edge-ai); outline-offset: 3px; }
  html { scrollbar-color: #5A564F var(--floor); }
  a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }

  .wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

  /* ---------- nagłówek strony ---------- */
  .top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; padding: 24px 0 20px; color: var(--floor-text); font: 600 19px var(--cond); }
  .top nav { display: flex; flex-wrap: wrap; gap: 6px 26px; }
  .top a { text-decoration: none; }
  .top a:hover { color: #fff; }

  /* ---------- arkusz (płyta) ---------- */
  .sheet { margin: 0 0 64px; }
  .sheet-head { display: flex; align-items: center; gap: 12px; color: var(--floor-text); font: 600 16px var(--cond); margin-bottom: 10px; }
  .sheet-head h2 { margin: 0; font: inherit; color: #F1ECE2; font-size: 22px; font-weight: 700; }
  .sheet-head .rule { flex: 1; height: 1px; background: #6F695F; position: relative; }
  .sheet-head .rule::before, .sheet-head .rule::after { content: ""; position: absolute; top: -5px; width: 1px; height: 11px; background: #6F695F; }
  .sheet-head .rule::before { left: 0; } .sheet-head .rule::after { right: 0; }
  .board { display: grid; gap: var(--kerf); background: var(--floor); }

  .p { position: relative; background: var(--board); padding: 28px 28px 30px; min-width: 0;
       background-image: repeating-linear-gradient(90deg, rgba(60,50,40,.022) 0 2px, transparent 2px 9px); }
  .p .mm { position: absolute; top: 12px; right: 14px; font: 600 14px var(--cond); color: var(--soft); font-variant-numeric: tabular-nums; }
  /* okleina: krawędź formatki w kolorze oferty */
  .e-ai-t { box-shadow: inset 0 6px 0 var(--edge-ai); }
  .e-ai-l { box-shadow: inset 6px 0 0 var(--edge-ai); }
  .e-ai-tl { box-shadow: inset 0 6px 0 var(--edge-ai), inset 6px 0 0 var(--edge-ai); }
  .e-wood-t { box-shadow: inset 0 6px 0 var(--edge-wood); }
  .e-wood-l { box-shadow: inset 6px 0 0 var(--edge-wood); }
  .e-wood-tl { box-shadow: inset 0 6px 0 var(--edge-wood), inset 6px 0 0 var(--edge-wood); }

  h1 { font: 700 clamp(58px, 7.6vw, 98px)/.94 var(--cond); margin: 0; padding-bottom: .16em; letter-spacing: -.005em; }
  .p h3 { font: 700 30px/1.05 var(--cond); margin: 0 0 10px; padding-right: 92px; text-wrap: balance; }
  .p p { margin: 0; max-width: 62ch; }
  .p p + p { margin-top: 10px; }
  .quiet { color: var(--soft); }
  .tag { font: 600 15px var(--cond); color: var(--soft); display: block; margin-bottom: 2px; }

  .btn { display: inline-block; font: 700 19px var(--cond); text-decoration: none; padding: 12px 20px; background: var(--ink); color: var(--board-hi); border: 0; cursor: pointer; }
  .btn:hover { background: #000; }
  .btn.ghost { background: none; color: var(--ink); padding-left: 0; padding-right: 0; text-decoration: underline; text-decoration-color: var(--edge-wood); }
  .btn.ghost:hover { color: var(--edge-wood); }
  .linkish { font: 600 17px var(--cond); background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--edge-ai); }

  /* ---------- arkusz 1: start ---------- */
  .s-start .board { grid-template-columns: 1.5fr 1fr 1fr; grid-template-rows: minmax(300px, auto) minmax(200px, auto); }
  .s-start .hero { grid-row: 1 / 3; display: flex; flex-direction: column; justify-content: flex-end; padding: 40px 36px 36px; }
  .hero .lede { font-size: 19px; max-width: 36ch; margin-top: 6px; }
  .hero .cta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
  .p .foot { margin-top: auto; padding-top: 16px; font: 600 17px var(--cond); }
  .stack { display: flex; flex-direction: column; }
  a.p.stack { text-decoration: none; color: inherit; }
  a.p.stack:hover { background-color: var(--board-hi); }
  a.p.stack .foot { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
  .endpoint { font: 500 15px/1.4 var(--body); word-break: break-all; background: var(--board-hi); border: 1px solid #CFC9BE; padding: 6px 9px; margin: 12px 0 10px; display: block; }
  .legend { display: flex; flex-wrap: wrap; gap: 6px 26px; margin-top: 12px; color: var(--floor-text); font: 600 15px var(--cond); }
  .legend i { display: inline-block; width: 24px; height: 5px; vertical-align: middle; margin-right: 7px; }

  /* ---------- arkusz 2: automatyzacje ---------- */
  .s-ai .board { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .s-ai .p:nth-child(-n+2) { grid-column: span 3; }
  .s-ai .p:nth-child(n+3) { grid-column: span 2; }
  .s-ai .p { min-height: 250px; }

  /* ---------- arkusz 3: meble ---------- */
  .s-wood .board { grid-template-columns: 1.4fr 1fr; }
  .s-wood .show { grid-row: span 3; display: flex; flex-direction: column; gap: 16px; }
  .s-wood .show svg { width: 100%; max-width: 420px; height: auto; align-self: center; margin-top: auto; }
  .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--kerf); margin-top: 8px; }
  .gallery img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; }

  /* ---------- arkusz: doświadczenie ---------- */
  .strip { display: grid; gap: var(--kerf); background: var(--floor); }
  .strip .p { padding: 14px 14px 16px; min-height: 120px; overflow: hidden; }
  .strip .p strong { display: block; font: 700 22px/1.05 var(--cond); }
  .strip .p span { display: block; font: 600 15px var(--cond); color: var(--soft); white-space: nowrap; }
  .strip .off { background: repeating-linear-gradient(135deg, #3A3833 0 2px, #2F2D29 2px 10px); min-height: 56px; }
  .strip .row2 { min-height: 56px; }
  .years { position: relative; height: 34px; margin-top: 6px; color: var(--floor-text); font: 600 14px var(--cond); }
  .years i { position: absolute; top: 0; height: 8px; border-left: 1px solid #6F695F; }
  .years b { position: absolute; top: 10px; transform: translateX(-50%); font-weight: 600; }
  .s-exp .board { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--kerf); }
  .s-exp .main { grid-column: span 2; grid-row: span 2; }
  .roles { list-style: none; padding: 0; margin: 12px 0 0; }
  .roles li { display: grid; grid-template-columns: 7.5em 1fr; gap: 2px 12px; padding: 8px 0; border-top: 1px dashed #BDB5A8; }
  .roles li:first-child { border-top: 0; }
  .roles .when { font: 600 16px var(--cond); color: var(--soft); font-variant-numeric: tabular-nums; }
  .roles .what { font-weight: 500; }
  .roles .sum { grid-column: 2; color: #3a3732; font-size: 16px; margin-top: 4px; }
  .s-exp .p:not(.main) .roles li { grid-template-columns: 1fr; }

  /* ---------- arkusz 4: pomiar ---------- */
  .s-measure .board { grid-template-columns: 1.15fr 1fr; }
  .modes { display: flex; gap: 0; margin: 0 0 22px; border: 2px solid var(--ink); width: fit-content; }
  .modes label { position: relative; font: 700 18px var(--cond); padding: 8px 16px; cursor: pointer; }
  .modes input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
  .modes label:has(input:checked) { background: var(--ink); color: var(--board-hi); }
  .modes label:has(input:focus-visible) { outline: 3px solid var(--edge-ai); outline-offset: 2px; }
  .row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
  .field label { display: block; font: 600 16px var(--cond); color: var(--soft); margin-bottom: 4px; }
  .field input, .field textarea { width: 100%; font: 400 18px/1.45 var(--body); color: var(--ink); background: var(--board-hi); border: 2px solid #BDB5A8; border-radius: 0; padding: 8px 10px; }
  .field input:focus, .field textarea:focus { border-color: var(--ink); outline: none; }
  .field textarea { min-height: 92px; resize: vertical; }
  .field + .field { margin-top: 14px; }
  .row3 { align-items: end; }
  .row3 .field + .field { margin-top: 0; }
  .s-measure .go { margin-top: 16px; }
  .readout { display: flex; flex-direction: column; }
  .readout .big { font: 700 clamp(48px, 6vw, 76px)/1 var(--cond); font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
  .readout svg { width: 100%; height: 300px; margin-top: 12px; }
  .result h4 { font: 700 22px var(--cond); margin: 18px 0 4px; }
  .result ul { margin: 6px 0 0; padding-left: 20px; }
  .result .btn { margin-top: 18px; }

  /* ---------- arkusz 5: współpraca ---------- */
  .s-work .board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .s-work .step { min-height: 280px; }
  .s-work .step h3 { display: flex; gap: 10px; align-items: baseline; }
  .s-work .step h3 span { color: var(--soft); }
  .s-work .about { grid-column: span 3; }
  .s-work .contact { display: flex; flex-direction: column; }
  .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
  .chip { font: 600 15px var(--cond); background: var(--board-hi); border: 1px solid #CFC9BE; padding: 2px 9px; }

  /* ---------- widok agenta ---------- */
  .agent-pre { display: none; grid-column: 1 / -1; margin: 0; background: #1A1917; color: #E6DFD2; font: 13px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; padding: 18px 20px; overflow: auto; max-height: 460px; white-space: pre-wrap; word-break: break-word; }
  .agent-pre .req { color: #F2A271; }
  body.agent .agent-pre { display: block; }

  footer { color: var(--floor-text); padding: 8px 0 64px; font-size: 15px; max-width: 70ch; }
  footer a:hover { color: #fff; }

  /* jedyny ruch bez kliknięcia: pierwsza płyta „przechodzi pod piłą” */
  @media (prefers-reduced-motion: no-preference) {
    .s-start .board { animation: cut .9s cubic-bezier(.16,1,.3,1) both; }
    @keyframes cut { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
  }

  @media (max-width: 980px) {
    .s-start .board { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
    .s-start .hero { grid-column: 1 / -1; grid-row: auto; min-height: 420px; }
    .s-ai .p:nth-child(n) { grid-column: span 3; }
    .s-work .board { grid-template-columns: 1fr 1fr; }
    .s-work .about { grid-column: 1 / -1; }
    .s-exp .board { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 640px) {
    .wrap { padding: 0 14px; }
    .board, .s-start .board, .s-wood .board, .s-measure .board, .s-work .board, .s-ai .board { grid-template-columns: minmax(0, 1fr); }
    .s-ai .p:nth-child(n), .s-work .about, .s-exp .main { grid-column: auto; grid-row: auto; }
    .s-exp .board { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
    .strip, .years, .s-exp .legend { display: none; }
    .roles li { grid-template-columns: 1fr; }
    .roles .sum { grid-column: 1; }
    .s-wood .show { grid-row: auto; }
    .s-start .hero { min-height: 0; padding: 32px 22px 28px; }
    .p { padding: 26px 20px 24px; }
    .s-ai .p, .s-work .step { min-height: 0; }
    .row3 { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .readout svg { height: 220px; }
  }

/* ---------- podstrony ---------- */
.skip { position: absolute; left: -9999px; top: 8px; background: var(--board-hi); color: var(--ink); padding: 8px 12px; font: 600 16px var(--cond); z-index: 10; }
.skip:focus { left: 8px; }
.top .brand { color: #F1ECE2; }
.top nav a[aria-current="page"] { color: #fff; text-decoration: underline; text-decoration-color: var(--edge-ai); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.s-intro .board { grid-template-columns: 1.6fr 1fr; }
.s-intro .hero { padding: 40px 36px 36px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 380px; }
.s-intro h1 { font-size: clamp(46px, 6.2vw, 84px); max-width: 14ch; }
.s-intro .lede { font-size: 19px; max-width: 58ch; margin: 6px 0 0; }
.s-intro .lede + .lede { margin-top: 12px; }
.s-intro .cta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.s-intro .show { display: flex; align-items: center; justify-content: center; }
.s-intro .show .cabinet { width: 100%; max-width: 380px; height: auto; }
.s-intro .show .gallery { width: 100%; }
.s-wood .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.s-wood .p { min-height: 240px; }
.s-steps .board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.s-steps .step { min-height: 220px; }
.s-steps .step h3 { display: flex; gap: 10px; align-items: baseline; }
.s-steps .step h3 span { color: var(--soft); }
.s-contact .board { grid-template-columns: 1.6fr 1fr; }
.s-contact .contact { display: flex; flex-direction: column; min-height: 240px; }
.actions { margin-top: auto !important; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.tag.gap { margin-top: 12px; }
.chips.tight { margin-top: 4px; }
.linkrow { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.spaced { margin-top: 14px !important; }
.linkish.on-dark { color: #F1ECE2; font-size: 15px; }
footer code { font: 500 14px var(--body); color: #F1ECE2; word-break: break-all; }
.exp-note { margin-top: 12px; }
@media (max-width: 980px) {
  .s-wood .board, .s-steps .board { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .s-intro .board, .s-contact .board, .s-wood .board, .s-steps .board { grid-template-columns: minmax(0, 1fr); }
  .s-intro .hero { min-height: 0; padding: 32px 22px 28px; }
  .s-wood .p, .s-steps .step, .s-contact .contact { min-height: 0; }
  .exp-note { display: none; }
}

/* ---------- czat z asystentem ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.s-chat .board { grid-template-columns: 1fr 2fr; }
.small { font-size: 15px; }
.chat { display: flex; flex-direction: column; gap: 14px; }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 420px; min-height: 160px; overflow-y: auto; padding-right: 4px; margin-top: 18px; }
.msg { margin: 0; padding: 10px 14px; max-width: 85%; white-space: pre-wrap; }
.msg.bot { background: var(--board-hi); border-left: 4px solid var(--edge-ai); align-self: flex-start; }
.msg.me { background: var(--ink); color: var(--board-hi); align-self: flex-end; }
.msg.wait { color: var(--soft); font-style: italic; }
.chat-form { display: flex; gap: 10px; align-items: stretch; }
.chat-form textarea { flex: 1; font: 400 17px/1.45 var(--body); color: var(--ink); background: var(--board-hi); border: 2px solid #BDB5A8; border-radius: 0; padding: 8px 10px; resize: vertical; min-height: 52px; }
.chat-form textarea:focus { border-color: var(--ink); outline: none; }
@media (max-width: 640px) {
  .s-chat .board { grid-template-columns: minmax(0, 1fr); }
  .chat-form { flex-direction: column; }
  .msg { max-width: 100%; }
}

.avatar-wrap { width: min(200px, 60%); margin: 4px 0 16px; }
.avatar-wrap svg { width: 100%; height: auto; display: block; }
@media (max-width: 640px) { .avatar-wrap { width: 150px; } }

/* ---------- przełącznik języka ---------- */
.top-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.langs { display: flex; gap: 8px; align-items: center; }
.langs a { display: block; line-height: 0; padding: 3px; border: 2px solid transparent; opacity: .55; }
.langs a:hover { opacity: 1; }
.langs a[aria-current="true"] { opacity: 1; border-color: var(--edge-ai); }
.langs svg { width: 26px; height: 16px; display: block; }
@media (max-width: 640px) {
  .top { position: relative; }
  .langs { position: absolute; top: 22px; right: 0; }
}
