/* TANIX business website: the AI Automations page (/ai-automations). Loaded after styles.css and extras.css and
   built from their tokens and glass material, so the page reads as part of the same site. Three 3D pieces:
   the hero scene (ai-automations-3d.js on #aa-canvas), the tilting channel cards and the floating phone. */

/* The glass material, for the surfaces this page adds. */
.aa-do, .aa-cta, .aa-phone {
  position: relative; background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow); border: 0;
}
.aa-do::before, .aa-cta::before, .aa-phone::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--glass-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* ---------- Hero ---------- */
.aa-hero h1 .script { font-size: clamp(28px, 3.4vw, 42px); }
.aa-hero h1 .name { font-size: clamp(30px, 3.5vw, 45px); }
.aa-stage { position: relative; justify-self: center; width: min(100%, 560px); aspect-ratio: 1; }
.aa-canvas { position: absolute; inset: -9%; width: 118%; height: 118%; opacity: 0; transition: opacity .8s; }
.aa-stage.has-3d .aa-canvas { opacity: 1; }
.aa-stage.has-3d .aa-fallback { opacity: 0; visibility: hidden; }
/* Without WebGL, or with reduced motion: the robot with the seven channels in a ring around it. */
.aa-fallback { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .5s; }
.aa-fallback img { width: 42%; height: auto; filter: drop-shadow(0 20px 40px rgba(47, 134, 255, .45)); }
.aa-fb { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px; display: grid; place-items: center; border-radius: 50%; color: #fff;
  background: linear-gradient(140deg, rgba(47, 134, 255, .55), rgba(111, 220, 255, .22)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 26px rgba(0, 10, 50, .5); }
.aa-fb .ic { width: 26px; height: 26px; }
.aa-fb-0 { transform: translate(0, -210px); } .aa-fb-1 { transform: translate(164px, -131px); } .aa-fb-2 { transform: translate(205px, 47px); }
.aa-fb-3 { transform: translate(91px, 189px); } .aa-fb-4 { transform: translate(-91px, 189px); } .aa-fb-5 { transform: translate(-205px, 47px); }
.aa-fb-6 { transform: translate(-164px, -131px); }

/* ---------- Channels: eight glass cards that tilt and lift their icon off the surface ---------- */
.aa-channels { grid-template-columns: repeat(4, 1fr); }
.aa-ch { transform-style: preserve-3d; }
.aa-ch .service-ic { transition: transform .5s var(--ease); }
.aa-ch.is-tilting .service-ic { transform: translateZ(38px) scale(1.06); }
.aa-ch h3, .aa-ch > p { transition: transform .5s var(--ease); }
.aa-ch.is-tilting h3 { transform: translateZ(22px); }
.aa-ch.is-tilting > p { transform: translateZ(12px); }
.aa-ch .service-ic { animation: aa-bob 5s ease-in-out infinite; }
.aa-ch:nth-child(2n) .service-ic { animation-delay: -1.6s; } .aa-ch:nth-child(3n) .service-ic { animation-delay: -3.1s; }
.aa-ch.is-tilting .service-ic { animation-play-state: paused; }
@keyframes aa-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

/* ---------- Demo: a phone floating in 3D ---------- */
.aa-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.aa-demo-copy h2 { font-size: clamp(30px, 4vw, 48px); font-weight: 800; }
.aa-demo-copy h2 span, .aa-cta h2 span { background: linear-gradient(100deg, #9fe8ff, var(--cyan) 40%, #6aa8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.aa-demo-copy .sub { color: var(--muted); font-size: 18px; margin-top: 16px; }
.aa-ticks { list-style: none; padding: 0; margin: 26px 0 30px; display: grid; gap: 12px; font-weight: 700; color: #d9e4fb; }
.aa-ticks li { display: flex; align-items: center; gap: 12px; }
.aa-ticks .ic { color: var(--green); }
.aa-phone-wrap { position: relative; display: grid; place-items: center; perspective: 1400px; min-height: 600px; }
.aa-phone { --rx: 7deg; --ry: -19deg; width: min(100%, 330px); height: 580px; border-radius: 42px; padding: 14px; display: flex; flex-direction: column; overflow: hidden;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform .7s var(--ease);
  animation: aa-float 7s ease-in-out infinite;
  box-shadow: var(--glass-shadow), 34px 44px 90px rgba(0, 8, 40, .6), 0 0 0 1px rgba(160, 210, 255, .2), 0 0 80px rgba(47, 134, 255, .22); }
@keyframes aa-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
.aa-phone-top { display: flex; align-items: center; gap: 11px; padding: 10px 10px 14px; border-bottom: 1px solid var(--line); }
.aa-phone-av { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(140deg, rgba(47, 134, 255, .5), rgba(111, 220, 255, .2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.aa-phone-top b { display: block; font: 700 15px/1.2 var(--head); }
.aa-phone-top small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.aa-live { margin-left: auto; padding: 4px 10px; border-radius: 999px; font: 800 11px/1.4 var(--head); color: #06281a; background: var(--green); box-shadow: 0 0 16px rgba(34, 197, 94, .6); }
.aa-chat { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 9px; padding: 14px 6px; overflow: hidden; }
.aa-msg { max-width: 84%; padding: 9px 13px; border-radius: 17px; font-size: 14px; line-height: 1.4; font-weight: 600; animation: aa-pop .45s var(--ease) backwards; }
@keyframes aa-pop { from { opacity: 0; translate: 0 14px; scale: .9; } }
.aa-msg.in { align-self: flex-start; border-bottom-left-radius: 5px; background: rgba(255, 255, 255, .1); color: #e8f0ff; }
.aa-msg.out { align-self: flex-end; border-bottom-right-radius: 5px; color: #fff; background: linear-gradient(140deg, #2f86ff, #1f5fd6); box-shadow: 0 8px 22px rgba(47, 134, 255, .35); }
.aa-msg.typing { display: inline-flex; gap: 5px; padding: 13px 15px; }
.aa-msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: #dbe8ff; animation: aa-dot 1s ease-in-out infinite; }
.aa-msg.typing i:nth-child(2) { animation-delay: .15s; } .aa-msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aa-dot { 0%, 100% { opacity: .35; translate: 0 0; } 50% { opacity: 1; translate: 0 -4px; } }
.aa-chat.is-leaving .aa-msg { opacity: 0; transition: opacity .45s; }
.aa-phone-bar { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 4px; padding: 11px 16px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--dim); font-size: 14px; font-weight: 600; }
.aa-phone-bar .ic { color: var(--cyan); }
.aa-orb { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(2px); z-index: -1; }
.aa-orb-1 { width: 190px; height: 190px; right: 4%; top: 6%; background: radial-gradient(circle at 30% 30%, rgba(111, 220, 255, .5), rgba(47, 134, 255, .06) 70%); animation: aa-float 9s ease-in-out infinite reverse; }
.aa-orb-2 { width: 120px; height: 120px; left: 6%; bottom: 8%; background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, .5), rgba(139, 92, 246, .05) 70%); animation: aa-float 11s ease-in-out infinite; }

/* Try the real AI (v5.4): sample-business buttons, and the phone's message bar is a real form. */
.aa-try-lbl { margin: 0 0 12px; color: #d9e4fb; font-weight: 700; }
.aa-try-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.aa-phone-wrap { grid-template-rows: auto auto; align-content: center; gap: 16px; }
.aa-try-note { margin: 0; color: var(--dim); font-size: 13.5px; font-weight: 600; text-align: center; }
.aa-phone-bar { gap: 8px; padding: 5px 6px 5px 16px; transition: box-shadow .3s; }
.aa-phone-bar:focus-within { box-shadow: 0 0 0 2px var(--yellow), 0 0 24px rgba(255, 214, 10, .35); }
.aa-phone-bar input { flex: 1; min-width: 0; height: 34px; border: 0; outline: 0; background: none; color: #fff; font-size: 14px; font-weight: 600; }
.aa-phone-bar input::placeholder { color: var(--dim); }
.aa-phone-bar button { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: #0a1430; background: linear-gradient(140deg, #fff6b0, #ffd60a 45%, #ffb300); }
.aa-phone-bar button .ic { color: #0a1430; width: 16px; height: 16px; }
.aa-phone.is-live { --rx: 2deg; --ry: -5deg; animation: none; }

/* ---------- What it does ---------- */
.aa-does { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; perspective: 1500px; }
.aa-do { display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: var(--r); }
.aa-do-ic { width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 16px; color: #fff;
  background: linear-gradient(140deg, rgba(47, 134, 255, .75), rgba(111, 220, 255, .28)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 24px rgba(47, 134, 255, .28); }
.aa-do-ic .ic { width: 23px; height: 23px; }
.aa-do h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.aa-do p { color: var(--muted); font-size: 15px; }

/* ---------- Call to action ---------- */
.aa-cta { padding: 64px 40px; border-radius: 34px; text-align: center; overflow: hidden;
  background: radial-gradient(520px circle at 50% 0%, rgba(47, 134, 255, .22), rgba(47, 134, 255, 0) 70%), var(--glass-bg); }
.aa-cta h2 { font-size: clamp(30px, 4vw, 48px); font-weight: 800; }
.aa-cta p { color: #cbd8f4; font-size: 18px; margin-top: 14px; }
.aa-cta .hero-actions { justify-content: center; }

/* The tab in the header, on this page and on the homepage. */
.primary-nav > a[aria-current="page"] { color: #fff; }

@media (max-width: 1080px) {
  .aa-channels, .aa-does { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  .aa-stage { width: min(100%, 420px); order: -1; }
  .aa-demo { grid-template-columns: 1fr; gap: 36px; }
  .aa-phone-wrap { min-height: 560px; }
  .aa-fb { width: 46px; height: 46px; margin: -23px; }
  .aa-fb-0 { transform: translate(0, -150px); } .aa-fb-1 { transform: translate(117px, -94px); } .aa-fb-2 { transform: translate(146px, 33px); }
  .aa-fb-3 { transform: translate(65px, 135px); } .aa-fb-4 { transform: translate(-65px, 135px); } .aa-fb-5 { transform: translate(-146px, 33px); }
  .aa-fb-6 { transform: translate(-117px, -94px); }
}
@media (max-width: 640px) {
  .aa-channels, .aa-does { grid-template-columns: 1fr; }
  .aa-cta { padding: 44px 22px; }
  .aa-phone { --ry: -10deg; height: 540px; }
}
@media (prefers-reduced-motion: reduce) {
  .aa-phone, .aa-orb, .aa-ch .service-ic, .aa-msg, .aa-msg.typing i { animation: none; }
  .aa-phone { --rx: 0deg; --ry: 0deg; }
}
