/* budops.eu — static product page (ADR 0020). Tokens copied from packages/design-tokens (light + dark). */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap; src: url(fonts/ibm-plex-sans-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: 'Plex fallback'; src: local('Arial'), local('Helvetica'); size-adjust: 106%; ascent-override: 96.7%; descent-override: 25.9%; line-gap-override: 0%; }

:root {
  color-scheme: light dark;
  --bg: #FFFFFF;
  --background: #F4F7FA;
  --surface: #FFFFFF;
  --muted: #E9F2FA;
  --border: #DCE5ED;
  --text: #18334F;
  --text-2: #546A7C;
  --primary: #F2CE54;
  --on-primary: #18334F;
  --accent: #2A6496;
  --brand: #83B4DC;
  --brand-surface: #83B4DC;
  --on-brand-surface: #102030;
  --ok: #1E7A46;
  --warn: #8B4613;
  --ai: #6944A1;
  --ai-surface: #F2EDF9;
  --hot: #B77B56;
  --shadow: 0 1px 2px rgba(24, 51, 79, .06), 0 12px 32px -12px rgba(24, 51, 79, .18);
  --sans: 'IBM Plex Sans', 'Plex fallback', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --gutter: 20px;
  --max: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #102030;
    --background: #0C1926;
    --surface: #192B3D;
    --muted: #263E53;
    --border: #35495C;
    --text: #E4EEF7;
    --text-2: #B2C3D3;
    --accent: #83B4DC;
    --brand-surface: #1F3B57;
    --on-brand-surface: #E4EEF7;
    --ok: #5CCB90;
    --warn: #FFC695;
    --ai: #CFB4F5;
    --ai-surface: #2A2A47;
    --hot: #E6A57C;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  font-feature-settings: 'tnum';
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1; }
::selection { background: var(--primary); color: var(--on-primary); }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; text-wrap: balance; font-variant-numeric: proportional-nums; }
.amount, .it-amt, .totals dd, .proposal-body .row span:last-child { font-variant-numeric: tabular-nums lining-nums; }
p { margin: 0; text-wrap: pretty; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.1875rem; letter-spacing: .02em; min-height: 48px; }
.logo img { width: 30px; height: 30px; }
.top nav { display: flex; gap: 4px; }
.top nav a { color: var(--text-2); text-decoration: none; font-size: 0.9375rem; padding: 0 10px; min-height: 48px; display: inline-flex; align-items: center; border-radius: 8px; }
.top nav a:hover { color: var(--text); background: var(--muted); }
.top nav .hide-sm { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 20px; border-radius: 8px; white-space: nowrap;
  font: 500 1rem/1.2 var(--sans); text-decoration: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background-color .15s ease-out, border-color .15s ease-out, transform .15s ease-out;
}
.btn:hover { background: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, var(--on-primary)); border-color: color-mix(in srgb, var(--primary) 88%, var(--on-primary)); }
.btn svg { flex: none; }
.btn small { font-weight: 400; font-size: 0.8125rem; color: var(--text-2); }

/* Hero */
.hero { padding-block: 40px 64px; }
.hero h1 { font-size: clamp(2.25rem, 8.5vw, 3.75rem); line-height: 1.07; font-weight: 700; letter-spacing: -.02em; max-width: 20ch; }
.hero .lead { margin-top: 18px; font-size: 1.1875rem; line-height: 1.55; color: var(--text-2); max-width: 34ch; }
.hero-grid { display: grid; gap: 28px; grid-template-areas: 'intro' 'chat' 'cta'; }
.intro { grid-area: intro; }
.chat { grid-area: chat; }
.cta { grid-area: cta; }
.actions { display: grid; gap: 10px; }

/* Assistant exchange */
.chat { display: grid; gap: 12px; align-content: start; margin: 0; max-width: 34rem; }
.q, .a { margin: 0; border-radius: 16px; padding: 14px 18px; max-width: 32ch; }
.q { justify-self: end; background: var(--background); border: 1px solid var(--border); border-bottom-right-radius: 4px; }
.a { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; box-shadow: var(--shadow); max-width: 38ch; }
.a .amount { display: block; font-size: 1.75rem; font-weight: 600; line-height: 1.2; margin-bottom: 6px; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding: 0; list-style: none; }
.sources li { font: 400 0.8125rem/1.4 var(--mono); color: var(--accent); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; display: inline-flex; gap: 6px; align-items: center; }
.who { font-size: 0.8125rem; color: var(--text-2); }
.example { font-size: 0.875rem; color: var(--text-2); }

