/* ===== After Effects x Claude section ===== */
.ai-merge { padding: 90px 0 100px; position: relative; }
.ai-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.ai-head h2 { font-size: clamp(34px, 5vw, 56px); margin-bottom: 16px; }
.ai-head p { color: var(--muted); font-size: 17px; }

/* Merge stage */
.ai-stage { position: relative; height: 200px; max-width: 560px; margin: 0 auto; }
.ai-ring, .ai-core { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.ai-ring {
  width: 190px; height: 190px;
  background: conic-gradient(from 0deg, #9999ff, var(--accent-2), #d97757, var(--accent), #9999ff);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%, #000 66%, transparent 67%);
          mask: radial-gradient(circle, transparent 62%, #000 63%, #000 66%, transparent 67%);
  animation: ai-spin 6s linear infinite; opacity: 0; transition: opacity .6s .9s;
  filter: drop-shadow(0 0 12px rgba(255,120,46,.6));
}
.ai-core {
  width: 64px; height: 64px; display: grid; place-items: center; z-index: 3;
  background: radial-gradient(circle, #fff 0%, #ffd9b0 35%, var(--accent) 70%, transparent 72%);
  box-shadow: 0 0 40px 12px rgba(255,120,46,.55), 0 0 110px 30px rgba(255,77,46,.25);
  opacity: 0; scale: .3; transition: opacity .5s .75s, scale .6s .75s cubic-bezier(.34,1.56,.64,1);
}
.ai-core span { font: 700 30px "Space Grotesk", sans-serif; color: #160804; line-height: 1; margin-top: -3px; }
.ai-logo {
  position: absolute; top: 50%; z-index: 2; width: 104px; height: 104px; border-radius: 26px;
  display: grid; place-items: center; background: var(--card); border: 1px solid var(--line);
  transition: transform 1s cubic-bezier(.7,0,.2,1), box-shadow .6s;
}
.ai-logo img { width: 74px; height: 74px; object-fit: contain; }
.ai-left img { width: 80px; height: 80px; border-radius: 16px; }
.ai-left  { left: 50%; transform: translate(calc(-50% - 210px), -50%); box-shadow: 0 0 30px rgba(153,153,255,.35); }
.ai-right { left: 50%; transform: translate(calc(-50% + 210px), -50%); box-shadow: 0 0 30px rgba(217,119,87,.3); }
.ai-right img { width: 66px; height: 66px; }
.ai-tag { position: absolute; bottom: 4px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); transition: opacity .4s; }
.ai-tag-l { left: 50%; transform: translateX(calc(-50% - 210px)); }
.ai-tag-r { left: 50%; transform: translateX(calc(-50% + 210px)); }

/* merge when revealed */
.ai-stage.in .ai-left  { transform: translate(calc(-50% - 62px), -50%) rotate(-8deg); animation: ai-bob-l 4s ease-in-out 1.4s infinite; }
.ai-stage.in .ai-right { transform: translate(calc(-50% + 62px), -50%) rotate(8deg);  animation: ai-bob-r 4s ease-in-out 1.4s infinite; }
.ai-stage.in .ai-core { opacity: 1; scale: 1; animation: ai-pulse 2.2s ease-in-out 1.4s infinite; }
.ai-stage.in .ai-ring { opacity: 1; }
.ai-stage.in .ai-tag { opacity: 0; }

@keyframes ai-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes ai-pulse { 0%,100% { scale: 1; } 50% { scale: 1.12; } }
@keyframes ai-bob-l { 0%,100% { transform: translate(calc(-50% - 62px), -50%) rotate(-8deg); } 50% { transform: translate(calc(-50% - 54px), -50%) rotate(-4deg); } }
@keyframes ai-bob-r { 0%,100% { transform: translate(calc(-50% + 62px), -50%) rotate(8deg); }  50% { transform: translate(calc(-50% + 54px), -50%) rotate(4deg); } }

/* Arrows + results */
.ai-flow { max-width: 1000px; margin: 0 auto; }
.ai-arrows { display: block; width: 100%; height: 120px; overflow: visible; }
.ai-arrows path { fill: none; stroke: url(#aiGrad); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ai-path { stroke-dasharray: 8 10; animation: ai-flow 1s linear infinite; filter: drop-shadow(0 0 6px rgba(255,100,46,.7)); }
.ai-head-l, .ai-head-r { stroke: var(--accent) !important; }
@keyframes ai-flow { to { stroke-dashoffset: -18; } }

.ai-results { display: grid; grid-template-columns: 1fr 3.16fr 1fr; gap: 0 4%; align-items: center; margin-top: 6px; }
.ai-short { aspect-ratio: 9/16; border-color: rgba(255,77,46,.45); box-shadow: 0 0 40px rgba(255,77,46,.22); }
.ai-short img { opacity: .95; }
.ai-long { aspect-ratio: 16/9; border-color: rgba(255,77,46,.45); box-shadow: 0 0 40px rgba(255,77,46,.22); }
.ai-arrows-2 { display: none; }
.ai-arrows-2 path { stroke: url(#aiGrad2); }

@media (max-width: 620px) {
  .ai-merge { padding: 70px 0 80px; }
  .ai-stage { height: 170px; }
  .ai-logo { width: 84px; height: 84px; border-radius: 22px; }
  .ai-logo img { width: 58px; height: 58px; }
  .ai-right img { width: 52px; height: 52px; }
  .ai-left  { transform: translate(calc(-50% - 120px), -50%); }
  .ai-right { transform: translate(calc(-50% + 120px), -50%); }
  .ai-tag-l { transform: translateX(calc(-50% - 120px)); }
  .ai-tag-r { transform: translateX(calc(-50% + 120px)); }
  .ai-stage.in .ai-left  { transform: translate(calc(-50% - 50px), -50%) rotate(-8deg); animation-name: ai-bob-l-sm; }
  .ai-stage.in .ai-right { transform: translate(calc(-50% + 50px), -50%) rotate(8deg);  animation-name: ai-bob-r-sm; }
  .ai-ring { width: 160px; height: 160px; }
  .ai-arrows { height: 90px; }
  .ai-arrows-3 { display: none; }
  .ai-arrows-2 { display: block; }
  .ai-results { grid-template-columns: 1fr 1fr; gap: 18px 10%; }
  .ai-results .ai-short:first-child { grid-column: 1; grid-row: 1; }
  .ai-results .ai-short:last-child { grid-column: 2; grid-row: 1; }
  .ai-results .ai-long { grid-column: 1 / -1; grid-row: 2; }
}
/* Two Shorts only (no long video in the middle) */
.ai-flow.ai-two { max-width: 560px; }
.ai-two .ai-arrows-3 { display: none; }
.ai-two .ai-arrows-2 { display: block; }
.ai-two .ai-results { grid-template-columns: 1fr 1fr; gap: 0; }
.ai-two .ai-results .ai-short { width: 80%; justify-self: center; }

@keyframes ai-bob-l-sm { 0%,100% { transform: translate(calc(-50% - 50px), -50%) rotate(-8deg); } 50% { transform: translate(calc(-50% - 44px), -50%) rotate(-4deg); } }
@keyframes ai-bob-r-sm { 0%,100% { transform: translate(calc(-50% + 50px), -50%) rotate(8deg); }  50% { transform: translate(calc(-50% + 44px), -50%) rotate(4deg); } }

@media (prefers-reduced-motion: reduce) {
  .ai-ring, .ai-path, .ai-stage.in .ai-core, .ai-stage.in .ai-left, .ai-stage.in .ai-right { animation: none; }
}
