:root {
  --page: #fbf4f2;
  --blush: #f6e6e7;
  --night: #24172f;
  --plum: #4a2c5a;
  --gold: #e8c987;
  --ink: #2e2035;
}

[hidden] {
  display: none !important;
}

body {
  background: var(--page);
  color: var(--ink);
  font-synthesis: none;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

:focus-visible {
  outline: 3px solid #b4536a;
  outline-offset: 3px;
}

.night :focus-visible,
header :focus-visible,
footer :focus-visible {
  outline-color: var(--gold);
}

/* Zimowy zmierzch: od nocnej śliwki do różowej łuny nad horyzontem. */
.night {
  background: linear-gradient(#24172f 0%, #3a2450 38%, #6e4471 68%, #c48b98 92%);
}

/* Gwiazdy migoczą na zmianę w dwóch warstwach. */
.stars,
.stars::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-size: 260px 260px;
}

.stars {
  background-image:
    radial-gradient(circle at 20px 30px, #fff 1.2px, transparent 1.8px),
    radial-gradient(circle at 130px 80px, #fde9b8 1.6px, transparent 2.2px),
    radial-gradient(circle at 200px 170px, #fff 1px, transparent 1.6px),
    radial-gradient(circle at 70px 220px, #fff 1.3px, transparent 1.9px);
  mask-image: linear-gradient(#000 40%, transparent 75%);
  animation: twinkle 5s ease-in-out infinite alternate;
}

.stars::after {
  content: "";
  background-image:
    radial-gradient(circle at 90px 140px, #fde9b8 1.8px, transparent 2.4px),
    radial-gradient(circle at 230px 40px, #fff 1.3px, transparent 1.9px),
    radial-gradient(circle at 170px 240px, #fff 1px, transparent 1.6px);
  background-position: 120px 60px;
  animation: twinkle 7s ease-in-out infinite alternate-reverse;
}

@keyframes twinkle {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stars,
  .stars::after {
    animation: none;
  }
}

.hero-scene {
  display: block;
  width: 100%;
  height: clamp(270px, 88vw, 330px);
}

@media (min-width: 640px) {
  .hero-scene {
    height: clamp(330px, 48vw, 560px);
  }
}

@media (min-width: 1440px) {
  .hero-scene {
    position: absolute;
    inset: 0;
    height: 100%;
  }
}

/* Animacje ilustracji: rozmowa w balii i płomień świecy. */
.hero-scene .arm,
.hero-scene .head,
.hero-scene .jaw,
.hero-scene .flame,
.hero-scene .candle-glow {
  transform-box: fill-box;
}

.arm {
  transform-origin: 100% 100%;
}

.arm-w {
  animation: gesture-w 8s ease-in-out infinite;
}

.arm-m {
  animation: gesture-m 8s ease-in-out infinite;
}

.head {
  transform-origin: 50% 100%;
}

.head-w {
  animation: tilt-w 8s ease-in-out infinite;
}

.head-m {
  animation: tilt-m 8s ease-in-out infinite;
}

.mouth-open {
  opacity: 0;
}

.mouth-open-w {
  animation: speaking-w 8s linear infinite;
}

.mouth-closed-w {
  animation: listening-w 8s linear infinite;
}

.mouth-open-m {
  animation: speaking-m 8s linear infinite;
}

.mouth-closed-m {
  animation: listening-m 8s linear infinite;
}

.jaw {
  transform-origin: 50% 0;
  animation: jaw 0.32s ease-in-out infinite alternate;
}

.breath {
  opacity: 0.75;
  animation: breath 8s ease-out infinite;
}

.flame {
  transform-origin: 50% 100%;
  animation: flicker 1.7s ease-in-out infinite;
}

.flame-core {
  animation-duration: 1.3s;
  animation-direction: reverse;
}

.candle-glow {
  transform-origin: 50% 50%;
  animation: candle-glow 2.4s ease-in-out infinite alternate;
}

@keyframes gesture-w {
  0%, 44%, 100% { transform: rotate(0); }
  7% { transform: rotate(26deg); }
  15% { transform: rotate(10deg); }
  24% { transform: rotate(30deg); }
  34% { transform: rotate(6deg); }
}

@keyframes gesture-m {
  0%, 50%, 94%, 100% { transform: rotate(0); }
  57% { transform: rotate(28deg); }
  65% { transform: rotate(12deg); }
  74% { transform: rotate(32deg); }
  84% { transform: rotate(8deg); }
}

@keyframes tilt-w {
  0%, 48%, 100% { transform: rotate(0); }
  10%, 38% { transform: rotate(4deg); }
  60%, 80% { transform: rotate(2deg); }
  70%, 90% { transform: rotate(0); }
}

@keyframes tilt-m {
  0%, 50%, 100% { transform: rotate(0); }
  15%, 35% { transform: rotate(-2deg); }
  25% { transform: rotate(0); }
  60%, 88% { transform: rotate(-4deg); }
}

@keyframes speaking-w {
  0%, 44% { opacity: 1; }
  45%, 100% { opacity: 0; }
}

@keyframes listening-w {
  0%, 44% { opacity: 0; }
  45%, 100% { opacity: 1; }
}

@keyframes speaking-m {
  0%, 49% { opacity: 0; }
  50%, 94% { opacity: 1; }
  95%, 100% { opacity: 0; }
}

@keyframes listening-m {
  0%, 49% { opacity: 1; }
  50%, 94% { opacity: 0; }
  95%, 100% { opacity: 1; }
}

@keyframes jaw {
  from { transform: scaleY(0.35); }
  to { transform: scaleY(1.15); }
}

@keyframes breath {
  0% { opacity: 0; transform: translate(0, 0); }
  8% { opacity: 0.8; }
  40% { opacity: 0.45; transform: translate(10px, -12px); }
  46%, 100% { opacity: 0; transform: translate(14px, -16px); }
}

@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(0); }
  18% { transform: scale(0.9, 1.14) rotate(-4deg); }
  37% { transform: scale(1.06, 0.92) rotate(2deg); }
  55% { transform: scale(0.94, 1.08) rotate(-1deg); }
  74% { transform: scale(1.04, 0.96) rotate(3deg); }
}

@keyframes candle-glow {
  from { opacity: 0.7; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1.05); }
}

/* Dym z komina: kłęby rosną, unoszą się i znikają. */
.hero-scene .puff,
.hero-scene .eyes {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.smoke-static {
  display: none;
}

.puff {
  opacity: 0;
  animation: puff 7s ease-out infinite;
}

@keyframes puff {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  12% { opacity: 0.8; }
  55% { opacity: 0.45; }
  85%, 100% { opacity: 0; transform: translate(38px, -62px) scale(2); }
}

/* Kobieta przy saunie mruga, a raz w cyklu przymyka oczy na dłużej. */
.eyes {
  animation: blink 7s linear infinite;
}

@keyframes blink {
  0%, 30%, 33%, 66%, 86%, 100% { transform: scaleY(1); }
  31.5% { transform: scaleY(0.12); }
  68%, 84% { transform: scaleY(0.12); }
}

@media (prefers-reduced-motion: reduce) {
  .smoke {
    display: none;
  }

  .smoke-static {
    display: inline;
  }

  .puff,
  .eyes,
  .arm,
  .head,
  .jaw,
  .mouth-open,
  .mouth-closed,
  .breath,
  .flame,
  .candle-glow {
    animation: none;
  }
}

/* Wspólny kontener sklepu: logo, tekst na ilustracji, treść i stopka
   zaczynają się w tej samej linii. Na szerokich ekranach margines boczny
   to połowa tego, który dawałby kontener o szerokości 72rem. */
.shell {
  width: 100%;
  padding-inline: 1rem;
}

@media (min-width: 640px) {
  .shell {
    padding-inline: calc(0.5 * (max(0px, (100% - 72rem) / 2) + 1.5rem));
  }
}

/* Katalog: nocne niebo pod ośnieżonym lasem, jak na ilustracji u góry. */
.treeline {
  height: 130px;
  margin-bottom: -1px;
  background: url("../img/treeline.svg") repeat-x 0 100% / 640px 130px;
}

.catalog {
  background: linear-gradient(#24172f, #3a2450);
}

.product-card {
  box-shadow: 0 0 0 1px rgb(232 201 135 / 0.35), 0 14px 34px rgb(10 4 16 / 0.45);
  transition: box-shadow 0.2s ease;
}

.product-card:hover {
  box-shadow: 0 0 0 2px var(--gold), 0 0 34px rgb(232 201 135 / 0.3);
}

.catalog :focus-visible {
  outline-color: var(--gold);
}

.footer-night {
  background: linear-gradient(#3a2450, var(--night));
}

/* Ścieg obrzucający: krawędź ramki z instrukcją płatności. */
.stitched {
  position: relative;
  background: #fffaf7;
  border: 2px solid var(--plum);
  border-radius: 18px;
  overflow: hidden;
}

.stitched::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 12px;
  background: repeating-linear-gradient(90deg, var(--plum) 0 2px, transparent 2px 16px);
}

.field {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border: 1px solid #a68fa6;
  border-radius: 12px;
  background: #fffaf7;
  color: var(--ink);
}

.field[aria-invalid="true"] {
  border-color: #96302a;
  border-width: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--plum);
  border-radius: 999px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.btn-primary {
  background: var(--plum);
  color: #fffaf7;
}

.btn-primary:hover {
  background: #36203f;
}

/* Przycisk na ciemnym tle: blask świecy. */
.btn-glow {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--night);
  box-shadow: 0 0 24px rgb(232 201 135 / 0.45);
}

.btn-glow:hover {
  background: #f3dcaa;
}

.btn-quiet {
  background: transparent;
  color: var(--plum);
}

.btn-quiet:hover {
  background: var(--blush);
}

.btn-small {
  min-height: 44px;
  padding: 0.4rem 1rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.link {
  color: var(--plum);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link:hover {
  color: #b4536a;
}

.qty::-webkit-outer-spin-button,
.qty::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.qty {
  appearance: textfield;
}
