/* ============================================================
   WEBVERSE LANDING CHAPTER 08 (Security) & CHAPTER 09 (Finale)
   Scoped strictly under .st .wv-security-* and .st .wv-finale-*
   ============================================================ */

/* ------------------------------------------------------------
   Common & Base Container Styles
   ------------------------------------------------------------ */
.st .wv-security-copy .st-p,
.st .wv-finale-copy .st-p {
  font-size: clamp(15px, 1.2vw, 19px);
  line-height: 1.55;
}

/* ------------------------------------------------------------
   Slide A: Role Matrix
   ------------------------------------------------------------ */
.st .wv-security-matrix-card {
  width: 100%;
  max-width: 620px;
  background: #ffffff;
  color: #17151f;
  border: 2px solid #17151f;
  border-radius: 18px;
  box-shadow: 6px 6px 0 #17151f;
  overflow: hidden;
  margin: 0 auto;
  --md: 12;
}

.st .wv-security-matrix-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #f7f6fb;
  border-bottom: 2px solid #17151f;
}

.st .wv-security-matrix-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 780;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.st .wv-security-matrix-icon {
  font-size: 16px;
  line-height: 1;
}

.st .wv-security-matrix-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  background: #ede9fe;
  border: 1.5px solid #7c3aed;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.st .wv-security-matrix-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 6px;
}

.st .wv-security-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  text-align: center;
}

.st .wv-security-matrix-th {
  padding: 10px 6px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #68647a;
  border-bottom: 1.5px solid #ece9f3;
  white-space: nowrap;
}

.st .wv-security-matrix-th.is-role {
  text-align: left;
  padding-left: 14px;
}

.st .wv-security-matrix-td {
  padding: 10px 6px;
  border-bottom: 1px solid #f1eff7;
  vertical-align: middle;
}

.st .wv-security-matrix-td.is-role {
  text-align: left;
  padding-left: 14px;
  white-space: nowrap;
}

.st .wv-security-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 750;
  font-size: 12px;
  border: 1.5px solid #17151f;
  margin-right: 6px;
}

.st .wv-security-role-badge.is-admin {
  background: #7c3aed;
  color: #ffffff;
}

.st .wv-security-role-badge.is-manager {
  background: #5b8cff;
  color: #ffffff;
}

.st .wv-security-role-badge.is-staff {
  background: #ffd23f;
  color: #17151f;
}

.st .wv-security-role-note {
  display: block;
  font-size: 10.5px;
  color: #7b788c;
  margin-top: 2px;
}

/* Switch Component Driven by Scroll (--dw) */
.st .wv-security-sw {
  position: relative;
  width: 27px;
  height: 16px;
  border-radius: 99px;
  background: #e2e0ea;
  border: 1.5px solid #17151f;
  display: inline-flex;
  align-items: center;
  padding: 1px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.st .wv-security-sw::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #7c3aed;
  opacity: var(--sw-v, 0);
  transition: opacity 0.1s ease;
}

.st .wv-security-sw.is-on {
  --sw-v: 1;
}

.st .wv-security-sw.is-off {
  --sw-v: 0;
}

.st .wv-security-sw.is-on-seq {
  --sw-v: clamp(0, calc((var(--dw) - var(--sw-step, 0)) * 14), 1);
}

.st .wv-security-sw.is-off-seq {
  --sw-v: clamp(0, calc(1 - (var(--dw) - var(--sw-step, 0)) * 14), 1);
}

.st .wv-security-sw-knob {
  position: relative;
  z-index: 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #17151f;
  transform: translate3d(calc(var(--sw-v, 0) * 11px), 0, 0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.st .wv-security-matrix-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 10px 16px;
  background: #fbfafc;
  border-top: 1.5px solid #ece9f3;
  font-size: 11.5px;
  color: #635f75;
}

.st .wv-security-matrix-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.st .wv-security-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #17151f;
}

.st .wv-security-legend-dot.is-active {
  background: #7c3aed;
}

.st .wv-security-legend-dot.is-restricted {
  background: #e2e0ea;
}

/* ------------------------------------------------------------
   Slide B: Isolated Databases
   ------------------------------------------------------------ */
