/* ─────────────────────────────────────────────────────────────
   Katalog agentów AI — wspólne style dla /agenci/ i podstron
   Paleta i typografia zgodne ze stroną główną.
   ───────────────────────────────────────────────────────────── */

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

:root {
  --bg:        #050A14;
  --bg2:       #080F1E;
  --panel:     #060D1F;
  --blue:      #0066FF;
  --blue-dark: #003399;
  --white:     #FFFFFF;
  --muted:     #A0AEC0;
  --dim:       rgba(255,255,255,.38);
  --card-bg:   rgba(8,18,40,.72);
  --border:    rgba(255,255,255,.08);
  --border-blue: rgba(0,102,255,.25);
  --ok:        #2FD98A;
  --radius:    16px;

  /* skala — podnoszona w trybie prezentacji */
  --scale: 1;
  --shell: 1160px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  font-size: calc(1rem * var(--scale));
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; line-height: 1.18; }
p { color: var(--muted); }
a { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--blue-dark); border-radius: 3px; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 24px; }

/* ─── NAV ──────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 72px;
  background: rgba(5,10,20,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.1rem; }
.nav-logo span { color: var(--blue); }
.nav-links { display: flex; gap: 30px; list-style: none; align-items: center; }
.nav-links a { color: var(--muted); font-size: .85rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--white); }
.nav-cta { padding: 8px 20px; border: 1px solid var(--blue); color: var(--blue) !important; border-radius: 8px; }
.nav-cta:hover { background: var(--blue); color: #fff !important; }

/* ─── ELEMENTY WSPÓLNE ─────────────────────────────────────── */
.label {
  display: inline-block;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue);
  background: rgba(0,102,255,.1);
  border: 1px solid var(--border-blue);
  padding: 5px 14px; border-radius: 99px;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .9rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 0 24px rgba(0,102,255,.4); }
.btn-primary:hover { background: #1a7aff; box-shadow: 0 0 36px rgba(0,102,255,.65); transform: translateY(-2px); }
.btn-secondary { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.2); }
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); background: rgba(0,102,255,.08); transform: translateY(-2px); }

/* ─── HERO ─────────────────────────────────────────────────── */
.hero { padding: 150px 0 60px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); margin-bottom: 18px; }
.hero .lede { font-size: 1.06rem; max-width: 660px; margin: 0 auto; }
.hero .lede strong { color: var(--white); font-weight: 600; }

/* ─── FILTRY ───────────────────────────────────────────────── */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin: 40px 0 44px;
}
.filter {
  padding: 9px 20px; border-radius: 99px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border);
  font-family: 'Space Grotesk', sans-serif;
  font-size: .84rem; font-weight: 600;
  cursor: pointer; transition: all .22s ease;
}
.filter:hover { color: var(--white); border-color: rgba(255,255,255,.24); }
.filter.on { background: rgba(0,102,255,.14); border-color: var(--blue); color: var(--white); }
.filter .count { color: var(--dim); font-weight: 500; margin-left: 6px; }
.filter.on .count { color: rgba(255,255,255,.6); }

/* ─── SIATKA AGENTÓW ───────────────────────────────────────── */
.agents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
  padding-bottom: 40px;
}
.agent-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  text-align: left;
  cursor: pointer;
  transition: border-color .25s, transform .25s, box-shadow .25s, opacity .3s;
}
.agent-card:hover {
  border-color: var(--border-blue);
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(0,102,255,.14);
}
.agent-card[hidden] { display: none; }
.agent-card.flag::after {
  content: '';
  position: absolute; inset: -1px;
  border-radius: var(--radius);
  border: 1px solid rgba(0,102,255,.45);
  pointer-events: none;
}

.agent-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.agent-icon {
  flex: none;
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(0,102,255,.12);
  border: 1px solid var(--border-blue);
  color: var(--blue);
}
.agent-icon svg { width: 22px; height: 22px; }
.agent-cat {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim);
}
.agent-card h3 { font-size: 1.16rem; margin-top: 2px; }
.agent-pain {
  font-size: .92rem; color: var(--muted);
  margin-bottom: 18px; flex: 1;
}
.agent-pain strong { color: rgba(255,255,255,.9); font-weight: 600; }

.agent-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.agent-play {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--blue); font-size: .85rem; font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  background: none; border: none; cursor: pointer; padding: 0;
}
.agent-play svg { width: 15px; height: 15px; }
.agent-more { font-size: .82rem; color: var(--dim); transition: color .2s; }
.agent-card:hover .agent-more { color: var(--muted); }

.proof {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ok);
  background: rgba(47,217,138,.1);
  border: 1px solid rgba(47,217,138,.28);
  padding: 3px 10px; border-radius: 99px;
  margin-bottom: 14px;
}

/* ─── PANEL DEMO (modal na katalogu, sekcja na podstronie) ─── */
.demo-overlay {
  position: fixed; inset: 0; z-index: 900;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(8px);
}
.demo-overlay.open { display: flex; }

