/* AVENQORA Launch Candidate — shared typography, appearance and premium depth layer.
   This file is intentionally dependency-free and safe for public/client/internal surfaces. */

:root {
  color-scheme: dark light;
  --aq-readable-xs: 10px;
  --aq-readable-sm: 11.5px;
  --aq-readable-md: 13px;
  --aq-readable-body: 14.5px;
  --aq-focus-ring: 0 0 0 3px rgba(0, 189, 214, .16);
  --aq-panel-glow: 0 24px 70px rgba(0, 0, 0, .24), inset 0 1px rgba(255,255,255,.045);
}

/* ---------- Readability ---------- */
#appView,
.app-shell {
  font-size: var(--aq-readable-body);
  line-height: 1.55;
}
.app-context strong { font-size: 14px !important; }
.app-context span { font-size: 11px !important; line-height: 1.4; }
.app-sidebar-label,
.app-nav-group-label { font-size: 10px !important; line-height: 1.25; }
.app-sidebar .app-nav-button,
.app-sidebar button { font-size: 11.5px; line-height: 1.3; }
.metric-card span { font-size: 10.5px !important; line-height: 1.35; }
.metric-card strong { font-size: clamp(20px, 2.2vw, 28px) !important; line-height: 1.08; }
.metric-card small { font-size: 11.5px !important; line-height: 1.5; }
.panel-head h2 { font-size: 16px !important; line-height: 1.25; }
.panel-head span { font-size: 11px !important; line-height: 1.45; }
.data-table th { font-size: 10.5px !important; line-height: 1.35; }
.data-table td { font-size: 12px !important; line-height: 1.55; }
.status-pill { font-size: 10px !important; line-height: 1.25; padding: 6px 9px !important; }
.summary-item span { font-size: 10px !important; line-height: 1.35; }
.summary-item strong { font-size: 12.5px !important; line-height: 1.55; }
.timeline-copy span,
.timeline-state { font-size: 11px !important; line-height: 1.45; }
.timeline-dot { font-size: 10px !important; }
.empty-state { font-size: 12.5px !important; line-height: 1.65; }
.deliverable p,
.payment-method span,
.solution-footer,
.proposal-inclusions span,
.qa-gate,
.preview-gate-card p,
.preview-protections span,
.preview-toolbar-copy span { font-size: 11.5px !important; line-height: 1.55; }
.btn-small { font-size: 11px !important; }
.field label { font-size: 11px !important; line-height: 1.35; }
.field input,
.field textarea,
.field select { font-size: 14px; line-height: 1.5; }

/* Public microcopy that was visually too small. */
#publicSite .aq-core-center span,
#publicSite .aq-core-node,
#publicSite .aq-core-readout span,
#publicSite .aq-chaos-readout span { font-size: 9px !important; }
#publicSite .aq-core-center small,
#publicSite .aq-core-readout small { font-size: 9.5px !important; line-height: 1.55; }
#publicSite .aq-core-readout strong { font-size: 12px !important; }
#publicSite .aq-hero-tertiary { font-size: 10.5px !important; }
#publicSite .aq-mini-audit-form label { font-size: 10px !important; }
#publicSite .aq-mini-audit-form input,
#publicSite .aq-mini-audit-form textarea { font-size: 14px !important; }

/* ---------- Premium 3D restraint ---------- */
#publicSite .aq-core-constellation {
  filter: saturate(.88) contrast(1.02);
  transition: transform .5s cubic-bezier(.22,.8,.28,1), filter .35s ease;
}
#publicSite .aq-core-center {
  width: 132px;
  height: 132px;
  border-color: rgba(184, 225, 239, .25);
  background:
    linear-gradient(145deg, rgba(22,31,42,.92), rgba(5,10,17,.97)),
    radial-gradient(circle at 32% 22%, rgba(220,248,255,.18), transparent 22%);
  box-shadow:
    0 32px 90px rgba(0,0,0,.42),
    0 0 42px rgba(53,174,201,.075),
    inset 0 1px rgba(255,255,255,.1),
    inset 0 -24px 54px rgba(0,0,0,.18);
}
#publicSite .aq-core-center strong {
  font-size: 27px !important;
  font-weight: 650;
  letter-spacing: -.045em;
}
#publicSite .aq-core-center::before,
#publicSite .aq-core-center::after { opacity: .72; }
#publicSite .aq-core-node {
  min-width: 100px;
  min-height: 38px;
  padding: 0 12px;
  border-color: rgba(183, 212, 228, .16);
  border-radius: 12px;
  color: rgba(218, 232, 241, .78);
  background: linear-gradient(145deg, rgba(10,18,28,.84), rgba(4,8,14,.76));
  box-shadow: 0 18px 42px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.045);
  backdrop-filter: blur(20px) saturate(120%);
  letter-spacing: .105em;
}
#publicSite .aq-core-node::before {
  width: 4px;
  height: 4px;
  box-shadow: 0 0 8px rgba(103, 226, 247, .42);
}
#publicSite .aq-core-node:hover,
#publicSite .aq-core-node:focus-visible,
#publicSite .aq-core-node.is-active {
  border-color: rgba(139, 224, 240, .3);
  background: linear-gradient(145deg, rgba(14,29,41,.9), rgba(6,12,20,.86));
  box-shadow: 0 24px 56px rgba(0,0,0,.3), 0 0 22px rgba(75,215,240,.05), inset 0 1px rgba(255,255,255,.065);
  transform: translate(-50%, -50%) translateZ(25px) scale(1.018);
}
#publicSite .aq-core-readout {
  border-color: rgba(176, 211, 231, .15);
  background: linear-gradient(145deg, rgba(8,14,22,.86), rgba(3,7,12,.78));
  box-shadow: 0 18px 48px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(22px) saturate(115%);
}
#publicSite .aq-experience-theatre,
#publicSite .aq-hero-card {
  border-color: rgba(184, 212, 230, .16);
  box-shadow: 0 42px 120px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.06);
}
#publicSite .aq-experience-theatre::before { opacity: .58; }

