/* ==========================================================================
   Styl strony głównej (index.html) – MT Biuro Rachunkowe
   ========================================================================== */

/* Zmienne kolorystyczne, czcionki i rozmiary */
:root {
  --pine: #0a3626;
  --forest: #0e4a34;
  --leaf: #2f9e68;
  --mint: #e3f3e9;
  --paper: #f6faf7;
  --lime: #cfe86a;
  --ink: #133126;
  --muted: #4f6b5d;
  --line: #b9d7c6;

  --logo: 56px;
  --logo-big: 96px;

  --ease: cubic-bezier(.22, .8, .24, 1);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Reset i ustawienia bazowe strony */
[hidden] { display: none !important; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  overflow-x: hidden;
}
body.loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--leaf); outline-offset: 3px; }
.hero :focus-visible { outline-color: var(--lime); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 clamp(18px, 5vw, 48px); }

/* Logo (wersja standardowa oraz powiększona na ekranie ładowania) */
.logo-slot {
  width: var(--logo);
  height: var(--logo);
  flex: none;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: .6rem;
  font-weight: 800;
  line-height: 1.25;
  border: 2px dashed currentColor;
  border-radius: 10px;
  color: var(--leaf);
}
.logo-slot--big { width: var(--logo-big); height: var(--logo-big); font-size: .8rem; }
.logo-img { width: var(--logo); height: var(--logo); object-fit: contain; }
.logo-img--big { width: var(--logo-big); height: var(--logo-big); }

/* Ekran ładowania (preloader) z animacją paska postępu */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: #fff;
  transition: transform .9s cubic-bezier(.7, 0, .2, 1), visibility 0s .9s;
}
#preloader .logo-slot, #preloader .logo-img { animation: breathe 1.4s ease-in-out infinite; }
.loader-bar { width: 180px; height: 4px; border-radius: 4px; background: var(--mint); overflow: hidden; }
.loader-bar span {
  display: block;
  height: 100%;
  background: var(--leaf);
  transform-origin: left;
  animation: fill 1.3s var(--ease) forwards;
}
body:not(.loading) #preloader { transform: translateY(-100%); visibility: hidden; }

@keyframes breathe { 50% { transform: scale(1.07); } }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Przyklejony nagłówek, nawigacja główna i przycisk menu mobilnego */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; color: var(--forest); box-shadow: 0 1px 0 var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; line-height: 1.15; color: #0e4a34; }

.main-nav { display: flex; gap: 4px; }
.main-nav a { position: relative; padding: 8px 14px; font-weight: 600; color: var(--forest); transition: color .25s; }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  background: var(--leaf);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.main-nav a:hover { color: var(--leaf); }
.main-nav a:hover::after { transform: scaleX(1); }

.burger {
  display: none;
  width: 44px; height: 44px;
  border: 0; border-radius: 8px;
  background: var(--mint);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.burger span { width: 22px; height: 2px; background: var(--forest); border-radius: 2px; transition: transform .3s, opacity .3s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Sekwencyjna animacja pojawiania się elementów po załadowaniu */
.seq { opacity: 0; }
body:not(.loading) .seq {
  animation: rise .8s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * .12s + .45s);
}

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* Sekcja powitalna (Hero) z przyciskami i zdjęciem */
.hero {
  background: var(--forest);
  color: #fff;
  padding: clamp(40px, 7vw, 80px) 0 clamp(56px, 8vw, 96px);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(2.4rem, 5.2vw, 4rem); line-height: 1.05; letter-spacing: -.01em; }
.lead { max-width: 46ch; margin-top: 22px; font-size: 1.12rem; color: #cfe6d8; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.btn {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 8px;
  font-weight: 800;
  background: var(--lime);
  color: var(--pine);
  transition: transform .25s var(--ease), background .25s;
}
.btn:hover { transform: translateY(-3px); background: #dcf07f; }
.btn--ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.btn--ghost:hover { background: rgba(255, 255, 255, .1); }

.hero-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  isolation: isolate;
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  z-index: -1;
  border-radius: 14px;
  border: 2px solid var(--lime);
  opacity: .7;
}
.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  background: var(--pine);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
}

/* Spis podstron z animowanym tłem po najechaniu */
.index { padding: clamp(56px, 8vw, 96px) 0; }
.index h2 { margin-bottom: 28px; font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--forest); }
.index-list { border-top: 2px solid var(--forest); }
.index-list a {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2fr;
  gap: 20px;
  align-items: baseline;
  padding: 26px 16px;
  border-bottom: 1px solid var(--line);
  transition: color .35s;
}
.index-list a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--forest);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .35s var(--ease);
}
.index-list a:hover, .index-list a:focus-visible { color: #fff; }
.index-list a:hover::before, .index-list a:focus-visible::before { transform: scaleY(1); }
.index-list strong { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; }
.index-list span { color: var(--muted); transition: color .35s; }
.index-list a:hover span, .index-list a:focus-visible span { color: #cfe6d8; }

/* Stopka z danymi rejestrowymi firmy i linkiem do polityki prywatności */
.site-footer { padding: 36px 0; background: var(--pine); color: #cfe6d8; font-size: .9rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid rgba(185, 215, 198, .2); }
.footer-brand strong { display: block; margin-bottom: 4px; font-family: var(--serif); font-size: 1.05rem; color: #fff; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; color: #cfe6d8; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding-top: 18px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: #fff; text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.footer-links a:hover { color: var(--lime); }

/* Baner informujący o plikach cookies na dole ekranu */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  padding: 16px 0;
  background: var(--pine);
  color: #fff;
  border-top: 2px solid var(--leaf);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .28);
}
.cookie-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.cookie-banner p { max-width: 78ch; font-size: .92rem; color: #cfe6d8; }
.cookie-banner a { color: var(--lime); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.cookie-banner .btn { padding: 10px 22px; border: 0; font: inherit; font-size: .92rem; font-weight: 800; cursor: pointer; flex: none; }

/* Dostosowanie układu na ekrany mobilne i tablety */
@media (max-width: 860px) {
  .burger { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    padding: 8px clamp(18px, 5vw, 48px) 20px;
    background: #fff;
    box-shadow: 0 14px 24px rgba(10, 54, 38, .12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .3s, transform .3s var(--ease), visibility 0s .3s;
  }
  .main-nav.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .main-nav a::after { display: none; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo::before { inset: 12px -8px -12px 8px; }
  .index-list a { grid-template-columns: 1fr; gap: 4px; }
}

/* Wyłączenie animacji dla użytkowników preferujących ograniczony ruch */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  #preloader { display: none; }
  .seq { opacity: 1; }
}