.demo {
  position: relative;
  width: 100%; max-width: 720px;
  max-height: 92vh; overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border-blue);
  border-radius: 22px;
  box-shadow: 0 0 90px rgba(0,102,255,.18), 0 32px 64px rgba(0,0,0,.6);
}
.demo-inline {
  max-width: 920px; margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border-blue);
  border-radius: 22px;
  overflow: hidden;
}

.demo-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--border);
}
.demo-head h2, .demo-head h3 { font-size: 1.25rem; }
.demo-head p { font-size: .88rem; margin-top: 4px; }
.demo-close {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.07); border: none; color: #fff;
  font-size: 19px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.demo-close:hover { background: rgba(255,255,255,.14); }

.demo-note {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 28px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
  font-size: .74rem; color: var(--dim);
  letter-spacing: .02em;
}
.demo-note b { color: var(--muted); font-weight: 600; }

.demo-body { padding: 22px 28px 26px; }

/* ─── SCHEMAT WĘZŁOWY ──────────────────────────────────────── */
.graph-wrap {
  margin: 2px 0 26px;
  padding: 14px 12px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.015);
  border: 1px solid rgba(255,255,255,.05);
}
.graph { display: block; width: 100%; height: auto; overflow: visible; }

.gstart {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px; font-weight: 700;
  letter-spacing: .18em;
  fill: rgba(0,102,255,.75);
}

/* węzeł */
.gbody {
  fill: #0A1428;
  stroke: rgba(255,255,255,.09);
  stroke-width: 1.5;
  transition: stroke .3s ease, fill .3s ease;
}
.gaccent { fill: rgba(255,255,255,.1); transition: fill .3s ease; }
.gbadge { fill: rgba(255,255,255,.05); stroke: rgba(255,255,255,.1); stroke-width: 1.2; transition: all .3s ease; }
.gnum {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px; font-weight: 700;
  fill: rgba(255,255,255,.4);
  transition: fill .3s ease, opacity .25s ease;
}
.gcheck {
  fill: none; stroke: var(--ok); stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transition: opacity .3s ease;
}
.gt {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 600;
  fill: rgba(255,255,255,.5);
  transition: fill .3s ease;
}

.gnode.run .gbody { stroke: var(--blue); fill: #0B1B3A; filter: url(#gl); }
.gnode.run .gaccent { fill: var(--blue); }
.gnode.run .gbadge { fill: rgba(0,102,255,.22); stroke: rgba(0,102,255,.6); }
.gnode.run .gnum { fill: #fff; }
.gnode.run .gt { fill: #fff; }

.gnode.done .gbody { stroke: rgba(47,217,138,.42); }
.gnode.done .gaccent { fill: var(--ok); }
.gnode.done .gbadge { fill: rgba(47,217,138,.14); stroke: rgba(47,217,138,.45); }
.gnode.done .gnum { opacity: 0; }
.gnode.done .gcheck { opacity: 1; }
.gnode.done .gt { fill: rgba(255,255,255,.92); }

/* połączenia */
.gedge-base { fill: none; stroke: rgba(255,255,255,.13); stroke-width: 2; }
.gedge-on { fill: none; stroke: var(--blue); stroke-width: 2.6; stroke-linecap: round; }
.gpulse { fill: #fff; filter: url(#gl); }

/* kafel z wynikiem */
.gres-body {
  fill: rgba(0,102,255,.06);
  stroke: rgba(0,102,255,.2);
  stroke-width: 1.5;
  transition: fill .45s ease, stroke .45s ease;
}
.gres-l {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px; font-weight: 700; letter-spacing: .18em;
  fill: rgba(0,102,255,.7);
  transition: fill .45s ease;
}
.gres-v {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px; font-weight: 700;
  fill: rgba(255,255,255,.28);
  transition: fill .45s ease;
}
.gresult { opacity: .55; transition: opacity .45s ease; }
.gresult.in { opacity: 1; }
.gresult.in .gres-body { fill: rgba(0,102,255,.15); stroke: rgba(0,102,255,.5); }
.gresult.in .gres-l { fill: var(--blue); }
.gresult.in .gres-v { fill: #fff; }

/* Wynik pokazuje schemat — w bloku pod spodem zostaje samo wyjaśnienie.
   Na wąskich ekranach schemat znika, więc zdanie wraca na swoje miejsce. */
.has-graph .result-v { display: none; }

/* kroki */
.steps { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.step {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 11px 0;
  opacity: 0; transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease;
}
.step.in { opacity: 1; transform: none; }
.step + .step { border-top: 1px solid rgba(255,255,255,.05); }

.step-mark {
  flex: none; margin-top: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid rgba(255,255,255,.18);
  color: var(--ok);
}
.step-mark svg { width: 12px; height: 12px; opacity: 0; transition: opacity .25s; }
.step.done .step-mark { border-color: rgba(47,217,138,.5); background: rgba(47,217,138,.12); }
.step.done .step-mark svg { opacity: 1; }
.step.busy .step-mark {
  border-color: rgba(0,102,255,.5);
  border-top-color: var(--blue);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.step-txt { min-width: 0; display: flex; flex-direction: column; }
.step-t {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .98rem; font-weight: 600;
  color: rgba(255,255,255,.55);
  transition: color .3s;
}
.step.done .step-t, .step.busy .step-t { color: var(--white); }
.step-d { font-size: .84rem; color: var(--dim); margin-top: 1px; }

/* wynik */
.result {
  margin-top: 20px; padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,102,255,.14), rgba(0,102,255,.04));
  border: 1px solid var(--border-blue);
  opacity: 0; transform: translateY(8px);
  transition: opacity .4s ease, transform .4s ease;
}
.result.in { opacity: 1; transform: none; }
.result-l {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 6px;
}
.result-v { font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 700; }
.result-s { font-size: .85rem; color: var(--muted); margin-top: 4px; }

.demo-actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.replay {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: .84rem; font-weight: 600;
  padding: 11px 18px; border-radius: 10px; cursor: pointer;
  transition: all .2s;
}
.replay:hover { color: var(--white); border-color: rgba(255,255,255,.24); }
.replay svg { width: 14px; height: 14px; }
.kbd {
  font-family: ui-monospace, monospace; font-size: .7rem;
  border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; color: var(--dim);
}

/* ─── PODSTRONA AGENTA ─────────────────────────────────────── */
.crumbs { font-size: .8rem; color: var(--dim); padding-top: 110px; }
.crumbs a:hover { color: var(--muted); }
.crumbs span { margin: 0 8px; }

.agent-hero { padding: 26px 0 50px; }
.agent-hero h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); margin-bottom: 16px; max-width: 800px; }
.agent-hero .lede { font-size: 1.08rem; max-width: 700px; margin-bottom: 28px; }
.agent-hero .btns { display: flex; flex-wrap: wrap; gap: 12px; }

.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 12px; }
.section > .shell > p { max-width: 720px; }
.section p + p { margin-top: 14px; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; margin-top: 28px; }
.box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.box h3 { font-size: 1.02rem; margin-bottom: 12px; }
.box ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.box li { position: relative; padding-left: 22px; font-size: .92rem; color: var(--muted); }
.box li::before {
  content: ''; position: absolute; left: 4px; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--blue);
}
.box.limits li::before { background: rgba(255,255,255,.22); }
.box.limits { border-color: rgba(255,255,255,.06); background: rgba(255,255,255,.015); }

.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item h3 { font-size: 1rem; margin-bottom: 8px; }
.faq-item p { font-size: .93rem; }

.cta-band {
  margin: 70px auto 90px;
  max-width: 820px;
  text-align: center;
  background: linear-gradient(135deg, rgba(0,102,255,.14), rgba(0,102,255,.03));
  border: 1px solid var(--border-blue);
  border-radius: 22px;
  padding: 44px 28px;
}
.cta-band h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 12px; }
.cta-band p { max-width: 520px; margin: 0 auto 24px; }

