/* MRBD Keyboard — styles for the Meta Ray-Ban Display additive waveguide.
   Pure black renders fully transparent on the glasses; bright colors add
   light. Everything lives inside a fixed 600×600 viewport, no scrolling. */

:root {
  --bg: #000000;          /* transparent on glasses */
  --key: #101418;         /* barely-there key body */
  --key-edge: #3a4650;
  --ink: #e8f4f8;         /* primary text */
  --focus: #00d4ff;       /* Meta's recommended bright accent */
  --focus-glow: rgba(0, 212, 255, 0.45);
  --latched: #7dffb2;
  --dim: #7d8b96;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg);
  font-family: -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}

.mrbd-kbd {
  position: relative;
  width: 600px;
  height: 600px;
  display: flex;
  flex-direction: column;
  padding: 14px;
}

/* ---- Typed-text display ------------------------------------------- */

.kbd-text {
  height: 88px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border: 2px solid var(--key-edge);
  border-radius: 14px;
  font-size: 30px;
  letter-spacing: 0.5px;
  white-space: pre;
  overflow: hidden;
}

.kbd-caret {
  display: inline-block;
  width: 3px;
  height: 38px;
  margin-left: 3px;
  background: var(--focus);
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ---- Status flash (“centered”, “sent”, “exiting”) ------------------- */

.kbd-status {
  position: absolute;
  top: 108px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  border-radius: 999px;
  background: var(--focus);
  color: #001018;
  font-size: 18px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  z-index: 3;
}
.kbd-status.show { opacity: 1; }

/* ---- Key grid ------------------------------------------------------- */

.kbd-grid-wrap {
  position: relative;
  flex: 1;
  margin-top: 14px;
}

.kbd-grid {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 8px;
}

.kbd-row {
  display: flex;
  flex: 1;
  gap: 8px;
  justify-content: center;
}

.kbd-key {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--key);
  border: 2px solid var(--key-edge);
  border-radius: 12px;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.kbd-key.focused {
  border-color: var(--focus);
  box-shadow: 0 0 20px var(--focus-glow), inset 0 0 12px rgba(0, 212, 255, 0.15);
  color: var(--focus);
  transform: scale(1.06);
  z-index: 1;
}

.kbd-key.latched {
  border-color: var(--latched);
  color: var(--latched);
}

/* ---- Reticle: the continuous head-pointer dot ----------------------- */

.kbd-reticle {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--focus);
  box-shadow: 0 0 10px var(--focus-glow);
  pointer-events: none;
  z-index: 2;
  transition: transform 60ms linear;
}
.kbd-reticle.at-center {
  background: var(--latched);
  box-shadow: 0 0 10px rgba(125, 255, 178, 0.5);
}

/* ---- Settings overlay ------------------------------------------------ */

.kbd-settings {
  position: absolute;
  inset: 14px;
  background: rgba(0, 0, 0, 0.92);
  border: 2px solid var(--key-edge);
  border-radius: 16px;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 4;
}
.kbd-settings.hidden { display: none; }

.set-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.set-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 68px;
  padding: 0 20px;
  border: 2px solid var(--key-edge);
  border-radius: 12px;
  font-size: 24px;
}
.set-row.focused {
  border-color: var(--focus);
  box-shadow: 0 0 20px var(--focus-glow);
  color: var(--focus);
}
.set-value { font-weight: 700; }
.set-arrow { color: var(--dim); font-size: 18px; }

.set-hint {
  margin-top: auto;
  text-align: center;
  color: var(--dim);
  font-size: 17px;
}

/* ---- Start / exit screens (demo shell) -------------------------------- */

.shell-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: var(--bg);
  z-index: 5;
  text-align: center;
  padding: 40px;
}
.shell-screen.hidden { display: none; }

.shell-title { font-size: 34px; font-weight: 700; }
.shell-sub { font-size: 20px; color: var(--dim); line-height: 1.5; max-width: 460px; }

.shell-btn {
  min-height: 88px; /* glasses minimum tap target */
  min-width: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  border: 2px solid var(--key-edge);
  border-radius: 14px;
  background: var(--key);
  color: var(--ink);
}
.shell-btn:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 20px var(--focus-glow);
  color: var(--focus);
}
