/* PARACYT TV
   Design language: a specimen slide. PARACYT is a parasitic inscription chain
   that writes itself into a host chain's memo field, so the interface reads as
   an instrument panel looking at that organism. Two accents carry meaning
   rather than decoration: filament-teal is PARACYT, host-amber is the chain
   being inscribed into. Chain data is always monospace, because on this chain
   the record genuinely is a text record. */

:root {
  --ink:        #071016;
  --ink-2:      #0D1D25;
  --ink-3:      #122C36;
  --rule:       #1B3E4A;
  --bone:       #E8EDE9;
  --bone-dim:   #7E948F;
  --bone-faint: #4A5F5C;
  --filament:   #3DE0C0;
  --filament-d: #1E9E86;
  --host:       #E8A33D;
  --host-d:     #A8752A;
  --alarm:      #FF6B5A;

  --safe-x: 5.5vw;
  --safe-y: 4.5vh;

  --display: "Samsung One", "SamsungOne", system-ui, "Roboto Condensed", Roboto, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--display);
  overflow: hidden;
  /* A TV is a pointer-free device. Kill every hover/selection artifact. */
  cursor: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  /* Faint field gradient: the slide is lit from the upper left. */
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(1200px 700px at 18% 8%, rgba(61,224,192,0.055), transparent 62%),
    radial-gradient(900px 600px at 88% 92%, rgba(232,163,61,0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#app { position: relative; z-index: 1; display: flex; height: 100%; }

/* ---------- focus ------------------------------------------------------
   Focus must be legible from three metres away. Ring plus glow plus lift. */

.f {
  outline: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.f.on {
  box-shadow: 0 0 0 3px var(--filament), 0 0 34px rgba(61,224,192,0.42);
  transform: scale(1.028);
  z-index: 5;
}

.f.on .card-title { color: var(--filament); }

@media (prefers-reduced-motion: reduce) {
  .f { transition: none; }
  .f.on { transform: none; }
}

/* ---------- left rail --------------------------------------------------- */

#rail {
  width: 21rem;
  flex: 0 0 21rem;
  padding: var(--safe-y) 0 var(--safe-y) var(--safe-x);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(13,29,37,0.72), rgba(7,16,22,0.72));
}

.brand { margin-bottom: 4.2rem; padding-right: 2rem; }

.brand-mark {
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: 0.32em; text-indent: 0.32em;
  line-height: 1; white-space: nowrap;
  color: var(--bone);
}

.brand-sub {
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.94rem;
  letter-spacing: 0.16em;
  color: var(--filament-d);
  text-transform: uppercase;
}

nav { display: flex; flex-direction: column; gap: 0.5rem; padding-right: 2rem; }

.nav-item {
  display: flex; align-items: center; gap: 1.15rem;
  padding: 1.15rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 1.35rem; font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bone-dim);
  background: transparent;
}

.nav-item .glyph {
  width: 0.42rem; height: 1.5rem;
  background: var(--bone-faint);
  flex: 0 0 auto;
  transition: background-color 140ms ease, height 140ms ease;
}

.nav-item.active { color: var(--bone); background: var(--ink-2); border-color: var(--rule); }
.nav-item.active .glyph { background: var(--filament); height: 2rem; }
.nav-item.f.on { color: var(--bone); background: var(--ink-3); }

.rail-foot {
  margin-top: auto; padding-right: 2rem;
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--bone-faint); line-height: 1.9;
}

.dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; margin-right: 0.6rem; vertical-align: middle; }
.dot.up { background: var(--filament); box-shadow: 0 0 10px var(--filament); }
.dot.down { background: var(--alarm); box-shadow: 0 0 10px var(--alarm); }
.dot.wait { background: var(--host); }

/* ---------- main -------------------------------------------------------- */

#main {
  flex: 1 1 auto;
  padding: var(--safe-y) var(--safe-x) 0 3.5rem;
  overflow: hidden;
  display: flex; flex-direction: column;
}

.view { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding-bottom: 2rem; scrollbar-width: none; }
.view::-webkit-scrollbar { display: none; }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 2.6rem; }

h1 {
  font-size: 3.2rem; font-weight: 800;
  letter-spacing: -0.015em; line-height: 1;
}

.view-note { font-family: var(--mono); font-size: 1rem; color: var(--bone-dim); letter-spacing: 0.06em; }

