@font-face {
  font-family: "Inter Tight";
  src: url("/fonts/of-inter-tight-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/of-inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/of-jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/of-jetbrains-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --field: #151513;
  --lime: #faff69;
  --grey: #414141;
  --panel: #1c1c19;
  --panel-hi: #242420;
  --ink: #f4f4ef;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, sans-serif;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--field);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

code {
  font-family: var(--mono);
  font-size: 0.94em;
  color: var(--lime);
}

/* ---- shell ---- */

.desk {
  height: 100vh;
  height: 100dvh;
  max-width: 1360px;
  margin: 0 auto;
  padding: clamp(16px, 2.6vw, 34px) clamp(16px, 3.4vw, 48px) 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--panel-hi);
  font-family: var(--display);
  font-weight: 800;
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.mark { color: var(--lime); }

.claim {
  color: var(--ink);
  opacity: 0.56;
  font-weight: 400;
  letter-spacing: 0.14em;
}

.panes {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 27%) minmax(0, 1fr);
  gap: clamp(14px, 2vw, 26px);
  padding: clamp(14px, 2.4vh, 26px) 0;
}

/* ---- the card ---- */

.card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: clamp(12px, 1.4vw, 18px);
  background: var(--panel);
  border: 1px solid var(--panel-hi);
  border-top: 2px solid var(--grey);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--grey) transparent;
}

.chead {
  position: sticky;
  top: calc(-1 * clamp(12px, 1.4vw, 18px));
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-top: clamp(12px, 1.4vw, 18px);
  margin-top: calc(-1 * clamp(12px, 1.4vw, 18px));
  background: var(--panel);
}

.card[data-state="open"] { border-top-color: var(--lime); }

.ctop {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ctitle {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.55;
}

.cstate {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.led {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--grey);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4) inset;
}

.card[data-state="idle"] .led { background: #4a4a44; }
.card[data-state="connecting"] .led { background: var(--lime); opacity: 0.55; }
.card[data-state="open"] .led {
  background: var(--lime);
  box-shadow: 0 0 9px rgba(250, 255, 105, 0.5);
}
.card[data-state="closed"] .led { background: #b4544a; }

.card[data-state="idle"] .cstate { opacity: 0.7; }
.card[data-state="connecting"] .cstate { opacity: 0.8; }
.card[data-state="open"] .cstate { color: var(--lime); }
.card[data-state="closed"] .cstate { color: #d4675c; }

/* ---- the gate ---- */

.gate {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--panel-hi);
}

.gread {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(36px, 4.6vw, 54px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  opacity: 0.4;
  font-variant-numeric: tabular-nums;
  transition: color 160ms linear, opacity 160ms linear;
}

.gate.on .gread {
  color: var(--lime);
  opacity: 1;
  text-shadow: 0 0 26px rgba(250, 255, 105, 0.22);
}

.glabel {
  font-family: var(--display);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.58;
}

.gsr {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink);
  opacity: 0.6;
  overflow-wrap: anywhere;
}

/* ---- facts ---- */

.meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dotted rgba(65, 65, 65, 0.5);
}

.mrow:last-child { border-bottom: 0; }

.mrow dt {
  font-family: var(--display);
  font-weight: 800;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.58;
  flex: none;
}

.mrow dd {
  margin: 0;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.mrow dd.set { color: var(--lime); }

/* ---- the toggle ---- */

.drq {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--grey);
  border-radius: 0;
  background: var(--panel-hi);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 130ms linear, background-color 130ms linear;
}

.drq .dlabel { text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; }
.drq .dvalue { color: var(--ink); opacity: 0.5; }

.drq[aria-pressed="true"] {
  border-color: var(--lime);
  background: rgba(250, 255, 105, 0.07);
}
.drq[aria-pressed="true"] .dlabel { color: var(--lime); }
.drq[aria-pressed="true"] .dvalue { color: var(--lime); opacity: 1; }

.drq:hover { border-color: var(--ink); }
.drq[aria-pressed="true"]:hover { border-color: var(--lime); }

.drq:focus-visible,
.kbtn:focus-visible,
.copy:focus-visible,
.kinput:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.gatenote {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink);
  opacity: 0.6;
}

/* ---- key ---- */

.cspacer {
  flex: 1 1 auto;
  min-height: 8px;
}