/* ---------- Appearance control ---------- */
.aq-appearance-control {
  position: fixed;
  z-index: 2147482500;
  top: max(88px, calc(env(safe-area-inset-top) + 72px));
  right: max(12px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 16px 42px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.05);
  backdrop-filter: blur(18px) saturate(120%);
}
.aq-appearance-control button {
  min-width: 44px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font: 750 10px/1 var(--font-body);
  letter-spacing: .035em;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.aq-appearance-control button:hover { color: var(--ink); }
.aq-appearance-control button[aria-pressed="true"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-3) 68%, transparent);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 5px 14px rgba(0,0,0,.12);
}
.aq-appearance-control button:focus-visible { outline: none; box-shadow: var(--aq-focus-ring); }

/* ---------- Live sync status ---------- */
.aq-sync-status {
  position: fixed;
  z-index: 2147482400;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 12px 34px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.045);
  backdrop-filter: blur(16px) saturate(120%);
  font: 700 10.5px/1 var(--font-body);
  cursor: pointer;
}
.aq-sync-status.is-visible { display: inline-flex; }
.aq-sync-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px color-mix(in srgb, var(--green) 56%, transparent);
}
.aq-sync-status[data-state="syncing"]::before { background: var(--cyan); animation: aqSyncPulse 1s ease-in-out infinite; }
.aq-sync-status[data-state="offline"]::before,
.aq-sync-status[data-state="error"]::before { background: var(--red); box-shadow: none; }
.aq-sync-status[data-state="paused"]::before { background: var(--amber); box-shadow: none; }
@keyframes aqSyncPulse { 50% { transform: scale(1.45); opacity: .48; } }

