:root {
  --pulse-orbit-deep: #9a4d0a;
  --pulse-orbit-ember: #ff6a00;
  --pulse-orbit-core: #ff9e2c;
  --pulse-orbit-light: #ffd29a;
  --pulse-orbit-ink: #f4f1ea;
  --pulse-orbit-muted: #a79d8d;
}

.pulse-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
  min-width: 0;
  color: var(--pulse-orbit-ink);
  text-decoration: none;
  isolation: isolate;
}

.pulse-brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.pulse-orbit {
  display: block;
  width: 3rem;
  height: auto;
  overflow: visible;
  color: var(--pulse-orbit-core);
  transform-origin: 50% 52%;
}

.pulse-orbit--compact { width: 2.5rem; }
.pulse-orbit--hero { width: clamp(6.75rem, 11vw, 8.5rem); }
.pulse-orbit--static { width: 2rem; }

.pulse-orbit use {
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
}

.pulse-orbit__halo {
  color: var(--pulse-orbit-ember);
  opacity: 0.2;
  filter: blur(9px);
}

.pulse-orbit__far {
  color: var(--pulse-orbit-deep);
  opacity: 0.78;
}

.pulse-orbit__near {
  color: var(--pulse-orbit-ember);
  filter: drop-shadow(0 0 5px rgba(255, 106, 0, 0.25));
}

.pulse-orbit__highlight {
  color: var(--pulse-orbit-light);
  opacity: 0.88;
}

.pulse-orbit__axis {
  color: var(--pulse-orbit-core);
  opacity: 0.9;
}

.pulse-orbit__flare {
  color: var(--pulse-orbit-light);
  opacity: 0.92;
}

.pulse-brand__lockup {
  display: grid;
  min-width: 0;
  line-height: 1;
}

