/* Automatify
   Koncepcja: granat rozdzielni i bursztyn zapalonego światła (oba z logo). Góra każdej strony jest
   granatowa, treść jasna. Małe opisy wersalikami pochodzą z rysunku technicznego: tak podpisuje się
   rozdzielnie i schematy. Całość w jednym kroju (Manrope). */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-pl.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light;

  --night: #0c1a29;
  --night-2: #142739;
  --night-line: #2b4257;
  --on-night: #edf2f6;
  --on-night-muted: #b4c3d1;

  --day: #f3f5f7;
  --white: #ffffff;
  --ink: #101e2c;
  --muted: #4e5f70;
  --line: #d3dae1;

  --blue: #1b8bd6;      /* niebieski z logo */
  --blue-text: #14679f; /* ten sam odcień, czytelny na jasnym tle */
  --amber: #f7a41d;     /* bursztyn z logo */
  --alert: #ff8a73;

  --font-body: "Manrope", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  --step-3: clamp(1.95rem, 1.45rem + 2.1vw, 3.25rem);

  --gutter: clamp(16px, 4vw, 56px);
  --section: clamp(4rem, 3rem + 5vw, 8rem);
  --max: 1360px;
  --wire: 1.1rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }

body {
  margin: 0;
  background: var(--day);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.05rem, 1rem + 3vw, 3.6rem); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; }

p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.on-night :focus-visible { outline-color: var(--amber); }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 100;
  padding: .6rem 1rem; background: var(--amber); color: var(--night); font-weight: 600;
}
.skip:focus { top: .5rem; }

/* Układ */
.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.section { padding-block: var(--section); }
.on-night { background: var(--night); color: var(--on-night); }
.on-white { background: var(--white); }

/* Opisy w stylu rysunku technicznego */
.tag, .tile-tag, .facts dt, .steps li::before, .foot-grid h2 {
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tag { color: var(--muted); }
.on-night .tag { color: var(--on-night-muted); }

.lead { font-size: var(--step-1); line-height: 1.5; max-width: 38rem; }
.measure { max-width: 40rem; }
.stack { display: grid; gap: 1.1rem; }
.link-more {
  display: inline-flex; gap: .5em; align-items: baseline;
  color: var(--blue-text); font-weight: 600; text-underline-offset: .22em;
}
.on-night .link-more { color: var(--amber); }

/* Przyciski */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: .7rem 1.4rem;
  border: 1px solid transparent; border-radius: 2px;
  font: inherit; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-amber { background: var(--amber); color: var(--night); }
.btn-amber:hover { background: #ffb948; }
.btn-line { border-color: currentColor; }
.btn-line:hover { background: var(--on-night); border-color: var(--on-night); color: var(--night); }
.btn-ink { background: var(--night); color: var(--on-night); }
.btn-ink:hover { background: var(--blue-text); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Nagłówek */
.site-head { position: sticky; top: 0; z-index: 50; background: var(--night); color: var(--on-night); border-bottom: 1px solid var(--night-line); }
.site-head .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4.75rem; }
.brand img { width: 210px; height: auto; }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.25rem); margin-left: auto; }
.site-nav a { text-decoration: none; font-weight: 500; padding-block: .4rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--on-night-muted); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--amber); }

/* Pierwszy ekran */
.hero { overflow: hidden; }
.hero-grid {
  display: grid; gap: clamp(2.5rem, 4vw, 4.5rem);
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  padding-block: clamp(2.5rem, 2rem + 3vw, 5rem);
}
.hero-copy { display: grid; gap: 1.5rem; min-width: 0; justify-items: start; }
.hero-copy .lead { color: var(--on-night-muted); }
.hero h1 span { display: block; margin-top: .25em; color: var(--amber); }

.refs { border-top: 1px solid var(--night-line); }
.refs .wrap { display: flex; flex-wrap: wrap; gap: .4rem 2.5rem; padding-block: 1.1rem; }
.refs strong { font-weight: 400; color: var(--on-night); }