.foot {
  border-top: 1px solid var(--border);
  padding: 30px 24px; text-align: center;
  color: var(--dim); font-size: .82rem;
}
.foot a { color: var(--blue); }

/* ─── TRYB PREZENTACJI (?tv=1) — pod nagranie ekranu ────────
   Węższa kolumna mieści się w kadrze pionowym 9:16,
   większa typografia jest czytelna na telefonie.
   ───────────────────────────────────────────────────────── */
html.tv { --scale: 1.22; --shell: 780px; }
html.tv .nav { display: none; }
html.tv .hero { padding-top: 56px; }
html.tv .crumbs { padding-top: 56px; }
html.tv .agents { grid-template-columns: 1fr; gap: 16px; }
html.tv .demo { max-width: 760px; }
html.tv .tv-hide { display: none !important; }
html.tv .step { padding: 14px 0; }
html.tv .filters { margin-top: 28px; }
/* w nagraniu animacje wejścia klatkują — zostaje tylko demo */
html.tv .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }

.tv-flag {
  position: fixed; bottom: 14px; left: 14px; z-index: 999;
  display: none;
  font-family: ui-monospace, monospace; font-size: .66rem;
  color: var(--dim); background: rgba(0,0,0,.5);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 9px;
}
html.tv .tv-flag { display: block; }

/* ─── ANIMACJA WEJŚCIA ─────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.on { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .step, .result { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ─── RESPONSYWNOŚĆ ────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav { padding: 0 20px; }
  .nav-links li:not(:last-child) { display: none; }
}
@media (max-width: 620px) {
  .shell { padding: 0 18px; }
  .hero { padding: 120px 0 40px; }
  .agents { grid-template-columns: 1fr; }
  .demo-head, .demo-note, .demo-body { padding-left: 20px; padding-right: 20px; }
  .agent-hero .btns .btn { width: 100%; }
}

/* Poniżej tej szerokości etykiety w węzłach robią się nieczytelne —
   schemat ustępuje liście kroków, która niesie tę samą treść. */
@media (max-width: 560px) {
  .graph-wrap { display: none; }
  .has-graph .result-v { display: block; }
}