/* ---------- Light theme ---------- */
html[data-theme="light"] {
  --ink: #10243a;
  --muted: #536a82;
  --subtle: #6d8094;
  --base: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #edf3f8;
  --surface-3: #e4edf5;
  --line: rgba(35, 67, 96, .14);
  --line-strong: rgba(0, 126, 157, .3);
  --cyan: #007f9e;
  --cyan-2: #006d87;
  --blue: #1f5fd1;
  --violet: #6950c7;
  --green: #157a55;
  --amber: #9b6500;
  --red: #b83d55;
  --shadow: 0 28px 80px rgba(32, 61, 88, .12);
  --aq-panel-glow: 0 24px 68px rgba(31, 61, 91, .1), inset 0 1px #fff;
}
html[data-theme="light"] body { color: var(--ink); background: var(--base); }
html[data-theme="light"] .gradient-text {
  background: linear-gradient(105deg, #17324e 0%, #007c99 48%, #6248b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
html[data-theme="light"] .site-header.scrolled,
html[data-theme="light"] .app-topbar,
html[data-theme="light"] .preview-toolbar {
  background: rgba(247,250,253,.9) !important;
  border-color: var(--line) !important;
  box-shadow: 0 10px 32px rgba(42,69,94,.06);
}
html[data-theme="light"] .brand { color: #122b43; }
html[data-theme="light"] .brand-mark { background-image: url('/icons/avenqora-mark-light.svg'); filter: none; }
html[data-theme="light"] #publicSite,
html[data-theme="light"] .solution-page,
html[data-theme="light"] .preview-gate,
html[data-theme="light"] .app-shell {
  background:
    radial-gradient(circle at 78% 4%, rgba(0, 145, 178, .075), transparent 28%),
    radial-gradient(circle at 12% 28%, rgba(105, 80, 199, .045), transparent 23%),
    var(--base) !important;
}
html[data-theme="light"] .app-sidebar {
  background: rgba(248,251,253,.96) !important;
  border-color: var(--line) !important;
}
html[data-theme="light"] .app-panel,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .summary-item,
html[data-theme="light"] .proposal-card,
html[data-theme="light"] .deliverable,
html[data-theme="light"] .payment-method,
html[data-theme="light"] .qa-gate,
html[data-theme="light"] .consent-row,
html[data-theme="light"] .consent-box,
html[data-theme="light"] .preview-gate-card,
html[data-theme="light"] .solution-form,
html[data-theme="light"] .demo-card,
html[data-theme="light"] .advisor-panel,
html[data-theme="light"] .policy-card {
  color: var(--ink);
  border-color: var(--line) !important;
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(244,248,251,.92)) !important;
  box-shadow: var(--aq-panel-glow);
}
html[data-theme="light"] .data-table-wrap { background: #fff; border-color: var(--line); }
html[data-theme="light"] .data-table th { color: #536a82; background: #eef3f7 !important; }
html[data-theme="light"] .data-table td { color: #3b536b; border-color: var(--line); }
html[data-theme="light"] .data-table td strong,
html[data-theme="light"] .summary-item strong,
html[data-theme="light"] .panel-head h2,
html[data-theme="light"] .app-context strong { color: #17324d; }
html[data-theme="light"] .field input,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .field select,
html[data-theme="light"] .aq-mini-audit-form input,
html[data-theme="light"] .aq-mini-audit-form textarea,
html[data-theme="light"] .assistant-form textarea {
  color: #15314b !important;
  background: #fff !important;
  border-color: rgba(37,71,100,.2) !important;
}
html[data-theme="light"] .field input:focus,
html[data-theme="light"] .field textarea:focus,
html[data-theme="light"] .field select:focus,
html[data-theme="light"] .aq-mini-audit-form input:focus,
html[data-theme="light"] .aq-mini-audit-form textarea:focus {
  background: #fff !important;
  border-color: rgba(0,126,157,.52) !important;
  box-shadow: var(--aq-focus-ring) !important;
}
html[data-theme="light"] .btn:not(.btn-primary):not(.nav-cta) {
  color: #27445f;
  background: rgba(255,255,255,.88);
  border-color: rgba(38,70,98,.18);
}
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .nav-cta {
  color: #f8fdff !important;
  background: linear-gradient(112deg, #007f9e, #365fb2) !important;
  border-color: transparent !important;
  box-shadow: 0 12px 30px rgba(20,104,138,.16);
}
html[data-theme="light"] #publicSite .aq-hero-card,
html[data-theme="light"] #publicSite .aq-experience-theatre,
html[data-theme="light"] #publicSite .aq-core-readout,
html[data-theme="light"] #publicSite .aq-core-node,
html[data-theme="light"] #publicSite .aq-core-center {
  color: #17324d;
  border-color: rgba(37,71,100,.15);
  background: linear-gradient(145deg, rgba(255,255,255,.93), rgba(235,242,247,.9)) !important;
  box-shadow: 0 28px 80px rgba(43,73,99,.11), inset 0 1px #fff;
}
html[data-theme="light"] #publicSite .aq-core-node,
html[data-theme="light"] #publicSite .aq-core-readout small,
html[data-theme="light"] #publicSite .aq-core-center small { color: #5a7086; }
html[data-theme="light"] #publicSite .aq-core-center strong,
html[data-theme="light"] #publicSite .aq-core-readout strong { color: #17324d; }
html[data-theme="light"] #publicSite .aq-core-axis,
html[data-theme="light"] #publicSite .aq-core-axis::before,
html[data-theme="light"] #publicSite .aq-core-axis::after { border-color: rgba(22,111,139,.16); }
html[data-theme="light"] .invoice-paper { color: #0b1a33; }

@media (max-width: 860px) {
  .aq-appearance-control {
    top: auto;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(56px, calc(env(safe-area-inset-bottom) + 52px));
  }
  .aq-appearance-control button { min-width: 40px; min-height: 34px; padding-inline: 8px; font-size: 9.5px; }
  .aq-sync-status { right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); }
  .data-table td { font-size: 11.5px !important; }
  .metric-card { min-height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  .aq-appearance-control button,
  #publicSite .aq-core-constellation,
  #publicSite .aq-core-node { transition: none !important; }
  .aq-sync-status[data-state="syncing"]::before { animation: none !important; }
}