.eyebrow {
  font-family: var(--mono); font-size: 0.92rem;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--filament-d);
  margin-bottom: 1.15rem;
}

section + section { margin-top: 3rem; }

/* ---------- cards ------------------------------------------------------- */

.grid { display: grid; gap: 1.5rem; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}

/* A hairline on the left edge tells you which side of the system a card
   belongs to: teal is PARACYT, amber is the host chain it lives inside. */
.card.para::before,
.card.host::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.card.para::before { background: var(--filament); }
.card.host::before { background: var(--host); }

.card-title {
  font-family: var(--mono); font-size: 0.94rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone-dim); margin-bottom: 0.9rem;
}

.card-value { font-size: 2.5rem; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.card-value.mono { font-family: var(--mono); font-size: 2.05rem; font-weight: 600; }
.card-sub { margin-top: 0.55rem; font-family: var(--mono); font-size: 1rem; color: var(--bone-dim); }

.hero {
  background: linear-gradient(135deg, var(--ink-2) 0%, #0A2129 100%);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2.6rem 2.8rem;
  display: flex; align-items: center; justify-content: space-between; gap: 3rem;
}

.hero-value { font-size: 4.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.hero-value .unit { font-size: 1.8rem; font-weight: 600; color: var(--bone-dim); margin-left: 0.6rem; letter-spacing: 0; }

/* ---------- rows -------------------------------------------------------- */

.row {
  display: flex; align-items: center; gap: 1.6rem;
  padding: 1.25rem 1.6rem;
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.row + .row { margin-top: 0.75rem; }
.row .grow { flex: 1 1 auto; min-width: 0; }
.row .name { font-size: 1.35rem; font-weight: 600; margin-bottom: 0.3rem; }
.row .meta { font-family: var(--mono); font-size: 0.95rem; color: var(--bone-dim); }
.row .num { font-family: var(--mono); font-size: 1.4rem; font-weight: 600; text-align: right; white-space: nowrap; }

.tick-up { color: var(--filament); }
.tick-down { color: var(--alarm); }

.chip {
  display: inline-block;
  font-family: var(--mono); font-size: 0.82rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.32rem 0.72rem;
  border: 1px solid var(--rule); border-radius: 2px;
  color: var(--bone-dim);
}
.chip.para { border-color: var(--filament-d); color: var(--filament); }
.chip.host { border-color: var(--host-d); color: var(--host); }
.chip.warn { border-color: var(--alarm); color: var(--alarm); }

/* ---------- inscription strip (signature element) -----------------------
   A live readout of the actual GLEWME:v1 memo record behind whatever is
   focused. The chain's mechanic, made visible instead of described. */

#strip {
  flex: 0 0 auto;
  height: 4.6rem;
  display: flex; align-items: center; gap: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 1.02rem;
  color: var(--bone-faint);
  letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden;
}

#strip .label {
  color: var(--filament-d);
  letter-spacing: 0.22em; text-transform: uppercase;
  font-size: 0.86rem;
  flex: 0 0 auto;
}

#strip .record { color: var(--bone-dim); overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
#strip .record .op { color: var(--filament); }
#strip .record .host { color: var(--host); }
#strip .hint { flex: 0 0 auto; color: var(--bone-faint); font-size: 0.9rem; letter-spacing: 0.1em; }

/* ---------- pairing / QR ------------------------------------------------ */

.pair-wrap { display: flex; gap: 3.5rem; align-items: center; }
.qr-box { background: #fff; padding: 1.1rem; border-radius: 3px; flex: 0 0 auto; }
.qr-box img { display: block; width: 20rem; height: 20rem; image-rendering: pixelated; }

.pair-code {
  font-family: var(--mono); font-size: 3.6rem; font-weight: 700;
  letter-spacing: 0.34em; color: var(--filament);
  margin: 1.2rem 0;
}

.pair-steps { list-style: none; }
.pair-steps li {
  font-size: 1.25rem; color: var(--bone-dim);
  padding-left: 2.4rem; position: relative; margin-bottom: 1rem; line-height: 1.5;
}
.pair-steps li::before {
  content: counter(step); counter-increment: step;
  position: absolute; left: 0; top: 0.1rem;
  font-family: var(--mono); font-size: 0.95rem; color: var(--filament-d);
}
.pair-steps { counter-reset: step; }

/* ---------- forms ------------------------------------------------------- */

.field { margin-bottom: 1.5rem; }
.field label {
  display: block; font-family: var(--mono); font-size: 0.92rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone-dim); margin-bottom: 0.6rem;
}
.field .val {
  background: var(--ink); border: 1px solid var(--rule); border-radius: 3px;
  padding: 1.05rem 1.3rem; font-size: 1.4rem; font-family: var(--mono);
  min-height: 3.9rem; display: flex; align-items: center;
  word-break: break-all;
}
.field .val.empty { color: var(--bone-faint); }
.field .hint { margin-top: 0.5rem; font-family: var(--mono); font-size: 0.88rem; color: var(--bone-faint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.8rem;
  padding: 1.1rem 2.2rem;
  background: var(--ink-2); border: 1px solid var(--rule); border-radius: 3px;
  font-family: var(--display); font-size: 1.25rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bone);
}
.btn.primary { background: var(--filament); border-color: var(--filament); color: #04120E; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--alarm); color: var(--alarm); }
.btn-row { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 2rem; }

/* ---------- keyboard ---------------------------------------------------- */

.kb { display: grid; grid-template-columns: repeat(10, 1fr); gap: 0.55rem; margin-top: 1.3rem; }
.key {
  padding: 0.95rem 0; text-align: center;
  background: var(--ink-2); border: 1px solid var(--rule); border-radius: 3px;
  font-family: var(--mono); font-size: 1.25rem;
}
.key.wide { grid-column: span 2; font-size: 0.9rem; letter-spacing: 0.1em; }
.key.f.on { background: var(--filament); color: #04120E; border-color: var(--filament); }

/* ---------- states ------------------------------------------------------ */

.empty-state { padding: 3.5rem 0; max-width: 44rem; }
.empty-state h2 { font-size: 2rem; font-weight: 700; margin-bottom: 0.9rem; }
.empty-state p { font-size: 1.25rem; color: var(--bone-dim); line-height: 1.6; }

.error-note {
  border-left: 3px solid var(--alarm);
  background: rgba(255,107,90,0.07);
  padding: 1.1rem 1.5rem; margin-bottom: 1.5rem;
  font-size: 1.15rem; color: var(--bone);
}

.loading { font-family: var(--mono); color: var(--bone-dim); font-size: 1.15rem; letter-spacing: 0.1em; }
.loading::after { content: ""; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---------- toast ------------------------------------------------------- */

#toast {
  position: fixed; bottom: 8rem; left: 50%; transform: translateX(-50%) translateY(2rem);
  background: var(--ink-3); border: 1px solid var(--filament-d); border-left: 3px solid var(--filament);
  padding: 1.2rem 2rem; border-radius: 3px;
  font-size: 1.25rem; max-width: 60rem;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 60;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { border-color: var(--alarm); border-left-color: var(--alarm); }

/* ---------- modal ------------------------------------------------------- */

#modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4,10,14,0.9);
  display: none; align-items: center; justify-content: center;
}
#modal.open { display: flex; }
.modal-box {
  width: 64rem; max-width: 86vw;
  background: var(--ink-2); border: 1px solid var(--rule); border-radius: 3px;
  padding: 3rem;
}
.modal-box h2 { font-size: 2.2rem; margin-bottom: 1rem; }
.modal-box p { font-size: 1.25rem; color: var(--bone-dim); line-height: 1.6; margin-bottom: 1rem; }
.modal-box .mono-block {
  font-family: var(--mono); font-size: 1.05rem; color: var(--bone-dim);
  background: var(--ink); border: 1px solid var(--rule); padding: 1.2rem;
  border-radius: 3px; word-break: break-all; margin: 1.2rem 0; line-height: 1.6;
}

/* ---------- steps ------------------------------------------------------- */

.steps { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1.5rem; }
.step { display: flex; align-items: center; gap: 1.2rem; font-family: var(--mono); font-size: 1.1rem; color: var(--bone-faint); }
.step .mark { width: 1.5rem; text-align: center; flex: 0 0 auto; }
.step.done { color: var(--filament); }
.step.active { color: var(--bone); }
.step.failed { color: var(--alarm); }

/* ---------- responsive rem ---------------------------------------------
   Designed at 1920x1080. Scale the root so 720p and 4K panels both land. */

@media (max-width: 1400px) { html { font-size: 13px; } }
@media (min-width: 1401px) and (max-width: 2000px) { html { font-size: 16px; } }
@media (min-width: 2001px) { html { font-size: 22px; } }
