:root {
  --bg-header: #f1f1f1;
  --bg-field: #d1dbbd;
  --accent-green: #b0d872;
  --dark-green: #395244;
  --line-gray: #8b8c88;
  --text-body: #2e2a2c;
  --white: #ffffff;

  --font-display: "BW Gradual", "Plus Jakarta Sans", sans-serif;
  --font-body: "Plus Jakarta Sans", sans-serif;

  --stage-h: 460px;
  --footer-h: 230px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--text-body);
  background: #fafaf8;
}

img { display: block; max-width: 100%; }
button { font: inherit; }

/* ---------- Widget shell ---------- */

.pk-widget {
  position: relative;
  background: var(--bg-header);
  height: calc(var(--stage-h) + var(--footer-h));
  max-width: 1100px;
  margin: 0 auto;
}

/* ---------- Tree, shown only on the last slide ---------- */

.pk-deco-tree {
  position: absolute;
  pointer-events: none;
  right: -30px;
  top: 0;
  bottom: 0;
  height: 100%;
  width: auto;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.pk-deco-tree.is-visible { opacity: 0.95; }

/* ---------- Stage (gray, top 2/3) ---------- */

.pk-stage {
  position: relative;
  z-index: 3;
  height: var(--stage-h);
  overflow: hidden;
}

.pk-viewport { overflow: hidden; width: 100%; height: 100%; }

.pk-track {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.pk-slide {
  width: 33.3333%;
  height: 100%;
  flex-shrink: 0;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
}

.pk-slide-inner {
  max-width: 950px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.pk-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px dashed rgba(57, 82, 68, 0.35);
}

.pk-icon { width: 52px; height: 52px; flex-shrink: 0; }
.pk-icon img { width: 100%; height: 100%; }

.pk-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pk-meta h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.25;
  color: var(--dark-green);
  margin: 0;
}

.pk-sub {
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--line-gray);
  margin: 0.2rem 0 0;
}

.pk-text h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 2.4vw, 1.65rem);
  color: var(--dark-green);
  margin: 0 0 0.75rem;
  max-width: 26ch;
}

.pk-text p {
  font-size: 1rem;
  line-height: 1.65;
  max-width: 52ch;
  margin: 0 0 1.25rem;
}

.pk-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}

.pk-badges li {
  background: var(--accent-green);
  color: var(--dark-green);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
}

.pk-illustration { display: flex; justify-content: center; align-items: center; height: 100%; }
.pk-illustration img {
  max-height: 260px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* ---------- Controls ---------- */

/* ---------- Footer bar (green, bottom 1/3) ---------- */

.pk-footer-bar {
  position: relative;
  z-index: 1;
  height: var(--footer-h);
  background: var(--bg-field);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.pk-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0 1.5rem 1.75rem;
}

.pk-arrow {
  background: var(--dark-green);
  color: var(--white);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.pk-arrow:hover { opacity: 0.85; }
.pk-arrow svg { width: 20px; height: 20px; }

.pk-connector {
  width: 220px;
  max-width: 45%;
  height: auto;
  overflow: visible;
}

.pk-connector-base {
  fill: none;
  stroke: var(--line-gray);
  stroke-width: 2;
  stroke-dasharray: 2 6;
  stroke-linecap: round;
}

.pk-connector-progress {
  fill: none;
  stroke: var(--dark-green);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.pk-node {
  fill: var(--bg-field);
  stroke: var(--dark-green);
  stroke-width: 2;
  cursor: pointer;
  transition: fill 0.3s ease;
}

.pk-node.is-active { fill: var(--dark-green); }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  :root {
    --stage-h: 620px;
    --footer-h: 180px;
  }
  .pk-slide-inner {
    grid-template-columns: 1fr;
  }
  .pk-illustration { order: -1; }
  .pk-illustration img { max-height: 180px; }
  .pk-connector { width: 160px; }
  .pk-deco-tree { right: -20px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .pk-track { transition: none; }
  .pk-connector-progress { transition: none; }
}
