/* DW Consult — minimalistyczny system wizualny */
:root {
  --ink: #0d0e10;
  --ink-70: rgba(13, 14, 16, 0.68);
  --ink-45: rgba(13, 14, 16, 0.45);
  --paper: #f7f6f3;
  --paper-2: #efedE8;
  --line: rgba(13, 14, 16, 0.12);
  --accent: #8a6a3a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --gut: clamp(1.5rem, 5vw, 6rem);
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--paper); }

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

/* ---------- typografia ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; margin: 0; }
.eyebrow {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-45); margin: 0 0 1.6rem;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-70); max-width: 60ch; }

/* Tekst ciągły justowany. Bez dzielenia wyrazów długie polskie słowa
   robią w wąskich kolumnach rzeki — stąd hyphens: auto (działa dzięki lang="pl"). */
.lead, .prose p, .post p, .hero .lead, .modal-card .prose p {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-wrap: pretty;
}

/* ---------- nawigacja ---------- */
header.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(247, 246, 243, 0);
  border-bottom: 1px solid transparent;
  transition: background .4s ease, border-color .4s ease;
}
header.nav.solid { background: rgba(247, 246, 243, 0.82); border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 1.15rem var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.brand { display: flex; align-items: baseline; gap: .55rem; font-family: var(--serif); font-size: 1.15rem; letter-spacing: .01em; }
.brand span { font-family: var(--sans); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-45); }
.nav-links { display: flex; gap: 2.2rem; align-items: center; }
.nav-links a { font-size: .84rem; letter-spacing: .02em; color: var(--ink-70); position: relative; padding: .2rem 0; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--ink); transition: width .35s cubic-bezier(.22,1,.36,1);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  border: 1px solid var(--ink); border-radius: 999px; padding: .5rem 1.15rem !important;
  font-size: .8rem !important; color: var(--ink) !important; transition: background .3s, color .3s;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--ink); color: var(--paper) !important; }
.burger { display: none; background: none; border: 0; padding: .4rem; cursor: pointer; }
.burger i { display: block; width: 22px; height: 1px; background: var(--ink); margin: 5px 0; transition: transform .3s, opacity .3s; }
.nav-open .burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .burger i:nth-child(2) { opacity: 0; }
.nav-open .burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { min-height: 100svh; display: flex; align-items: center; padding: 9rem 0 5rem; position: relative; }
.hero h1 {
  font-size: clamp(2.6rem, 7.2vw, 6.2rem); line-height: 1.02; max-width: 16ch;
  margin: 0 0 2rem;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lead { font-size: clamp(1.05rem, 2vw, 1.45rem); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 3rem; }
.hero-meta {
  margin-top: 5rem; display: flex; flex-wrap: wrap; gap: 2.5rem 4rem;
  padding-top: 2rem; border-top: 1px solid var(--line);
}
.hero-meta div { min-width: 150px; }
.hero-meta dt { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-45); margin-bottom: .4rem; }
.hero-meta dd { margin: 0; font-family: var(--serif); font-size: 1.05rem; }

.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .95rem 1.9rem; border-radius: 999px; font-size: .88rem; letter-spacing: .01em;
  border: 1px solid var(--ink); transition: transform .3s cubic-bezier(.22,1,.36,1), background .3s, color .3s;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { transform: translateY(-2px); background: var(--accent); border-color: var(--accent); }
.btn-ghost:hover { transform: translateY(-2px); background: var(--ink); color: var(--paper); }

/* ---------- sekcje ---------- */
section { padding: clamp(5rem, 11vw, 9.5rem) 0; border-top: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.sec-head h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.08; }
.sec-body { margin-top: clamp(3rem, 7vw, 5.5rem); }
.prose p { margin: 0 0 1.4rem; color: var(--ink-70); max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }

/* usługi */
.services { border-top: 1px solid var(--line); }
.service {
  border-bottom: 1px solid var(--line); padding: 2.4rem 0;
  display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 3rem; gap: 1.5rem;
  align-items: start; cursor: pointer; transition: opacity .3s;
}
.service:hover .service-title { color: var(--accent); }
.service-num { font-family: var(--serif); font-size: .95rem; color: var(--ink-45); padding-top: .35rem; }
.service-title { font-family: var(--serif); font-size: clamp(1.4rem, 2.8vw, 2.1rem); line-height: 1.2; transition: color .3s; }
.service-toggle { justify-self: end; padding-top: .5rem; color: var(--ink-45); transition: transform .4s cubic-bezier(.22,1,.36,1); }
.service.open .service-toggle { transform: rotate(45deg); }
.service-detail { grid-column: 2 / 3; overflow: hidden; height: 0; transition: height .5s cubic-bezier(.22,1,.36,1); }
.service-detail-inner { padding-top: 1.4rem; }

