/* web/public/styles.css
   A/B/C: Logo green aura pulse + TopBar reveal rules + Feed polish
   - Works in Chrome + Safari
*/

:root{
  --bg0:#05070a;
  --bg1:#0b1210;
  --fg:#e8f0ee;

  --green:#19ff7a;
  --green2:#35e07a;

  /* mic-driven pulse (0..1) set by JS */
  --pulse: 0;

  /* Safari boost (0..1) controlled by JS */
  --safari-boost: 0;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: radial-gradient(circle at 50% 45%, #102018 0%, #05070a 60%, #030406 100%);
  color:var(--fg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  overflow:hidden;
}

#app{
  position:relative;
  height:100%;
  width:100%;
}

/* ===== Stage ===== */
#stage{
  position:absolute;
  inset:0;
  z-index:0;
}

.bgFx{
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 50% 35%, rgba(53,224,122,0.08), rgba(0,0,0,0) 55%),
    radial-gradient(circle at 50% 65%, rgba(60,190,255,0.06), rgba(0,0,0,0) 55%);
  filter: saturate(calc(1 + var(--safari-boost) * 0.18)) contrast(calc(1 + var(--safari-boost) * 0.10));
  pointer-events:none;
}

.mainStage{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.logoStage{
  width:min(560px, 92vw);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

/* ✅ Green aura ring (always visible; pulse even without mic) */
.logoRing{
  width:260px;
  height:260px;
  border-radius:999px;
  position:relative;
  margin: 0 auto 16px;
  /* base glow */
  box-shadow:
    0 0 28px rgba(25,255,122,0.18),
    0 0 70px rgba(25,255,122,0.12),
    inset 0 0 26px rgba(25,255,122,0.14);
  transform: translateZ(0);
  animation: breathe 2.8s ease-in-out infinite;
}

/* subtle inner sheen */
.logoRing::before{
  content:"";
  position:absolute;
  inset: 10px;
  border-radius:999px;
  background: radial-gradient(circle at 50% 50%,
    rgba(53,224,122,0.10),
    rgba(0,0,0,0) 60%);
  filter: blur(0.4px);
}

/* crisp outer rim */
.logoRing::after{
  content:"";
  position:absolute;
  inset: 0;
  border-radius:999px;
  border: 1px solid rgba(53,224,122,0.22);
}

/* mic-driven pulse overrides the breathe amplitude visually */
@keyframes breathe{
  0%,100%{
    box-shadow:
      0 0 28px rgba(25,255,122,0.18),
      0 0 70px rgba(25,255,122,0.12),
      inset 0 0 26px rgba(25,255,122,0.14);
  }
  50%{
    box-shadow:
      0 0 38px rgba(25,255,122,0.24),
      0 0 96px rgba(25,255,122,0.18),
      inset 0 0 34px rgba(25,255,122,0.18);
  }
}

/* JS will set --pulse (0..1); we add an extra “pulse halo” layer using filter */
html.micActive .logoRing{
  animation:none;
  box-shadow:
    0 0 calc(28px + (var(--pulse) * 34px)) rgba(25,255,122, calc(0.18 + var(--pulse) * 0.25)),
    0 0 calc(70px + (var(--pulse) * 90px)) rgba(25,255,122, calc(0.10 + var(--pulse) * 0.22)),
    inset 0 0 calc(26px + (var(--pulse) * 22px)) rgba(25,255,122, calc(0.12 + var(--pulse) * 0.22));
}

/* ✅ Logo typography: CSS big, STUDIO small */
.logoTextWrap{
  position:relative;
  margin-top: -214px; /* place text into ring center */
  pointer-events:none;
}
.logoCSS{
  font-size: 58px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-shadow: 0 0 18px rgba(25,255,122,0.14);
}
.logoStudio{
  font-size: 14px;
  letter-spacing: 0.55em;
  opacity: 0.78;
  margin-top: 6px;
}

/* ✅ Slogan must be below the green ring */
.tagline{
  margin-top: 18px;
  font-size: 14px;
  opacity: 0.78;
  filter: saturate(calc(1 + var(--safari-boost) * 0.10));
}

/* ===== HUD / Topbar ===== */
#hud{
  position:absolute;
  inset:0;
  z-index:10;
  pointer-events:none; /* panels + bar re-enable */
}

#topReveal{
  position:absolute;
  top:0;
  left:0;
  right:0;
  height: 44px; /* hover zone */
  pointer-events:auto;
  background: transparent;
}

