/* mamtoapp.pl - landing, privacy, disclosure.
   Static CSS, no build step, no framework. Layout is flow + grid;
   nothing here depends on JavaScript running. */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  /* Short pages (404) otherwise leave the footer floating mid-viewport. */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--f-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

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

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
/* Even out the line lengths instead of letting a one-letter word dangle at the
   end of a line. Ignored by browsers that do not support it, which just get
   the greedy wrap they got before. */
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
h1 { font-size: var(--f-display); font-weight: 700; }
h2 { font-size: var(--f-h2); font-weight: 700; }
h3 { font-size: var(--f-h3); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--text-primary); color: var(--background);
  padding: var(--sp-md) var(--sp-lg); border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { left: 0; }

/* ---------- layout ---------- */

.wrap { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 46rem; }

.section { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }
.section--alt { background: var(--surface-alt); }

/* One vertical line down the page: every section starts its h2 on the
   container's left edge. Text-only sections move their body into a second
   column beside the heading, which fills the row without stretching the
   reading measure; sections with a full-width grid keep the heading above it.
   Below 60rem both columns collapse, heading first, and the distinction
   disappears - which is the layout phones get. */
.section__head { max-width: var(--measure); }
.section__head > * + * { margin-top: var(--sp-lg); }
.section__head .eyebrow + h2 { margin-top: var(--sp-sm); }

.section__body { max-width: var(--measure); }
.section__head + .section__body { margin-top: var(--sp-xl); }

@media (min-width: 60rem) {
  .section__grid {
    display: grid;
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    column-gap: clamp(2.5rem, 1rem + 3vw, 4rem);
    align-items: start;
  }
  .section__grid > .section__head { max-width: none; }
  .section__grid > .section__head + .section__body { margin-top: 0; }
}

.stack > * + * { margin-top: var(--sp-lg); }
.stack--tight > * + * { margin-top: var(--sp-md); }
/* Heading to grid needs more air than paragraph to paragraph when the section
   itself is separated by ~88px. */
.stack--section > * + * { margin-top: clamp(2rem, 1rem + 2vw, 3rem); }

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--sp-lg); }
.lead { font-size: var(--f-lead); color: var(--text-secondary); }

.eyebrow {
  font-size: var(--f-eyebrow); font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-ink); margin: 0;
}

/* ---------- header ---------- */

.site-header { padding-block: var(--sp-xl); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-lg); }
.brand { display: inline-flex; align-items: center; gap: var(--sp-md); font-weight: 700; font-size: 1.15rem; color: var(--text-primary); text-decoration: none; }
.brand__mark { width: 36px; height: 36px; border-radius: 10px; }
.site-header nav { display: flex; gap: var(--sp-lg); font-size: var(--f-small); flex-wrap: wrap; }
/* At 390px four items plus the wordmark need ~400px of the 349px available and
   break onto a second ragged row. The two anchors to sections just below the
   fold give way to the two that answer the question about money. */
@media (max-width: 40rem) {
  .site-header nav a[href="#jak-to-dziala"],
  .site-header nav a[href="#w-srodku"] { display: none; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-sm);
  font: inherit; font-weight: 600; text-decoration: none;
  padding: 0.9rem 1.6rem; border-radius: var(--r-pill); border: 1px solid transparent;
}
.btn--primary { background: var(--text-primary); color: var(--background); }
.btn--primary:hover { background: color-mix(in srgb, var(--text-primary) 88%, black); }

/* Pre-launch state. Not a link, not a <button>: there is nothing to press yet,
   so it must not be focusable or announced as a control - and it must not look
   pressable either. A filled pill in accent-soft read as a primary button and
   invited clicks that go nowhere, so this is styled as a status: dashed
   outline, no fill, a dot to mark it as pending. Swap per web/README.md. */
.btn--soon {
  background: transparent; color: var(--accent-ink);
  border: 1px dashed var(--border-strong); cursor: default;
}
.btn--soon::before {
  content: ""; flex: none; width: 8px; height: 8px;
  border-radius: var(--r-pill); background: var(--accent);
}

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-lg); }
.cta__note { font-size: var(--f-small); color: var(--text-secondary); }

/* The closing CTA is the one centred block on the page. It sits in a bounded
   panel so the centring reads as a full stop rather than as a third alignment. */
.cta-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(2rem, 1rem + 3vw, 3rem);
  text-align: center;
}
.cta-panel > * + * { margin-top: var(--sp-lg); }
.cta-panel .lead { max-width: 34rem; margin-inline: auto; }
.cta-panel .cta { justify-content: center; }

