/* ===== Smooth scroll ===== */
html { scroll-behavior: smooth; }

/* ===== Brand logo (text) ===== */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: .15em;
  font-family: 'Caveat', 'Plus Jakarta Sans', cursive;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  position: relative;
  padding: .15em 1.8em .15em .1em;
  text-decoration: none;
  transition: transform .25s ease;
  transform-origin: left center;
  overflow: visible;
  flex-shrink: 0;
}
.brand-logo:hover { transform: rotate(-1.5deg) scale(1.02); }

.brand-korki {
  font-size: 1.75rem;
  color: #1e1b4b;
  line-height: 1;
  padding-right: .15em;
  display: inline-block;
}
.brand-u {
  font-size: 1.35rem;
  color: #ec4899;
  margin: 0 .1em;
  line-height: 1;
  display: inline-block;
}
.brand-karolki {
  font-size: 1.95rem;
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 60%, #db2777 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  display: inline-block;
  padding-right: .35em;     /* room for italic-tail glyph overhang */
  overflow: visible;
}
.brand-i {
  position: relative;
  display: inline-block;
  padding-right: .25em;     /* room for italic-tail overhang */
  /* re-apply gradient: parent's background-clip:text doesn't propagate to children */
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 60%, #db2777 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-heart {
  position: absolute;
  left: 50%;
  top: -.55em;
  transform: translateX(-50%);
  font-size: .55em;
  color: #f472b6;
  line-height: 1;
  animation: heartbeat 1.8s ease-in-out infinite;
  transform-origin: center;
}
@keyframes heartbeat {
  0%, 100% { transform: translateX(-50%) scale(1); }
  20%      { transform: translateX(-50%) scale(1.3); }
  40%      { transform: translateX(-50%) scale(0.95); }
  60%      { transform: translateX(-50%) scale(1.2); }
}
@keyframes heartbeat {
  0%, 100% { transform: translateX(-50%) scale(1); }
  20%      { transform: translateX(-50%) scale(1.3); }
  40%      { transform: translateX(-50%) scale(0.95); }
  60%      { transform: translateX(-50%) scale(1.2); }
}

/* Smaller variant for footer */
.brand-logo--sm .brand-korki   { font-size: 1.15rem; }
.brand-logo--sm .brand-u       { font-size: .9rem; }
.brand-logo--sm .brand-karolki { font-size: 1.3rem; }

@media (min-width: 640px) {
  .brand-korki   { font-size: 2rem; }
  .brand-karolki { font-size: 2.25rem; }
  .brand-u       { font-size: 1.5rem; }
}

/* ===== Header scrolled state ===== */
#site-header.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  box-shadow: 0 1px 0 0 rgba(15, 23, 42, 0.06);
}

/* ===== Reveal-on-scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease, transform .8s ease;
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Calculator pills ===== */
.calc-pill {
  padding: .65rem 1rem;
  border-radius: .9rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: #e2e8f0;
  font-weight: 600;
  font-size: .9rem;
  text-align: center;
  transition: all .2s ease;
  cursor: pointer;
}
.calc-pill:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.25);
}
.calc-pill.active {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border-color: #a78bfa;
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(139, 92, 246, .6);
}

