/* The /me screen, drawn in the map's own type and colours so the hand-off into the scene is seamless. */
body.gate-open { overflow: hidden; }
#mote-gate[hidden] { display: none; }
#mote-gate {
  --cream: #eeebe4;
  --line: rgba(238, 235, 228, .22);
  --pixel: "Geist Pixel", ui-monospace, monospace;
  position: fixed; inset: 0; z-index: 50;
  background: var(--cream); color: #2b2b2b;
  display: grid; grid-template-rows: auto auto 1fr;
  padding: 16px;
  font-family: "Lay Grotesk Hello", "Lay Grotesk", Helvetica, Arial, sans-serif;
}
.gate-nav { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid #2b2b2b; }
.gate-nav a { color: inherit; text-decoration: none; font-weight: 600; letter-spacing: -.05em; font-size: clamp(1.05rem, .24rem + 1.9vw, 2rem); line-height: 1; }
.gate-title {
  margin: 0; font-weight: 600; letter-spacing: -.07em; line-height: .78;
  font-size: clamp(5rem, 15vw, 15rem); padding: .12em 0 0; white-space: nowrap; overflow: hidden;
}

/* stage: the black field the scene will appear in */
.gate-stage {
  position: relative; min-height: 0; overflow: auto;
  background: #0b0b0a; color: var(--cream);
  display: grid; place-items: center;
  padding: 56px 20px 48px;
  background-image:
    radial-gradient(ellipse 60% 55% at 50% 52%, rgba(226, 137, 58, .07), transparent 70%),
    linear-gradient(rgba(238, 235, 228, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 235, 228, .035) 1px, transparent 1px);
  background-size: auto, 100% 64px, 64px 100%;
  background-position: center, 0 -1px, -1px 0;
}
.gate-ruler {
  position: absolute; top: 14px; left: 16px; right: 16px; height: 12px; opacity: .45; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--cream) 0 1px, transparent 1px 120px) left bottom / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, var(--cream) 0 1px, transparent 1px 12px) left bottom / 100% 5px no-repeat;
}
.gate-corner { position: absolute; bottom: 16px; font: 10px/1.2 var(--pixel); letter-spacing: .06em; opacity: .32; }
.gate-corner--bl { left: 16px; }
.gate-corner--br { right: 16px; }

/* the framed card, with the same corner marks as the map's project frames */
.gate-frame {
  position: relative; width: min(100%, 520px);
  padding: 30px 30px 26px;
  display: grid; gap: 18px;
  --c: 14px;
  background:
    linear-gradient(var(--cream), var(--cream)) top left / var(--c) 1px no-repeat,
    linear-gradient(var(--cream), var(--cream)) top left / 1px var(--c) no-repeat,
    linear-gradient(var(--cream), var(--cream)) top right / var(--c) 1px no-repeat,
    linear-gradient(var(--cream), var(--cream)) top right / 1px var(--c) no-repeat,
    linear-gradient(var(--cream), var(--cream)) bottom left / var(--c) 1px no-repeat,
    linear-gradient(var(--cream), var(--cream)) bottom left / 1px var(--c) no-repeat,
    linear-gradient(var(--cream), var(--cream)) bottom right / var(--c) 1px no-repeat,
    linear-gradient(var(--cream), var(--cream)) bottom right / 1px var(--c) no-repeat,
    rgba(11, 11, 10, .72);
  outline: 1px solid rgba(238, 235, 228, .08); outline-offset: -1px;
  backdrop-filter: blur(2px);
}
.gate-frame-head { display: flex; justify-content: space-between; font: 11px/1.2 var(--pixel); letter-spacing: .06em; }
.gate-frame-head span:last-child { opacity: .5; }
.gate-copy { margin: -6px 0 2px; font: 11px/1.6 var(--pixel); letter-spacing: .05em; opacity: .55; max-width: 44ch; }

/* wallets as rows */
.gate-wallets { display: grid; gap: 8px; }
.gate-wallets:empty { display: none; }
.gate-row {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 14px;
  width: 100%; padding: 12px 14px; text-align: left; cursor: pointer;
  font: inherit; color: var(--cream); background: rgba(238, 235, 228, .03);
  border: 1px solid var(--line);
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.gate-row:hover, .gate-row:focus-visible { background: var(--cream); color: #0b0b0a; border-color: var(--cream); outline: none; }
.gate-row:disabled { opacity: .45; cursor: default; }
.gate-row-icon {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 7px; overflow: hidden; background: rgba(238, 235, 228, .1);
  font: 600 14px/1 "Lay Grotesk Hello", "Lay Grotesk", sans-serif;
}
.gate-row-icon img { width: 100%; height: 100%; object-fit: contain; }
.gate-row-name { font-weight: 600; letter-spacing: -.035em; font-size: 1.35rem; line-height: 1; }
.gate-row-go { font: 10px/1 var(--pixel); letter-spacing: .08em; opacity: .55; white-space: nowrap; }
.gate-row:hover .gate-row-go { opacity: .8; }
.gate-row--solid { background: var(--cream); color: #0b0b0a; border-color: var(--cream); }
.gate-row--solid .gate-row-icon { background: #0b0b0a; color: var(--cream); }
.gate-note { margin: 0; font: 11px/1.6 var(--pixel); letter-spacing: .05em; opacity: .55; }

/* divider */
.gate-or { display: flex; align-items: center; gap: 12px; margin: 2px 0 -4px; font: 10px/1 var(--pixel); letter-spacing: .08em; opacity: .4; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; border-top: 1px dashed var(--cream); }

/* address */
.gate-form { display: grid; grid-template-columns: 1fr auto; gap: 0; border: 1px solid var(--line); }
.gate-form[hidden] { display: none; }
.gate-form:focus-within { border-color: rgba(238, 235, 228, .6); }
.gate-input {
  min-width: 0; background: none; border: 0; outline: none;
  color: var(--cream); font: 13px/1 var(--pixel); letter-spacing: .04em; padding: 15px 14px;
}
.gate-input::placeholder { color: rgba(238, 235, 228, .3); }
.gate-read {
  border: 0; border-left: 1px solid var(--line); background: none; color: var(--cream); cursor: pointer;
  font: 600 1.05rem/1 "Lay Grotesk Hello", "Lay Grotesk", sans-serif; letter-spacing: -.03em; padding: 0 18px;
  transition: background .25s ease, color .25s ease;
}
.gate-read:hover { background: var(--cream); color: #0b0b0a; }

.gate-status { margin: 0; min-height: 1.6em; font: 11px/1.6 var(--pixel); letter-spacing: .05em; opacity: .75; }
.gate-status:empty { display: none; }

/* reading: the card turns into a progress readout */
#mote-gate[data-mode="read"] .gate-or,
#mote-gate[data-mode="read"] .gate-copy,
#mote-gate[data-mode="read"] .gate-wallets { display: none; }
#mote-gate[data-mode="read"] .gate-status { display: flex; gap: 10px; align-items: center; opacity: .9; }
#mote-gate[data-mode="read"] .gate-status::before {
  content: ""; width: 7px; height: 7px; flex: none; background: #e2893a; border-radius: 50%;
  animation: gate-pulse 1.1s ease-in-out infinite;
}
@keyframes gate-pulse { 50% { opacity: .2; } }

@media (max-width: 640px) {
  .gate-stage { padding: 40px 12px 44px; place-items: start center; }
  .gate-frame { padding: 24px 18px 20px; }
  .gate-row-name { font-size: 1.15rem; }
  .gate-corner--br { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #mote-gate[data-mode="read"] .gate-status::before { animation: none; }
}