/* Schemat rozdzielni w pierwszym ekranie: granatowa karta z nagłówkiem, w środku bez ramek, z dużym i jasnym tekstem */
.scene { min-width: 0; display: grid; gap: 1rem; }
.board-card {
  --b-ink: var(--on-night); --b-muted: #bfcddb; --b-line: #41596f; --b-wire: var(--amber); --b-alert: #ff9c88;
  display: grid; gap: 1.4rem; color: var(--b-ink);
  padding: clamp(1.25rem, 2.5vw, 2rem); border: 1px solid #2c4358; border-radius: 1rem; background: rgba(255, 255, 255, .04);
}
.board-intro { display: grid; gap: .6rem; }
.board-title { font-size: var(--step-1); line-height: 1.25; }
.board-intro p:last-child { color: var(--b-muted); max-width: 38rem; }
.board-card .tag { color: var(--b-muted); }
.node { position: relative; display: grid; gap: .15rem; padding: .25rem 0; transition: opacity .5s; }
.node strong { font-size: 1.0625rem; font-weight: 600; line-height: 1.25; }
.node .state { font-size: .875rem; color: var(--b-muted); }
.sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: var(--wire); }
.sources .node { justify-items: center; text-align: center; }
.sources .node::before { content: ""; width: .6rem; height: .6rem; margin-bottom: .4rem; border-radius: 50%; background: var(--b-line); transition: background-color .5s; }
.sources .node::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: var(--wire); background: var(--b-line); transition: background-color .5s; }
.node[data-active="true"]::before, .node[data-active="true"]::after { background: var(--b-wire); }
.node[data-active="false"] { opacity: .8; }
.node[data-fault="true"] { opacity: 1; }
.node[data-fault="true"]::before { background: var(--b-alert); }
.node[data-fault="true"] .state { color: var(--b-alert); font-weight: 600; }
.node-szr { justify-self: center; justify-items: center; text-align: center; padding: .5rem 1.25rem; border: 1px solid var(--b-wire); border-radius: 999px; }
.node-szr .tag { font-size: .75rem; }
.wire { width: 1px; height: var(--wire); margin: 0 auto; background: var(--b-wire); }
.node-rg { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 1rem 0; border-block: 1px solid var(--b-line); }
.node-rg > div { display: grid; gap: .15rem; }
.total { font-size: clamp(2rem, 1.4rem + 1.8vw, 2.75rem); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.total b { font-weight: 600; }
.total span, .kw span { font-size: .875rem; font-weight: 500; color: var(--b-muted); }
.circuits { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-block: var(--wire); }
.circuits::before { content: ""; position: absolute; top: calc(-1 * var(--wire)); left: 12.5%; right: 12.5%; height: 1px; background: var(--b-wire); }
.circuit { position: relative; display: grid; gap: .15rem; align-content: start; justify-items: center; text-align: center; padding-top: .2rem; }
.circuit::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 1px; height: var(--wire); background: var(--b-wire); }
.circuit strong { font-size: 1rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.circuit .tag { font-size: .75rem; line-height: 1.35; letter-spacing: .05em; }
.circuit strong, .circuit .kw, .circuit .bar { transition: opacity .5s; }
.kw { margin-top: .3rem; font-variant-numeric: tabular-nums; }
.kw b { font-size: 1.375rem; font-weight: 600; }
.bar { display: block; width: 100%; height: 3px; margin-top: .5rem; background: var(--b-line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); transform-origin: left; transition: transform .9s ease; }
.circuit.is-shed strong, .circuit.is-shed .kw, .circuit.is-shed .bar { opacity: .5; }
.circuit.is-shed .tag { color: var(--b-alert); font-weight: 700; }
.iot { grid-template-columns: auto minmax(0, 1fr); gap: .2rem 1rem; align-items: baseline; padding: 1rem 0 0; border-top: 1px dashed var(--b-line); }
.iot .tag { grid-column: 1 / -1; }
.iot time { font-size: .9375rem; font-weight: 700; color: var(--amber); font-variant-numeric: tabular-nums; }
.iot p { min-height: 2.9em; font-size: 1rem; line-height: 1.45; }

.scene-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.scene-tabs[hidden] { display: none; }
.scene-tabs button {
  appearance: none; background: transparent; color: var(--b-ink); border: 1px solid #52697e; border-radius: 999px;
  padding: .55rem 1.1rem; font: inherit; font-size: .9375rem; font-weight: 600; line-height: 1.2; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.scene-tabs button small { margin-left: .5rem; font-size: .8125rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--b-muted); }
.scene-tabs button:hover { border-color: var(--b-muted); }
.scene-tabs button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--night); }
.scene-tabs button[aria-pressed="true"] small { color: var(--night); }
.scene-tabs button.is-alert::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .5rem; border-radius: 50%; background: var(--b-alert); vertical-align: .08em; }
.scene-tabs button.is-alert[aria-pressed="true"]::before { background: var(--night); }
.scene-note { font-size: .8125rem; color: var(--on-night-muted); }

