/* ============================================================
   Szkoła AI — dark engineering aesthetic
   tło var(--sa-bg,#070a0f) · akcent var(--sa-acc,#34e2a0) · mobile-first
   ============================================================ */

:root {
  --bg: var(--sa-bg,#070a0f);
  --bg-soft: var(--sa-bg2,#0b0f17);
  --panel: var(--sa-surface,#111826);
  --line: var(--sa-surface2,#1e2940);
  --text: var(--sa-txt,#e8edf4);
  --dim: var(--sa-muted,#8b96a8);
  --accent: var(--sa-acc,#34e2a0);
  --accent-soft: rgba(var(--sa-acc-rgb,52,226,160), 0.12);
  --green: #3ddc84;
  --red: #ff5f56;
  --maxw: 1080px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.dim { color: var(--dim); }
.center { text-align: center; }

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

a { color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin-bottom: 0.5rem; }

.kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.lead { color: var(--dim); font-size: 1.05rem; max-width: 46rem; margin-bottom: 2rem; }
.lead strong { color: var(--text); }

.section { padding: 5rem 0; }
.section:nth-of-type(even) { background: var(--bg-soft); }

/* ---------------- progress track ---------------- */
.progress-track {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.progress-bar {
  height: 3px;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  list-style: none;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
}

.progress-steps a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--dim);
  text-decoration: none;
  font-size: 0.78rem;
  font-family: var(--mono);
}

.progress-steps .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--line);
  flex: 0 0 auto;
  transition: background 0.3s;
}

.progress-steps a.is-done .dot,
.progress-steps a.is-active .dot { background: var(--accent); }
.progress-steps a.is-active { color: var(--accent); }

@media (max-width: 640px) {
  .progress-steps .lbl { display: none; }
  .progress-steps { justify-content: space-around; }
}

/* ---------------- HERO ---------------- */
.hero {
  min-height: calc(100vh - 42px);
  display: flex;
  align-items: center;
  padding: 4rem 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(var(--sa-acc-rgb,52,226,160), 0.07), transparent),
    var(--bg);
  text-align: center;
}

.hero .container { width: 100%; }

.hero-h1 { font-size: clamp(2.2rem, 6vw, 4rem); margin: 2.5rem 0 1rem; }

.hero-sub { color: var(--dim); font-size: clamp(1rem, 2.5vw, 1.25rem); margin-bottom: 2.5rem; }

/* terminal window */
.terminal, .appwin {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
}

.hero-terminal { max-width: 560px; margin: 0 auto; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }

.terminal-bar, .appwin-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--sa-surface2,#161c27);
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.9rem;
}

.t-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.t-dot.red { background: #ff5f56; }
.t-dot.yellow { background: #ffbd2e; }
.t-dot.green { background: #27c93f; }
.t-title { margin-left: 0.6rem; color: var(--dim); font-size: 0.75rem; font-family: var(--mono); }

.terminal-body {
  padding: 1.1rem 1.2rem;
  min-height: 4.6rem;
  font-size: 0.95rem;
  color: var(--text);
}

.tw-line { white-space: pre-wrap; }

.cursor {
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* CTA */
.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--sa-bg,#070a0f);
  font-weight: 700;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--accent);
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(var(--sa-acc-rgb,52,226,160),0.3); }

.cta-ghost {
  background: transparent;
  color: var(--accent);
}

/* ---------------- cards / pillars ---------------- */
.cards-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 760px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.6rem;
}

.card-tag { color: var(--accent); font-size: 0.85rem; margin-bottom: 0.6rem; }
.card p { color: var(--dim); font-size: 0.95rem; }
.card h3 { font-size: 1.2rem; }

/* ---------------- prompt compare ---------------- */
.prompt-compare {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
}

.pc-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.pc-toggle { display: flex; gap: 0.5rem; }

.pc-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.pc-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.pc-pane.is-hidden { display: none; }

.pc-note { margin-top: 1rem; color: var(--red); font-size: 0.9rem; }
.pc-note.good { color: var(--green); }

/* chat bubbles */
.chat { display: flex; flex-direction: column; gap: 0.8rem; }

.bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.bubble.user {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid rgba(var(--sa-acc-rgb,52,226,160), 0.35);
  border-bottom-right-radius: 3px;
  color: var(--text);
}

.bubble.ai {
  align-self: flex-start;
  background: var(--sa-surface,#1a2230);
  border: 1px solid var(--line);
  border-bottom-left-radius: 3px;
  color: var(--text);
}

.bubble em { color: var(--dim); font-size: 0.85em; }

/* ---------------- tools grid ---------------- */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  margin-bottom: 4rem;
}

@media (min-width: 980px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }

.appwin-body { padding: 1rem; }

.appwin .chat .bubble { font-size: 0.82rem; max-width: 95%; }

.code-body { font-size: 0.8rem; line-height: 1.7; }

.code-line { white-space: pre-wrap; }
.code-line.del { color: #ff6b6b; background: rgba(255, 95, 86, 0.08); }
.code-line.add { color: var(--green); background: rgba(61, 220, 132, 0.07); }
.code-line.ok { color: var(--green); margin-top: 0.4rem; }
.code-line.dim { color: var(--dim); }

.src-list { list-style: none; font-size: 0.82rem; display: flex; flex-direction: column; gap: 0.45rem; }
.src-list li { background: var(--sa-surface,#1a2230); border: 1px solid var(--line); padding: 0.45rem 0.7rem; border-radius: 6px; }

.src-arrow { text-align: center; color: var(--accent); font-size: 1.3rem; padding: 0.4rem 0; }

.quiz-box {
  background: var(--sa-surface,#1a2230);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
}

.quiz-tag { color: var(--accent); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 0.4rem; }

/* ---------------- proofs ---------------- */
.proofs h3 { margin-bottom: 0.5rem; }

.proof-videos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin: 2rem 0 3rem;
}

@media (min-width: 760px) { .proof-videos { grid-template-columns: repeat(3, 1fr); } }

.video-ph .vp-frame {
  aspect-ratio: 16 / 9;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--accent);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.video-ph figcaption { color: var(--dim); font-size: 0.8rem; margin-top: 0.5rem; text-align: center; }

.exercises h4 { font-size: 1.15rem; margin-bottom: 0.3rem; }

.ex-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin-top: 1.4rem;
}

@media (min-width: 980px) { .ex-grid { grid-template-columns: repeat(3, 1fr); } }

.ex-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ex-module { color: var(--dim); font-size: 0.72rem; }
.ex-card h5 { font-size: 1.02rem; }
.ex-goal { color: var(--dim); font-size: 0.88rem; }

.ex-prompt {
  background: var(--sa-bg2,#0c1118);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--green);
  white-space: pre-wrap;
  margin-top: auto;
}

.ex-source { color: var(--dim); font-size: 0.72rem; margin-top: 1rem; }

/* ---------------- army diagram (responsywny przepływ z pętlą) ---------------- */
.army-wrap { margin-bottom: 4rem; }

.army-flow { position: relative; max-width: 660px; margin: 0 auto 0.6rem; padding: 6px 0 10px; }
.af-row { display: flex; align-items: flex-start; justify-content: center; gap: 0; flex-wrap: nowrap; }
.af-step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 auto; }
.af-node { min-width: 98px; padding: 15px 10px; background: var(--sa-surface,#111826); border: 1px solid var(--sa-surface2,#1e2940); border-radius: 10px; color: var(--sa-txt,#e8edf4); font: 700 18px/1 ui-monospace, Menlo, Consolas, monospace; text-align: center; }
.af-cap { color: var(--sa-acc,#34e2a0); font: 14px/1 ui-monospace, Menlo, Consolas, monospace; }
.af-arrow { position: relative; flex: 1 1 44px; min-width: 36px; height: 2px; margin: 26px 6px 0; background: linear-gradient(90deg, #3a2a18, var(--sa-acc,#34e2a0)); border-radius: 2px; }
.af-arrow::after { content: ''; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--sa-acc,#34e2a0); }
.af-run { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--sa-acc-tint,#a7f3d6); box-shadow: 0 0 9px var(--sa-acc,#34e2a0); animation: af-run-h 1.6s linear infinite; }
@keyframes af-run-h { 0% { left: 0; opacity: 0 } 12% { opacity: 1 } 88% { opacity: 1 } 100% { left: 100%; opacity: 0 } }
/* pętla zwrotna: linia pod rzędem, biegnie w prawo→lewo (weryfikuje → research) */
.af-loop { position: relative; height: 30px; max-width: 540px; margin: 12px auto 0; border: 2px solid rgba(var(--sa-acc-rgb,52,226,160),.7); border-top: none; border-radius: 0 0 16px 16px; }
.af-loop::after { content: ''; position: absolute; left: -2px; top: -2px; border: 6px solid transparent; border-bottom-color: var(--sa-acc,#34e2a0); }
.af-loop-run { position: absolute; bottom: -4px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--sa-acc-tint,#a7f3d6); box-shadow: 0 0 9px var(--sa-acc,#34e2a0); animation: af-loop-h 2.6s linear infinite; }
@keyframes af-loop-h { 0% { right: 8px; opacity: 0 } 12% { opacity: 1 } 88% { opacity: 1 } 100% { right: calc(100% - 14px); opacity: 0 } }
.af-loop-cap { position: absolute; left: 50%; transform: translateX(-50%); top: 6px; color: var(--sa-muted,#94a3b8); font: 12px/1 ui-monospace, Menlo, Consolas, monospace; background: var(--sa-bg,#070a0f); padding: 0 8px; white-space: nowrap; }
.army-flow.loop-back .af-loop { box-shadow: 0 6px 22px -8px rgba(var(--sa-acc-rgb,52,226,160),.6); }
.army-flow.loop-back .af-loop-run { animation-duration: 1.1s; }

@media (max-width: 760px) {
  .army-flow { padding-left: 34px; }
  .af-row { flex-direction: column; align-items: center; gap: 0; }
  .af-arrow { width: 2px; height: 36px; min-width: 0; flex: 0 0 36px; margin: 8px 0; background: linear-gradient(180deg, #3a2a18, var(--sa-acc,#34e2a0)); }
  .af-arrow::after { right: auto; top: auto; left: -4px; bottom: -2px; border: 5px solid transparent; border-top-color: var(--sa-acc,#34e2a0); }
  .af-run { top: 0; left: -3px; animation: af-run-v 1.6s linear infinite; }
  @keyframes af-run-v { 0% { top: 0; opacity: 0 } 12% { opacity: 1 } 88% { opacity: 1 } 100% { top: 100%; opacity: 0 } }
  /* pętla zwrotna na mobile: pionowa linia z lewej, biegnie dół→góra (↑) */
  .af-loop { position: absolute; left: 8px; top: 12px; bottom: 28px; height: auto; width: 20px; max-width: none; margin: 0; border: 2px solid rgba(var(--sa-acc-rgb,52,226,160),.7); border-right: none; border-radius: 16px 0 0 16px; }
  .af-loop::after { left: auto; right: -2px; top: -2px; border: 6px solid transparent; border-bottom-color: var(--sa-acc,#34e2a0); }
  .af-loop-run { right: auto; left: -4px; bottom: 8px; animation: af-loop-v 2.6s linear infinite; }
  @keyframes af-loop-v { 0% { bottom: 8px; opacity: 0 } 12% { opacity: 1 } 88% { opacity: 1 } 100% { bottom: calc(100% - 14px); opacity: 0 } }
  .af-loop-cap { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .af-run, .af-loop-run { animation: none; opacity: .85; }
}

/* ---------------- journal ---------------- */
.journal { margin-bottom: 2.5rem; text-align: center; }

.journal-steps {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 560px;
  margin: 0 auto;
}

.j-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
}

.j-ico { color: var(--accent); font-size: 0.85rem; padding-top: 0; flex: 0 0 auto; }
.j-step h4 { font-size: 1rem; margin-bottom: 0.2rem; }
.j-step p { color: var(--dim); font-size: 0.88rem; }

.j-arrow { text-align: center; color: var(--accent); font-size: 1.1rem; line-height: 1.4; }

.mention { color: var(--dim); font-size: 0.95rem; text-align: center; }
.mention .mono { font-size: 0.85rem; }

/* ---------------- demo ---------------- */
/* sekcja demo — intro (kicker/h2/lead) wyśrodkowane; sam czat zostaje po lewej */
#demo .container { text-align: center; }

.demo-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.4rem;
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

.demo-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
}

.badge.offline { color: var(--accent); border-color: rgba(var(--sa-acc-rgb,52,226,160),0.4); background: var(--accent-soft); }
.badge.live { color: var(--green); border-color: rgba(61,220,132,0.4); background: rgba(61,220,132,0.08); }

.limit { color: var(--dim); font-size: 0.75rem; }

.demo-chat {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 200px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--sa-bg2,#0c1118);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.demo-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }

.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.82rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--mono);
}

.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }
.chip.is-used { opacity: 0.35; text-decoration: line-through; cursor: not-allowed; }
.chip.is-used::after { content: " ✓"; text-decoration: none; }

.demo-input { display: flex; gap: 0.6rem; }

.demo-input input {
  flex: 1;
  background: var(--sa-bg2,#0c1118);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  font-family: var(--sans);
}

.demo-input input:focus { outline: none; border-color: var(--accent); }

.demo-input .cta { padding: 0.7rem 1.1rem; font-size: 0.9rem; white-space: nowrap; }

@media (max-width: 560px) {
  .demo-input { flex-direction: column; }
}

/* ---------------- ladder ---------------- */
.ladder {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 760px) {
  .ladder { flex-direction: row; align-items: center; }
  .ladder .rung { flex: 1; }
}

.rung {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem;
}

.rung-no { color: var(--accent); font-size: 1.1rem; display: block; margin-bottom: 0.4rem; }
.rung h4 { margin-bottom: 0.3rem; }
.rung p { color: var(--dim); font-size: 0.88rem; }

.rung-link { color: var(--accent); text-align: center; font-size: 1.4rem; padding: 0 0.6rem; }

@media (max-width: 759px) { .rung-link { transform: rotate(90deg); } }

/* ---------------- pricing ---------------- */
.pricing {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

@media (min-width: 760px) { .pricing { grid-template-columns: repeat(3, 1fr); } }

.price-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.8rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.price-card.featured { border-color: var(--accent); box-shadow: 0 0 40px rgba(var(--sa-acc-rgb,52,226,160),0.1); }

.price-soon {
  color: var(--accent);
  border: 1px dashed rgba(var(--sa-acc-rgb,52,226,160),0.4);
  border-radius: 6px;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.price-card ul { list-style: none; color: var(--dim); font-size: 0.92rem; display: flex; flex-direction: column; gap: 0.4rem; }
.price-card li::before { content: "— "; color: var(--accent); }
.price-card .cta { text-align: center; margin-top: auto; }

/* ---------------- FAQ ---------------- */
/* FAQ — cała sekcja wyśrodkowana (nagłówek + pytania + odpowiedzi + marker) */
#faq .container { text-align: center; }

.faq-list { max-width: 720px; display: flex; flex-direction: column; gap: 0.7rem; margin: 1.5rem auto 0; }

.faq-list details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.3rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1.2rem;
}

.faq-list details[open] summary::after { content: "–"; }

.faq-list details p { color: var(--dim); margin-top: 0.7rem; font-size: 0.95rem; }

/* ---------------- footer ---------------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  text-align: center;
  color: var(--dim);
  font-size: 0.85rem;
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cursor { animation: none; }
}

/* ============ Strefa kursanta (LMS :9912) ============ */
.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-lms-link {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  padding: 0.5rem 1.1rem;
}
