/**
 * Telno terminals — product layer only.
 *
 * The tokens, cards, pills, chips and buttons come from /ui/console.css, the same
 * sheet the consoles serve, so the landing page cannot look like a different
 * family. What is left here is this page's own shape: a hero with the estate
 * counts, then one card per terminal and no navigation, because the page has one
 * job.
 */

.hub-body {
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-glow);
  color: var(--text);
  font-family: var(--font);
}

.hub {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px var(--pad) 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
}

/* ── header ────────────────────────────────────────────────────────────── */

.hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hub-brand .brand-mark {
  font-size: 24px;
  color: var(--accent-strong);
}

.hub-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.hub-brand .brand-name {
  font-weight: 650;
  letter-spacing: -0.01em;
  font-size: 17px;
}

.hub-brand .brand-sub {
  font-size: 12px;
  color: var(--text-3);
  text-transform: lowercase;
  letter-spacing: 0.06em;
}

.hub-head-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── hero ──────────────────────────────────────────────────────────────── */

.hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 22px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(620px 220px at 92% 0%, rgba(124, 107, 255, 0.16), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
}

.hub-hero .eyebrow {
  margin: 0 0 6px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.hub-hero h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 640;
}

.hub-hero .hero-copy p {
  margin: 0;
  max-width: 58ch;
  line-height: 1.55;
}

#lead-note {
  margin-top: 8px;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-stat {
  min-width: 132px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
}

.hero-stat .label {
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}

.hero-stat .value {
  margin-top: 4px;
  font-size: 21px;
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero-stat .value.ok { color: var(--ok); }
.hero-stat .value.warn { color: var(--warn); }
.hero-stat .value.bad { color: var(--bad); }

.hero-stat .foot {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-2);
}

/* ── section heading ───────────────────────────────────────────────────── */

.hub-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.hub-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hub-section-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 620;
  letter-spacing: 0.02em;
}

.hub-section-head .hint {
  color: var(--text-3);
}

/* ── terminal cards ────────────────────────────────────────────────────── */

.terminal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 16px;
}

.terminal-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.terminal-card:hover {
  transform: translateY(-1px);
}

.terminal-card.is-up {
  border-color: rgba(61, 220, 151, 0.22);
}

.terminal-card.is-down {
  border-color: rgba(255, 107, 107, 0.24);
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
}

/* The model badge carries a word (T54W, T750), so it takes the width of its text
   and stays square-cornered rather than borrowing the round port badge. */
.terminal-model {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(124, 107, 255, 0.34);
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.terminal-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.terminal-id .title {
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-id .sub {
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--mono);
}

.status-orb {
  margin-left: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.status-orb.ok {
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}

.status-orb.warn {
  background: var(--warn);
  box-shadow: 0 0 0 4px var(--warn-soft);
}

.status-orb.bad {
  background: var(--bad);
  box-shadow: 0 0 0 4px var(--bad-soft);
}

.terminal-status {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 16px 14px;
  border-bottom: 1px solid var(--line);
}

.terminal-status .word {
  font-size: 15px;
  font-weight: 620;
}

.terminal-status .word.ok { color: var(--ok); }
.terminal-status .word.warn { color: var(--warn); }
.terminal-status .word.bad { color: var(--bad); }

.terminal-status .detail {
  font-size: 12px;
  color: var(--text-2);
}

.terminal-facts {
  margin: 0;
  padding: 6px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.terminal-facts > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.terminal-facts > div:first-child {
  border-top: 0;
}

.terminal-facts dt {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.terminal-facts dd {
  margin: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.terminal-facts dd .mono {
  overflow-wrap: anywhere;
}

.hub-error {
  margin: 0 16px 12px;
  color: var(--bad);
  line-height: 1.5;
}

.terminal-card .card-actions {
  margin-top: auto;
}

/* ── footer ────────────────────────────────────────────────────────────── */

.hub-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12px;
}

#how {
  margin: 0;
}

/* A single card that has to sit in a multi-column grid (an error, an empty state). */
.span-all {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .hub-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hub-hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .hero-stats {
    justify-content: flex-start;
  }

  .hub-hero h1 {
    font-size: 26px;
  }
}