/* Lista usług */
.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.split-head { display: grid; gap: 1.1rem; position: sticky; top: 7rem; }
.svc-list { border-top: 1px solid var(--line); }
.svc-list a {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) auto; gap: .5rem 2rem; align-items: baseline;
  padding-block: 1.4rem; border-bottom: 1px solid var(--line); text-decoration: none;
}
.svc-list .arrow { color: var(--blue-text); font-size: 1.25rem; line-height: 1; transition: transform .15s; }
.svc-list a:hover h3 { color: var(--blue-text); }
.svc-list a:hover .arrow { transform: translateX(4px); }
.svc-title { display: grid; gap: .3rem; }

/* Uprawnienia */
.creds { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.creds-head { display: grid; gap: 1.25rem; }
.cred-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); }
.cred { display: grid; gap: .75rem; align-content: start; padding: clamp(1.1rem, 2vw, 1.6rem); border: 1px solid var(--line); background: var(--day); }
.cred p { color: var(--muted); }
.cred-scope { grid-column: 1 / -1; padding: clamp(1.1rem, 2vw, 1.6rem); border: 1px solid var(--night); background: var(--night); color: var(--on-night); display: grid; gap: .5rem; }
.cred-scope .tag { color: var(--amber); font-size: var(--step--1); line-height: 1.5; }
.cred-scope p:not(.tag) { font-size: 1.0625rem; line-height: 1.5; }
.cred-scope .scope-list { display: grid; gap: .45rem; }
.cred-scope .scope-list li { position: relative; padding-left: 1.1rem; color: var(--on-night-muted); }
.cred-scope .scope-list li::before { content: ""; position: absolute; left: 0; top: .75em; width: .5rem; height: 1px; background: var(--amber); }
.cred-scope .scope-spec { padding-top: .8rem; border-top: 1px solid var(--night-line); font-size: .9375rem !important; color: var(--on-night-muted); }

