/* ==========================================================================
   RM GROUP — warstwa „malarska”: faktura farby, natrysk, schemat, wzornik
   ========================================================================== */

/* --- Faktura farby: ziarno na bieli i czerni ------------------------------ */
:root {
  --grain-dark: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --grain-light: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
body { background-image: var(--grain-light); }
.coat::before { background: var(--grain-dark), var(--paper); }

/* Mgiełka farby (overspray) nad i pod każdą białą warstwą */
.coat::after {
  content: ""; position: absolute; left: 0; right: 0; top: -42px; bottom: -42px; z-index: -1;
  pointer-events: none;
  background: var(--spk-t, none) left top / 1200px 42px repeat-x,
              var(--spk-b, none) left bottom / 1200px 42px repeat-x;
  opacity: 0; transition: opacity .9s ease .9s;
}
.coat.is-painted::after, .no-js .coat::after { opacity: 1; }

/* --- HERO: natrysk kursorem ------------------------------------------------- */
.hero { touch-action: pan-y; }
.hero-paint { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.hero.is-spraying { user-select: none; -webkit-user-select: none; }
.hero.has-aim { cursor: none; }
.aim {
  position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border: 1px solid rgba(255, 255, 255, .55); border-radius: 50%;
  opacity: 0; transition: opacity .25s, border-color .2s;
}
.aim::before, .aim::after { content: ""; position: absolute; background: rgba(255, 255, 255, .55); }
.aim::before { left: 50%; top: -8px; bottom: -8px; width: 1px; }
.aim::after { top: 50%; left: -8px; right: -8px; height: 1px; }
.aim i { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; background: var(--red); border-radius: 50%; }
.aim.on { opacity: 1; }
.aim.down { border-color: var(--red); }

.spray-hint {
  position: relative; z-index: 2;
  display: flex; justify-content: flex-end; align-items: center; gap: .8em;
  margin: -10px 0 22px; color: var(--mute-d); transition: opacity .6s;
}
.spray-hint::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1.6s ease-in-out infinite; }
.spray-hint .touch { display: none; }
.spray-hint.is-used { opacity: 0; }
@keyframes blink { 50% { opacity: .2; } }
/* dotyk: (hover: none) to telefony; (pointer: coarse) łapie też telefony i tablety, które zgłaszają hover (np. część Samsungów) */
@media (hover: none), (pointer: coarse) { .spray-hint .pc { display: none; } .spray-hint .touch { display: inline; } }

/* --- TECHNIKA NATRYSKU: schemat ---------------------------------------------- */
.tech { margin: 0; }
.tech-svg { display: block; width: 100%; height: auto; overflow: visible; }
.tech-t { font-family: var(--mono); font-size: 15px; letter-spacing: .06em; fill: #fff; }
.tech-dim line { stroke: rgba(255, 255, 255, .5); stroke-width: 1; }
.tech-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 34px; border-top: 1px solid var(--line-d2); }
.tech-specs > div { padding: 22px 20px 0 0; }
.tech-specs > div + div { padding-left: 20px; border-left: 1px solid var(--line-d); }
.tech-specs .mono { color: var(--mute-d); }
.tech-specs h3 {
  margin: 10px 0; font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-weight: 800; line-height: 1; letter-spacing: -.03em;
  font-variation-settings: "SHRP" 100, "slnt" -12;
}
.tech-specs p:not(.mono) { color: rgba(255, 255, 255, .62); font-size: .93rem; }

/* --- KOLOR: wachlarz wzornika i ściana ------------------------------------- */
.swatch { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.3fr); gap: clamp(32px, 6vw, 110px); align-items: center; }
.swatch-copy .lead { margin-top: 24px; color: #333; }
.swatch-try { margin-top: 30px; color: var(--red-l); }
.swatch-stage { position: relative; padding-bottom: 40px; }
.wall { position: relative; aspect-ratio: 4 / 3; background: #f1f0ea; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-l); }
.wall canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.wall::after { content: ""; position: absolute; inset: 0; background: var(--grain-dark); mix-blend-mode: multiply; pointer-events: none; }
.wall-nozzle { position: absolute; z-index: 2; top: 0; left: 0; width: 3px; height: 30%; background: var(--red); opacity: 0; transform: skewX(var(--skew)); transition: opacity .3s; }
.wall-nozzle.on { opacity: 1; }
.wall-label { position: absolute; z-index: 2; left: 14px; top: 14px; background: var(--paper); color: var(--ink); padding: 7px 11px; }
.wall-label b { font-weight: 600; margin-right: .6em; }

.fan { position: absolute; left: 50%; bottom: 0; width: 0; height: 0; z-index: 3; }
.fan-card {
  --r: calc((var(--i) - 3.5) * 8deg);
  position: absolute; left: -26px; bottom: 0;
  width: 52px; height: clamp(170px, 19vw, 250px);
  display: flex; justify-content: center; padding-top: 12px;
  background: var(--c); border: 0; cursor: pointer;
  box-shadow: -1px 0 0 rgba(0, 0, 0, .18), 0 10px 24px -14px rgba(0, 0, 0, .6);
  transform-origin: 50% calc(100% - 14px);
  transform: rotate(var(--r));
  transition: transform .55s var(--ease-out);
}
.fan-card::after {               /* nit wachlarza */
  content: ""; position: absolute; left: 50%; bottom: 8px; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: #1a1a1a; box-shadow: inset 0 0 0 2px #888;
}
.fan-card span { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; color: rgba(0, 0, 0, .62); }
.fan-card.is-dark span { color: rgba(255, 255, 255, .82); }
.fan:hover .fan-card, .fan:focus-within .fan-card { --r: calc((var(--i) - 3.5) * 11deg); }
.fan-card.is-on { transform: rotate(var(--r)) translateY(-26px); }
.swatch-note { margin-top: 14px; color: var(--mute-l); }

/* Próbki kolorów — właściwa kontrolka wyboru */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sw {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px 6px 8px;
  border: 1px solid var(--line-l); background: var(--paper); cursor: pointer;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.sw i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.sw:hover { border-color: var(--ink); }
.sw[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--red); }
.sw:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* --- PROCES na czerni ---------------------------------------------------------- */
.dark .step::before { background: var(--paper); }
.dark .step p:not(.mono) { color: rgba(255, 255, 255, .62); }

/* --- RODO ------------------------------------------------------------------------ */
.todo { outline: 1px dashed var(--red); outline-offset: 1px; padding: 0 .25em; }
.card-rodo { padding: 14px 20px 16px; border-top: 1px solid var(--line-l); font-size: .78rem; line-height: 1.55; color: var(--mute-l); }
.card-rodo a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.ftr-admin { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line-d); }
.ftr-admin h2 { margin-bottom: 10px; font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--mute-d); }
.ftr-admin p { max-width: 62em; font-size: .88rem; }
.ftr-admin a { text-decoration: underline; text-underline-offset: 2px; }

