/* ==========================================================================
   Ashburn Taylor — effects.css
   Interaction patterns adapted to the AT universe (slate + mint/cyan, restrained):
   1) Spotlight cards   2) Flow buttons   3) Ripple grid (hero)
   4) Animated tabs     5) CPU / architecture animation
   ========================================================================== */

/* ========================================================================
   1. SPOTLIGHT CARDS — a soft mint glow follows the cursor across the card
   ======================================================================== */
.card, .service, .benefit, .phase { position: relative; }
.card::after, .service::after, .benefit::after, .phase::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; z-index: 4; opacity: 0;
  transition: opacity .45s var(--ease);
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
              rgba(52, 245, 197, 0.07), rgba(54, 205, 253, 0.03) 38%, transparent 62%);
}
.card:hover::after, .service:hover::after, .benefit:hover::after, .phase:hover::after { opacity: 1; }
/* a hairline that lights up near the cursor too */
.card::before, .service::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; z-index: 4; opacity: 0; transition: opacity .45s var(--ease);
  background: radial-gradient(170px circle at var(--mx, 50%) var(--my, 50%),
              rgba(52, 245, 197, 0.28), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 1px;
}
.card:hover::before, .service:hover::before { opacity: 1; }

/* ========================================================================
   2. FLOW BUTTON — a light sheen flows across primary buttons on hover
   ======================================================================== */
.btn--primary { overflow: hidden; }
.btn--primary > * { position: relative; z-index: 1; }
.btn--primary::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(122, 249, 224, 0.22) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .7s var(--ease);
}
.btn--primary:hover::after { transform: translateX(130%); }

/* ========================================================================
   3. RIPPLE GRID — concentric rings ripple out behind the hero grid
   ======================================================================== */
.ripple-grid { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 0; overflow: hidden; }
.ripple-grid span {
  position: absolute; width: 44vmax; height: 44vmax; border-radius: 50%;
  border: 1px solid rgba(52, 245, 197, 0.16);
  transform: scale(0.1); opacity: 0;
  animation: at-ripple 9s ease-out infinite;
}
.ripple-grid span:nth-child(2) { animation-delay: 3s; border-color: rgba(54, 205, 253, 0.15); }
.ripple-grid span:nth-child(3) { animation-delay: 6s; }
@keyframes at-ripple {
  0%   { transform: scale(0.05); opacity: 0; }
  15%  { opacity: 0.55; }
  100% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .ripple-grid { display: none; } }

/* Ripple grid inside interior page heads — smaller, subtler, content stays on top */
.page-head { position: relative; }
.page-head > .wrap { position: relative; z-index: 1; }
.ripple-grid--head span { width: 30vmax; height: 30vmax; border-color: rgba(52,245,197,0.12); }
.ripple-grid--head span:nth-child(2) { border-color: rgba(54,205,253,0.11); }

/* ========================================================================
   4. ANIMATED TABS — sliding pill indicator + cross-fading panels
   ======================================================================== */
.tabs { max-width: 980px; margin-inline: auto; }
.tabs__bar {
  position: relative; display: flex; flex-wrap: wrap; gap: 0.25rem;
  background: #fff; border: 1px solid var(--hairline);
  border-radius: 100px; padding: 0.4rem; box-shadow: var(--shadow-sm);
  width: max-content; max-width: 100%; margin-inline: auto;
}
.tabs__tab {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em;
  color: var(--body); padding: 0.7rem 1.4rem; border-radius: 100px;
  transition: color .3s var(--ease); white-space: nowrap;
}
.tabs__tab:hover { color: var(--ink); }
.tabs__tab.is-active { color: #fff; }
.tabs__pill {
  position: absolute; top: 0; left: 0; height: 0; z-index: 0;
  border-radius: 100px;
  background: linear-gradient(120deg, var(--teal), var(--cyan));
  box-shadow: 0 8px 20px -8px rgba(28, 197, 163, 0.6);
  transition: transform .45s var(--ease), width .45s var(--ease), height .45s var(--ease);
  transform: translate(0, 0); width: 0;
}
.tabs__panels { margin-top: clamp(1.6rem, 3vw, 2.4rem); }
.tabs__panel { display: none; }
.tabs__panel.is-active { display: block; animation: tab-in .5s var(--ease-out); }
@keyframes tab-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.tab-card {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(1.4rem, 3vw, 2.6rem);
  align-items: center;
  background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 4vw, 3rem); box-shadow: var(--shadow-sm);
}
.tab-card__icon {
  width: 92px; height: 92px; border-radius: 22px; flex: none;
  background: var(--accent-grad-soft); border: 1px solid var(--hairline);
  display: grid; place-items: center;
}
.tab-card__icon svg { width: 42px; height: 42px; color: var(--mint-deep); }
.tab-card h3 { margin-bottom: 0.6rem; }
.tab-card p { color: var(--body); max-width: 60ch; }
.tab-card .tlink { margin-top: 1.1rem; }
@media (max-width: 620px) {
  .tab-card { grid-template-columns: 1fr; text-align: left; }
  .tabs__tab { padding: 0.6rem 1rem; font-size: 0.85rem; }
}

/* ========================================================================
   5. CPU / ARCHITECTURE — chip with traces and pulses of light flowing out
   ======================================================================== */
.cpu { width: min(620px, 100%); margin-inline: auto; display: block; }
.cpu .trace { fill: none; stroke: rgba(255,255,255,0.10); stroke-width: 1.5; }
.on-dark .cpu .trace { stroke: rgba(255,255,255,0.12); }
.cpu .node { fill: rgba(255,255,255,0.06); stroke: rgba(255,255,255,0.16); stroke-width: 1; }
.cpu .pulse {
  fill: none; stroke-width: 2.2; stroke-linecap: round;
  stroke-dasharray: 26 240;
  animation: cpu-flow 3.4s linear infinite;
}
.cpu .pulse--mint { stroke: var(--mint); filter: drop-shadow(0 0 5px rgba(52,245,197,.8)); }
.cpu .pulse--cyan { stroke: var(--cyan); filter: drop-shadow(0 0 5px rgba(54,205,253,.8)); }
.cpu .pulse:nth-of-type(2) { animation-delay: -0.6s; }
.cpu .pulse:nth-of-type(3) { animation-delay: -1.2s; }
.cpu .pulse:nth-of-type(4) { animation-delay: -1.9s; }
.cpu .pulse:nth-of-type(5) { animation-delay: -2.5s; }
.cpu .pulse:nth-of-type(6) { animation-delay: -3.0s; }
@keyframes cpu-flow { to { stroke-dashoffset: -266; } }
.cpu__core {
  fill: url(#cpuCore); stroke: rgba(52,245,197,0.5); stroke-width: 1.5;
}
.cpu__core-pulse { transform-origin: center; transform-box: fill-box; animation: cpu-breathe 3s ease-in-out infinite; }
@keyframes cpu-breathe { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
.cpu__label { fill: #fff; font-family: var(--font-display); font-weight: 500; font-size: 15px; letter-spacing: 0.04em; }
@media (prefers-reduced-motion: reduce) { .cpu .pulse, .cpu__core-pulse { animation: none; } }