/* Short pages with no layout of their own (404). */
.page-center { text-align: center; }
.page-center .section__head { margin-inline: auto; }
.page-center .cta { justify-content: center; }

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

.hero { padding-block: clamp(1rem, 0.5rem + 2vw, 2.5rem) clamp(3rem, 2rem + 4vw, 5rem); }
.hero__grid { display: grid; gap: clamp(2rem, 1rem + 4vw, 4rem); align-items: center; }
@media (min-width: 56rem) {
  .hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}
.hero__copy > * + * { margin-top: var(--sp-xl); }

/* ---------- phone frame ---------- */

/* iPhone silhouette: a thin black bezel inside a titanium rail, corners at the
   ~14.5% of width Apple uses, and the side buttons. A single thick uniform
   border reads as a generic Android slab, and the buttons are what the eye
   actually uses to tell the two apart. box-shadow rings follow border-radius,
   so the rail needs no extra element. */
.phone {
  --phone-w: clamp(230px, 20vw + 120px, 320px);
  --phone-r: calc(var(--phone-w) * 0.145);
  position: relative;
  width: var(--phone-w);
  margin-inline: auto;
  border: 3px solid var(--device-bezel);
  border-radius: var(--phone-r);
  background: var(--background);
  box-shadow:
    0 0 0 5px var(--device-rail),
    0 0 0 6px rgba(43, 39, 38, 0.3),
    0 18px 40px -18px rgba(43, 39, 38, 0.35);
}
/* No `overflow: hidden` here: it clipped the side buttons, which sit outside
   the padding box, so the whole silhouette below rendered as nothing. The
   screen corners are rounded on the image instead - inner radius is the outer
   one minus the bezel. */
.phone img { width: 100%; border-radius: calc(var(--phone-r) - 3px); }

/* Right rail: side button. Left rail: volume pair plus action button. */
.phone::after,
.phone::before {
  content: "";
  position: absolute;
  width: 6px;
  background: var(--device-button);
  pointer-events: none;
}
.phone::after { right: -6px; top: 27%; height: 11%; border-radius: 0 2px 2px 0; }
.phone::before { left: -6px; top: 21%; height: 20%; border-radius: 2px 0 0 2px; }

.phone-row {
  display: grid; gap: clamp(1.5rem, 1rem + 3vw, 3rem);
  grid-template-columns: 1fr;
  align-items: start;
}
/* 60rem, not 48rem: at 768px three columns gave each step a 206px column, which
   is 25 characters a line and spilled step one over eight lines. Below this the
   steps stack, which already works. */
@media (min-width: 60rem) {
  /* Four shared rows (number, heading, copy, phone) so the phones line up on a
     common baseline no matter how long each step's copy runs. Without subgrid
     the longest paragraph pushes only its own phone down. */
  .phone-row { grid-template-columns: repeat(3, 1fr); grid-template-rows: auto auto 1fr auto; }
  .phone-row .step { display: grid; grid-row: span 4; grid-template-rows: subgrid; gap: 0; }
  .phone-row .step > * + * { margin-top: var(--sp-md); }
  /* The phone needs more air than paragraph-to-paragraph spacing: it is a
     different kind of object, and at --sp-lg it read as attached to the last
     line of copy. */
  .phone-row .step > .phone { margin-top: clamp(1.75rem, 1rem + 2vw, 2.75rem); align-self: end; }
}
/* Explicit radius here, not the 14.5% formula: --phone-w carries a percentage
   in this row, and a percentage in border-radius resolves against the image's
   own box rather than the frame's, so the inner corner drifts from the outer
   one. 38px is 14.5% of the 260px cap. */
.phone-row .phone { --phone-w: min(100%, 260px); --phone-r: 38px; }

/* ---------- steps ---------- */

.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 700; font-size: var(--f-small);
}
.step > * + * { margin-top: var(--sp-md); }
.step p { color: var(--text-secondary); }

/* ---------- cards ---------- */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-xl);
}
.card--flat { background: var(--surface-alt); border-color: var(--border-strong); }
.card--trust { background: var(--completion-soft); border-color: var(--completion-border); }
.card--price { background: var(--accent-soft); border-color: var(--border-strong); }

.grid-cards { display: grid; gap: var(--sp-lg); grid-template-columns: 1fr; }
@media (min-width: 34rem) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
/* Three cards never enter a 2-column grid: it leaves an orphan on the second
   row through the whole 544-960px band. One column or three, nothing between.
   Must come after the 34rem rule above to win on order. */
.grid-cards--3 { grid-template-columns: 1fr; }
@media (min-width: 48rem) { .grid-cards--3 { grid-template-columns: repeat(3, 1fr); } }