/* ===== Form radio "pills" ===== */
.form-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1rem;
  border-radius: .9rem;
  border: 2px solid #e2e8f0;
  background: #fff;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s ease;
  color: #334155;
}
.form-pill:hover { border-color: #c4b5fd; }
.form-pill input { display: none; }
.form-pill:has(input:checked) {
  border-color: #7c3aed;
  background: #f5f3ff;
  color: #5b21b6;
}

/* ===== Instagram feed (carousel) ===== */
.ig-carousel {
  position: relative;
}
#ig-feed.ig-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-padding-left: .25rem;
  padding: .25rem .25rem 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c4b5fd transparent;
}
#ig-feed.ig-track::-webkit-scrollbar { height: 8px; }
#ig-feed.ig-track::-webkit-scrollbar-thumb { background: #c4b5fd; border-radius: 999px; }
#ig-feed.ig-track::-webkit-scrollbar-track { background: transparent; }
#ig-feed .instagram-media {
  margin: 0 !important;
  flex: 0 0 calc(100% - .5rem);
  min-width: 0 !important;
  width: calc(100% - .5rem) !important;
  max-width: 100% !important;
  scroll-snap-align: start;
  border-radius: 1rem !important;
  box-shadow: 0 10px 30px -10px rgba(124,58,237,.18) !important;
  overflow: hidden !important;
}
@media (min-width: 640px) {
  #ig-feed .instagram-media {
    flex-basis: calc((100% - 1.25rem) / 2);
    width: calc((100% - 1.25rem) / 2) !important;
  }
}
@media (min-width: 1024px) {
  #ig-feed .instagram-media {
    flex-basis: calc((100% - 2.5rem) / 3);
    width: calc((100% - 2.5rem) / 3) !important;
  }
}
.ig-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #7c3aed;
  border: 1px solid #ede9fe;
  border-radius: 9999px;
  box-shadow: 0 8px 24px -8px rgba(124,58,237,.35);
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
}
.ig-nav:hover { background: #7c3aed; color: #fff; transform: translateY(-50%) scale(1.05); }
.ig-nav:disabled { opacity: .35; cursor: default; }
.ig-nav-prev { left: -10px; }
.ig-nav-next { right: -10px; }
@media (min-width: 768px) {
  .ig-nav-prev { left: -22px; }
  .ig-nav-next { right: -22px; }
}
.ig-placeholder {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(124,58,237,.18);
  display: flex;
  flex-direction: column;
}
.ig-head {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.ig-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
  padding: 2px;
  position: relative;
  flex-shrink: 0;
}
.ig-avatar::before {
  content: 'K';
  position: absolute; inset: 2px;
  background: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #ec4899;
  font-weight: 800;
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
}
.ig-name { font-size: .85rem; font-weight: 700; color: #1e293b; }
.ig-loc  { font-size: .7rem; color: #64748b; }
.ig-body {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #ede9fe, #fce7f3);
  color: #5b21b6;
  font-weight: 700;
  font-size: 1rem;
}
.ig-body span {
  display: block;
  margin-top: .5rem;
  font-size: .75rem;
  font-weight: 500;
  color: #7c3aed;
  opacity: .8;
}

/* ===== Gallery slider (legacy, niewykorzystywane) ===== */
.gallery-slider {
  scrollbar-width: thin;
  scrollbar-color: #c4b5fd transparent;
  -webkit-overflow-scrolling: touch;
}
.gallery-slider::-webkit-scrollbar { height: 8px; }
.gallery-slider::-webkit-scrollbar-thumb { background: #c4b5fd; border-radius: 4px; }
.gallery-slider::-webkit-scrollbar-track { background: transparent; }
.gallery-slider .slide {
  flex: 0 0 auto;
  width: calc((100% - 1.5rem) / 3); /* 3 per view, two .75rem gaps */
  min-width: 0;
  scroll-snap-align: start;
  aspect-ratio: 1 / 1;
}
@media (max-width: 640px) {
  .gallery-slider .slide {
    width: calc((100% - .75rem) / 2); /* 2 per view on mobile, one gap */
  }
}

/* ===== Gallery item ===== */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(91,33,182,.45), transparent 50%);
  opacity: 0;
  transition: opacity .3s ease;
}
.gallery-item:hover::after { opacity: 1; }
.gallery-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: #7c3aed; font-weight: 700; font-size: .8rem;
  text-align: center; padding: .5rem;
}

/* ===== Lightbox visible state ===== */
#lightbox.show { display: flex; animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }

/* ===== Details (FAQ) marker ===== */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* ===== Range slider ===== */
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  background: #a78bfa;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(139,92,246,.5);
  cursor: pointer;
}


/* ===== Oferta â€” subject cards ===== */
.subject-card { transition: transform .35s ease, box-shadow .35s ease; }
.subject-card:hover { box-shadow: 0 30px 60px -25px rgba(76, 29, 149, .45); }
.subject-pattern-math {
  background-image:
    radial-gradient(circle at 20% 30%, #fff 1.5px, transparent 2px),
    radial-gradient(circle at 70% 60%, #fff 1.5px, transparent 2px),
    radial-gradient(circle at 40% 80%, #fff 1px, transparent 1.5px);
  background-size: 80px 80px, 110px 110px, 60px 60px;
  mask-image: linear-gradient(180deg, #000 0%, #000 80%, transparent 100%);
}
.subject-pattern-en {
  background-image:
    linear-gradient(45deg, transparent 48%, #fff 49%, #fff 51%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, #fff 49%, #fff 51%, transparent 52%);
  background-size: 32px 32px, 32px 32px;
}

/* ===== Oferta â€” format cards ===== */
.format-card {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: 1.1rem 1.25rem;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 1.25rem;
  box-shadow: 0 6px 20px -12px rgba(15, 23, 42, .15);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.format-card:hover {
  transform: translateY(-3px);
  border-color: #e9d5ff;
  box-shadow: 0 18px 35px -18px rgba(124, 58, 237, .35);
}
.format-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 18px -8px rgba(15, 23, 42, .35);
}

/* ===== Sekcja "Jak ucz" — lesson cards ===== */
.lesson-card {
  position: relative;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 1.25rem;
  padding: 1.6rem 1.4rem 1.4rem;
  box-shadow: 0 6px 20px -12px rgba(15, 23, 42, .15);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.lesson-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-soft, #e9d5ff);
  box-shadow: 0 22px 40px -22px color-mix(in srgb, var(--accent, #7c3aed) 45%, transparent);
}
.lesson-stripe {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent, #7c3aed), color-mix(in srgb, var(--accent, #7c3aed) 50%, #fff));
}
.lesson-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-soft, #ede9fe);
  color: var(--accent, #7c3aed);
}
.lesson-card-featured {
  background: linear-gradient(180deg, #fff 0%, color-mix(in srgb, var(--accent, #7c3aed) 6%, #fff) 100%);
}