html { scroll-behavior: smooth; }
body { font-feature-settings: 'ss01', 'cv11'; overflow-x: hidden; }

/* Avoid orphans / weird line breaks in text-heavy elements */
p, li, summary, .hero-title, h1, h2, h3, h4 {
  text-wrap: pretty;
}
h1, h2, h3 {
  text-wrap: balance;
}

/* Justify body paragraphs on tablet+ for clean edges */
@media (min-width: 768px) {
  section p,
  details > p,
  article p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
  .no-justify, .no-justify p, p.no-justify {
    text-align: left !important;
    hyphens: none !important;
  }
}

/* Price rows in pricing breakdown — never let zł / PLN drop to next line */
.price-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  gap: 1rem;
}
.price-row > span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}
.price-row > span:first-child {
  hyphens: auto;
  -webkit-hyphens: auto;
}

#navbar.scrolled {
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.06);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

#faq-list details[open] .faq-icon {
  transform: rotate(45deg);
}

/* ===== HERO with animated aurora background + mouse parallax ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #FAF6F0;
}
/* Coral spotlight that follows the cursor — visible against cream */
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 40%),
              rgba(231, 111, 81, 0.22),
              rgba(244, 162, 97, 0.10) 35%,
              transparent 65%);
  transition: opacity 0.4s ease;
}
/* Interactive dot grid — mask center follows cursor */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(31,41,55,0.22) 1.2px, transparent 1.6px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle 360px at var(--mx, 50%) var(--my, 40%),
              rgba(0,0,0,1) 0%,
              rgba(0,0,0,0.6) 40%,
              rgba(0,0,0,0.18) 75%,
              transparent 100%);
  -webkit-mask-image: radial-gradient(circle 360px at var(--mx, 50%) var(--my, 40%),
              rgba(0,0,0,1) 0%,
              rgba(0,0,0,0.6) 40%,
              rgba(0,0,0,0.18) 75%,
              transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Magnetic CTA buttons — stronger pull + scale on proximity */
.magnetic {
  display: inline-flex;
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1);
  will-change: transform;
}
.magnetic > * {
  pointer-events: none;
}
.hero-layer {
  position: absolute;
  inset: 0;
  will-change: transform;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.65;
}
.blob-1 { width: 540px; height: 540px; background: #E76F51; top: -120px; left: -80px; animation: blobA 18s ease-in-out infinite; }
.blob-2 { width: 460px; height: 460px; background: #F4A261; top: 30%; right: -120px; animation: blobB 22s ease-in-out infinite; }
.blob-3 { width: 380px; height: 380px; background: #2A9D8F; bottom: -100px; left: 25%; animation: blobC 16s ease-in-out infinite; opacity: 0.45; }
.blob-4 { width: 280px; height: 280px; background: #264653; top: 50%; left: 40%; animation: blobD 24s ease-in-out infinite; opacity: 0.35; }

@keyframes blobA {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(80px, 60px) scale(1.08); }
  66% { transform: translate(-40px, 100px) scale(0.95); }
}
@keyframes blobB {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-90px, -50px) scale(1.1); }
}
@keyframes blobC {
  0%, 100% { transform: translate(0,0) scale(1); }
  40% { transform: translate(60px, -70px) scale(0.9); }
  80% { transform: translate(-50px, 30px) scale(1.05); }
}
@keyframes blobD {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(70px, -40px) scale(1.15); }
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: #1F2937;
}
.hero-title em {
  font-style: normal;
  color: #E76F51;
  position: relative;
  white-space: nowrap;
}
.hero-title em::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.18em;
  background: rgba(231, 111, 81, 0.18);
  z-index: -1;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.hero-eyebrow .dot {
  width: 8px; height: 8px;
  background: #E76F51;
  border-radius: 50%;
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.4; }
}

/* ===== PENTAGON of elements ===== */
.pentagon-section {
  padding: 6rem 1.5rem;
}
.pentagon-wrap {
  position: relative;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}
.pentagon-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.35;
}
.pentagon-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  width: 30%;
}
.pentagon-center-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 1.6rem);
  letter-spacing: -0.02em;
  color: #1F2937;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}
.pentagon-center-sub {
  font-size: 0.78rem;
  color: #6B5D52;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.elem {
  position: absolute;
  width: 23%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.elem-1 { top: 10%; left: 50%; }
.elem-2 { top: 37.6%; left: 88%; }
.elem-3 { top: 82.4%; left: 73.5%; }
.elem-4 { top: 82.4%; left: 26.5%; }
.elem-5 { top: 37.6%; left: 12%; }

.elem-circle {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--from), var(--to));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 50px -20px var(--shadow, rgba(31,41,55,0.4));
  transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s ease;
  overflow: hidden;
}
.elem:hover .elem-circle {
  transform: scale(1.07);
  box-shadow: 0 30px 70px -20px var(--shadow, rgba(31,41,55,0.55));
}
.elem-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 30% 20%, rgba(255,255,255,0.4), transparent 60%);
  pointer-events: none;
}

