/* VOICE   spokojne narzędzie do nauki, precyzyjne jak przyrząd pomiarowy, z wyraźnym ruchem
   IDEA    przyrząd do kodu: miarka 22 lekcji nad prawdziwym edytorem z dwoma plikami
   PICTURE działający edytor (HTML + CSS) i podgląd na żywo, duże, po prawej
   COLOUR  aluminium #e9eaec, czerń, pomarańczowa wskazówka #ff4f00; noc #141517; logo Novaro na biało
   TYPE    Geist 600 + Geist, Geist Mono w kodzie
   LAYOUT  laptop: lista lekcji | teoria i zadanie | edytor nad podglądem; telefon: jedna kolumna */

@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  color-scheme: light dark;
  --bg: light-dark(#e9eaec, #141517);
  --panel: light-dark(#ffffff, #1c1d20);
  --ink: light-dark(#111214, #ececee);
  --mute: light-dark(#5b5f66, #9b9fa7);
  --line: light-dark(#d4d6da, #2d2f34);
  --soft: light-dark(#f2f3f5, #25272b);
  --acc: #ff4f00;
  --accs: light-dark(#fff0e8, #33201a);
  --ok: light-dark(#0e8a4a, #3fcf80);
  --oks: light-dark(#e6f6ed, #15291d);
  --bad: light-dark(#d1242f, #ff6b6b);
  --bads: light-dark(#fdeced, #331a1c);
  --code: #16171a;
  --spring: cubic-bezier(.3, 1.4, .5, 1);
  --out: cubic-bezier(.2, .8, .2, 1);
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 4.5l7 7M11.5 4.5l-7 7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }

* { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 Geist, system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: clip; }
body::before { content: ""; position: fixed; inset: -48px; z-index: -1; pointer-events: none; background-image: linear-gradient(color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px); background-size: 48px 48px; animation: drift 24s linear infinite; }
button { font: inherit; color: inherit; cursor: pointer; }
code, pre, textarea, kbd { font-family: "Geist Mono", ui-monospace, Consolas, monospace; }

/* ---------- logo Novaro (maska, więc przyjmuje kolor i błysk) ---------- */
.lw { display: inline-block; flex: none; width: 27px; height: 36px; background: linear-gradient(110deg, currentColor 42%, var(--acc) 50%, #ffd0b5 52%, currentColor 60%) 0 0 / 300% 100%; -webkit-mask: url(../img/novaro-mark.png) center / contain no-repeat; mask: url(../img/novaro-mark.png) center / contain no-repeat; animation: shine 5s var(--out) infinite; }
.lw.sm { width: 15px; height: 20px; }

/* ---------- ekran startowy ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #111214; animation: splashOut .7s cubic-bezier(.7, 0, .2, 1) 1.55s forwards; }
.splash.gone { display: none; }
.sp-in { display: grid; justify-items: center; gap: 28px; }
.splash img { width: min(150px, 34vw); height: auto; animation: logoIn 1.1s var(--out) both; filter: drop-shadow(0 0 0 transparent); }
.sp-bar { width: 140px; height: 2px; background: #2a2c31; border-radius: 2px; overflow: hidden; animation: fadeIn .4s .3s both; }
.sp-bar i { display: block; height: 100%; background: var(--acc); box-shadow: 0 0 12px var(--acc); transform-origin: left; animation: barFill 1.1s .35s var(--out) both; }

/* ---------- górny pasek z miarką postępu ---------- */
.top { position: sticky; top: 0; z-index: 40; height: 60px; display: flex; align-items: center; gap: 18px; padding: 0 max(2vw, 16px); background: rgba(17, 18, 20, .86); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 1px 0 rgba(255, 255, 255, .06); color: #fff; view-transition-name: topbar; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; white-space: nowrap; }
.bt { display: grid; line-height: 1.1; }
.bn { font-weight: 600; font-size: 17px; letter-spacing: .14em; text-transform: uppercase; }
.bs { font-size: 12.5px; color: #9a9da5; }
.bs b { color: var(--acc); font-weight: 600; }
.brand:hover .lw { animation-duration: 1.2s; }
.ruler { flex: 1; display: flex; align-items: flex-end; gap: 3px; height: 30px; max-width: 760px; margin-left: auto; }
.ruler a { flex: 1; height: 12px; background: #3a3c41; border-radius: 2px; transform-origin: bottom; transition: height .3s var(--spring), background-color .3s; }
.ruler a:nth-child(5n) { height: 16px; }
.ruler a:hover { height: 22px; background: #5a5d63; }
.ruler a.done { background: var(--acc); }
.ruler a.on { height: 28px; background: #fff; animation: glow 2.4s ease-in-out infinite; }
.ruler a.on.done { background: var(--acc); }
.ruler.intro a { animation: tickIn .6s var(--spring) both; animation-delay: calc(var(--i) * 28ms + 1.6s); }
.ruler a.pulse { animation: tickPulse .9s var(--spring); }
.score { font: 500 14px/1 "Geist Mono", monospace; white-space: nowrap; color: #c9cbd0; min-width: 4.5em; text-align: right; font-variant-numeric: tabular-nums; }
.menu { display: none; background: none; border: 0; color: #fff; width: 44px; height: 44px; margin-left: -10px; place-items: center; }

/* ---------- układ ---------- */
.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.side { position: sticky; top: 60px; height: calc(100vh - 60px); overflow: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 10px 10px 20px; display: flex; flex-direction: column; view-transition-name: sidebar; }
#sideList { position: relative; z-index: 1; flex: 1; }
.pill { position: absolute; left: 10px; right: 10px; top: 0; height: 40px; background: var(--ink); border-radius: 8px; transition: transform .55s var(--spring), height .3s var(--out); z-index: 0; box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 25%, transparent); }
.side h4 { margin: 18px 10px 6px; font-size: 13px; font-weight: 500; color: var(--mute); }
.side a { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 40px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.3; transition: color .3s, background-color .15s, transform .2s var(--out); }
.side a:hover { background: var(--soft); transform: translateX(3px); }
.side a.on, .side a.on:hover { background: transparent; color: var(--panel); transform: none; }
.side .n { font: 500 13px "Geist Mono", monospace; color: var(--mute); width: 20px; text-align: right; flex: none; transition: color .3s; }
.side a.on .n { color: inherit; opacity: .65; }
.side i { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; transition: border-color .3s; }
.side a.on i { border-color: color-mix(in srgb, var(--panel) 40%, transparent); }
.side a.done i { border-color: var(--acc); background: var(--acc) var(--check) center / 12px no-repeat; }
.side a.just i { animation: pop .6s var(--spring) both; }
.sidefoot { display: flex; align-items: center; gap: 8px; margin: 20px 10px 0; color: var(--mute); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.scrim { display: none; }

.app > .main { padding: 22px max(2vw, 16px) 48px; view-transition-name: lesson; }
.lhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.chap { margin: 0 0 6px; color: var(--mute); font-size: 15px; }
.lhead.enter .chap { animation: rise .5s var(--out) both; }
h1 { margin: 0; font-size: clamp(28px, 3.3vw, 42px); line-height: 1.05; letter-spacing: -.02em; font-weight: 600; text-wrap: balance; }
h1 .w { display: inline-block; }
.lhead.enter h1 .w { animation: wordIn .7s var(--out) both; animation-delay: calc(var(--i) * 70ms + 60ms); }
.pager { display: flex; gap: 8px; }

/* ---------- przyciski ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; white-space: nowrap; transition: background-color .15s, transform .15s var(--out), border-color .15s, box-shadow .2s; }
.btn:hover { background: var(--soft); transform: translateY(-1px); box-shadow: 0 6px 16px color-mix(in srgb, var(--ink) 10%, transparent); }
.btn:active { transform: translateY(1px) scale(.98); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.pri:hover { background: #ff5a10; box-shadow: 0 8px 22px rgba(255, 79, 0, .38); }
.btn.pri::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%); transform: translateX(-120%); }
.btn.pri:hover::after { transform: translateX(120%); transition: transform .8s var(--out); }
.btn.loading { pointer-events: none; background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .22) 0 10px, transparent 10px 20px); background-size: 28px 28px; animation: stripes .6s linear infinite; }
.btn.loading span::after { content: "…"; }
.btn.shake { animation: shake .45s; }
.rip { position: absolute; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); animation: rip .65s var(--out) forwards; pointer-events: none; z-index: -1; }
.btn:focus-visible, .side a:focus-visible, .ruler a:focus-visible, .tabs button:focus-visible, .edbar button:focus-visible, .ftab:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.learn { display: grid; gap: 18px; }
.grid.enter .learn > * { animation: rise .6s var(--out) backwards; }
.grid.enter .learn > :nth-child(2) { animation-delay: .08s; }
.grid.enter .learn > :nth-child(3) { animation-delay: .16s; }
.grid.enter .work { animation: riseR .7s var(--out) .05s backwards; }

/* ---------- karty z teorią i zadaniem ---------- */
.card { position: relative; background-color: var(--panel); background-image: radial-gradient(420px circle at var(--mx, -500px) var(--my, -500px), color-mix(in srgb, var(--acc) 7%, transparent), transparent 60%); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; transition: border-color .3s, box-shadow .3s; }
.card:hover { border-color: color-mix(in srgb, var(--acc) 30%, var(--line)); box-shadow: 0 10px 30px color-mix(in srgb, var(--ink) 7%, transparent); }
.card h2 { margin: 0 0 10px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.card h3 { margin: 16px 0 8px; font-size: 16px; font-weight: 600; }
.card p { margin: 0 0 12px; max-width: 68ch; }
.theory summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.theory summary::-webkit-details-marker { display: none; }
.theory summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--mute); border-bottom: 2px solid var(--mute); transform: rotate(45deg); margin: -4px 6px 0 0; transition: transform .3s var(--spring); }
.theory:not([open]) summary::after { transform: rotate(-45deg); margin-top: 0; }
.theory:not([open]) summary h2 { margin: 0; }
.grid.enter #exBody > * { animation: rise .55s var(--out) both; animation-delay: calc(var(--k) * 55ms + .15s); }
code { font-size: .88em; background: var(--soft); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
pre.code { margin: 4px 0 14px; background: var(--code); color: #e3e4e8; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.6; overflow-x: auto; tab-size: 2; }
#exBody .tip { margin-top: 6px; background: var(--accs); border-radius: 10px; padding: 12px 14px; font-size: 15px; }
#exBody .tip strong { display: block; margin-bottom: 2px; }
.sol .mute { color: var(--mute); font-size: 14px; }
.sol .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.req { position: relative; list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; overflow: hidden; border-radius: 10px; }
.req.scan::after { content: ""; position: absolute; left: 0; right: 0; top: -60px; height: 60px; background: linear-gradient(transparent, color-mix(in srgb, var(--acc) 28%, transparent) 80%, var(--acc)); animation: scan .52s cubic-bezier(.5, 0, .5, 1) forwards; pointer-events: none; }
.req li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px; border-radius: 9px; font-size: 15px; line-height: 1.45; transition: background-color .35s var(--d, 0s); }
.req li::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--panel) center / 12px no-repeat; }
.req li.ok { background: var(--oks); }
.req li.bad { background: var(--bads); animation: nudge .45s calc(var(--d, 0s) + .25s); }
.req li.ok::before { background-color: var(--ok); border-color: var(--ok); background-image: var(--check); animation: pop .5s var(--spring) var(--d, 0s) both; box-shadow: 0 0 0 0 var(--ok); }
.req li.bad::before { background-color: var(--bad); border-color: var(--bad); background-image: var(--cross); animation: pop .5s var(--spring) var(--d, 0s) both; }
.sum { margin: 12px 0 0; font-weight: 500; min-height: 1.5em; }
.win { position: relative; overflow: hidden; margin-top: 14px; display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; padding: 12px 12px 12px 14px; border-radius: 12px; background: var(--ink); color: var(--panel); font-weight: 500; }
.win[hidden] { display: none; }
.win.show { animation: winIn .7s var(--spring) both; }
.win.show::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%); transform: translateX(-100%); animation: sweep 1.1s .45s var(--out) forwards; pointer-events: none; }
.win #winText { flex: 1; min-width: 12em; }
.stamp { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 2px solid var(--acc); border-radius: 7px; color: var(--acc); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.win.show .stamp { animation: stamp .55s var(--spring) .2s both; }
.hints ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.hints li { animation: flip .6s var(--out) both; transform-origin: top center; padding-left: 4px; }
.sol { margin-top: 8px; animation: flip .6s var(--out) both; transform-origin: top center; }

/* ---------- edytor z dwoma plikami ---------- */
.work { position: sticky; top: 76px; height: calc(100vh - 92px); min-height: 600px; display: flex; flex-direction: column; gap: 10px; }
.edglow { position: relative; flex: 1.3; min-height: 0; display: flex; padding: 2px; border-radius: 16px; }
.edglow::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: conic-gradient(from var(--ang), transparent 0deg 200deg, var(--acc) 290deg, #ffd0b5 330deg, transparent 360deg); opacity: 0; transition: opacity .5s; animation: spin 3.5s linear infinite; }
.edglow:focus-within::before { opacity: 1; }
.edwin { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--code); border-radius: 14px; overflow: hidden; border: 1px solid #000; }
.edbar { display: flex; align-items: stretch; gap: 10px; height: 40px; flex: none; padding-right: 6px; background: #0d0e10; color: #8d9098; font-size: 13px; }
.ftabs { display: flex; flex: none; }
.ftab { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 0; background: transparent; color: #8d9098; font: 500 13px "Geist Mono", monospace; transition: color .2s, background-color .2s; overflow: hidden; }
.ftab:hover { color: #d8dade; background: #131417; }
.ftab.on { background: var(--code); color: #e3e4e8; }
.ftab::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--acc); transform: scaleX(0); transition: transform .35s var(--spring); }
.ftab.on::after { transform: scaleX(1); }
.fi { font: 700 10px/1 "Geist Mono", monospace; padding: 3px 4px; border-radius: 4px; }
.fh { color: #ff8a57; background: rgba(255, 138, 87, .12); }
.fc { color: #8fb4ff; background: rgba(143, 180, 255, .12); }
.keys { flex: 1; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: flex-end; }
kbd { font-size: 11.5px; padding: 1px 5px; margin: 0 2px; border: 1px solid #34363c; border-bottom-width: 2px; border-radius: 4px; color: #c9cbd0; }
.edbar button#reset { position: relative; overflow: hidden; align-self: center; background: none; border: 1px solid #2f3136; color: #c9cbd0; border-radius: 7px; height: 30px; padding: 0 12px; font-size: 13px; flex: none; }
.edbar button#reset:hover { background: #1f2024; }
.ed { --fs: 14px; --lh: 22px; flex: 1; min-height: 0; display: flex; position: relative; }
.ed[hidden] { display: none; }
.ed.swap { animation: fadeSlide .35s var(--out); }
.ed.boot .hl, .ed.boot .gin { animation: reveal .85s var(--out) both; }
.ed.boot::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--acc), transparent); box-shadow: 0 0 14px 2px var(--acc); animation: scanline .85s var(--out) forwards; pointer-events: none; }
.gut { width: 46px; flex: none; overflow: hidden; padding-top: 12px; text-align: right; color: #4b4e56; font: var(--fs)/var(--lh) "Geist Mono", monospace; user-select: none; }
.gin div { padding-right: 10px; transition: color .15s; }
.gin div.cur { color: #c9cbd0; }
.area { position: relative; flex: 1; min-width: 0; }
.hl, .area textarea { position: absolute; inset: 0; margin: 0; border: 0; padding: 12px 16px 40px 4px; font: var(--fs)/var(--lh) "Geist Mono", ui-monospace, monospace; white-space: pre; tab-size: 2; letter-spacing: 0; font-variant-ligatures: none; }
.hl { overflow: hidden; color: #e3e4e8; pointer-events: none; }
.area textarea { background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: #ff7a3d; resize: none; outline: none; overflow: auto; }
.area textarea::selection { background: rgba(255, 122, 61, .3); }
.xt { color: #ff8a57; }
.xa { color: #9ccfff; }
.xs { color: #b9e48c; }
.xc { color: #6b7079; font-style: italic; }
.xp { color: #7d828c; }
.xd { color: #c792ea; }
.xsel { color: #ffcb6b; }
.xat { color: #c792ea; }
.xk { color: #8fb4ff; }
.xh { color: #f7a1c4; }
.xn { color: #f5b971; }

.ac { position: absolute; z-index: 5; width: min(390px, calc(100% - 12px)); display: flex; flex-direction: column; background: #202226; border: 1px solid #383b41; border-radius: 9px; box-shadow: 0 14px 34px rgba(0, 0, 0, .5); font: 13px/1.2 Geist, sans-serif; color: #d8dade; overflow: hidden; transform-origin: top left; animation: acIn .18s var(--spring); }
.ac[hidden] { display: none; }
.acl { overflow: auto; padding: 4px; max-height: 232px; }
.ai { display: flex; align-items: center; gap: 9px; height: 29px; padding: 0 8px; border-radius: 6px; cursor: pointer; transition: background-color .1s; }
.ai:hover { background: #2a2c31; }
.ai.on { background: linear-gradient(90deg, #4a2a1b, #32221c); color: #fff; box-shadow: inset 2px 0 0 var(--acc); }
.ik { flex: none; width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; font: 600 10px/1 "Geist Mono", monospace; background: #2e3137; }
.ik.tag { color: #ff8a57; }
.ik.attr { color: #9ccfff; }
.ik.prop { color: #8fb4ff; }
.ik.val { color: #b9e48c; }
.ik.snip { color: #c792ea; }
.ik.col { border: 1px solid #555; }
.al { font-family: "Geist Mono", monospace; white-space: nowrap; }
.al b { color: #ff8a57; font-weight: 600; }
.ad { margin-left: auto; color: #868a93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52%; padding-left: 8px; }
.af { border-top: 1px solid #34373d; padding: 7px 10px; color: #aeb2ba; font-size: 12.5px; line-height: 1.35; }

.work > .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: none; }
#status { margin-left: auto; color: var(--mute); font-size: 14px; }

/* ---------- podgląd ---------- */
.pv { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pvbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; flex: none; }
.tabs { position: relative; display: flex; background: var(--soft); border-radius: 9px; padding: 3px; gap: 2px; }
.tabs button { position: relative; overflow: hidden; border: 0; background: none; height: 34px; padding: 0 12px; border-radius: 7px; font-size: 14px; color: var(--mute); transition: background-color .25s, color .25s, box-shadow .25s; }
.tabs button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .16); }
.warn { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--bad); font-weight: 500; animation: rise .4s var(--out); }
.warn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: blink 1.2s ease-in-out infinite; }
.warn[hidden] { display: none; }
.pvbox { position: relative; flex: 1; min-height: 0; overflow: hidden; background: repeating-linear-gradient(45deg, var(--soft) 0 10px, var(--panel) 10px 20px); }
.pvbox.load::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 3; background: linear-gradient(90deg, var(--acc), #ffb38a); transform-origin: left; animation: loadBar .6s var(--out) forwards; }
.pvbox iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: #fff; z-index: 1; transition: opacity .3s, width .6s var(--out), left .6s var(--out), top .6s var(--out), height .6s var(--out), border-radius .6s var(--out), box-shadow .6s, transform .3s var(--out); }
.pvbox iframe.off { opacity: 0; pointer-events: none; z-index: 0; transform: scale(.98); }
.pvbox.tel iframe { width: 390px; left: max(0px, calc(50% - 195px)); top: 14px; height: calc(100% - 28px); border-radius: 26px; box-shadow: 0 0 0 7px #111214, 0 0 0 8px #3a3c41, 0 24px 50px rgba(0, 0, 0, .35); }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- przejście między lekcjami ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(lesson) { animation: lessonOut .32s cubic-bezier(.5, 0, .7, .4) both; }
::view-transition-new(lesson) { animation: lessonIn .5s var(--out) both; }
[data-dir=prev]::view-transition-old(lesson) { animation-name: lessonOutR; }
[data-dir=prev]::view-transition-new(lesson) { animation-name: lessonInL; }

/* ---------- klatki animacji ---------- */
@keyframes drift { to { transform: translate(48px, 48px); } }
@keyframes shine { 0%, 55% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes logoIn { 0% { opacity: 0; transform: scale(.7) translateY(20px); filter: blur(12px); } 60% { opacity: 1; filter: blur(0); } 100% { transform: none; } }
@keyframes splashOut { to { clip-path: inset(0 0 100% 0); visibility: hidden; } }
@keyframes barFill { from { transform: scaleX(0); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes tickIn { from { transform: scaleY(0); } }
@keyframes tickPulse { 0% { transform: scaleY(1); } 35% { transform: scaleY(1.6); box-shadow: 0 0 16px var(--acc); } 100% { transform: scaleY(1); } }
@keyframes glow { 50% { box-shadow: 0 0 12px rgba(255, 255, 255, .55); } }
@keyframes pop { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 65% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes riseR { from { opacity: 0; transform: translateX(24px) scale(.985); } }
@keyframes wordIn { from { opacity: 0; transform: translateY(.5em) rotate(3deg); filter: blur(8px); } }
@keyframes shake { 15%, 55% { transform: translateX(-6px) rotate(-1deg); } 35%, 75% { transform: translateX(6px) rotate(1deg); } }
@keyframes nudge { 30% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }
@keyframes stripes { to { background-position: 28px 0; } }
@keyframes rip { to { transform: scale(1); opacity: 0; } }
@keyframes scan { to { top: 100%; } }
@keyframes winIn { 0% { opacity: 0; transform: translateY(16px) scale(.94); } 100% { opacity: 1; transform: none; } }
@keyframes sweep { to { transform: translateX(100%); } }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.2) rotate(-12deg); } 100% { opacity: 1; transform: rotate(-3deg); } }
@keyframes flip { from { opacity: 0; transform: perspective(700px) rotateX(-75deg); } }
@keyframes spin { to { --ang: 360deg; } }
@keyframes fadeSlide { from { opacity: 0; transform: translateX(10px); } }
@keyframes reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes scanline { from { top: 0; opacity: 1; } 85% { opacity: 1; } to { top: 100%; opacity: 0; } }
@keyframes acIn { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes loadBar { 0% { transform: scaleX(0); opacity: 1; } 70% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes lessonOut { to { opacity: 0; transform: translateX(-60px) scale(.98); filter: blur(4px); } }
@keyframes lessonIn { from { opacity: 0; transform: translateX(80px) scale(.98); } }
@keyframes lessonOutR { to { opacity: 0; transform: translateX(60px) scale(.98); filter: blur(4px); } }
@keyframes lessonInL { from { opacity: 0; transform: translateX(-80px) scale(.98); } }

/* ---------- szerokości ---------- */
@media (max-width: 1180px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .work { position: static; height: auto; min-height: 0; }
  .edglow { height: 440px; flex: none; }
  .pv { height: 420px; flex: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .menu { display: grid; }
  .side { position: fixed; top: 60px; left: 0; bottom: 0; width: min(300px, 86vw); height: auto; z-index: 35; transform: translateX(-105%); transition: transform .45s var(--out); view-transition-name: none; }
  .nav-open .side { transform: none; box-shadow: 8px 0 30px rgba(0, 0, 0, .25); }
  .scrim { display: block; position: fixed; inset: 60px 0 0; background: rgba(0, 0, 0, .35); backdrop-filter: blur(2px); z-index: 34; opacity: 0; pointer-events: none; transition: opacity .35s; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .keys { display: none; }
  .edbar { justify-content: space-between; }
}
@media (max-width: 600px) {
  .top { gap: 10px; }
  .bs { display: none; }
  .ed { --fs: 16px; --lh: 24px; }
  .card { padding: 16px; }
  .pager { width: 100%; }
  .pager .btn { flex: 1; }
  .edglow { height: 400px; }
  .pv { height: 440px; }
  .ftab { padding: 0 10px; font-size: 12px; }
  #status { width: 100%; margin-left: 0; }
}
@media (max-width: 420px) {
  .score { display: none; }
  .ftab .fi { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .splash { display: none; }
}

/* ---------- silnik VS Code (komputer) i pasek znaków (telefon) ---------- */
.mon { position: absolute; inset: 0; }
.ed.monaco .gut, .ed.monaco .area { display: none; }
.ed.boot .mon { animation: reveal .85s var(--out) backwards; }
.kbar { display: none; flex: none; gap: 4px; padding: 6px; overflow-x: auto; background: #0d0e10; border-top: 1px solid #23252a; scrollbar-width: none; }
.kbar button { flex: none; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid #2f3136; border-bottom-width: 2px; border-radius: 8px; background: #1b1c20; color: #e3e4e8; font: 500 16px "Geist Mono", monospace; touch-action: manipulation; transition: transform .1s, background-color .1s; }
.kbar button:active { transform: translateY(1px) scale(.95); background: #4a2a1b; }
.kbar button.wide { min-width: 56px; color: #ff8a57; }
@media (pointer: coarse) {
  .kbar { display: flex; }
  .keys { display: none; }
}
body.vscode .kbar { display: none; }

/* ---------- „po ludzku” ---------- */
.easy { margin: 2px 0 16px; padding: 14px 16px 6px; border-radius: 12px; background: linear-gradient(135deg, var(--accs), color-mix(in srgb, var(--accs) 40%, var(--panel))); border: 1px solid color-mix(in srgb, var(--acc) 25%, transparent); }
.easy strong { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 6px; }
.easy strong::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc) 20%, transparent); }
.easy ul { margin: 0; padding-left: 20px; }
.easy li { margin-bottom: 8px; line-height: 1.5; }
.easy li::marker { color: var(--acc); }
.more { color: var(--mute); font-size: 14px !important; font-weight: 500 !important; margin: 4px 0 8px !important; }
.ruler.intro.now a { animation-delay: calc(var(--i) * 28ms); }
@media (max-width: 1640px) { .keys { display: none; } .edbar { justify-content: space-between; } }

/* ---------- przełącznik motywu ---------- */
.theme { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #2f3136; border-radius: 12px; background: #1b1c20; color: #ffd27a; transition: background-color .2s, transform .2s var(--spring), color .4s; }
.theme:hover { background: #26282c; transform: rotate(-12deg) scale(1.06); }
.theme:active { transform: scale(.9); }
.theme:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.theme svg { overflow: visible; }
.theme .sun { transform-origin: center; transition: r .5s var(--spring), transform .6s var(--spring); }
.theme .mc { transition: cx .6s var(--out), cy .6s var(--out); }
.theme .rays { transform-origin: 12px 12px; transition: transform .6s var(--spring), opacity .3s; }
.theme.dark { color: #c9d4ff; }
.theme.dark .sun { r: 8; transform: rotate(-30deg); }
.theme.dark .mc { cx: 17; cy: 7; }
.theme.dark .rays { transform: rotate(90deg) scale(.4); opacity: 0; }
html.theming::view-transition-old(root) { animation: none; z-index: 1; }
html.theming::view-transition-new(root) { animation: themeIn .7s cubic-bezier(.6, 0, .2, 1) both; z-index: 2; }
html.theming .app > .main, html.theming .side, html.theming .top { view-transition-name: none; }
@keyframes themeIn { from { clip-path: circle(0 at var(--tx) var(--ty)); } to { clip-path: circle(150vmax at var(--tx) var(--ty)); } }
@media (max-width: 420px) { .theme { width: 36px; height: 36px; } }