/* ---------- sekcja „W praktyce" — teczka otwierana scrollem ---------- */
.showcase { height: 340vh; padding: 0; position: relative; }
.showcase-stage {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  /* miejsce zarezerwowane na podpisy i kropki, które leżą na dole warstwą wyżej */
  padding-bottom: calc(11vh + 5rem);
}
.showcase-grid {
  position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 15%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 15%, transparent 72%);
}
/* Nagłówek zostaje w przepływie — gaśnie, ale trzyma swoje miejsce, więc
   teczka nigdy pod niego nie wejdzie, niezależnie od wysokości okna. */
.showcase-head {
  position: relative; z-index: 3; width: 100%;
  padding: 0 var(--gut); text-align: center; will-change: opacity, transform;
}
.showcase-head h2 { font-size: clamp(1.9rem, 4.2vw, 3.2rem); }
.showcase-hint {
  margin-top: 1.6rem; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-45); display: inline-flex; align-items: center; gap: .6rem;
}
.showcase-hint i { font-style: normal; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(4px) } }

.rig {
  position: relative; z-index: 2; margin-top: 3vh;
  /* szerokość ograniczona też wysokością okna: nagłówek + podpisy zabierają
     ok. 380px, a karta ma proporcje 4:3 */
  width: min(86vw, 600px, max(260px, calc((100svh - 380px) * 1.3)));
  will-change: transform;
}
.rig-perspective { perspective: 2000px; }

/* Okładka i karta zajmują to samo pudełko — okładka odchyla się wokół górnej
   krawędzi i odsłania to, co leży pod spodem. Dzięki temu scena ma wysokość
   jednej karty, a nie dwóch ułożonych jedna pod drugą. */
.folder-box { position: relative; aspect-ratio: 4 / 3; }
.folder-cover {
  position: absolute; inset: 0; transform-origin: 50% 0; will-change: transform;
  border-radius: 3px 10px 10px 3px;
  background: linear-gradient(155deg, #cbbfa6, #b9ab8d);
  box-shadow: 0 26px 60px -24px rgba(13, 14, 16, .55), inset 0 1px 0 rgba(255, 255, 255, .4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  overflow: hidden;
}
.folder-cover::before { /* grzbiet teczki */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px;
  background: linear-gradient(90deg, rgba(13,14,16,.16), transparent);
}
.folder-brand { font-family: var(--serif); font-size: clamp(1.1rem, 2.4vw, 1.7rem); color: #3b3428; }
.folder-sub { font-size: .64rem; letter-spacing: .26em; text-transform: uppercase; color: rgba(59, 52, 40, .6); }

/* karta z aktami — leży w teczce */
.folder-sheet {
  position: absolute; inset: 0; overflow: hidden; border-radius: 3px;
  background: #fdfcfa; border: 1px solid var(--line);
  box-shadow: 0 30px 70px -30px rgba(13, 14, 16, .5);
}
.sheet-card {
  position: absolute; inset: 0; padding: clamp(1.2rem, 3.2vw, 2.4rem);
  display: flex; flex-direction: column; opacity: 0; will-change: opacity, transform;
}
.sheet-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: .8rem; border-bottom: 1px solid var(--line);
  font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-45);
}
.sheet-card h3 {
  font-size: clamp(1.05rem, 2.4vw, 1.65rem); line-height: 1.25; margin: 1.2rem 0 .8rem; max-width: 22ch;
}
.sheet-card > p { font-size: clamp(.76rem, 1.4vw, .92rem); color: var(--ink-70); margin: 0; text-align: justify; hyphens: auto; }
.sheet-lines { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: .55rem; }
.sheet-lines li {
  font-size: clamp(.7rem, 1.3vw, .84rem); color: var(--ink-70);
  padding-left: 1.5rem; position: relative;
}
.sheet-lines li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: .7rem; height: 1px; background: var(--accent);
}
/* dolna krawędź teczki */
.folder-edge {
  position: relative; width: 104%; margin-left: -2%; height: 14px;
  border-radius: 0 0 10px 10px; background: linear-gradient(180deg, #c3b599, #ab9d80);
  clip-path: polygon(1.2% 0, 98.8% 0, 100% 100%, 0 100%);
}
.folder-edge span { display: block; width: 14%; height: 3px; margin: 0 auto; border-radius: 0 0 4px 4px; background: rgba(13, 14, 16, .18); }
.folder-shadow { width: 78%; height: 28px; margin: .9rem auto 0; border-radius: 50%; background: rgba(13, 14, 16, .26); filter: blur(22px); }

.showcase-captions { position: absolute; inset-inline: 0; bottom: 6vh; height: 5rem; z-index: 3; }
.sc-caption {
  position: absolute; inset-inline: 0; margin: 0 auto; max-width: 46rem;
  padding: 0 var(--gut); text-align: center; opacity: 0; will-change: opacity, transform;
}
.sc-caption .tag { font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.sc-caption p { font-size: .92rem; color: var(--ink-70); margin: .7rem auto 0; max-width: 40rem; }

.showcase-dots { position: absolute; bottom: 3vh; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: .4rem; }
.showcase-dots span { height: 3px; border-radius: 999px; background: var(--accent); opacity: .25; width: 6px; transition: none; }

/* wariant statyczny — bez animacji */
.showcase-static { display: grid; gap: 3rem; padding-top: 5rem; padding-bottom: 5rem; }
.showcase-static .folder-sheet { max-width: 640px; margin: 0 auto; }
.showcase-static .sheet-card { opacity: 1; position: relative; }
.showcase-static figcaption { text-align: center; margin-top: 1.4rem; }

@media (max-width: 860px) {
  .showcase { height: 300vh; }
  .showcase-head { top: 9vh; }
  .rig { margin-top: 8vh; }
  .sheet-lines { display: none; }
}

/* zespół */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(2rem, 4vw, 3.5rem); }
.member figure { margin: 0; overflow: hidden; background: var(--paper-2); aspect-ratio: 3 / 4; }
.member img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.02); transition: filter .6s ease, transform .8s cubic-bezier(.22,1,.36,1); }
.member:hover img { filter: grayscale(0); transform: scale(1.03); }
.member h3 { font-size: 1.35rem; margin: 1.4rem 0 .3rem; }
.member .role { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-45); }
.member .more { margin-top: 1rem; font-size: .84rem; border-bottom: 1px solid var(--line); padding-bottom: .2rem; cursor: pointer; display: inline-block; }
.member .more:hover { border-color: var(--ink); }

