/* ==========================================================================
   Webartis: kierunek redakcyjny
   Papier + atrament, jeden akcent. Kształty: wszystko ostre (radius 0).
   Motyw jasny z założenia (estetyka druku); ciemny jest tylko finał strony.
   ========================================================================== */

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-opsz-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-ext-opsz-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokeny --------------------------------------------------------------- */

:root {
  --paper: #f1eee7;
  --paper-2: #e8e4da;
  --ink: #16140f;
  --ink-2: #4a463e;          /* tekst drugorzędny, 8.1:1 na papierze */
  --ink-3: #6b665b;          /* metadane, 4.9:1 na papierze */
  --rule: #cfc9bc;
  --accent: #b23a0e;         /* 5.2:1 na papierze */
  --accent-on-ink: #e8683a;  /* 5.7:1 na atramencie */
  --muted-on-ink: #a8a294;
  --rule-on-ink: #3a362e;

  --font-sans: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Newsreader", ui-serif, Georgia, serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --grid-gap: clamp(1rem, 2vw, 1.5rem);
  --section-space: clamp(5rem, 11vw, 9.5rem);
  --masthead-height: 4.25rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Warstwy */
  --z-masthead: 10;
  --z-skip-link: 20;
}

/* --- Baza ---------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--masthead-height) + 1.5rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.06em;
  letter-spacing: -0.01em;
  /* Szeryf ma wyższe metryki niż grotesk; bez tego rozpycha wiersz w nagłówku. */
  line-height: 0;
  color: var(--accent);
}

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

.sprite {
  display: none;
}

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: currentColor;
}

.container {
  width: min(100% - 2 * var(--gutter), 85rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: var(--z-skip-link);
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* --- Elementy interaktywne ---------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 500 1rem/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s;
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.button:active {
  transform: translateY(1px);
}

.button .icon {
  transition: transform 0.35s var(--ease-out);
}

.button:hover .icon {
  transform: translateX(0.25rem);
}

.button--inverse {
  background: transparent;
  border-color: var(--muted-on-ink);
  color: var(--paper);
  padding: 0.75rem 1.125rem;
  font-size: 0.9375rem;
}

.button--inverse:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.button--inverse:hover .icon {
  transform: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: color 0.2s;
}

.text-link:hover {
  color: var(--accent);
}

/* --- Nagłówek ----------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: var(--z-masthead);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  height: var(--masthead-height);
}

.wordmark {
  margin-right: auto;
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.wordmark__dot {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15em;
  color: var(--accent);
}

.masthead__nav ul,
.lang-switch ul {
  display: flex;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

.masthead__nav a {
  color: var(--ink-2);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s;
}

.masthead__nav a:hover {
  color: var(--ink);
}

.lang-switch ul {
  gap: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.lang-switch a {
  color: var(--ink-3);
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--ink);
}

.lang-switch a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

.masthead__cta {
  font-size: 0.9375rem;
  font-weight: 500;
}

@media (max-width: 56rem) {
  .masthead__nav {
    display: none;
  }
}

@media (max-width: 30rem) {
  .masthead__cta .icon {
    display: none;
  }
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  row-gap: 3.5rem;
  align-items: end;
  padding-block: clamp(3.5rem, 9vw, 6rem) var(--section-space);
}

.hero__copy {
  grid-column: 1 / span 8;
}

.hero__title {
  font-size: clamp(2.625rem, 1.2rem + 4.9vw, 5.5rem);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.042em;
  text-wrap: balance;
}

.hero__lead {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 38ch;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.hero__cta {
  margin-top: 2.25rem;
}

.hero__index {
  grid-column: 10 / -1;
}

.hero__index ol {
  counter-reset: service;
  border-top: 1px solid var(--ink);
}

.hero__index li {
  counter-increment: service;
}

.hero__index a {
  display: grid;
  grid-template-columns: 2.25rem 1fr auto;
  align-items: center;
  padding-block: 0.875rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s;
}

.hero__index a::before {
  content: counter(service, decimal-leading-zero);
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.hero__index .icon {
  color: var(--ink-3);
  opacity: 0;
  transform: translate(-0.35rem, -0.35rem);
  transition: opacity 0.25s, transform 0.35s var(--ease-out), color 0.2s;
}

.hero__index a:hover {
  color: var(--accent);
}

.hero__index a:hover .icon,
.hero__index a:focus-visible .icon {
  color: var(--accent);
  opacity: 1;
  transform: none;
}

@media (max-width: 64rem) {
  .hero__copy,
  .hero__index {
    grid-column: 1 / -1;
  }

  .hero__index {
    max-width: 30rem;
  }
}

/* --- Sekcje: wspólne ---------------------------------------------------- */

.section {
  padding-block: var(--section-space);
}

.section-title {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  font-size: clamp(2rem, 1.3rem + 2.4vw, 3.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* --- Usługi -------------------------------------------------------------- */

.services {
  counter-reset: service;
  border-top: 1px solid var(--ink);
}

.service {
  counter-increment: service;
  display: grid;
  grid-template-columns: 4rem minmax(0, 5fr) minmax(0, 6fr);
  column-gap: var(--grid-gap);
  padding-block: clamp(1.75rem, 3.5vw, 2.75rem);
  border-bottom: 1px solid var(--rule);
}

.service::before {
  content: counter(service, decimal-leading-zero);
  padding-top: 0.55rem;
  color: var(--ink-3);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.service__name {
  font-size: clamp(1.5rem, 1.05rem + 1.6vw, 2.375rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  transition: color 0.4s;
}

.service:target .service__name {
  color: var(--accent);
}

.service__text {
  max-width: 44ch;
  color: var(--ink-2);
  text-wrap: pretty;
}

.service__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.5rem;
  margin-top: 1.125rem;
  color: var(--ink-3);
  font-size: 0.875rem;
}

@media (max-width: 48rem) {
  .service {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    row-gap: 1rem;
  }

  .service__body {
    grid-column: 2;
  }
}

/* --- Z czym przychodzą klienci ----------------------------------------- */

.problems {
  background: var(--paper-2);
}

.problems__inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
}

.problems__title {
  grid-column: 1 / span 4;
  align-self: start;
  position: sticky;
  top: calc(var(--masthead-height) + 2.5rem);
  max-width: 11ch;
}

.problems__list {
  grid-column: 6 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 4rem);
}

/* Prawa kolumna przesunięta w dół: rytm jak w łamaniu gazetowym. */
.problem:nth-child(even) {
  margin-top: clamp(3rem, 7vw, 6.5rem);
}

.problem__quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.625rem, 1.15rem + 1.5vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.problem__answer {
  max-width: 34ch;
  margin-top: 1.25rem;
  color: var(--ink-2);
  text-wrap: pretty;
}

@media (max-width: 64rem) {
  .problems__title,
  .problems__list {
    grid-column: 1 / -1;
  }

  .problems__title {
    position: static;
    max-width: none;
  }
}

@media (max-width: 40rem) {
  .problems__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .problem:nth-child(even) {
    margin-top: 0;
  }
}

/* --- Proces -------------------------------------------------------------- */

.process {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--grid-gap);
}

/* Jedna linia czasu przez wszystkie etapy. */
.process::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--ink);
  transform-origin: left;
}

