:root {
  --bg: #121214;
  --bg-raised: #1a1a1c;
  --text: #ecebe8;
  --text-soft: #b6b5b1;
  --muted: #8a8986;
  --line: #343436;
  /* monochrom jak w ulotce: akcentem jest biel */
  --accent: #ffffff;
  --glow: #2f2f31;
  --glow-top: #222224;
  --dust: #ececea;
  --gutter: clamp(16px, 5vw, 72px);
  --header-h: 72px;
}

* { box-sizing: border-box; }
/* Atrybut hidden ma wygrywać z display ustawionym w klasach (formularz, wiersze kalkulatora). */
[hidden] { display: none !important; }
/* Tekst tylko dla czytników ekranu i wyszukiwarek (np. nazwa produktu w H1). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 "Jost", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }


/* ---------- nagłówek ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
/* Poza opowieścią nagłówek dostaje tło, żeby nie nachodził na treść sekcji. */
.site-header { transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.site-header.is-solid { background: rgba(14, 14, 15, .88); backdrop-filter: blur(10px); border-color: var(--line); pointer-events: auto; }
.section { scroll-margin-top: var(--header-h); }
.logo { text-decoration: none; line-height: 1; letter-spacing: .02em; }
.logo b { display: block; font-weight: 700; font-size: 17px; }
.logo span { display: block; font-weight: 200; font-size: 26px; letter-spacing: .1em; }

/* Przyciski czarno-białe jak w ulotce, bez zaokrągleń. Po najechaniu kolory się odwracają. */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 13px/1 "Jost", sans-serif; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  padding: 17px 28px; border-radius: 0; border: 1px solid rgba(255, 255, 255, .4);
  color: #fff; background: transparent;
  transition: background .25s, color .25s, border-color .25s;
}
.btn:hover { border-color: #fff; background: rgba(255, 255, 255, .06); }
.btn-primary { background: #fff; border-color: #fff; color: #0e0e0f; }
.btn-primary:hover { background: transparent; color: #fff; }
.btn-small { padding: 13px 20px; font-size: 12px; }

/* ---------- opowieść ---------- */
.story { position: relative; height: calc(var(--story-length, 9.2) * 100vh); }
.stage {
  /* svh = wysokość ekranu przy widocznym pasku przeglądarki na telefonie (100vh liczy ją przy schowanym pasku,
     przez co dół sceny – razem z tekstem – chował się pod paskiem). vh zostaje dla starszych przeglądarek. */
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background:
    radial-gradient(42% 40% at 62% 52%, var(--glow) 0%, transparent 70%),
    radial-gradient(120% 90% at 20% 0%, var(--glow-top) 0%, var(--bg) 60%);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
/* Zapas bez WebGL: render z ulotki zamiast sceny 3D, przyciemniony pod tekst. */
.stage.no-webgl canvas, .stage.no-webgl .dim-label { display: none; }
.stage.no-webgl {
  background:
    linear-gradient(90deg, rgba(18, 18, 20, .92) 0%, rgba(18, 18, 20, .55) 45%, rgba(18, 18, 20, .15) 100%),
    url("../img/aranzacja-czarna.jpg") center / cover no-repeat;
}

.scene-text {
  position: absolute; left: var(--gutter); top: 50%;
  width: min(440px, 40vw);
  transform: translateY(-50%);
  opacity: 0; pointer-events: none;
  will-change: opacity, transform;
}
.scene-text.is-active { pointer-events: auto; }
.eyebrow {
  font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.scene-text h1 { font-weight: 300; font-size: clamp(38px, 4.6vw, 64px); line-height: 1.05; letter-spacing: -.01em; }
.scene-text h1 strong { font-weight: 600; }
.scene-text h2 { font-weight: 300; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; }
.scene-text p { color: var(--text-soft); margin-top: 20px; font-size: 17px; }
.scene-text p.note { font-size: 13px; line-height: 1.55; color: var(--muted); margin-top: 16px; }
.scene-text .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.specs { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.specs li { background: var(--bg); padding: 14px 16px; }
.specs b { display: block; font-size: 24px; font-weight: 400; }
.specs span { color: var(--muted); font-size: 13px; }

.tags { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid var(--line); border-radius: 0; padding: 6px 14px; font-size: 14px; color: var(--text-soft); }

.hint { margin-top: 24px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.hint::before { content: ""; width: 22px; height: 1px; background: var(--muted); }

.variants { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 8px; }
.variants li {
  display: grid; grid-template-columns: 56px 1fr; gap: 2px 14px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 0;
  transition: border-color .4s, background .4s;
}
.variants li.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.swatch { grid-row: span 2; width: 56px; height: 40px; border-radius: 0; border: 1px solid var(--line); }
.variants b { font-weight: 500; }
.variants span { color: var(--muted); font-size: 14px; }

/* etykiety wymiarów nad sceną 3D */
.dim-label {
  position: absolute; left: 0; top: 0; pointer-events: none;
  font-size: 15px; font-weight: 500; color: var(--accent);
  white-space: nowrap; opacity: 0; font-variant-numeric: tabular-nums;
}

/* wskazówka przewijania */
.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.scroll-cue i { width: 1px; height: 40px; background: linear-gradient(var(--muted), transparent); animation: cue 2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* nawigacja rozdziałów */
.chapters {
  position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 15;
  list-style: none; padding: 0; margin: 0; display: grid; gap: 14px;
  transition: opacity .4s;
}
.chapters.is-hidden { opacity: 0; pointer-events: none; }
.chapters a { display: flex; align-items: center; justify-content: flex-end; gap: 12px; text-decoration: none; font-size: 13px; color: var(--muted); }
.chapters a span { opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s; }
.chapters a::after { content: ""; width: 7px; height: 7px; border-radius: 0; border: 1px solid var(--muted); transition: background .3s, border-color .3s, transform .3s; }
.chapters a:hover span, .chapters a.is-active span { opacity: 1; transform: none; }
.chapters a.is-active { color: var(--text); }
.chapters a.is-active::after { background: var(--accent); border-color: var(--accent); transform: scale(1.3); }

/* ---------- dalsza część strony ---------- */
.section { padding: clamp(80px, 12vh, 140px) var(--gutter); border-top: 1px solid var(--line); background: var(--bg); }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-weight: 300; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; }
.section-head p { color: var(--text-soft); margin-top: 16px; font-size: 17px; }
.fine { color: var(--muted); font-size: 12px; margin-top: 24px; }

/* galeria */
.gallery-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: auto auto; gap: 12px; }
.gallery-grid figure { margin: 0; position: relative; overflow: hidden; background: var(--bg-raised); }
.gallery-grid .g-main { grid-row: span 2; }
.gallery-grid figure:last-child { grid-column: 2 / span 2; }
.gallery-grid img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; transition: transform .8s ease; }
.gallery-grid .g-main img { aspect-ratio: auto; }
.gallery-grid figure:last-child img { aspect-ratio: 21 / 9; object-position: 50% 70%; }
.gallery-grid figure:hover img { transform: scale(1.03); }
.gallery-grid figcaption {
  position: absolute; left: 0; bottom: 0; padding: 10px 14px;
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #fff;
  background: rgba(14, 14, 15, .72);
}

/* dla kogo */
.audience { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.audience-card { background: var(--bg); padding: 36px 32px; display: flex; flex-direction: column; gap: 18px; }
.audience-num { font-size: 12px; letter-spacing: .18em; color: var(--muted); }
.audience-card h3 { font-weight: 400; font-size: 24px; }
.audience-card p { color: var(--text-soft); }
.audience-card ul { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; flex: 1; }
.audience-card li { padding-left: 22px; position: relative; color: var(--text-soft); font-size: 15px; }
.audience-card li::before { content: ""; position: absolute; left: 0; top: .75em; width: 12px; height: 1px; background: var(--text); }
.audience-card .btn { align-self: flex-start; }

/* pola formularzy */
.field { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span, .field legend { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 8px; }
.field input, .field textarea {
  font: inherit; color: var(--text); background: transparent;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 10px 0; outline: none; transition: border-color .2s;
}
.field input:focus, .field textarea:focus { border-color: #fff; }
.field textarea { resize: vertical; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #e08a7a; }
.segmented { display: flex; gap: 0; }
.segmented.wrap { flex-wrap: wrap; gap: 8px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; padding: 11px 16px; border: 1px solid var(--line); font-size: 14px; color: var(--text-soft);
  transition: background .2s, color .2s, border-color .2s;
}
.segmented:not(.wrap) label + label span { border-left: 0; }
.segmented input:checked + span { background: #fff; border-color: #fff; color: #0e0e0f; }
.segmented input:focus-visible + span { outline: 1px solid #fff; outline-offset: 2px; }
.segmented.is-invalid span { border-color: #e08a7a; }

/* kalkulator */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.calc-inputs { display: grid; gap: 28px; }
.calc-result { display: block; border: 1px solid var(--line); padding: 32px; }
.result-main { display: flex; align-items: baseline; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.result-main b { font-weight: 200; font-size: clamp(56px, 6vw, 88px); line-height: 1; font-variant-numeric: tabular-nums; }
.result-main span { color: var(--text-soft); }
.calc-result dl { margin: 0; }
.calc-result dl div { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.calc-result dt { color: var(--text-soft); }
.calc-result dd { margin: 0; font-size: 20px; font-variant-numeric: tabular-nums; }
.calc-note { color: var(--muted); font-size: 13px; margin-top: 18px; }

/* gdzie kupić */
.search { max-width: 360px; margin-bottom: 32px; }
.retailers { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.retailers li { background: var(--bg); padding: 36px 28px; display: grid; gap: 10px; min-height: 140px; align-content: center; }
.retailers li[hidden] { display: none; }
.retailers small { color: var(--muted); font-size: 13px; }
.wordmark { font-size: 24px; line-height: 1; color: #fff; }
.wm-1 { font-weight: 700; letter-spacing: .14em; }
.wm-2 { font-weight: 300; } .wm-2 b { font-weight: 700; }
.wm-3 { font-weight: 400; font-style: italic; letter-spacing: .02em; }
.wm-4 { font-weight: 600; letter-spacing: .2em; } .wm-4 i { font-weight: 300; letter-spacing: .02em; margin-left: 6px; text-transform: none; }
.wm-5 { font-weight: 500; text-transform: uppercase; font-size: 18px; letter-spacing: .08em; border: 1px solid #fff; padding: 6px 10px; justify-self: start; }
.wm-6 { font-weight: 200; letter-spacing: .04em; } .wm-6 b { font-weight: 600; }
.empty { color: var(--text-soft); margin-top: 24px; }

/* pliki */
.downloads { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.downloads a { display: grid; gap: 8px; padding: 28px 24px 28px; background: var(--bg); text-decoration: none; height: 100%; transition: background .2s; position: relative; }
.downloads a::after { content: "↓"; position: absolute; right: 24px; top: 26px; color: var(--muted); transition: transform .2s, color .2s; }
.downloads a:hover { background: var(--bg-raised); }
.downloads a:hover::after { transform: translateY(3px); color: #fff; }
.downloads span { font-size: 19px; }
.downloads small { color: var(--muted); font-size: 13px; }

/* próbki */
.sample-form { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 40px; max-width: 920px; }
.sample-form .full { grid-column: 1 / -1; }
.consent { display: flex; gap: 12px; align-items: flex-start; color: var(--text-soft); font-size: 14px; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #fff; flex: none; }
.consent.is-invalid span { color: #e08a7a; }
.form-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.btn[type="submit"] { font-family: inherit; }
.form-error { color: #e08a7a; font-size: 14px; }
.form-success { max-width: 640px; border: 1px solid #fff; padding: 32px; outline: none; }
.form-success h3 { font-weight: 400; font-size: 24px; }
.form-success p { color: var(--text-soft); margin-top: 10px; }

/* FAQ */
.faq { max-width: 860px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative; font-size: 19px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 18px; font-size: 24px; font-weight: 200; transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-soft); padding: 0 40px 24px 0; }

/* stopka */
.site-footer {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 40px;
  padding: 72px var(--gutter) 40px; border-top: 1px solid var(--line); background: #0c0c0d;
}
.site-footer p, .site-footer address { color: var(--text-soft); font-style: normal; font-size: 14px; line-height: 1.8; }
.footer-brand p { margin-top: 16px; }
.footer-links { display: grid; gap: 8px; align-content: start; font-size: 14px; }
.footer-links a, .site-footer address a { text-decoration: none; color: var(--text-soft); }
.footer-links a:hover, .site-footer address a:hover { color: #fff; }
.site-footer .fine { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 24px; max-width: 820px; }

@media (max-width: 1000px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid .g-main { grid-column: 1 / -1; grid-row: auto; }
  .gallery-grid figure:last-child { grid-column: auto; }
  .gallery-grid figure:last-child img { aspect-ratio: 4 / 3; }
  .audience, .retailers { grid-template-columns: 1fr 1fr; }
  .downloads { grid-template-columns: 1fr 1fr; }
  .calc { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .audience, .retailers, .downloads, .sample-form, .site-footer { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid figure:last-child { grid-column: auto; }
  .audience-card { padding: 28px 22px; }
  .segmented:not(.wrap) { flex-wrap: wrap; }
  /* Tekst leży na dole kadru, nad sceną – przyciemnienie trzyma kontrast niezależnie od tego, co jest pod spodem. */
  .stage::after {
    content: ""; position: absolute; inset: 45% 0 0 0; pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(18, 18, 20, .82) 45%, rgba(18, 18, 20, .92));
  }
  .scene-text {
    top: auto; transform: none; width: auto; right: var(--gutter); z-index: 1;
    /* zapas na dolną krawędź iPhone'ów z paskiem domowym */
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .scene-text p { font-size: 15px; margin-top: 14px; }
  .scene-text h1 { font-size: 34px; }
  .scene-text h2 { font-size: 27px; }
  .scene-text .actions { margin-top: 22px; }
  .scene-text .mobile-hide { display: none; }
  .variants { margin-top: 18px; gap: 6px; }
  .variants li { padding: 8px 10px; grid-template-columns: 40px 1fr; }
  .swatch { width: 40px; height: 30px; }
  .specs { margin-top: 18px; }
  .specs b { font-size: 20px; }
  .chapters { display: none; }
  .scroll-cue { display: none; }
}

/* Fokus klawiatury: wyraźna, kwadratowa obwódka w stylu strony. */
:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }
.btn:focus-visible { outline-offset: 4px; }

/* Systemowe „ogranicz ruch”: bez animacji dekoracyjnych i płynnych przejść. */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue i { animation: none; }
  .gallery-grid img, .gallery-grid figure:hover img { transition: none; transform: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