/* blog */
.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(2rem, 4vw, 3rem); }
.post figure { margin: 0 0 1.5rem; overflow: hidden; aspect-ratio: 16 / 10; background: var(--paper-2); }
.post img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.22,1,.36,1); }
.post:hover img { transform: scale(1.04); }
.post h3 { font-size: 1.2rem; line-height: 1.3; margin-bottom: .7rem; }
.post .meta { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-45); margin-bottom: .9rem; }
.post p { font-size: .92rem; color: var(--ink-70); margin: 0; }

/* kontakt */
.offices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(2rem, 5vw, 4rem); }
.office { border-top: 1px solid var(--ink); padding-top: 1.6rem; }
.office h3 { font-size: 1.6rem; margin-bottom: 1.2rem; }
.office dl { margin: 0; display: grid; gap: .9rem; }
.office dt { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-45); }
.office dd { margin: .2rem 0 0; font-size: .95rem; }
.office a:hover { color: var(--accent); }

/* stopka */
footer { border-top: 1px solid var(--line); padding: 3.5rem 0; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--ink-45); }
.foot-inner a:hover { color: var(--ink); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-bg { position: absolute; inset: 0; background: rgba(13, 14, 16, .45); backdrop-filter: blur(6px); animation: fade .4s ease; }
.modal-card {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(680px, 100%);
  background: var(--paper); overflow-y: auto; padding: clamp(2rem, 5vw, 4rem);
  animation: slide .5s cubic-bezier(.22,1,.36,1);
}
.modal-close { position: sticky; top: 0; float: right; background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-45); }
.modal-close:hover { color: var(--ink); }
.modal-card h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin-bottom: .5rem; clear: both; }
.modal-card .role { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-45); display: block; margin-bottom: 2rem; }
.modal-card .prose { margin-top: 1.5rem; }
.modal-card .contact-line { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .9rem; display: grid; gap: .4rem; }
@keyframes fade { from { opacity: 0 } }
@keyframes slide { from { transform: translateX(40px); opacity: 0 } }

/* animacje wejścia */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .sec-head { grid-template-columns: 1fr; gap: 1.5rem; }
  .burger { display: block; }
  /* uwaga: backdrop-filter w .nav czyni z nagłówka blok zawierający dla position:fixed,
     dlatego zamiast inset:0 podajemy jawne wymiary okna */
  .nav-links {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100svh;
    background: var(--paper); flex-direction: column;
    justify-content: center; gap: 2rem; font-size: 1.4rem; transform: translateY(-100%);
    transition: transform .5s cubic-bezier(.22,1,.36,1);
  }
  .nav-open .nav-links { transform: none; }
  .nav-links a { font-size: 1.35rem; font-family: var(--serif); }
  .service { grid-template-columns: 2.5rem minmax(0, 1fr) 2rem; }
  .hero-meta { gap: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
