/* ===== Współpraca (scoped) — premium steps ===== */
/* Sekcja: tytuł w jednej linii (desktop) */
@media (min-width: 900px){
  #wspolpraca .section__title{ white-space: nowrap; }
}
#wspolpraca .wsp-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 12px;
}

#wspolpraca .wsp-head p{
  margin: 0;
  color: var(--muted);
  flex: 1 1 auto;      /* nie zwężaj sztucznie */
  max-width: none;     /* naturalna szerokość jak inne sekcje */
  text-wrap: pretty;   /* bardziej „naturalne” łamanie (wspierane w nowych przeglądarkach) */
}


/* Szeroki desktop: jedna linia, bez ucinania */
@media (min-width: 1200px){
  #wspolpraca .wsp-head p{
    max-width: none;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }
}

/* Węższe okna: pozwól na normalne zawijanie */
@media (max-width: 1199px){
  #wspolpraca .wsp-head p{
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

#wspolpraca .steps{
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

/* desktop: poziomo */
@media (min-width: 900px){
  #wspolpraca .steps{
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  /* delikatna linia „procesu” w tle */
  #wspolpraca .steps::before{
    content:"";
    position:absolute;
    left: 6%;
    right: 6%;
    top: 38px;
    height: 2px;
    background: rgba(0,0,0,.08);
    border-radius: 2px;
    z-index: 0;
  }
  html[data-theme="dark"] #wspolpraca .steps::before{
    background: rgba(255,255,255,.10);
  }
}

#wspolpraca .step{
  position: relative;
  z-index: 1;
  padding: 16px 16px 14px;
  border-radius: 18px;
  border: var(--border-2);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(12px) saturate(160%);
  box-shadow: var(--shadow-soft);

  /* appear animation */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .38s ease, transform .38s ease;
}
html[data-theme="dark"] #wspolpraca .step{
  background: rgba(18,21,28,.55);
  border-color: rgba(255,255,255,.12);
}

#wspolpraca.is-visible .step{
  opacity: 1;
  transform: none;
}

/* stagger */
#wspolpraca.is-visible .step:nth-child(1){ transition-delay: 70ms; }
#wspolpraca.is-visible .step:nth-child(2){ transition-delay: 140ms; }
#wspolpraca.is-visible .step:nth-child(3){ transition-delay: 210ms; }
#wspolpraca.is-visible .step:nth-child(4){ transition-delay: 280ms; }

#wspolpraca .step__top{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
}

#wspolpraca .step__num{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: var(--border-2);
  background: color-mix(in srgb, var(--bg) 78%, white);
  font-weight: 950;
  letter-spacing: .06em;
  font-size: 12px;
  flex: 0 0 auto;
}
html[data-theme="dark"] #wspolpraca .step__num{
  background: color-mix(in srgb, var(--bg) 78%, black);
  border-color: rgba(255,255,255,.12);
}

#wspolpraca .step__title{
  margin: 0;
  font-weight: 950;
  letter-spacing: -0.02em;
  font-size: 16px;
}

#wspolpraca .step__desc{
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* lekki highlight po najechaniu */
@media (hover:hover){
  #wspolpraca .step:hover{
    box-shadow: var(--shadow-soft), var(--ring-soft);
  }
}

/* ===== O mnie (scoped) ===== */
#o-mnie .about-split{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

@media (min-width: 900px){
  #o-mnie .about-split{
    grid-template-columns: 260px 1fr;
    gap: 22px;
    align-items: start;
  }

  /* Desktop: prevent whitespace by letting the photo span both text rows */
  #o-mnie .about-split__photo{ grid-row: 1 / span 2; }
}

#o-mnie .about-split__photo{
  display:flex;
  align-items:flex-start;
  justify-content:flex-start;
}

/* keep portrait responsive inside this section */
#o-mnie .portrait--lg{
  width: 220px;
  height: 280px;
  border-radius: 22px;
}
@media (min-width: 900px){
  #o-mnie .portrait--lg{
    width: 250px;
    height: 320px;
  }
}

#o-mnie .about-lead{ margin: 0 0 10px; }
#o-mnie .about-desc{ margin: 0; color: var(--muted); }
#o-mnie .about-meta{ margin: 10px 0 0; color: var(--muted); }

