/* =========================================================
   ELWAN AI — personal shopping assistant (assistant.html)
   Everything enters in slow motion, in 3D.
   ========================================================= */
.page-ai {
  --ai-wine: #4a0b13;
  --ai-wine-2: #5e1019;
  --ai-rose: #e0a49c;
  --ai-card: #f4ede7;
  --ai-pill: #ebe1da;
  --ai-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --ai-slow: cubic-bezier(.16, 1, .3, 1);
  background: var(--ai-wine);
}
.page-ai .announce { display: none; }
.page-ai .header { position: absolute; left: 0; right: 0; background: transparent !important; color: #f4e8df; animation: aiFade 1s var(--ai-slow) 0s both; }
.page-ai .header.is-scrolled { background: rgba(74, 11, 19, .9) !important; box-shadow: none; }
.page-ai .header .icon-btn { color: #f4e8df; }
.page-ai .header__logo img { filter: brightness(0) invert(.94) sepia(.15); }
.page-ai .cart-btn__count { background: #c62f2f; }

.ai-page { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; max-width: 100vw; }
.ai-close { display: none; }

/* ---------- entrance helpers (all wait for --d) ---------- */
.ai-anim { animation: aiUp 1.1s var(--ai-slow) var(--d, 0s) both; }
.ai-anim3d { animation: aiFlip 1.2s var(--ai-slow) var(--d, 0s) both; transform-origin: 50% 100%; }
.ai-rise { animation: aiRise 1.3s var(--ai-slow) var(--d, 0s) both; transform-origin: 50% 0; }
@keyframes aiFade { from { opacity: 0; } }
@keyframes aiUp { from { opacity: 0; transform: translateY(26px); filter: blur(8px); } }
@keyframes aiFlip { from { opacity: 0; transform: perspective(600px) rotateX(-75deg) translateY(30px) translateZ(-60px); filter: blur(6px); } }
@keyframes aiRise { from { opacity: 0; transform: perspective(1200px) translateY(140px) rotateX(18deg) scale(.94); } }

/* ---------- hero ---------- */
.ai-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-h) + 30px) 22px 50px;
  min-height: 360px;
  color: #f6ece5;
  background: radial-gradient(120% 90% at 10% 20%, #6a1420 0%, var(--ai-wine) 60%);
  perspective: 900px;
}
.ai-dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.ai-hero__bg { position: absolute; inset: 0; pointer-events: none; transform-style: preserve-3d; transition: transform 1.2s var(--ai-slow); }
.ai-hero__bg img {
  position: absolute; right: -14%; top: 104px;
  width: 112%; height: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 34%), linear-gradient(180deg, transparent 0%, #000 22%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  mask-image: linear-gradient(90deg, transparent 0%, #000 34%), linear-gradient(180deg, transparent 0%, #000 22%);
  animation: aiScene 1.8s var(--ai-slow) 0s both, aiBreathe 14s ease-in-out 1.8s infinite;
}
@keyframes aiScene { from { opacity: 0; transform: scale(1.22) translateZ(-120px); filter: blur(14px) brightness(.4); } }
@keyframes aiBreathe { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.04) translateY(-8px); } }
.ai-halo {
  position: absolute; right: 4%; top: 120px; width: 230px; height: 230px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 170, .32), rgba(255, 140, 120, 0) 65%);
  filter: blur(6px);
  animation: aiFade 1.5s ease .4s both, aiPulse 5s ease-in-out 4s infinite;
}
@keyframes aiPulse { 50% { transform: scale(1.18); opacity: .6; } }
.ai-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(90deg, rgba(60, 7, 14, .82) 0%, rgba(60, 7, 14, .35) 50%, transparent 75%),
              linear-gradient(0deg, rgba(60, 7, 14, .6), transparent 30%);
}
.ai-hero__in { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; }
.ai-hero__kicker {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-sans); font-size: 8.6px; font-weight: 400;
  letter-spacing: .38em; text-transform: uppercase; color: var(--ai-rose);
}
.ai-hero__kicker i { width: 22px; height: 1px; background: currentColor; transform-origin: left; animation: aiLine 1s var(--ai-slow) .2s both; }
@keyframes aiLine { from { transform: scaleX(0); } }