/* Sections */
section.part { padding: 56px 0; border-top: 1px solid var(--border); }
.part-grid { display: grid; gap: 28px; align-items: center; }
.part h2 { font-size: clamp(1.75rem, 5.5vw, 2.5rem); line-height: 1.15; font-weight: 600; letter-spacing: -.01em; max-width: 18ch; }
.part .body { margin-top: 16px; color: var(--text-2); max-width: 46ch; }

/* App screen replicas */
.screen { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; font-size: 0.9375rem; }
.screen-head { background: var(--brand-surface); color: var(--on-brand-surface); padding: 14px 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.screen-head b { font-weight: 600; }
.screen-head span { font-size: 0.8125rem; }

.proposal { margin: 16px; border: 1.5px solid var(--ai); border-radius: 12px; overflow: hidden; }
.proposal-head { background: var(--ai-surface); color: var(--ai); font-size: 0.875rem; font-weight: 500; padding: 8px 14px; display: flex; gap: 8px; align-items: center; }
.proposal-body { padding: 14px; display: grid; gap: 4px; }
.proposal-body .row { display: flex; justify-content: space-between; gap: 12px; }
.proposal-body .row span:first-child { color: var(--text-2); }
.proposal-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.proposal-actions .btn { min-height: 44px; font-size: 0.9375rem; padding: 0 16px; }


/* Two places */
.places { display: grid; gap: 16px; margin-top: 28px; }
.place { padding: 20px 0 0; border-top: 2px solid var(--text); }
.place h3 { font-size: 1.25rem; font-weight: 600; }
.place p { margin-top: 6px; color: var(--text-2); }
.place .status { margin-top: 12px; font-size: 0.9375rem; color: var(--text); }

/* Pricing */

/* Footer */
footer { margin-top: 0; padding: 40px 0 56px; background: var(--background); border-top: 1px solid var(--border); font-size: 0.9375rem; }
.foot-grid { display: grid; gap: 24px; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 4px; margin-left: -10px; }
footer nav a { color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 8px; }
footer nav a:hover { background: var(--muted); }
footer p { color: var(--text-2); }

/* Legal pages */
.doc { padding-block: 32px 64px; }
.doc h1 { font-size: clamp(2rem, 7vw, 3rem); line-height: 1.12; font-weight: 700; letter-spacing: -.01em; }
.doc .meta { margin-top: 8px; color: var(--text-2); font-size: 0.9375rem; }
.doc .content { margin-top: 32px; max-width: 68ch; }
.doc .content h2 { font-size: 1.375rem; font-weight: 600; margin: 36px 0 10px; }
.doc .content p, .doc .content li { color: var(--text); }
.doc .content p + p { margin-top: 12px; }
.pending { margin-top: 28px; padding: 18px 20px; border: 1px dashed var(--border); border-radius: 12px; background: var(--background); max-width: 68ch; }
.pending b { display: block; margin-bottom: 4px; }
.facts { margin: 24px 0 0; display: grid; gap: 0; max-width: 68ch; border-top: 1px solid var(--border); }
.facts div { display: grid; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.facts dt { font-size: 0.875rem; color: var(--text-2); }
.facts dd { margin: 0; font-size: 1.125rem; }

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .top nav .hide-sm { display: inline-flex; }
  .actions { display: flex; flex-wrap: wrap; }
    .places { grid-template-columns: 1fr 1fr; gap: 32px; }
      .facts div { grid-template-columns: 200px 1fr; align-items: baseline; }
}
@media (min-width: 960px) {
  :root { --gutter: 48px; }
  .hero { padding-block: 72px 96px; }
  .hero-grid { grid-template-columns: 1.1fr 1fr; grid-template-areas: 'intro chat' 'cta chat'; column-gap: 72px; row-gap: 36px; align-items: start; }
  .chat { align-self: center; }
  .a .amount { font-size: 2.25rem; }
  .q, .a { font-size: 1.125rem; }
  section.part { padding: 88px 0; }
  .part-grid { grid-template-columns: 1fr 1.1fr; gap: 64px; }
  .part-grid.flip > :first-child { order: 2; }
  /* Short copy beside a tall drawing or screen travels with it instead of floating mid-section. */
  .part-grid { align-items: start; }
  .part-grid > div:first-child { position: sticky; top: 96px; }
  #places-title { max-width: none; }
  .foot-grid { grid-template-columns: 1fr auto; align-items: start; }
}

/* Drawings (inline SVG, theme-aware) with numbered markers placed in HTML over the plot. */
.sheet { margin: 28px 0 0; background: var(--background); border: 1px solid var(--border); border-radius: 16px; overflow: clip; }
.sheet-tight { margin-top: 0; }
.plot { position: relative; padding: 12px; }
.drawing { display: block; width: 100%; height: auto; }
.d-wall { fill: var(--surface); }
.d-hatch { fill: none; stroke: var(--border); stroke-width: 1; }
.d-edge { stroke: var(--text); stroke-width: 2; }
.d-out { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.d-concrete { fill: var(--muted); stroke: var(--text); stroke-width: 2; }
.d-open { fill: var(--background); stroke: var(--text); stroke-width: 2; }
.d-ground { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 8 6; }
.d-chase { fill: var(--muted); stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 4 3; }
.d-pipe { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.d-pipe.d-hot { stroke: var(--hot); }
.d-roof-bare { stroke: var(--text-2); stroke-opacity: .35; stroke-width: 16; stroke-linecap: butt; }
.d-window { fill: var(--muted); stroke: var(--text); stroke-width: 1.5; }
.d-frame { stroke: var(--text); stroke-width: 1.5; }
.d-outlet { fill: var(--surface); stroke: var(--text); stroke-width: 2; }
.d-stack { stroke-width: 16; }
.d-drain { fill: none; stroke: var(--text-2); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.d-clip { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.d-mixer { fill: var(--surface); stroke: var(--text); stroke-width: 2; }
.d-fixture { fill: none; stroke: var(--text-2); stroke-width: 2; stroke-dasharray: 7 5; }
.d-cable { fill: none; stroke: var(--text); stroke-width: 2; stroke-dasharray: 6 5; }
.d-box { fill: var(--brand); stroke: var(--text); stroke-width: 2; }
.d-hole { fill: var(--text); }
.marks { position: absolute; inset: 12px; pointer-events: none; }
.mk { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--on-primary); border: 2px solid var(--on-primary); font: 700 0.875rem/1 var(--sans); display: grid; place-items: center; }
/* Marker positions in percent of each drawing's viewBox (house 720x440, wall 600x420). */
.mk.h1 { left: 50%; top: 89.5%; } .mk.h2 { left: 30%; top: 21%; } .mk.h3 { left: 28.5%; top: 57.7%; } .mk.h4 { left: 62.8%; top: 68.2%; }
.mk.w1 { left: 22%; top: 52%; } .mk.w2 { left: 64%; top: 43%; } .mk.w3 { left: 62%; top: 62%; }
.sheet figcaption { padding: 4px 20px 20px; }
.legend { margin: 0; padding: 0; list-style: none; counter-reset: mark; display: grid; gap: 12px; }
.legend li { counter-increment: mark; display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; align-items: baseline; color: var(--text-2); }
.legend li::before { content: counter(mark); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--on-primary); border: 2px solid var(--on-primary); font-weight: 700; display: grid; place-items: center; line-height: 1; }
.legend b { color: var(--text); font-weight: 600; display: block; }
.key { margin: 4px 0 16px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.875rem; color: var(--text-2); }
.key li { display: inline-flex; align-items: center; gap: 8px; }
.key i { display: inline-block; width: 22px; height: 0; border-top: 4px solid var(--accent); }
.key .k-hot { border-top-color: var(--hot); }
.key .k-drain { border-top: 6px solid var(--text-2); }
.key .k-cable { border-top: 2px dashed var(--text); }
.sheet .example { margin-top: 14px; }
.mock { pointer-events: none; }
.closing { background: var(--background); }
.closing .actions { margin-top: 24px; }
.cta .actions { margin-top: 0; }

@media (min-width: 640px) {
  .legend { grid-template-columns: repeat(2, 1fr); gap: 16px 32px; }
  .sheet figcaption { padding: 4px 32px 28px; }
  .plot { padding: 20px; }
  .marks { inset: 20px; }
  .mk { width: 34px; height: 34px; font-size: 1rem; }
}
@media (min-width: 960px) {
  .legend.legend-3 { grid-template-columns: 1fr; gap: 12px; }
}

/* Kosztorys replica: tabs, totals, items with evidence chips (labels as in the app). */
.tabs { display: flex; gap: 4px; padding: 12px 16px 0; }
.tabs span { font-size: 0.875rem; padding: 8px 12px; border-radius: 8px; color: var(--text-2); }
.tabs .on { background: var(--muted); color: var(--text); font-weight: 500; }
.totals { margin: 12px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr)); gap: 8px; }
.totals div { background: var(--background); border-radius: 8px; padding: 8px 10px; }
.totals dt { font-size: 0.75rem; color: var(--text-2); }
.totals dd { margin: 0; font-weight: 600; font-size: 0.9375rem; white-space: nowrap; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'name amt' 'name chip'; gap: 2px 12px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: center; }
.it-name { grid-area: name; font-weight: 500; }
.it-name small { display: block; font-weight: 400; font-size: 0.8125rem; color: var(--text-2); }
.it-name small.over { color: var(--warn); }
.it-amt { grid-area: amt; justify-self: end; font-weight: 600; white-space: nowrap; }
.chip { grid-area: chip; justify-self: end; font-size: 0.75rem; color: var(--accent); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.proposal-body .vat { margin-top: 6px; font-size: 0.8125rem; color: var(--text-2); }

@media (max-width: 639px) {
  .hero { padding-block: 20px 48px; }
  .hero-grid { gap: 20px; }
  .hero .lead { margin-top: 12px; font-size: 1.125rem; }
  .q, .a { padding: 12px 16px; }
  .a .amount { font-size: 1.5rem; }
  .totals dd { font-size: 0.875rem; }
}

/* Motion (CSS only: the CSP allows no scripts). Final states are the defaults, so nothing hides if a feature is missing.
   Focal moment: the assistant answer arrives with its sources. Supporting: the house builds from the foundation up and
   water runs through the bathroom pipes as each drawing scrolls into view; markers stamp in when their part exists. */
@property --k { syntax: '<integer>'; initial-value: 25; inherits: false; }
.tick { --k: 25; counter-reset: k var(--k); }
.tick::before { content: counter(k); }
.tick-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
  .chat .q { animation: m-rise .45s cubic-bezier(.16, 1, .3, 1) .1s both; }
  .chat .a { animation: m-unfold .6s cubic-bezier(.16, 1, .3, 1) .35s both; }
  .chat .tick { animation: m-count .9s cubic-bezier(.16, 1, .3, 1) .5s both; }
  .chat .sources li { animation: m-stamp .45s cubic-bezier(.16, 1, .3, 1) both; }
  .chat .sources li:nth-child(1) { animation-delay: 1.2s; }
  .chat .sources li:nth-child(2) { animation-delay: 1.32s; }
  .chat figcaption { animation: m-fade .5s ease-out 1.5s both; }
}
@media (prefers-reduced-motion: reduce) {
  .chat .a, .chat .sources { animation: m-fade .3s ease-out .2s both; }
}
@keyframes m-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes m-unfold { from { opacity: 0; clip-path: inset(0 0 100% 0 round 16px); transform: translateY(8px); } to { clip-path: inset(-24px -24px -40px -24px round 16px); } }
@keyframes m-count { from { --k: 0; } }
@keyframes m-stamp { from { opacity: 0; transform: scale(1.25); filter: blur(4px); } }
@keyframes m-fade { from { opacity: 0; } }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .house .plot { view-timeline: --house block; }
    .house .drawing { animation: m-build linear both; animation-timeline: --house; animation-range: entry 20% cover 50%; }
    .house .mk { animation: m-pin linear both; animation-timeline: --house; }
    /* Construction order: foundation (1), walls and roof (2), windows (3), installations (4). */
    .house .mk.h1 { animation-range: cover 22% cover 27%; }
    .house .mk.h2 { animation-range: cover 47% cover 52%; }
    .house .d-windows { animation: m-fade linear both; animation-timeline: --house; animation-range: cover 52% cover 57%; }
    .house .mk.h3 { animation-range: cover 55% cover 60%; }
    .house .d-install { animation: m-fade linear both; animation-timeline: --house; animation-range: cover 60% cover 65%; }
    .house .mk.h4 { animation-range: cover 63% cover 68%; }

    .wall .plot { view-timeline: --wall block; }
    .wall .d-pipe { stroke-dasharray: 220; animation: m-flow linear both; animation-timeline: --wall; animation-range: entry 30% cover 45%; }
    .wall .d-drain:not(.d-stack) { stroke-dasharray: 360; animation: m-flow-long linear both; animation-timeline: --wall; animation-range: cover 30% cover 48%; }
    .wall .mk { animation: m-pin linear both; animation-timeline: --wall; animation-range: cover 44% cover 52%; }
  }
}
@keyframes m-build { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes m-pin { from { opacity: 0; transform: translate(-50%, -50%) scale(1.8); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes m-flow { from { stroke-dashoffset: 220; } to { stroke-dashoffset: 0; } }
@keyframes m-flow-long { from { stroke-dashoffset: 360; } to { stroke-dashoffset: 0; } }

/* Kosztorys: costs file into Poniesione one by one and both totals follow, so the sums visibly add up.
   Totals are counters (thousands and hundreds) whose final values are the defaults; the screen is aria-hidden
   behind its role="img" label, so assistive tech reads the label, not the counters. */
@property --t { syntax: '<integer>'; initial-value: 0; inherits: false; }
@property --h { syntax: '<integer>'; initial-value: 0; inherits: false; }
.sum { counter-reset: t var(--t) h var(--h); }
.sum::before { content: counter(t) "\00a0" counter(h) "00\00a0zł"; }
.s-inc { --t: 165; --h: 7; }
.s-left { --t: 246; --h: 3; }
.reader .proposal { position: relative; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .ledger { view-timeline: --ledger block; }
    .ledger .items li { animation: m-file linear both; animation-timeline: --ledger; }
    .ledger .items li:nth-child(1) { animation-range: cover 22% cover 27%; }
    .ledger .items li:nth-child(2) { animation-range: cover 30% cover 35%; }
    .ledger .items li:nth-child(3) { animation-range: cover 38% cover 43%; }
    .ledger .items li:nth-child(4) { animation-range: cover 46% cover 51%; }
    .ledger .items .chip { animation: m-pin-chip linear both; animation-timeline: --ledger; }
    .ledger .items li:nth-child(1) .chip { animation-range: cover 25% cover 28%; }
    .ledger .items li:nth-child(2) .chip { animation-range: cover 33% cover 36%; }
    .ledger .items li:nth-child(3) .chip { animation-range: cover 41% cover 44%; }
    .ledger .items li:nth-child(4) .chip { animation-range: cover 49% cover 52%; }
    .ledger .s-inc { animation: m-sum-inc steps(1, end) both; animation-timeline: --ledger; animation-range: cover 20% cover 52%; }
    .ledger .s-left { animation: m-sum-left steps(1, end) both; animation-timeline: --ledger; animation-range: cover 20% cover 52%; }

    .reader { view-timeline: --reader block; }
    .reader .proposal::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(var(--ai), var(--ai)) top / 100% 2px no-repeat; animation: m-scan linear both; animation-timeline: --reader; animation-range: cover 20% cover 46%; }
    .reader .proposal-body .row, .reader .proposal-body .vat { animation: m-read linear both; animation-timeline: --reader; }
    .reader .proposal-body .row:nth-child(1) { animation-range: cover 24% cover 28%; }
    .reader .proposal-body .row:nth-child(2) { animation-range: cover 28% cover 32%; }
    .reader .proposal-body .row:nth-child(3) { animation-range: cover 32% cover 36%; }
    .reader .proposal-body .row:nth-child(4) { animation-range: cover 36% cover 40%; }
    .reader .proposal-body .vat { animation-range: cover 40% cover 44%; }
    .reader .proposal-actions .btn { animation: m-pin-chip linear both; animation-timeline: --reader; animation-range: cover 47% cover 51%; }
  }
}
@keyframes m-file { from { opacity: 0; transform: translateY(-10px); } }
@keyframes m-pin-chip { from { opacity: 0; transform: scale(1.4); } }
@keyframes m-read { from { opacity: 0; filter: blur(3px); } }
@keyframes m-scan { from { transform: translateY(0); opacity: 1; } 95% { opacity: 1; } to { transform: translateY(100%); opacity: 0; } }
@keyframes m-sum-inc { 0% { --t: 0; --h: 0; } 25% { --t: 43; --h: 8; } 50% { --t: 117; --h: 3; } 75% { --t: 155; --h: 7; } 100% { --t: 165; --h: 7; } }
@keyframes m-sum-left { 0% { --t: 412; --h: 0; } 25% { --t: 368; --h: 2; } 50% { --t: 294; --h: 7; } 75% { --t: 256; --h: 3; } 100% { --t: 246; --h: 3; } }

/* 404: an empty plot staked out with string, in the drawings' line work. */
.lost .plot-empty { display: block; width: min(100%, 30rem); height: auto; margin: 8px 0 28px; }
.d-string { fill: var(--muted); stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.d-stake line { stroke: var(--text); stroke-width: 4; stroke-linecap: round; }
@media (prefers-reduced-motion: no-preference) {
  .d-stake line { animation: m-stake .5s cubic-bezier(.16, 1, .3, 1) both; transform-box: fill-box; transform-origin: bottom; }
  .d-stake line:nth-child(2) { animation-delay: .1s; } .d-stake line:nth-child(3) { animation-delay: .2s; } .d-stake line:nth-child(4) { animation-delay: .3s; }
  .d-string { animation: m-fade .4s ease-out .45s both; }
}
@keyframes m-stake { from { transform: scaleY(0); } }

/* Hardening: long words (addresses, document numbers) wrap instead of widening the page; Polish hyphenation in prose. */
body { overflow-wrap: break-word; }
p, li, dd { hyphens: auto; }
.sources li, .chip, .btn, .it-amt, .totals dd { hyphens: manual; }

/* Print: the page as a readable sheet, no navigation chrome, no motion, links spelled out. */
@media print {
  :root, :root:not([data-theme]) { color-scheme: light; --bg: #fff; --background: #fff; --surface: #fff; --muted: #fff; --border: #bbb; --text: #000; --text-2: #333; --accent: #000; --brand: #ddd; --brand-surface: #fff; --on-brand-surface: #000; --ai: #000; --ai-surface: #fff; --warn: #000; --ok: #000; --hot: #555; }
  body { font-size: 11pt; }
  .top nav, .actions, .cta, .closing .actions { display: none; }
  section.part { padding: 16pt 0; break-inside: avoid; }
  .screen, .sheet { box-shadow: none; break-inside: avoid; }
  *, *::before, *::after { animation: none !important; }
  main a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #333; }
  footer { background: none; }
}

/* Phone held sideways: a short viewport keeps the headline to two lines and the first actions in reach. */
@media (orientation: landscape) and (max-height: 500px) {
  .hero { padding-block: 16px 40px; }
  .hero h1 { font-size: 2.25rem; max-width: 26ch; }
  .hero .lead { font-size: 1.0625rem; }
}

/* Overdrive: the whole page is one build. A small house in the margin rises with the scroll in construction order
   (foundation, walls, roof, windows, pipes) and names the current stage. Narrower screens get a thin stage bar.
   Only where scroll-driven animation exists and motion is welcome; otherwise nothing is shown. */
.site-build { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .site-build { display: block; position: fixed; z-index: 5; pointer-events: none; }
    .site-build svg { display: block; width: 100%; height: auto; }
    .sb-roof { fill: var(--muted); }
    .sb-pipe { stroke-width: 3; stroke-dasharray: 30; }
    .site-build .stages { margin: 4px 0 0; font-size: .75rem; font-weight: 500; color: var(--text-2); display: grid; }
    .site-build .stages span { grid-area: 1 / 1; opacity: 0; }

    .sb-found { transform-box: fill-box; transform-origin: bottom; animation: sb-rise linear both; animation-timeline: scroll(root); animation-range: 4% 14%; }
    .sb-walls { animation: sb-clip linear both; animation-timeline: scroll(root); animation-range: 14% 40%; }
    .sb-roof { animation: sb-clip linear both; animation-timeline: scroll(root); animation-range: 40% 58%; }
    .sb-win { animation: m-fade linear both; animation-timeline: scroll(root); animation-range: 58% 72%; }
    .sb-pipe { animation: sb-pipe linear both; animation-timeline: scroll(root); animation-range: 72% 88%; }
    .stages span { animation: sb-stage linear both; animation-timeline: scroll(root); }
    .stages span:nth-child(1) { animation-range: 2% 14%; }
    .stages span:nth-child(2) { animation-range: 14% 58%; }
    .stages span:nth-child(3) { animation-range: 58% 72%; }
    .stages span:nth-child(4) { animation: sb-stage-last linear both; animation-timeline: scroll(root); animation-range: 72% 80%; }

    @media (min-width: 1360px) {
      .site-build { right: 20px; bottom: 24px; width: 104px; }
    }
    @media (max-width: 1359px) {
      .site-build { top: 0; left: 0; right: 0; height: 3px; background: var(--brand); transform-origin: left; animation: sb-bar linear both; animation-timeline: scroll(root); }
      .site-build svg, .site-build .stages { display: none; }
    }
  }
}
@keyframes sb-rise { from { transform: scaleY(0); } }
@keyframes sb-clip { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes sb-pipe { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes sb-stage { 0% { opacity: 0; } 12%, 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sb-stage-last { from { opacity: 0; } to { opacity: 1; } }
@keyframes sb-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
