:root { color-scheme: dark; }
html, body { background: #07080d; min-height: 100%; }
body { -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
section[id] { scroll-margin-top: 70px; }

.aurora { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.aurora i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(100px); opacity: .22; animation: drift 24s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { background: #f59e0b; top: -28vmax; left: -18vmax; opacity: .16; }
.aurora i:nth-child(2) { background: #6366f1; bottom: -32vmax; right: -20vmax; animation-delay: -8s; }
.aurora i:nth-child(3) { background: #06b6d4; top: 40%; left: 45%; width: 35vmax; height: 35vmax; opacity: .1; animation-delay: -14s; }
@keyframes drift { to { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); } }

.glass { background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); box-shadow: 0 20px 60px -30px rgba(0,0,0,.8); }
.grad { background: linear-gradient(100deg, #fbbf24, #fb923c 45%, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #fbbf24; }
.sec-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; letter-spacing: -.02em; font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1.08; }

/* nav */
.nav { position: sticky; top: 0; z-index: 40; background: rgba(7,8,13,.7); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255,255,255,.06); }
.menu { margin-left: auto; display: flex; gap: 4px; }
.menu a { padding: 8px 14px; border-radius: 999px; font-size: .86rem; color: #cbd5e1; transition: background .2s, color .2s; }
.menu a:hover { background: rgba(255,255,255,.08); color: #fff; }
.burger { display: none; margin-left: auto; width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); position: relative; }
.burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: #e2e8f0; border-radius: 2px; transition: transform .25s, top .25s; }
.burger span:first-child { top: 15px; } .burger span:last-child { top: 23px; }
.burger[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }
@media (max-width: 767px) {
  .burger { display: block; }
  .menu { position: absolute; left: 12px; right: 12px; top: 100%; margin: 8px 0 0; flex-direction: column; padding: 8px; border-radius: 20px; background: rgba(12,14,22,.96); border: 1px solid rgba(255,255,255,.1); opacity: 0; transform: translateY(-8px); pointer-events: none; transition: all .22s; }
  .menu.open { opacity: 1; transform: none; pointer-events: auto; }
  .menu a { padding: 12px 14px; border-radius: 12px; }
}

/* buttons */
.btn-primary { background: linear-gradient(135deg, #fbbf24, #fb923c); color: #1a1004; font-weight: 600; font-size: .92rem; padding: 12px 24px; border-radius: 999px; box-shadow: 0 10px 30px -10px rgba(251,146,60,.7); transition: transform .2s; }
.btn-primary:active { transform: scale(.96); }
.btn-ghost { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); font-weight: 600; font-size: .92rem; padding: 12px 24px; border-radius: 999px; transition: background .2s; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }

/* hero */
.seal { position: relative; width: min(300px, 72vw); aspect-ratio: 1; border-radius: 50%; }
.seal::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; background: conic-gradient(from 0deg, #fbbf24, #6366f1, #06b6d4, #fbbf24); filter: blur(28px); opacity: .45; animation: spin 14s linear infinite; }
.seal img { position: relative; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 30px 80px -20px rgba(0,0,0,.9); }
.stat { border-radius: 16px; padding: 12px 6px; text-align: center; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.stat b { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.5rem; font-weight: 800; }
.stat span { font-size: .66rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; }

/* cards */
.card { border-radius: 22px; padding: 20px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); transition: transform .25s, border-color .25s, background .25s; }
.card:hover { transform: translateY(-4px); border-color: rgba(251,191,36,.35); background: rgba(255,255,255,.07); }
.tile { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1.1rem; color: #1a1004; background: linear-gradient(135deg, #fbbf24, #fb923c); }
.card h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.15rem; font-weight: 700; margin-top: 14px; }
.card p { font-size: .88rem; color: #94a3b8; margin-top: 6px; line-height: 1.55; }
.card .by { margin-top: 12px; font-size: .75rem; color: #cbd5e1; }
.fee { padding: 28px; }
.fee .amt { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.02em; margin-top: 10px; }
.fee .amt small { font-size: .95rem; font-weight: 500; color: #94a3b8; }
.fee .lbl { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: #fbbf24; font-weight: 600; }
.act-n { font-family: 'Bricolage Grotesque', sans-serif; font-size: 2.4rem; font-weight: 800; color: rgba(255,255,255,.14); line-height: 1; }

.tab { padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); color: #94a3b8; transition: all .2s; }
.tab.on { background: #fff; color: #0b0f1a; border-color: #fff; }
.teacher { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); animation: rise .35s ease both; }
.avatar { flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1.1rem; color: #1a1004; background: linear-gradient(135deg, #fbbf24, #fb923c); }
.teacher b { display: block; font-weight: 600; }
.teacher span { font-size: .8rem; color: #94a3b8; }

.cta { text-align: center; border-radius: 32px; padding: 56px 24px; background: linear-gradient(135deg, rgba(251,191,36,.16), rgba(99,102,241,.16)); border: 1px solid rgba(255,255,255,.1); }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Corner voice widget ===== */
#widget { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.launcher { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 20px 0 16px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 600; font-size: .9rem; color: #1a1004; background: linear-gradient(135deg, #fbbf24, #fb923c); box-shadow: 0 14px 40px -8px rgba(251,146,60,.65); transition: transform .2s; position: relative; }
.launcher:active { transform: scale(.95); }
.launcher::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid rgba(251,191,36,.6); animation: ping 2.4s ease-out infinite; pointer-events: none; }
.launcher[aria-expanded="true"]::after { display: none; }
.launcher .l-x { display: none; }
.launcher[aria-expanded="true"] .l-x { display: block; }
.launcher[aria-expanded="true"] .l-mic, .launcher[aria-expanded="true"] .l-text { display: none; }
.launcher[aria-expanded="true"] { padding: 0 16px; }
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.35, 1.7); opacity: 0; } }

.panel { width: min(380px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 110px)); display: flex; flex-direction: column; border-radius: 26px; overflow: hidden; background: rgba(12,14,22,.94); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 30px 80px -20px rgba(0,0,0,.9);
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.97); transform-origin: bottom right; transition: opacity .25s, transform .25s, visibility .25s; }
.panel.open { opacity: 1; visibility: visible; transform: none; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #94a3b8; background: rgba(255,255,255,.06); }
.close:hover { color: #fff; background: rgba(255,255,255,.12); }

/* orb */
.orb { --lvl: 0; position: relative; width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer; color: #1a1004; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, #fde68a, #fbbf24 45%, #fb923c 80%);
  box-shadow: 0 0 44px -6px rgba(251,191,36,.55), inset 0 -6px 18px rgba(0,0,0,.18); transition: transform .2s, box-shadow .3s; }
.orb:active { transform: scale(.94); }
.orb:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }
.orb .ring { position: absolute; inset: -10px; border-radius: 50%; border: 1.5px solid rgba(251,191,36,.35); transform: scale(calc(1 + var(--lvl) * .5)); transition: transform .08s linear; pointer-events: none; }
.orb .r2 { inset: -22px; border-color: rgba(251,146,60,.2); transform: scale(calc(1 + var(--lvl) * .9)); }
.orb .stop { display: none; }
.orb[data-state="idle"] .ring { animation: breathe 3.2s ease-in-out infinite; }
.orb[data-state="recording"] { background: radial-gradient(circle at 30% 25%, #fecdd3, #fb7185 45%, #e11d48); box-shadow: 0 0 56px -4px rgba(251,113,133,.75); color: #2a0610; }
.orb[data-state="recording"] .mic { display: none; }
.orb[data-state="recording"] .stop { display: block; }
.orb[data-state="recording"] .ring { border-color: rgba(251,113,133,.45); }
.orb[data-state="thinking"] { pointer-events: none; animation: spin 1.3s linear infinite; background: conic-gradient(from 0deg, #fbbf24, #fb923c, #6366f1, #fbbf24); }
.orb[data-state="thinking"] svg { animation: spin 1.3s linear infinite reverse; }
.orb[data-state="speaking"] { animation: pulse 1.1s ease-in-out infinite; background: radial-gradient(circle at 30% 25%, #ddd6fe, #a78bfa 45%, #6366f1); box-shadow: 0 0 56px -4px rgba(167,139,250,.7); }
@keyframes breathe { 50% { transform: scale(1.1); opacity: .5; } }
@keyframes pulse { 50% { transform: scale(1.07); } }

/* chat */
.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 8px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.msg { display: flex; gap: 8px; align-items: flex-end; animation: rise .3s ease both; }
.msg.user { justify-content: flex-end; }
.bubble { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: .88rem; line-height: 1.5; word-break: break-word; }
.msg.user .bubble { background: #fff; color: #0b0f1a; border-bottom-right-radius: 5px; }
.msg.bot .bubble { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); border-bottom-left-radius: 5px; }
.msg.err .bubble { background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.3); color: #fecdd3; }
.ur { font-family: 'Noto Naskh Arabic', serif; direction: rtl; text-align: right; line-height: 2; font-size: 1.02rem; }
.replay { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #cbd5e1; display: grid; place-items: center; }
.replay:hover { background: rgba(255,255,255,.14); }
.chips { display: flex; gap: 6px; padding: 4px 14px 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: #cbd5e1; border-radius: 999px; padding: 6px 12px; font-size: .74rem; white-space: nowrap; transition: all .2s; }
.chip:hover { background: rgba(255,255,255,.12); color: #fff; }

@media (max-width: 480px) {
  #widget { right: 12px; left: 12px; align-items: flex-end; }
  .panel { width: 100%; height: min(78dvh, 640px); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }

/* safe image sizes even if the Tailwind CDN is slow to load */
.nav img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.panel-head img { width: 36px; height: 36px; border-radius: 50%; flex: none; }