.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-sm); }
.cat-list li {
  display: flex; align-items: baseline; gap: var(--sp-md);
  padding: var(--sp-md) 0; border-bottom: 1px solid var(--border);
}
.cat-list li:last-child { border-bottom: 0; }
.cat-list b { font-weight: 600; }
.tag {
  font-size: var(--f-caption); font-weight: 600; padding: 2px 10px;
  border-radius: var(--r-pill); white-space: nowrap;
}
/* Push the tag to the card's right edge so the tags form a column, and stop
   `align-items: baseline` from stranding it on line one of a wrapping label. */
.cat-list .tag { margin-inline-start: auto; }
.tag--free { background: var(--completion-soft); color: var(--completion-ink); }
.tag--core { background: var(--text-primary-tint); color: var(--text-secondary); }

.stat { display: grid; gap: var(--sp-xs); }
.stat__num { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); font-weight: 700; line-height: 1; }
.stat__label { font-size: var(--f-small); color: var(--text-secondary); }

/* ---------- price ---------- */

.price { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3rem); font-weight: 700; line-height: 1; color: var(--accent-ink); }

/* ---------- faq ---------- */

.faq { max-width: var(--measure); }
.faq details {
  border-bottom: 1px solid var(--border-strong);
  padding-block: var(--sp-lg);
  padding-inline: var(--sp-md);
  margin-inline: calc(var(--sp-md) * -1);
  border-radius: var(--r-sm);
}
.faq details:first-of-type { border-top: 1px solid var(--border-strong); }
.faq summary {
  cursor: pointer; font-weight: 600; font-size: var(--f-lead);
  list-style: none; display: flex; justify-content: space-between; gap: var(--sp-lg);
  align-items: baseline;
}
.faq summary:hover { color: var(--accent-ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-ink); font-weight: 700; flex: none; font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > p { margin-top: var(--sp-md); color: var(--text-secondary); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border); background: var(--surface-alt);
  padding-block: var(--sp-xxl); margin-top: var(--sp-xxl);
  font-size: var(--f-small);
}
.site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--sp-lg) var(--sp-xl); justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--sp-lg); }
.site-footer p { color: var(--text-secondary); }

/* ---------- legal pages ---------- */

.legal { padding-block: var(--sp-xxl) var(--sp-xxl); }

/* A legal document, not a landing: h1 comes off the display scale so there is
   one step between h1 and h2 rather than a 2.5x drop. */
.legal .prose h1 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); }

/* Sections have to group visually. Margin alone does not do it at
   line-height 1.15, so a rule draws the boundary. */
.legal .prose h2 {
  font-size: 1.45rem;
  margin-top: 3.5rem;
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--border);
}
.legal .prose h2 + * { margin-top: var(--sp-lg); }
.legal .prose h3 { margin-top: var(--sp-xxl); }

/* Lists carry the same rank as paragraphs, so they take the same colour. They
   were --text-secondary, which made "W skrócie" - the most load-bearing part of
   the document - lighter than the prose around it. */
.legal .prose ul, .legal .prose ol { margin: 0; padding-left: 1.3em; }
.legal .prose li + li { margin-top: var(--sp-sm); }

.legal .prose table {
  width: 100%; border-collapse: collapse; font-size: var(--f-small);
}
.legal .prose th, .legal .prose td {
  text-align: left; padding: var(--sp-md); border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.legal .prose th { font-weight: 600; }
.legal .prose thead th { border-bottom-color: var(--border-strong); }
/* Outer cells lose their padding so the table sits in the text column instead
   of indented 12px from it. */
.legal .prose :is(th, td):first-child { padding-left: 0; }
.legal .prose :is(th, td):last-child { padding-right: 0; }

.legal .prose code {
  font-size: 0.9em; background: var(--text-primary-tint);
  padding: 1px 6px; border-radius: var(--r-sm);
}
/* Anchor targets must not land under the top edge. */
.legal :target { scroll-margin-top: var(--sp-xl); }

/* A focusable scroll container: without tabindex a keyboard user cannot scroll
   a table that overflows on a narrow screen (WCAG 2.1.1). */
.table-scroll { overflow-x: auto; }
.legal-meta { font-size: var(--f-small); color: var(--text-secondary); }

.toc {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-xl);
}
.toc ol { margin: var(--sp-md) 0 0; padding-left: 1.3em; columns: 2; column-gap: var(--sp-xl); }
.toc li { break-inside: avoid; }
@media (max-width: 36rem) { .toc ol { columns: 1; } }

.callout {
  background: var(--surface-alt); border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent); border-radius: var(--r-md);
  padding: var(--sp-lg);
}

.muted { color: var(--text-secondary); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
