:root {
  --wall: #1b1a24;
  --plastic: #d6c9a0;
  --plastic-hi: #efe4c2;
  --plastic-sh: #b3a47c;
  --outline: #2b2620;
  --recess: #6e6449;
  --recess-dk: #544c37;
  --recess-hi: #e3d8b4;
  --screen: #0d0f14;
  --desk: #3b2e27;
  --ink: #b8a682;
  --ink-hi: #e8d9b2;
  --note: #f2df7a;
  --note-ink: #3a3220;
  --mono: ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", monospace;

  --step16: polygon(16px 0, calc(100% - 16px) 0, calc(100% - 16px) 8px, calc(100% - 8px) 8px, calc(100% - 8px) 16px, 100% 16px, 100% calc(100% - 16px), calc(100% - 8px) calc(100% - 16px), calc(100% - 8px) calc(100% - 8px), calc(100% - 16px) calc(100% - 8px), calc(100% - 16px) 100%, 16px 100%, 16px calc(100% - 8px), 8px calc(100% - 8px), 8px calc(100% - 16px), 0 calc(100% - 16px), 0 16px, 8px 16px, 8px 8px, 16px 8px);
  --step8: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px), 0 8px, 4px 8px, 4px 4px, 8px 4px);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--mono);
  background-color: var(--wall);

  background-image:
    repeating-conic-gradient(rgb(255 255 255 / 0.025) 0% 25%, transparent 0% 50%),
    radial-gradient(ellipse at 50% 35%, #2a2737 0%, #221f2d 45%, var(--wall) 75%);
  background-size: 8px 8px, 100% 100%;
}

.wall {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 16px 0;
}

.monitor {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: min(100%, 2600px, max(1300px, 88vw));
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--outline);
  clip-path: var(--step16);
}

.bezel {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 28px 0;
  background: var(--plastic);
  clip-path: var(--step16);
  box-shadow: inset 8px 8px 0 var(--plastic-hi), inset -10px -10px 0 var(--plastic-sh);
}

.recess {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  padding: 10px;
  background: var(--recess);
  clip-path: var(--step8);
  box-shadow: inset 6px 6px 0 var(--recess-dk), inset -4px -4px 0 var(--recess-hi);
}

.screen {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  border-radius: 4px;
  background: var(--screen);
}

#term { width: 100%; height: 100%; }

#term canvas { filter: drop-shadow(0 0 1.5px rgb(212 165 116 / 0.35)); }

.scanlines {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / 0.12) 2px 3px);
  box-shadow: inset 0 0 24px rgb(0 0 0 / 0.35);
}

.chin {
  flex: 0 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 6px 10px 2px;
}

.note {
  margin: 0;
  padding: 5px 12px 7px;
  background: var(--note);
  color: var(--note-ink);
  font-size: 15px;
  line-height: 16px;
  white-space: nowrap;
  transform: rotate(-2.5deg) translateY(-4px);
  box-shadow: 4px 4px 0 rgb(0 0 0 / 0.25);
}

.note code {
  display: block;
  margin-top: 2px;
  font: inherit;
  font-size: 19px;
  line-height: 20px;
  user-select: all;
}

.panel { display: flex; align-items: center; gap: 16px; }

.vents {
  width: 54px;
  height: 24px;
  background: repeating-linear-gradient(to right, var(--plastic-sh) 0 4px, transparent 4px 10px);
}

.led { width: 8px; height: 8px; background: #5a5744; box-shadow: 0 0 0 4px #3b3a2e; }
.led[data-state="dialling"] { background: #f0b840; box-shadow: 0 0 0 4px #6e5a2a; animation: blink 0.5s steps(1) infinite; }
.led[data-state="online"] { background: #8cff6a; box-shadow: 0 0 0 4px #3b6e2f; }
.led[data-state="closed"] { background: #ff5a4a; box-shadow: 0 0 0 4px #6e2f2f; }

@keyframes blink { 50% { background: #5a5744; } }

@media (prefers-reduced-motion: reduce) {
  .led { animation: none !important; }
}

#sound {
  padding: 4px 12px;
  border: 0;
  background: var(--plastic);
  color: var(--note-ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  box-shadow: inset 3px 3px 0 var(--plastic-hi), inset -3px -3px 0 var(--plastic-sh), 0 0 0 3px var(--outline);
}

#sound[aria-pressed="false"] {
  color: #7a7158;
  box-shadow: inset -3px -3px 0 var(--plastic-hi), inset 3px 3px 0 var(--plastic-sh), 0 0 0 3px var(--outline);
}

#sound:hover, #sound:focus-visible { outline: none; background: var(--plastic-hi); }

.stand { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; width: 100%; }

.neck {
  width: 22%;
  min-width: 160px;
  height: 20px;
  background: var(--plastic-sh);
  box-shadow: inset 0 6px 0 rgb(0 0 0 / 0.25), 0 0 0 4px var(--outline);
}

.foot {
  width: 34%;
  min-width: 240px;
  height: 14px;
  background: var(--plastic);
  box-shadow: inset 0 4px 0 var(--plastic-hi), inset 0 -4px 0 var(--plastic-sh), 0 0 0 4px var(--outline);
}

.badge {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 16px;
  padding: 22px 24px 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 8px 22px;
  background: var(--desk);
  box-shadow: inset 0 4px 0 #4d3c32;
  color: #8f7e62;
  font-size: 17px;
  line-height: 20px;
  letter-spacing: 0.04em;
}

.badge strong { color: #c9b78f; letter-spacing: 0.12em; }
.badge code { font: inherit; color: var(--ink-hi); }
.badge a { color: var(--ink); text-decoration: none; border-bottom: 2px solid rgb(184 166 130 / 0.35); }
.badge a:hover, .badge a:focus-visible { color: var(--ink-hi); border-bottom-color: var(--ink-hi); outline: none; }

@media (max-height: 760px) {
  .wall { padding-top: 10px; }
  .bezel { padding: 14px 22px 0; }
  .recess { padding: 8px; }
  .screen { padding: 8px 10px; }
  .chin { height: 44px; padding-bottom: 6px; }
  .note { font-size: 12px; line-height: 12px; padding: 3px 8px 4px; }
  .note code { font-size: 14px; line-height: 14px; }
  .stand { display: none; }
  .badge { margin-top: 8px; padding: 8px 16px 10px; font-size: 14px; }
}

@media (max-width: 700px) {
  .wall { padding: 8px 8px 0; }
  .bezel { padding: 10px; }
  .recess { padding: 6px; }
  .screen { padding: 8px; }
  .chin, .stand { display: none; }
  .badge { margin-top: 10px; padding: 12px 12px 16px; gap: 6px 14px; font-size: 13px; line-height: 16px; }
}
