/**
 * mspaint / dcus - MacBook 3D Stage & Keyboard Styles
 */

/* --------------------------------------------------------------------------
   MacBook 3D Stage & Structure
   -------------------------------------------------------------------------- */
.stage-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  z-index: 5;
  margin-top: -30px;
}

.stage {
  width: 760px;
  height: 620px;
  flex: 0 0 auto;
  transform-origin: top center;
  position: relative;
}

.scene {
  position: absolute;
  inset: 0;
  perspective: 1700px;
  perspective-origin: 50% 62%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 14px;
}

.rig {
  position: relative;
  width: 560px;
  height: 570px;
  transform-style: preserve-3d;
}

.lid {
  position: absolute;
  left: 0;
  top: -110px;
  width: 560px;
  height: 340px;
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
  z-index: 5;
}

.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Outer lid (Aluminium back with logo) */
.back {
  transform: rotateY(180deg);
  border-radius: 18px 18px 13px 13px;
  background:
    radial-gradient(60% 50% at 50% 48%, rgba(255, 255, 255, 0.05), transparent 70%),
    linear-gradient(160deg, #3d3d41, #26262a 45%, #19191c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(0, 0, 0, 0.6),
    0 12px 36px rgba(0, 0, 0, 0.6);
}

.logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 57px;
  height: 57px;
  margin: -28px 0 0 -28px;
  object-fit: contain;
  transform: rotate(180deg);
  opacity: 0.95;
  pointer-events: none;
  filter: none;
}

/* Inner lid (Bezel + Screen - with realistic solid top and side edge thickness) */
.front {
  transform: rotateY(0deg);
  background: linear-gradient(180deg, #07070a, #030304);
  border-radius: 18px 18px 13px 13px;
  padding: 8px;
  box-shadow:
    0 -3px 0 0 #3a3a42,
    0 -5px 0 0 #202024,
    0 0 0 1px #5a5a60,
    0 0 0 2px #1b1b1f,
    0 0 0 3px #0c0c0e,
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.front::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 10px;
  right: 10px;
  height: 4px;
  background: linear-gradient(90deg, #222226, #484852 18%, #646472 50%, #484852 82%, #222226);
  border-radius: 4px 4px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.notch {
  position: absolute;
  top: 0;
  left: 50%;
  width: 66px;
  height: 15px;
  transform: translateX(-50%);
  background: #000;
  border-radius: 0 0 9px 9px;
  z-index: 4;
}

.notch::before,
.notch::after {
  content: "";
  position: absolute;
  top: 0;
  width: 9px;
  height: 9px;
}

.notch::before {
  left: -9px;
  background: radial-gradient(circle at 0 100%, transparent 8.5px, #000 9px);
}

.notch::after {
  right: -9px;
  background: radial-gradient(circle at 100% 100%, transparent 8.5px, #000 9px);
}

.notch i {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: #111118;
  box-shadow: inset 0 0 2px rgba(70, 130, 255, 0.7);
}

.chin {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  text-align: center;
  font-size: 7px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.sheen {
  position: absolute;
  inset: 0;
  border-radius: 18px 18px 13px 13px;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.17) 46%, rgba(255, 255, 255, 0.04) 54%, transparent 70%);
  background-size: 280% 100%;
  background-position: var(--sx, 0%) 0;
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 10px 10px 5px 5px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px #000;
}

.screen iframe {
  position: absolute;
  left: 0;
  top: 0;
  width: 1440px;
  height: 860px;
  border: 0;
  background: #fff;
  transform: scale(0.3792);
  transform-origin: 0 0;
}

.shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  display: block;
  background: #000;
}

.glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.08), transparent 36%, transparent 68%, rgba(0, 0, 0, 0.2));
}