/* Wycinek projektu */
.project-figure { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: end; margin: clamp(2.5rem, 4vw, 4rem) 0 0; }
.project-figure-img { display: block; border: 1px solid var(--line); background: #fff; }
.project-figure img { width: 100%; height: auto; }
.project-figure figcaption { display: grid; gap: .8rem; justify-items: start; }
.project-figure figcaption p:not(.tag) { color: var(--muted); }

/* Realizacje na stronie głównej */
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 2rem; margin-bottom: clamp(2rem, 3vw, 3.5rem); }
.mosaic { display: grid; gap: clamp(1.25rem, 2vw, 1.75rem); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.tile { display: grid; gap: .9rem; align-content: start; min-width: 0; text-decoration: none; }
.tile-photo { position: relative; overflow: hidden; background: var(--line); }
.tile-photo picture, .tile-photo img { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile-photo img { object-fit: cover; transition: transform .5s ease; }
.tile:hover .tile-photo img { transform: scale(1.025); }
.tile:hover h3 { color: var(--blue-text); }
.tile-copy { display: grid; gap: .4rem; justify-items: start; }
.tile-copy p { color: var(--muted); max-width: 34rem; }
.tile-more { color: var(--blue-text); font-weight: 600; margin-top: .2rem; }
.tile:hover .tile-more { text-decoration: underline; text-underline-offset: .22em; }
.tile-a { grid-column: span 8; }
.tile-a .tile-photo { aspect-ratio: 16 / 10; }
.tile-b { grid-column: span 4; }
.tile-b .tile-photo { aspect-ratio: 4 / 5; }
.tile-c, .tile-d { grid-column: span 6; }
.tile-e { grid-column: span 4; }
.tile-e .tile-photo { aspect-ratio: 4 / 5; }
.tile-low .tile-photo img { object-position: 50% 72%; }
.tile-c .tile-photo, .tile-d .tile-photo { aspect-ratio: 16 / 9; }
.tile-tag { color: var(--blue-text); }

/* Z realizacji: rozdzielnice */
.behind { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.behind-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.6rem, 1.2vw, 1rem); }
.behind-photos figure { margin: 0; }
.behind-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.behind-photos .caption { grid-column: 1 / -1; }
.behind-mosaic { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.behind-mosaic .tall { position: relative; grid-row: span 2; min-height: 0; overflow: hidden; }
.behind-mosaic .tall picture, .behind-mosaic .tall img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.spec { display: grid; border-top: 1px solid var(--night-line); }
.spec li { padding-block: .8rem; border-bottom: 1px solid var(--night-line); }

/* Zrzut systemu opomiarowania */
.meter { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.meter-figure { display: grid; gap: .75rem; margin: 0; min-width: 0; }
.meter-figure a { display: block; border: 1px solid var(--night-line); }
.meter-figure img { width: 100%; height: auto; }
.on-night .app-points li::before { background: var(--amber); }

/* Tekst prawny (polityka prywatności) */
.legal { display: grid; gap: 1rem; max-width: 46rem; }
.legal h2 { margin-top: 1.75rem; font-size: var(--step-2); }
.legal h2:first-child { margin-top: 0; }
.legal h3 { margin-top: .5rem; font-size: var(--step-1); }
.legal ul { display: grid; gap: .5rem; padding-left: 1.25rem; list-style: disc; }
.legal li::marker { color: var(--blue-text); }
.legal a { color: var(--blue-text); text-underline-offset: .2em; }
.form-note a { color: inherit; text-underline-offset: .2em; }

/* Obszar działania */
.areas { display: flex; flex-wrap: wrap; gap: .5rem; }
.areas li { padding: .45rem 1rem; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .9375rem; background: var(--day); }
.behind > .stack { justify-items: start; }

/* Jak pracuję */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.25rem, 2.5vw, 2.5rem); counter-reset: step; }
.steps li { display: grid; gap: .6rem; align-content: start; padding-top: 1rem; border-top: 2px solid var(--ink); counter-increment: step; }
.steps li::before { content: "Etap " counter(step); color: var(--muted); }

/* Partnerzy */
.partners { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.5rem clamp(1.5rem, 3vw, 3.5rem); align-items: center; margin-top: 2.5rem; }
.partners a { display: flex; align-items: center; justify-content: center; height: 4.75rem; }
.partners img { max-height: 100%; max-width: 100%; width: auto; object-fit: contain; filter: grayscale(1); opacity: .78; mix-blend-mode: multiply; transition: filter .2s, opacity .2s; }
.partners a:hover img { filter: none; opacity: 1; }

/* Zaproszenie do kontaktu */
.cta { position: relative; overflow: hidden; }
.cta > picture, .cta > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.cta-salon > picture img { object-position: 50% 36%; }
.cta-schody > picture img { object-position: 50% 50%; }
.cta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12, 26, 41, .94) 0%, rgba(12, 26, 41, .82) 42%, rgba(12, 26, 41, .25) 100%); }
.cta .wrap { position: relative; z-index: 1; }
.cta-copy { display: grid; gap: 1.4rem; max-width: 36rem; padding-block: var(--section); justify-items: start; }

