:root {
  --paper: #f5f5ef;
  --paper-2: #fbfbf7;
  --ink: #1d1e21;
  --ink-soft: #4a4b4f;
  --rule: #1d1e21;
  --terakota: #a9472c;
  --terakota-dark: #8c3a23;
  --terakota-tint: #f1e3dc;
  --line-soft: rgba(29, 30, 33, .14);

  --sans: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage Grotesque', var(--sans);
  --mono: var(--sans); /* etykiety i drobne podpisy */
  --tracking: -.035em;
  --label-tracking: .1em;

  --wrap: 1160px;
  --pad: clamp(20px, 4vw, 48px);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

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

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; letter-spacing: var(--tracking); margin: 0; }

/* ---------- ramka strony ---------- */

.frame {
  max-width: var(--wrap);
  margin: 0 auto;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px var(--pad);
  border-bottom: 1px solid var(--rule);
  background: rgba(245, 245, 239, .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; }
.brand__role { font-family: var(--mono); font-size: .7rem; letter-spacing: var(--label-tracking); text-transform: uppercase; color: var(--ink-soft); }

.nav { display: none; list-style: none; margin: 0; padding: 0; gap: 28px; font-weight: 500; font-size: .95rem; }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--terakota); }

.topbar__call {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--rule);
  background: var(--terakota);
  color: #fff;
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s;
}
.topbar__call:hover { background: var(--terakota-dark); }
.topbar__call-label { display: none; font-family: var(--sans); font-weight: 600; }

.label, .chip {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  padding: clamp(40px, 6vw, 64px) var(--pad) clamp(24px, 4vw, 40px);
  border-bottom: 1px solid var(--rule);
  overflow: hidden; /* wstęga kończy się na ramce strony */
}

.hero__text { position: relative; z-index: 2; }

.label { margin: 0 0 18px; color: var(--terakota); }

.hero h1 { font-size: clamp(2.9rem, 7vw, 5.4rem); line-height: .98; }

.lead { margin: 24px 0 0; max-width: 36ch; font-size: 1.125rem; color: var(--ink-soft); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  background: var(--terakota);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s;
}
.btn:hover { background: var(--terakota-dark); }

.textlink { font-weight: 500; text-underline-offset: 4px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 40px 0 0;
  border-top: 1px solid var(--rule);
}
.stats div { padding: 16px 16px 0 0; }
.stats div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.stats dt { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: var(--tracking); line-height: 1; }
.stats dd { margin: 8px 0 0; font-size: .82rem; line-height: 1.45; color: var(--ink-soft); }
.textlink:hover { color: var(--terakota); }

.hero__art { position: relative; max-width: 440px; width: 100%; margin: 0 auto; }

.art { position: relative; z-index: 1; mix-blend-mode: multiply; }

.hero__art .art {
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}

/* ---------- wstęga za portretem ---------- */

/* viewBox 100×150 = proporcje rysunku, więc kreska skaluje się równo */
.ribbon { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.ribbon path { fill: none; stroke: var(--terakota); stroke-linecap: round; }
.ribbon__line { stroke-width: .6; }
.ribbon__line--thin { stroke-width: .25; opacity: .55; }
.ribbon__glow { stroke-width: 3.2; opacity: .3; }

.js .ribbon path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .ribbon.is-drawn path { stroke-dashoffset: 0; transition: stroke-dashoffset 2.4s cubic-bezier(.45, .05, .2, 1); }
.js .ribbon.is-drawn .ribbon__line--thin { transition-delay: .25s; }
.js .ribbon.is-drawn .ribbon__glow { animation: glow 5s ease-in-out 2.4s infinite; }

@keyframes glow {
  0%, 100% { opacity: .3; }
  50% { opacity: .5; }
}

/* ---------- sekcje ---------- */

.section { padding: clamp(36px, 5vw, 64px) var(--pad); border-bottom: 1px solid var(--rule); }

.section__title { font-size: clamp(2rem, 4.4vw, 2.9rem); margin-bottom: 28px; }

.services .section__title { text-align: center; }

.cards { display: grid; grid-template-columns: 1fr; gap: 20px; }

.card {
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}

.card__art {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
}
.card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
  transition: transform .6s ease;
}
.card:hover .card__art img { transform: scale(1.03); }

