/* MERIOS icon art system
 * -----------------------------------------------------------------------
 * Turns the outline set into finished drawings: a translucent gold body,
 * a gradient outline over it, and one sky-blue accent per icon. Motion is
 * a one-shot draw-in when the icon first scrolls into view, plus a slow
 * breathing accent — all of it disabled under prefers-reduced-motion, where
 * the icon simply appears fully drawn.
 * Gradients are defined once per page in the .ic-defs sprite; url(#id)
 * resolves document-wide, so every icon here stays a few hundred bytes.
 */

.ic-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.ic-art { overflow: visible; }

.ic-art .ic-fill {
  fill: url(#icFill);
  stroke: none;
  transform-origin: 24px 24px;
}

.ic-art .ic-line {
  fill: none;
  stroke: url(#icLine);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ic-art .ic-spark {
  fill: none;
  stroke: url(#icSpark);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic-art circle.ic-spark,
.ic-art rect.ic-spark,
.ic-art .ic-sf {
  fill: url(#icSpark);
  stroke: none;
}

/* ---------------------------------------------------------------- the halo
   A soft gold wash behind the drawing. On round holders (.why-ic) the holder
   already carries its own ring, so the halo there is tuned down. */
/* Applied to holders that already exist (.icon-chip, .g-icon), so it must not
   touch their display/layout — only establish a positioning context. */
.ic-holder { position: relative; }
.ic-holder::before {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  /* Ambient warmth, not a visible disc behind the chip. */
  background: radial-gradient(circle at 50% 44%,
              rgba(212,175,55,.14) 0%, rgba(212,175,55,.04) 52%, transparent 72%);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .55s ease, transform .55s ease;
  pointer-events: none;
}
html .ic-holder.drawn::before,
html.js-on .ic-holder.drawn::before { opacity: 1; transform: scale(1); }

/* ------------------------------------------------------------- the draw-in
   Longest outline in the set is ~190 user units, so a 320 dash covers every
   path with room to spare and no visible seam.
   The hidden start state is gated on html.js-on, which icons.js sets the moment
   it runs. Without JS (or before it runs) the icon is simply drawn — no risk of
   a page of invisible icons if a script fails or is slow. */
html.js-on .ic-art .ic-line,
html.js-on .ic-art .ic-spark {
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
}
html.js-on .ic-art .ic-fill,
html.js-on .ic-art .ic-sf,
html.js-on .ic-art circle.ic-spark,
html.js-on .ic-art rect.ic-spark {
  opacity: 0;
}
html.js-on .ic-holder::before { opacity: 0; transform: scale(.7); }

.ic-art.drawn .ic-line {
  animation: ic-draw 1.15s cubic-bezier(.6,.05,.25,1) forwards;
}
.ic-art.drawn .ic-spark {
  animation: ic-draw .8s cubic-bezier(.6,.05,.25,1) .42s forwards;
}
.ic-art.drawn .ic-fill {
  animation: ic-bloom .8s cubic-bezier(.2,.7,.3,1) .28s forwards;
}
.ic-art.drawn .ic-sf,
.ic-art.drawn circle.ic-spark,
.ic-art.drawn rect.ic-spark {
  animation: ic-pop .55s cubic-bezier(.2,.9,.3,1) .5s forwards,
             ic-breathe 4.6s ease-in-out 1.4s infinite;
}

@keyframes ic-draw  { to { stroke-dashoffset: 0; } }
@keyframes ic-bloom { from { opacity: 0; transform: scale(.86); }
                      to   { opacity: 1; transform: scale(1); } }
@keyframes ic-pop   { from { opacity: 0; } to { opacity: 1; } }
@keyframes ic-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ------------------------------------------------------------------- hover */
.icon-item:hover .ic-art .ic-fill,
.icon-chip:hover .ic-art .ic-fill,
.feature-card:hover .ic-art .ic-fill,
.why-card:hover .ic-art .ic-fill,
.guarantee-card:hover .ic-art .ic-fill { fill: url(#icHalo); }

.icon-item:hover .ic-holder::before,
.why-card:hover .ic-holder::before { transform: scale(1.12); }

.ic-art { transition: transform .4s cubic-bezier(.2,.7,.3,1); }
.icon-item:hover .ic-art,
.icon-chip:hover .ic-art,
.trust-item:hover .ic-art,
.guarantee-card:hover .ic-art { transform: translateY(-3px) scale(1.06); }

/* ------------------------------------------- the five circular medallions */
.why-ic {
  position: relative;
  isolation: isolate;
}
.why-ic::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  padding: 1px;
  background: conic-gradient(from 0deg,
      transparent 0deg, rgba(212,175,55,.85) 55deg,
      rgba(126,203,255,.75) 110deg, transparent 190deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .6s ease;
  animation: ic-orbit 7s linear infinite;
  pointer-events: none;
}
.why-ic.drawn::after { opacity: .9; }
@keyframes ic-orbit { to { transform: rotate(360deg); } }

/* -------------------------------------------------------- reduced motion
   No draw-in, no orbit, no breathing: the icon is simply there, complete. */
@media (prefers-reduced-motion: reduce) {
  html.js-on .ic-art .ic-line,
  html.js-on .ic-art .ic-spark { stroke-dashoffset: 0; }
  html.js-on .ic-art .ic-fill,
  html.js-on .ic-art .ic-sf,
  html.js-on .ic-art circle.ic-spark,
  html.js-on .ic-art rect.ic-spark { opacity: 1; }
  .ic-art.drawn .ic-line,
  .ic-art.drawn .ic-spark,
  .ic-art.drawn .ic-fill,
  .ic-art.drawn .ic-sf,
  .ic-art.drawn circle.ic-spark,
  .ic-art.drawn rect.ic-spark { animation: none; }
  .why-ic::after { animation: none; }
  html.js-on .ic-holder::before { opacity: 1; transform: scale(1); transition: none; }
  .ic-art { transition: none; }
}

/* ------------------------------------------------------------------
   Иконки читались как пустые контуры: тело было почти прозрачным,
   а обводка слишком тонкой для 30 px. Утолщаем линию и подкрашиваем
   держатель, чтобы значок выглядел заполненным, как в фирменных макетах.
------------------------------------------------------------------ */
.ic-art .ic-line { stroke-width: 2.1; }
.ic-art .ic-spark { stroke-width: 2.3; }

.icon-chip, .g-icon, .why-ic {
  background: linear-gradient(150deg, rgba(212,175,55,.16), rgba(212,175,55,.05));
  border-color: rgba(212,175,55,.42);
}
.has-bed .icon-chip, .has-bed .g-icon {
  background: linear-gradient(150deg, rgba(212,175,55,.20), rgba(212,175,55,.07));
}
