/* GGE Aivy Performance — Vertical Bars
   Scoped to .gge-aivyb. Light (porcelain) + dark (deep green) themes. */

.gge-aivyb {
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  max-width: var(--aivy-maxw, 1180px);
  margin: 28px auto;
  padding: clamp(24px, 3.4vw, 46px) clamp(24px, 4.5vw, 60px);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Montserrat", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.gge-aivyb * { box-sizing: border-box; }

.gge-aivyb[data-theme="light"] {
  --ink: #1a4029;
  --ink-70: rgba(26, 64, 41, 0.68);
  --ink-55: rgba(26, 64, 41, 0.55);
  --hairline: rgba(26, 64, 41, 0.13);
  --grid: rgba(26, 64, 41, 0.09);
  --axis: rgba(26, 64, 41, 0.28);
  color: var(--ink);
  background:
    radial-gradient(96% 88% at 72% 12%, rgba(255,255,255,0.92), rgba(255,255,255,0) 60%),
    linear-gradient(158deg, #fcfdfb 0%, #f5f7f3 52%, #ebeee8 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 20px 50px rgba(26,64,41,0.10), 0 2px 6px rgba(26,64,41,0.05);
}
.gge-aivyb[data-theme="dark"] {
  --ink: #f6f1de;
  --ink-70: rgba(246, 241, 222, 0.72);
  --ink-55: rgba(246, 241, 222, 0.52);
  --hairline: rgba(246, 241, 222, 0.16);
  --grid: rgba(246, 241, 222, 0.10);
  --axis: rgba(246, 241, 222, 0.30);
  color: var(--ink);
  background: radial-gradient(120% 120% at 50% 0%, #2a4632 0%, #1c3323 52%, #172b1d 100%);
  box-shadow: inset 0 1px 0 rgba(246,241,222,0.06), 0 24px 60px rgba(0,0,0,0.35);
}

.gge-aivyb::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
.gge-aivyb[data-theme="light"]::before { opacity: 0.03; }
.gge-aivyb[data-theme="dark"]::before  { opacity: 0.05; }
.gge-aivyb::after {
  content: ""; position: absolute; inset: clamp(10px, 1.4vw, 18px);
  border: 0; border-radius: 12px; pointer-events: none;
}

.gge-aivyb__inner { position: relative; z-index: 1; max-width: var(--aivy-innerw, 1000px); margin: 0 auto; }
.gge-aivyb__head { margin-bottom: clamp(20px, 2.6vw, 30px); }
.gge-aivyb h2 {
  margin: 0 0 10px; color: var(--ink);
  font-size: clamp(19px, 2.4vw, 30px); line-height: 1.22; font-weight: 700; letter-spacing: -0.012em;
}
.gge-aivyb__subtitle {
  max-width: 720px; margin: 0; color: var(--ink-70);
  font-size: clamp(12.5px, 1.3vw, 16px); line-height: 1.5; font-weight: 400;
}

.gge-aivyb__chart { position: relative; margin-top: clamp(14px, 2vw, 24px); padding-top: clamp(24px, 3vw, 36px); padding-left: clamp(40px, 5vw, 56px); }
.gge-aivyb__plot { position: relative; height: clamp(210px, 26vw, 300px); border-bottom: 1.5px solid var(--axis); }
.gge-aivyb__grid {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, var(--grid) 0, var(--grid) 1px, transparent 1px, transparent 25%);
}
.gge-aivyb__yaxis { position: absolute; inset: 0; pointer-events: none; color: var(--ink-70); font-size: clamp(10px, 1vw, 12.5px); font-variant-numeric: tabular-nums; }
.gge-aivyb__yaxis span { position: absolute; right: calc(100% + 12px); transform: translateY(-50%); white-space: nowrap; line-height: 1; }

.gge-aivyb__bars {
  position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  align-items: end; column-gap: clamp(28px, 6vw, 90px); padding: 0 clamp(14px, 4vw, 56px); z-index: 2;
}
.gge-aivyb__group { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.gge-aivyb__bar {
  width: min(100%, 170px); height: calc(var(--pct) * 1%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, white), var(--accent));
  border: none;
  transform: scaleY(0); transform-origin: bottom center;
}
.gge-aivyb[data-theme="dark"] .gge-aivyb__bar {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, white), var(--accent));
}
.gge-aivyb__val {
  position: absolute; bottom: calc(var(--pct) * 1% + 12px); left: 50%;
  color: var(--ink); font-size: clamp(15px, 1.7vw, 21px); font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; transform: translate(-50%, 8px);
}
.gge-aivyb__labels {
  display: grid; grid-template-columns: repeat(3, 1fr);
  column-gap: clamp(28px, 6vw, 90px); padding: 12px clamp(14px, 4vw, 56px) 0;
  text-align: center; font-size: clamp(11px, 1.15vw, 14px); font-weight: 500; line-height: 1.35; color: var(--ink-70);
}

.gge-aivyb__note {
  margin-top: clamp(20px, 2.6vw, 30px);
  color: var(--ink-55); font-size: clamp(10.5px, 1.05vw, 12.5px); line-height: 1.6;
}
.gge-aivyb__note p { margin: 0; }
.gge-aivyb__note strong { color: var(--ink-70); font-weight: 600; }

.gge-aivyb.is-inview .gge-aivyb__bar {
  animation: gge-aivyb-rise 1450ms var(--ease) forwards; animation-delay: var(--delay);
}
.gge-aivyb.is-inview .gge-aivyb__val {
  animation: gge-aivyb-fadeup 780ms var(--ease) forwards; animation-delay: calc(var(--delay) + 1150ms);
}
@keyframes gge-aivyb-rise   { to { transform: scaleY(1); } }
@keyframes gge-aivyb-fadeup { to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
  .gge-aivyb__bar, .gge-aivyb__val { animation: none !important; }
  .gge-aivyb__bar { transform: scaleY(1); }
  .gge-aivyb__val { opacity: 1; transform: translate(-50%, 0); }
}
@media (max-width: 560px) {
  .gge-aivyb__labels, .gge-aivyb__bars { column-gap: 18px; }
}

/* no-JS fallback: show final state */
@media (scripting: none) {
  .gge-aivyb__bar { transform: scaleY(1); }
  .gge-aivyb__val { opacity: 1; transform: translate(-50%, 0); }
}
