:root {
  --bg: #ffffff;
  --surface: #f3f7ff;
  --card: #ffffff;
  --ink: #0b1b3f;
  --muted: #4a5a7d;
  --border: #e1e9f7;
  --accent: #1d5bff;
  --accent-fill: #1d5bff;
  --accent-soft: #e8efff;
  --navy: #0a1c4a;
  --ink-rgb: 11, 27, 63;
  --accent-rgb: 29, 91, 255;
}

html[data-theme="dark"] {
  --bg: #071022;
  --surface: #0a1530;
  --card: #0e1c3f;
  --ink: #f1f5ff;
  --muted: #aab8d8;
  --border: #1f2f5a;
  --accent: #4a86ff;
  --accent-fill: #2d62e8;
  --accent-soft: #14275a;
  --navy: #0a1c4a;
  --ink-rgb: 255, 255, 255;
  --accent-rgb: 74, 134, 255;
}

.pg-knowledge {
  --pk-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --pk-maxw: 1080px;
  --pk-gutter: clamp(20px, 6vw, 56px);
  --pk-radius: 22px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--pk-font);
  font-size: clamp(15px, 0.55vw + 13.6px, 17px);
  line-height: 1.55;
  padding-top: 100px;
  padding-bottom: clamp(48px, 8vw, 96px);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(.pg-knowledge) *,
:where(.pg-knowledge) *::before,
:where(.pg-knowledge) *::after { box-sizing: border-box; }

:where(.pg-knowledge) p { margin: 0; }
:where(.pg-knowledge) h1,
:where(.pg-knowledge) h2,
:where(.pg-knowledge) h3 { margin: 0; font-weight: 500; }
:where(.pg-knowledge) ul { margin: 0; padding: 0; list-style: none; }
:where(.pg-knowledge) svg { display: block; }

:where(.pg-knowledge) a:focus-visible,
:where(.pg-knowledge) button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.pg-wrap {
  width: 100%;
  max-width: var(--pk-maxw);
  margin-inline: auto;
  padding-inline: var(--pk-gutter);
}

.pk-section { padding-block: clamp(56px, 8vw, 116px); }

