:root {
  color-scheme: dark;
  --surface: #1a1a19;
  --surface-raised: #232322;
  --ink: #ffffff;
  --ink-soft: #c4c4bf;
  --ink-muted: #8d8d87;
  --rule: #3a3a36;
  --rule-strong: #55554e;
  --accent: #3987e5;
  --good: #199e70;
  --bad: #e66767;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--surface);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: 3px;
}

.splash-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 28px clamp(24px, 4vw, 64px) 24px;
}

.splash-header,
.splash-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--ink-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.splash-header {
  position: relative;
  z-index: 10;
  min-height: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.splash-header p,
.splash-footer p {
  margin: 0;
}

.splash-brand {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.splash-brand__suffix {
  color: var(--ink-muted);
  font-weight: 400;
}

.splash-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.86fr) minmax(460px, 1.14fr);
  align-items: center;
  gap: clamp(48px, 8vw, 128px);
  padding: clamp(56px, 8vh, 100px) 0;
}

.splash-copy {
  position: relative;
  z-index: 4;
  max-width: 590px;
}

.splash-copy__rule {
  width: 72px;
  height: 3px;
  margin-bottom: 30px;
  background: var(--accent);
  transform-origin: left;
  animation: rule-arrive 700ms var(--ease-out) both;
}

.splash-copy h1 {
  max-width: 9ch;
  margin: 0;
  font-size: clamp(54px, 6.2vw, 92px);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 0.94;
  text-wrap: balance;
}

.splash-intro {
  max-width: 49ch;
  margin: 30px 0 36px;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.58;
}

.access-form {
  max-width: 590px;
}

.access-form > label {
  display: block;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.access-controls {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 10px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  width: 100%;
  height: 52px;
  padding: 0 68px 0 16px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--ink);
  caret-color: var(--accent);
  font-size: 17px;
  letter-spacing: 0.04em;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.password-wrap input:hover {
  border-color: #707069;
}

.password-wrap input:focus {
  border-color: var(--accent);
  background: #282827;
}

.password-wrap input[aria-invalid="true"] {
  border-color: var(--bad);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.password-toggle:hover {
  color: var(--ink);
}

.enter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-width: 178px;
  height: 52px;
  padding: 0 18px 0 20px;
  overflow: hidden;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 720;
  position: relative;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms var(--ease-out);
}

.enter-button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--ink);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
}

.enter-button:hover:not(:disabled) {
  background: #4b94ed;
  transform: translateY(-1px);
}

.enter-button:active:not(:disabled) {
  transform: translateY(0);
}

.enter-button:disabled {
  cursor: wait;
  opacity: 0.82;
}

.enter-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.7;
  transition: transform 250ms var(--ease-out);
}

.enter-button:hover:not(:disabled) svg {
  transform: translateX(3px);
}

.is-checking .enter-button::after {
  animation: button-progress 900ms linear infinite;
}

.access-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.5;
}

.is-error .access-status {
  color: #f08a8a;
}

.mechanism-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 540px;
}

.mechanism-panel::before,
.mechanism-panel::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.mechanism-panel::before {
  inset: 9% 4%;
  border-top: 1px solid #292927;
  border-bottom: 1px solid #292927;
}

.mechanism-panel::after {
  top: 4%;
  bottom: 4%;
  left: 50%;
  border-left: 1px solid #292927;
}

.mechanism {
  position: relative;
  z-index: 2;
  width: min(100%, 510px);
  aspect-ratio: 1 / 1.04;
  transform: translateZ(0);
}

.shackle {
  position: absolute;
  top: 4%;
  left: 50%;
  width: 46%;
  height: 39%;
  transform: translateX(-50%);
  transform-origin: 72% 84%;
  transition: transform 620ms var(--ease-out) 180ms;
}

.shackle__bar {
  position: absolute;
  inset: 0;
  border: clamp(13px, 1.65vw, 21px) solid #474741;
  border-bottom: 0;
  border-radius: 120px 120px 0 0;
}

.shackle__bar::after {
  position: absolute;
  right: calc(clamp(13px, 1.65vw, 21px) * -1);
  bottom: -28px;
  width: clamp(13px, 1.65vw, 21px);
  height: 31px;
  background: #474741;
  content: "";
}

.lock-plate {
  position: absolute;
  right: 3%;
  bottom: 5%;
  left: 3%;
  height: 65%;
  overflow: hidden;
  border: 1px solid #4a4a45;
  background: #20201f;
  clip-path: polygon(0 18px, 18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px));
}

.lock-plate::before {
  position: absolute;
  inset: 18px;
  border: 1px solid #2f2f2c;
  content: "";
}

.lock-plate__corner {
  position: absolute;
  z-index: 3;
  width: 34px;
  height: 34px;
}

