/* siphon — clone the OCTO NOTE gate treatment; quiet cards on the pink field
   Nohemi: worker names + big numbers
   JetBrains Mono (.micro): everything else */

@font-face { font-family: 'Nohemi'; font-weight: 100 900; font-display: swap;
  src: url(fonts/Nohemi-VF.ttf) format('truetype'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 300 500; font-display: swap;
  src: url(fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

[hidden] { display: none !important; }

:root {
  --bg: #f386a3;
  --panel: #f59bb3;
  --panel-2: #f7a9be;
  --fg: #3a2e30;
  --faint: #7a5c60;
  --crit: #6b1938;
  --ok: #2f7d4a;
  --warn: #8a5a00;
  --busy: #2560c0;
  --off: #8b7a7e;
  --ink: #3a2e30;
  --dim: #7a5c60;
  --accent: #d65f8a;
  --card: #f59bb3;
  --line: rgba(58, 46, 48, .22);
  --line-2: rgba(58, 46, 48, .14);
  --sunk: rgba(58, 46, 48, .07);
  --ease: cubic-bezier(.2,.9,.25,1);
  --bw: 1.5px;
  --mono: 13px;
  --body: 21px;
  color-scheme: light;
}
[data-mode="dark"] {
  --bg: #1b1418;
  --panel: #251a1f;
  --panel-2: #2b1f24;
  --fg: #ecdedf;
  --faint: #a5888e;
  --crit: #ff8aa5;
  --ok: #7fc490;
  --warn: #f0b860;
  --busy: #8db6ff;
  --off: #8a7a7e;
  --ink: #ecdedf;
  --dim: #a5888e;
  --accent: #d65f8a;
  --card: #251a1f;
  --line: rgba(236, 222, 223, .18);
  --line-2: rgba(236, 222, 223, .12);
  --sunk: rgba(236, 222, 223, .07);
  color-scheme: dark;
}

html { background: var(--bg); }
body {
  margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  font-family: 'Nohemi', system-ui, sans-serif; font-size: var(--body); font-weight: 400; letter-spacing: .01em;
  min-height: 100dvh;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

.micro, .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px; font-weight: 300;
  letter-spacing: .10em; text-transform: uppercase;
  color: var(--faint);
}
.link {
  appearance: none; background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--mono);
  letter-spacing: .10em; text-transform: uppercase; color: var(--faint);
}
.link:hover, .link:focus { color: var(--fg); }
.link:disabled { opacity: .4; cursor: default; }

/* ============ GATE (cloned from OCTO NOTE) ============ */
.gate { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 22vh; width: 100%; }
.gate-box { position: relative; display: block; padding: 10px 14px; cursor: text; }
.slots { display: flex; gap: 22px; }
.slots i {
  display: block; position: relative; width: 32px; height: 46px;
  border-bottom: 2px solid var(--line);
  transition: border-color .2s var(--ease);
}
.slots i.on { border-bottom-color: var(--fg); }
.slots i.on::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  border-radius: 50%; background: var(--fg);
  animation: rise .18s var(--ease);
}
.slots i.cur { border-bottom-color: var(--fg); animation: pulse 1.1s ease-in-out infinite; }
.gate.bad .slots { animation: shake .36s var(--ease); }
.gate.bad .slots i { border-bottom-color: var(--crit); }
.gate.wait .slots i { border-bottom-color: var(--line-2); animation: none; }
#pin {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; font-size: 16px;
  color: transparent; caret-color: transparent; background: transparent;
}
.gate-msg { min-height: 18px; text-align: center; font-size: var(--mono); letter-spacing: .10em; color: var(--faint); }
.gate.bad .gate-msg { color: var(--crit); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes pulse { 0%, 100% { border-bottom-color: var(--fg); } 50% { border-bottom-color: var(--line-2); } }
@media (prefers-reduced-motion: reduce) {
  .gate.bad .slots, .slots i.cur, .slots i.on::after { animation: none; }
}
@media (max-width: 480px) { .gate { margin-top: 18vh; } .slots { gap: 18px; } .slots i { width: 28px; height: 42px; } }

/* ============ top ============ */
.top { padding-top: calc(18px + env(safe-area-inset-top, 0px)); padding-bottom: 10px; }
.top-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.brand { font-family: 'Nohemi', sans-serif; font-size: 24px; font-weight: 600; letter-spacing: -.01em; color: var(--fg); margin: 0; line-height: 1; }
.top-actions { display: flex; gap: 22px; }
.updated { margin: 6px 0 0; font-size: 12px; letter-spacing: .08em; }

/* ============ totals: cards, big Nohemi ============ */
.totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 22px 0 0; }
@media (min-width: 560px) { .totals { grid-template-columns: repeat(4, 1fr); } }
.tot { display: grid; gap: 6px; padding: 16px 18px 18px; background: var(--panel); border-radius: 4px; border: 1px solid var(--line-2); }
.tot-k { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: var(--mono); font-weight: 300; letter-spacing: .10em; text-transform: uppercase; color: var(--faint); }
.tot-v { font-family: 'Nohemi', sans-serif; font-size: 54px; font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.tot-v.bad { color: var(--crit); }
@media (max-width: 480px) { .tot-v { font-size: 44px; } }

/* ============ section head ============ */
.sec {
  font-family: 'Nohemi', sans-serif; font-size: 22px; font-weight: 600;
  color: var(--fg); letter-spacing: -.01em; text-transform: lowercase;
  margin: 40px 0 10px; padding: 0;
}

/* ============ worker card ============ */
.workers { display: grid; gap: 12px; grid-template-columns: 1fr; }
.card { padding: 20px 22px 22px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 4px; display: grid; grid-template-columns: 1fr; gap: 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.card-name { font-family: 'Nohemi', sans-serif; font-weight: 600; font-size: 28px; letter-spacing: -.01em; margin: 0; line-height: 1; }
.card-sub { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; font-weight: 300; color: var(--faint); letter-spacing: .04em; margin: 0; text-transform: lowercase; }

.pill { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; font-weight: 300; letter-spacing: .10em; text-transform: uppercase; color: var(--off); }
.pill::before { content: '○'; margin-right: 6px; font-weight: 400; }
.pill.idle { color: var(--ok); }
.pill.busy { color: var(--busy); }
.pill.degraded { color: var(--warn); }
.pill.idle::before, .pill.busy::before, .pill.degraded::before { content: '●'; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 0; }
@media (min-width: 560px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.facts > div { min-width: 0; }
.facts dt { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; font-weight: 400; color: var(--faint); letter-spacing: .10em; text-transform: uppercase; }
.facts dd { margin: 2px 0 0; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 15px; font-weight: 400; letter-spacing: .01em; overflow-wrap: anywhere; line-height: 1.3; }
.facts dd.wide, .facts div.wide { grid-column: 1 / -1; }
.facts dd.unk { color: var(--faint); }

.live { display: grid; gap: 14px; padding-top: 4px; }
.metric { display: grid; gap: 4px; min-width: 0; }
.metric-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.metric-k { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; font-weight: 400; letter-spacing: .10em; text-transform: uppercase; color: var(--faint); }
.metric-v { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 15px; font-weight: 400; letter-spacing: .01em; text-align: right; }
.metric-v.warn { color: var(--warn); }
.metric-v.bad { color: var(--crit); }

.spark { position: relative; --tone: var(--accent); }
.spark canvas { display: block; width: 100%; height: 22px; color: var(--fg); }
.spark-scale { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--faint); letter-spacing: .06em; }

.bar { height: 3px; background: var(--sunk); overflow: hidden; border: none; border-radius: 0; }
.bar > i { display: block; height: 100%; width: 0; background: var(--fg); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--crit); }

.nolive { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: var(--mono); color: var(--faint); letter-spacing: .06em; margin: 2px 0 0; text-transform: uppercase; }

.hw { padding: 2px 0 0; }
.hw > summary { min-height: 28px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; cursor: pointer; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); list-style: none; }
.hw > summary::after { content: '+'; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 14px; font-weight: 300; }
.hw[open] > summary::after { content: '−'; }
.hw > summary:hover { color: var(--fg); }
.hw-body { padding: 10px 0 4px; }
.hw > dl { margin: 0; display: grid; gap: 4px; }
.hw dt { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--faint); letter-spacing: .10em; text-transform: uppercase; }
.hw dd { margin: 0 0 6px; overflow-wrap: anywhere; font-size: 13px; }