/* Desktop/base: keep expanded block in the text column (same as old layout) */
#o-mnie .about-more{ grid-column: 2; }

/* Desktop/base: no expand control (only mobile uses it) */
#o-mnie .about-more__btn{ display: none; }

#o-mnie .about-edukurs{
  display: inline;
  margin-left: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: color .2s ease, opacity .2s ease;
  opacity: .92;
}
#o-mnie .about-edukurs:hover,
#o-mnie .about-edukurs:focus-visible{
  opacity: 1;
  color: var(--text);
  outline: none;
}


#o-mnie .about-points{
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

@media (max-width: 640px){
  /* Mobile: avatar + first paragraph side-by-side */
  #o-mnie .about-split{
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }

  #o-mnie .about-split__photo{ align-self: start; }

  #o-mnie .portrait--lg{
    width: 112px;
    height: 140px;
    border-radius: 18px;
  }
  #o-mnie .portrait--lg img{ object-position: 50% 25%; }

  /* Expanded content sits below and spans full width */
  #o-mnie .about-more{
    grid-column: 1 / -1;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,.06);

    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height .35s ease, opacity .25s ease, transform .35s ease;
  }
  html[data-theme="dark"] #o-mnie .about-more{ border-top-color: rgba(255,255,255,.10); }

  #o-mnie.is-open .about-more{
    max-height: 900px; /* enough for this content */
    opacity: 1;
    transform: none;
  }

  #o-mnie .about-more__btn{
    display: inline;
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    cursor: pointer;
    opacity: .78;
  }
  #o-mnie .about-more__btn:hover{ opacity: 1; }

  /* hide the button after opening */
  #o-mnie.is-open .about-more__btn{ display: none; }
}

/* ===== Header + drawer ===== */
.site-header{
  position: sticky;
  top: 0;
  height: 64px;
  z-index: 110;
  background: color-mix(in srgb, var(--bg) 82%, white);
  backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
@media (max-width: 899px){
  .site-header{ height: 60px; }
}
html[data-theme="dark"] .site-header{
  background: color-mix(in srgb, var(--bg) 86%, black);
  border-bottom-color: rgba(255,255,255,.08);
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
  height: 100%;
}

.brand{
  display:flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-decoration:none;
  color: var(--text);
  min-width: 0;
  line-height: 1.05;
}
.brand__name{
  font-weight: 950;
  letter-spacing: -0.03em;
  white-space: nowrap;
  line-height: 1.05;
}
.brand__tag{
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: min(62vw, 520px);
  line-height: 1.1;
}

.nav{
  display:none;
  align-items:center;
  gap: 14px;
  margin-left: auto;
  justify-content: flex-end;
}
.nav a{
  color: var(--muted);
  text-decoration:none;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 10px;
  border-radius: 12px;
}
.nav a:hover{
  color: var(--text);
  background: rgba(255,255,255,.55);
  border: var(--border-2);
  backdrop-filter: blur(10px) saturate(160%);
}
html[data-theme="dark"] .nav a:hover{
  background: rgba(18,21,28,.55);
  border-color: rgba(255,255,255,.12);
}

.header-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-left: 10px;
}

.burger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: var(--border-2);
  background: color-mix(in srgb, var(--bg) 70%, white);
  backdrop-filter: blur(10px) saturate(160%);
  cursor:pointer;
}
html[data-theme="dark"] .burger{
  background: color-mix(in srgb, var(--bg) 72%, black);
  border-color: rgba(255,255,255,.12);
  color: var(--text);
}
.burger:hover{ box-shadow: var(--ring-soft); }

.burger .lines{ width: 18px; height: 12px; position: relative; }
.burger .lines::before,
.burger .lines::after,
.burger .lines span{
  content:"";
  position:absolute;
  left:0; right:0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .22s ease, opacity .18s ease, top .22s ease, bottom .22s ease;
}
.burger .lines::before{ top:0; }
.burger .lines span{ top:5px; }
.burger .lines::after{ bottom:0; }

/* Burger -> X when drawer open */
.burger[aria-expanded="true"] .lines::before{
  top: 5px;
  transform: rotate(45deg);
}
.burger[aria-expanded="true"] .lines::after{
  bottom: 5px;
  transform: rotate(-45deg);
}
.burger[aria-expanded="true"] .lines span{
  opacity: 0;
  transform: scaleX(.6);
}