.ai-hero__title {
  margin-top: 12px;
  font-family: var(--ai-display); font-weight: 500;
  font-size: 36px; line-height: .98; letter-spacing: -.01em; color: #fbf3ee;
  perspective: 700px;
}
.ai-split { display: block; white-space: nowrap; }
.ai-split .ch {
  display: inline-block; transform-origin: 50% 80%;
  animation: aiChar 1s var(--ai-slow) calc(var(--d) + var(--i) * 30ms) both;
}
@keyframes aiChar { from { opacity: 0; transform: translateY(.55em) rotateX(-95deg) translateZ(-40px); filter: blur(6px); } }
.ai-split--accent { font-style: italic; font-weight: 500; font-size: 1.1em; padding-left: .04em; }
.ai-split--accent .ch {
  background: linear-gradient(100deg, #e48d84 0%, #f2b3a6 25%, #fff0e4 50%, #f2b3a6 75%, #e48d84 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: aiChar 1s var(--ai-slow) calc(var(--d) + var(--i) * 30ms) both, aiShine 6s linear 1.5s infinite;
}
@keyframes aiShine { to { background-position: -300% 0; } }
.ai-hero__lead { margin-top: 12px; max-width: 220px; font-size: 11.6px; line-height: 1.6; font-weight: 300; letter-spacing: .01em; color: rgba(251, 243, 238, .86); }

.ai-feats { display: flex; gap: 6px; margin: 44px -8px 0; perspective: 600px; }
.ai-feat {
  position: relative; overflow: hidden;
  flex: 0 1 auto; min-width: 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 11px 8px 10px;
  border-radius: 999px;
  background: rgba(110, 22, 32, .55);
  border: 1px solid rgba(255, 220, 210, .16);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #f6ece5; text-align: left;
  font-size: 9.2px; line-height: 1.3; font-weight: 300;
  transition: background .4s var(--ease), box-shadow .5s;
}
.ai-feat::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 230, 220, .28) 50%, transparent 70%);
  transform: translateX(-120%); animation: aiSweep 7s ease-in-out calc(var(--d) + 1.5s) infinite;
}
@keyframes aiSweep { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.ai-feat:hover { background: rgba(130, 28, 40, .8); box-shadow: 0 12px 26px rgba(0, 0, 0, .3); }
.ai-feat svg { width: 16px; height: 16px; flex: none; }

/* ---------- chat card ---------- */
.ai-chat {
  position: relative; z-index: 2;
  flex: 1;
  margin-top: -18px;
  padding: 26px 16px 28px;
  border-radius: 24px 24px 0 0;
  background: var(--ai-card);
  color: var(--ink);
  display: flex; flex-direction: column;
}
.ai-chat__glow {
  position: absolute; left: 10%; right: 10%; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(198, 120, 110, .8), transparent);
  animation: aiGlow 4s ease-in-out 5s infinite;
}
@keyframes aiGlow { 50% { left: 30%; right: 30%; opacity: .3; } }