.pulse-brand__name {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
  white-space: nowrap;
  color: var(--pulse-orbit-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.045em;
}

.pulse-brand__pulse {
  display: inline-block;
  font-size: 1.02rem;
  font-style: italic;
  font-weight: 820;
  transform: skewX(-7deg);
}

.pulse-brand__ai {
  font-size: 1rem;
  font-weight: 320;
  letter-spacing: -0.025em;
}

.pulse-brand__descriptor {
  margin-top: 0.24rem;
  overflow: hidden;
  color: var(--pulse-orbit-muted);
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.pulse-brand--sidebar {
  width: 100%;
  max-width: 14.5rem;
}

.pulse-brand--sidebar .pulse-brand__lockup { text-align: left; }
.pulse-brand--sidebar .pulse-orbit { width: 2.65rem; }

.pulse-brand--hero {
  display: grid;
  justify-items: center;
  gap: 0.05rem;
  margin: 0 0 0.3rem;
  text-align: center;
}

.pulse-brand--hero .pulse-brand__mark::before,
.pulse-brand--hero .pulse-brand__mark::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.pulse-brand--hero .pulse-brand__mark::before {
  inset: 20% 8%;
  background: rgba(255, 106, 0, 0.12);
  filter: blur(20px);
}

.pulse-brand--hero .pulse-brand__mark::after {
  inset: 34% 20%;
  background: rgba(255, 210, 154, 0.08);
  filter: blur(12px);
}

.pulse-brand--hero .pulse-brand__name { font-size: 1.12rem; }
.pulse-brand--hero .pulse-brand__pulse { font-size: 1.18rem; }
.pulse-brand--hero .pulse-brand__ai { font-size: 1.16rem; }

.pulse-brand--login {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  margin: 0 0 1.35rem;
  text-align: center;
}

.pulse-brand--login .pulse-orbit { width: 4.75rem; }
.pulse-brand--login .pulse-brand__pulse { font-size: 1.28rem; }
.pulse-brand--login .pulse-brand__ai { font-size: 1.25rem; }

.pulse-brand--landing .pulse-orbit { width: 2.45rem; }
.pulse-brand--landing .pulse-brand__descriptor { display: none; }

.pulse-brand--footer {
  align-items: flex-start;
  margin-bottom: 0.25rem;
}

.pulse-brand--footer .pulse-orbit { width: 3.35rem; }
.pulse-brand--footer .pulse-brand__pulse { font-size: 1.3rem; }
.pulse-brand--footer .pulse-brand__ai { font-size: 1.27rem; }

.pulse-brand--coder .pulse-orbit { width: 2.25rem; }
.pulse-brand--coder .pulse-brand__pulse { font-size: 0.94rem; }
.pulse-brand--coder .pulse-brand__ai { font-size: 0.92rem; }
.pulse-brand--coder .pulse-brand__descriptor { color: var(--pulse-orbit-core); }

.pulse-brand--offline {
  display: grid;
  justify-items: center;
  margin-bottom: 1rem;
}

.pulse-brand--offline .pulse-orbit { width: 4.6rem; }

html[data-brand-ready="true"] .pulse-orbit__axis {
  animation: pulse-orbit-axis-intro 720ms cubic-bezier(0.22, 1, 0.36, 1) 1 both;
}

html[data-brand-ready="true"] .pulse-orbit__flare {
  animation: pulse-orbit-flare-intro 760ms ease-out 1 both;
}

html[data-brand-state="idle"] .pulse-orbit__near {
  animation: pulse-orbit-idle-depth 9s ease-in-out infinite;
}

html[data-brand-state="received"] .pulse-orbit__highlight,
html[data-brand-state="preparing"] .pulse-orbit__highlight,
html[data-brand-state="queued"] .pulse-orbit__highlight,
html[data-brand-state="analyzing"] .pulse-orbit__highlight {
  stroke-dasharray: 24 68;
  animation: pulse-orbit-travel 2.2s linear infinite;
}

html[data-brand-state="received"] .pulse-orbit,
html[data-brand-state="preparing"] .pulse-orbit,
html[data-brand-state="queued"] .pulse-orbit,
html[data-brand-state="analyzing"] .pulse-orbit {
  animation: pulse-orbit-precess 3.8s ease-in-out infinite;
}

html[data-brand-state="searching"] .pulse-orbit__axis {
  animation: pulse-orbit-scan 1.7s ease-in-out infinite;
}

html[data-brand-state="searching"] .pulse-orbit__highlight {
  stroke-dasharray: 18 72;
  animation: pulse-orbit-travel 1.35s linear infinite;
}

html[data-brand-state="vision"] .pulse-orbit {
  animation: pulse-orbit-focus 2.6s ease-in-out infinite;
}

html[data-brand-state="streaming"] .pulse-orbit__flare {
  animation: pulse-orbit-handoff 560ms cubic-bezier(0.22, 1, 0.36, 1) 1;
}

html[data-brand-state="recovering"] .pulse-orbit {
  animation: pulse-orbit-recover 2.8s ease-in-out infinite;
}

html[data-brand-state="completed"] .pulse-orbit {
  animation: pulse-orbit-settle 260ms ease-out 1;
}

html[data-brand-state="offline"] .pulse-orbit,
html[data-brand-state="offline"] .pulse-orbit use {
  animation: none !important;
  filter: none !important;
}

html[data-brand-state="offline"] .pulse-orbit__halo,
html[data-brand-state="offline"] .pulse-orbit__flare { opacity: 0; }
html[data-brand-state="offline"] .pulse-orbit__far { color: #4e4b47; opacity: 0.45; }
html[data-brand-state="offline"] .pulse-orbit__near { color: #77716a; opacity: 0.62; }
html[data-brand-state="offline"] .pulse-orbit__highlight,
html[data-brand-state="offline"] .pulse-orbit__axis { color: #999088; opacity: 0.45; }

html[data-brand-paused="true"] .pulse-orbit use,
html[data-brand-paused="true"] .pulse-orbit {
  animation-play-state: paused !important;
}

#app.sidebar-collapsed .pulse-brand--sidebar .pulse-brand__lockup { display: none; }
#app.sidebar-collapsed .pulse-brand--sidebar { justify-content: center; }
#app.sidebar-collapsed .pulse-brand--sidebar .pulse-orbit { width: 2.15rem; }

@keyframes pulse-orbit-axis-intro {
  from { opacity: 0; transform: translate(-8px, 5px) scaleX(0.72); }
  to { opacity: 0.9; transform: translate(0, 0) scaleX(1); }
}

@keyframes pulse-orbit-flare-intro {
  0%, 28% { opacity: 0; transform: scale(0.55); }
  66% { opacity: 1; transform: scale(1.14); }
  100% { opacity: 0.92; transform: scale(1); }
}

@keyframes pulse-orbit-idle-depth {
  0%, 100% { opacity: 0.9; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-0.5px); }
}

@keyframes pulse-orbit-travel { to { stroke-dashoffset: -92; } }

@keyframes pulse-orbit-precess {
  0%, 100% { transform: rotate(-0.65deg) scale(1); }
  50% { transform: rotate(0.65deg) scale(1.012); }
}

@keyframes pulse-orbit-scan {
  0%, 100% { opacity: 0.46; transform: translate(-2px, 1px); }
  50% { opacity: 1; transform: translate(2px, -1px); }
}

@keyframes pulse-orbit-focus {
  0%, 100% { transform: scale(0.99); }
  50% { transform: scale(1.018); }
}

@keyframes pulse-orbit-handoff {
  0% { opacity: 0.35; transform: scale(0.72); }
  45% { opacity: 1; transform: scale(1.34); }
  100% { opacity: 0.92; transform: scale(1); }
}

@keyframes pulse-orbit-recover {
  0%, 100% { transform: translateX(0) rotate(0); opacity: 0.82; }
  22% { transform: translateX(-0.8px) rotate(-0.45deg); opacity: 1; }
  31% { transform: translateX(0.45px) rotate(0.25deg); opacity: 0.74; }
  68% { transform: translateX(0) rotate(0); opacity: 0.92; }
}

@keyframes pulse-orbit-settle {
  from { transform: scale(1.025); }
  to { transform: scale(1); }
}

@media (max-width: 860px) {
  .pulse-orbit__halo { filter: none; opacity: 0.12; }
  .pulse-brand--hero .pulse-brand__mark::before,
  .pulse-brand--hero .pulse-brand__mark::after { display: none; }
  .pulse-brand--sidebar { max-width: 12rem; }
}

@media (max-width: 360px) {
  .pulse-brand--hero { margin-bottom: 0; }
  .pulse-brand--hero .pulse-orbit { width: 4.5rem; }
  .pulse-brand--hero .pulse-brand__descriptor { display: none; }
  .pulse-brand--login .pulse-orbit { width: 4rem; }
  .pulse-brand--login .pulse-brand__pulse { font-size: 1.08rem; }
  .pulse-brand--login .pulse-brand__ai { font-size: 1.05rem; }
  .pulse-brand__descriptor { letter-spacing: 0.08em; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-orbit,
  .pulse-orbit use {
    animation: none !important;
    transition: none !important;
    filter: none !important;
  }
  .pulse-brand--hero .pulse-brand__mark::before,
  .pulse-brand--hero .pulse-brand__mark::after { display: none; }
}

html[data-brand-motion="reduced"] .pulse-orbit,
html[data-brand-motion="reduced"] .pulse-orbit use {
  animation: none !important;
  transition: none !important;
  filter: none !important;
}

@media (forced-colors: active) {
  .pulse-orbit,
  .pulse-orbit use {
    color: CanvasText !important;
    opacity: 1 !important;
    animation: none !important;
    filter: none !important;
  }
  .pulse-orbit__halo,
  .pulse-orbit__flare { display: none; }
  .pulse-brand { color: CanvasText; }
  .pulse-brand__descriptor { color: CanvasText; }
}