.keyrow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-hi);
}

.klabel {
  font-family: var(--display);
  font-weight: 800;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.58;
}

.kfield {
  display: flex;
  gap: 8px;
}

.kinput {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--grey);
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
}

.kinput::placeholder { color: var(--ink); opacity: 0.26; }

.kbtn,
.copy {
  flex: none;
  padding: 8px 14px;
  border: 1px solid var(--grey);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 130ms linear, color 130ms linear, background-color 130ms linear;
}

.kbtn:hover,
.copy:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.khint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink);
  opacity: 0.55;
}

.copy.done {
  border-color: var(--lime);
  color: var(--lime);
  background: rgba(250, 255, 105, 0.08);
}

.copybuf {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---- the tail ---- */

.tail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--panel-hi);
  background: var(--panel);
}

.thead {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--panel-hi);
  background: var(--panel-hi);
}

.ttitle {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.55;
}

.tcount {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.tstate {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.7;
}

.thead .copy {
  margin-left: auto;
  padding: 5px 11px;
  font-size: 10.5px;
}

.tail[data-state="open"] .tstate { color: var(--lime); opacity: 1; }
.tail[data-state="closed"] .tstate { color: #d4675c; opacity: 1; }

.out {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 15px 14px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.62;
  scrollbar-width: thin;
  scrollbar-color: var(--grey) transparent;
  overscroll-behavior: contain;
}

.out::-webkit-scrollbar { width: 8px; }
.out::-webkit-scrollbar-thumb { background: #2c2c28; border-radius: 4px; }
.out::-webkit-scrollbar-track { background: transparent; }

.ln {
  display: grid;
  grid-template-columns: 12.4em 4.4em minmax(0, 1fr);
  gap: 0 12px;
  padding: 1px 0;
  align-items: baseline;
}

.ln .ts { color: var(--ink); opacity: 0.32; font-variant-numeric: tabular-nums; font-size: 0.9em; letter-spacing: -0.01em; white-space: nowrap; }
.ln .lv { color: var(--ink); opacity: 0.5; text-transform: uppercase; font-size: 0.86em; letter-spacing: 0.06em; }
.ln .tx { color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }

.ln.lv-warn .lv { color: #d8b45a; opacity: 0.95; }
.ln.lv-error .lv,
.ln.lv-err .lv { color: #d4675c; opacity: 1; }
.ln.lv-info .lv { color: var(--ink); opacity: 0.45; }

.ln.err .tx { color: #d4675c; }
.ln.new { animation: enl 380ms ease-out both; }

@keyframes enl {
  from { background: rgba(250, 255, 105, 0.09); }
  to { background: transparent; }
}

.emptytail {
  margin: 0;
  padding: 6px 0;
  font-size: 12.5px;
  color: var(--ink);
  opacity: 0.72;
}

/* ---- footer ---- */

.foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 15px;
  border-top: 1px solid var(--panel-hi);
  font-size: 11.5px;
  line-height: 1.4;
}

.hint { color: var(--ink); opacity: 0.55; letter-spacing: 0.03em; }

.site {
  flex: none;
  color: var(--ink);
  opacity: 0.58;
  text-decoration: none;
  border-bottom: 1px solid var(--grey);
  padding-bottom: 1px;
  transition: opacity 120ms linear, border-color 120ms linear;
}
.site:hover,
.site:focus-visible {
  opacity: 1;
  border-bottom-color: var(--lime);
  outline: none;
}

/* ---- narrow: the card goes on top ---- */

@media (max-width: 860px) {
  .desk { height: auto; min-height: 100vh; overflow: visible; padding-bottom: 0; }
  .panes {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(320px, 60vh);
    gap: 14px;
  }
  .card { overflow: visible; }
  .gate { padding: 4px 0 8px; }
  .gread { font-size: clamp(44px, 15vw, 62px); }
  .keyrow { margin-top: 0; }
}

@media (max-width: 480px) {
  .banner { font-size: 9.5px; letter-spacing: 0.13em; padding-bottom: 11px; }
  .claim { letter-spacing: 0.1em; }
  .ln { grid-template-columns: 3.4em minmax(0, 1fr); gap: 0 10px; }
  .ln .ts { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ln.new { animation: none; }
  .gread { transition: none; }
}
