:root {
  --bg: #ffffff;
  --plate: #ebeef3;
  --dark: 150, 163, 184;
  --ink: #2b3140;
  --soft: rgba(43, 49, 64, 0.55);
  --accent: #19c2a0;
  --depth: 1;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 14px;
}

/* the plate the switch is carved into */
.np { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; width: min(272px, 100%); padding: 22px 22px 22px 24px; border-radius: 30px; background: linear-gradient(145deg, #f3f5f8, var(--plate)); box-shadow: calc(12px * var(--depth)) calc(14px * var(--depth)) calc(30px * var(--depth)) rgba(var(--dark), 0.5), inset 1px 1px 0 rgba(255, 255, 255, 0.9), inset -1px -1px 0 rgba(var(--dark), 0.14); }
.np__text { min-width: 0; display: grid; }
.np__label { font-size: 16px; line-height: 21px; font-weight: 700; font-stretch: 102%; letter-spacing: -0.01em; white-space: nowrap; }
.np__state { height: 17px; overflow: hidden; font-size: 13px; line-height: 17px; font-weight: 600; color: var(--soft); }
.np__state b { display: block; font-weight: inherit; }

.nt { --lift: 1; --on: 0; position: relative; flex: none; width: 104px; height: 56px; border: 0; border-radius: 28px; background: #e3e7ed; cursor: pointer; outline: none; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.nt:focus-visible { box-shadow: 0 0 0 3px var(--plate), 0 0 0 5px var(--ink); }
.nt__fill { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 28px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, #ffffff), var(--accent)); opacity: var(--on); clip-path: inset(0 calc((1 - var(--on)) * 46%) 0 0 round 28px); }
/* the carving: inner shadows on top of the groove, wider when the switch is on */
.nt__carve { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 28px; box-shadow: inset calc(5px * var(--depth)) calc(5px * var(--depth)) calc((10px + 5px * var(--on)) * var(--depth)) rgba(var(--dark), calc(0.75 + 0.1 * var(--on))), inset calc(-5px * var(--depth)) calc(-5px * var(--depth)) calc(10px * var(--depth)) rgba(255, 255, 255, calc(0.95 - 0.55 * var(--on))); pointer-events: none; }
.nt__knob { position: absolute; left: 6px; top: 6px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #ffffff, #dde2ea); box-shadow: calc(5px * var(--lift) * var(--depth)) calc(6px * var(--lift) * var(--depth)) calc(12px * var(--lift) * var(--depth)) rgba(var(--dark), 0.85), calc(-2px * var(--lift)) calc(-2px * var(--lift)) calc(5px * var(--lift)) rgba(255, 255, 255, 0.9), inset 1px 1px 0 rgba(255, 255, 255, 0.95); }
.nt__dimple { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 50%; background: linear-gradient(145deg, #dfe4eb, #f7f8fa); box-shadow: inset 2px 2px 4px rgba(var(--dark), 0.65), inset -2px -2px 3px rgba(255, 255, 255, 0.9); }
.nt__dimple i { width: 1.500px; height: 8px; border-radius: 1px; background: color-mix(in srgb, var(--accent) calc(var(--on) * 100%), rgba(var(--dark), 0.9)); }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #2b3140; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(43, 49, 64, 0.3)); z-index: 5; }
