/*
  ══════════════════════════════════════════════════════════════
  CARUK AUDIT — THERMAL SIGNATURE
  Thematic components: hero · trust bar · service cards ·
  features · process steps · CTA banner · contact section
  ══════════════════════════════════════════════════════════════
*/

/* ── HERO ────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: var(--sp-24);
  overflow: hidden;
}

/* Atmospheric radial glows */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 50% at 70% 5%,  rgba(219,161,78,.07)  0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 20% 90%, rgba(219,161,78,.05) 0%, transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 50%, rgba(44,74,122,.10)  0%, transparent 100%);
  pointer-events: none;
}

/* Subtle grid texture */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(44,74,122,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44,74,122,.028) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 860px;
}

/* Linia skanowania termicznego — porusza się w górę jak kamera IR */
.hero-inner::before {
  content: '';
  position: absolute;
  inset-inline: -5%;
  top: -2px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(219,161,78,.35) 40%, rgba(219,161,78,.5) 50%, rgba(219,161,78,.35) 60%, transparent 100%);
  filter: blur(1px);
  animation: thermal-scan 9s linear infinite;
  pointer-events: none;
  border-radius: 1px;
}

/* Ciepła poświata pod linią skanowania */
.hero-inner::after {
  content: '';
  position: absolute;
  inset-inline: -5%;
  top: -8px;
  height: 14px;
  background: linear-gradient(180deg, transparent 0%, rgba(219,161,78,.06) 50%, transparent 100%);
  animation: thermal-scan 9s linear infinite;
  pointer-events: none;
}

/* Animated thermal dots indicator */
.thermal-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.thermal-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.thermal-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: t-pulse 2.8s ease-in-out infinite;
}
/* Ciepła rampa: od chłodnego brązu do jasnego złota */
.thermal-dots span:nth-child(1) { background: #7a3b2e; animation-delay:    0ms; }
.thermal-dots span:nth-child(2) { background: #cc6a55; animation-delay:  280ms; }
.thermal-dots span:nth-child(3) { background: #dba14e; animation-delay:  560ms; }
.thermal-dots span:nth-child(4) { background: #e8c074; animation-delay:  840ms; }

@keyframes t-pulse {
  0%, 100% { opacity: .35; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.35); }
}

/* Hero headline */
.hero h1 {
  font-size: clamp(2.75rem, 7vw, 5.75rem);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-6);
  font-style: italic;
}

.hero h1 .t-gradient {
  font-style: inherit;
  color: var(--c-accent);
  animation: heat-glow 4s ease-in-out infinite;
}

/* Thermal bar under headline — "nagrzewanie" */
.hero-bar {
  height: 3px;
  width: 180px;
  background: var(--c-accent);
  border-radius: var(--r-full);
  margin-block: var(--sp-6);
  transform-origin: left center;
  animation: bar-heat 1.4s var(--ease) both;
  animation-play-state: paused;
}
.hero-bar.visible { animation-play-state: running; }

.hero-sub {
  font-size: var(--text-xl);
  color: var(--c-body);
  max-width: 540px;
  line-height: 1.65;
  margin-bottom: var(--sp-10);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  padding-top: var(--sp-8);
  margin-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--c-muted);
}
.hero-meta-item svg { color: var(--c-accent); flex-shrink: 0; }

/* ── TRUST BAR ───────────────────────────────────────────────────── */
.trust-bar {
  padding-block: var(--sp-10);
  background: var(--c-surface);
  border-block: 1px solid var(--c-border);
  position: relative;
  overflow: hidden;
}
.trust-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--g-thermal);
}
.trust-bar-inner {
  display: flex;
  justify-content: center;
  gap: var(--sp-20);
  flex-wrap: wrap;
}
.trust-stat       { text-align: center; }
.trust-stat-num {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1;
  margin-bottom: var(--sp-1);
  font-variant-numeric: tabular-nums;
}
.trust-stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-muted);
}

/* ── SERVICE CARDS ───────────────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}

.service-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition:
    transform var(--t-slow) var(--ease),
    box-shadow var(--t-slow),
    border-color var(--t-slow);
}

/* Thermal top accent + amber glow przy hover */
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--c-accent);
  opacity: 0;
  transition: opacity var(--t-base);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--c-accent), 0 0 32px rgba(219,161,78,.10);
  border-color: var(--c-accent);
}
.service-card:hover::before { opacity: 1; }

.service-card-img {
  width: 100%;
  height: 185px;
  object-fit: cover;
  filter: saturate(0.5) brightness(0.65);
  transition: filter 0.65s var(--ease), transform 0.65s var(--ease);
}
.service-card:hover .service-card-img {
  filter: saturate(0.85) brightness(0.8);
  transform: scale(1.04);
}

