/* Credential Ninja — private gate. */

@import url("tokens.css?v=2");

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

::selection {
  background: oklch(0.9 0.014 88 / 0.16);
  color: var(--ink);
}

a {
  color: inherit;
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--pad);
}

.gate:has(pre.zcap) {
  place-items: safe center;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, var(--measure));
  transform: translateY(-6vh);
  animation: rise 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mark {
  width: 112px;
  height: 112px;
  color: var(--ink);
}

.mark path {
  stroke: currentColor;
}

.domain {
  margin: 28px 0 0;
  color: var(--ink-dim);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
}

.enter {
  margin-top: 72px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
}

.enter::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
}

.enter:hover,
.enter:focus-visible {
  color: var(--ink);
}

.enter:hover::after,
.enter:focus-visible::after {
  transform: scaleX(1);
}

.enter:focus-visible {
  outline: none;
}

button.enter {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.stage .sheet {
  width: 100%;
  margin-top: 48px;
  transform: none;
  animation: none;
}

.sheet {
  width: min(100%, var(--measure));
  transform: translateY(-4vh);
  animation: rise 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sheet-mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  margin-bottom: 40px;
  color: var(--ink);
}

.sheet-mark path {
  stroke: currentColor;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 28px;
}

.field span {
  color: var(--ink-dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
}

.field input {
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 8px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  letter-spacing: -0.011em;
  caret-color: var(--ink);
}

.field input::placeholder {
  color: oklch(0.9 0.014 88 / 0.28);
}

.field input:focus {
  outline: none;
  border-bottom-color: var(--line-strong);
}

.entry {
  position: relative;
  display: block;
}

.field .entry input {
  padding-right: 108px;
}

.grant .entry pre.value {
  padding-right: 132px;
  -webkit-text-security: disc;
}

.enter-btn {
  position: absolute;
  right: 0;
  bottom: 13px;
  margin: 0;
  padding: 2px 0 1px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
}

.enter-btn:hover,
.enter-btn:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.enter-btn:focus-visible {
  outline: none;
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--ground) inset;
}

.field .error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.hint {
  margin: 0;
  color: var(--ink-dim);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.grant {
  margin: 0 0 28px;
}

.grant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.grant-head span {
  color: var(--ink-dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
}

.grant pre {
  margin: 0;
  color: var(--ink);
  font: inherit;
  letter-spacing: -0.011em;
}

.grant pre.value {
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.grant pre.zcap {
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: visible;
  color: var(--ink-soft);
}

.grant .hint {
  margin-top: 8px;
}

.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
}

.copy svg {
  display: block;
  width: 16px;
  height: 16px;
}

.copy .done {
  display: none;
}

.copy.is-copied {
  color: var(--ink);
}

.copy.is-copied .idle {
  display: none;
}

.copy.is-copied .done {
  display: block;
}

.copy:hover,
.copy:focus-visible {
  color: var(--ink);
}

.copy:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 4px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

form.actions {
  margin: 12px 0 0;
}

.submit {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 0 8px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
}

.submit::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
}

.submit:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 6px;
}

.quiet {
  color: var(--ink-dim);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}

button.quiet {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.quiet:hover,
.quiet:focus-visible {
  color: var(--ink-soft);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(calc(-6vh + 8px));
  }
  to {
    opacity: 1;
  }
}

.sheet {
  animation-name: rise-sheet;
}

@keyframes rise-sheet {
  from {
    opacity: 0;
    transform: translateY(calc(-4vh + 8px));
  }
  to {
    opacity: 1;
    transform: translateY(-4vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage,
  .sheet,
  .enter::after {
    animation: none;
    transition: none;
    transform: none;
  }

  .stage {
    transform: translateY(-6vh);
  }

  .sheet {
    transform: translateY(-4vh);
  }
}
