/* ============================================================
   Atrium — guest phone (wallet) and door reader
   Both are dark: one lives in a pocket, one lives on a wall.
   ============================================================ */

body.dev {
  background: #0B0F0D;
  color: #F2EFE8;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
body.dev::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(760px 500px at 78% -8%, rgba(44,106,89,.34), transparent 62%),
    radial-gradient(620px 460px at 8% 104%, rgba(162,128,58,.16), transparent 60%);
}
body.dev > * { position: relative; z-index: 1; }

.dev-wrap { width: min(460px, calc(100% - 32px)); margin-inline: auto; padding-block: 22px 40px; }
.dev-wide { width: min(1100px, calc(100% - 40px)); }

.dev-top { display: flex; align-items: center; gap: 12px; margin-block-end: 22px; }
.dev-glyph {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: linear-gradient(150deg, #2C6A59, #123C31); color: #fff;
}
.dev-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.dev-sub { font-size: 11px; color: rgba(242,239,232,.5); letter-spacing: .09em; text-transform: uppercase; }

/* ------------------------------------------------------------- the key card */

.mkey {
  position: relative; border-radius: 26px; overflow: hidden;
  background: linear-gradient(155deg, #12352C 0%, #0E2A23 45%, #164034 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.1);
  padding: 26px 24px 24px;
}
.mkey::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, transparent 32%, rgba(255,255,255,.10) 47%, transparent 62%);
  background-size: 260% 100%; animation: sheen 6s linear infinite;
}
.mkey.dead {
  background: linear-gradient(155deg, #2A2724, #17150F);
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.mkey.dead::after { display: none; }

.mkey-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.mkey-room {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -.045em; line-height: .9;
  font-size: 72px; font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 90;
}
.mkey-rlabel { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: rgba(242,239,232,.55); }
.mkey-type { font-size: 13.5px; color: rgba(242,239,232,.72); margin-block-start: 6px; }

.mkey-qr {
  margin-block: 22px 6px; background: #fff; border-radius: 18px; padding: 14px;
  aspect-ratio: 1; display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(0,0,0,.34);
}
.mkey-qr svg { width: 100%; height: 100%; }
.mkey-qr.stale { opacity: .35; transition: opacity .3s; }

/* Estates where the door is not ours: the card must say what it actually is. */
.mkey-alt {
  margin-block: 22px 6px; padding: 22px 20px; border-radius: 18px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.11);
  text-align: center;
}
.mkey-alt-icon {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.1); color: #CFE3DA;
}
.mkey-alt-title { font-family: var(--font-display); font-size: 20px; font-weight: 600;
  letter-spacing: -.02em; }
.mkey-alt-body { font-size: 13px; color: rgba(242,239,232,.66); line-height: 1.6;
  margin-block-start: 9px; }
.mkey-alt-body .mono { color: #E7EFEB; }

.rot {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin-block-start: 14px; font-size: 12.5px; color: rgba(242,239,232,.6);
}
.rot-ring { width: 22px; height: 22px; flex: none; }
.rot-ring circle { fill: none; stroke-width: 3; }
.rot-ring .bg { stroke: rgba(255,255,255,.16); }
.rot-ring .fg { stroke: #7BD3B4; stroke-linecap: round; transition: stroke-dashoffset .95s linear; }

.mkey-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-block-start: 18px; padding-block-start: 16px; border-block-start: 1px solid rgba(255,255,255,.12);
  font-size: 12px; color: rgba(242,239,232,.6);
}
.mkey-code { font-family: var(--font-mono); letter-spacing: .1em; }

.dead-stamp {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: rgba(11,15,13,.72); backdrop-filter: blur(3px);
}
.dead-stamp .lbl {
  border: 2.5px solid #C4614F; color: #E28E7C; border-radius: 12px;
  padding: 12px 22px; font-size: 15px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; transform: rotate(-7deg);
}

/* ------------------------------------------------------------------ tiles */

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-block-start: 16px; }
.tile {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px; padding: 15px 16px; text-align: start;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.tile:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.16); }
.tile-lbl { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: rgba(242,239,232,.5); }
.tile-val { font-size: 17px; font-weight: 650; letter-spacing: -.015em; margin-block-start: 5px; }
.tile-val.mono { font-family: var(--font-mono); letter-spacing: .16em; }
.tile-full { grid-column: 1 / -1; }

