/*
 * site.css — style stron informacyjnych tictactoe.swistai.com
 * (strona główna, /pobierz/, /polityka-prywatnosci/, 404).
 * Kolory, font i kształty pochodzą z tokens.css; tu tylko układ i komponenty.
 * Gra (/graj/) ma własny arkusz game.css.
 */

:root {
  --gutter: 16px;
  --maxw: 72rem;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
}
@media (min-width: 640px) {
  :root { --gutter: 24px; }
}

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

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
}
main { flex: 1 0 auto; }

img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; }
h1, h2, h3, p, ul, ol, dl { overflow-wrap: break-word; }

/* Szerokość treści: marginesy boczne min. 16 px */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}
.wrap-narrow {
  width: min(100% - 2 * var(--gutter), 45rem);
  margin-inline: auto;
}

/* Link „Przejdź do treści" — widoczny dopiero po sfokusowaniu */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: var(--r-chip);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

.site-header { padding-block: 12px; }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
}
.brand svg { width: 36px; height: 36px; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--r-chip);
  color: var(--text2);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.nav a:hover,
.nav a[aria-current="page"] { background: var(--surface2); color: var(--text); }

/* ---------- Przyciski (R16, 56 px; główny / tonalny) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 28px;
  border: 0;
  border-radius: var(--r-tile);
  font: 500 1rem/1.3 var(--font);
  letter-spacing: .01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 200ms var(--ease), transform 150ms var(--ease);
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--pri-hover); }
.btn-primary:active { background: var(--pri-press); transform: scale(.98); }
.btn-tonal { background: var(--surface2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-tonal:hover { background: var(--s2-hover); }
.btn-tonal:active { background: var(--s2-press); transform: scale(.98); }
.btn-lg { min-height: 64px; padding-inline: 36px; font-size: 1.125rem; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.cta .btn { flex: 1 1 15rem; }
@media (min-width: 880px) {
  .cta .btn { flex: 0 1 auto; }
}

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

.hero { padding-block: clamp(24px, 5vw, 64px) clamp(40px, 7vw, 88px); overflow-x: clip; }
.hero-grid {
  display: grid;
  gap: clamp(32px, 6vw, 56px);
  align-items: center;
}
@media (min-width: 880px) {
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 6px 14px 6px 12px;
  border-radius: var(--r-chip);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text2);
  font-size: .875rem;
  font-weight: 600;
}
.eyebrow svg { width: 16px; height: 16px; flex: none; }

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(1.875rem, .4rem + 7.5vw, 4rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -.025em;
}
.lead {
  margin: 0 0 32px;
  max-width: 36rem;
  color: var(--text2);
  font-size: clamp(1.0625rem, .9rem + .7vw, 1.25rem);
  line-height: 1.6;
}
.hero-note {
  margin: 20px 0 0;
  max-width: 36rem;
  color: var(--text2);
  font-size: .9375rem;
}

/* ---------- Makieta telefonu (dekoracyjna, aria-hidden) ----------
 * Wymiary w jednostkach --u (1 dp projektu); --u skaluje się z szerokością
 * kontenera (container query), więc makieta mieści się od 320 px wzwyż. */

