/* The door: the passcode page. The palette and basics are in base.css. */
body.door {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-rows: 1fr;
  padding: 0 var(--gutter);
}

/* ---- the middle: the lines come in from the left edge of the window and run
   behind the words. ---- */
.door-main {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(24px, 4vw, 72px);
  padding: clamp(24px, 6vh, 64px) 0;
}
.door-art {
  grid-column: 1 / -1; grid-row: 1;
  position: relative; min-height: 320px;
  margin-left: calc(-1 * var(--gutter));
  /* A finger dragged over the lines moves them, instead of the browser taking
     the drag for scrolling or pull-to-refresh and cancelling it. */
  touch-action: none;
}
.door-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.door-copy {
  grid-column: 1; grid-row: 1; align-self: end;
  transition: opacity 0.35s ease;
  position: relative; z-index: 1;
  max-width: 520px; padding-bottom: clamp(0px, 4vh, 40px);
}
.door-copy h1 {
  margin: 0 0 40px -0.05em;
  font-family: var(--display);
  font-size: clamp(64px, 9.5vw, 148px); font-weight: 600;
  letter-spacing: -0.055em; line-height: 0.88;
}

/* ---- the passcode field, with its button inside ---- */
#door { position: relative; display: flex; max-width: 400px; }
#door input {
  flex: 1; min-width: 0; height: 56px; padding: 0 64px 0 24px;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 17px; letter-spacing: 0.04em;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#door input::placeholder { color: var(--ink-muted); letter-spacing: 0; }
#door input:focus { outline: none; border-color: var(--ink); }
#door input:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
#door button {
  position: absolute; top: 6px; right: 6px;
  width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.15s;
}
#door button svg { transition: transform 0.2s; }
#door button:hover { background: var(--accent); color: #fff; }
#door button:hover svg { transform: translateX(2px); }
#door button:active { transform: scale(0.94); }
#door button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#door.going button { background: var(--accent); color: #fff; }
#door.going button svg { transform: translateX(4px); }

.door-error { margin: 14px 0 0 24px; font-size: 14px; font-weight: 500; color: var(--red); }

/* ---- motion ---- */
@keyframes door-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes door-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.door-copy > * { animation: door-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.door-copy > :nth-child(2) { animation-delay: 0.08s; }
.door-copy > :nth-child(3) { animation-delay: 0.16s; }
#door.shake { animation: door-shake 0.4s ease-in-out; }
/* Signing in: the words go, leaving the lines for the portal's curtain. */
.door-copy.leaving { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .door-copy > *, #door.shake { animation: none; }
}

/* ---- phones: waves on top, words below ---- */
@media (max-width: 820px) {
  .door-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(200px, 1fr) auto;
    gap: 8px; padding: 32px 0 28px;
  }
  .door-art { grid-column: 1; grid-row: 1; margin-left: 0; min-height: 34vh; }
  .door-copy { grid-column: 1; grid-row: 2; align-self: start; padding-bottom: 0; }
  .door-copy h1 { font-size: clamp(56px, 18vw, 96px); margin-bottom: 28px; }
  #door { max-width: none; }
}