.step {
  position: relative;
  padding-top: 2rem;
}

.step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 0.875rem;
  background: var(--ink);
}

.step__name {
  margin-bottom: 0.75rem;
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.step__text {
  max-width: 30ch;
  color: var(--ink-2);
  text-wrap: pretty;
}

@media (max-width: 56rem) {
  .process {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 3rem;
  }

  .process::before {
    display: none;
  }

  .step {
    border-top: 1px solid var(--ink);
  }
}

@media (max-width: 34rem) {
  .process {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2.5rem;
  }
}

/* --- Technologie (kolofon) ---------------------------------------------- */

.colophon__group {
  padding-block: 0.3em;
  font-size: clamp(1.75rem, 1rem + 2.7vw, 3.5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: pretty;
}

.colophon__group dt,
.colophon__group dd {
  display: inline;
}

.colophon__group dt {
  margin-right: 0.35em;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 0.62em;
  letter-spacing: 0;
  color: var(--accent);
}

.colophon__group dd span:not(:last-child)::after {
  content: ", ";
}

.colophon__group dd span:last-child::after {
  content: ".";
}

/* --- Kontakt i stopka (finał w atramencie) ------------------------------ */

.contact,
.footer {
  background: var(--ink);
  color: var(--paper);
}

.contact :focus-visible,
.footer :focus-visible {
  outline-color: var(--accent-on-ink);
}

.contact {
  padding-block: var(--section-space) clamp(3.5rem, 7vw, 5.5rem);
}

.contact__title {
  color: var(--muted-on-ink);
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2.25rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.contact__email {
  display: inline-block;
  margin-top: clamp(1rem, 2vw, 1.75rem);
  padding-bottom: 0.08em;
  font-size: clamp(2rem, 8.2vw, 7.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 0.04em no-repeat;
  transition: color 0.3s, background-size 0.6s var(--ease-out);
}

.contact__email:hover {
  color: var(--accent-on-ink);
  background-size: 100% 0.04em;
}

.contact__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem clamp(1.5rem, 4vw, 3.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule-on-ink);
  color: var(--muted-on-ink);
  font-size: 0.9375rem;
}

[data-copy] .icon--done,
[data-copy][data-state="done"] .icon--idle {
  display: none;
}

[data-copy][data-state="done"] .icon--done {
  display: block;
}

.footer {
  font-size: 0.8125rem;
  color: var(--muted-on-ink);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule-on-ink);
}

/* --- Ruch ---------------------------------------------------------------- */
/* Wejście hero ustala kolejność czytania; odsłanianie przy przewijaniu prowadzi
   przez sekcje. Tylko transform i opacity; całość wyłączona przy reduced motion. */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
}

@keyframes draw {
  from {
    transform: scaleX(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .hero__title,
  .hero__lead,
  .hero__cta,
  .hero__index li {
    animation: rise 0.9s var(--ease-out) both;
  }

  .hero__lead { animation-delay: 0.08s; }
  .hero__cta { animation-delay: 0.16s; }
  .hero__index li { animation-delay: calc(0.2s + var(--i, 0) * 0.05s); }
  .hero__index li:nth-child(2) { --i: 1; }
  .hero__index li:nth-child(3) { --i: 2; }
  .hero__index li:nth-child(4) { --i: 3; }
  .hero__index li:nth-child(5) { --i: 4; }

  /* Przeglądarki bez scroll-driven animations pokazują treść statycznie. */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }

    .process::before {
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 30% cover 45%;
    }
  }
}