/* Stopka */
.site-foot { background: var(--night); color: var(--on-night); border-top: 1px solid var(--night-line); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2fr)); gap: 2.5rem clamp(1.5rem, 3vw, 3rem); padding-block: clamp(3rem, 5vw, 4.5rem); }
.foot-grid h2 { color: var(--on-night-muted); margin-bottom: .75rem; }
.foot-grid ul { display: grid; gap: .35rem; }
.foot-grid a { text-decoration: none; }
.foot-grid a:hover { color: var(--amber); }
.foot-brand { display: grid; gap: 1rem; align-content: start; justify-items: start; }
.foot-brand img { width: 170px; }
.foot-brand p { max-width: 24rem; color: var(--on-night-muted); }
.foot-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding-block: 1.1rem; border-top: 1px solid var(--night-line); }

/* Nagłówek podstron */
.page-head { padding-block: clamp(3rem, 2.5rem + 3vw, 5.5rem); }
.page-head .wrap { display: grid; gap: 1.25rem; justify-items: start; }
.page-head .lead { color: var(--on-night-muted); }
.crumb a { text-underline-offset: .2em; }

/* Oferta */
.jump { position: sticky; top: 4.75rem; z-index: 40; background: var(--white); border-bottom: 1px solid var(--line); }
.jump ul { display: flex; gap: clamp(1rem, 2.5vw, 2.25rem); overflow-x: auto; scrollbar-width: none; }
.jump a { display: block; padding-block: .9rem; font-size: .9375rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.jump a:hover { color: var(--blue-text); }
.offer { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; padding-block: clamp(3rem, 5vw, 5.5rem); border-bottom: 1px solid var(--line); scroll-margin-top: 6rem; }
.offer:last-child { border-bottom: 0; }
.offer-copy { display: grid; gap: 1.3rem; min-width: 0; justify-items: start; }
.offer-copy > * { max-width: 100%; }
.offer h2 { font-size: var(--step-2); }
.offer-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.offer-photo-top img { object-position: 50% 22%; }
.offer-photo-app img { aspect-ratio: 1206 / 859; border: 1px solid var(--line); }
.ticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; border-top: 1px solid var(--line); width: 100%; }
.ticks li { padding-block: .6rem; border-bottom: 1px solid var(--line); }
.ticks-one { grid-template-columns: minmax(0, 1fr); }

/* Lista realizacji */
.project { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: center; padding-block: clamp(2.5rem, 4vw, 4rem); border-bottom: 1px solid var(--line); }
.project:first-child { padding-top: 0; }
.project:last-child { border-bottom: 0; padding-bottom: 0; }
.project-photo { display: block; overflow: hidden; }
.project-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .5s ease; }
a.project-photo:hover img { transform: scale(1.025); }
.project-copy { display: grid; gap: 1rem; justify-items: start; min-width: 0; }
.project-copy h2 { font-size: var(--step-2); }

