/* ---------- Deploy with AI (MCP) section ---------- */
.ai {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(4rem, 9vw, 8rem) clamp(1.2rem, 4vw, 3rem);
  border-top: 1px solid rgba(255,255,255,.04);
}
.ai { position: relative; }
.ai-head {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.ai-kicker {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .4rem .9rem; border-radius: 999px;
  border: 1px solid rgba(140,198,63,.3); background: rgba(140,198,63,.07);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--green-2); margin-bottom: 1.6rem;
}
.ai-kicker i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: ping 2s ease-out infinite; }
.ai-head h2 {
  font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: .98;
  font-weight: 600; letter-spacing: -.05em; color: var(--fg);
}
.ai-head h2 span {
  background: linear-gradient(100deg, #b8e04a, #8CC63F 45%, #e4ffb8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 30px rgba(140,198,63,.35));
}
.ai-sub {
  margin-top: 1.6rem; max-width: 60ch;
  font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.65;
  color: rgba(255,255,255,.5);
}
.ai-sub b { color: var(--fg); font-weight: 600; }
.ai-sub em { font-style: normal; color: var(--green-2); }

/* ---------- the "video" ---------- */
.ai-video { position: relative; perspective: 1600px; }
/* aurora behind the window */
.ai-video::before {
  content: ''; position: absolute; left: 5%; right: 5%; top: 8%; bottom: 8%; z-index: -1;
  background:
    radial-gradient(40% 60% at 25% 40%, rgba(140,198,63,.35), transparent 70%),
    radial-gradient(35% 55% at 75% 60%, rgba(130,170,255,.18), transparent 70%),
    radial-gradient(30% 50% at 55% 30%, rgba(199,146,234,.14), transparent 70%);
  filter: blur(60px);
  animation: aurora 12s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes aurora { from { transform: translate3d(-3%, 2%, 0) scale(1); } to { transform: translate3d(3%, -2%, 0) scale(1.08); } }
.av-window {
  position: relative;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: #0d0f0d;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(140,198,63,.04),
    0 40px 120px -40px rgba(140,198,63,.22),
    0 30px 60px -30px rgba(0,0,0,.8);
  transform-origin: 50% 0;
  transition: box-shadow .8s ease;
}
/* light beam travelling around the border */
@property --beam { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.av-window::before {
  content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--beam), transparent 0deg 250deg, rgba(140,198,63,.9) 300deg, #e4ffb8 330deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: beam 5s linear infinite;
}
@keyframes beam { to { --beam: 360deg; } }
.ai-video[data-phase="live"] .av-window {
  box-shadow:
    0 0 0 1px rgba(140,198,63,.35),
    0 40px 140px -30px rgba(140,198,63,.55),
    0 30px 60px -30px rgba(0,0,0,.8);
}
.av-chrome {
  display: flex; align-items: center; gap: .9rem;
  height: 42px; padding: 0 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: #0b0c0b;
  font-family: var(--mono); font-size: .72rem; color: rgba(255,255,255,.4);
}
.av-dots { display: flex; gap: 6px; }
.av-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.12); }
.av-title { flex: 1; text-align: center; }
.av-tag {
  color: var(--green); border: 1px solid rgba(140,198,63,.3);
  border-radius: 999px; padding: .15rem .6rem; font-size: .66rem; letter-spacing: .04em;
}

.av-body {
  display: grid; grid-template-columns: 1.15fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  height: clamp(440px, 46vw, 560px);
}

