/* ============================================================
   Stowarzyszenie Q Samodzielności — stylesheet
   ============================================================ */

:root{
  /* Color */
  --bg:            #EEF0E9;
  --surface:        #FFFFFF;
  --surface-alt:    #E4E2D3;
  --ink:            #1E2A22;
  --ink-soft:       #4C584F;
  --ink-faint:      #7C877D;
  --primary:        #2F6F5E;
  --primary-dark:   #234F42;
  --primary-tint:   #DCE8E2;
  --accent:         #C1861F;
  --accent-tint:    #F1E1BC;
  --border:         #D7D5C4;
  --border-strong:  #C3C1AE;
  --error:          #B3402F;

  /* Type */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;

  /* Layout */
  --wrap: 1180px;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-1: 0 1px 2px rgba(30,42,34,.06), 0 8px 24px -12px rgba(30,42,34,.18);
}

/* ---------- Reset ---------- */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ list-style: none; margin: 0; padding: 0; }
button{ font: inherit; }
h1,h2,h3{
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 .5em;
}
p{ margin: 0 0 1em; color: var(--ink-soft); }
p:last-child{ margin-bottom: 0; }

.skip-link{
  position: absolute; left: -999px; top: 0;
  background: var(--primary); color: #fff; padding: .75rem 1.25rem;
  z-index: 200; border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus{ left: 0; }

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

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

.section-label{
  font-size: .92rem;
  color: var(--primary);
  font-weight: 600;
  margin: 0 0 .6em;
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .85rem 1.5rem;
  border-radius: var(--radius-s);
  font-weight: 600;
  font-size: .98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn-primary{ background: var(--primary); color: #fff; }
.btn-primary:hover{ background: var(--primary-dark); }
.btn-ghost{ background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover{ border-color: var(--primary); color: var(--primary); }
.btn-block{ width: 100%; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header{
  position: sticky; top: 0; z-index: 100;
  background: rgba(238,240,233,.92);
  backdrop-filter: saturate(150%) blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-inner{
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 14px;
}
.brand{
  display: flex; align-items: center; gap: .65rem;
  margin-right: auto;
}
.brand-mark{
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.3rem;
  flex-shrink: 0;
}
.brand-text{ display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong{ font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; }
.brand-text em{ font-style: normal; font-size: .8rem; color: var(--ink-soft); }

.main-nav ul{ display: flex; gap: 2rem; align-items: center; }
.nav-cta-mobile{ display: none; }
.nav-link{
  font-weight: 500; font-size: .98rem; color: var(--ink-soft);
  position: relative; padding: .25rem 0;
  transition: color .2s ease;
}
.nav-link::after{
  content:""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px; background: var(--accent);
  transition: width .2s ease;
}
.nav-link:hover, .nav-link.active{ color: var(--ink); }
.nav-link:hover::after, .nav-link.active::after{ width: 100%; }

.header-cta{ margin-left: .5rem; }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: transparent; border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  cursor: pointer;
}
.nav-toggle span{
  display: block; height: 2px; width: 20px; margin: 0 auto;
  background: var(--ink); transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero{ padding: 88px 0 96px; overflow: hidden; }
.hero-grid{
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 3.5rem;
  align-items: center;
}
.eyebrow{
  font-size: .92rem; color: var(--primary); font-weight: 600; margin-bottom: 1rem;
}
.hero h1{
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  max-width: 16ch;
  margin-bottom: .55em;
}
.hero-lede{
  font-size: 1.12rem;
  max-width: 46ch;
  margin-bottom: 1.8rem;
}
.hero-actions{ display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.6rem; }

.hero-facts{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
  max-width: 46rem;
}
.hero-facts dt{
  font-size: .8rem; color: var(--ink-faint); margin-bottom: .3em;
}
.hero-facts dd{
  margin: 0; font-weight: 600; font-size: .98rem; color: var(--ink);
}

.hero-visual{ position: relative; }
.hero-svg{ width: 100%; height: auto; }
.ring{ fill: none; stroke: var(--border-strong); stroke-width: 1; }
.ring-2{ stroke: var(--border); }
.node{ fill: var(--primary-tint); stroke: var(--primary); stroke-width: 1.5; }
.node-core{ fill: var(--primary); }
.node-b{ fill: var(--accent-tint); stroke: var(--accent); }
.link{ stroke: var(--border-strong); stroke-width: 1.5; fill: none; }

.hero-card{
  position: absolute;
  left: -8px; bottom: 6%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
  padding: 1rem 1.2rem;
  max-width: 230px;
}
.hero-card-label{
  font-size: .75rem; color: var(--accent); font-weight: 600;
  text-transform: none; margin-bottom: .3em;
}
.hero-card-text{ font-size: .92rem; color: var(--ink); font-weight: 500; margin: 0; }

/* ============================================================
   ABOUT
   ============================================================ */
.about{ padding: 96px 0; background: var(--surface); }
.about-grid{
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 4rem;
  align-items: start;
}
.about-text h2{ font-size: clamp(1.7rem, 3vw, 2.3rem); max-width: 20ch; }
.about-text p{ max-width: 58ch; }
.about-text p + p{ margin-top: 1rem; }

.value-list li{
  padding: 1.1rem 0 1.1rem 1.1rem;
  border-top: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}
.value-list li:first-child{ border-top: none; padding-top: 0; }
.value-list h3{ font-size: 1.05rem; margin-bottom: .3em; }
.value-list p{ font-size: .95rem; max-width: 42ch; }

/* ============================================================
   SERVICES
   ============================================================ */
.services{ padding: 96px 0; }
.section-head{ max-width: 62ch; margin-bottom: 3rem; }
.section-head h2{ font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-intro{ font-size: 1.05rem; }

.card-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.service-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 1.8rem 1.7rem;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.service-card:hover{
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-1);
}
.service-card .icon{
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary-tint);
  margin-bottom: 1.1rem;
}
.service-card .icon svg{
  width: 24px; height: 24px;
  fill: none; stroke: var(--primary); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}
.service-card h3{ font-size: 1.1rem; margin-bottom: .45em; }
.service-card p{ font-size: .95rem; }

/* ============================================================
   WHY CHOOSE US
   ============================================================ */
.why{ padding: 96px 0; background: var(--surface-alt); }
.why-grid{
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 3.5rem;
}
.why-text h2{ font-size: clamp(1.7rem, 3vw, 2.2rem); max-width: 18ch; }
.why-text p{ max-width: 40ch; margin-bottom: 1.6rem; }

.benefit-list{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem 2rem;
}
.benefit-list li{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 1.4rem 1.5rem;
}
.benefit-list h3{ font-size: 1.02rem; margin-bottom: .4em; }
.benefit-list p{ font-size: .92rem; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact{ padding: 96px 0; }
.contact-grid{
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 3.5rem;
  align-items: start;
}
.contact-form-wrap h2{ font-size: clamp(1.6rem, 3vw, 2.1rem); max-width: 22ch; }
.contact-form-wrap .section-intro{ margin-bottom: 2rem; }

.contact-form{
  display: flex; flex-direction: column; gap: 1.2rem;
}
.form-row{
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem;
}
.field{ display: flex; flex-direction: column; gap: .4rem; }
.field label{ font-size: .9rem; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea{
  font: inherit;
  padding: .75rem .9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
  outline: none;
}
.field textarea{ resize: vertical; min-height: 110px; }
.field.invalid input, .field.invalid select, .field.invalid textarea{
  border-color: var(--error);
}
.field-error{
  font-size: .82rem; color: var(--error); min-height: 1.1em;
}
.form-status{
  font-size: .92rem; font-weight: 600; margin: .2rem 0 0;
  min-height: 1.3em;
}
.form-status.success{ color: var(--primary); }
.form-status.error{ color: var(--error); }

.contact-details{
  background: var(--surface-alt);
  border-radius: var(--radius-m);
  padding: 2rem;
}
.contact-details h3{ font-size: 1.15rem; margin-bottom: 1.2rem; }
.detail-list{ display: flex; flex-direction: column; gap: 1.2rem; margin-bottom: 1.8rem; }
.detail-label{ display: block; font-size: .8rem; color: var(--ink-faint); margin-bottom: .25em; }
.detail-value{ font-size: .98rem; font-weight: 500; }
.detail-value a:hover{ color: var(--primary); text-decoration: underline; }

.map-block{
  border-radius: var(--radius-s);
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-svg{ width: 100%; display: block; }
.map-bg{ fill: var(--surface); }
.map-grid{ stroke: var(--border); stroke-width: 1; }
.map-pin{ fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.map-pin-stem{ stroke: var(--accent); stroke-width: 2; }
.map-block p{
  font-size: .82rem; text-align: center; padding: .6rem; margin: 0;
  background: var(--surface); color: var(--ink-faint);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer{
  background: var(--ink);
  color: #C9D2CB;
  padding: 72px 0 0;
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}
.footer-brand p{ color: #97A39B; font-size: .92rem; margin-top: 1rem; max-width: 32ch; }
.site-footer .brand-mark{ background: var(--accent); }
.site-footer .brand-text strong{ color: #fff; }
.site-footer .brand-text em{ color: #97A39B; }

.footer-col h4{
  font-family: var(--font-body);
  color: #fff; font-size: .95rem; font-weight: 600; margin: 0 0 1rem;
}
.footer-col ul{ display: flex; flex-direction: column; gap: .65rem; }
.footer-col a{ color: #A9B4AC; font-size: .92rem; transition: color .2s ease; }
.footer-col a:hover{ color: #fff; }
.footer-col li{ color: #A9B4AC; font-size: .92rem; }

.footer-bottom{
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: 1.5rem 24px;
  border-top: 1px solid #33403A;
  font-size: .85rem; color: #7E8B82;
}

/* ---------- Back to top ---------- */
.back-to-top{
  position: fixed; right: 22px; bottom: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  opacity: 0; visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
  z-index: 90;
}
.back-to-top.visible{ opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover{ background: var(--primary-dark); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px){
  .hero-grid, .about-grid, .why-grid, .contact-grid{
    grid-template-columns: 1fr;
  }
  .hero-visual{ order: -1; max-width: 340px; margin: 0 auto; }
  .hero-card{ position: static; margin-top: 1rem; max-width: none; }
  .card-grid{ grid-template-columns: repeat(2, 1fr); }
  .footer-grid{ grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px){
  .main-nav, .header-cta{ display: none; }
  .nav-toggle{ display: flex; }

  .main-nav.open{
    display: block;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 24px 1.5rem;
  }
  .main-nav.open ul{ flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav.open li{ border-top: 1px solid var(--border); }
  .main-nav.open li:first-child{ border-top: none; }
  .main-nav.open a{ display: block; padding: .9rem 0; }
  .main-nav.open .nav-cta-mobile{ display: block; border-top: none; padding-top: .5rem; }
  .main-nav.open .nav-cta-mobile a{ padding: 0; }

  .hero{ padding: 56px 0 64px; }
  .hero-facts{ grid-template-columns: 1fr; gap: 1rem; }
  .about, .services, .why, .contact{ padding: 64px 0; }
  .card-grid{ grid-template-columns: 1fr; }
  .benefit-list{ grid-template-columns: 1fr; }
  .form-row{ grid-template-columns: 1fr; }
  .footer-grid{ grid-template-columns: 1fr; gap: 2rem; padding-bottom: 2rem; }
  .footer-bottom{ flex-direction: column; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation: none !important; transition: none !important; }
}