/* Szczegóły realizacji */
.detail { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.detail-main { display: grid; gap: 1.5rem; min-width: 0; }
.detail-side { display: grid; gap: 1.25rem; position: sticky; top: 7rem; min-width: 0; }
.facts { display: grid; border-top: 1px solid var(--line); margin: 0; }
.facts div { display: grid; gap: .1rem; padding-block: .8rem; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(.6rem, 1.2vw, 1rem); }
.gallery figure { margin: 0; grid-column: span 6; min-width: 0; }
.gallery figure.wide { grid-column: span 12; }
.gallery figure.third { grid-column: span 4; }
.gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.gallery figure.tall img { aspect-ratio: 3 / 4; }
.gallery figure.wide img { aspect-ratio: 2 / 1; }
.gallery figure.low img { object-position: 50% 85%; }
.gallery-title { margin-block: clamp(2.5rem, 4vw, 4rem) 1.25rem; font-size: var(--step-1); }
.next-project { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding-block: 1.5rem; border-top: 1px solid var(--line); margin-top: clamp(3rem, 5vw, 5rem); }

/* Kontakt */
.contact { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.field { display: grid; gap: .35rem; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { font-weight: 500; }
.field label small { font-weight: 400; color: var(--muted); font-size: inherit; }
.field input, .field textarea {
  width: 100%; padding: .8rem .9rem; font: inherit; color: var(--ink); background: var(--white);
  border: 1px solid #8796a5; border-radius: 2px;
}
.field textarea { min-height: 11rem; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.form-note { font-size: var(--step--1); color: var(--muted); }
.form-end { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }
.form-status { flex: 1 1 16rem; font-weight: 500; }
.form-status.ok { color: #18693a; }
.form-status.err { color: #a42b17; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.direct { display: grid; gap: 1.5rem; }
.direct-big { display: grid; gap: .1rem; }
.direct-big a { font-size: var(--step-1); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.direct-big a:hover { color: var(--blue-text); }

/* Kontakt społecznościowy: WhatsApp i Instagram */
.float-contact { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; gap: .75rem; }
.float-contact.is-armed { visibility: hidden; opacity: 0; transform: translateY(.5rem); transition: opacity .25s, transform .25s, visibility .25s; }
.float-contact.is-armed.is-shown { visibility: visible; opacity: 1; transform: none; }
.wa-float, .ig-float { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; color: #fff; box-shadow: 0 6px 20px rgba(12, 26, 41, .35); transition: transform .15s; }
.wa-float { background: #1da851; }
.ig-float { background: #b0306f; }
.wa-float:hover, .ig-float:hover { transform: scale(1.06); }
.wa-float svg, .btn-wa svg { fill: currentColor; flex: none; }
.ig-float svg, .btn-ig svg { fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.wa-float svg, .ig-float svg { width: 1.75rem; height: 1.75rem; }
.btn-wa, .btn-ig { gap: .6rem; color: #fff; }
.btn-wa { background: #0f7a42; }
.btn-wa:hover { background: #0b6636; }
.btn-ig { background: #b0306f; }
.btn-ig:hover { background: #8f2759; }
.btn-wa svg, .btn-ig svg { width: 1.25rem; height: 1.25rem; }
.wa-note { font-size: var(--step--1); color: var(--muted); }

/* Wizualizacja aplikacji do sterowania domem */
.app-demo { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.app-copy { display: grid; gap: 1.25rem; justify-items: start; }
.app-points { display: grid; gap: .7rem; max-width: 36rem; }
.app-points li { padding-left: 1.1rem; position: relative; }
.app-points li::before { content: ""; position: absolute; left: 0; top: .7em; width: .45rem; height: 1px; background: var(--blue-text); }
.phone-wrap { display: grid; gap: 1rem; justify-items: center; min-width: 0; }
.phone { width: min(100%, 19.5rem); padding: .6rem; border-radius: 2.6rem; background: var(--night); box-shadow: 0 30px 60px -30px rgba(12, 26, 41, .55); }
.phone-screen { display: grid; gap: .9rem; align-content: start; min-height: 29rem; padding: 1.2rem 1rem 1.25rem; border-radius: 2.1rem; color: var(--on-night); background: linear-gradient(170deg, #1d3852 0%, #112437 55%, #0c1a29 100%); }
.phone-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding-inline: .25rem; }
.phone-room { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; }
.phone-scenes { display: flex; flex-wrap: wrap; gap: .4rem; padding-inline: .25rem; }
.phone-scenes button { appearance: none; padding: .35rem .75rem; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: transparent; color: var(--on-night); font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; transition: background-color .2s, color .2s; }
.phone-scenes button[aria-pressed="true"] { background: var(--on-night); border-color: var(--on-night); color: var(--night); }
.phone-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.ptile { appearance: none; display: grid; gap: .3rem; align-content: start; min-height: 5.4rem; padding: .8rem .75rem; border: 1px solid rgba(255, 255, 255, .09); border-radius: 1rem; background: rgba(255, 255, 255, .07); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color .25s, border-color .25s; }
.ptile:hover { background: rgba(255, 255, 255, .11); }
.ptile svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ptile b { font-size: .9375rem; font-weight: 600; }
.ptile small { font-size: .75rem; color: var(--on-night-muted); font-variant-numeric: tabular-nums; }
.ptile[aria-pressed="true"] { background: rgba(247, 164, 29, .17); border-color: rgba(247, 164, 29, .55); }
.ptile[aria-pressed="true"] svg { color: var(--amber); }
.ptile[data-alert="true"] { background: rgba(255, 138, 115, .16); border-color: rgba(255, 138, 115, .6); }
.ptile[data-alert="true"] svg, .ptile[data-alert="true"] small { color: var(--alert); }
.phone-note { max-width: 22rem; font-size: var(--step--1); color: var(--muted); text-align: center; }

/* Tablet */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .scene { max-width: 44rem; }
  .split, .behind, .detail, .contact, .creds, .app-demo, .project-figure, .meter { grid-template-columns: minmax(0, 1fr); }
  .split-head, .detail-side { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .partners { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
}

/* Telefon */
@media (max-width: 760px) {
  html { scroll-padding-top: 4rem; }
  /* Subtelniejszy tekst na telefonie: o około jeden stopień mniejszy niż na komputerze */
  :root { --step-0: 1rem; --step-1: 1.125rem; --step-2: 1.4rem; --step-3: 1.6rem; }
  h1 { font-size: 1.8rem; }
  .btn { font-size: .9375rem; }
  .site-nav { font-size: .9375rem; }
  .total { font-size: 1.75rem; }
  .kw b { font-size: 1.25rem; }
  .node strong { font-size: 1rem; }
  .site-head .wrap { gap: 1rem; padding-block: .4rem; min-height: 60px; }
  .brand img { width: clamp(124px, 40vw, 156px); }
  .site-nav { gap: 1.25rem; }
  .jump { top: 61px; }
  .circuits { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block: var(--wire); }
  .circuits::before, .circuit::before, .circuit::after { display: none; }
  .svc-list a { grid-template-columns: minmax(0, 1fr) auto; }
  .svc-list .svc-desc { grid-column: 1 / -1; grid-row: 2; }
  .svc-list .arrow { grid-column: 2; grid-row: 1; }
  .cred-list { grid-template-columns: minmax(0, 1fr); }
  .behind-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .behind-mosaic .tall { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 4 / 5; }
  .tile-a, .tile-b, .tile-c, .tile-d, .tile-e { grid-column: span 12; }
  .tile-a .tile-photo, .tile-b .tile-photo { aspect-ratio: 4 / 3; }
  .offer, .project { grid-template-columns: minmax(0, 1fr); }
  .offer-photo { order: -1; }
  .offer-photo img { aspect-ratio: 16 / 10; }
  .offer-photo-app img { aspect-ratio: 1206 / 859; }
  .ticks { grid-template-columns: minmax(0, 1fr); }
  .form { grid-template-columns: minmax(0, 1fr); }
  .gallery figure, .gallery figure.third { grid-column: span 12; }
  .gallery figure.wide img { aspect-ratio: 4 / 3; }
  .cta::after { background: linear-gradient(0deg, rgba(12, 26, 41, .95) 0%, rgba(12, 26, 41, .78) 100%); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .partners { gap: 1rem 1.5rem; }
}
@media (max-width: 460px) {
  .sources { grid-template-columns: minmax(0, 1fr); }
  .sources .node::after { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .behind-photos { grid-template-columns: minmax(0, 1fr); }
  .btn-row .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .site-head, .jump, .cta, .refs, .float-contact { display: none; }
}
