/* Aurea Quantra operational demo — boutique “studio” presentation */

:root {
  --aq-gold: #c9a227;
  --aq-gold-bright: #e4c45c;
  --aq-gold-dim: rgba(201, 162, 39, 0.35);
  --aq-charcoal: #1a1918;
  --aq-ink: #2e2c2a;
  --aq-muted: #5e5a55;
  --aq-slate: #3d5a80;
  --aq-cream: #faf7f2;
  --aq-line: rgba(44, 36, 24, 0.09);
  --aq-glass: rgba(255, 255, 255, 0.78);
  --aq-glass-edge: rgba(255, 255, 255, 0.92);
  --aq-shadow: 0 4px 28px rgba(28, 22, 18, 0.07), 0 1px 3px rgba(28, 22, 18, 0.04);
  --aq-shadow-hover: 0 18px 48px rgba(28, 22, 18, 0.12), 0 4px 12px rgba(201, 162, 39, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body.pbix-body {
  font-family: var(--font-body);
  /* Cool base so warm radial overlays read clearly (also differs from older flat tan builds). */
  background: #c5ccd6;
  color: var(--aq-ink);
  position: relative;
  line-height: 1.55;
}

/* Atmospheric layer */
body.pbix-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 70% at 0% -10%, rgba(201, 162, 39, 0.2), transparent 52%),
    radial-gradient(ellipse 80% 55% at 100% 5%, rgba(61, 90, 128, 0.12), transparent 48%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(139, 115, 85, 0.08), transparent 50%),
    linear-gradient(168deg, #f0ebe3 0%, #e5e0d8 45%, #ddd8cf 100%);
}

.pbix-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Top bar --- */
.aq-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.35rem;
  background: linear-gradient(115deg, #121110 0%, #1f1d1b 38%, #252320 100%);
  color: #f7f3eb;
  border-bottom: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}

.aq-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--aq-gold), var(--aq-gold-bright), var(--aq-gold), transparent);
  opacity: 0.85;
}

@media (prefers-reduced-motion: no-preference) {
  .aq-topbar {
    animation: topbar-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@keyframes topbar-in {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.aq-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.aq-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: conic-gradient(from 220deg, var(--aq-gold-bright), #f5edd2, var(--aq-gold), #7a6528, var(--aq-gold-bright));
  box-shadow:
    0 0 0 2px rgba(201, 162, 39, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .aq-mark {
    animation: mark-pulse 4s ease-in-out infinite;
  }
}

@keyframes mark-pulse {
  0%,
  100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.08) saturate(1.05);
  }
}

.aq-product {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.2;
  background: linear-gradient(120deg, #fff 0%, #e8dcc8 55%, #c9a227 130%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.aq-sub {
  font-size: 0.8rem;
  opacity: 0.78;
  margin-top: 0.15rem;
  letter-spacing: 0.02em;
}

.aq-topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.8rem;
}

.pill {
  background: rgba(201, 162, 39, 0.16);
  color: #f5ebc8;
  border: 1px solid rgba(201, 162, 39, 0.5);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.15);
}

@media (prefers-reduced-motion: no-preference) {
  .pill {
    animation: pill-glow 3s ease-in-out infinite;
  }
}

@keyframes pill-glow {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(201, 162, 39, 0.12);
  }
  50% {
    box-shadow: 0 0 22px rgba(201, 162, 39, 0.28);
  }
}

.muted {
  opacity: 0.72;
}

/* --- Shell (framed “stage” — obvious vs. flat full-bleed layouts) --- */
.aq-shell {
  flex: 1;
  padding: 1.15rem 1.25rem 2.25rem;
  max-width: 1680px;
  margin: 0.85rem auto 1.25rem;
  width: calc(100% - 1.5rem);
  border-radius: 22px;
  border: 1px solid rgba(201, 162, 39, 0.55);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(250, 247, 242, 0.38) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45) inset,
    0 24px 60px rgba(18, 17, 16, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
  .aq-shell {
    width: calc(100% - 0.6rem);
    margin: 0.45rem auto 0.85rem;
    padding: 0.85rem 0.75rem 1.5rem;
    border-radius: 16px;
  }
}

.aq-build-pill {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a1918;
  background: linear-gradient(90deg, var(--aq-gold-bright), var(--aq-gold));
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(26, 25, 24, 0.12);
}

