/* eMedics, wspolna warstwa wygladu (redesign 2026-10).
   Tokeny, typografia, przyciski, naglowek, stopka, FAQ, tabele i notki.
   Zrodlem jest css/home.css (strona glowna, wyglad zatwierdzony przez
   Macieja): papier i fiolet tuszu pieczatki, IBM Plex hostowany lokalnie.
   Podstrony laduja base.css + subpage.css. Strona glowna na razie dalej
   laduje wlasny home.css z tymi samymi tokenami (te same wartosci; przy
   zmianie tokenu zmien oba pliki albo przepnij index.html na base.css). */

:root {
  --paper: oklch(0.975 0.008 85);
  --paper-2: oklch(0.948 0.013 85);
  --paper-3: oklch(0.915 0.016 85);
  --sheet: oklch(0.99 0.004 85);
  --ink: oklch(0.23 0.03 280);
  --ink-2: oklch(0.41 0.025 280);
  --ink-3: oklch(0.52 0.02 280);
  --rule: oklch(0.86 0.014 85);
  --rule-2: oklch(0.78 0.015 85);
  --stamp: oklch(0.47 0.17 292);
  --stamp-hover: oklch(0.41 0.17 292);
  --stamp-deep: oklch(0.29 0.11 292);
  --stamp-deeper: oklch(0.24 0.09 292);
  --stamp-tint: oklch(0.935 0.035 292);
  --on-stamp: oklch(0.975 0.012 292);
  --on-stamp-2: oklch(0.86 0.04 292);
  --ok: oklch(0.5 0.12 155);
  --ok-ink: oklch(0.38 0.09 155);
  --ok-tint: oklch(0.94 0.04 155);
  --warn: oklch(0.5 0.11 65);
  --warn-tint: oklch(0.95 0.04 85);
  --bad: oklch(0.5 0.17 25);
  --bad-tint: oklch(0.95 0.03 25);
  --focus: oklch(0.62 0.19 292);

  --f-body: 'IBM Plex Sans', 'IBM Plex Sans Fallback', system-ui, sans-serif;
  --f-display: 'IBM Plex Sans Condensed', 'IBM Plex Sans Cond Fallback', 'IBM Plex Sans', system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --wrap: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--stamp); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--stamp-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--stamp-tint); color: var(--ink); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 6px;
}
.skip:focus { top: 12px; color: var(--paper); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.label {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--stamp); margin: 0 0 14px;
}

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
h3 { font-weight: 600; line-height: 1.2; }
.lede { font-size: clamp(1.08rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 62ch; line-height: 1.55; }

/* Przyciski: jeden glowny styl na strone, plus link tekstowy. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--stamp); color: var(--on-stamp);
  font-weight: 600; font-size: 1.02rem; text-decoration: none; border: 0;
  padding: 15px 24px; border-radius: 8px; min-height: 48px;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { background: var(--stamp-hover); color: var(--on-stamp); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.textlink { font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-2); text-decoration-thickness: 2px; }
.textlink:hover { color: var(--stamp); text-decoration-color: currentColor; }

/* ---------- NAGLOWEK (ten sam co na stronie glownej) ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: oklch(0.975 0.008 85 / 0.96);
}
.nav-in { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.logo { font-family: var(--f-display); font-weight: 700; font-size: 1.45rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.logo:hover { color: var(--ink); }
.logo span { color: var(--stamp); }
.nav nav { margin-left: auto; }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; font-weight: 500; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--stamp); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.nav-links .nav-demo { font-weight: 600; color: var(--ink); }
.nav-links .nav-demo:hover { color: var(--stamp); }
.nav .btn { padding: 10px 16px; min-height: 42px; font-size: 0.93rem; white-space: nowrap; }
@media (max-width: 1080px) { .nav-in { gap: 20px; } .nav-links { gap: 16px; } .nav-links a { font-size: 0.9rem; } }
@media (max-width: 960px) {
  .nav-in { flex-wrap: wrap; gap: 0 16px; }
  .nav .btn { margin-left: auto; }
  .nav nav { order: 3; flex: 0 0 100%; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .nav nav::-webkit-scrollbar { display: none; }
  .nav-links { gap: 20px; padding: 2px 0 12px; }
}
@media (max-width: 380px) { .nav .btn { font-size: 0.86rem; padding: 9px 12px; } }

/* ---------- FAQ na <details>: bez JS, wszystkie zwiniete ---------- */
.faq { max-width: 860px; }
.faq details { background: var(--paper-2); border-radius: 10px; padding: 0 20px; border: 1px solid transparent; transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.faq details + details { margin-top: 8px; }
.faq details:hover { border-color: var(--rule); }
.faq details[open] { border-color: var(--rule); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 16px 0; font-family: var(--f-display); font-weight: 600; font-size: 1.18rem; line-height: 1.3; border-radius: 8px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::marker { content: ""; }
.faq summary::after { content: "+"; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--stamp); font-size: 1.4rem; font-weight: 400; line-height: 1; color: var(--stamp); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }
.faq .a { padding: 0 0 20px; color: var(--ink-2); max-width: 70ch; }
.faq .a p + p { margin-top: 10px; }
@media (max-width: 640px) {
  .faq details { padding: 0 14px; }
  .faq summary { font-size: 1.05rem; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { .faq summary::after, .faq details { transition: none; } }

/* ---------- STOPKA (ta sama co na stronie glownej) ---------- */
.foot { padding: 56px 0 40px; color: var(--ink-2); font-size: 0.9rem; background: var(--paper-2); }
.foot a { color: var(--ink-2); }
.foot-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 40px; margin-bottom: 44px; }
.foot .foot-h { font-family: inherit; font-size: 0.84rem; font-weight: 600; line-height: 1.3; color: var(--ink-3, var(--ink-2)); margin: 0 0 12px; padding: 0; letter-spacing: 0; text-transform: none; }
.foot .foot-col ul { display: grid; list-style: none; gap: 9px; margin: 0; padding: 0; list-style: none; }
.foot-col a { text-decoration: none; line-height: 1.4; }
.foot-col a:hover { text-decoration: underline; color: var(--ink); }
.foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: baseline; padding-top: 8px; }
.foot-top p { margin: 0; max-width: 75ch; }
.foot-note { margin-top: 18px; font-size: 0.8125rem; line-height: 1.55; max-width: 80ch; }
@media (max-width: 900px) { .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .foot-cols { grid-template-columns: 1fr; gap: 28px; } }

/* Pojawianie przy przewijaniu: tylko gdy ruch nie jest wylaczony i JS dziala
   (scripting: enabled; bez wsparcia tej cechy warunek jest falszywy = tresc widoczna). */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  .js .rev { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js .rev.in { opacity: 1; transform: none; }
}

/* Ruch 2026-10, wspolny z home.css: ziarno papieru i pasek czytania. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1000; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .24 0 0 0 0 .2 0 0 0 0 .3 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") repeat;
}
@media print { body::after { display: none; } }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .nav::after {
      content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px;
      background: var(--stamp); transform-origin: 0 50%; transform: scaleX(0);
      animation: em-readbar linear both; animation-timeline: scroll(root);
    }
  }
}
@keyframes em-readbar { to { transform: scaleX(1); } }

/* ---------- Link "demo bez rejestracji" i podpis pod przyciskiem proby ---------- */
.demo-link { display: block; text-align: center; margin-top: 0.6rem; font-size: 0.86rem; color: var(--ink-2); text-decoration: none; border-bottom: 1px dotted var(--rule-2); align-self: center; }
.demo-link:hover { color: var(--ink); border-bottom-color: var(--ink-2); }
.demo-link:focus-visible { outline: 3px solid var(--stamp); outline-offset: 3px; }
.cta-micro { display: block; text-align: center; font-size: 0.82rem; color: var(--ink-2); line-height: 1.4; }