.card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.chip {
  align-self: flex-start;
  margin: 0 0 14px;
  padding: 3px 8px;
  background: var(--terakota-tint);
  color: var(--terakota-dark);
}
.card h3 { font-size: 1.55rem; margin-bottom: 10px; }
.card p { margin: 0 0 10px; color: var(--ink-soft); }
.card__facts { list-style: none; margin: auto 0 0; padding: 14px 0 0; }
.card__facts li {
  padding: 10px 0 10px 22px;
  border-top: 1px solid var(--line-soft);
  font-size: .88rem;
  line-height: 1.45;
  position: relative;
}
.card__facts li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--terakota);
  transform: rotate(45deg);
}

.card__cta {
  display: flex;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--rule);
  background: var(--terakota);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s;
}
.card__cta:hover { background: var(--terakota-dark); }

.about__facts { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--rule); }
.about__facts li { padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-family: var(--mono); font-size: .8rem; letter-spacing: .02em; }
.about__text { max-width: 64ch; font-size: 1.05rem; line-height: 1.8; }
.about__text p { margin: 0 0 18px; }
.about__text p:last-child { margin-bottom: 0; }

/* ---------- kontakt ---------- */

.contact { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }

.contact__art {
  position: relative;
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid var(--rule);
  background: #fff;
}
.contact__art .art { mix-blend-mode: normal; }

.contact__text p { margin: 0 0 14px; max-width: 36ch; color: var(--ink-soft); }

.tiles { display: grid; grid-template-columns: 1fr; margin-top: 24px; border: 1px solid var(--rule); background: var(--paper-2); }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; text-decoration: none; border-top: 1px solid var(--rule); }
.tile--main { grid-column: 1 / -1; border-top: 0; background: var(--paper-2); transition: background-color .2s; }
.tile__label { font-family: var(--mono); font-size: .72rem; letter-spacing: var(--label-tracking); text-transform: uppercase; color: var(--terakota); }
.tile__value { font-weight: 500; word-break: break-word; }
.tile__value--big { font-family: var(--display); font-size: clamp(1.9rem, 4.4vw, 2.8rem); font-weight: 700; letter-spacing: var(--tracking); line-height: 1; }
.tile__hint { font-weight: 600; font-size: .9rem; }
a.tile:hover .tile__value, a.tile:hover .tile__hint { color: var(--terakota); }

/* ---------- stopka ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px var(--pad) 28px;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink-soft);
}
.footer p { margin: 0; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--terakota); }

/* ---------- wjazd przy przewijaniu ---------- */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* elementy siatki nie mogą rozpychać strony szerokością obrazków */
.hero > *, .contact > *, .cards > * { min-width: 0; }

/* ---------- szersze ekrany ---------- */

@media (min-width: 760px) {
  .cards { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .card__art { aspect-ratio: 4 / 3; }
  .about { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; align-items: start; }
  .about__facts { margin-bottom: 0; }
  .topbar__call-label { display: inline; }
}

@media (max-width: 520px) {
  .brand__role { display: none; }
  .stats dd { font-size: .75rem; }
}

@media (min-width: 960px) {
  .nav { display: flex; }
  .hero { grid-template-columns: 1.1fr 1fr; padding-top: 48px; padding-bottom: 24px; }
  .hero__art { max-width: 460px; }
  .contact { grid-template-columns: 1fr 1fr; gap: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .ribbon path { stroke-dashoffset: 0; transition: none; animation: none; }
}

section[id] { scroll-margin-top: 72px; }
