/* ---- Theme switcher (port of ThemeSwitcher: system / light / dark) ---- */
.themesw{position:relative;display:inline-flex;align-items:center;border-radius:999px;background:var(--panel);box-shadow:inset 0 0 0 1px var(--line-2);overflow:hidden;flex:none}
.themesw button{position:relative;z-index:1;width:32px;height:32px;display:grid;place-items:center;border:0;background:none;border-radius:999px;color:var(--dim);cursor:pointer;transition:color .2s}
.themesw button:hover,.themesw button[aria-checked=true]{color:var(--text)}
.themesw button svg{width:16px;height:16px}
.themesw .tsw-ind{position:absolute;z-index:0;left:0;top:0;width:32px;height:32px;border-radius:999px;box-shadow:inset 0 0 0 1px var(--line-2);background:var(--panel-2);transition:transform .6s cubic-bezier(.34,1.56,.64,1)}
.themesw[data-ready=false] .tsw-ind{transition:none}
.l-top .themesw{margin-left:2px}
.top .themesw{margin-left:10px}

/* ---- Light palette ---- */
:root[data-theme=light]{
  color-scheme:light;
  --bg:#f5f8f1;--side:#edf2e8;--panel:#ffffff;--panel-2:#eef3e9;--line:#dbe3d3;--line-2:#c8d3bd;
  --text:#11170d;--muted:#46523f;--dim:#6b7864;
  --lime:#4a7a0e;--ink:#f7fff0;
  --amber:#b45309;--red:#c0392b;--green:#15803d;--periwinkle:#4338ca;
}
:root[data-theme=light] .sculpt-stage{filter:saturate(.9) brightness(.92)}

