/* AVENQORA Official Brand Identity — canonical implementation layer.
   The approved metallic A + cyan intelligence core is the only master mark. */
:root {
  --avq-bg-primary: #0A0F19;
  --avq-bg-secondary: #121820;
  --avq-surface: #101722;
  --avq-surface-elevated: #16202D;
  --avq-surface-glass: rgba(18, 24, 32, .84);
  --avq-metal: #A0A8B8;
  --avq-metal-bright: #F2F4F8;
  --avq-text-primary: #F2F4F8;
  --avq-text-secondary: #A0A8B8;
  --avq-accent-cyan: #00E5FF;
  --avq-accent-blue: #0066FF;
  --avq-accent-violet: #8B5CFF;
  --avq-border: rgba(160, 168, 184, .18);
  --avq-border-accent: rgba(0, 229, 255, .32);
  --avq-success: #58D8A4;
  --avq-warning: #F4C86A;
  --avq-danger: #FF748C;
  --avq-font-display: "Exo 2", "Sora", "Manrope", "Segoe UI", sans-serif;
  --avq-font-body: "Manrope", "Inter", "Segoe UI", sans-serif;

  /* Compatibility mapping keeps every existing RC1 view on one palette. */
  --ink: var(--avq-text-primary);
  --muted: var(--avq-text-secondary);
  --subtle: #748091;
  --base: var(--avq-bg-primary);
  --surface: var(--avq-surface);
  --surface-2: var(--avq-bg-secondary);
  --surface-3: var(--avq-surface-elevated);
  --line: var(--avq-border);
  --line-strong: var(--avq-border-accent);
  --cyan: var(--avq-accent-cyan);
  --cyan-2: #00BFD8;
  --blue: var(--avq-accent-blue);
  --violet: var(--avq-accent-violet);
  --green: var(--avq-success);
  --amber: var(--avq-warning);
  --red: var(--avq-danger);
  --font-body: var(--avq-font-body);
  --font-display: var(--avq-font-display);
  --aq3-cyan: var(--avq-accent-cyan);
  --aq3-blue: var(--avq-accent-blue);
  --aq3-violet: var(--avq-accent-violet);
  --aq3-ink: var(--avq-text-primary);
  --aq3-muted: var(--avq-text-secondary);
  --aq3-line: var(--avq-border);
}

body { background: var(--avq-bg-primary); font-family: var(--avq-font-body); }
h1, h2, h3, h4, .brand-word { font-family: var(--avq-font-display); }

/* Backwards-compatible master lockup. Every legacy brand slot resolves here. */
.brand { gap: 10px; isolation: isolate; }
.brand-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 0 !important;
  border-radius: 0 !important;
  background: url('/icons/avenqora-mark-dark.svg') center / contain no-repeat !important;
  box-shadow: none !important;
  transform: none !important;
  filter: drop-shadow(0 0 11px rgba(0, 229, 255, .12));
}
.brand-mark::before, .brand-mark::after { content: none !important; display: none !important; }
.brand-word {
  color: var(--avq-metal-bright);
  background: linear-gradient(180deg, #F2F4F8 8%, #9BA4B3 48%, #F2F4F8 72%, #697382 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 580 !important;
  letter-spacing: .19em !important;
  text-shadow: 0 8px 26px rgba(0, 0, 0, .36);
}
.avq-brand-lockup { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.avq-brand-lockup img { display: block; width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 0 13px rgba(0, 229, 255, .15)); }
.avq-brand-lockup > span { min-width: 0; }
.avq-brand-lockup strong { display: block; color: var(--avq-metal-bright); font: 580 15px/1 var(--avq-font-display); letter-spacing: .19em; }
.avq-brand-lockup small { display: block; margin-top: 6px; color: var(--avq-metal); font: 650 6px/1.2 var(--avq-font-body); letter-spacing: .19em; text-transform: uppercase; }
.avq-brand-lockup small b { color: var(--avq-accent-cyan); font-weight: 750; }
.avq-brand-lockup.is-compact small { display: none; }
.avq-brand-lockup.is-compact img { width: 34px; height: 34px; }
.avq-brand-lockup.is-compact strong { font-size: 12px; }

/* Official subsystem identity remains subordinate to the company mark. */
.assistant-launcher-core,
.advisor-core .core-sphere {
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: url('/icons/avenqora-mark-dark.svg') center / contain no-repeat !important;
  box-shadow: none !important;
  color: transparent !important;
  font-size: 0 !important;
  transform: none !important;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, .16));
}
.assistant-launcher-core::before, .assistant-launcher-core::after { content: none !important; }
.advisor-mobile-orb { overflow: hidden; color: transparent !important; background: url('/icons/avenqora-mark-dark.svg') center / contain no-repeat !important; font-size: 0 !important; filter: drop-shadow(0 0 10px rgba(0, 229, 255, .15)); }