.st .wv-security-db-card {
  width: 100%;
  max-width: 580px;
  background: #151322;
  color: #ffffff;
  border: 2px solid #3b3558;
  border-radius: 18px;
  box-shadow: 6px 6px 0 rgba(14, 14, 18, 0.6);
  padding: 18px 20px 14px;
  margin: 0 auto;
  --md: 14;
}

.st .wv-security-db-svg {
  width: 100%;
  height: auto;
  display: block;
}

.st .wv-security-db-wire {
  stroke: #5b8cff;
  stroke-width: 2.4;
  stroke-dasharray: 6 4;
  animation: wv-security-wire-dash 1.6s linear infinite;
}

@keyframes wv-security-wire-dash {
  to {
    stroke-dashoffset: -20;
  }
}

.st .wv-security-db-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.st .wv-security-db-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e0f0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------
   Slide C: Developer API Code Card
   ------------------------------------------------------------ */
.st .wv-security-code-card {
  width: 100%;
  max-width: 600px;
  background: #13111d;
  color: #ffffff;
  border: 2px solid #17151f;
  border-radius: 18px;
  box-shadow: 6px 6px 0 #17151f;
  overflow: hidden;
  margin: 0 auto;
  --md: 12;
}

.st .wv-security-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #1b182a;
  border-bottom: 2px solid #28243e;
}

.st .wv-security-code-dots {
  display: flex;
  gap: 6px;
}

.st .wv-security-code-dots i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.st .wv-security-code-dots i:nth-child(1) { background: #ff5f56; }
.st .wv-security-code-dots i:nth-child(2) { background: #ffbd2e; }
.st .wv-security-code-dots i:nth-child(3) { background: #27c93f; }

.st .wv-security-code-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: #b5b0cf;
}

.st .wv-security-code-mcp-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: #7c3aed;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.st .wv-security-code-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.st .wv-security-code-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
}

.st .wv-security-code-num {
  color: #55506e;
  font-size: 12px;
  min-width: 18px;
  user-select: none;
}

.st .wv-security-code-method {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  background: #231f38;
  border: 1px solid #7c3aed;
  color: #c4b5fd;
  font-weight: 750;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.st .wv-security-code-path-wrap {
  --c-type-progress: clamp(0, calc((var(--dw) - var(--c-t0, 0)) / var(--c-dur, 0.3)), 1);
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  max-width: calc(var(--c-type-progress) * 260px);
  vertical-align: bottom;
}

.st .wv-security-code-path {
  color: #5b8cff;
  font-weight: 700;
}

.st .wv-security-code-cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: #ffd23f;
  margin-left: 3px;
  opacity: calc(clamp(0, (1 - var(--c-type-progress)) * 12, 1) * clamp(0, var(--c-type-progress) * 12, 1));
}

.st .wv-security-code-comment {
  color: #797394;
  font-size: 12px;
  font-style: italic;
}

.st .wv-security-code-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: #181525;
  border-top: 1.5px solid #28243e;
}

.st .wv-security-code-meta {
  font-size: 12px;
  color: #928ca9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ------------------------------------------------------------
   Chapter 09: Finale
   ------------------------------------------------------------ */
.st .wv-finale-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.st .wv-finale-credit {
  margin-top: clamp(28px, 5vh, 52px);
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
}

.st .wv-finale-link {
  color: #ffffff;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.st .wv-finale-link:hover {
  color: #ffd23f;
}

/* ------------------------------------------------------------
   Responsive Adjustments (Mobile & Reduced Motion)
   ------------------------------------------------------------ */
@media (max-width: 899px) {
  .st .wv-security-matrix-card,
  .st .wv-security-db-card,
  .st .wv-security-code-card {
    max-width: 100%;
  }

  .st .wv-security-matrix-head {
    padding: 10px 14px;
  }

  .st .wv-security-matrix-table {
    font-size: 12px;
  }

  .st .wv-security-matrix-th,
  .st .wv-security-matrix-td {
    padding: 8px 4px;
  }

  .st .wv-security-code-body {
    padding: 14px 16px;
    gap: 12px;
  }

  .st .wv-security-code-line {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st .wv-security-db-wire {
    animation: none;
  }

  .st .wv-security-code-path-wrap {
    max-width: 100% !important;
  }

  .st .wv-security-code-cursor {
    display: none;
  }

  .st .wv-security-sw.is-on-seq,
  .st .wv-security-sw.is-off-seq {
    --sw-v: 1;
  }
}