.pk-overline {
  font-family: var(--pk-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.pk-h1 {
  font-size: clamp(2.25rem, 5.4vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.05;
}

.pk-h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.45rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.pk-h3 {
  font-size: clamp(1.12rem, 1.5vw, 1.38rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.pk-lede {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  line-height: 1.6;
}

.pk-crumb {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-family: var(--pk-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.pk-crumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.pk-crumb a:hover,
.pk-crumb a:focus-visible { color: var(--accent); border-bottom-color: currentColor; }
.pk-crumb span[aria-current="page"] { color: var(--ink); }

.pk-hero {
  text-align: center;
  padding-top: clamp(8px, 2vw, 32px);
  padding-bottom: clamp(40px, 6vw, 84px);
}
.pk-hero__inner {
  max-width: 860px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.pk-hero .pk-h1 { max-width: 15ch; }
.pk-hero .pk-lede { max-width: 56ch; }

.pk-sample {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.pk-searchbar {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100%, 620px);
  padding: 18px 24px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 22px 55px rgba(var(--ink-rgb), 0.09);
  text-align: left;
}
.pk-searchbar__icon { flex: none; width: 21px; height: 21px; color: var(--accent); }
.pk-searchbar__q {
  flex: 1;
  min-width: 0;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pk-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--accent);
  animation: pk-blink 1.05s steps(1, end) infinite;
}
@keyframes pk-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

.pk-answer {
  width: min(100%, 620px);
  margin-top: 6px;
  padding: 22px 24px 20px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--pk-radius);
  box-shadow: 0 16px 44px rgba(var(--ink-rgb), 0.06);
}
.pk-answer__head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}
.pk-answer__seal { flex: none; width: 30px; height: 30px; color: var(--accent); }
.pk-answer__note { color: var(--ink); font-size: 0.98rem; }
.pk-answer__rule {
  height: 1px;
  margin: 18px 0 16px;
  background: var(--border);
}
.pk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.pk-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.2;
}
.pk-chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.pk-problem,
.pk-seal { background: var(--surface); }

.pk-problem__head,
.pk-build__head,
.pk-steps__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  margin-bottom: clamp(34px, 5vw, 56px);
}

.pk-docs {
  position: relative;
  height: clamp(170px, 24vw, 232px);
  max-width: 820px;
  margin: 0 auto clamp(30px, 4vw, 46px);
  border-radius: var(--pk-radius);
  background-image:
    linear-gradient(rgba(var(--ink-rgb), 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--ink-rgb), 0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  background-position: center;
  overflow: hidden;
}
.pk-doc {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 46px;
  height: 58px;
  border-radius: 9px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(var(--ink-rgb), 0.08);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  transition: left 0.75s cubic-bezier(0.2, 0.72, 0.2, 1),
              top 0.75s cubic-bezier(0.2, 0.72, 0.2, 1),
              transform 0.75s cubic-bezier(0.2, 0.72, 0.2, 1);
}
.pk-doc::before,
.pk-doc::after {
  content: "";
  position: absolute;
  left: 11px;
  height: 2px;
  border-radius: 2px;
  background: rgba(var(--ink-rgb), 0.2);
}
.pk-doc::before { top: 16px; right: 11px; }
.pk-doc::after { top: 26px; right: 20px; }
.pk-docs.is-gathered .pk-doc {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translate(var(--sx, 0), var(--sy, 0)) rotate(0deg);
}

.pk-lines {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}
.pk-lines li {
  padding-block: clamp(16px, 2.4vw, 24px);
  font-size: clamp(1.08rem, 1.8vw, 1.4rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.4;
  border-top: 1px solid var(--border);
}
.pk-lines li:last-child { border-bottom: 1px solid var(--border); }

.pk-rows {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vw, 52px);
}
.pk-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.pk-row__text { max-width: 44ch; }
.pk-row__text .pk-h3 { margin-bottom: 10px; }
.pk-row__text p { color: var(--muted); }
.pk-row:nth-child(even) .pk-row__text { order: 2; }
.pk-row:nth-child(even) .pk-row__art { order: 1; }

.pk-vig {
  position: relative;
  min-height: 210px;
  padding: 26px;
  border-radius: var(--pk-radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 18px 44px rgba(var(--ink-rgb), 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.pk-vig::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 100% 0%, rgba(var(--accent-rgb), 0.09), transparent 58%);
  pointer-events: none;
}
.pk-vig__bubble {
  border-radius: 14px 14px 14px 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.pk-vig__line { height: 9px; border-radius: 5px; background: rgba(var(--ink-rgb), 0.16); }
.pk-vig__line--a { width: 84%; }
.pk-vig__line--b { width: 62%; }
.pk-vig__source {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-family: var(--pk-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.pk-vig__source svg { width: 15px; height: 15px; color: var(--accent); flex: none; }

.pk-vig__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.9rem;
}
.pk-vig__row svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.pk-vig__row--dim { opacity: 0.62; }

.pk-vig--lock { align-items: stretch; }
.pk-vig__lockhead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}
.pk-vig__lockhead svg { width: 26px; height: 26px; color: var(--accent); }
.pk-vig__lockhead span {
  height: 10px;
  border-radius: 5px;
  background: rgba(var(--ink-rgb), 0.16);
  flex: 1;
}

.pk-vig--reuse { justify-content: center; align-items: center; }
.pk-stack { position: relative; width: 150px; height: 118px; }
.pk-stack span {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.pk-stack span:nth-child(1) { transform: translateY(0) rotate(-4deg); }
.pk-stack span:nth-child(2) { transform: translateY(12px) rotate(2deg); }
.pk-stack span:nth-child(3) {
  transform: translateY(24px) rotate(-1deg);
  background: var(--card);
  box-shadow: 0 14px 30px rgba(var(--ink-rgb), 0.1);
}
.pk-vig__reuse-icon {
  position: absolute;
  right: 22px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.pk-vig__reuse-icon svg { width: 20px; height: 20px; }

.pk-chat {
  max-width: 720px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pk-bubble {
  max-width: 84%;
  align-self: flex-start;
  padding: 18px 22px;
  border-radius: 20px 20px 20px 7px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(var(--ink-rgb), 0.05);
}
.pk-bubble:nth-child(even) {
  align-self: flex-end;
  border-radius: 20px 20px 7px 20px;
  background: var(--surface);
}
.pk-bubble__who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--pk-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.pk-bubble__who::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pk-bubble p { margin-top: 9px; color: var(--ink); }

.pk-seal__inner {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.pk-seal__badge {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 16px 38px rgba(var(--ink-rgb), 0.08);
  color: var(--accent);
}
.pk-seal__badge svg { width: 36px; height: 36px; }
.pk-seal__label {
  font-family: var(--pk-mono);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.pk-seal__statement {
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.pk-seal__outcome { color: var(--muted); max-width: 46ch; }

.pk-related__head { text-align: center; margin-bottom: clamp(28px, 4vw, 44px); }
.pk-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.5vw, 26px);
}
.pk-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  min-height: 168px;
  padding: 26px;
  border-radius: var(--pk-radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.pk-card:hover,
.pk-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 20px 46px rgba(var(--ink-rgb), 0.1);
}
.pk-card__title { font-size: 1.16rem; font-weight: 600; letter-spacing: -0.01em; }
.pk-card__arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--accent);
  transition: transform 0.28s ease;
}
.pk-card__arrow svg { width: 16px; height: 16px; }
.pk-card:hover .pk-card__arrow,
.pk-card:focus-visible .pk-card__arrow { transform: translateX(4px); }

.pk-cta { padding-top: clamp(30px, 5vw, 60px); padding-bottom: clamp(20px, 4vw, 40px); }
.pk-cta__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(100%, 720px);
  margin-inline: auto;
  padding: 16px 16px 16px 26px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 22px 55px rgba(var(--ink-rgb), 0.09);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.28s ease, box-shadow 0.28s ease;
}
.pk-cta__link:hover,
.pk-cta__link:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 26px 60px rgba(var(--accent-rgb), 0.2);
}
.pk-cta__prompt {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  min-width: 0;
}
.pk-cta__prompt svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.pk-cta__btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pk-js .pk-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.72, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.72, 0.2, 1);
}
.pk-js .pk-reveal.is-in { opacity: 1; transform: none; }

.pk-js .pk-chip {
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.72, 0.2, 1);
}
.pk-js .pk-chip.is-in { opacity: 1; transform: none; }

@media (max-width: 920px) {
  .pk-row { grid-template-columns: 1fr; gap: 24px; }
  .pk-row:nth-child(even) .pk-row__text,
  .pk-row:nth-child(even) .pk-row__art { order: initial; }
  .pk-row__text { max-width: 60ch; }
  .pk-cards { grid-template-columns: 1fr; }
  .pk-card { min-height: 0; flex-direction: row; align-items: center; }
  .pk-card__title { flex: 1; }
  .pk-bubble { max-width: 92%; }
}

@media (max-width: 620px) {
  .pg-knowledge { padding-top: 88px; }
  .pk-hero .pk-h1 { max-width: none; }
  .pk-searchbar { padding: 16px 18px; border-radius: 20px; }
  .pk-searchbar__q { white-space: normal; overflow: visible; text-overflow: clip; }
  .pk-answer { padding: 18px 18px 16px; }
  .pk-bubble { max-width: 100%; }
  .pk-chat { gap: 14px; }
  .pk-cta__link {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 20px;
    border-radius: 24px;
  }
  .pk-cta__prompt { justify-content: center; }
  .pk-cta__btn { justify-content: center; width: 100%; }
  .pk-lines li { font-size: 1.06rem; }
}

@media (prefers-reduced-motion: reduce) {
  :where(.pg-knowledge) *,
  :where(.pg-knowledge) *::before,
  :where(.pg-knowledge) *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