@media (min-width: 900px){
  .nav{ display:flex; }
  .burger{ display:none; }
}

/* ===== HERO kicker (scoped) ===== */
#start .hero-kicker{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 10px;
}
#start .kicker-pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: var(--border-2);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(10px) saturate(160%);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
}
html[data-theme="dark"] #start .kicker-pill{
  background: rgba(18,21,28,.55);
  border-color: rgba(255,255,255,.12);
}
#start .kicker-pill--muted{
  color: var(--muted);
  font-weight: 800;
}
#start .kicker-pill--muted strong{ color: var(--text); font-weight: 950; }

/* Anchor offsets for sticky header (auto via CSS var) */
:root{ --header-h: 72px; }
html{ scroll-padding-top: var(--header-h); }
section[id]{ scroll-margin-top: var(--header-h); }

/* Drawer sits UNDER the sticky header so the header remains visible */
.drawer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: var(--header-h);
  height: calc(100dvh - var(--header-h));
  z-index: 105; /* below header (110) */

  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.drawer[aria-hidden="false"]{
  opacity: 1;
  pointer-events: auto;
}
.drawer__backdrop{
  position:absolute;
  inset:0;
  background: rgba(6,8,12,.46);
  backdrop-filter: blur(10px) saturate(140%);
  opacity: 0;
  transition: opacity .22s ease;
}
.drawer[aria-hidden="false"] .drawer__backdrop{ opacity: 1; }
.drawer__panel{
  position:absolute;
  top:0; left:0;
  height: 100%;
  width: 80vw;
  max-width: 420px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, white), color-mix(in srgb, var(--bg) 96%, white));
  border-right: 1px solid rgba(0,0,0,.08);
  border-top-right-radius: 18px;
  border-bottom-right-radius: 18px;
  box-shadow: 22px 0 52px rgba(0,0,0,.18);
  transform: translateX(-102%) scale(.98);
  transition: transform .28s cubic-bezier(.2,.9,.2,1);
  will-change: transform;
  display:flex;
  flex-direction: column;
}
html[data-theme="dark"] .drawer__panel{
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, black), color-mix(in srgb, var(--bg) 96%, black));
  border-right-color: rgba(255,255,255,.10);
  box-shadow: 22px 0 58px rgba(0,0,0,.55);
}
.drawer[aria-hidden="false"] .drawer__panel{ transform: translateX(0) scale(1); }

.drawer__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  border-bottom: var(--border-2);
}
.drawer__title{ font-weight: 950; letter-spacing: -0.03em; }

.drawer__close{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: var(--border-2);
  background: color-mix(in srgb, var(--bg) 70%, white);
  backdrop-filter: blur(10px) saturate(160%);
  cursor:pointer;
  font-weight: 900;
}
html[data-theme="dark"] .drawer__close{
  background: color-mix(in srgb, var(--bg) 72%, black);
  border-color: rgba(255,255,255,.12);
  color: var(--text);
}
.drawer__close:hover{ box-shadow: var(--ring-soft); }

.drawer__nav{
  padding: 14px 14px 12px;
  display: grid;
  gap: 8px;
}
.drawer__nav a{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  text-decoration:none;
  color: var(--text);
  border: var(--border-2);
  background: rgba(255,255,255,.46);
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  font-size: 15px;
  backdrop-filter: blur(10px) saturate(160%);
  font-weight: 900;
  transform: translateX(-10px);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease, box-shadow .2s ease;
}
html[data-theme="dark"] .drawer__nav a{
  background: rgba(18,21,28,.46);
  border-color: rgba(255,255,255,.12);
}
.drawer__panel{
  padding-top: 10px;
}

@media (max-width: 899px){
  .drawer__panel{
    padding-top: calc(10px + env(safe-area-inset-top));
  }
}
.drawer[aria-hidden="false"] .drawer__nav a{
  transform: none;
  opacity: 1;
}
.drawer[aria-hidden="false"] .drawer__nav a:nth-child(1){ transition-delay: 40ms; }
.drawer[aria-hidden="false"] .drawer__nav a:nth-child(2){ transition-delay: 80ms; }
.drawer[aria-hidden="false"] .drawer__nav a:nth-child(3){ transition-delay: 120ms; }
.drawer[aria-hidden="false"] .drawer__nav a:nth-child(4){ transition-delay: 160ms; }
.drawer[aria-hidden="false"] .drawer__nav a:nth-child(5){ transition-delay: 200ms; }