.dev-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  height: 56px; border-radius: var(--r-pill); font-size: 16px; font-weight: 650;
  background: #F2EFE8; color: #12100C; margin-block-start: 12px;
  transition: transform .14s var(--ease), opacity .2s;
}
.dev-btn:active { transform: scale(.985); }
.dev-btn.ghost { background: transparent; color: #F2EFE8; border: 1.5px solid rgba(255,255,255,.2); }
.dev-btn.ghost:hover { border-color: rgba(255,255,255,.38); }
.dev-btn.brass { background: linear-gradient(150deg, #C9A354, #9C7A2E); color: #17150F; }
.dev-btn[disabled] { opacity: .4; pointer-events: none; }

.dev-note { font-size: 12.5px; color: rgba(242,239,232,.48); line-height: 1.6; margin-block-start: 16px; text-align: center; }

/* folio on phone */
.dev-sheet {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px; overflow: hidden; margin-block-start: 16px;
}
.dev-sheet-head { padding: 14px 18px; border-block-end: 1px solid rgba(255,255,255,.09);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(242,239,232,.55); }
.dev-line { display: flex; justify-content: space-between; gap: 14px; padding: 12px 18px;
  border-block-end: 1px solid rgba(255,255,255,.06); font-size: 14px; }
.dev-line:last-child { border-block-end: 0; }
.dev-line .d { color: rgba(242,239,232,.78); }
.dev-line .a { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.dev-line.tax { color: rgba(242,239,232,.5); font-size: 13px; }
.dev-line.total { background: rgba(255,255,255,.07); font-size: 16px; font-weight: 700; padding-block: 15px; }

/* ============================================================ door reader */

body.door {
  background: #08090A; min-height: 100dvh; padding-block: 18px;
  display: grid; justify-items: center; align-content: center;
  overflow-y: auto;
}
.lock {
  width: min(430px, calc(100% - 28px));
  border-radius: 30px; padding: 30px 26px 26px;
  background: linear-gradient(168deg, #23262A 0%, #131517 52%, #0C0D0F 100%);
  box-shadow: 0 40px 90px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.09);
  position: relative; overflow: hidden;
}
.lock::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.32), transparent);
}
.lock-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: rgba(255,255,255,.42); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.lock-room {
  font-family: var(--font-display); font-size: 58px; font-weight: 600; letter-spacing: -.04em;
  color: #F0EEE8; line-height: 1; margin-block-start: 6px;
}
.lock-type { font-size: 12.5px; color: rgba(255,255,255,.45); margin-block-start: 4px; }

.lock-led {
  width: 100%; height: 5px; border-radius: 4px; margin-block: 24px 22px;
  background: rgba(255,255,255,.08); position: relative; overflow: hidden;
}
.lock-led::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
}
.lock.granted .lock-led::after { background: #3FD69C; box-shadow: 0 0 22px #3FD69C; opacity: 1; }
.lock.denied .lock-led::after { background: #E2604A; box-shadow: 0 0 22px #E2604A; opacity: 1; }
.lock.reading .lock-led::after {
  background: linear-gradient(90deg, transparent, #7BD3B4, transparent); opacity: 1;
  animation: ledSweep 1.1s linear infinite;
}
@keyframes ledSweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.lock-notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 13px; margin-block-end: 16px;
  background: rgba(201,163,84,.14); border: 1px solid rgba(201,163,84,.3);
  color: #E3CB96; font-size: 12px; line-height: 1.5;
}
.lock-notice b { color: #F3E4C4; }
.lock-notice svg { flex: none; margin-block-start: 1px; }

.lock-eye {
  aspect-ratio: 1.45; border-radius: 22px; overflow: hidden; position: relative;
  background: #000; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.09);
  max-height: 30vh; width: 100%; justify-self: center;
}
.lock-eye video { width: 100%; height: 100%; object-fit: cover; }
.lock-eye .ph { text-align: center; color: rgba(255,255,255,.44); padding: 22px; }
.lock-ret { position: absolute; inset: 14%; pointer-events: none; }
.lock-ret span { position: absolute; width: 34px; height: 34px; border: 2.5px solid rgba(255,255,255,.75); border-radius: 5px; }
.lock-ret span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.lock-ret span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.lock-ret span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.lock-ret span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.lock-verdict {
  margin-block-start: 20px; border-radius: 18px; padding: 20px; text-align: center;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  transition: background .3s, border-color .3s;
}
.lock.granted .lock-verdict { background: rgba(63,214,156,.13); border-color: rgba(63,214,156,.36); }
.lock.denied  .lock-verdict { background: rgba(226,96,74,.13); border-color: rgba(226,96,74,.36); }
.lock-icon {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.6);
  transition: background .3s, color .3s, transform .4s var(--ease-out);
}
.lock.granted .lock-icon { background: #3FD69C; color: #06231A; transform: scale(1.06); }
.lock.denied  .lock-icon { background: #E2604A; color: #2B0B05; animation: shake .42s var(--ease); }
@keyframes shake {
  10%,90% { transform: translateX(-2px); } 20%,80% { transform: translateX(4px); }
  30%,50%,70% { transform: translateX(-7px); } 40%,60% { transform: translateX(7px); }
}
.lock-msg { font-size: 19px; font-weight: 650; color: #F0EEE8; letter-spacing: -.015em; }
.lock-sub { font-size: 13px; color: rgba(255,255,255,.5); margin-block-start: 5px; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-block-start: 16px; }
.keypad button {
  height: 58px; border-radius: 15px; font-size: 21px; font-weight: 600; color: #EDEAE3;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  transition: background .14s var(--ease), transform .1s;
}
.keypad button:hover { background: rgba(255,255,255,.12); }
.keypad button:active { transform: translateY(2px); }
.keypad .ok { background: #2C6A59; border-color: #2C6A59; }
.pin-dots { display: flex; gap: 10px; justify-content: center; margin-block-start: 16px; }
.pin-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.14); transition: background .2s; }
.pin-dots i.on { background: #7BD3B4; }

.lock-actions { display: flex; gap: 9px; margin-block-start: 16px; }
.lock-act {
  flex: 1; height: 48px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600;
  color: rgba(255,255,255,.72); background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.lock-act:hover { background: rgba(255,255,255,.11); color: #fff; }
.lock-act.on { background: #2C6A59; border-color: #2C6A59; color: #fff; }

.lock-log { margin-block-start: 16px; max-height: 128px; overflow-y: auto; }
.lock-log-row {
  display: flex; align-items: center; gap: 10px; padding-block: 7px;
  font-size: 12px; color: rgba(255,255,255,.5); border-block-end: 1px solid rgba(255,255,255,.05);
}
.lock-log-row .r { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.lock-log-row .g { color: #3FD69C; } .lock-log-row .d { color: #E2604A; }

.manual-in {
  width: 100%; margin-block-start: 12px; padding: 13px 15px; border-radius: 13px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  color: #F0EEE8; font-family: var(--font-mono); font-size: 13px;
}
.manual-in::placeholder { color: rgba(255,255,255,.3); }
.manual-in:focus { outline: none; border-color: #2C6A59; }

/* ============================================ estate reader (booth surface)
   Everything below is additive and scoped to body.door.reader or .rdr*.
   Not one rule above is edited: /door must stay pixel-identical.
   It exists because .lock is a 430px phone-sized card whose verdict is 19px
   and whose eye is capped at 30vh — none of which reads from two metres.
   ========================================================================= */

body.door.reader {
  padding: 0; display: block; overflow: hidden;
  height: 100dvh;
}
.rdr {
  height: 100dvh; display: grid; grid-template-rows: 6px 1fr auto;
  background: radial-gradient(1200px 700px at 50% -10%, #16191C, #08090A 70%);
}
.rdr .lock-led { margin: 0; border-radius: 0; height: 6px; }
.rdr.granted .lock-led::after { background: #3FD69C; box-shadow: 0 0 38px 6px #3FD69C; opacity: 1; }
.rdr.denied  .lock-led::after { background: #E2604A; box-shadow: 0 0 38px 6px #E2604A; opacity: 1; }
.rdr.foreign .lock-led::after { background: #C9A354; box-shadow: 0 0 38px 6px #C9A354; opacity: 1; }
.rdr.offline .lock-led::after { background: #C9A354; opacity: 1;
  background: linear-gradient(90deg, transparent, #C9A354, transparent);
  animation: ledSweep 1.4s linear infinite; }
.rdr.reading .lock-led::after {
  background: linear-gradient(90deg, transparent, #7BD3B4, transparent); opacity: 1;
  animation: ledSweep 1.1s linear infinite; }

/* stage: the eye and the words, side by side on a monitor, stacked on a phone */
.rdr-stage {
  display: grid; grid-template-columns: minmax(0, 44vmin) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px); align-items: center;
  padding-inline: clamp(16px, 4vw, 64px); min-height: 0;
}
/* THE EYE. Square on purpose: the brackets mark the exact pixels the decoder
   is handed, so the aiming affordance is literally true. */
.rdr-eye {
  position: relative; aspect-ratio: 1; width: 100%; justify-self: center;
  border-radius: 28px; overflow: hidden; background: #000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 30px 80px rgba(0,0,0,.6);
}
.rdr-eye video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .82; transition: opacity .3s;
}
.rdr-eye video.mirror { transform: scaleX(-1); }
.rdr.granted .rdr-eye video, .rdr.denied .rdr-eye video { opacity: 1; }
.rdr-quad { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.rdr .lock-ret { inset: 0; transition: opacity .25s; }
.rdr .lock-ret span {
  width: clamp(28px, 7vmin, 64px); height: clamp(28px, 7vmin, 64px);
  border-width: 3px; border-radius: 8px; border-color: rgba(255,255,255,.62);
  transition: border-color .25s;
}
.rdr.armed .lock-ret { animation: rdrBreathe 2.6s var(--ease) infinite; }
.rdr.locked-on .lock-ret span { border-color: #3FD69C; }
.rdr.granted .lock-ret, .rdr.denied .lock-ret, .rdr.foreign .lock-ret { opacity: 0; }
@keyframes rdrBreathe { 50% { transform: scale(1.014); } }

/* THE WORDS. This is the whole payload of the exhibit, so it is sized for a
   standing crowd, not for a hand. */
.rdr-say { min-width: 0; }
.rdr-brand {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline;
  color: rgba(255,255,255,.42); font-size: clamp(11px, 1.3vmin, 15px);
  letter-spacing: .16em; text-transform: uppercase;
}
.rdr-word {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(30px, 5.4vmin, 76px); line-height: 1.04;
  letter-spacing: -.02em; color: #F0EEE8; margin-block-start: .35em;
  max-width: 17ch; text-wrap: balance;
}
.rdr.granted .rdr-word { color: #3FD69C; letter-spacing: .14em; text-transform: uppercase;
  font-size: clamp(26px, 4vmin, 54px); }
.rdr.denied  .rdr-word { color: #E2604A; }
.rdr.foreign .rdr-word { color: #E3CB96; }
.rdr-room {
  font-family: var(--font-display); font-weight: 600; line-height: .86;
  letter-spacing: -.045em; font-size: clamp(76px, 19vmin, 300px);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 90;
  color: rgba(255,255,255,.14); transition: color .3s;
  font-variant-numeric: tabular-nums;
}
.rdr.granted .rdr-room { color: #F0EEE8; animation: rdrLand .34s var(--ease-out) both; }
.rdr-room:empty { display: none; }
@keyframes rdrLand { from { transform: translateY(12px) scale(1.04); opacity: 0; } }
.rdr-name {
  font-size: clamp(16px, 2.4vmin, 34px); color: rgba(255,255,255,.72);
  line-height: 1.45; margin-block-start: .5em; max-width: 26ch; text-wrap: pretty;
}
.rdr.granted .rdr-name { color: #EDEAE3; }
.rdr-fine {
  font-size: clamp(11px, 1.3vmin, 16px); color: rgba(255,255,255,.34);
  letter-spacing: .08em; margin-block-start: .8em; min-height: 1.4em;
}

/* the flood: a GPU transform, never a layout change */
.rdr::after {
  content: ""; position: fixed; inset: -20%; pointer-events: none; z-index: 0;
  opacity: 0; transform: scale(.2); transition: opacity .26s, transform .26s var(--ease-out);
  background: radial-gradient(closest-side, rgba(63,214,156,.26), transparent 70%);
}
.rdr.granted::after { opacity: 1; transform: scale(1); }
.rdr.denied::after {
  opacity: 1; transform: scale(1);
  background: radial-gradient(closest-side, transparent 40%, rgba(226,96,74,.3));
}
.rdr > * { position: relative; z-index: 1; }
.rdr.denied .rdr-say { animation: shake .42s var(--ease); }

/* foot: log + operator controls, deliberately small */
.rdr-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; padding: clamp(10px, 1.6vh, 20px) clamp(16px, 4vw, 64px) clamp(14px, 2vh, 26px);
  flex-wrap: wrap;
}
.rdr-log { display: flex; gap: clamp(8px, 1.4vw, 20px); flex-wrap: wrap; min-width: 0; }
.rdr-log-row {
  display: flex; align-items: center; gap: 7px; font-size: clamp(11px, 1.2vmin, 15px);
  color: rgba(255,255,255,.42); font-variant-numeric: tabular-nums;
}
.rdr-log-row .g { color: #3FD69C; } .rdr-log-row .d { color: #E2604A; }
.rdr-ops { display: flex; gap: 9px; margin-inline-start: auto; }
.rdr-ops .lock-act { flex: none; padding-inline: 16px; height: 42px; font-size: 12.5px; }
.rdr-man { padding: 0 clamp(16px, 4vw, 64px) 16px; }

/* arm plate: the camera grant gesture, the audio unlock and the wake lock */
.rdr-arm {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(8,9,10,.92); backdrop-filter: blur(6px);
  padding: 24px; text-align: center;
}
.rdr-arm.hidden { display: none !important; }
.rdr-arm-box { width: min(520px, 100%); }
.rdr-arm-title { font-family: var(--font-display); font-weight: 600;
  font-size: clamp(22px, 3.4vmin, 38px); margin-block-start: 18px; color: #F0EEE8; }
.rdr-arm-body { font-size: clamp(13px, 1.7vmin, 18px); color: rgba(255,255,255,.6);
  line-height: 1.6; margin-block-start: 10px; }
.rdr-arm-fix {
  margin-block-start: 18px; padding: 14px 16px; border-radius: 13px; text-align: start;
  background: rgba(201,163,84,.14); border: 1px solid rgba(201,163,84,.3);
  color: #E3CB96; font-size: 12.5px; line-height: 1.6;
}

/* Portrait / stacked — LAST in the file on purpose: these override the
   two-column rules above by source order, not by inflated specificity. */
@media (max-aspect-ratio: 1/1) {
  .rdr-stage {
    grid-template-columns: 1fr; grid-template-rows: auto auto;
    justify-items: center; align-content: center; gap: clamp(14px, 3vh, 30px);
  }
  .rdr-eye { width: min(68vw, 40vh); }
  .rdr-say { text-align: center; }
  .rdr-brand { justify-content: center; }
  .rdr-word, .rdr-name { margin-inline: auto; }
}