.phone-wrap {
  position: relative;
  width: min(100%, 320px);
  margin-inline: auto;
  container-type: inline-size;
}
.phone-wrap::before {
  content: '';
  position: absolute;
  inset: -8% -4%;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--x) 16%, transparent), transparent);
  pointer-events: none;
}
@media (min-width: 880px) {
  .phone-wrap::before { inset: -12% -18%; }
}
.phone {
  --u: .7px;
  padding: calc(8 * var(--u));
  border-radius: calc(44 * var(--u));
  background: #050607;
  box-shadow: 0 0 0 1px var(--line), 0 40px 80px -32px rgba(0, 0, 0, .55);
  user-select: none;
  pointer-events: none;
}
@supports (width: 1cqw) {
  .phone { --u: calc(100cqw / 428); }
}
.ph-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(10 * var(--u));
  border-radius: calc(36 * var(--u));
  background: var(--bg);
  color: var(--text);
  font-size: calc(16 * var(--u));
  line-height: 1.4;
}
.ph-sbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 1.75em;
  padding: 0 1.5em;
  font-size: .875em;
  font-weight: 600;
  line-height: 1;
}
.ph-sbar-icons { display: flex; align-items: center; gap: .3em; }
.ph-sbar-icons svg { width: 1em; height: 1em; fill: currentColor; }
.ph-cut {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.5em;
  height: 1.5em;
  margin: -.75em 0 0 -.75em;
  border-radius: 50%;
  background: #050607;
}
.ph-top {
  display: flex;
  align-items: center;
  min-height: 4em;
  padding: 0 .75em 0 1.5em;
}
.ph-title {
  flex: 1;
  font-size: 1.375em;
  font-weight: 600;
  line-height: 1.27;
  letter-spacing: -.01em;
}
.ph-gear { display: grid; place-items: center; width: 3em; height: 3em; }
.ph-gear svg { width: 1.5em; height: 1.5em; fill: currentColor; }
.ph-body { padding: 0 1.5em; }
.ph-score {
  display: flex;
  align-items: center;
  gap: .5em;
  min-height: 4em;
}
.ph-chip {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 3em;
  padding: .25em .5em;
  border: 1px solid var(--surface);
  border-radius: .75em;
  background: var(--surface);
}
.ph-chip.is-active { background: var(--surface2); }
.ph-chip.is-x { border-color: var(--x); }
.ph-chip svg { width: 1.125em; height: 1.125em; flex: none; }
.ph-chip .lbl { font-size: .875em; font-weight: 500; color: var(--text2); }
.ph-chip .num { font-size: 1.75em; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ph-boardwrap { padding: .5em 0; }
.ph-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5em;
  aspect-ratio: 1 / 1;
}
.ph-tile { border-radius: 1em; background: var(--surface2); }
.ph-tile.is-win { background: var(--win-x); }
.ph-tile svg { display: block; width: 100%; height: 100%; }
.ph-tile .dim { opacity: .35; }
.ph-win {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ph-win path {
  stroke-dasharray: 100;
  animation: site-draw 700ms var(--ease) 600ms both;
}
.ph-status {
  margin: 1em 0 1.5em;
  text-align: center;
  font-weight: 500;
  line-height: 1.5;
}
.ph-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5em;
  border-radius: 1em;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 500;
  letter-spacing: .01em;
}
.ph-pill {
  width: 6.75em;
  height: .25em;
  margin: 1.5em auto .25em;
  border-radius: .125em;
  background: var(--text2);
  opacity: .6;
}
@keyframes site-draw {
  0%   { stroke-dashoffset: 100; opacity: 0; }
  1%   { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

/* ---------- Sekcje i karty ---------- */

.section { padding-block: clamp(40px, 7vw, 88px); }
.section + .section { padding-top: 0; }
.section-head { max-width: 40rem; margin-bottom: 28px; }
.section h2,
.page-head h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.02em;
}
.section-lead { margin: 0; color: var(--text2); font-size: 1.0625rem; }

.cards {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 600px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* 6 kart = 3 × 2 (nie zostawiaj osieroconej karty) */
}
.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-dialog);
  background: var(--surface);
}
.card-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: var(--r-tile);
  background: var(--surface2);
}
.card-icon svg { width: 28px; height: 28px; }
.card h3 {
  margin: 0 0 8px;
  font-size: 1.1875rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -.01em;
}
.card p { margin: 0; color: var(--text2); font-size: .9375rem; }

/* Symbole X / O jako SVG (kolory z tokenów; grubość kreski w atrybucie) */
.mk { fill: none; stroke-linecap: round; }
.mk-x { stroke: var(--x); }
.mk-o { stroke: var(--o); }

