/* Home, projects and servers pages: every block is built like the UPS module Can kept.
   Off-white module bodies on a light grey wall, a lamp and a state line, rows of
   readings. Barlow Condensed for names and figures, Barlow for text. The meter is
   the one dark device. */

:root {
  --wall:       #dfe0db;
  --ink:        #1c1f1e;
  --body:       #f3f2ec;
  --edge:       #b3b7b0;
  --row:        #dcdbd4;
  --lamp-off:   #46514a;
  --lamp-on:    #2aa548;
  --amber-on:   #ee9c16;
  --brand:      #ff4655;   /* Quizcik's own red, used only on its module */
  --lcd:        #b6c3a7;
  --lcd-ink:    #17200e;
  --housing:    #2c302e;
  --housing-in: #e8eae5;
  --shadow-2:   0 2px 5px rgba(18, 22, 20, .2), 0 1px 1px rgba(18, 22, 20, .16);
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --text: 'Barlow', 'Segoe UI', sans-serif;
  --seg:  'DSEG7 Classic', 'Barlow Condensed', monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font: 400 16px/1.45 var(--text);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, p, dl, dd, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }

.md-wrap { width: calc(100% - 48px); max-width: 1120px; margin: 0 auto; }

/* ---------- Head ---------- */
.md-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 20px; padding: 16px 0 14px; border-bottom: 1px solid var(--edge); }
.md-title { font: 700 26px/1 var(--cond); letter-spacing: .005em; }
.md-title a { text-decoration: none; }
.md-nav { display: flex; flex-wrap: wrap; margin-left: auto; }
.md-nav a { font: 500 17px/1 var(--text); text-decoration: none; padding: 13px 11px; }
.md-nav a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.md-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.md-lang { display: flex; border: 1px solid var(--edge); border-radius: 3px; overflow: hidden; background: var(--body); }
.md-lang a { font: 700 15px/1 var(--cond); letter-spacing: .04em; text-decoration: none; padding: 12px 11px; min-width: 44px; text-align: center; }
.md-lang a[aria-current] { background: var(--ink); color: var(--body); }

.md-page { padding: 24px 0 8px; }
.md-group { margin-top: 28px; }
.md-label { font: 700 19px/1 var(--cond); letter-spacing: .01em; margin-bottom: 10px; }
.md-row { display: grid; gap: 10px; align-items: start; }
.md-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; }
.md-row-top { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: stretch; }
.md-row-power { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); align-items: stretch; }
.md-row-quakes { margin-top: 28px; }

/* ---------- The module (the UPS, generalised) ---------- */
.mod {
  background: var(--body);
  border: 1px solid var(--edge);
  border-radius: 4px;
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, .8);
  padding: 13px 14px 14px;
  display: flex; flex-direction: column; gap: 12px;
  min-width: 0;
}
.brk-name { font: 700 22px/1.05 var(--cond); letter-spacing: .005em; }
.brk-name a { text-decoration: none; }
.brk-name a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.brk-state { display: flex; align-items: center; gap: 8px; font: 600 16px/1.2 var(--text); }
.brk-lamp {
  flex: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--lamp-off);
  box-shadow: inset 0 -2px 2px rgba(0, 0, 0, .35), inset 0 2px 2px rgba(255, 255, 255, .18), 0 0 0 1px rgba(18, 22, 20, .45);
}
.mod.is-on .brk-lamp, .ups .brk-lamp { background: var(--lamp-on); }
.ups.is-batt .brk-lamp { background: var(--amber-on); }
.ups.is-cold .brk-lamp { background: var(--lamp-off); }
.ups-read { display: grid; gap: 6px; }
.ups-read div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--row); padding-bottom: 5px; }
.ups-read dt { font: 400 15px/1.2 var(--text); }
.ups-read dd { font: 600 17px/1.2 var(--text); text-align: right; overflow-wrap: anywhere; min-width: 0; }
.ups-plate { font: 600 14px/1 var(--cond); letter-spacing: .03em; }
.ups .ups-plate { margin-top: auto; }

