/* ==========================================
   CLEANSHAVE'S TOOL - SITE SHELL STYLES
   Header, ticker tape and live badge shared by
   every page. Loaded after styles.css. The markup
   comes from site-shell.js, which adds the
   has-shell class to <body>.
   ========================================== */

body.has-shell {
  /* header (69px) + ticker (~38px) + gap */
  padding-top: 124px;
}

/* No ticker cache yet: header only */
body.has-shell.shell-no-ticker {
  padding-top: 88px;
}

/* border-box also keeps the closed menu's edge from peeking in at the left */
body.has-shell .nav-menu,
body.has-shell .header,
body.has-shell .header *,
body.has-shell .t-ticker,
body.has-shell .t-ticker * {
  box-sizing: border-box;
}

/* ==========================================
   HEADER
   ========================================== */

body.has-shell .header {
  padding: 12px 16px;
  border-bottom: 1px solid #00ffc3;
}

body.has-shell .hamburger {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #333;
  border-radius: 8px;
  color: #00ffc3;
  font-size: 1.15em;
  cursor: pointer;
}

body.has-shell .hamburger:hover {
  background: #2a2a2a;
  color: #00d4a3;
}

body.has-shell .t-brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.2;
}

body.has-shell .header h1 {
  margin: 0;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 1px;
  font-weight: 700;
  color: #00ffc3;
}

body.has-shell .t-brand-sub {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #9CA3AF;
  letter-spacing: 0.5px;
}

/* ---- Live badge (Dashboard only) ---- */

body.has-shell .t-live {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid #333;
  border-radius: 999px;
  background: #1a1a1a;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #9CA3AF;
}

body.has-shell .t-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9CA3AF;
}

body.has-shell .t-live.is-live {
  border-color: #00695c;
  background: #0f2a26;
  color: #00ffc3;
}

body.has-shell .t-live.is-live .t-live-dot {
  background: #00ffc3;
  box-shadow: 0 0 8px #00ffc3;
  animation: t-pulse 1.6s ease-in-out infinite;
}

body.has-shell .t-live.is-down {
  border-color: #7f1d1d;
  color: #F87171;
}

body.has-shell .t-live.is-down .t-live-dot { background: #F87171; }

@keyframes t-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ==========================================
   TICKER TAPE
   ========================================== */

body.has-shell .t-ticker {
  position: fixed;
  top: 69px;
  left: 0;
  right: 0;
  z-index: 998;
  overflow: hidden;
  background: #0d0d0d;
  border-bottom: 1px solid #262626;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}

body.has-shell .t-ticker-track {
  display: inline-flex;
  gap: 22px;
  padding: 9px 16px;
  will-change: transform;
}

body.has-shell .t-ticker-track.is-scrolling {
  animation: t-marquee var(--t-marquee-time, 60s) linear infinite;
}

body.has-shell .t-ticker:hover .t-ticker-track { animation-play-state: paused; }

body.has-shell .t-ticker-item {
  color: #F3F4F6;
  text-decoration: none;
}

body.has-shell .t-ticker .t-up { color: #10B981; }
body.has-shell .t-ticker .t-down { color: #F87171; }
body.has-shell .t-ticker .t-flat { color: #9CA3AF; }

@keyframes t-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  body.has-shell .t-ticker-track.is-scrolling { animation: none; }
  body.has-shell .t-ticker { overflow-x: auto; }
  body.has-shell .t-live.is-live .t-live-dot { animation: none; }
}

/* ==========================================
   MOBILE (overrides the styles.css header rules)
   ========================================== */

@media (max-width: 768px) {
  body.has-shell .header { padding: 12px 16px; }
  body.has-shell .header h1 { font-size: 14px; }
}