/* ---- Rainbow text (port of RainbowTextEffect) ---- */
.rainbow-fx{margin:0;padding:0;text-align:center;font-family:"Open Sans",var(--body);font-style:italic;font-weight:600;text-transform:lowercase;word-break:keep-all;
  font-size:clamp(48px,9.5vw,124px);line-height:1;color:#fff;-webkit-text-stroke:1px #000;
  text-shadow:
  0.0071em 0.0357em #FFD20E,
  0.0071em 0.0429em #000,
  0.0143em 0.0714em #E5BC08,
  0.0143em 0.0786em #000,
  0.0214em 0.1071em #EC8401,
  0.0214em 0.1143em #000,
  0.0286em 0.1429em #E65C04,
  0.0286em 0.1500em #000,
  0.0357em 0.1786em #E52E06,
  0.0357em 0.1857em #000,
  0.0429em 0.2143em #DE006B,
  0.0429em 0.2214em #000,
  0.0500em 0.2500em #CA039E,
  0.0500em 0.2571em #000,
  0.0571em 0.2857em #A203CB,
  0.0571em 0.2929em #000,
  0.0643em 0.3214em #6D01C9,
  0.0643em 0.3286em #000,
  0.0714em 0.3571em #22008F,
  0.0714em 0.3643em #000,
  0.0786em 0.3929em #062F9A,
  0.0786em 0.4000em #000,
  0.0857em 0.4286em #0045AC,
  0.0857em 0.4357em #000,
  0.0929em 0.4643em #007DB2,
  0.0929em 0.4714em #000,
  0.1000em 0.5000em #00B8D9,
  0.1000em 0.5071em #000;
  padding-bottom:.5em;margin-bottom:-.15em;
}
@media (max-width:400px){.rainbow-fx{text-shadow:none;-webkit-text-stroke:0;background:linear-gradient(to bottom,#FFD20E,#EC8401,#E65C04);-webkit-background-clip:text;background-clip:text;color:transparent;line-height:1.3;padding-bottom:0}}
.cta .rainbow-fx{animation:rbIn 1s cubic-bezier(.2,.9,.3,1) both}
@keyframes rbIn{from{opacity:0;transform:translateY(24px) skewX(-6deg)}to{opacity:1;transform:none}}

/* ---- Liquid metal button (port of LiquidMetalButton; shader from @paper-design/shaders) ---- */
.lmb{position:relative;display:inline-block;width:var(--w,190px);height:46px;border-radius:100px;text-decoration:none;vertical-align:middle}
.lmb .lmb-ring{position:absolute;inset:0;border-radius:100px;transition:box-shadow .15s cubic-bezier(.4,0,.2,1),transform .8s cubic-bezier(.34,1.56,.64,1);
  box-shadow:0 0 0 1px rgba(0,0,0,.3),0 36px 14px rgba(0,0,0,.02),0 20px 12px rgba(0,0,0,.08),0 9px 9px rgba(0,0,0,.12),0 2px 5px rgba(0,0,0,.15)}
.lmb:hover .lmb-ring{box-shadow:0 0 0 1px rgba(0,0,0,.4),0 12px 6px rgba(0,0,0,.05),0 8px 5px rgba(0,0,0,.1),0 4px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.2)}
.lmb .lmb-shader{position:absolute;inset:0;border-radius:100px;overflow:hidden;background:linear-gradient(135deg,#d7dbde,#8d949a 40%,#e9ecee 60%,#7b8288)}
.lmb .lmb-shader canvas{width:100%!important;height:100%!important;display:block!important;position:absolute!important;inset:0!important;border-radius:100px!important}
.lmb .lmb-core{position:absolute;inset:2px;border-radius:100px;background:linear-gradient(180deg,#202020,#000);z-index:2;transition:box-shadow .15s,transform .8s cubic-bezier(.34,1.56,.64,1)}
.lmb .lmb-label{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;gap:8px;color:#c9d0d4;font:500 14px/1 var(--body);text-shadow:0 1px 2px rgba(0,0,0,.5);white-space:nowrap;pointer-events:none}
.lmb .lmb-label svg{width:16px;height:16px;flex:none}
.lmb .lmb-hit{position:absolute;inset:0;z-index:4;border-radius:100px;overflow:hidden;outline:none}
.lmb:focus-visible{outline:2px solid var(--lime);outline-offset:3px}
.lmb.pressed .lmb-ring,.lmb.pressed .lmb-core{transform:translateY(1px) scale(.98)}
.lmb.pressed .lmb-core{box-shadow:inset 0 2px 4px rgba(0,0,0,.4),inset 0 1px 2px rgba(0,0,0,.3)}
.lmb .lmb-rip{position:absolute;width:20px;height:20px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.45),rgba(255,255,255,0) 70%);pointer-events:none;animation:lmbRip .6s ease-out forwards}
@keyframes lmbRip{from{transform:translate(-50%,-50%) scale(0);opacity:.6}to{transform:translate(-50%,-50%) scale(4);opacity:0}}

/* ---- Gooey cursor reveal on the landing hero (port of ParticleAnimation) ---- */
.l-hero{position:relative;isolation:isolate}
.goo-layer{position:absolute;inset:0;z-index:-1;pointer-events:none;overflow:hidden}
.goo-layer canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
@media (prefers-reduced-motion:reduce){.goo-layer{display:none}.lmb .lmb-ring,.lmb .lmb-core{transition:none}.rainbow-fx{animation:none}}

/* Light-theme fixes for surfaces that were hard-coded dark */
:root[data-theme=light] .top,:root[data-theme=light] .l-top,:root[data-theme=light] .l-top.scrolled{background:rgba(245,248,241,.86);box-shadow:none}
:root[data-theme=light] .flash{background:#fff;border-color:rgba(74,122,14,.4)}
:root[data-theme=light] .marquee{background:rgba(237,242,232,.7)}
:root[data-theme=light] .scrim,:root[data-theme=light] body.nav-open .scrim{background:rgba(20,30,15,.35)}
:root[data-theme=light] .lcard:hover,:root[data-theme=light] .step:hover,:root[data-theme=light] .way:hover,:root[data-theme=light] .lvl:hover{border-color:rgba(74,122,14,.45);box-shadow:0 18px 40px -22px rgba(30,50,10,.35)}
:root[data-theme=light] .l-hero h1,:root[data-theme=light] .l-hero .lead{text-shadow:none}
:root[data-theme=light] .logo,:root[data-theme=light] .btn.primary{color:#f7fff0}

/* Light data rain: pale ground, soft ink-green streaks */
:root[data-theme=light]{--dr-bg-0:#e9efe2;--dr-bg-1:#f5f8f1;--dr-bg-2:#fbfdf8;--dr-vignette:0;--dr-grain:.03;--dr-bloom-opacity:.35}
:root[data-theme=light]{--dr-core:#11170d}
:root[data-theme=light] .dr-main{opacity:.7}
:root[data-theme=light] .cta h2{background:linear-gradient(100deg,#11170d 30%,#4a7a0e 50%,#11170d 70%) 0 0/250% 100%;-webkit-background-clip:text;background-clip:text}
.cta p.rainbow-fx{color:#fff;font-size:clamp(48px,9.5vw,124px);margin:0 0 .35em;padding-bottom:.5em}
@media (max-width:400px){.cta p.rainbow-fx{color:transparent;padding-bottom:0}}
:root[data-theme=light] .orbit{background:rgba(255,255,255,.92);color:var(--text);border-color:var(--line-2);box-shadow:0 10px 26px -12px rgba(30,50,10,.35)}
:root[data-theme=light] .demo{box-shadow:0 30px 70px -30px rgba(30,50,10,.35)}
:root[data-theme=light]{--s1:#ffffff;--s2:#f7faf4;--s3:#e8efe1;--s4:#e0e4fb;--track:#d6dfcc}
:root[data-theme=light] .nav a[aria-current=page]{background:var(--s3)}
:root[data-theme=light] .verdict .v-sub,:root[data-theme=light] .chip[aria-pressed=true]{background:var(--s3);color:var(--text)}
:root[data-theme=light] .rich code{background:var(--s3)}
:root[data-theme=light] .fc-face.back{background:linear-gradient(160deg,#eef7d9,var(--panel))}
:root[data-theme=light] .skel,:root[data-theme=light] [class*=skel]{background:linear-gradient(90deg,#e8efe1 25%,#f4f8ef 50%,#e8efe1 75%);background-size:200% 100%}
:root[data-theme=light] .chat-wrap.over::after{background:rgba(245,248,241,.92)}

/* ============ Smoothness pass ============
   Rule: animate only transform / opacity (compositor), never repaint a big gradient every frame. */
:root{--ease-out:cubic-bezier(.22,1,.36,1)}

/* cursor spotlight: a fixed-size layer moved with transform instead of repainting a full-screen gradient */
.spot{inset:auto;left:0;top:0;width:920px;height:920px;margin:-460px 0 0 -460px;--mx:380px;--my:240px;
  background:radial-gradient(circle,rgba(197,242,75,.085),transparent 65%);transform:translate3d(var(--mx),var(--my),0);will-change:transform;contain:strict}

/* demo card border: a spinning layer clipped by the card (transform animation), instead of an animated @property angle (repaint) */
.demo{overflow:hidden;isolation:isolate}
.demo::before{inset:auto;left:50%;top:50%;width:190%;aspect-ratio:1;height:auto;padding:0;border-radius:0;z-index:-2;
  background:conic-gradient(transparent 0 72%,rgba(197,242,75,.85) 88%,transparent 100%);
  -webkit-mask:none;mask:none;translate:-50% -50%;animation:kgSpin 7s linear infinite;will-change:transform}
.demo::after{content:"";position:absolute;inset:1.5px;border-radius:16.5px;background:var(--panel);z-index:-1;pointer-events:none}
@keyframes kgSpin{to{transform:rotate(360deg)}}

/* floating chips: opaque enough without blur (backdrop-filter re-blurs every frame while they move) */
.orbit{-webkit-backdrop-filter:none;backdrop-filter:none;background:rgba(13,17,20,.94);will-change:transform}
.demo-wrap .float,.demo.float{will-change:transform}

/* skip layout + paint of far-below-the-fold sections until they are near the screen */
#features,#levels,#safeguards{content-visibility:auto;contain-intrinsic-size:auto 620px}

/* anything marked off-screen stops its infinite animations */
.kg-idle,.kg-idle *,.kg-idle *::before,.kg-idle *::after{animation-play-state:paused!important}

/* softer, longer easing for hover lifts and reveals */
.lcard,.step,.way,.lvl,.btn,.chip{transition-timing-function:var(--ease-out)}
@media (prefers-reduced-motion:reduce){.demo::before{animation:none}}

/* ============ UI renovation (presentation only) ============ */
/* keyboard focus: one consistent, visible ring */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid var(--lime);outline-offset:2px;border-radius:inherit}
.composer textarea:focus-visible{outline:none}

/* readable text in light theme (bold text was hard-coded white) */
.rich strong{color:var(--text)}
.err{color:var(--red)}

/* chat bubbles */
.m{border-radius:16px;line-height:1.65}
.m.user{border-bottom-right-radius:5px}
.m.bot{border-bottom-left-radius:5px;box-shadow:0 1px 0 rgba(255,255,255,.03) inset,0 10px 24px -18px rgba(0,0,0,.5)}
:root[data-theme=light] .m.bot{box-shadow:0 8px 22px -16px rgba(30,50,10,.28)}
:root[data-theme=light] .m.user{background:rgba(74,122,14,.1);border-color:rgba(74,122,14,.28)}

/* friendly error card */
.m.bot.error{display:flex;gap:12px;align-items:flex-start;color:var(--text);background:color-mix(in srgb,var(--red) 6%,var(--panel-2));border-color:color-mix(in srgb,var(--red) 38%,transparent)}
.m.bot.error .err-ic{flex:none;width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:color-mix(in srgb,var(--red) 18%,transparent);color:var(--red)}
.m.bot.error .err-b b{display:block;font:600 14.5px var(--display);margin-bottom:2px}
.m.bot.error .err-b p{margin:0;color:var(--muted);font-size:14px}

/* copy-reply button: quiet until you hover, always there on touch screens */
.m-actions{display:flex;justify-content:flex-end;margin-top:8px;opacity:0;transition:opacity .2s var(--ease-out)}
.m.bot:hover .m-actions,.m.bot:focus-within .m-actions{opacity:1}
@media (hover:none){.m-actions{opacity:1}}
.ibtn.cpm{display:inline-flex;align-items:center;gap:6px;width:auto;height:28px;padding:0 10px;border-radius:8px;font-size:12px;color:var(--muted);border:1px solid var(--line)}
.ibtn.cpm:hover{color:var(--text);border-color:var(--line-2);background:var(--s3)}

/* composer + send */
.composer{transition:border-color .2s,box-shadow .2s}
.composer:focus-within{box-shadow:0 0 0 4px color-mix(in srgb,var(--lime) 14%,transparent)}
#csend{transition:transform .2s var(--ease-out),filter .2s}
#csend:not(:disabled):hover{transform:translateY(-1px);filter:brightness(1.07)}
#csend:not(:disabled):active{transform:scale(.95)}
#csend:disabled{opacity:.5}

/* landing footer: calmer two-sided layout */
.l-foot{padding:28px 0 44px}
.l-foot .wrap{align-items:center;gap:10px 28px}
.l-foot .wrap span:first-child{color:var(--muted);font-weight:500}

/* mobile */
@media (max-width:720px){
  .chat-wrap{height:calc(100dvh - 64px - 24px);min-height:420px}
  .msgs{padding:14px 12px;gap:12px}
  .m{max-width:94%}
  .starters{grid-template-columns:1fr}
  .composer textarea{font-size:16px}          /* stops iOS zooming into the field */
  .l-foot .wrap{flex-direction:column;text-align:center}
  .chat-bar{padding:10px 12px}
}
@media (prefers-reduced-motion:reduce){.m-actions,#csend{transition:none}}
