/* BlackGrid Labs — operator hub (launcher at /dashboard).
   Inherits palette + typography from marketing.css. */

.hub-body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Subtle drifting grid background. */
.hub-grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(0deg, rgba(38,38,38,0.85) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38,38,38,0.85) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(circle at 50% 50%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 0%, transparent 80%);
  animation: hub-grid-drift 60s linear infinite;
}
@keyframes hub-grid-drift {
  0%   { background-position: 0 0; }
  100% { background-position: -64px -64px; }
}

/* Soft radial accent — amber + violet hint behind tiles. */
.hub-radial-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(212,210,203,0.06), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(168,136,212,0.04), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Header — minimal mark + back link. */
.hub-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  border-bottom: 1px solid var(--rule);
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hub-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.hub-mark-square {
  width: 12px;
  height: 12px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(212,210,203,0.5);
  animation: hub-mark-pulse 3s ease-in-out infinite;
}
@keyframes hub-mark-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
.hub-mark-name {
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: 0.04em;
}
.hub-mark-name b { font-weight: 600; color: var(--ink); }
.hub-mark-name span { color: var(--muted); margin-left: 3px; font-weight: 400; }
.hub-back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s ease;
}
.hub-back:hover { color: var(--accent); }

/* Main launcher area. */
.hub-main {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 32px 48px;
  width: 100%;
}
@media (max-width: 720px) {
  .hub-main { padding: 40px 22px 32px; }
}

.hub-intro {
  max-width: 760px;
  margin-bottom: 56px;
}
.hub-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-bottom: 18px;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 12px;
}
.hub-eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}
.hub-title {
  font-family: var(--sans);
  font-size: clamp(40px, 5.6vw, 72px);
  font-weight: 300;
  letter-spacing: -0.028em;
  line-height: 1.0;
  margin: 0 0 18px;
  color: var(--ink);
}
.hub-slogan {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.hub-sub {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0;
}

/* Tile grid — 2x2 default, 4-wide on very wide screens. */
.hub-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-bottom: 56px;
}
@media (max-width: 820px) {
  .hub-tiles { grid-template-columns: 1fr; }
}

.hub-tile {
  --accent: var(--accent);
  background: var(--bg);
  padding: 34px 32px 28px;
  text-decoration: none;
  color: inherit;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 360px;
  overflow: hidden;
  transition:
    background 0.28s ease,
    transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
  /* Staggered entrance */
  opacity: 0;
  transform: translateY(12px);
  animation: hub-tile-in 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) calc(var(--i, 0) * 0.08s + 0.2s) forwards;
}
@keyframes hub-tile-in {
  to { opacity: 1; transform: translateY(0); }
}

/* Top accent bar — color-coded to product, draws in on hover. */
.hub-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0.08);
  transform-origin: 0 0;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.hub-tile:hover {
  background: rgba(255,255,255,0.022);
  transform: translateY(-3px);
}
.hub-tile:hover::before { transform: scaleX(1); }

/* Diagonal gleam on hover. */
.hub-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.025) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
  pointer-events: none;
}
.hub-tile:hover::after { transform: translateX(100%); }

.hub-tile-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.hub-tile-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--muted-2);
}
.hub-tile-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  padding: 4px 9px;
  border: 1px solid var(--rule-strong, var(--border-strong));
  text-transform: uppercase;
}
.hub-status-live { color: var(--green); border-color: rgba(95,180,134,0.5); }
.hub-status-beta { color: var(--amber); border-color: rgba(212,161,85,0.5); }
.hub-tile-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.hub-status-live .hub-tile-dot { animation: hub-status-pulse-ok 2.4s ease-in-out infinite; }
.hub-status-beta .hub-tile-dot { animation: hub-status-pulse-warn 2s ease-in-out infinite; }
@keyframes hub-status-pulse-ok {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
@keyframes hub-status-pulse-warn {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px currentColor; }
  50%      { opacity: 0.6; box-shadow: 0 0 10px currentColor; }
}

.hub-tile-name {
  font-family: var(--sans);
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.024em;
  color: var(--accent);
  margin: 0;
  line-height: 1.0;
}
.hub-tile-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--muted-2);
}
.hub-tile-desc {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
  flex: 1;
}

.hub-tile-stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.hub-tile-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hub-tile-stat-val {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.hub-tile-stat-key {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted-2);
}

.hub-tile-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.hub-tile-auth {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted-2);
}
.hub-tile-cta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hub-arrow {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.hub-tile:hover .hub-arrow { transform: translateX(4px); }

/* Hub meta footer (session state + suite status). */
.hub-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--rule);
  background: var(--surface);
}
@media (max-width: 820px) { .hub-meta { grid-template-columns: 1fr; gap: 12px; } }
.hub-meta-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hub-meta-key {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--muted-2);
}
.hub-meta-val {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hub-meta-val a {
  color: var(--accent);
  letter-spacing: 0.18em;
  text-decoration: none;
  border-bottom: 1px solid rgba(212,210,203,0.3);
}
.hub-meta-val a:hover { border-bottom-color: var(--accent); }
.hub-meta-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: hub-status-pulse-ok 2.4s ease-in-out infinite;
}

/* Footer */
.hub-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 20px 32px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted-2);
  background: var(--bg);
}
.hub-footer-r { font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* Reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .hub-grid-bg, .hub-mark-square, .hub-tile-dot, .hub-meta-dot { animation: none; }
  .hub-tile { animation: none; opacity: 1; transform: none; }
  .hub-tile::before { transform: scaleX(1); }
  .hub-tile::after { display: none; }
}

/* Quick-link row beneath the hub tiles. */
.hub-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-bottom: 18px;
}
@media (max-width: 820px) {
  .hub-links { grid-template-columns: 1fr; }
}
.hub-link {
  background: var(--bg);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 0.2s ease;
}
.hub-link::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.hub-link:hover {
  background: rgba(255,255,255,0.022);
}
.hub-link:hover::before {
  transform: scaleX(1);
}
.hub-link-key {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
}
.hub-link-sub {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
}
.hub-link-arrow {
  position: absolute;
  top: 18px; right: 22px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.18s ease, color 0.18s ease;
}
.hub-link:hover .hub-link-arrow {
  color: var(--accent);
  transform: translateX(3px);
}
