/* Paleta 1:1 z ui/theme/Color.kt aplikacji — fiolet + róż na prawie czarnym tle.
   Strona jest wyłącznie ciemna, tak jak aplikacja: jeden wygląd, ten sam znak firmowy.
   (Uwaga dla przyszłego czytelnika: CLAUDE.md opisuje akcenty jako „teal/pink" — to opis
   nieaktualny, Teal500 jest dziś aliasem na Purple. Źródłem jest Color.kt.) */

:root {
  color-scheme: dark;

  --bg: #0f0f14;          /* BgDark */
  --surface: #1a1825;     /* SurfaceDark */
  --card: #221f2e;        /* CardDark */
  --border: rgba(255, 255, 255, 0.07);   /* BorderColor */
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #f0edf8;                        /* TextPrimary */
  --text-dim: rgba(240, 237, 248, 0.55);  /* TextSub */
  --text-muted: rgba(240, 237, 248, 0.3); /* TextMuted */

  --purple: #7c3aed;      /* Purple */
  --purple-light: #9d5cf6;/* PurpleLight */
  --pink: #ec4899;        /* Pink */
  --pink-light: #f472b6;  /* PinkLight */

  --link: #b794f6;
  --radius: 14px;
  --maxw: 46rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--pink); }

.page-head { border-bottom: 1px solid var(--border); padding-bottom: 1.5rem; margin-bottom: 2rem; }
.page-head h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); line-height: 1.2; margin: .3rem 0 .6rem; }
.page-head.home h1 {
  background: linear-gradient(100deg, var(--pink-light), var(--purple-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.crumbs { margin: 0; font-size: .9rem; }
.lead { color: var(--text-dim); margin: .2rem 0 0; }

.meta { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; color: var(--text-dim); font-size: .875rem; margin: 0 0 .75rem; }
.meta strong { color: var(--text); font-weight: 600; }
.switch { margin: 0; font-size: .9rem; }

.toc {
  background: var(--surface);
  border-left: 3px solid var(--purple);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
}
.toc h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin: 0 0 .6rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.toc li { margin: .15rem 0; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
@media (max-width: 34rem) { .toc ol { columns: 1; } }

.doc h2 {
  font-size: 1.35rem;
  margin: 2.75rem 0 .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 1rem;
}
.doc h3 { font-size: 1.08rem; margin: 1.75rem 0 .5rem; color: var(--purple-light); scroll-margin-top: 1rem; }
.doc h4 { font-size: 1rem; margin: 1.25rem 0 .4rem; }
.doc p, .doc li { overflow-wrap: break-word; }
.doc ul, .doc ol { padding-left: 1.4rem; }
.doc li { margin: .3rem 0; }
.doc strong { color: var(--text); }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; display: none; }

.anchor {
  float: left;
  margin-left: -1.1rem;
  width: 1.1rem;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0;
  transition: opacity .15s;
}
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
@media (max-width: 52rem) { .anchor { display: none; } }

.doc blockquote {
  margin: 1.25rem 0;
  padding: .75rem 1rem;
  background: var(--surface);
  border-left: 3px solid var(--pink);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dim);
}
.doc blockquote p { margin: .4rem 0; }

.doc code {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .1em .35em;
  font-size: .875em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.doc pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}
.doc pre code { background: none; border: 0; padding: 0; }

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: .92rem;
  display: block;
  overflow-x: auto;
}
.doc th, .doc td {
  border: 1px solid var(--border);
  padding: .55rem .7rem;
  text-align: left;
  vertical-align: top;
}
.doc th { background: var(--card); font-weight: 600; }
.doc tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface) 60%, transparent); }

.cards { margin: 2rem 0; }
.cards h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin: 0 0 .75rem; }
.cards ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.cards a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, transform .15s;
}
.cards a:hover { border-color: var(--border-strong); box-shadow: 0 0 0 1px var(--purple); transform: translateY(-1px); }
.cards strong { display: block; font-size: 1.05rem; }
.cards span { display: block; color: var(--text-dim); font-size: .9rem; margin-top: .15rem; }

.page-foot {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .875rem;
}
.page-foot p { margin: .3rem 0; }

@media print {
  body { background: #fff; color: #000; }
  .toc, .switch, .crumbs, .anchor, .page-foot a { display: none; }
  .doc h2 { page-break-after: avoid; }
}

/* ── Znak firmowy ─────────────────────────────────────────────────────────────
   Ta sama ikona co w launcherze (assets/icon.svg jest przeniesionym wektorem). */

.brand { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; }
.brand img { width: 1.6rem; height: 1.6rem; flex: none; }
.brand a { text-decoration: none; font-size: .9rem; }
.brand a:hover { text-decoration: underline; }

.page-head.home { text-align: center; border-bottom: none; padding-bottom: 1rem; }
.page-head.home .brand-mark {
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto .9rem;
  display: block;
  filter: drop-shadow(0 10px 26px color-mix(in srgb, var(--purple) 45%, transparent));
}
.page-head.home .lead { margin-top: .35rem; }
.page-head.home + .cards { margin-top: 2.5rem; }