/* Fast, accessible canonical loading state. */
.loader {
  position: relative;
  width: 72px !important;
  height: 72px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: url('/icons/avenqora-mark-dark.svg') center / contain no-repeat;
  animation: avqBrandPulse 1.8s ease-in-out infinite !important;
  filter: drop-shadow(0 0 18px rgba(0, 229, 255, .22));
}
.loader::after { content: ""; position: absolute; left: 50%; top: 58%; width: 6px; height: 6px; border-radius: 50%; background: var(--avq-accent-cyan); box-shadow: 0 0 18px 6px rgba(0, 102, 255, .28); transform: translate(-50%, -50%); }
@keyframes avqBrandPulse { 0%,100% { opacity: .82; transform: scale(.98); } 50% { opacity: 1; transform: scale(1.025); } }

/* Hero: one foreground context panel, a readable official Core, no card collision. */
.aq-hero .aq-chaos-readout,
.aq-hero .aq-spatial-labels,
.aq-hero .cinematic-frame { display: none !important; }
.aq-cinematic-window { isolation: isolate; overflow: hidden !important; }
.aq-core-constellation { inset: 3% 1% 8%; z-index: 8; }
.aq-core-center {
  width: 138px;
  height: 138px;
  border-color: rgba(0, 229, 255, .28);
  background: radial-gradient(circle, rgba(0, 102, 255, .11), rgba(10, 15, 25, .94) 70%);
}
.aq-core-center::before {
  inset: 12px;
  border: 0;
  border-radius: 0;
  background: url('/icons/avenqora-mark-dark.svg') center / contain no-repeat;
  transform: none;
  filter: drop-shadow(0 0 15px rgba(0, 229, 255, .18));
}
.aq-core-center::after { inset: -27px; border-color: rgba(0, 229, 255, .12); }
.aq-core-center span, .aq-core-center strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.aq-core-center small { position: absolute; left: 50%; top: calc(100% + 24px); width: max-content; color: #8190A2; transform: translateX(-50%); }
.aq-core-node[data-capability="ai"] { --node-x: 0px; --node-y: -145px; }
.aq-core-node[data-capability="software"] { --node-x: 132px; --node-y: -101px; }
.aq-core-node[data-capability="automation"] { --node-x: 166px; --node-y: -8px; }
.aq-core-node[data-capability="cloud"] { --node-x: 134px; --node-y: 84px; }
.aq-core-node[data-capability="infrastructure"] { --node-x: 0px; --node-y: 136px; }
.aq-core-node[data-capability="security"] { --node-x: -134px; --node-y: 84px; }
.aq-core-node[data-capability="research"] { --node-x: -166px; --node-y: -8px; }
.aq-core-node[data-capability="invention"] { --node-x: -132px; --node-y: -101px; }
.aq-core-readout {
  z-index: 12;
  bottom: 0;
  width: min(390px, 82%);
  border-color: var(--avq-border-accent);
  background: rgba(10, 15, 25, .92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .38);
}

/* Signature intake → personalized existing explorer handoff. */
.aq-signature-explorer-context {
  display: none;
  position: relative;
  z-index: 5;
  margin: 30px 0 -18px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--avq-border-accent);
  border-radius: 22px;
  background: radial-gradient(circle at 8% 0, rgba(0, 229, 255, .1), transparent 34%), linear-gradient(145deg, rgba(18, 24, 32, .96), rgba(8, 12, 20, .96));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .36);
}
.aq-signature-explorer-context.is-active { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.aq-signature-explorer-brand { display: flex; align-items: center; gap: 15px; min-width: 0; }
.aq-signature-explorer-brand img { width: 54px; height: 54px; object-fit: contain; }
.aq-signature-explorer-brand span, .aq-signature-explorer-brand strong, .aq-signature-explorer-brand small { display: block; overflow-wrap: anywhere; }
.aq-signature-explorer-brand span { color: var(--avq-accent-cyan); font: 800 8px/1 var(--avq-font-body); letter-spacing: .16em; text-transform: uppercase; }
.aq-signature-explorer-brand strong { margin-top: 8px; color: var(--avq-text-primary); font: 610 clamp(18px, 2.5vw, 28px)/1.15 var(--avq-font-display); }
.aq-signature-explorer-brand small { margin-top: 7px; color: var(--avq-text-secondary); font-size: 10px; line-height: 1.5; }
.aq-signature-explorer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.aq-signature-explorer-actions .btn { min-height: 42px; }
.aq-signature-panel > .overlay-head::before { content: ""; flex: 0 0 auto; width: 38px; height: 38px; background: url('/icons/avenqora-mark-dark.svg') center / contain no-repeat; filter: drop-shadow(0 0 11px rgba(0, 229, 255, .16)); }
.aq-signature-init-core {
  border: 0 !important;
  background: url('/icons/avenqora-mark-dark.svg') center / contain no-repeat !important;
  box-shadow: none !important;
  filter: drop-shadow(0 0 22px rgba(0, 229, 255, .2));
}
.aq-signature-init-core span { display: none !important; }
.aq-signature-init-core i { border-color: rgba(0, 229, 255, .18) !important; }
.aq-signature-demo-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 20px; color: var(--avq-metal-bright); font: 580 11px/1 var(--avq-font-display); letter-spacing: .16em; }
.aq-signature-demo-brand img { width: 38px; height: 38px; }

