/* The front door: a round vault door on printed paper, the sign-in plate
   beside it. Ink outlines and hard offset shadows like the rest of Vault;
   the racing stripes run round the door. */

:root { --door-line: var(--ink); --door-face: var(--surface-3); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --door-line: #e9dcc0; --door-face: #2c241c; }
}
:root[data-theme="dark"] { --door-line: #e9dcc0; --door-face: #2c241c; }

#app.door-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--grain), radial-gradient(120% 90% at 30% 40%, var(--surface) 0%, var(--bg) 70%);
  overflow: hidden;
}

.door-scene {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 440px);
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 6vw, 96px);
  padding: 48px clamp(16px, 5vw, 72px);
  max-width: 1200px;
  margin: 0 auto;
  perspective: 1600px;
}

/* ---- the door ---- */

.door-wrap {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1;
  justify-self: center;
  filter: drop-shadow(9px 9px 0 var(--drop));
}
.door-frame, .door-leaf, .door-glow { position: absolute; inset: 0; }
.door-frame { width: 100%; height: 100%; }
.frame-ring { fill: var(--ink); }
.frame-inner { fill: var(--block); stroke: var(--brown); stroke-width: 3; }
.door-glow {
  border-radius: 50%;
  margin: 6%;
  background: radial-gradient(circle, var(--mustard) 0%, var(--orange) 45%, transparent 72%);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.door-leaf {
  transform-origin: 6% 50%;
  transition: transform 1.1s cubic-bezier(0.6, 0, 0.2, 1) 0.35s;
  z-index: 1;
}
.door-svg { width: 100%; height: 100%; display: block; }
.door-face { fill: var(--door-face); stroke: var(--door-line); stroke-width: 5; }
.door-stripe { fill: none; stroke-width: 8; }
.door-stripe.s1 { stroke: var(--mustard); }
.door-stripe.s2 { stroke: var(--orange); }
.door-stripe.s3 { stroke: var(--tomato); }
.door-dial { fill: var(--surface); stroke: var(--door-line); stroke-width: 4; }
.door-ticks line { stroke: var(--door-line); stroke-width: 2.4; stroke-linecap: round; }
.door-bolt { fill: var(--door-line); }
.door-hinge { fill: var(--ink); }
.door-wheel { transform-origin: 200px 200px; transform-box: view-box; transition: transform 0.9s var(--ease-out); }
.wheel-rim { fill: none; stroke: var(--door-line); stroke-width: 9; }
.wheel-spokes line { stroke: var(--door-line); stroke-width: 9; stroke-linecap: round; }
.wheel-knob { fill: var(--tomato); stroke: var(--ink); stroke-width: 4; }
.wheel-hub { fill: var(--mustard); stroke: var(--ink); stroke-width: 5; }

/* Idle: the wheel rocks a little, as if someone's just let go of it. */
@keyframes wheel-idle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.door-wheel { animation: wheel-idle 6s ease-in-out infinite; }
/* Checking: it spins round. */
@keyframes wheel-spin { to { transform: rotate(360deg); } }
.turning .door-wheel { animation: wheel-spin 1.2s linear infinite; }
/* In: one last turn, then the door swings open on its hinges. */
.opening .door-wheel { animation: none; transform: rotate(540deg); }
.opening .door-leaf { transform: rotateY(-100deg); }
.opening .door-glow { opacity: 1; }
.opening .door-plate { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease 0.9s, transform 0.5s ease 0.9s; }
/* A wrong password: the plate shakes its head. */
@keyframes plate-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.shake .door-plate { animation: plate-shake 0.4s ease; }

/* ---- the plate ---- */

.door-plate { position: relative; padding: 34px 32px 26px; overflow: hidden; box-shadow: var(--hard-lg); }
.door-stripes { position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--stripes-x); border-bottom: var(--bw) solid var(--edge); }
.door-brand { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 18px; }
.door-name { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.door-sub { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }
.door-title { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 4vw, 40px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 8px; }
.door-lead { color: var(--text-2); margin: 0 0 22px; line-height: 1.5; }
.door-form { display: flex; flex-direction: column; gap: 14px; }
.door-form .input { width: 100%; height: 42px; font-size: 15px; }
.door-btn { height: 46px; font-size: 15px; font-weight: 600; justify-content: center; margin-top: 4px; }
.door-hint { margin: -4px 0 0; font-size: 12.5px; color: var(--text-3); }
.door-warn { background: var(--crit-wash); border: var(--bw) solid var(--crit); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 14px; color: var(--crit); font-size: 13.5px; }
.door-foot { margin: 20px 0 0; font-size: 12.5px; color: var(--text-3); }

@media (max-width: 860px) {
  .door-scene { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 28px 16px 40px; align-content: start; }
  .door-wrap { width: min(62vw, 300px); margin-top: 8px; }
  .door-plate { padding: 28px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .door-wheel, .turning .door-wheel { animation: none; }
  .door-leaf, .door-wheel, .opening .door-plate { transition: none; }
}

/* The People page */
.people-sub { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-2); margin: 22px 0 10px; font-weight: 500; }
.people-row { flex-wrap: wrap; gap: 10px; }
.people-row .input { flex: 1 1 200px; min-width: 0; }
.invite-link { margin-top: 12px; padding: 12px; border: var(--bw) dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.invite-link .row { gap: 10px; }
.invite-link .input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; }