/* editor pane */
.av-editor {
  position: relative; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
  min-width: 0; min-height: 0;
}
.av-tabs {
  display: flex; font-family: var(--mono); font-size: .72rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.av-tabs span { padding: .65rem 1rem; color: rgba(255,255,255,.3); border-right: 1px solid rgba(255,255,255,.05); }
.av-tabs .on { color: var(--fg); background: rgba(255,255,255,.025); box-shadow: inset 0 -1.5px 0 var(--green); }
.av-code {
  flex: 1; margin: 0; padding: 1.1rem 1rem; overflow: hidden;
  font-family: var(--mono); font-size: clamp(.68rem, 1vw, .8rem); line-height: 1.85;
  color: rgba(255,255,255,.72); white-space: pre;
}
.av-code .ln { display: inline-block; width: 2.2em; color: rgba(255,255,255,.18); user-select: none; }
.av-code .k { color: #c792ea; }
.av-code .s { color: #b8e04a; }
.av-code .f { color: #82aaff; }
.av-code .t { color: #f07178; }
.av-code .a { color: #ffcb6b; }
.av-code .c { color: rgba(255,255,255,.3); font-style: italic; }
.av-caret {
  display: inline-block; width: 7px; height: 1.1em; margin-left: 2px;
  vertical-align: text-bottom; background: var(--green);
  animation: avBlink 1s steps(1) infinite;
}
.av-status {
  display: flex; align-items: center; gap: .5rem;
  height: 30px; padding: 0 1rem;
  border-top: 1px solid rgba(255,255,255,.05);
  background: #0b0c0b;
  font-family: var(--mono); font-size: .68rem; color: rgba(255,255,255,.42);
}
.av-status-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.3); transition: background .3s, box-shadow .3s; }
.ai-video[data-phase="deploying"] .av-status-dot { background: #ffcb6b; box-shadow: 0 0 8px #ffcb6b; animation: avPulse 1s ease-in-out infinite; }
.ai-video[data-phase="live"] .av-status-dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.ai-video[data-phase="live"] .av-status { color: var(--green); }

/* assistant pane */
.av-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #0a0b0a; }
.av-chat-head {
  display: flex; align-items: center; gap: .55rem;
  padding: .65rem 1rem; font-size: .76rem; font-weight: 500;
  color: rgba(255,255,255,.6);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.av-spark {
  width: 14px; height: 14px; border-radius: 4px;
  background: conic-gradient(from 210deg, var(--green), #82aaff, #c792ea, var(--green));
}
.av-feed {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: .7rem;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2.5rem);
          mask-image: linear-gradient(to bottom, transparent 0, #000 2.5rem);
  padding: 1rem;
  font-size: clamp(.74rem, 1vw, .84rem); line-height: 1.55;
  transition: opacity .6s ease;
}
.ai-video.fading .av-feed { opacity: 0; }

.av-msg, .av-tool {
  opacity: 0; transform: translateY(10px);
  transition: opacity .45s ease, transform .45s cubic-bezier(.22,1,.36,1);
  display: none;
}
.av-msg.in, .av-tool.in { display: block; }
.av-msg.shown, .av-tool.shown { opacity: 1; transform: none; }

.av-msg.user {
  align-self: flex-end; max-width: 85%;
  background: rgba(140,198,63,.12); border: 1px solid rgba(140,198,63,.22);
  color: var(--fg); padding: .55rem .8rem; border-radius: 12px 12px 3px 12px;
}
.av-type { display: none; width: 6px; height: 1em; margin-left: 2px; vertical-align: text-bottom; background: var(--fg); animation: avBlink .8s steps(1) infinite; }
.av-msg.user.typing .av-type { display: inline-block; }
.av-msg.bot { color: rgba(255,255,255,.72); max-width: 92%; }
.av-msg.bot b { color: var(--fg); font-weight: 600; }

.av-tool {
  border: 1px solid rgba(255,255,255,.07); border-radius: 10px;
  background: rgba(255,255,255,.02);
  padding: .55rem .7rem;
}
.av-tool-row { display: flex; align-items: center; gap: .55rem; }
.av-tool-row code { font-family: var(--mono); font-size: .92em; color: var(--fg); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.av-tool-ic {
  width: 16px; height: 16px; border-radius: 4px; flex: none;
  background: var(--green); position: relative;
}
.av-tool-ic::after {
  content: ''; position: absolute; left: 4px; top: 6px; width: 8px; height: 5px;
  border: solid #0a0a0a; border-width: 2px 2px 0 0; transform: rotate(-45deg);
}
.av-state { font-family: var(--mono); font-size: .82em; color: rgba(255,255,255,.4); }
.av-state::before { content: 'running…'; }
.av-tool.done .av-state { color: var(--green); }
.av-tool.done .av-state::before { content: 'done ✓'; }
.av-tool-out {
  margin-top: .4rem; padding-left: calc(16px + .55rem);
  font-family: var(--mono); font-size: .9em; color: var(--green-2);
  display: none;
}
.av-tool.done .av-tool-out { display: block; animation: avIn .35s ease; }

.av-log { list-style: none; margin: .45rem 0 0; padding-left: calc(16px + .55rem); font-family: var(--mono); font-size: .86em; }
.av-log li { color: rgba(255,255,255,.5); display: none; }
.av-log li.in { display: block; animation: avIn .35s ease; }
.av-log li::before { content: '▸ '; color: var(--green); }
.av-bar { margin: .5rem 0 .1rem calc(16px + .55rem); height: 3px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden; }
.av-bar span { display: block; height: 100%; width: 0; background: var(--green); border-radius: 3px; }

.av-msg.final { color: rgba(255,255,255,.72); }
.av-live {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--mono); font-size: .78em; letter-spacing: .06em; text-transform: uppercase;
  color: var(--green); margin-right: .4rem;
}
.av-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: avPulse 1.4s ease-in-out infinite; }
.av-url {
  display: block; margin: .3rem 0 .35rem;
  font-family: var(--mono); color: var(--fg); text-decoration: underline;
  text-decoration-color: rgba(140,198,63,.5); text-underline-offset: 3px;
}

/* player controls */
.av-controls {
  display: flex; align-items: center; gap: .9rem;
  margin-top: 1rem; padding: 0 .2rem;
}
.av-play {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  border: 1px solid rgba(255,255,255,.12); background: transparent; cursor: pointer;
  display: grid; place-items: center; transition: border-color .25s;
}
.av-play:hover { border-color: var(--green); }
.av-play .i-pause { width: 9px; height: 10px; border-left: 3px solid var(--fg); border-right: 3px solid var(--fg); }
.av-play .i-play { display: none; width: 0; height: 0; margin-left: 2px; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent var(--fg); }
.ai-video.paused .av-play .i-pause { display: none; }
.ai-video.paused .av-play .i-play { display: block; }
.av-track { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; cursor: pointer; }
.av-track span { display: block; height: 100%; width: 0; background: var(--green); }
.av-time { font-family: var(--mono); font-size: .72rem; color: rgba(255,255,255,.4); font-variant-numeric: tabular-nums; }

.av-big-play {
  position: absolute; left: 50%; top: calc(50% - 1.5rem);
  width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  border: 1px solid rgba(140,198,63,.5); cursor: pointer;
  background: rgba(10,10,10,.75); backdrop-filter: blur(6px);
  display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
.av-big-play span { width: 0; height: 0; margin-left: 5px; border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent var(--green); }
.ai-video.paused .av-big-play { opacity: 1; pointer-events: auto; }
.av-big-play:hover { transform: scale(1.06); }

/* steps + clients */
.ai-steps {
  list-style: none; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-top: clamp(3rem, 6vw, 5rem);
}
.ai-steps li {
  position: relative; overflow: hidden;
  padding: 1.6rem 1.5rem 1.7rem; border-radius: 16px;
  border: 1px solid rgba(255,255,255,.07);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
  transition: transform .35s cubic-bezier(.22,1,.36,1), border-color .35s;
}
.ai-steps li::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(140,198,63,.7), transparent);
  opacity: 0; transition: opacity .35s;
}
.ai-steps li:hover { transform: translateY(-4px); border-color: rgba(140,198,63,.28); }
.ai-steps li:hover::after { opacity: 1; }
.ai-steps .n {
  font-family: var(--display); font-size: 2.6rem; font-weight: 600; line-height: 1;
  letter-spacing: -.04em;
  background: linear-gradient(180deg, var(--green), rgba(140,198,63,.15));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.ai-steps h3 { font-size: 1.25rem; font-weight: 500; margin: .9rem 0 .4rem; }
.ai-steps p { font-size: .9rem; line-height: 1.6; color: rgba(255,255,255,.45); }
.ai-clients {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .6rem;
  margin-top: 2.5rem; font-size: .8rem; color: rgba(255,255,255,.35);
}
.ai-clients span {
  font-family: var(--mono); font-size: .74rem; color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: .3rem .8rem;
  transition: color .25s, border-color .25s, box-shadow .25s;
}
.ai-clients span:hover { color: var(--fg); border-color: rgba(140,198,63,.5); box-shadow: 0 0 20px -4px rgba(140,198,63,.5); }

@keyframes avBlink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }
@keyframes avPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes avIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .av-body { grid-template-columns: 1fr; height: 480px; }
  .av-editor { display: none; }
  .av-title { visibility: hidden; }
  .ai-steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .av-caret, .av-type, .av-live i, .ai-video .av-status-dot,
  .av-window::before, .ai-video::before, .ai-kicker i { animation: none !important; }
}