/* ---------- The project display: one project at a time ---------- */
.disp { display: grid; padding: 14px; }
.disp-panel { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; visibility: hidden; }
.disp-panel.is-shown { visibility: visible; }
.disp-shot { display: block; width: 100%; height: auto; aspect-ratio: 1024 / 500; border-radius: 3px; background: #0b0b0c; }
.disp-read { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 24px; padding: 0 4px; }
.disp-id { display: grid; gap: 8px; align-content: start; }
.disp-name { font-size: 34px; line-height: 1; }
.disp-tag { font: 500 17px/1.3 var(--text); }
.disp-facts { display: grid; gap: 8px; align-content: start; }
.disp-link {
  justify-self: start;
  font: 700 19px/1 var(--cond); letter-spacing: .01em;
  text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px;
  padding: 12px 0 6px; overflow-wrap: anywhere;
}
.disp-panel[data-proj="quizcik"] .disp-link { text-decoration-color: var(--brand); }
.disp-link:hover { text-decoration-thickness: 4px; }

/* ---------- Servers ---------- */
.srv .ups-read { margin-top: -2px; }
.srv.is-unknown .brk-state, .srv:not(.is-on) .ups-read dd { color: #4b524d; }
.md-copy, .md-copy-inline {
  appearance: none; cursor: pointer; color: var(--ink); text-align: left;
  font: 600 17px/1.15 var(--cond); letter-spacing: .02em;
}
.md-copy {
  margin-top: auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px;
  width: 100%; min-height: 44px;
  background: #fff; border: 1px solid var(--edge); border-radius: 3px;
  padding: 11px 10px 10px;
}
.md-copy:hover { border-color: #8f948d; }
.md-copy-val { overflow-wrap: anywhere; }
.md-copy-act { font: 500 14px/1.15 var(--text); letter-spacing: 0; color: #4b524d; }
.md-copy.is-copied { background: var(--ink); color: var(--body); border-color: var(--ink); }
.md-copy.is-copied .md-copy-act { color: var(--body); }
.md-copy-inline {
  background: none; border: 0; padding: 0;
  font: 600 17px/1.2 var(--text); letter-spacing: 0;
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.md-copy-inline.is-copied { text-decoration: none; }

/* ---------- The meter (round one, unchanged) ---------- */
.meter {
  background: var(--housing); color: var(--housing-in);
  border-radius: 6px;
  padding: 12px 14px 14px;
  box-shadow: var(--shadow-2);
  display: grid; gap: 10px; min-width: 0;
}
.meter-head { display: flex; align-items: center; gap: 12px; }
.meter-brand { font: 700 17px/1 var(--cond); letter-spacing: .03em; }
.meter-led { width: 9px; height: 9px; border-radius: 50%; background: #5b2420; box-shadow: inset 0 -1px 1px rgba(0, 0, 0, .5); }
.meter-led.is-pulse { background: #ff3b2f; }
.lcd {
  background: var(--lcd); color: var(--lcd-ink);
  border-radius: 4px;
  padding: 12px 14px 12px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .38);
  display: grid; gap: 12px; min-width: 0;
}
.lcd-label { font: 700 14px/1 var(--cond); letter-spacing: .03em; }
.lcd-main { display: flex; align-items: flex-end; gap: 12px; }
.lcd-main .lcd-label { align-self: flex-start; }
.lcd-digits { display: inline-grid; font: 700 58px/1 var(--seg); }
.lcd-digits > span { grid-area: 1 / 1; justify-self: end; }
.lcd-ghost { opacity: .09; }
.lcd-unit { font: 700 30px/1 var(--cond); padding-bottom: 2px; }
.lcd-regs { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.lcd-regs div { display: grid; gap: 3px; }
.lcd-regs dt { font: 700 14px/1 var(--cond); letter-spacing: .03em; }
.lcd-regs dd { font: 700 22px/1 var(--cond); }
.lcd-graph { display: grid; gap: 7px; position: relative; }
.lcd-read { position: absolute; top: 0; white-space: nowrap; transform: translateX(-50%); }
.lcd-graph.is-reading [data-cap] { visibility: hidden; }
.lcd-bars.is-reading span { opacity: .3; }
.lcd-bars.is-reading span.is-hot { opacity: 1; }
.lcd-bars {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px;
  align-items: end; height: 58px;
  border-bottom: 2px solid var(--lcd-ink);
}
.lcd-bars span { height: var(--h); min-height: 2px; background: var(--lcd-ink); }
.lcd-bars span.is-outage { background: transparent; box-shadow: inset 0 0 0 1.5px var(--lcd-ink); }
.lcd-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; font: 700 14px/1.2 var(--cond); letter-spacing: .02em; }

/* ---------- Projects and quakes ---------- */
.pj-list { flex: 1; display: grid; grid-auto-rows: 1fr; gap: 1px; margin: 0 -8px; }
.pj-list li { display: grid; }
.pj-list a {
  display: grid; gap: 2px;
  text-decoration: none; padding: 6px 8px 6px; border-radius: 3px; min-height: 44px; align-content: center;
}
.pj-name { font: 700 19px/1.1 var(--cond); }
.pj-tag { font: 400 14px/1.3 var(--text); }
.pj-list a:hover { background: #e7e6df; }
.pj-list a.is-shown { background: var(--ink); color: var(--body); }
.qk-empty { font: 500 16px/1.4 var(--text); }
.qk-list { width: 100%; border-collapse: collapse; font: 400 15px/1.3 var(--text); }
.qk-list th { text-align: left; font: 700 14px/1 var(--cond); letter-spacing: .03em; padding: 0 12px 6px 0; border-bottom: 1px solid var(--row); }
.qk-list td { padding: 7px 12px 6px 0; border-bottom: 1px solid var(--row); vertical-align: top; }
.qk-list td:nth-child(-n+2) { white-space: nowrap; font-weight: 600; }
.qk-list tr.is-strong td { font-weight: 600; }
.qk .ups-plate { margin-top: auto; }

/* ---------- Inner pages: projects and servers ---------- */
.md-h1 { font: 700 34px/1 var(--cond); letter-spacing: .005em; margin: 4px 0 16px; }

.pjx-list { display: grid; gap: 12px; }
.pjx { flex-direction: row; gap: 22px; padding: 14px; }
.pjx-shot { flex: 0 0 52%; display: block; }
.pjx-shot img { display: block; width: 100%; height: auto; aspect-ratio: 1024 / 500; border-radius: 3px; background: #0b0b0c; }
.pjx-read { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 0; }
.pjx-name { font-size: 34px; line-height: 1; }
.pjx-tag { font: 500 17px/1.3 var(--text); margin-top: -2px; }
.pjx-points li { font: 400 15px/1.3 var(--text); padding: 6px 0 5px; border-bottom: 1px solid var(--row); }
.pjx-link { margin-top: auto; }
#quizcik .pjx-link { text-decoration-color: var(--brand); }

.srvx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.srvx-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; }
.srvx-name { font-size: 30px; }
.srvx-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 22px; align-items: start; }
.srvx-body:not(:has(.srvx-who)) { grid-template-columns: minmax(0, 1fr); }
.srvx-who-h { font: 600 15px/1.2 var(--text); padding-bottom: 6px; border-bottom: 1px solid var(--row); }
.srvx-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0 5px; border-bottom: 1px solid var(--row); font: 400 15px/1.25 var(--text); }
.srvx-player { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.srvx-meta { flex: none; color: #4b524d; }
.srvx-list li.srvx-empty { border-bottom: 0; color: #4b524d; }
.srvx-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.srvx-foot .md-copy { flex: 1 1 200px; width: auto; margin-top: 0; }
.srvx-connect {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px;
  background: var(--ink); color: var(--body); border-radius: 3px; text-decoration: none;
  font: 700 17px/1 var(--cond); letter-spacing: .02em;
}
.srvx-connect:hover { background: #3a403d; }

/* ---------- Foot ---------- */
.md-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px;
  margin-top: 34px; padding: 14px 0 26px;
  border-top: 1px solid var(--edge);
  font: 600 16px/1.3 var(--cond); letter-spacing: .01em;
}
/* Tip link. The vertical padding widens the tap area without moving the line. */
.md-foot a { padding: 10px 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.md-foot a:hover { text-decoration-thickness: 3px; }

@media (pointer: coarse) {
  .md-nav a, .md-lang a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 960px) {
  .pjx { flex-direction: column; }
  .pjx-shot { flex: none; }
  .srvx-grid { grid-template-columns: minmax(0, 1fr); }
  .md-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-row-top, .md-row-power { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .srvx-body { grid-template-columns: minmax(0, 1fr); }
  .md-h1 { font-size: 30px; }
  .pjx-name { font-size: 30px; }
  .md-wrap { width: calc(100% - 24px); }
  .md-nav { margin-left: 0; order: 3; width: 100%; }
  .md-nav a { padding: 12px 16px 10px 0; }
  .md-lang { margin-left: auto; }
  .md-page { padding-top: 16px; }
  .md-group, .md-row-quakes { margin-top: 22px; }
  .md-row { gap: 8px; }
  .disp-read { grid-template-columns: minmax(0, 1fr); }
  .disp-name { font-size: 30px; }
}
@media (max-width: 440px) {
  .mod { padding: 11px 10px 12px; gap: 10px; }
  .srv .brk-name { font-size: 20px; }
  .srv .ups-read dt { font-size: 14px; }
  .srv .ups-read dd { font-size: 15px; }
  .md-copy { font-size: 15px; padding: 10px 8px 9px; flex-direction: column; }
  .lcd-digits { font-size: 50px; }
}
