// ─────────────────────────────────────────────────────────
//  Studio Status Strip — live ticker under top nav
// ─────────────────────────────────────────────────────────

const { useEffect: useEffectSS, useState: useStateSS } = React;

function StudioStrip() {
  const [now, setNow] = useStateSS(new Date());

  useEffectSS(() => {
    const id = setInterval(() => setNow(new Date()), 1000);
    return () => clearInterval(id);
  }, []);

  // Jammu time (IST is UTC+5:30 — local time already)
  const time = now.toLocaleTimeString('en-IN', {
    hour: '2-digit', minute: '2-digit', hour12: false,
    timeZone: 'Asia/Kolkata',
  });

  // Determine ambient context by hour
  const h = now.getHours();
  const sky = h < 6 ? 'pre-dawn' : h < 11 ? 'morning' : h < 16 ? 'afternoon' : h < 19 ? 'dusk' : 'night';

  // Rough seasonal Jammu temperature
  const month = now.getMonth();
  const baseT = [13, 16, 22, 28, 33, 35, 32, 31, 30, 26, 20, 14][month];
  const temp = baseT + Math.floor(Math.sin(now.getHours() / 24 * Math.PI) * 3);

  return (
    <div className="studio-strip">
      <div className="cell">
        <span className="ic">◉</span>
        <span>Jammu</span>
        <span className="v">{time}</span>
        <span>IST</span>
      </div>

      <div className="ticker">
        <div className="ticker-inner">
          <span>◆ Currently shipping · Vault Capital · SaaS for VCs</span>
          <span>◆ Last build · JK Realtors · 4 weeks</span>
          <span>◆ Now reading · "The Cold Start Problem" by Andrew Chen</span>
          <span>◆ Studio uptime · 99.97% · last 90d</span>
          <span>◆ Next opening · 2 slots Q3 2026</span>
          <span>◆ Now playing · Bonobo · Cirrus</span>
        </div>
      </div>

      <div className="cell">
        <span>{sky}</span>
        <span className="v">{temp}°C</span>
        <span>·</span>
        <span>32.73°N · 74.86°E</span>
      </div>
    </div>
  );
}

window.StudioStrip = StudioStrip;