/* Default Wallpaper / Clock / Dock fallback */
.wall {
  position: absolute;
  inset: 0;
  color: #fff;
  overflow: hidden;
  opacity: 0;
  background:
    radial-gradient(120% 90% at 80% 8%, #f3a15a 0%, transparent 45%),
    radial-gradient(100% 90% at 8% 92%, #2f4fbf 0%, transparent 55%),
    linear-gradient(160deg, #6b3b8f, #1d1b4a 70%);
}

.menu {
  height: 18px;
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  align-items: center;
  padding: 0 12px;
  font-size: 9.5px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.menu b { font-weight: 600; }
.ml, .mr { display: flex; align-items: center; gap: 12px; }
.mr { justify-content: flex-end; }

.clock {
  position: absolute;
  top: 84px;
  left: 0;
  right: 0;
  text-align: center;
}

.clock .t {
  font-size: 66px;
  font-weight: 200;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}

.clock .d {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 2px;
}

.dock {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
}

.dock i {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  display: block;
}

/* --------------------------------------------------------------------------
   MacBook Base, Keyboard & Trackpad
   -------------------------------------------------------------------------- */
.base {
  position: absolute;
  left: 0;
  top: 230px;
  width: 560px;
  height: 340px;
  border-radius: 6px 6px 28px 28px;
  background:
    radial-gradient(75% 38% at 50% 0%, rgba(255, 255, 255, 0.08), transparent 72%),
    linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.035) 38%, transparent 52%),
    linear-gradient(180deg, var(--chassis-hi), var(--chassis) 6%, var(--chassis) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 28px 56px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.hinge {
  position: absolute;
  top: 0;
  left: 75px;
  width: 410px;
  height: 15px;
  background: linear-gradient(#000, #0b0b0c);
  border-radius: 0 0 3px 3px;
  z-index: 2;
}

.spk {
  display: none;
}

.well {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 508px;
  padding: 5px;
  background: transparent;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 1px 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 3px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.kb {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
}

.kw {
  flex: var(--u, 1) 1 0;
  min-width: 0;
  height: 34px;
  padding: 1.2px;
  display: flex;
}

.row.f .kw {
  height: 22px;
}

.k {
  flex: 1;
  min-width: 0;
  position: relative;
  border-radius: 3.5px;
  background: linear-gradient(180deg, #242428, #17171a);
  box-shadow:
    0 1px 0 #000,
    0 2px 4px rgba(255, 238, 205, 0.15),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1.5px 2px rgba(0, 0, 0, 0.4);
  color: #f1f1f4;
  font-size: 7.5px;
  font-weight: 500;
  line-height: 1;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.3);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.k small {
  font-size: 5.5px;
  font-weight: 400;
  opacity: 0.8;
  line-height: 1;
}

.k.bl, .k.br {
  font-size: 5.5px;
  font-weight: 400;
  letter-spacing: 0.03em;
  justify-content: flex-end;
  padding: 0 7px 6px;
}

.k.bl { align-items: flex-start; }
.k.br { align-items: flex-end; }

.k.m {
  font-size: 5.5px;
  font-weight: 400;
  letter-spacing: 0.03em;
  justify-content: space-between;
  align-items: flex-end;
  padding: 7px 6px 6px;
}

.k.m small { font-size: 7px; opacity: 0.9; }
.k.mr { align-items: flex-start; }

.k.fnk {
  font-size: 5.5px;
  font-weight: 400;
  justify-content: space-between;
  align-items: flex-end;
  padding: 7px 7px 6px;
}

.k.fnk i { align-self: flex-start; font-style: normal; font-size: 7px; }

.row.f .k { font-size: 4.8px; font-weight: 400; gap: 2px; }
.row.f .k i { font-style: normal; font-size: 6px; line-height: 1; }
.row.f .k.bl { font-size: 5px; padding: 0 6px 4px; }

.k.tid::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #2c2c32, #0b0b0d);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.arrows {
  flex: 3 1 0;
  min-width: 0;
  display: flex;
}

.ac {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hk {
  height: 17px;
  padding: 1.2px;
  display: flex;
}

.k.ar { font-size: 5.5px; }

.fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 220px;
  background: linear-gradient(180deg, transparent 0%, rgba(11, 11, 13, 0.4) 25%, rgba(11, 11, 13, 0.85) 60%, var(--page) 100%);
  pointer-events: none;
}

.trackpad {
  position: absolute;
  left: 50%;
  top: 238px;
  width: 236px;
  height: 88px;
  transform: translateX(-50%);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012) 55%, rgba(0, 0, 0, 0.08));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 1px 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -8px 16px rgba(0, 0, 0, 0.16);
}

.lip {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 78px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(255, 255, 255, 0.07));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.spill {
  position: absolute;
  left: 30px;
  right: 30px;
  top: 4px;
  height: 230px;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(70% 62% at 50% 0%, rgba(160, 175, 255, 0.26), rgba(255, 170, 110, 0.07) 55%, transparent 78%);
  opacity: var(--sp, 0);
}

.hint {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.04em;
  pointer-events: none;
}
