/* A seismic network terminal: an amber dot display in a moulded bezel.
   Everything on the glass is drawn in whole dots, 2 px to a dot, and moves a dot or a row at a time. */
.sg {
  --bright: #ffc247;
  --normal: #f59b00;
  --dim: #a86400;
  --faint: #5c3500;
  --black: #0b0600;
  --bezel: #1d5d93;
  position: relative;
  width: 540px;
  height: 540px;
  overflow: hidden;
  /* the bezel: textured blue enamel on a cast frame, lit from above */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='2' seed='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.3 0.78'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #2a73b0 0%, var(--bezel) 30%, #174b78 100%);
  background-blend-mode: multiply, normal;
  box-shadow:
    inset 0 2px 0 #6aa9dc,
    inset 2px 0 0 #3c82bd,
    inset -2px 0 0 #123f66,
    inset 0 -2px 0 #0d3252;
  user-select: none;
  cursor: default;
}
.sg *,
.sg *::before,
.sg *::after {
  box-sizing: border-box;
}

/* the screen, set back in the bezel */
.sg-screen {
  position: absolute;
  inset: 22px;
  padding: 0 0 8px;
  border-radius: 7px;
  background: var(--black);
  box-shadow:
    0 0 0 2px #0a2740,
    0 -1.5px 0 3.5px #0b2e4b,
    0 2px 0 3.5px #4f93cc,
    inset 0 0 0 1px #000,
    inset 0 6px 14px #000;
  overflow: hidden;
}
.sg-screen canvas {
  display: block;
  image-rendering: pixelated;
  /* the dots glow a little into the dark around them; the dots themselves stay square */
  filter: drop-shadow(0 0 1.5px #ff9d0073) drop-shadow(0 0 5px #ff8a0033);
}
.sg-head {
  position: absolute;
  left: 0;
  top: 4px;
}

.sg-split {
  position: absolute;
  left: 0;
  top: 52px;
  width: 496px;
  height: 440px;
}
.sg-pane {
  position: relative;
  overflow: hidden;
}
.sg-table {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ---------- the split bar ---------- */
/* One text row. At rest it is a half-tone rule with a solid block to take hold of. */
.sg-handle {
  position: relative;
  z-index: 1;
  flex: none;
  height: 20px;
  outline: 0;
  background:
    conic-gradient(var(--normal) 25%, #0000 0 50%, var(--normal) 0 75%, #0000 0) 0 0 / 4px 4px content-box,
    var(--black);
  padding: 4px 4px;
  filter: drop-shadow(0 0 1.5px #ff9d0066);
}
/* a taller target than the row itself */
.sg-handle::before {
  content: "";
  position: absolute;
  inset: -8px 0;
}
.sg-grip {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 64px;
  height: 16px;
  margin-left: -32px;
  background: var(--bright);
  box-shadow: 0 0 0 4px var(--black);
}
.sg-grip svg {
  position: absolute;
  left: 9px;
  top: 2px;
  width: 46px;
  height: 12px;
  fill: var(--black);
  shape-rendering: crispEdges;
}
/* pointer over it: the rule fills in */
.sg-handle[data-hovering] {
  background:
    linear-gradient(var(--normal), var(--normal)) 0 0 / 100% 100% content-box,
    var(--black);
}
.sg-handle[data-hovering] .sg-grip {
  background: var(--bright);
}
/* held: the whole row goes to reverse video */
.sg-handle[data-dragging] {
  padding: 2px 0;
  background:
    linear-gradient(var(--bright), var(--bright)) 0 0 / 100% 100% content-box,
    var(--black);
}
.sg-handle[data-dragging] .sg-grip {
  background: var(--black);
  box-shadow: none;
}
.sg-handle[data-dragging] .sg-grip svg {
  fill: var(--bright);
}
/* keyboard focus: the block is the cursor, and blinks like one; a bracket stands at each end of the row */
.sg-handle:focus-visible {
  background:
    linear-gradient(var(--bright), var(--bright)) 0 0 / 8px 100% no-repeat border-box,
    linear-gradient(var(--bright), var(--bright)) 100% 0 / 8px 100% no-repeat border-box,
    linear-gradient(var(--normal), var(--normal)) 0 0 / 100% 100% content-box,
    var(--black);
}
.sg-handle:focus-visible .sg-grip {
  background: var(--bright);
  animation: sg-cursor 1s steps(1) infinite;
}
.sg-handle:focus-visible .sg-grip svg {
  animation: sg-cursor-mark 1s steps(1) infinite;
}
@keyframes sg-cursor {
  50% {
    background: var(--black);
  }
}
@keyframes sg-cursor-mark {
  50% {
    fill: var(--bright);
  }
}

/* ---------- the glass ---------- */
/* the display's own structure, kept faint: a dark line under each row of dots, and the tube's face catching the room */
.sg-glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(118deg, #ffffff12 0%, #ffffff00 34%),
    repeating-linear-gradient(180deg, #0000 0 1px, #00000038 1px 2px);
  box-shadow: inset 0 0 40px #000000b3;
  pointer-events: none;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .sg-handle:focus-visible .sg-grip,
  .sg-handle:focus-visible .sg-grip svg {
    animation: none;
  }
}
