/* =========================================================
   TOKENS
   ========================================================= */
:root{
  --navy: #10233F;
  --navy-deep: #0B1930;
  --jade: #4CAE97;
  --jade-soft: #6FCBB4;
  --cream: #F4F2EA;
  --charcoal: #1C1C1C;
  --jade-deep: #1B6358;
  --steel: #5C7088;
  --line: rgba(16,35,63,0.14);
  --line-light: rgba(244,242,234,0.18);

  --font-display: 'Libre Franklin', system-ui, sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;

  --radius: 6px;
  --wrap: 1160px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{
    animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

body{
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo-text, .eyebrow, .btn, nav a, .hero-facts strong{
  font-family: var(--font-display);
}

h1, h2, h3{ margin: 0 0 0.5em; color: var(--navy); font-weight: 700; line-height: 1.15; }
h1{ font-size: clamp(2.2rem, 4.6vw, 3.6rem); letter-spacing: -0.01em; }
h2{ font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -0.005em; }
h3{ font-size: 1.25rem; }
p{ margin: 0 0 1em; }
a{ color: inherit; }
img{ max-width: 100%; display: block; }

.wrap{ max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip-link{
  position: absolute; left: -9999px; top: 0; background: var(--jade); color: var(--navy-deep);
  padding: 12px 18px; z-index: 1000; font-family: var(--font-display); font-weight: 700; border-radius: 0 0 6px 0;
}
.skip-link:focus{ left: 0; }

:focus-visible{ outline: 3px solid var(--jade); outline-offset: 2px; }

.eyebrow{
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem;
  color: var(--jade-deep); margin: 0 0 0.7em;
}
.eyebrow-light{ color: var(--jade-soft); }
.h-light{ color: var(--cream); }
.p-light{ color: rgba(244,242,234,0.82); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  padding: 14px 26px; border-radius: var(--radius); border: 2px solid transparent;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn:hover{ transform: translateY(-2px); }
.btn-primary{ background: var(--jade); color: var(--navy-deep); }
.btn-primary:hover{ background: var(--jade-soft); }
.btn-ghost{ background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover{ background: var(--navy); color: var(--cream); }
.btn-call{ background: var(--navy); color: var(--cream); padding: 10px 18px; font-size: 0.95rem; }
.btn-call:hover{ background: var(--navy-deep); }
.btn-block{ width: 100%; padding: 15px 26px; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header{
  position: sticky; top: 0; z-index: 100;
  background: rgba(16,35,63,0.97);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--jade);
}
.header-inner{ display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 12px; padding-bottom: 12px; }

.logo{ display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--cream); }
.logo-mark{ color: var(--jade); display: inline-flex; }
.logo-text{ font-weight: 700; font-size: 1.15rem; color: var(--cream); }
.logo-text em{ font-style: normal; color: var(--jade); }
.logo-text-footer{ color: var(--cream); }

.main-nav{ display: flex; gap: 28px; }
.main-nav a{ color: var(--cream); text-decoration: none; font-weight: 600; font-size: 0.98rem; position: relative; padding: 4px 0; }
.main-nav a::after{
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--jade);
  transition: width 0.2s ease;
}
.main-nav a:hover::after, .main-nav a:focus-visible::after{ width: 100%; }

.header-actions{ display: flex; align-items: center; gap: 14px; }
.menu-toggle{ display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; background: transparent; border: none; cursor: pointer; }
.menu-toggle span{ display: block; width: 22px; height: 2px; background: var(--cream); }

/* =========================================================
   HERO
   ========================================================= */
.hero{ padding: 72px 0 88px; overflow: hidden; }
.hero-inner{ display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.hero-lead{ font-size: 1.15rem; max-width: 46ch; color: #2b2b2b; }
.hero-actions{ display: flex; gap: 16px; flex-wrap: wrap; margin: 28px 0 36px; }

.hero-facts{ list-style: none; display: flex; gap: 30px; padding: 0; margin: 0; border-top: 1px solid var(--line); padding-top: 24px; flex-wrap: wrap; }
.hero-facts li{ display: flex; flex-direction: column; gap: 2px; }
.hero-facts strong{ font-size: 1.4rem; color: var(--navy); font-weight: 800; }
.hero-facts span{ font-size: 0.85rem; color: var(--steel); font-family: var(--font-display); }

.hero-visual{ display: flex; justify-content: center; }
#circuit-hero{ width: 100%; max-width: 460px; height: auto; }

/* Długość każdej kreski (--len), czas rysowania (--dur) i opóźnienie (--delay) są
   wyliczane w script.js na podstawie getTotalLength() rzeczywistej ścieżki SVG —
   wartości domyślne poniżej to tylko fallback, gdy JS się nie wykona. */
.circuit-line{ stroke-dasharray: var(--len, 260); stroke-dashoffset: var(--len, 260); }
.energize .circuit-line{
  animation: draw var(--dur, 1.1s) cubic-bezier(0.65, 0, 0.35, 1) var(--delay, 0s) forwards;
}
@keyframes draw{ to{ stroke-dashoffset: 0; } }

.node{ opacity: 0.5; }
.energize .node-1, .energize .node-2, .energize .node-3{
  animation: pulse 0.4s cubic-bezier(0.16, 1, 0.3, 1) var(--delay, 0s) forwards;
}
@keyframes pulse{ to{ opacity: 1; fill: var(--jade); } }

.bulb-fill{
  filter: drop-shadow(0 0 0 rgba(76,174,151,0));
  transition: fill 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.bulb-filament{ transition: stroke 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.energize .bulb-fill{
  transition-delay: var(--bulb-delay, 1.3s); fill: var(--jade); filter: drop-shadow(0 0 14px rgba(76,174,151,0.55));
}
.energize .bulb-filament{ transition-delay: var(--bulb-delay, 1.3s); stroke: var(--navy-deep); }

/* =========================================================
   SECTIONS (general)
   ========================================================= */
.section{ padding: 84px 0; }
.section-alt{ background: #EFEAE0; }
.section-dark{ background: var(--navy); }
.section-head{ max-width: 640px; margin-bottom: 44px; }
.section-note{ color: var(--steel); font-family: var(--font-display); font-size: 0.95rem; }

.grid-2{ display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }

/* reveal on scroll */
[data-reveal]{ opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].in-view{ opacity: 1; transform: translateY(0); }

/* =========================================================
   O MNIE / credentials
   ========================================================= */
.credential-card{ background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.credential-list{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.credential-list li{ display: flex; gap: 16px; align-items: flex-start; }
.credential-list svg{ color: var(--jade-deep); flex-shrink: 0; margin-top: 3px; }
.credential-list strong{ display: block; font-family: var(--font-display); color: var(--navy); font-size: 1.02rem; }
.credential-list span{ font-family: var(--font-display); font-size: 0.88rem; color: var(--steel); }

/* =========================================================
   SERVICES
   ========================================================= */
.services-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card{
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px; transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.service-card:hover{ transform: translateY(-6px); box-shadow: 0 14px 28px rgba(16,35,63,0.12); border-color: var(--jade); }
.service-icon{ color: var(--jade-deep); margin-bottom: 14px; }
.service-card h3{ font-size: 1.08rem; margin-bottom: 0.4em; }
.service-card p{ font-size: 0.98rem; color: #3c3c3c; margin-bottom: 0; }

/* =========================================================
   AREA
   ========================================================= */
.area-list{ display: flex; flex-wrap: wrap; gap: 14px; align-content: flex-start; }
.area-list span{
  font-family: var(--font-display); font-weight: 600; color: var(--cream);
  border: 1px solid var(--line-light); border-radius: 999px; padding: 10px 20px; font-size: 0.95rem;
}

/* =========================================================
   GALLERY
   ========================================================= */
.gallery-grid{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.gallery-placeholder{
  aspect-ratio: 4/3; border: 1.5px dashed var(--line); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; color: var(--steel);
  background: repeating-linear-gradient(135deg, transparent, transparent 10px, rgba(16,35,63,0.03) 10px, rgba(16,35,63,0.03) 20px);
}
.gallery-item{ aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.gallery-item img{ width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.gallery-item:hover img{ transform: scale(1.04); }

/* =========================================================
   CONTACT
   ========================================================= */
.grid-2-contact{ align-items: start; }
.contact-form{ display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.contact-form label{ font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; color: var(--navy); margin-top: 10px; }
.contact-form input[type="text"],
.contact-form input[type="tel"],
.contact-form textarea{
  font-family: var(--font-body); font-size: 1rem; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--charcoal);
}
.contact-form input:focus, .contact-form textarea:focus{ border-color: var(--jade); }
.hidden-field{ position: absolute; left: -9999px; }
.checkbox-label{ display: flex; gap: 10px; align-items: flex-start; font-family: var(--font-body); font-size: 0.9rem; color: #3c3c3c; margin-top: 14px; }
.checkbox-label input{ margin-top: 4px; }
.contact-form .btn{ margin-top: 20px; }

.contact-card{ background: var(--navy); color: var(--cream); border-radius: var(--radius); padding: 34px; }
.contact-card h3{ color: var(--cream); margin-bottom: 20px; }
.contact-row{ display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-light); text-decoration: none; color: var(--cream); font-family: var(--font-display); font-size: 0.98rem; }
.contact-row:first-of-type{ border-top: none; }
.contact-row svg{ color: var(--jade); flex-shrink: 0; }
.contact-row span{ min-width: 0; overflow-wrap: anywhere; }
a.contact-row:hover{ color: var(--jade-soft); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{ background: var(--navy-deep); color: rgba(244,242,234,0.75); padding: 36px 0; }
.footer-inner{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.footer-nav{ display: flex; gap: 22px; }
.footer-nav a{ color: rgba(244,242,234,0.75); text-decoration: none; font-family: var(--font-display); font-size: 0.9rem; }
.footer-nav a:hover{ color: var(--jade); }
.footer-copy{ margin: 0; font-family: var(--font-display); font-size: 0.85rem; width: 100%; text-align: center; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px){
  .hero-inner{ grid-template-columns: 1fr; }
  .hero-visual{ order: -1; max-width: 340px; margin: 0 auto 12px; }
  .grid-2{ grid-template-columns: 1fr; gap: 36px; }
  .services-grid{ grid-template-columns: repeat(2, 1fr); }
  .gallery-grid{ grid-template-columns: repeat(2, 1fr); }
}

/* Rozwijane menu mobilne — próg podniesiony do 900px (zamiast 720px), bo przy
   pełnej nawigacji (5 pozycji) + przycisku telefonu numer zawijał się na
   kilka linijek w zakresie ok. 721-899px (widoczne m.in. przy 768px). */
@media (max-width: 900px){
  .main-nav{
    position: absolute; top: 100%; left: 0; right: 0; background: var(--navy);
    flex-direction: column; padding: 8px 24px 20px; gap: 4px;
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
    border-bottom: 2px solid var(--jade);
  }
  .main-nav.open{ max-height: 320px; }
  .main-nav a{ padding: 12px 0; border-top: 1px solid var(--line-light); }
  .menu-toggle{ display: flex; }
  .btn-call span{ display: none; }
  .btn-call{ padding: 10px 12px; min-width: 44px; min-height: 44px; }
}

@media (max-width: 720px){
  .services-grid{ grid-template-columns: 1fr; }
  .gallery-grid{ grid-template-columns: 1fr 1fr; }
  .footer-inner{ flex-direction: column; text-align: center; }
  .footer-copy{ order: 3; }
}

@media (max-width: 480px){
  body{ font-size: 17px; }
  .section{ padding: 60px 0; }
  .hero{ padding: 48px 0 60px; }
  .wrap{ padding: 0 16px; }
  .header-inner{ gap: 12px; }
  .header-actions{ gap: 10px; }
}
