/* Light mode. Dark is the default; <html data-theme="light"> comes from the device setting or the sun/moon switch.
   Terminals, code and the agent chat stay dark in both: they read as "the terminal", and stay legible.
   Phone and browser previews keep their own light look in both. */
:root[data-theme=light]{
  color-scheme:light;
  --page:#f5f6fa; --paper:#ffffff; --ink:#11131b; --soft:#4f566a; --line:#dde1ea;
  --leaf:#3346e0; --leaf-2:#e8ebff; --sun:#9a6400; --sun-2:#fff4d6; --clay:#c2410c; --sky:#3346e0; --sky-2:#e8ebff;
  --ok:#087a55; --ok-2:#e1f5ec;
}
[data-theme=light] body::before{background:radial-gradient(34% 40% at 78% 10%,rgba(97,112,255,.20),transparent 70%),radial-gradient(28% 34% at 92% 60%,rgba(0,190,150,.10),transparent 70%),radial-gradient(30% 36% at 8% 85%,rgba(97,112,255,.08),transparent 70%)}
[data-theme=light] body::after{opacity:.06;mix-blend-mode:multiply}
:where([data-theme=light]) a{color:#2c3bcc}
[data-theme=light] .logo{color:var(--ink)}

/* surfaces: white cards with a soft shadow instead of dark frosted glass */
[data-theme=light] :is(.lesson,.out,.idea,.day-c,.em,.cmp,.bk-t,.cost-c,.how>div,.lvl-opts button,.ft-box,.lz-goal,.reply,.snag,.a2h>div,.files,.dep-url,.src,.updbar,.sg-prompt){background:#fff;border-color:var(--line);box-shadow:0 1px 2px rgba(17,19,27,.04),0 10px 26px -18px rgba(17,19,27,.25)}
[data-theme=light] .demo{background:#f0f2f8;border-color:var(--line)}
[data-theme=light] .cost-c{background:#fafbfd}

[data-theme=light] .lz-top{background:rgba(245,246,250,.85)}
[data-theme=light] .fin{background:linear-gradient(160deg,#e8ebff,#f7f8ff);border-color:#cfd5ff}
[data-theme=light] .see{background:linear-gradient(160deg,#e4f7ef,#f4fbf8);border-color:#b9e6d3}
[data-theme=light] .tip{background:var(--sun-2)}

/* text that was set to white for the dark page */
[data-theme=light] :is(.hero .sub,.v3-sub,.ft-cta h2,.fin h2,.lesson h3,.su-step b,.day-c b,.idea>b,.out b){color:var(--ink)}
[data-theme=light] .lvl-opts button[aria-checked=true]{background:linear-gradient(160deg,#e3e7ff,#fff);border-color:var(--leaf)}

/* buttons: the white-on-dark ones become ink-on-light */
[data-theme=light] :is(.btn.fill,.bar nav a.cta,.v3-copy,.scenes button[aria-selected=true],.sg-steps span.on){background:#11131b;color:#fff;border-color:#11131b}
[data-theme=light] .v3-copy small{color:#b8bfd6}
[data-theme=light] .btn{border-color:#c9cedb;color:var(--ink)}
[data-theme=light] :is(.lvl-chip,.v3-nav .cp,.scenes button,.sg-steps span,.theme-t){background:#fff;border-color:var(--line);color:var(--ink)}
[data-theme=light] :is(.v3-nav a,.bar nav a){color:var(--soft)}
[data-theme=light] .fin .btn{background:#11131b;border-color:#11131b;color:#fff}
[data-theme=light] .tabs button{color:var(--ink);border-color:var(--line)}
[data-theme=light] .tabs button[aria-selected=true]{background:#11131b;color:#fff;border-color:#11131b}
[data-theme=light] .updbar{color:var(--ink)}
[data-theme=light] .updbar button{background:#11131b;color:#fff}

/* sketches, the logo and the step rings */
[data-theme=light] :is(.chalk,.sg-sketch path,.sg-sketch rect,.sg-sketch circle){stroke:#11131b}
[data-theme=light] .lg-sketch{stroke:#11131b}
[data-theme=light] .st-n::before{background:var(--page)}
[data-theme=light] .su-n{background:#eef0fb;color:#3346e0;box-shadow:0 0 0 1px var(--line)}
[data-theme=light] .ft-word{-webkit-text-stroke-color:rgba(17,19,27,.16)}
[data-theme=light] .ft-word span{color:rgba(51,70,224,.18)}
[data-theme=light] .sg-ticks span,[data-theme=light] .sg-live{background:#e1f5ec;border-color:#a8dcc6;color:#065f43}
[data-theme=light] .gh li.live .gh-dot{box-shadow:0 0 0 4px #d3f1e5}
[data-theme=light] .dep-up{color:#c6cde2}
[data-theme=light] .dep-live{background:#e1f5ec}
[data-theme=light] .lz-main code,[data-theme=light] .snag div code{background:#eef0f6;color:var(--ink)}
[data-theme=light] .hand{color:#9a6400}
[data-theme=light] .lz-pill{color:var(--soft)}
[data-theme=light] .bk-ic{background:#eef0fb}

/* the sun/moon switch */
.theme-t{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:999px;border:1px solid var(--line);background:rgba(255,255,255,.04);color:var(--ink);cursor:pointer;flex:none}
.theme-t svg{width:18px;height:18px}
.theme-t .sun{display:none}
[data-theme=light] .theme-t .sun{display:block}
[data-theme=light] .theme-t .moon{display:none}
.lz-top .theme-t{margin-left:6px}.v3-nav .theme-t{margin-left:-8px}

/* dark islands keep the dark colours in light mode: terminals, code, the agent chat, and the "Get the skill" band */
[data-theme=light] :is(.term2,.term,.bk-cfg,.tree,.skill,.say,.cmd,.chat,.lesson .ask,.dep-up,.install,.hub){
  --page:#07080c; --paper:#10121a; --ink:#e9ecf5; --soft:#9ba3ba; --line:#232737;
  --leaf:#6170ff; --leaf-2:#161a3a; --sun:#ffd166; --sun-2:#2a2414; --ok:#00d6aa; --ok-2:#0a2621; color:var(--ink)}
[data-theme=light] .install{background:linear-gradient(180deg,#0e1020,#090a10)}
[data-theme=light] .install .tabs button{color:var(--ink);border-color:#343b52;background:none}
[data-theme=light] .install .tabs button[aria-selected=true]{background:var(--sun);color:#07080c;border-color:var(--sun)}
[data-theme=light] .install .mono{color:#fff}
[data-theme=light] .hub{color:#e6edf3}
[data-theme=light] .cr .y{color:var(--leaf)}
.bk-cfg pre span.on{background:#3443d6}
.install,[data-theme=light] .install{background:#0b0d16 linear-gradient(180deg,#0e1020,#090a10)}
[data-theme=light] .lz-open{color:var(--leaf)}[data-theme=light] .lz-open:hover{color:var(--ink)}