/* Wariant z linkiem-otoczką (lista usług /uslugi/) — jednolita wysokość i kadrowanie */
.service-card-img-wrap { display: block; overflow: hidden; }
.service-card-img-wrap img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  filter: saturate(0.5) brightness(0.65);
  transition: filter 0.65s var(--ease), transform 0.65s var(--ease);
}
.service-card:hover .service-card-img-wrap img {
  filter: saturate(0.85) brightness(0.8);
  transform: scale(1.04);
}

.service-card-body {
  padding: var(--sp-5) var(--sp-6) var(--sp-6);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.service-card-body h3 { font-size: var(--text-xl); margin-bottom: var(--sp-3); }
.service-card-body p  { font-size: var(--text-sm); color: var(--c-muted); flex-grow: 1; margin-bottom: var(--sp-5); line-height: 1.65; }

.service-card-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-accent);
  margin-top: auto;
  transition: gap var(--t-base) var(--ease);
}
.service-card-link:hover { gap: var(--sp-4); }

/* ── FEATURE CARDS (Why us) ──────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

.feature-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.feature-card:hover {
  border-color: var(--c-border-2);
  box-shadow: var(--shadow-md);
}

.feature-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-5);
  color: var(--c-accent);
  transition: background var(--t-base), border-color var(--t-base);
  flex-shrink: 0;
}
.feature-card:hover .feature-icon-wrap {
  background: var(--c-accent-glow);
  border-color: var(--c-accent);
}

.feature-card h3 { font-size: var(--text-xl); margin-bottom: var(--sp-3); }
.feature-card p  { font-size: var(--text-sm); color: var(--c-muted); margin: 0; line-height: 1.65; }

/* ── PROCESS STEPS ───────────────────────────────────────────────── */
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  position: relative;
}

/* Connector line */
.process-steps::before {
  content: '';
  position: absolute;
  top: 27px;
  left: calc(12.5% + 27px);
  right: calc(12.5% + 27px);
  height: 1px;
  background: var(--c-border-2);
  z-index: 0;
}

.process-step {
  text-align: center;
  padding: var(--sp-5) var(--sp-4);
  position: relative;
  z-index: 1;
}

.process-num {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--c-surface);
  border: 2px solid var(--c-border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--c-accent);
  margin: 0 auto var(--sp-5);
  transition: background var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}
.process-step:hover .process-num {
  background: var(--c-accent-glow);
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(219,161,78,.11);
}

.process-step h4,
.process-step h3  { font-size: var(--text-base); margin-bottom: var(--sp-2); }
.process-step p   { font-size: var(--text-sm); color: var(--c-muted); margin: 0; line-height: 1.6; }

/* ── BLOG GRID ───────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

.article-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform var(--t-slow) var(--ease),
    box-shadow var(--t-slow),
    border-color var(--t-slow);
}
.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--c-border-2);
}

/* ── AREA / LOCATION SECTION ────────────────────────────────────── */
.location-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  max-width: 860px;
  margin-inline: auto;
}

/* ── CTA BANNER ──────────────────────────────────────────────────── */
.cta-banner {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-20) var(--sp-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 65% 65% at 50% 50%, rgba(219,161,78,.04), transparent);
  pointer-events: none;
}
.cta-banner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--g-thermal);
}
.cta-banner > * { position: relative; z-index: 1; }
.cta-banner h2  { margin-bottom: var(--sp-4); }
.cta-banner p   { color: var(--c-body); font-size: var(--text-lg); margin-bottom: var(--sp-8); max-width: 560px; margin-inline: auto; }

/* ── CONTACT SECTION ─────────────────────────────────────────────── */
.contact-section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-12);
  position: relative;
  overflow: hidden;
}
.contact-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--g-thermal);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-12);
  align-items: start;
}

.contact-info h3 { margin-bottom: var(--sp-6); }

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.contact-icon {
  width: 42px;
  height: 42px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-accent);
  flex-shrink: 0;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.contact-item:hover .contact-icon {
  background: var(--c-accent-glow);
  border-color: var(--c-accent);
}

.contact-item-text strong {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  margin-bottom: var(--sp-1);
}
.contact-item-text a,
.contact-item-text span {
  font-size: var(--text-sm);
  color: var(--c-body);
  transition: color var(--t-fast);
}
.contact-item-text a:hover { color: var(--c-accent); }