.lock-plate__corner--tl {
  top: 0;
  left: 0;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

.lock-plate__corner--br {
  right: 0;
  bottom: 0;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
}

.tumbler-stack {
  position: absolute;
  z-index: 2;
  top: 14%;
  right: 16%;
  bottom: 15%;
  left: 11%;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  gap: 5px;
}

.tumbler {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr 18px;
  align-items: center;
  gap: 12px;
  transform: translateX(var(--start));
  animation: tumbler-calibrate 4.2s var(--ease-out) var(--delay) forwards;
}

.tumbler__number {
  color: var(--ink-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.tumbler__track {
  position: relative;
  display: block;
  height: 24px;
  border: 1px solid #4a4a45;
  background: #292927;
}

.tumbler__track::before,
.tumbler__track::after {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid #60605a;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.tumbler__track::before {
  left: 12%;
}

.tumbler__track::after {
  right: 12%;
}

.tumbler__track i {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: calc(50% - 10px);
  width: 20px;
  border: 1px solid #686861;
  background: var(--surface);
}

.tumbler__track i::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  transform: translate(-50%, -50%);
}

.tumbler__pin {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #55554f;
  transition: background-color 250ms ease, transform 250ms var(--ease-out);
}

.keyline {
  position: absolute;
  z-index: 1;
  top: 12%;
  bottom: 13%;
  left: calc(47.5% + 5px);
  width: 0;
  border-left: 2px dotted rgba(57, 135, 229, 0.3);
}

.keyline span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  width: 2px;
  background: rgba(57, 135, 229, 0.62);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 460ms var(--ease-out);
}

.lock-release {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: 7%;
  width: 38px;
  height: 38px;
  border: 1px solid #5e5e58;
  border-radius: 50%;
  background: var(--surface);
  transform: translateY(-50%);
}

.lock-release::before,
.lock-release::after {
  position: absolute;
  top: 50%;
  left: 50%;
  background: #60605a;
  content: "";
  transform: translate(-50%, -50%);
}

.lock-release::before {
  width: 20px;
  height: 1px;
}

.lock-release::after {
  width: 1px;
  height: 20px;
}

.lock-release__core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  transition: background-color 220ms ease, transform 450ms var(--ease-out);
}

.mechanism-caption {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(86%, 430px);
  margin: -2px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.mechanism-signal {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
}

.is-ready .tumbler__pin {
  background: var(--accent);
}

.is-ready .mechanism-signal {
  animation: none;
}

.is-checking .tumbler {
  animation: none;
  transform: translateX(0);
  transition: transform 240ms var(--ease-out);
}

.is-checking .tumbler__pin {
  background: var(--accent);
}

.is-ready .keyline span,
.is-unlocking .keyline span {
  transform: scaleY(1);
}

.is-unlocking .tumbler {
  animation: none;
  transform: translateX(0);
  transition: transform 220ms var(--ease-out);
}

.is-unlocking .tumbler__pin,
.is-unlocking .mechanism-signal,
.is-unlocking .lock-release__core {
  background: var(--good);
}

.is-unlocking .lock-release__core {
  transform: translate(-50%, -50%) scale(1.8);
}

.is-unlocking .shackle {
  transform: translateX(-50%) translateY(-12%) rotate(9deg);
}

.is-unlocking .transition-wipe {
  transform: translateX(0);
}

.is-error .tumbler:nth-child(3) {
  animation: tumbler-reject 520ms var(--ease-out) both;
}

.is-error .tumbler:nth-child(3) .tumbler__pin,
.is-error .mechanism-signal {
  background: var(--bad);
}

.transition-wipe {
  position: fixed;
  z-index: 100;
  inset: 0;
  background: #20201f;
  pointer-events: none;
  transform: translateX(102%);
  transition: transform 620ms var(--ease-out) 180ms;
}

.splash-footer {
  min-height: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.splash-footer a {
  color: inherit;
  font-weight: 600;
  text-underline-offset: 3px;
}

.splash-footer a:hover { color: var(--ink); }

@keyframes tumbler-calibrate {
  0% { transform: translateX(var(--start)); }
  24% { transform: translateX(calc(var(--start) * -0.42)); }
  43% { transform: translateX(calc(var(--start) * 0.2)); }
  62% { transform: translateX(calc(var(--start) * -0.1)); }
  78%, 100% { transform: translateX(0); }
}

@keyframes tumbler-reject {
  0%, 100% { transform: translateX(0); }
  34% { transform: translateX(-22px); }
  68% { transform: translateX(9px); }
}

@keyframes rule-arrive {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes button-progress {
  0% { transform: scaleX(0); }
  60%, 100% { transform: scaleX(1); }
}

@media (max-width: 900px) {
  .splash-shell {
    padding-inline: 24px;
  }

  .splash-layout {
    grid-template-columns: minmax(280px, 0.92fr) minmax(350px, 1.08fr);
    gap: 36px;
  }

  .splash-copy h1 {
    font-size: clamp(48px, 7.6vw, 70px);
  }

  .mechanism-panel {
    min-height: 470px;
  }
}

@media (max-width: 720px) {
  .splash-shell {
    display: block;
    min-height: 100svh;
    padding: 18px 18px 20px;
  }

  .splash-header {
    min-height: 34px;
    padding-bottom: 14px;
  }

  .splash-header > p {
    display: none;
  }

  .splash-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px 0 28px;
  }

  .mechanism-panel {
    order: -1;
    width: 100%;
    min-height: 0;
  }

  .mechanism-panel::before {
    inset: 8% 0;
  }

  .mechanism {
    width: min(100%, 290px);
  }

  .mechanism-caption {
    min-width: min(82%, 260px);
    margin-top: -8px;
    font-size: 11px;
  }

  .splash-copy {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .splash-copy__rule {
    width: 52px;
    height: 2px;
    margin-bottom: 16px;
  }

  .splash-copy h1 {
    max-width: none;
    font-size: clamp(38px, 11vw, 54px);
    line-height: 0.98;
  }

  .splash-intro {
    margin: 16px 0 22px;
    font-size: 15px;
    line-height: 1.5;
  }

  .access-controls {
    grid-template-columns: 1fr;
  }

  .enter-button {
    width: 100%;
  }

  .splash-footer {
    display: none;
  }
}

@media (max-width: 390px) {
  .splash-layout {
    padding-top: 18px;
  }

  .mechanism {
    width: min(100%, 250px);
  }

  .splash-copy h1 {
    font-size: 38px;
  }

  .splash-intro {
    margin-bottom: 18px;
  }

  .password-wrap input,
  .enter-button {
    height: 49px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .tumbler {
    transform: translateX(0);
  }

  .mechanism-signal {
    animation: none;
  }
}
