/* GGE Aivy Performance — Radial Gauges
   Scoped to .gge-aivyg. Light (porcelain) + dark (deep green) themes. */

.gge-aivyg {
  --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-aivyg * { box-sizing: border-box; }

.gge-aivyg[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);
  --track: rgba(26, 64, 41, 0.10);
  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-aivyg[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);
  --track: rgba(246, 241, 222, 0.12);
  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-aivyg::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-aivyg[data-theme="light"]::before { opacity: 0.03; }
.gge-aivyg[data-theme="dark"]::before  { opacity: 0.05; }
.gge-aivyg::after {
  content: ""; position: absolute; inset: clamp(10px, 1.4vw, 18px);
  border: 0; border-radius: 12px; pointer-events: none;
}

.gge-aivyg__inner { position: relative; z-index: 1; max-width: var(--aivy-innerw, 1000px); margin: 0 auto; }
.gge-aivyg__head { margin-bottom: clamp(24px, 3vw, 38px); }
.gge-aivyg 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-aivyg__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-aivyg__grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2.4vw, 34px);
  margin: clamp(8px, 1.5vw, 18px) 0 clamp(6px, 1vw, 12px);
}
.gge-aivyg__gauge { display: flex; flex-direction: column; align-items: center; text-align: center; }
.gge-aivyg__ring { position: relative; width: clamp(118px, 15vw, 172px); aspect-ratio: 1; }
.gge-aivyg__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gge-aivyg__track { fill: none; stroke: var(--track); stroke-width: 12; }
.gge-aivyg__fill {
  fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: 339.292; stroke-dashoffset: 339.292;
}
.gge-aivyg__pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: clamp(19px, 2.3vw, 29px); font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em; color: var(--ink);
  opacity: 0;
}
.gge-aivyg__name {
  margin-top: 14px; font-size: clamp(12px, 1.2vw, 14.5px); font-weight: 600; line-height: 1.35;
  max-width: 210px; color: var(--ink);
}
.gge-aivyg__name small { display: block; font-weight: 400; color: var(--ink-55); font-size: 0.86em; margin-top: 2px; }

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

.gge-aivyg.is-inview .gge-aivyg__fill {
  animation: gge-aivyg-ring 1950ms var(--ease) forwards; animation-delay: var(--delay);
}
.gge-aivyg.is-inview .gge-aivyg__pct {
  animation: gge-aivyg-fade 820ms var(--ease) forwards; animation-delay: calc(var(--delay) + 980ms);
}
@keyframes gge-aivyg-ring { to { stroke-dashoffset: var(--off); } }
@keyframes gge-aivyg-fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .gge-aivyg__fill, .gge-aivyg__pct { animation: none !important; }
  .gge-aivyg__fill { stroke-dashoffset: var(--off); }
  .gge-aivyg__pct { opacity: 1; }
}
@media (max-width: 640px) {
  .gge-aivyg__grid { grid-template-columns: 1fr; gap: 22px; }
  .gge-aivyg__ring { width: clamp(130px, 40vw, 168px); }
}

/* no-JS fallback: show final state */
@media (scripting: none) {
  .gge-aivyg__fill { stroke-dashoffset: var(--off); }
  .gge-aivyg__pct { opacity: 1; }
}
