/* Password gate for the Neutrinos case studies (gate.js). Colours are tokens, so both themes work. */
html.gate-locked main, html.gate-locked .toc, html.gate-locked .top .r { visibility: hidden; }
html.gate-locked body { overflow: hidden; }

.gate { --sans: "Inter", -apple-system, "Segoe UI", sans-serif; text-transform: none; letter-spacing: 0;
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; overflow-y: auto;
  background: color-mix(in srgb, var(--k-000000) 78%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .25s; }
.gate.on { opacity: 1; }
.gate.direct { background: color-mix(in srgb, var(--k-000000) 60%, transparent); }
.gate-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); width: min(880px, 100%);
  background: var(--k-0a0a0a); border: 1px solid var(--k-2a2a2a); transform: translateY(10px); transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.gate.on .gate-card { transform: none; }
.gate-card::before, .gate-card::after { content: ''; position: absolute; width: 10px; height: 10px; border: 1px solid var(--accent); }
.gate-card::before { top: -5px; left: -5px; border-right: 0; border-bottom: 0; } .gate-card::after { bottom: -5px; right: -5px; border-left: 0; border-top: 0; }
.gate-x { position: absolute; top: 14px; right: 14px; z-index: 2; font: 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--soft);
  background: none; border: 1px solid var(--k-2a2a2a); padding: 7px 9px; cursor: pointer; text-decoration: none; }
.gate-x:hover, .gate-x:focus-visible { color: var(--k-ffffff); border-color: var(--accent); }

/* the project's motion graphic, locked */
.gate-thumb { position: relative; min-height: 340px; border-right: 1px solid var(--k-2a2a2a); overflow: hidden;
  background-image: radial-gradient(var(--k-2a2a2a) 1px, transparent 1px); background-size: 16px 16px; }
.gate .gate-scene { position: absolute; inset: 24px 18px 70px; background: none; }
.gate .gate-scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gate-lock { position: absolute; left: 24px; bottom: 22px; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--accent); color: var(--accent);
  background: var(--k-000000); }
.gate-lock svg, .gate-k svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gate-lock .shackle { transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 16px 11px; }
.gate.grant .gate-lock .shackle { transform: translate(3px, -3px) rotate(28deg); }
.gate-scan { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); opacity: 0; box-shadow: 0 0 12px var(--accent); }
.gate.busy .gate-scan, .gate.grant .gate-scan { animation: gate-scan .65s linear; }
@keyframes gate-scan { 0% { top: 0; opacity: .9; } 100% { top: 100%; opacity: .2; } }

.gate-body { padding: 28px 30px 26px; display: flex; flex-direction: column; }
.gate-k { display: inline-flex; align-items: center; gap: 8px; font: 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.gate-k svg { width: 14px; height: 14px; }
.gate h2 { font: 400 26px/1.2 var(--mono); color: var(--k-ffffff); margin: 16px 0 4px; letter-spacing: -.01em; }
.gate-what { font: 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--soft); margin: 0; }
.gate-ov { font: 15px/1.6 var(--sans); color: var(--body); margin: 16px 0 0; max-width: none; }
.gate-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0 22px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--k-2a2a2a); }
.gate-facts dt { font: 10.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.gate-facts dd { font: 13px/1.4 var(--sans); color: var(--k-e6e6e6); margin: 3px 0 0; }

/* the access key field: a terminal prompt with HUD corners */
.gate-f { margin-top: 24px; }
.gate-f label { display: block; font: 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); margin-bottom: 9px; }
.gate-in { position: relative; display: flex; align-items: center; border: 1px solid var(--k-444444); background: var(--k-000000); transition: border-color .2s; }
.gate-in::before, .gate-in::after { content: ''; position: absolute; width: 6px; height: 6px; border: 1px solid var(--accent); opacity: 0; transition: opacity .2s; }
.gate-in::before { top: -4px; left: -4px; border-right: 0; border-bottom: 0; } .gate-in::after { bottom: -4px; right: -4px; border-left: 0; border-top: 0; }
.gate-in:focus-within { border-color: var(--accent); } .gate-in:focus-within::before, .gate-in:focus-within::after { opacity: 1; }
.gate-in .pr { font: 14px var(--mono); color: var(--accent); padding: 0 4px 0 13px; }
.gate-in input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: none; color: var(--k-ffffff); font: 15px var(--mono); letter-spacing: .14em; caret-color: var(--accent); padding: 0 8px; }
.gate-in input::placeholder { letter-spacing: .04em; color: var(--k-6f6f6f); }
.gate-in button { height: 44px; padding: 0 16px; border: 0; border-left: 1px solid var(--k-444444); background: var(--accent); color: var(--k-000000);
  font: 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.gate-in button:hover, .gate-in button:focus-visible { filter: brightness(1.1); }
.gate-st { font: 11.5px/1.5 var(--mono); letter-spacing: .04em; color: var(--soft); margin: 10px 0 0; min-height: 18px; max-width: none; }
.gate-st.ok { color: var(--accent); } .gate-st.no { color: var(--k-c-coral); }
.gate.deny .gate-in { border-color: var(--k-c-coral); animation: gate-shake .38s steps(1, end); }
@keyframes gate-shake { 0% { translate: 6px 0; } 20% { translate: -5px 0; clip-path: inset(0 0 45% 0); } 40% { translate: 4px 0; clip-path: none; } 60% { translate: -3px 0; } 80% { translate: 1px 0; } 100% { translate: 0; } }
.gate-ask { margin-top: auto; padding-top: 22px; font: 13.5px/1.4 var(--sans); color: var(--soft); text-decoration: none; }
.gate-ask b { font-weight: 600; color: var(--k-ffffff); border-bottom: 1px solid var(--accent); }
.gate-ask:hover b, .gate-ask:focus-visible b { color: var(--accent); }

/* landing cards: the lock mark */
.kind .nda { display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 2; }

@media (max-width: 760px) {
  .gate { padding: 14px; place-items: start center; }
  .gate-card { grid-template-columns: 1fr; }
  .gate-thumb { min-height: 170px; border-right: 0; border-bottom: 1px solid var(--k-2a2a2a); }
  .gate .gate-scene { inset: 14px 14px 14px 76px; }
  .gate-lock { bottom: auto; top: 14px; left: 14px; }
  .gate-body { padding: 22px 18px 20px; }
  .gate h2 { font-size: 22px; }
  .gate-facts { grid-template-columns: 1fr 1fr; gap: 10px 18px; }
}
@media (prefers-reduced-motion: reduce) { .gate, .gate-card, .gate-lock .shackle { transition: none; } .gate-scan, .gate.deny .gate-in { animation: none; } }