/* ============ jobs ============ */
.jobs-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.jobs { width: 100%; border-collapse: collapse; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 14px; font-weight: 300; }
.jobs th { text-align: left; font-weight: 400; font-size: 12px; color: var(--faint); letter-spacing: .10em; text-transform: uppercase; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
.jobs td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; letter-spacing: .01em; }
.jobs td.num, .jobs th.num { text-align: right; font-variant-numeric: tabular-nums; }
.jobs td.e { color: var(--crit); font-size: 12px; overflow-wrap: anywhere; }
.jobs tr.ok td.s { color: var(--ok); }
.jobs tr.fail td.s { color: var(--crit); }
@media (max-width: 700px) {
  .jobs thead { display: none; }
  .jobs, .jobs tbody, .jobs tr, .jobs td { display: block; width: 100%; }
  .jobs tr { padding: 10px 0 8px; border-bottom: 1px solid var(--line-2); }
  .jobs td { border: none; padding: 0 0 2px; }
  .jobs td::before { content: attr(data-label); display: inline-block; min-width: 76px; font-size: 12px; color: var(--faint); font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .10em; text-transform: uppercase; }
}
.empty { margin: 10px 0 0; color: var(--faint); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: var(--mono); letter-spacing: .10em; text-transform: uppercase; }

#dash > .wrap { padding-bottom: 60px; }