.elem-label {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1F2937;
  text-align: center;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.elem-popup {
  position: absolute;
  top: calc(100% + 2.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 260px;
  max-width: 70vw;
  background: #1F2937;
  color: #FAF6F0;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 20px 50px -10px rgba(31,41,55,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
  z-index: 10;
}
.elem-popup::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: #1F2937;
}
.elem:hover .elem-popup,
.elem:focus-within .elem-popup {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.elem-popup-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
.elem-popup-desc {
  font-size: 0.78rem;
  color: rgba(250,246,240,0.75);
  line-height: 1.45;
  margin-bottom: 0.7rem;
}
.elem-popup-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #E76F51;
  color: #FAF6F0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background .25s ease;
}
.elem-popup-cta:hover { background: #C5563E; }

/* Element color variables */
.elem-air      { --from: #5B8DBF; --to: #A8DADC; --shadow: rgba(91, 141, 191, 0.5); }
.elem-water    { --from: #0F4C5C; --to: #5BA0B5; --shadow: rgba(15, 76, 92, 0.5); }
.elem-earth    { --from: #1B4332; --to: #74A57F; --shadow: rgba(27, 67, 50, 0.5); }
.elem-stone    { --from: #4A4A4A; --to: #8B8275; --shadow: rgba(74, 74, 74, 0.5); }
.elem-classic  { --from: #7C9885; --to: #D4C5A0; --shadow: rgba(124, 152, 133, 0.5); }

/* === SVG element animations === */
.svg-elem {
  width: 60%;
  height: 60%;
  position: relative;
  z-index: 1;
}

/* AIR — falujące linie wiatru */
.air-line {
  fill: none;
  stroke: rgba(250,246,240,0.85);
  stroke-width: 4;
  stroke-linecap: round;
  animation: airFlow 3s ease-in-out infinite;
}
.air-line:nth-child(1) { animation-delay: 0s; }
.air-line:nth-child(2) { animation-delay: 0.6s; }
.air-line:nth-child(3) { animation-delay: 1.2s; }
.air-line:nth-child(4) { animation-delay: 0.3s; }
@keyframes airFlow {
  0%, 100% { transform: translateX(-6px); opacity: 0.5; }
  50% { transform: translateX(6px); opacity: 1; }
}

/* WATER — fala morska */
.water-wave {
  fill: rgba(250,246,240,0.85);
  animation: waterMove 4s ease-in-out infinite;
}
.water-wave-2 { animation-delay: -2s; opacity: 0.55; }
@keyframes waterMove {
  0%, 100% { transform: translateX(-12%); }
  50% { transform: translateX(0%); }
}

/* EARTH — drzewo z liśćmi */
.earth-trunk { fill: rgba(60,40,28,0.9); }
.earth-leaf {
  fill: rgba(250,246,240,0.9);
  transform-origin: center bottom;
  animation: earthSway 4s ease-in-out infinite;
}
.earth-leaf:nth-child(2) { animation-delay: 0.4s; }
.earth-leaf:nth-child(3) { animation-delay: 0.8s; }
.earth-leaf:nth-child(4) { animation-delay: 1.2s; }
@keyframes earthSway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

/* STONE — kamień + kruszące się okruchy */
.stone-rock { fill: rgba(250,246,240,0.85); }
.stone-particle {
  fill: rgba(250,246,240,0.7);
  animation: stoneFall 2.4s ease-in infinite;
}
.stone-particle:nth-child(2) { animation-delay: 0.6s; }
.stone-particle:nth-child(3) { animation-delay: 1.2s; }
.stone-particle:nth-child(4) { animation-delay: 1.8s; }
@keyframes stoneFall {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(60px) translateX(var(--tx, 0px)); opacity: 0; }
}

/* CLASSIC — vintage ornament + shimmer */
.classic-frame {
  fill: none;
  stroke: rgba(250,246,240,0.9);
  stroke-width: 3;
  stroke-linecap: round;
}
.classic-leaf {
  fill: rgba(250,246,240,0.9);
  transform-origin: center;
  animation: classicFloat 5s ease-in-out infinite;
}
.classic-leaf:nth-child(odd) { animation-delay: 0s; }
.classic-leaf:nth-child(even) { animation-delay: 1.5s; }
@keyframes classicFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(5deg); }
}
.classic-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: classicShimmer 3.5s ease-in-out infinite;
  border-radius: 50%;
  pointer-events: none;
}
@keyframes classicShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Contact form === */
.contact-form {
  display: grid;
  gap: 1rem;
}
.cf-row { display: grid; gap: 1rem; }
@media (min-width: 640px) {
  .cf-row-2 { grid-template-columns: 1fr 1fr; }
}
.cf-field { display: flex; flex-direction: column; gap: 0.4rem; }
.cf-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1F2937;
}
.cf-label .req { color: #E76F51; }
.cf-input,
.cf-select,
.cf-textarea {
  width: 100%;
  background: #FAF6F0;
  border: 1.5px solid #E8E2D9;
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: #1F2937;
  transition: border-color .2s ease, background .2s ease;
}
.cf-input:focus,
.cf-select:focus,
.cf-textarea:focus {
  outline: none;
  border-color: #E76F51;
  background: #ffffff;
}
.cf-textarea { resize: vertical; min-height: 110px; }
.cf-honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.cf-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #E76F51;
  color: #FAF6F0;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background .25s ease, transform .25s ease;
}
.cf-submit:hover { background: #C5563E; transform: translateY(-1px); }
.cf-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.cf-note {
  font-size: 0.8rem;
  color: #6B5D52;
  margin-top: 0.3rem;
}

/* Pentagon + preview panel side-by-side (desktop only) */
.pentagon-with-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}

.pentagon-preview {
  background: #FAF6F0;
  border: 1px solid #E8E2D9;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(31, 41, 55, 0.18);
  transition: opacity 0.4s ease;
}
.pp-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center top;
  background-color: #1F2937;
  transition: opacity 0.35s ease, background-image 0.35s ease;
}
.pp-content {
  padding: 1.4rem 1.75rem 1.75rem;
}
.pp-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #E76F51;
  margin-bottom: 0.4rem;
}
.pp-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  color: #1F2937;
}
.pp-desc {
  color: #6B5D52;
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 1.1rem;
}
.pp-usps {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4rem 0;
}
.pp-usps li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.875rem;
  margin-bottom: 0.45rem;
  color: #1F2937;
  line-height: 1.45;
}
.pp-usps li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: #E76F51;
  font-weight: 700;
}
.pp-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #1F2937;
  color: #FAF6F0;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.25s ease;
}
.pp-cta:hover {
  background: #E76F51;
  transform: translateX(3px);
}