.topBar{
  position:fixed;
  left:0; right:0;
  top:0;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
  pointer-events:none;
  z-index:20;

  transform: translateY(-110%);
  opacity: 0;
  transition: transform .20s ease, opacity .20s ease;
}
.topBar.show{
  transform: translateY(0);
  opacity: 1;
  pointer-events:auto;
}

.topBarInner{
  max-width: 980px;
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;

  background: rgba(10,14,12,0.52);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 10px 10px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.leftGroup,.centerGroup,.rightGroup{
  display:flex;
  align-items:center;
  gap:10px;
}

.centerGroup{
  gap: 6px;
  justify-content:center;
  flex: 1 1 auto;
}

/* buttons */
.pillBtn{
  pointer-events:auto;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.20);
  color: var(--fg);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}
.pillBtn:active{ transform: translateY(1px); }

.tabBtn{
  pointer-events:auto;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  color: var(--fg);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  cursor:pointer;
  opacity: .90;
}
.tabBtn.active{
  border-color: rgba(25,255,122,0.26);
  box-shadow: 0 0 14px rgba(25,255,122,0.12);
}

/* dropdown */
.dropdown{ position:relative; }
.menu{
  position:absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: rgba(10,14,12,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 8px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events:auto;
}
.menuItem{
  width:100%;
  text-align:left;
  border: 0;
  background: transparent;
  color: var(--fg);
  padding: 10px 10px;
  border-radius: 10px;
  cursor:pointer;
}
.menuItem:hover{ background: rgba(255,255,255,0.06); }
.menuSep{
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 6px 4px;
}

/* ===== Panels ===== */
.panels{
  position:absolute;
  inset:0;
  pointer-events:none;
}

.panel{
  position:absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  width: min(920px, 92vw);
  height: min(640px, 78vh);
  border-radius: 18px;
  background: rgba(10,14,12,0.66);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 60px rgba(0,0,0,0.55);

  display:none;
  pointer-events:auto;
  overflow:hidden;
}
.panel.show{ display:block; }

.panelHead{
  height: 54px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.panelTitle{
  display:flex;
  align-items:center;
  gap: 8px;
  font-weight: 650;
}
.pillTiny{
  font-size: 12px;
  opacity: .9;
  border: 1px solid rgba(255,255,255,0.10);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.12);
}
.panelClose{
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 18px;
  cursor:pointer;
  opacity:.85;
}
.panelBody{
  height: calc(100% - 54px);
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
}

.statusBox{
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  opacity: .88;
}

/* feed polish */
.emptyState{
  height: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap: 10px;
  padding: 18px;
}
.emptyTitle{
  font-size: 18px;
  font-weight: 700;
}
.emptySub{
  font-size: 13px;
  opacity: .75;
  max-width: 520px;
}
.emptyActions{
  display:flex;
  gap: 10px;
  margin-top: 8px;
}
.ghostBtn{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  color: var(--fg);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
}

/* profile */
.profileHeader{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 10px 6px 12px;
}
.avatar{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, rgba(25,255,122,0.35), rgba(0,0,0,0.0) 60%),
              rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
}
.profileName{ font-weight: 750; }
.profileSub{ font-size: 12px; opacity: .75; margin-top: 2px; }
.profileGridHint{ font-size: 12px; opacity: .72; padding: 0 6px 10px; }

.worksGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  padding: 6px;
}
@media (min-width: 720px){
  .worksGrid{ grid-template-columns: repeat(4, minmax(0,1fr)); }
}
.workCard{
  height: 120px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  overflow:hidden;
}
.workCard.skeleton{
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  background-size: 220% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer{
  0%{ background-position: 0% 0; }
  100%{ background-position: 220% 0; }
}

.comingSoon{
  padding: 18px;
  opacity: .78;
}

/* small screens */
@media (max-width: 480px){
  .logoRing{ width: 230px; height: 230px; }
  .logoTextWrap{ margin-top: -196px; }
  .logoCSS{ font-size: 52px; }
  .panel{
    top: 58%;
    height: min(660px, 80vh);
  }
}

/* =========================
   Landing overrides (index)
   ========================= */

body.landing {
  margin: 0;
  background: radial-gradient(circle at center, #102018, #05070a);
  color: #e8f0ee;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* Top HUD: hidden by default, shown on hover/click temporarily, pinned when logged-in */
.top-hud{
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 50;
}

body.hud-temp .top-hud,
body.logged-in .top-hud{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hud-btn{
  pointer-events: auto;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.18);
  color: #e8f0ee;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.hud-hover-zone{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 200px; /* your spec */
  z-index: 40;
}

/* Center stage */
.landing-stage{
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-wrap{
  text-align: center;
  transform: translateY(-10px);
}

/* Logo ring + pulse */
.logo-ring{
  width: 260px;
  height: 260px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow:
    0 0 28px rgba(53,224,122,0.30),
    inset 0 0 22px rgba(53,224,122,0.20);
  position: relative;
}

/* Soft green aura pulse */
.logo-ring::before{
  content:"";
  position:absolute;
  inset:-16px;
  border-radius:50%;
  background: radial-gradient(circle at center,
    rgba(53,224,122,.22),
    rgba(53,224,122,.10) 40%,
    rgba(0,0,0,0) 70%);
  filter: blur(0.8px);
  opacity: .75;
  animation: cssAuraPulse 3.2s ease-in-out infinite;
  pointer-events:none;
}

@keyframes cssAuraPulse{
  0%   { transform: scale(0.98); opacity: .60; }
  50%  { transform: scale(1.05); opacity: .90; }
  100% { transform: scale(0.98); opacity: .60; }
}

.logo-text{
  position: relative;
  z-index: 2;
  text-align: center;
}

.logo-css{
  font-size: 64px;      /* CSS big */
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
}

.logo-studio{
  font-size: 13px;      /* STUDIO small */
  letter-spacing: .55em;
  opacity: .70;
  margin-top: 10px;
}

/* Slogan MUST be below ring */
.slogan{
  margin-top: 18px;
  opacity: .75;
  font-size: 14px;
  letter-spacing: .02em;
}

/* === FIX: top menu bar must stay at top === */
#topMenu,
#topNav,
#topBar,
.top-menu,
.topMenu,
.hidden-top-menu,
.hidden-menu-bar,
.menu-bar,
.header-bar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 999999 !important;
  transform: none !important;
  margin: 0 !important;
}

/* If some container is centering everything, prevent it from affecting fixed bar */
body {
  overflow-x: hidden;
}

/* Optional: keep the hover trigger zone consistent (you mentioned 200px) */
#topMenuHoverZone,
.top-menu-hover-zone,
.hidden-menu-hover {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 200px !important;
  z-index: 999998 !important;
}

/* === FIX: force top menu stay on top === */
#topMenu,
#topNav,
#topBar,
.top-menu,
.topMenu,
.hidden-top-menu,
.hidden-menu-bar,
.menu-bar,
.header-bar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 999999 !important;
  transform: none !important;
  margin: 0 !important;
}

/* keep hover area (you used 200px before) */
#topMenuHoverZone,
.top-menu-hover-zone,
.hidden-menu-hover {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 200px !important;
  z-index: 999998 !important;
}

/* === FIX: force top menu stay on top === */
#topMenu,
#topNav,
#topBar,
.top-menu,
.topMenu,
.hidden-top-menu,
.hidden-menu-bar,
.menu-bar,
.header-bar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 999999 !important;
  transform: none !important;
  margin: 0 !important;
}

#topMenuHoverZone,
.top-menu-hover-zone,
.hidden-menu-hover {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 200px !important;
  z-index: 999998 !important;
}

/* ===== CSSSTUDIO HOTFIX: pin top HUD to top ===== */
#hud.top-hud{
  position: fixed !important;
  top: 10px !important;
  left: 10px !important;
  right: 10px !important;
  bottom: auto !important;
  height: auto !important;
  inset: auto !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  pointer-events: none !important;
  z-index: 9999 !important;
}
#hud.top-hud *{ pointer-events: auto !important; }