/* Ikony: kreski w kolorach X / O / tekstu */
.ic { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-x { stroke: var(--x); }
.ic-o { stroke: var(--o); }
.ic-t { stroke: var(--text); }

/* ---------- Platformy ---------- */

.platforms {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 760px) {
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--r-dialog);
  background: var(--surface);
}
.panel h3 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.01em;
}
.panel p { margin: 0 0 20px; color: var(--text2); }
.panel .btn { margin-top: auto; width: 100%; }
@media (min-width: 480px) {
  .panel .btn { width: auto; }
}
.tag {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text2);
  font-size: .8125rem;
  font-weight: 600;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-chip);
  background: var(--surface2);
  font-size: .875rem;
  font-weight: 600;
}
.chips svg { width: 20px; height: 20px; flex: none; }

/* ---------- Stopka ---------- */

.site-footer {
  flex: none;
  margin-top: clamp(32px, 6vw, 64px);
  padding-block: 28px 36px;
  border-top: 1px solid var(--line);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
}
.site-footer p { margin: 0; color: var(--text2); font-size: .9375rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0; padding: 0; list-style: none; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--r-chip);
  color: var(--text2);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
}
.footer-links a:hover { background: var(--surface2); color: var(--text); }

/* ---------- Podstrony: nagłówek strony i proza ---------- */

.page-head { padding-block: clamp(24px, 5vw, 56px) 8px; }
.page-head h1 { font-size: clamp(1.875rem, .6rem + 5.5vw, 3rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin-bottom: 16px; }
.page-head .lead { margin-bottom: 8px; }
.meta-line { margin: 0; color: var(--text2); font-size: .9375rem; }

.prose { font-size: 1.0625rem; line-height: 1.7; }
.prose h2 {
  margin: 2.4em 0 .6em;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.015em;
  scroll-margin-top: 16px;
}
.prose h3 { margin: 1.8em 0 .5em; font-size: 1.125rem; line-height: 1.35; font-weight: 600; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .45em; padding-left: .2em; }
.prose li::marker { color: var(--text2); }
.prose a { text-decoration-thickness: 1px; text-decoration-color: var(--text2); }
.prose a:hover { text-decoration-thickness: 2px; text-decoration-color: currentColor; }
.prose strong { font-weight: 600; }
.prose code {
  padding: .1em .4em;
  border-radius: 6px;
  background: var(--surface2);
  font-family: var(--mono);
  font-size: .9em;
  overflow-wrap: anywhere;
}

.callout {
  margin: 0 0 1.5em;
  padding: 20px 24px;
  border-radius: var(--r-tile);
  background: var(--surface2);
}
.callout > :last-child { margin-bottom: 0; }
.callout h2, .callout h3 { margin-top: 0; }

.toc {
  margin: 0 0 1.5em;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-tile);
  background: var(--surface);
}
.toc h2 { margin: 0 0 .5em; font-size: 1.125rem; }
.toc ol { margin: 0; padding-left: 1.6em; }
.toc li { margin-bottom: .15em; }
.toc a { display: block; padding: 4px 0; }

/* ---------- Pobieranie ---------- */

.dl-card {
  margin: 24px 0 0;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r-dialog);
  background: var(--surface);
}
.dl-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.dl-head svg { width: 64px; height: 64px; flex: none; }
.dl-head h2 { margin: 0; font-size: 1.375rem; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
.dl-head p { margin: 2px 0 0; color: var(--text2); font-size: .9375rem; }
.dl-card .btn-lg { width: 100%; }
@media (min-width: 600px) {
  .dl-card .btn-lg { width: auto; }
}
.meta { display: grid; gap: 0; margin: 28px 0 0; }
.meta > div {
  display: grid;
  gap: 2px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 600px) {
  .meta > div { grid-template-columns: 9rem minmax(0, 1fr); }
}
.meta dt { color: var(--text2); font-size: .9375rem; }
.meta dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- 404 ---------- */

.notfound { padding-block: clamp(40px, 10vw, 112px); text-align: center; }
.notfound .mark { width: 120px; height: 120px; margin: 0 auto 24px; }
.notfound h1 { margin: 0 0 12px; font-size: clamp(1.75rem, 1rem + 4vw, 2.75rem); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.notfound p { margin: 0 auto 28px; max-width: 30rem; color: var(--text2); font-size: 1.0625rem; }
.notfound .cta { justify-content: center; }
