/**
 * Florent Stroppa - Hub / Homepage
 * Shared styles for the TV-grid hub page.
 * Used by: index.html (once promoted), hub-frame.html (prototype).
 */

:root {
  --hub-bg: #0a0a0b;
  --hub-bg-2: #121215;
  --hub-fg: #f5f5f7;
  --hub-fg-dim: rgba(245, 245, 247, 0.55);
  --hub-frame: #1a1a1c;
  --hub-frame-edge: #2a2a2e;
  --hub-led: #00ff88;
}

html, body {
  background: var(--hub-bg);
  color: var(--hub-fg);
  font-family: 'Inter', -apple-system, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(80, 80, 120, 0.15), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Main container — respects the fixed shared header */
.hub-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--header-height) + 72px) 40px 120px;
  position: relative;
  z-index: 1;
}

/* ============ Hero ============ */

.hub-hero {
  margin-bottom: 72px;
  max-width: 860px;
}

.hub-hero h1 {
  font-size: clamp(40px, 5vw, 68px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 20px;
}

.hub-hero h1 .cursor {
  display: inline-block;
  width: 0.5ch;
  height: 0.9em;
  background: var(--hub-fg);
  vertical-align: -4px;
  margin-left: 6px;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
  animation: hub-blink 1s steps(1) infinite;
}

@keyframes hub-blink { 50% { opacity: 0; } }

.hub-hero p {
  font-size: 17px;
  color: var(--hub-fg-dim);
  line-height: 1.5;
  max-width: 560px;
}

/* ============ TV Grid ============ */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 32px;
}

@media (max-width: 1100px) { .hub-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .hub-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; } }
@media (max-width: 520px)  { .hub-grid { grid-template-columns: 1fr; } }

.hub-tv {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

.hub-tv:hover { transform: translateY(-6px); }

.hub-tv-frame {
  position: relative;
  background: linear-gradient(145deg, var(--hub-frame-edge), var(--hub-frame));
  padding: 10px 10px 12px;
  border-radius: 6px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 30px 60px -20px rgba(0, 0, 0, 0.8),
    0 10px 30px -10px rgba(0, 0, 0, 0.6);
  transition: box-shadow .35s;
}

.hub-tv:hover .hub-tv-frame {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 40px 80px -20px rgba(0, 0, 0, 0.9),
    0 20px 40px -10px rgba(0, 0, 0, 0.7),
    0 0 60px -10px rgba(120, 140, 255, 0.15);
}

.hub-tv-screen {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #000;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5) inset;
}

.hub-tv-screen img,
.hub-tv-screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .35s;
}

.hub-tv-screen video { opacity: 0; }
.hub-tv:hover .hub-tv-screen video { opacity: 1; }
.hub-tv:hover .hub-tv-screen img { opacity: 0; }

.hub-tv-screen .overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.35)),
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.08), transparent 50%);
  pointer-events: none;
}

/* Placeholder screens (when no image/video yet) */
.hub-tv-screen .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  background: linear-gradient(135deg, #1a1a2e, #16213e 50%, #0f3460);
}

.hub-tv-screen .placeholder.ocean  { background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); }
.hub-tv-screen .placeholder.sunset { background: linear-gradient(135deg, #2b1055, #7597de); }
.hub-tv-screen .placeholder.neon   { background: linear-gradient(135deg, #200122, #6f0000); }
.hub-tv-screen .placeholder.grid-bg {
  background:
    linear-gradient(135deg, #0a0a0f, #1a0a1f),
    repeating-linear-gradient(0deg, transparent 0 20px, rgba(255, 255, 255, 0.03) 20px 21px),
    repeating-linear-gradient(90deg, transparent 0 20px, rgba(255, 255, 255, 0.03) 20px 21px);
}

/* Code-editor style screen (used by "How I Made CLI Love") */
.hub-tv-screen .code-preview {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0b0c14 0%, #0d0e18 100%);
  padding: 14px 18px 16px;
  font-family: 'JetBrains Mono', 'Space Mono', monospace;
  font-size: 10px;
  line-height: 1.75;
  color: #7a8598;
  overflow: hidden;
  white-space: nowrap;
}

.hub-tv-screen .code-preview::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 22px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-tv-screen .code-preview::after {
  content: '';
  position: absolute;
  top: 7px; left: 14px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow:
    14px 0 0 #febc2e,
    28px 0 0 #28c840;
}

.hub-tv-screen .code-preview .code-lines {
  margin-top: 18px;
}

.hub-tv-screen .code-preview .ln {
  display: block;
}

.hub-tv-screen .code-preview .kw  { color: #c084fc; }
.hub-tv-screen .code-preview .fn  { color: #60a5fa; }
.hub-tv-screen .code-preview .str { color: #a3e635; }
.hub-tv-screen .code-preview .var { color: #f5f5f7; }
.hub-tv-screen .code-preview .num { color: #fbbf24; }
.hub-tv-screen .code-preview .com { color: #475569; font-style: italic; }

/* TV bottom bar (brand + LED) */
.hub-tv-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 4px;
}

.hub-tv-brand {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
}

.hub-tv-led {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 255, 136, 0.25);
  box-shadow: 0 0 4px rgba(0, 255, 136, 0.15);
  transition: all .3s;
}

.hub-tv:hover .hub-tv-led {
  background: var(--hub-led);
  box-shadow: 0 0 8px var(--hub-led), 0 0 16px rgba(0, 255, 136, 0.5);
}

/* Label under each TV */
.hub-tv-label {
  margin-top: 18px;
  padding: 0 2px;
}

.hub-tv-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.hub-tv-desc {
  font-size: 13px;
  color: var(--hub-fg-dim);
  line-height: 1.4;
}

/* Footer */
.hub-footer {
  margin-top: 120px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--hub-fg-dim);
  font-size: 12px;
}