.ai-log { display: flex; flex-direction: column; gap: 14px; padding: 0 4px; }
.ai-msg { display: flex; align-items: flex-end; gap: 10px; max-width: 100%; }
.ai-ava {
  position: relative; flex: none;
  width: 42px; height: 42px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7a1a26, #4a0b13);
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(74, 11, 19, .28);
}
.ai-ava i { position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgba(160, 60, 60, .35); animation: aiRing 3s ease-out infinite; }
@keyframes aiRing { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.ai-ava img { width: 74%; height: 74%; object-fit: contain; animation: aiNod 4s ease-in-out infinite; }
@keyframes aiNod { 50% { transform: translateY(-2px) rotate(-4deg); } }
.ai-bubble {
  padding: 11px 15px;
  border-radius: 18px 18px 18px 6px;
  background: linear-gradient(180deg, #efe6df, #e9dfd7);
  font-size: 13px; line-height: 1.65; color: #2e211d; letter-spacing: .005em;
  white-space: pre-wrap; word-break: break-word;
  max-width: calc(100% - 52px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 8px 20px rgba(74, 11, 19, .05);
}
.ai-bubble.is-ar { font-family: "El Messiri", "Jost", sans-serif; font-size: 13.4px; line-height: 1.75; }
.ai-bubble a { color: var(--burgundy); text-decoration: underline; text-underline-offset: 2px; }
.ai-bubble b, .ai-bubble strong { font-weight: 600; color: #5e1019; }
.ai-bubble .w { opacity: 0; filter: blur(4px); animation: aiWord .6s var(--ai-slow) calc(var(--w) * 22ms) forwards; }
@keyframes aiWord { to { opacity: 1; filter: blur(0); } }
.ai-msg--hello { animation: aiPop 1s var(--ai-slow) 1.3s both; }
.ai-msg--hello .ai-bubble:empty { min-height: 46px; min-width: 120px; }
@keyframes aiPop { from { opacity: 0; transform: translateY(18px) scale(.92); } }
.ai-msg--user { justify-content: flex-end; }
.ai-msg--user .ai-bubble { background: linear-gradient(135deg, #6e1620, #4a0b13); color: #fbf1eb; border-radius: 18px 18px 6px 18px; max-width: 82%; box-shadow: 0 10px 22px rgba(74, 11, 19, .25); }
.ai-msg--typing .ai-bubble { display: inline-flex; gap: 5px; padding: 14px 18px; }
.ai-msg--typing .ai-bubble i { width: 6px; height: 6px; border-radius: 50%; background: #9b6f69; animation: aiDot 1.1s infinite ease-in-out; }
.ai-msg--typing .ai-bubble i:nth-child(2) { animation-delay: .15s; }
.ai-msg--typing .ai-bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-5px); opacity: 1; } }
.ai-msg.is-new { animation: aiMsg .7s var(--ai-slow) both; }
.ai-msg--user.is-new { animation-name: aiMsgR; }
@keyframes aiMsg { from { opacity: 0; transform: perspective(500px) translate(-14px, 16px) rotateY(14deg) scale(.94); } }
@keyframes aiMsgR { from { opacity: 0; transform: perspective(500px) translate(14px, 16px) rotateY(-14deg) scale(.94); } }

/* ---------- 3D flying product carousel ---------- */
.ai-deck { position: relative; margin: 2px -16px 0; padding: 4px 0; }
.ai-deck__stage { position: relative; height: 268px; perspective: 1100px; perspective-origin: 50% 40%; touch-action: pan-y; cursor: grab; user-select: none; }
.ai-deck__floor { position: absolute; left: 18%; right: 18%; bottom: 4px; height: 26px; border-radius: 50%; background: radial-gradient(closest-side, rgba(74, 11, 19, .22), transparent); filter: blur(4px); }
.ai-card3d {
  position: absolute; left: 50%; top: 8px;
  width: 158px; margin-left: -79px;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, #fff, #faf4ef);
  box-shadow: 0 24px 40px rgba(74, 11, 19, .18);
  transition: transform .9s var(--ai-slow), opacity .9s var(--ai-slow), filter .9s;
  will-change: transform;
  -webkit-user-drag: none;
}
.ai-card3d.is-fly { transition: none; opacity: 0; transform: translate3d(var(--fx, 0), -280px, -1000px) rotateX(75deg) rotateY(var(--fr, 40deg)) rotateZ(-14deg) scale(.5); filter: blur(12px); }
.ai-card3d::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .6) 50%, transparent 65%);
  transform: translateX(-130%); transition: transform 1.6s var(--ai-slow) .3s;
}
.ai-card3d.is-active::after { transform: translateX(130%); }
.ai-card3d__img { position: relative; display: block; height: 152px; background: radial-gradient(circle at 50% 45%, #fff 0%, #efe4dc 75%); }
.ai-card3d__img img { width: 100%; height: 100%; object-fit: contain; padding: 12px; filter: drop-shadow(0 12px 14px rgba(40, 10, 10, .22)); pointer-events: none; }
.ai-card3d.is-active .ai-card3d__img img { animation: aiHover 4s ease-in-out 1.2s infinite; }
@keyframes aiHover { 50% { transform: translateY(-6px) rotate(-2deg); } }
.ai-card3d__tag { position: absolute; top: 9px; left: 9px; padding: 3px 8px; border-radius: 999px; font-size: 7.6px; letter-spacing: .14em; text-transform: uppercase; background: var(--ai-wine-2); color: #fff; }
.ai-card3d__tag--mirror { background: #8a6a5f; }
.ai-card3d__tag--out { background: #2d2421; }
.ai-card3d__body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.ai-card3d__brand { font-size: 8px; letter-spacing: .22em; text-transform: uppercase; color: #a5605b; }
.ai-card3d__name { font-family: var(--ai-display); font-size: 18px; font-weight: 600; line-height: 1.05; color: #2e211d; }
.ai-card3d__price { margin-top: 4px; display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--burgundy); }
.ai-card3d__price s { font-weight: 300; color: var(--muted); font-size: 9.5px; }
.ai-card3d__go { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 8.6px; letter-spacing: .2em; text-transform: uppercase; color: #5e1019; }
.ai-card3d__go::after { content: ""; width: 14px; height: 1px; background: currentColor; transition: width .5s var(--ai-slow); }
.ai-card3d.is-active:hover .ai-card3d__go::after { width: 26px; }
.ai-deck__nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ai-deck__btn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ai-pill); color: #5e1019; transition: transform .4s var(--ai-slow), background .3s; }
.ai-deck__btn:hover { background: #e2d4ca; }
.ai-deck__btn:active { transform: scale(.88); }
.ai-deck__btn svg { width: 14px; height: 14px; }
.ai-deck__dots { display: flex; gap: 6px; }
.ai-deck__dots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(94, 16, 25, .2); transition: width .6s var(--ai-slow), background .6s; }
.ai-deck__dots i.on { width: 20px; background: #5e1019; }

/* quick prompts */
.ai-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 10px; margin: 18px 0 0 12px; perspective: 600px; }
.ai-chip {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 0;
  padding: 10px 8px;
  border-radius: 999px;
  background: var(--ai-pill);
  font-size: 10.6px; color: #2e211d; white-space: nowrap;
  animation: aiFlip 1s var(--ai-slow) calc(1.5s + var(--i) * .1s) both;
  transition: background .3s var(--ease), box-shadow .5s;
}
.ai-chip::after { content: ""; width: 5px; height: 5px; border-right: 1.3px solid currentColor; border-top: 1.3px solid currentColor; transform: rotate(45deg); flex: none; transition: transform .5s var(--ai-slow); }
.ai-chip:hover { background: #e2d4ca; box-shadow: 0 8px 18px rgba(74, 11, 19, .1); }
.ai-chip:hover::after { transform: translateX(3px) rotate(45deg); }
.ai-chips.is-hidden { display: none; }

/* input */
.ai-form { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.ai-plus { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--ai-pill); color: #3a2a26; transition: transform .6s var(--ai-slow); }
.ai-plus:hover { transform: rotate(90deg); }
.ai-plus svg { width: 18px; height: 18px; }
.ai-field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; border-radius: 999px; background: #fbf7f4; box-shadow: 0 8px 22px rgba(74, 11, 19, .09); transition: box-shadow .5s; }
.ai-field:focus-within { box-shadow: 0 0 0 1.5px rgba(94, 16, 25, .35), 0 12px 28px rgba(74, 11, 19, .14); }
.ai-field input { flex: 1; min-width: 0; height: 46px; padding: 0 8px 0 16px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: #2e211d; }
.ai-field input::placeholder { color: #9a8a84; font-weight: 300; }
.ai-send { position: relative; flex: none; width: 46px; height: 46px; margin-right: -4px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #7a1a26, #4a0b13); color: #fff; box-shadow: 0 8px 18px rgba(74, 11, 19, .35); transition: transform .5s var(--ai-slow), opacity .25s; }
.ai-send::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgba(94, 16, 25, .3); animation: aiRing 2.6s ease-out infinite; }
.ai-send svg { width: 18px; height: 18px; transition: transform .6s var(--ai-slow); }
.ai-send:hover svg { transform: translate(2px, -2px); }
.ai-send:active { transform: scale(.9); }
.ai-send.is-sent svg { animation: aiFly .9s var(--ai-slow); }
@keyframes aiFly { 40% { transform: translate(22px, -22px); opacity: 0; } 41% { transform: translate(-18px, 18px); opacity: 0; } }
.ai-send:disabled { opacity: .6; }

/* ---------- opened on top of the home page (iframe) ---------- */
.is-embed .header, .is-embed .announce, .is-embed .menu, .is-embed .search, .is-embed .cart { display: none !important; }
.is-embed .ai-hero { padding-top: 46px; }
.is-embed .ai-hero__bg img { top: 70px; }
.is-embed .ai-close {
  display: grid; place-items: center;
  position: fixed; top: 12px; right: 12px; z-index: 30;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #f6ece5;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: aiFade 1s ease .6s both;
}
.is-embed .ai-close svg { width: 16px; height: 16px; }

/* ---------- laptop: one screen — intro + chat on the left, the robot on the right ---------- */
@media (min-width: 900px) {
  .page-ai:not(.is-embed) .ai-page {
    height: 100vh; height: 100dvh; min-height: 560px; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, min(640px, 50vw)) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    padding: calc(var(--header-h) + 4px) clamp(28px, 4vw, 72px) clamp(18px, 3vh, 34px);
    row-gap: clamp(14px, 2.4vh, 26px);
    background: radial-gradient(120% 90% at 10% 20%, #6a1420 0%, var(--ai-wine) 60%);
  }
  .page-ai:not(.is-embed) .ai-hero { position: static; grid-column: 1; grid-row: 1; padding: 0; min-height: 0; background: none; overflow: visible; perspective: none; }
  .page-ai:not(.is-embed) .ai-hero__in { perspective: 900px; }
  .page-ai:not(.is-embed) .ai-hero::after {
    background: linear-gradient(90deg, rgba(60, 7, 14, .9) 0%, rgba(60, 7, 14, .55) 42%, transparent 66%),
                linear-gradient(180deg, rgba(60, 7, 14, .55), transparent 22%),
                linear-gradient(0deg, rgba(60, 7, 14, .55), transparent 30%);
  }
  .page-ai:not(.is-embed) .ai-hero__bg img { right: 0; top: clamp(40px, 9vh, 90px); width: 60%; height: calc(100% - clamp(40px, 9vh, 90px)); object-fit: cover; object-position: 40% 0;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%), linear-gradient(180deg, transparent 0%, #000 16%); -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0%, #000 30%), linear-gradient(180deg, transparent 0%, #000 16%); mask-composite: intersect; }
  .page-ai:not(.is-embed) .ai-halo { right: 16%; top: 18%; width: 420px; height: 420px; }
  .page-ai:not(.is-embed) .ai-hero__in { margin: 0; max-width: none; }
  .ai-hero__kicker { font-size: 10.5px; }
  .ai-hero__kicker i { width: 40px; }
  .ai-hero__title { margin-top: 10px; font-size: clamp(40px, min(4.6vw, 7.4vh), 68px); line-height: 1.02; }
  .page-ai:not(.is-embed) .ai-split { display: inline-block; margin-right: .22em; }
  .ai-hero__lead { max-width: 460px; margin-top: 10px; font-size: 15px; }
  .ai-feats { margin: clamp(14px, 2.6vh, 26px) 0 0; gap: 10px; flex-wrap: wrap; }
  .ai-feat { font-size: 12.5px; padding: 10px 18px 10px 14px; }
  .ai-feat br { display: none; }
  .ai-feat svg { width: 20px; height: 20px; }
  .page-ai:not(.is-embed) .ai-chat {
    grid-column: 1; grid-row: 2; min-height: 0; width: auto; margin: 0;
    padding: 22px 26px 22px; border-radius: 26px;
    background: rgba(244, 237, 231, .97);
    box-shadow: 0 40px 90px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .5) inset;
  }
  .page-ai:not(.is-embed) .ai-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(94, 16, 25, .25) transparent; padding: 4px 6px 8px 4px; margin-right: -8px; }
  .ai-bubble { font-size: 14.5px; max-width: 82%; }
  .ai-msg--user .ai-bubble { max-width: 74%; }
  .ai-chips { display: flex; flex-wrap: wrap; margin: 12px 0 0 52px; gap: 8px; }
  .ai-chip { font-size: 12.5px; padding: 9px 16px; }
  .ai-form { margin-top: 14px; }
  .ai-deck { margin: 4px 0 0; }
  .ai-deck__stage { height: 300px; }
  .ai-card3d { width: 184px; margin-left: -92px; }
  .ai-card3d__img { height: 176px; }
  .ai-card3d__name { font-size: 20px; }
}
@media (min-width: 900px) and (max-height: 700px) {
  .ai-hero__lead { display: none; }
  .ai-hero__kicker { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .page-ai *, .page-ai *::before, .page-ai *::after { animation-duration: .01s !important; animation-delay: 0s !important; transition-duration: .01s !important; }
}

/* ---------- floating AI button (home page, js/assistant-fab.js) ---------- */
.ai-fab {
  position: fixed; right: 14px; bottom: 18px; z-index: 70;
  width: 62px; height: 62px; border: 0; padding: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 8px 16px rgba(60, 7, 14, .35));
  animation: aiFloat 3.6s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.ai-fab img { width: 100%; height: 100%; object-fit: contain; }
.ai-fab__tip {
  position: absolute; right: 64px; top: 50%; transform: translateY(-50%);
  padding: 6px 11px; border-radius: 999px; white-space: nowrap;
  background: #fbf5f1; color: #4a0b13; font: 400 11px/1.2 "Jost", sans-serif;
  box-shadow: 0 6px 16px rgba(60, 7, 14, .15);
  opacity: 0; transition: opacity .5s;
  pointer-events: none;
}
.ai-fab.is-tip .ai-fab__tip { opacity: 1; }
@keyframes aiFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.ai-sheet {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(30, 6, 9, .55);
  opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s;
}
.ai-sheet.is-open { opacity: 1; visibility: visible; }
.ai-sheet__frame {
  position: absolute; left: 0; right: 0; bottom: 0; height: 94%;
  border: 0; width: 100%; border-radius: 22px 22px 0 0; background: #4a0b13;
  transform: translateY(100%); transition: transform .7s cubic-bezier(.16, 1, .3, 1);
}
.ai-sheet.is-open .ai-sheet__frame { transform: none; }
@media (min-width: 900px) {
  .ai-fab { width: 78px; height: 78px; right: 26px; bottom: 26px; }
  /* an iframe does not stretch between top + bottom, so it needs a real height */
  .ai-sheet__frame { left: auto; right: 24px; top: auto; bottom: 24px; height: min(820px, calc(100vh - 48px)); height: min(820px, calc(100dvh - 48px)); width: min(440px, calc(100vw - 48px)); box-shadow: 0 40px 90px rgba(20, 3, 6, .5); border-radius: 24px; transform: translateY(30px) scale(.97); opacity: 0; transition: transform .6s cubic-bezier(.16, 1, .3, 1), opacity .4s; }
  .ai-sheet.is-open .ai-sheet__frame { opacity: 1; }
}
