/* AI-squared showcase
   Motion source: StokaSoftware/Kamui src/components/assets/AiSquared.astro
   at f6ed1a4b. The choreography and geometry below remain the canonical
   measured-width GSAP sequence; only its surrounding Sage Six layout differs. */

.ai-showcase {
  position: relative;
  display: grid;
  min-height: 0;
  padding: clamp(1.75rem, 3vw, 2.75rem) var(--gutter);
  place-items: center;
  scroll-margin-top: 2.75rem;
  overflow: clip;
}

.ais-section {
  position: relative;
  width: 100%;
  padding: 0;
  overflow: hidden;
}

.ais-stage {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  min-height: clamp(10rem, 14vw, 12rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: "Latin Modern Math", "Latin Modern Roman", "Cambria Math",
    "STIX Two Math", "CMU Serif", "Computer Modern Serif", Garamond,
    Georgia, serif;
  perspective: 1200px;
}

.ais-source {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.18em;
  max-width: 92%;
  overflow: hidden;
  color: rgba(74, 222, 128, 0.7);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ais-source-bracket { color: rgba(74, 222, 128, 0.45); }

.ais-source-cursor {
  display: inline-block;
  margin-left: 0.05em;
  animation: ais-blink 1s steps(2, end) infinite;
}

@keyframes ais-blink { 50% { opacity: 0; } }

.ais-eq {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  contain: layout style;
  gap: 0;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-style: italic;
  line-height: 1;
}

.ais-side {
  display: inline-flex;
  align-items: baseline;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform, opacity;
}

.ais-anchor {
  display: inline-block;
  color: #ffffff;
  transform-origin: center center;
  will-change: transform, opacity;
}

.ais-side[data-side="right"] .ais-anchor,
.ais-side[data-side="right"] .ais-tail {
  color: #4ade80;
  text-shadow: 0 0 14px rgba(74, 222, 128, 0.35);
}

.ais-bracket {
  display: inline-block;
  overflow: hidden;
  margin: 0 0.04em;
  color: #4ade80;
  font-style: normal;
  font-weight: 400;
  text-shadow: 0 0 16px rgba(74, 222, 128, 0.5);
  vertical-align: baseline;
  white-space: nowrap;
  will-change: max-width, opacity;
}

.ais-tail {
  display: inline-block;
  overflow: hidden;
  color: #ffffff;
  font-size: 0.62em;
  letter-spacing: -0.005em;
  vertical-align: baseline;
  white-space: nowrap;
  will-change: max-width;
}

.ais-char {
  display: inline-block;
  will-change: transform, opacity;
}

.ais-gap {
  display: inline-block;
  overflow: hidden;
}

.ais-stage:not([data-ais-ready]) .ais-eq { visibility: hidden; }

.ais-pipe {
  display: inline-block;
  overflow: hidden;
  margin: 0 0.12em;
  color: rgba(74, 222, 128, 0.85);
  font-style: normal;
  font-weight: 300;
  line-height: 1;
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.45);
  transform-origin: center center;
  will-change: transform, opacity;
}

.ais-sup {
  position: absolute;
  left: 0;
  top: 0;
  color: #4ade80;
  font-size: 0.55em;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 24px rgba(74, 222, 128, 0.55);
  will-change: transform, opacity;
}

@media (max-width: 56rem) {
  .ais-stage { min-height: 9.5rem; }
  .ais-eq { font-size: clamp(1.4rem, 3.5vw, 2.4rem); }
}

@media (max-width: 34rem) {
  .ai-showcase { padding-block: 1.75rem; }
  .ais-stage { min-height: 8.5rem; }
  .ais-source { margin-top: 1rem; font-size: 0.66rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ais-source-cursor { animation: none; opacity: 0; }
}

@media print {
  .ai-showcase { padding-block: 3rem; break-inside: avoid; }
}