/* --- Tabs --- */
.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  background: var(--aq-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--aq-glass-edge);
  margin-bottom: 1rem;
  box-shadow: var(--aq-shadow);
}

@media (prefers-reduced-motion: no-preference) {
  .page-tabs {
    animation: rise-fade 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
  }
}

.page-tab {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.5rem 0.95rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--aq-muted);
  letter-spacing: 0.02em;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.18s ease;
}

.page-tab:hover {
  background: rgba(201, 162, 39, 0.1);
  color: var(--aq-charcoal);
}

.page-tab.active {
  background: linear-gradient(165deg, #252320 0%, #1a1918 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(201, 162, 39, 0.35),
    0 6px 20px rgba(0, 0, 0, 0.2);
}

.page-tab.active:hover {
  color: #fff;
}

.tab-panel[hidden] {
  display: none !important;
}

.tab-panel.active {
  display: block;
  animation: panel-in 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise-fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Page heads --- */
.page-head {
  margin-bottom: 1rem;
}

.page-head h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--aq-charcoal);
  line-height: 1.15;
}

.page-sub {
  margin: 0;
  color: var(--aq-muted);
  font-size: 0.95rem;
  max-width: 62ch;
  font-weight: 500;
}

/* --- KPI --- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.kpi-card {
  position: relative;
  background: var(--aq-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--aq-glass-edge);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  box-shadow: var(--aq-shadow);
  overflow: hidden;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}

.kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--aq-gold), var(--aq-gold-bright), var(--aq-gold));
  opacity: 0.95;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--aq-shadow-hover);
}

@media (prefers-reduced-motion: no-preference) {
  .kpi-card {
    animation: rise-fade 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .kpi-card:nth-child(1) {
    animation-delay: 0.04s;
  }
  .kpi-card:nth-child(2) {
    animation-delay: 0.1s;
  }
  .kpi-card:nth-child(3) {
    animation-delay: 0.16s;
  }
  .kpi-card:nth-child(4) {
    animation-delay: 0.22s;
  }
  .kpi-card:nth-child(5) {
    animation-delay: 0.28s;
  }
  .kpi-card:nth-child(6) {
    animation-delay: 0.34s;
  }
  .kpi-card:nth-child(7) {
    animation-delay: 0.4s;
  }
  .kpi-card:nth-child(8) {
    animation-delay: 0.46s;
  }
}

.kpi-card h3 {
  margin: 0.15rem 0 0.4rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--aq-muted);
  font-weight: 700;
}

.kpi-value {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #141312 0%, #4a4540 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kpi-sub {
  font-size: 0.76rem;
  color: var(--aq-muted);
  margin-top: 0.25rem;
  font-weight: 500;
}

.kpi-trend {
  font-size: 0.72rem;
  color: #3d5a4a;
  margin-top: 0.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* --- Grid & cards --- */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.85rem;
}

.card {
  position: relative;
  background: var(--aq-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--aq-glass-edge);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--aq-shadow);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--aq-shadow-hover);
  border-color: rgba(201, 162, 39, 0.25);
}

.card h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--aq-slate);
  letter-spacing: -0.01em;
}

.chart-card > h2 {
  margin: 0 0 0.65rem;
  padding-left: 0.55rem;
  border-left: 3px solid rgba(201, 162, 39, 0.55);
}

.chart-card {
  min-height: 248px;
}

.chart-card.chart-tall {
  min-height: 328px;
}

.chart-card canvas {
  max-height: 280px;
}

.chart-tall canvas {
  max-height: 348px;
}

@media (prefers-reduced-motion: no-preference) {
  .tab-panel.active .chart-card {
    animation: rise-fade 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .tab-panel.active .chart-card:nth-of-type(1) {
    animation-delay: 0.06s;
  }
  .tab-panel.active .chart-card:nth-of-type(2) {
    animation-delay: 0.1s;
  }
  .tab-panel.active .chart-card:nth-of-type(3) {
    animation-delay: 0.14s;
  }
  .tab-panel.active .chart-card:nth-of-type(4) {
    animation-delay: 0.18s;
  }
  .tab-panel.active .chart-card:nth-of-type(5) {
    animation-delay: 0.22s;
  }
}

/* --- Slicers --- */
.slicer-bar {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem 0.85rem;
  border-left: 4px solid var(--aq-gold);
}

@media (prefers-reduced-motion: no-preference) {
  .slicer-bar {
    animation: rise-fade 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.04s both;
  }
}

.slicer-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.slicer-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--aq-charcoal);
}