/* --- Dokument (polityka prywatności) ------------------------------------------- */
.doc { padding-top: var(--hdr); }
.doc-head { padding: clamp(56px, 10vh, 120px) var(--gut) clamp(40px, 6vh, 72px); }
.doc-head h1 { margin-top: 18px; }
.doc-body { background: var(--grain-dark), var(--paper); color: var(--ink); padding: clamp(48px, 8vh, 96px) 0; position: relative; }
.doc-body::before {             /* mgiełka nad białą kartą */
  content: ""; position: absolute; left: 0; right: 0; top: -42px; height: 42px;
  background: var(--spk-t, none) left top / 1200px 42px repeat-x;
}
.doc-text { max-width: 760px; }
.doc-text section { padding: 30px 0; border-top: 1px solid var(--line-l); }
.doc-text section:first-child { border-top: 0; padding-top: 0; }
.doc-text .mono { color: var(--red-l); }
.doc-text h2 { margin: 10px 0 14px; font-size: clamp(1.4rem, 2.2vw, 1.9rem); font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; line-height: 1.05; }
.doc-text p, .doc-text li { color: #2c2c2c; }
.doc-text p + p { margin-top: 12px; }
.doc-text ul { list-style: none; display: grid; gap: 10px; }
.doc-text li { position: relative; padding-left: 26px; }
.doc-text li::before { content: ""; position: absolute; left: 0; top: .72em; width: 14px; height: 3px; background: var(--red); transform: skewX(var(--skew)); }
.doc-text b { font-weight: 600; color: var(--ink); }
.doc-text a { text-decoration: underline; text-underline-offset: 2px; }
.doc ~ .ftr { border-top: 0; padding-top: 30px; }

/* --- Responsywność ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .swatch { grid-template-columns: minmax(0, 1fr); }
  .tech-specs { grid-template-columns: minmax(0, 1fr); }
  .tech-specs > div, .tech-specs > div + div { padding: 20px 0; border-left: 0; border-bottom: 1px solid var(--line-d); }
}
@media (max-width: 640px) {
  .fan-card { left: -20px; width: 40px; height: 150px; }
  .spray-hint { justify-content: flex-start; margin: -6px 0 24px; }
  .tech-t { font-size: 25px; letter-spacing: .02em; }
}

/* Telefon: najpierw ściana, potem próbki — malowanie dzieje się w polu widzenia */
@media (max-width: 900px) {
  .swatch { row-gap: 0; }
  .swatch-copy { display: contents; }
  .swatch-copy > * { order: 1; }
  .swatch-stage { order: 2; margin-top: 28px; }
  .swatch-copy > .swatch-try, .swatch-copy > .chips, .swatch-copy > .swatch-note { order: 3; }
  .swatch-try { margin-top: 26px; }
}