/* ── HERO SUBPAGE ────────────────────────────────────────────────── */
.hero-subpage {
  min-height: auto;
  padding-block: var(--sp-20) var(--sp-16);
  background:
    radial-gradient(ellipse 60% 50% at 80% 0%,  rgba(219,161,78,.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 100%, rgba(44,74,122,.08)  0%, transparent 60%);
}
.hero-subpage h1  { margin-bottom: var(--sp-4); }
.hero-subpage p   { font-size: var(--text-lg); color: var(--c-body); max-width: 600px; }

/* ── SECTION THERMAL ACCENT (vertical left bar) ─────────────────── */
.thermal-left {
  padding-left: var(--sp-6);
  border-left: 3px solid var(--c-accent);
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid  { grid-template-columns: repeat(2, 1fr); }
  .process-steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .process-steps::before { display: none; }
  .contact-grid  { grid-template-columns: 1fr; }
  .blog-grid     { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding-block: var(--sp-20) var(--sp-16);
    align-items: flex-start;
    padding-top: calc(var(--header-h) + var(--sp-12));
  }

  .hero h1 { font-size: clamp(2.25rem, 9.5vw, 3rem); line-height: 1.12; }

  /* Subpage hero — mniejszy padding żeby nie tracić ekranu na mobile */
  .hero-subpage { padding-block: var(--sp-12) var(--sp-10); }

  .trust-bar-inner    { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8) var(--sp-6); }
  .trust-stat-num     { font-size: var(--text-3xl); line-height: 1.1; }
  .hero-meta          { gap: var(--sp-4); padding-top: var(--sp-6); }
  .hero-meta-item     { font-size: var(--text-xs); }
  .services-grid      { grid-template-columns: 1fr; }
  .feature-grid       { grid-template-columns: 1fr; }
  .process-steps      { grid-template-columns: 1fr; }
  .blog-grid          { grid-template-columns: 1fr; }

  .contact-section    { padding: var(--sp-8); }
  .cta-banner         { padding: var(--sp-10) var(--sp-6); }
}

/* ══════════════════════════════════════════════════════════════
   WYKRES OSZCZĘDNOŚCI — savings-chart
   CSS-only, animowany przez IntersectionObserver (.reveal)
   ══════════════════════════════════════════════════════════════ */

.savings-chart {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

.savings-row {
  display: grid;
  grid-template-columns: 1fr 3fr auto;
  align-items: center;
  gap: var(--sp-4);
}

.savings-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--c-ink);
  line-height: 1.3;
}

.savings-track {
  height: 10px;
  background: var(--c-surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.savings-fill {
  height: 100%;
  width: var(--w, 25%);
  background: var(--c-accent);
  border-radius: 99px;
  transform-origin: left center;
  transform: scaleX(0);
  /* delay 0.25s żeby row zdążył się pojawić przed animacją słupka */
  transition: transform 0.9s cubic-bezier(.4,0,.2,1) 0.25s;
  will-change: transform;
}

/* Trigger: gdy rodzic .savings-row dostanie .visible od IO */
.savings-row.visible .savings-fill {
  transform: scaleX(1);
}

.savings-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-accent);
  white-space: nowrap;
  min-width: 4.5rem;
  text-align: right;
}

.savings-disclaimer {
  font-size: var(--text-xs);
  color: var(--c-muted);
  margin-top: var(--sp-3);
  line-height: 1.5;
}

/* Mobile: etykieta nad słupkiem */
@media (max-width: 600px) {
  .savings-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    row-gap: var(--sp-2);
  }
  .savings-label { grid-column: 1; grid-row: 1; }
  .savings-value { grid-column: 2; grid-row: 1; }
  .savings-track { grid-column: 1 / -1; grid-row: 2; }
}

/* Reduced-motion: słupki pełne od razu, bez animacji */
@media (prefers-reduced-motion: reduce) {
  .savings-fill,
  .savings-row.visible .savings-fill { transform: scaleX(1); transition: none; }
}

/* ══════════════════════════════════════════════════════════════
   ANIMACJE TERMICZNE
   Wydajne: wyłącznie transform / opacity / color / text-shadow
   GPU-accelerated: translate3d, will-change ograniczone do hero
   ══════════════════════════════════════════════════════════════ */

/* Skan kamery termowizyjnej (hero) */
@keyframes thermal-scan {
  0%   { transform: translate3d(0, -10px, 0);   opacity: 0; }
  3%   { opacity: 1; }
  97%  { opacity: 1; }
  100% { transform: translate3d(0, 115vh, 0);   opacity: 0; }
}

/* Nagrzewanie hero-bar: rośnie od lewej */
@keyframes bar-heat {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Ciepła poświata na „nie widać" */
@keyframes heat-glow {
  0%,100% { text-shadow: 0 0 0 transparent; }
  50%     { text-shadow: 0 0 22px rgba(219,161,78,.45), 0 0 48px rgba(219,161,78,.20); }
}

/* ── Reduced-motion override ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-inner::before,
  .hero-inner::after  { animation: none; opacity: 0; }
  .hero-bar           { animation: none; }
  .hero h1 .t-gradient{ animation: none; }
  .thermal-dots span  { animation: none; }
}