/* App, install and operational shells use the same official mark and palette. */
.aq-install-prompt { border-color: var(--avq-border-accent); background: linear-gradient(145deg, rgba(18, 24, 32, .98), rgba(7, 11, 18, .98)); }
.aq-install-icon, .aq-app-brand img { border-radius: 12px; background: var(--avq-bg-primary); }
.aq-app-launch { background: radial-gradient(circle at 16% 12%, rgba(0, 229, 255, .09), transparent 30%), radial-gradient(circle at 84% 84%, rgba(139, 92, 255, .08), transparent 32%), var(--avq-bg-primary); }
.aq-app-launch-card { border-color: var(--avq-border); background: linear-gradient(145deg, rgba(18, 24, 32, .97), rgba(7, 11, 18, .97)); }
.app-topbar, .app-sidebar, .owner-login-card, .overlay-panel { border-color: var(--avq-border); }

@media (max-width: 1100px), (max-height: 820px) {
  .aq-core-constellation { inset: 5% -1% 7%; transform: perspective(1200px) rotateX(var(--aq-tilt-x)) rotateY(var(--aq-tilt-y)) scale(.88); }
  .aq-core-readout { bottom: -1%; }
}
@media (max-width: 900px) {
  .aq-core-constellation { inset: -2% 2% 4%; transform: perspective(1200px) rotateX(var(--aq-tilt-x)) rotateY(var(--aq-tilt-y)) scale(.78); }
  .aq-core-readout { bottom: -2%; }
  .aq-signature-explorer-context.is-active { grid-template-columns: 1fr; }
  .aq-signature-explorer-actions { justify-content: flex-start; }
}
@media (max-width: 620px) {
  .brand { gap: 7px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-word { font-size: 12px !important; letter-spacing: .15em !important; }
  .aq-core-constellation { inset: -5% -10% 4%; transform: perspective(1200px) rotateX(var(--aq-tilt-x)) rotateY(var(--aq-tilt-y)) scale(.61); }
  .aq-core-readout { bottom: -4%; width: 94%; }
  .aq-signature-explorer-context { margin-top: 22px; padding: 18px 15px; }
  .aq-signature-explorer-actions { display: grid; grid-template-columns: 1fr; }
  .aq-signature-explorer-actions .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .loader { animation: none !important; }
  .brand-mark, .avq-brand-lockup img, .aq-signature-init-core { filter: none; }
}
@media print {
  .brand-mark { background-image: url('/icons/avenqora-mark-mono.svg') !important; filter: none; }
  .brand-word { color: #0A0F19; background: none; -webkit-text-fill-color: #0A0F19; text-shadow: none; }
}
