/*
  Mingeta HUD — Meta Ray-Ban Display
  Viewport: fixed 600x600. Additive display: NEVER use #000000 (renders transparent).
  Visual language: ported from Loom (copper accent #c8843d, warm-neutral
  greys, hex-honeycomb motif, restrained motion). See ~/loom/frontend-web
  /components/ui/agent/STYLE.md for the source design system.
*/

:root {
  /* Loom copper palette (derived from #c8843d) */
  --copper:        #c8843d;
  --copper-bright: #e0a05a;
  --copper-deep:   #a06820;
  --copper-edge:   rgba(200, 132, 61, 0.24);
  --copper-soft:   rgba(200, 132, 61, 0.08);
  --copper-glow:   rgba(200, 132, 61, 0.36);

  /* warm neutrals (Loom uses tailwind `neutral-*`, no blue tint) */
  --bg:        #0a0a0f;     /* additive-display safe; do NOT use #000 */
  --bg-elev:   #15151c;
  --fg:        #f0ece6;     /* slightly warm white */
  --fg-2:      #b6b0a7;
  --dim:       #6a6660;
  --dim-2:     #3a3833;

  --amber: #d4a04a;
  --red:   #c04040;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11", "kern";
}

body { display: block; }

/* Subtle radial vignette for depth — warm copper-tinted highlight.
   Stays well above pure black at every stop. */
#hud {
  position: relative;
  width: 600px;
  height: 600px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 36%,
      rgba(200, 132, 61, 0.07) 0%,
      rgba(200, 132, 61, 0.02) 35%,
      transparent 75%),
    radial-gradient(ellipse 80% 60% at 50% 38%,
      #15151c 0%, #0d0d12 55%, #0a0a0f 100%);
  padding: 30px 38px 28px;
  display: flex;
  flex-direction: column;
  outline: none;
  border: none;
  transition: box-shadow 160ms ease-out;
}

#hud:focus,
#hud.focusable:focus-visible {
  /* copper inner glow on D-pad focus */
  box-shadow: inset 0 0 36px rgba(200, 132, 61, 0.10);
}

.zone {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* THEY SAID — tertiary, compact */
.zone-top {
  height: 150px;
  flex: 0 0 150px;
  justify-content: flex-start;
  gap: 10px;
  padding-bottom: 16px;
}

/* SAY THIS — hero zone */
.zone-bottom {
  flex: 1 1 auto;
  justify-content: flex-start;
  gap: 16px;
  padding-top: 22px;
  /* whisper-thin copper divider */
  background-image: linear-gradient(to right,
    transparent 0%,
    rgba(200, 132, 61, 0.14) 20%,
    rgba(200, 132, 61, 0.22) 50%,
    rgba(200, 132, 61, 0.14) 80%,
    transparent 100%);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: top;
  overflow: hidden;
  position: relative;
  border-radius: 2px;
  transition: box-shadow 400ms ease-out;
}

/* --- corner honeycomb glyph ---------------------------------------------- */

/* Tiny copper honeycomb mark, top-left — Loom brand signature on the HUD.
   Sized restrained (24px) so it reads as a brand cue, not chrome. */
.brand-mark {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 24px;
  height: 24px;
  color: var(--copper);
  opacity: 0.78;
  pointer-events: none;
}
.brand-mark svg { display: block; width: 100%; height: 100%; }

/* --- labels ---------------------------------------------------------------- */

.label {
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

/* THEY SAID — tertiary: tiny, wide-tracked, very dim */
.label-dim {
  font-size: 11px;
  letter-spacing: 0.32em;
  color: #4a4640;
  font-weight: 700;
}

/* SAY THIS — hero label: copper */
.label-cyan {       /* class name kept for app.js compatibility */
  font-size: 15px;
  letter-spacing: 0.26em;
  color: var(--copper);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* generation pulse dots — only visible while .generating */
.gen-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transition: opacity 200ms ease-out;
}
.zone-bottom.generating .gen-dots { opacity: 1; }
.gen-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 6px var(--copper-glow);
  animation: gen-pulse 1.4s ease-in-out infinite;
}
.gen-dots span:nth-child(2) { animation-delay: 0.18s; }
.gen-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes gen-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40%           { opacity: 1;    transform: scale(1.15); }
}

/* soft copper glow around SAY THIS zone while generating */
.zone-bottom.generating {
  box-shadow: inset 0 0 60px rgba(200, 132, 61, 0.07);
}

/* --- transcript (THEY SAID) ------------------------------------------------ */

.transcript {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  color: #8a857c;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  letter-spacing: -0.005em;
  transition: opacity 200ms ease-out;
}

.transcript.empty {
  font-size: 16px;
  color: #3a3833;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.transcript.empty::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4a4640;
  animation: listen-pulse 2s ease-in-out infinite;
}

@keyframes listen-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50%      { opacity: 0.9; transform: scale(1.1); }
}

.transcript.flash { animation: text-flash 220ms ease-out; }
@keyframes text-flash {
  0%   { opacity: 0.55; }
  100% { opacity: 1;    }
}

/* --- suggestion (SAY THIS) ------------------------------------------------- */

.suggestion {
  font-size: 36px;
  font-weight: 500;
  line-height: 1.22;
  color: #f0ece6;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  max-height: 100%;
  letter-spacing: -0.018em;
  transition: opacity 220ms ease-out;
}

.suggestion.empty { color: transparent; }

.suggestion.flash { animation: text-flash 220ms ease-out; }

/* --- regenerate button ----------------------------------------------------- */

.regen-btn {
  flex: 0 0 auto;
  height: 50px;
  margin-top: 18px;
  background: var(--copper-soft);
  border: 1px solid var(--copper-edge);
  color: #9a8770;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  border-radius: 12px;
  padding: 0 18px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition:
    background-color 180ms ease-out,
    color 180ms ease-out,
    box-shadow 180ms ease-out,
    border-color 180ms ease-out,
    transform 80ms ease-out;
}

.regen-btn:focus,
.regen-btn:focus-visible {
  background: rgba(200, 132, 61, 0.12);
  color: var(--fg);
  border-color: rgba(200, 132, 61, 0.55);
  box-shadow:
    0 0 0 1px rgba(200, 132, 61, 0.28),
    0 0 22px rgba(200, 132, 61, 0.32),
    inset 0 0 12px rgba(200, 132, 61, 0.10);
}

.regen-btn:active { transform: scale(0.985); }

/* --- status dot ------------------------------------------------------------ */

.status {
  position: absolute;
  bottom: 16px;
  right: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
  transition: background-color 220ms ease-out, box-shadow 220ms ease-out;
}

.status-live {
  background: var(--copper);
  box-shadow: 0 0 10px var(--copper-glow);
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% {
    box-shadow:
      0 0 8px rgba(200, 132, 61, 0.55),
      0 0 0 0 rgba(200, 132, 61, 0.40);
  }
  50% {
    box-shadow:
      0 0 14px rgba(200, 132, 61, 0.85),
      0 0 0 6px rgba(200, 132, 61, 0.0);
  }
}

.status-reconnecting {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(212, 160, 74, 0.55);
}

.status-disconnected {
  background: var(--red);
  box-shadow: 0 0 6px rgba(192, 64, 64, 0.35);
}