/* Highlighted active element in pentagon */
.elem.is-active .elem-circle {
  transform: scale(1.12);
  box-shadow: 0 30px 70px -15px var(--shadow, rgba(231, 111, 81, 0.6));
}

/* Desktop layout — hide elem-popup on lg+ since preview panel takes over */
@media (min-width: 1024px) {
  .elem-popup {
    display: none !important;
  }
  .pentagon-wrap {
    max-width: 520px;
  }
}

/* Tablet/mobile fallback — stack preview below + show old popups on touch */
@media (max-width: 1023px) {
  .pentagon-with-preview {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .pentagon-preview {
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .pentagon-preview { display: none; }
  .pentagon-wrap {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1rem;
    max-width: 480px;
    padding: 1rem 0;
  }
  .pentagon-grid, .pentagon-center { display: none; }
  .elem {
    position: static;
    width: 100%;
    transform: none;
  }
  .elem-1 { grid-column: 1 / -1; max-width: 50%; margin: 0 auto; }
  .elem-popup {
    display: block !important;
    position: static;
    transform: none;
    width: 100%;
    max-width: none;
    margin-top: 0.6rem;
    opacity: 1;
    pointer-events: auto;
  }
  .elem-popup::before { display: none; }
}

/* === Language switcher === */
.lang-switch {
  display: inline-flex;
  background: rgba(31, 41, 55, 0.06);
  border-radius: 999px;
  padding: 3px;
  gap: 0;
}
.lang-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #6B5D52;
  border-radius: 999px;
  text-decoration: none;
  transition: color .25s ease, background .25s ease;
  min-width: 36px;
}
.lang-pill:hover { color: #1F2937; }
.lang-pill.active {
  background: #1F2937;
  color: #FAF6F0;
}

/* === Interactive calculator (pensjonaty.html) === */
.calc-field {
  position: relative;
}
.calc-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(250, 246, 240, 0.9);
  margin-bottom: 0.6rem;
}
.calc-unit {
  color: rgba(250, 246, 240, 0.5);
  font-weight: 400;
}
.calc-input-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.calc-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(250, 246, 240, 0.15);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #E76F51;
  cursor: pointer;
  border: 3px solid #FAF6F0;
  box-shadow: 0 2px 8px rgba(231, 111, 81, 0.4);
  transition: transform .15s ease;
}
.calc-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.calc-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #E76F51;
  cursor: pointer;
  border: 3px solid #FAF6F0;
  box-shadow: 0 2px 8px rgba(231, 111, 81, 0.4);
  transition: transform .15s ease;
}
.calc-range::-moz-range-thumb:hover {
  transform: scale(1.15);
}
.calc-number {
  width: 92px;
  background: rgba(250, 246, 240, 0.08);
  border: 1px solid rgba(250, 246, 240, 0.18);
  color: #FAF6F0;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  -moz-appearance: textfield;
}
.calc-number::-webkit-outer-spin-button,
.calc-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc-number:focus {
  outline: none;
  border-color: #E76F51;
  background: rgba(250, 246, 240, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .blob { animation: none !important; }
  .hero-eyebrow .dot { animation: none; }
  .air-line, .water-wave, .earth-leaf, .stone-particle, .classic-leaf, .classic-shimmer { animation: none !important; }
  .hero-layer { transition: none !important; transform: none !important; }
  .magnetic { transition: none !important; transform: none !important; }
  .hero-bg::before, .hero-bg::after { transition: none !important; }
}
@media (hover: none) {
  /* Touch devices — no spotlight following non-existent cursor */
  .hero-bg::before { display: none; }
  .magnetic { transform: none !important; }
}