.slicer-badge {
  font-size: 0.65rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.28);
  color: var(--aq-muted);
  font-weight: 600;
}

.btn-slicer-reset {
  margin-left: auto;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, #2e2c2a, #1a1918);
  color: #fff;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-slicer-reset:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.slicer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.btn-slicer-secondary {
  cursor: pointer;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.32rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--aq-line);
  background: rgba(255, 255, 255, 0.95);
  color: var(--aq-charcoal);
  text-decoration: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn-slicer-secondary:hover {
  background: #fff;
  border-color: rgba(201, 162, 39, 0.45);
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.12);
}

a.btn-slicer-link {
  display: inline-block;
  line-height: 1.25;
}

.slicer-head .btn-slicer-reset {
  margin-left: 0;
}

@media (min-width: 900px) {
  .slicer-head .slicer-actions {
    margin-left: auto;
  }
  .slicer-head .btn-slicer-reset {
    margin-left: 0.5rem;
  }
}

.slicer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 0.5rem 0.75rem;
}

.slicer-field {
  font-size: 0.72rem;
  color: var(--aq-muted);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  letter-spacing: 0.02em;
}

.slicer-select {
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--aq-line);
  background: rgba(255, 255, 255, 0.95);
  color: var(--aq-charcoal);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.slicer-select:hover {
  border-color: rgba(201, 162, 39, 0.35);
}

.slicer-select:focus {
  outline: none;
  border-color: var(--aq-gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

.slicer-empty {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5a3d28;
  background: rgba(201, 162, 39, 0.14);
  border: 1px solid rgba(201, 162, 39, 0.35);
}

.slicer-chart-sample {
  margin: 0.4rem 0 0;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--aq-slate);
  background: rgba(61, 90, 128, 0.08);
  border: 1px solid rgba(61, 90, 128, 0.18);
}

.slicer-code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.68rem;
}

.slicer-hint {
  margin: 0.55rem 0 0;
  font-size: 0.74rem;
  color: var(--aq-muted);
  line-height: 1.45;
  max-width: 85ch;
}

.viz-tag {
  font-family: var(--font-body);
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--aq-gold);
  margin-left: 0.4rem;
  vertical-align: middle;
  opacity: 0.9;
}

.span-4 {
  grid-column: span 4;
}
.span-5 {
  grid-column: span 5;
}
.span-6 {
  grid-column: span 6;
}
.span-7 {
  grid-column: span 7;
}
.span-8 {
  grid-column: span 8;
}
.span-12 {
  grid-column: span 12;
}

@media (max-width: 1100px) {
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }
}

.commentary p {
  margin: 0;
  line-height: 1.6;
  color: #45423e;
  font-size: 0.92rem;
}

/* --- AI insight --- */
.ai-insight {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(44, 36, 24, 0.08);
}

.ai-insight-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--aq-muted);
  margin-bottom: 0.45rem;
}

.ai-insight-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--aq-line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 2.75rem;
  background: rgba(255, 255, 255, 0.92);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.ai-insight-textarea:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.ai-insight-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.55rem;
}

.ai-insight-trust {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  line-height: 1.45;
}

.ai-insight-status {
  font-size: 0.82rem;
}

.ai-insight-out {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(61, 90, 128, 0.06);
  border: 1px solid rgba(61, 90, 128, 0.14);
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--aq-charcoal);
}

.big {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0.4rem 0 0;
}

.checklist,
.mono-list {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.6;
  font-size: 0.9rem;
}

.mono-list {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
}

/* --- Footer --- */
.aq-footer {
  padding: 0.85rem 1.25rem;
  font-size: 0.74rem;
  color: rgba(247, 243, 235, 0.82);
  border-top: 1px solid rgba(201, 162, 39, 0.25);
  background: linear-gradient(180deg, #1f1d1b 0%, #121110 100%);
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  .aq-topbar,
  .page-tabs,
  .kpi-card,
  .tab-panel.active .chart-card,
  .slicer-bar,
  .pill,
  .aq-mark {
    animation: none !important;
  }
}