.drawer__footer{ margin-top:auto; padding: 12px; border-top: var(--border-2); }
.drawer__footer .drawer__cta{ display:flex; gap: 10px; }
.drawer__footer .drawer__cta a{ flex:1; text-align:center; }

@media (min-width: 900px){
  .drawer{ display:none !important; }
}

/* ===== Modal ===== */
.modal{ position: fixed; inset: 0; display: none; z-index: 120; }
.modal[aria-hidden="false"]{ display: block; }
.modal__backdrop{ position:absolute; inset:0; background: rgba(6,8,12,.56); backdrop-filter: blur(8px) saturate(140%); }
.modal__panel{
  position: relative;
  margin: 6vh auto;
  width: min(920px, calc(100% - 26px));
  background: var(--card);
  border: var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;

  /* scrollability */
  max-height: calc(100dvh - 12vh - 26px);
  display: flex;
  flex-direction: column;
}
.modal__head{ display:flex; align-items:flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: var(--border-2); }
.modal__head h3{ margin:0; font-size: 18px; letter-spacing: -.01em; }
.modal__head p{ margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal__close{
  border: var(--border-2);
  background: color-mix(in srgb, var(--bg) 70%, white);
  backdrop-filter: blur(10px) saturate(160%);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  cursor: pointer;
  transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}
html[data-theme="dark"] .modal__close{
  background: color-mix(in srgb, var(--bg) 72%, black);
  border-color: rgba(255,255,255,.12);
  color: var(--text);
}
.modal__close:hover{ box-shadow: var(--ring-soft); }
.modal__body{
  padding: 16px 18px 18px;
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

/* Mobile modal: avoid iOS zoom + allow inner scroll */
@media (max-width: 899px){
  .modal__panel{
    /* keep the panel inside the visible viewport (accounts for mobile browser UI) */
    margin: 10px auto 0;
  }
  .modal__head{ flex: 0 0 auto; }
  .modal__body{
  }

  /* iOS Safari zooms inputs under 16px; force 16px in the modal */
  .modal input,
  .modal textarea,
  .modal select{
    font-size: 16px;
  }
}

/* When modal open, prevent background scroll but keep layout stable */
body.is-modal-open{ overflow: hidden; }

/* ===== Sticky CTA (mobile) ===== */
.sticky-cta{ position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: color-mix(in srgb, var(--bg) 85%, white); backdrop-filter: blur(12px) saturate(160%); border-top: 1px solid rgba(0,0,0,.06); display: flex; gap: 10px; justify-content: center; z-index: 60; }
html[data-theme="dark"] .sticky-cta{ background: color-mix(in srgb, var(--bg) 85%, black); border-top-color: rgba(255,255,255,.10); }
@media (min-width: 900px){ .sticky-cta{ display:none; } }
@media (max-width: 899px){ body{ padding-bottom: 72px; } }

/* Mobile: sticky CTA zastępuje stopkę i CTA w kontakcie */
@media (max-width: 899px){
  #kontakt .contact-actions{ display:none; }
  #kontakt .kontakt__form-card{ display:none; }
  footer.footer{ display:none; }
}

/* ===== Modal form: inline validation (kontakt) ===== */

.kontakt-form .field{ min-width: 0; }

.kontakt-form .field-error{
  display: block;
  margin-top: 6px;
  min-height: 16px;
  font-size: 12px;
  font-weight: 800;
  color: color-mix(in srgb, var(--text) 65%, #c00);
}
html[data-theme="dark"] .kontakt-form .field-error{
  color: color-mix(in srgb, var(--text) 62%, #ff6b6b);
}

.kontakt-form .is-error input,
.kontakt-form .is-error textarea{
  border-color: rgba(200,0,0,.45) !important;
  box-shadow: 0 0 0 4px rgba(200,0,0,.10);
}
html[data-theme="dark"] .kontakt-form .is-error input,
html[data-theme="dark"] .kontakt-form .is-error textarea{
  border-color: rgba(255,107,107,.45) !important;
  box-shadow: 0 0 0 4px rgba(255,107,107,.12);
}

