/* V5.99 case-study password gate. Extends the approved design system. */
html.deep-protected-pending body { min-height: 100vh; overflow: hidden; }
html.deep-protected-pending body > :not(.deep-gate) { visibility: hidden !important; }
html.deep-protected-pending body::before { visibility: visible; }
body.deep-gate-open { overflow: hidden; }

.deep-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: var(--s-5);
  visibility: visible !important;
}
.deep-gate__scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 20, .68);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.deep-gate__panel {
  position: relative;
  width: min(100%, 620px);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  box-shadow: 0 28px 72px rgba(15,23,20,.28);
}
.deep-gate__close {
  position: absolute;
  top: clamp(.8rem, 2vw, 1.15rem);
  right: clamp(.8rem, 2vw, 1.15rem);
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.deep-gate__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.deep-gate__close:hover { border-color: var(--ink); background: var(--paper-3); }
.deep-gate__close:focus-visible {
  outline: 3px solid var(--redline-wash);
  outline-offset: 2px;
  border-color: var(--redline);
}
.deep-gate__eyebrow {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  margin: 2.9rem 0 var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--redline);
}
.deep-gate__eyebrow::before {
  content: "//";
  color: var(--redline);
}
.deep-gate__panel h2 {
  max-width: 13ch;
  margin-bottom: var(--s-4);
  font-size: clamp(2rem, 1.55rem + 2vw, 3.25rem);
}
.deep-gate__deck {
  max-width: 54ch;
  margin-bottom: var(--s-6);
  color: var(--ink-2);
  font-size: var(--fs-3);
}
.deep-gate__field { margin-bottom: var(--s-3); }
.deep-gate__label {
  display: block;
  margin-bottom: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.deep-gate__input {
  width: 100%;
  min-height: 52px;
  padding: .85rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper-3);
  color: var(--ink);
  font: 500 1rem/1.2 var(--font-mono);
  outline: none;
}
.deep-gate__input:focus {
  border-color: var(--redline);
  box-shadow: 0 0 0 3px var(--redline-wash);
}
.deep-gate__input[aria-invalid="true"] { border-color: var(--negative); }
.deep-gate__unlock {
  width: 100%;
  justify-content: center;
  margin-top: var(--s-3);
  text-align: center;
}
.deep-gate__error {
  min-height: 1.5em;
  margin: var(--s-2) 0 0;
  color: var(--negative);
  font-family: var(--font-mono);
  font-size: var(--fs-0);
}

.deep-gate__help {
  margin: var(--s-3) 0 0;
  color: var(--ink-2);
  font-size: var(--fs-1);
  line-height: 1.55;
}
.deep-gate__help a {
  color: var(--redline);
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.deep-gate__help a:hover,
.deep-gate__help a:focus-visible {
  color: var(--ink);
}
.deep-gate__help a[href^="mailto:"] { white-space: nowrap; }
.deep-gate__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  align-items: start;
  margin-top: var(--s-5);
}
.deep-gate__actions > .btn,
.deep-gate__public-choice .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}
.deep-gate__public-choice {
  display: grid;
  gap: .55rem;
}
.deep-gate__public-note {
  color: var(--ink-soft);
  font-size: var(--fs-0);
  line-height: 1.45;
}
.deep-gate__note {
  margin: var(--s-5) 0 0;
  padding-top: var(--s-4);
  border-top: 1px dashed var(--rule-strong);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  line-height: 1.55;
}
@media (max-width: 520px) {
  .deep-gate { padding: var(--s-3); align-items: end; }
  .deep-gate__panel {
    max-height: calc(100dvh - (var(--s-3) * 2));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius-md);
    padding: var(--s-5);
  }
  .deep-gate__close { top: .8rem; right: .8rem; width: 40px; height: 40px; }
  .deep-gate__eyebrow { margin-top: 2.7rem; }
  .deep-gate__panel h2 { font-size: clamp(1.85rem, 8.8vw, 2.45rem); }
  .deep-gate__deck { margin-bottom: var(--s-4); font-size: var(--fs-2); }
  .deep-gate__actions { grid-template-columns: 1fr; }
  .deep-gate__actions .btn { width: 100%; justify-content: center; text-align: center; }
}
