/* ==========================================================================
   Privacy — "nothing leaves your browser"
   The illustration stage is a 540×440 design: inside .privacy__stage, 1em = 10 design px.
   ========================================================================== */

#privacy {
  overflow: hidden;
  background: #fff6cc;
}
.privacy__head { margin-bottom: clamp(24px, 3vw, 36px); }

/* ---------- Illustration ---------- */
/* Centered under the header: exactly in the middle of the section */
.privacy__art {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  container-type: inline-size;
}
.privacy__stage {
  position: relative;
  width: 54em;
  height: 44em;
  font-size: 10px;
  font-size: calc(100cqw / 54);
}
.privacy__box {
  position: absolute;
  left: 0;
  top: 0;
  width: 33em;
  height: 43em;
  overflow: visible;
}
.privacy__shield {
  animation: privacy-float 4s ease-in-out infinite;
}
.privacy__cloud { animation: privacy-cloud 7s ease-in-out infinite; }
.privacy__gear {
  transform-box: fill-box;
  transform-origin: center;
  animation: privacy-spin 12s linear infinite;
}

.privacy__toggles {
  position: absolute;
  left: 36em;
  top: 3em;
  display: grid;
  gap: 1.3em;
}
.privacy__toggle { display: grid; gap: 0.5em; }
.privacy__tlabel {
  font-size: 1.35em;
  font-weight: 800;
  color: var(--navy);
}
.privacy__track {
  --x: 0em;
  --delay: calc(var(--i, 0) * 0.35s + 0.6s);
  position: relative;
  display: block;
  width: 16em;
  height: 5.6em;
  border: 0.28em solid var(--navy);
  border-radius: 3em;
  background: #8a93a8;
  box-shadow: 0.4em 0.4em 0 var(--navy);
  transition: background-color 0.4s var(--delay);
}
.privacy__knob {
  position: absolute;
  left: 0.45em;
  top: 50%;
  display: grid;
  place-items: center;
  width: 4.3em;
  height: 4.3em;
  margin-top: -2.15em;
  border: 0.28em solid var(--navy);
  border-radius: 50%;
  background: #fff;
  transform: translateX(var(--x));
  transition: transform 0.55s var(--ease-spring) var(--delay);
}
/* knob travel = track inner width − 2 × inset − knob width */
.privacy__track { --on: 10.24em; }
.privacy__knob svg { width: 2.4em; height: 2.4em; }

/* Final state is the default (correct without JS): "off" switches grey, "on" switch green. */
.privacy__toggle--on .privacy__track { --x: var(--on); background: var(--green); }
/* With JS, start inverted and flip into place when the illustration scrolls into view. */
.js .privacy__art:not(.is-visible) .privacy__toggle--off .privacy__track { --x: var(--on); background: var(--green); }
.js .privacy__art:not(.is-visible) .privacy__toggle--on .privacy__track { --x: 0em; background: #8a93a8; }

.privacy__spark {
  position: absolute;
  width: 2.6em;
  height: 2.6em;
  background: var(--blue);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: privacy-twinkle 3s ease-in-out infinite;
}
.privacy__spark--a { left: 30em; top: 2em; }
.privacy__spark--b { left: 1em; top: 22em; width: 1.8em; height: 1.8em; background: var(--green); animation-delay: -1.5s; }

/* ---------- Checks + code: two matching cards ---------- */
.privacy__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(20px, 3vw, 32px);
  max-width: 1040px;
  margin: clamp(36px, 4.5vw, 56px) auto 0;
}
.privacy__card {
  display: flex;
  align-items: center;
  padding: clamp(22px, 2.6vw, 30px);
  border: 2px solid var(--navy);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-pop);
}
.privacy__list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.privacy__list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.privacy__list p {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--muted);
}
.privacy__list b { color: var(--navy); }
.privacy__tick {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}
.privacy__tick svg { width: 14px; height: 14px; }

.privacy__code {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border: 2px solid var(--navy);
  border-radius: 18px;
  background: var(--navy);
  box-shadow: var(--shadow-pop);
}
.privacy__code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #8fa0c7;
}
.privacy__dots { display: flex; gap: 6px; }
.privacy__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
}
.privacy__dots i:nth-child(2) { background: var(--yellow); }
.privacy__dots i:nth-child(3) { background: var(--green); }
.privacy__code pre {
  flex: 1;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 18px 20px 20px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #e6ecff;
}
.privacy__code .tk-k { color: var(--blue-300); }
.privacy__code .tk-c { color: #7be3a6; }
.privacy__cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: -0.15em;
  background: var(--yellow);
  animation: sm-blink 1s steps(1) infinite;
}

/* ---------- Keyframes ---------- */
@keyframes privacy-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes privacy-cloud {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(10px); }
}
@keyframes privacy-spin { to { transform: rotate(360deg); } }
@keyframes privacy-twinkle {
  0%, 100% { transform: scale(1) rotate(0); }
  50% { transform: scale(0.6) rotate(45deg); }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .privacy__cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .privacy__code pre { padding: 16px; font-size: 0.78rem; }
  .privacy__title .hl,
  #privacy .hl { white-space: normal; }
}
