/* Casio demo app — the face of the reference screenshot (gui/lean#37), drawn at half its size: a 384 × 600 client. */
.casio-window { --casio-orange: #f0a030; --casio-blue: #2a8fd8; --casio-body: #3b4144; }
.casio {
  position: relative; flex: 1; width: 384px; height: 600px; overflow: hidden; outline: none; user-select: none;
  background: radial-gradient(120% 80% at 50% 0%, #454c50 0%, var(--casio-body) 55%, #31373a 100%);
  font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif; color: #eceff0;
}
.casio::before { content: ""; position: absolute; inset: 0; border: 3px solid #1b1e20; border-radius: 6px; pointer-events: none; }

/* The display: a bezel over the body, the LCD inside it */
.casio__bezel {
  position: absolute; left: 7px; top: 7px; width: 370px; height: 125px; border-radius: 10px 10px 18px 18px;
  background: linear-gradient(#2c3133, #23282a); box-shadow: inset 0 0 0 2px #141718, 0 1px 0 #5b6266;
}
.casio__lcd {
  position: absolute; left: 48px; top: 22px; width: 274px; height: 82px; background: linear-gradient(#bdd2bf, #b1c8b4);
  box-shadow: inset 0 2px 5px #0006, inset 0 0 0 1px #0004; color: #111;
}
.casio__marks { position: absolute; left: 0; right: 0; top: 6px; height: 14px; font: 700 11px/14px Arial, "Liberation Sans", sans-serif; }
.casio__marks span { position: absolute; opacity: 0; transition: opacity .12s; }
.casio__marks span.is-on { opacity: 1; }
.casio__marks [data-mark="shift"] { left: 8px; }
.casio__marks [data-mark="hyp"] { left: 28px; }
.casio__marks [data-mark="angle"] { left: 0; right: 0; text-align: center; font-size: 12px; }
.casio__marks [data-mark="sd"] { right: 44px; }
.casio__marks [data-mark="m"] { right: 24px; }
.casio__marks [data-mark="paren"] { right: 6px; }
.casio__digits { position: absolute; left: 14px; right: 6px; top: 24px; height: 42px; display: flex; justify-content: flex-end; align-items: flex-end; }
.casio__cell { width: 24px; height: 34px; flex: none; overflow: visible; }
.casio__cell polygon, .casio__cell circle { fill: #1111110a; transition: fill .05s; }
.casio__cell .is-on { fill: #111; }
.casio__exp { display: flex; margin-left: 4px; margin-bottom: 15px; }
.casio__exp[hidden] { display: none; }
.casio__exp .casio__cell { width: 12px; height: 17px; }
.casio__exp[data-neg="true"]::before { content: ""; width: 5px; height: 2px; background: #111; align-self: center; margin-right: 1px; }

/* The MODE legend */
.casio__modes { position: absolute; left: 14px; top: 144px; width: 360px; height: 30px; font-size: 11.5px; font-weight: 600; letter-spacing: .3px; color: #dfe3e4; }
.casio__modes-title { position: absolute; left: 0; top: 4px; font-size: 10.5px; font-weight: 700; color: #cfd4d6; }
.casio__mode { position: absolute; white-space: nowrap; }
.casio__mode i { display: inline-block; width: 11px; height: 6px; margin-right: 3px; background: #dde1e2; border-radius: 1px; vertical-align: 1px; transition: background .15s, box-shadow .15s; }
.casio__mode.is-on i { background: var(--casio-blue); box-shadow: 0 0 5px var(--casio-blue); }
.casio__mode[data-mode="COMP"] { left: 78px; top: 0; }
.casio__mode[data-mode="SD"] { left: 78px; top: 13px; }
.casio__mode[data-mode="DEG"] { left: 154px; top: 0; }
.casio__mode[data-mode="FIX"] { left: 154px; top: 13px; }
.casio__mode[data-mode="RAD"] { left: 230px; top: 0; }
.casio__mode[data-mode="SCI"] { left: 230px; top: 13px; }
.casio__mode[data-mode="GRA"] { left: 302px; top: 0; }
.casio__mode[data-mode="NORM"] { left: 302px; top: 13px; }
.casio.is-menu .casio__modes { color: #fff; }
.casio.is-menu .casio__mode i { animation: casio-blink .7s steps(2, start) infinite; }
@keyframes casio-blink { 50% { opacity: .35; } }

/* The keys: a slot (legends over, the key and its black well) at a grid position */
.casio__keys { position: absolute; inset: 0; }
.casio__slot { position: absolute; display: block; }
.casio__slot--sm { width: 46px; height: 30px; left: calc(19px + var(--col) * 59.2px); top: calc(192px + var(--row) * 51px); }
.casio__slot--lg { width: 59px; height: 34px; left: calc(19px + var(--col) * 70.8px); top: calc(358px + (var(--row) - 3) * 62px); }
.casio__legend { position: absolute; left: -12px; right: -12px; text-align: center; white-space: nowrap; font-weight: 700; line-height: 1; pointer-events: none; }
.casio__legend sup, .casio__legend sub { font-size: .65em; line-height: 0; }
.casio__legend--shift { color: var(--casio-orange); font-size: 11.5px; top: -17px; letter-spacing: .3px; }
.casio__slot--lg .casio__legend--shift { top: -20px; }
.casio__legend--sd { color: var(--casio-orange); font-size: 11px; top: -19px; font-style: italic; }
.casio__legend--sd::before, .casio__legend--sd::after { content: ""; position: absolute; top: -1px; width: 6px; height: 9px; border: 1.5px solid var(--casio-blue); opacity: .35; transition: opacity .15s; }
.casio__legend--sd::before { left: 6px; border-right: 0; }
.casio__legend--sd::after { right: 6px; border-left: 0; }
.casio.is-sd .casio__legend--sd::before, .casio.is-sd .casio__legend--sd::after { opacity: 1; }
.casio__slot--lg .casio__legend--sd { top: -22px; }
.casio.is-shift .casio__legend--shift { filter: drop-shadow(0 0 4px #f0a03099) brightness(1.25); }

.casio__key {
  position: absolute; inset: 0; margin: 0; padding: 0; border: 0; cursor: pointer; font: inherit; color: inherit; outline: none;
  background: #0a0b0c; border-radius: 6px; box-shadow: 0 0 0 3px #0a0b0c, 0 1px 0 3px #5a6165;
  -webkit-tap-highlight-color: transparent;
}
.casio__face {
  position: absolute; inset: 0 0 2px 0; display: flex; align-items: center; justify-content: center; border-radius: 5px; font-weight: 700;
  transform: translateY(0); transition: transform .08s ease-out, box-shadow .08s ease-out, filter .15s, background .15s;
  box-shadow: inset 0 1px 0 #ffffff55, inset 0 -3px 0 #0003, 0 2px 0 #000a, 0 3px 5px #0008;
}
.casio__key--sm .casio__face { background: linear-gradient(#5b6165, #464b4f); font-size: 15px; letter-spacing: .2px; color: #e9ecee; text-shadow: 0 1px 0 #0007; }
.casio__key--lg .casio__face { background: linear-gradient(#9b9b98, #7d7d7a); font-size: 30px; color: #f4f4f2; text-shadow: 0 1px 1px #0006; }
.casio__key--red .casio__face { background: linear-gradient(#e0323a, #bd1c25); font-size: 27px; color: #fff; text-shadow: 0 1px 1px #0006; }
.casio__key--lg[data-key="*"] .casio__face, .casio__key--lg[data-key="/"] .casio__face, .casio__key--lg[data-key="+"] .casio__face,
.casio__key--lg[data-key="-"] .casio__face, .casio__key--lg[data-key="="] .casio__face, .casio__key--lg[data-key="."] .casio__face { font-size: 34px; }
.casio__key[data-key="Exp"] .casio__face, .casio__key[data-key="M+"] .casio__face { font-size: 22px; }
.casio__key[data-key="OFF"] .casio__face, .casio__key[data-key="MODE"] .casio__face { font-size: 13px; }
.casio__face sup { font-size: .6em; line-height: 0; vertical-align: .6em; }
.casio__face sub { font-size: .6em; line-height: 0; vertical-align: -.4em; }

/* Animation: lift on hover, sink on press (also from the keyboard), SHIFT glows while armed */
.casio__key:hover .casio__face { filter: brightness(1.12); }
.casio__key:focus-visible { box-shadow: 0 0 0 3px #0a0b0c, 0 0 0 5px var(--casio-blue); }
.casio__key:active .casio__face, .casio__key.is-down .casio__face {
  transform: translateY(2px); filter: brightness(.9);
  box-shadow: inset 0 1px 0 #ffffff22, inset 0 -1px 0 #0003, 0 0 0 #000, 0 1px 2px #0008;
}
.casio__key.is-armed .casio__face { background: linear-gradient(#f2b24e, #d98b17); box-shadow: inset 0 1px 0 #fff7, inset 0 -3px 0 #0003, 0 2px 0 #000a, 0 0 10px #f0a030aa; }
@media (prefers-reduced-motion: reduce) { .casio__face, .casio__marks span, .casio__mode i { transition: none; } .casio.is-menu .casio__mode i { animation: none; } }

.casio__on { position: absolute; left: 366px; top: 366px; font-size: 11px; font-weight: 700; color: #eceff0; }
