/* NOVARO · strona główna
   Ten sam przyrząd co powtórki: aluminium #e9eaec, noc #141517, pomarańczowa wskazówka #ff4f00, Geist.
   Każdy projekt to jedna płyta: opis i własna miarka postępu po lewej, żywy podgląd po prawej.
   Ruch tylko na wejściu (jedna sekwencja po haśle) i w odpowiedzi na kursor. */

@view-transition { navigation: auto; }

:root {
  color-scheme: light dark;
  --bg: light-dark(#e9eaec, #141517);
  --panel: light-dark(#ffffff, #1c1d20);
  --ink: light-dark(#111214, #ececee);
  --body: light-dark(#3a3d44, #c3c6cc);
  --mute: light-dark(#5b5f66, #9b9fa7);
  --line: light-dark(#d4d6da, #2d2f34);
  --soft: light-dark(#f2f3f5, #25272b);
  --acc: #ff4f00;
  --acct: light-dark(#c73e00, #ff7a3d);
  --code: #16171a;
  --spring: cubic-bezier(.3, 1.4, .5, 1);
  --out: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }

* { box-sizing: border-box; min-width: 0; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; 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, input { font: inherit; color: inherit; }
button { cursor: pointer; }
code, pre { font-family: "Geist Mono", ui-monospace, Consolas, monospace; }
[hidden] { display: none !important; }

.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; }

/* ---------- wejście: logo + hasło (albo logo + pasek, gdy już wpuszczony) ---------- */
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: #111214; color: #fff; }
.skip-gate .gate { display: none; }
.gate-in { display: grid; justify-items: center; gap: 30px; width: min(360px, 100%); }
.gate-logo { width: min(150px, 34vw); height: auto; animation: logoIn 1.1s var(--out) both; }
.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; }
.gate:not(.splash) .sp-bar { display: none; }
.gate.splash .lock, .gate.splash .setup { display: none !important; }
.gate.splash { animation: gateOut .7s cubic-bezier(.7, 0, .2, 1) 1.55s forwards; }
.gate.leave { animation: gateOut .75s cubic-bezier(.7, 0, .2, 1) forwards; }
.gate.leave .gate-logo { animation: logoGo .75s var(--out) forwards; }
.gate.gone { display: none; }

.lock, .setup { width: 100%; display: grid; gap: 12px; animation: rise .7s var(--out) .55s both; }
.lock label, .setup label { text-align: center; font-size: 15px; color: #a3a6ad; }
.field { position: relative; }
.field input { width: 100%; height: 54px; padding: 0 60px 0 20px; border-radius: 14px; border: 1px solid #2f3136; background: #1b1c20; color: #fff; font: 500 18px "Geist Mono", monospace; letter-spacing: .14em; outline: none; transition: border-color .2s, box-shadow .25s, background-color .2s; }
.setup .field input { letter-spacing: .02em; }
.field input:focus { border-color: var(--acc); background: #1f2024; box-shadow: 0 0 0 4px rgba(255, 79, 0, .22); }
.go { position: absolute; top: 7px; right: 7px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--acc); color: #fff; transition: transform .2s var(--spring), background-color .2s, box-shadow .2s; }
.go:hover { background: #ff5a10; transform: translateX(2px); box-shadow: 0 6px 18px rgba(255, 79, 0, .45); }
.go:active { transform: scale(.92); }
.go:focus-visible, .copy:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.msg { margin: 0; min-height: 1.5em; text-align: center; font-size: 14px; color: #ff8f80; }
.lock.bad .field { animation: shake .45s; }
.lock.ok .go { background: #0e8a4a; }
.lock.busy .go svg { animation: nudge .6s ease-in-out infinite; }
.out { display: grid; gap: 10px; font-size: 14px; color: #a3a6ad; text-align: center; }
.out p { margin: 0; }
.out code { color: #fff; background: #1f2024; border: 1px solid #2f3136; padding: 0 5px; border-radius: 5px; }
.out pre { margin: 0; padding: 12px 14px; border-radius: 10px; background: #0d0e10; border: 1px solid #2a2c31; color: #b9e48c; font-size: 12px; text-align: left; white-space: pre-wrap; word-break: break-all; }
.copy { justify-self: center; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid #2f3136; background: #1b1c20; color: #fff; transition: background-color .2s; }
.copy:hover { background: #26282c; }

/* ---------- górny pasek ---------- */
.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; border-radius: 8px; }
.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; }
.top-r { margin-left: auto; display: flex; gap: 8px; }
.iconbtn, .theme { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #2f3136; border-radius: 12px; background: #1b1c20; transition: background-color .2s, transform .2s var(--spring), color .4s; }
.iconbtn { color: #c9cbd0; }
.iconbtn:hover { background: #26282c; color: #fff; }
.iconbtn .shackle { transition: transform .35s var(--spring); transform-origin: 15.5px 10px; }
.iconbtn:hover .shackle { transform: translateY(1.5px); }
.theme { color: #ffd27a; }
.theme:hover { background: #26282c; transform: rotate(-12deg) scale(1.06); }
.theme:active, .iconbtn:active { transform: scale(.9); }
.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; }
:is(.brand, .iconbtn, .theme, .plate):focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

/* ---------- treść ---------- */
.hub { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(22px, 4vw, 48px) max(3vw, 18px) 40px; view-transition-name: hub; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.plates { display: grid; gap: 18px; }
.plate { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 30px; min-height: 280px; padding: 26px 26px 26px 32px; border-radius: 22px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; background-color: var(--panel); background-image: radial-gradient(520px circle at var(--mx, -600px) var(--my, -600px), color-mix(in srgb, var(--acc) 7%, transparent), transparent 60%); transition: transform .45s var(--out), box-shadow .45s var(--out), border-color .3s; }
.plate:hover, .plate:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--acc) 32%, var(--line)); box-shadow: 0 28px 60px -30px color-mix(in srgb, var(--ink) 40%, transparent), 0 2px 8px color-mix(in srgb, var(--ink) 6%, transparent); }
.plate:active { transform: translateY(-1px) scale(.995); }
.txt { display: flex; flex-direction: column; justify-content: space-between; gap: 22px; padding: 4px 0; }
.plate h2 { margin: 0 0 10px; font-size: clamp(25px, 2.5vw, 33px); line-height: 1.08; letter-spacing: -.02em; font-weight: 600; }
.desc { margin: 0; max-width: 44ch; color: var(--body); font-size: 16.5px; }
.prog { display: grid; gap: 9px; }
.mini { display: flex; align-items: flex-end; gap: 3px; height: 20px; max-width: 330px; }
.mini i { flex: 1; max-width: 11px; height: 10px; border-radius: 2px; background: var(--line); transform-origin: bottom; transition: height .3s var(--spring), background-color .3s; }
.mini i:nth-child(5n) { height: 14px; }
.mini i.done { background: var(--acc); }
.plate:hover .mini i { animation: tickWave .7s var(--spring) both; animation-delay: calc(var(--i) * 16ms); }
.plabel { font: 500 13.5px/1.3 "Geist Mono", monospace; color: var(--mute); font-variant-numeric: tabular-nums; }
.plabel b { color: var(--ink); font-weight: 600; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.open { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px 0 18px; border-radius: 99px; background: var(--ink); color: var(--panel); font-weight: 500; font-size: 15px; transition: background-color .25s, color .25s, box-shadow .3s; }
.open .arr { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--acc); color: #fff; transition: transform .35s var(--spring); }
.plate:hover .open { box-shadow: 0 8px 22px rgba(255, 79, 0, .3); }
.plate:hover .open .arr { transform: translateX(3px) rotate(-45deg); }

/* podgląd po prawej: zawsze ciemny, jak okno edytora */
.art { position: relative; overflow: hidden; min-height: 226px; border-radius: 15px; background-color: var(--code); background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 24px 24px; border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04); color: #e3e4e8; }

/* sieć (INF.02) */
.art-net svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-net .cable { stroke: #34363c; stroke-width: 2; fill: none; }
.art-net .pk { stroke: var(--acc); stroke-width: 4; stroke-linecap: round; fill: none; stroke-dasharray: 5 100; stroke-dashoffset: 5; opacity: 0; filter: drop-shadow(0 0 4px rgba(255, 79, 0, .9)); }
.plate:hover .art-net .pk, .plate:focus-visible .art-net .pk { opacity: 1; animation: packet 1.5s linear infinite; animation-delay: var(--d); }
.art-net .pk.back { animation-direction: reverse; }
.art-net .host rect.scr { fill: #1f2125; stroke: #4a4d55; stroke-width: 1.5; transition: fill .3s, stroke .3s; }
.plate:hover .art-net .host rect.scr { animation: screen 1.5s ease-in-out infinite; animation-delay: calc(var(--d) + .6s); }
.art-net .host path { stroke: #4a4d55; stroke-width: 1.5; fill: none; }
.art-net .ip { font: 500 10px "Geist Mono", monospace; fill: #6b7079; }
.art-net .sw { fill: #222428; stroke: #45484f; stroke-width: 1.5; }
.art-net .led { fill: #3a3c42; }
.plate:hover .art-net .led { animation: led .5s steps(2) infinite; animation-delay: var(--d); }
.art-net .cap { font: 500 12px "Geist Mono", monospace; fill: #8d9098; }
.art-net .cap b, .art-net .accent { fill: var(--acc); }

/* edytor (HTML i CSS) */
.art-code { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; padding: 12px; }
.ed { display: flex; flex-direction: column; min-width: 0; border-radius: 10px; background: #0d0e10; border: 1px solid #23252a; overflow: hidden; }
.ed .tabs { display: flex; height: 30px; flex: none; background: #0a0b0c; font: 500 11px "Geist Mono", monospace; color: #8d9098; }
.ed .tabs span { display: flex; align-items: center; gap: 6px; padding: 0 11px; position: relative; }
.ed .tabs span.on { background: #0d0e10; color: #e3e4e8; }
.ed .tabs span.on::after { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--acc); }
.ed .tabs em { font-style: normal; font-weight: 700; font-size: 9px; padding: 2px 3px; border-radius: 3px; color: #ff8a57; background: rgba(255, 138, 87, .12); }
.ed .tabs span:nth-child(2) em { color: #8fb4ff; background: rgba(143, 180, 255, .12); }
.lines { padding: 9px 10px 10px 0; font: 11.5px/19px "Geist Mono", monospace; white-space: nowrap; overflow: hidden; }
.lines div { display: flex; gap: 0; }
.lines i { flex: none; width: 26px; padding-right: 9px; text-align: right; font-style: normal; color: #4b4e56; }
.xt { color: #ff8a57; } .xa { color: #9ccfff; } .xs { color: #b9e48c; } .xp { color: #7d828c; }
.typed { display: inline-block; clip-path: inset(0 100% 0 0); }
.plate:hover .typed, .plate:focus-visible .typed { animation: type 1.1s steps(18) .25s forwards; }
.caret { display: inline-block; width: 2px; height: 14px; margin: 2px 0 0 1px; background: #ff7a3d; vertical-align: top; opacity: 0; }
.plate:hover .caret, .plate:focus-visible .caret { animation: blink .9s steps(2) infinite; }
.pv { position: relative; border-radius: 10px; background: #fff; color: #111214; padding: 14px 14px 12px; overflow: hidden; display: grid; align-content: start; gap: 7px; }
.pv h3 { margin: 0; font-size: 20px; line-height: 1.1; letter-spacing: -.02em; font-weight: 700; }
.pv .bar { height: 7px; border-radius: 4px; background: #e3e5e9; }
.pv .bar.s { width: 62%; }
.pv .lnk { justify-self: start; font-size: 12px; font-weight: 600; color: #c73e00; text-decoration: underline; text-underline-offset: 2px; }
.pv .img { height: 46px; border-radius: 7px; background: linear-gradient(135deg, #ffd0b5, #ff8a57); transform: scale(.4); opacity: 0; transform-origin: top left; }
.plate:hover .pv .img, .plate:focus-visible .pv .img { animation: popIn .5s var(--spring) 1.35s forwards; }
.pv .ok { position: absolute; right: 9px; bottom: 9px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 2px solid var(--acc); border-radius: 6px; color: #c73e00; font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: 0; transform: rotate(-4deg) scale(2); }
.plate:hover .pv .ok, .plate:focus-visible .pv .ok { animation: stampIn .5s var(--spring) 1.75s forwards; }

/* boisko (Duel Arcade) */
.art-duel { background: radial-gradient(120% 90% at 50% 0%, #2a1f4d 0%, #120e22 55%, #0b0915 100%); }
.art-duel::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26%; background: linear-gradient(#f2c88f, #d99a58); box-shadow: 0 -3px 0 #160c33; }
.art-duel .net { position: absolute; left: 50%; bottom: 26%; width: 6px; height: 36%; margin-left: -3px; border-radius: 3px 3px 0 0; background: #fff4e0; box-shadow: 0 0 0 3px #160c33; }
.art-duel .score { position: absolute; top: 14px; left: 0; right: 0; text-align: center; font: 700 26px/1 "Geist Mono", monospace; color: #fff4e0; letter-spacing: .06em; }
.art-duel .score .p1 { color: #34c6ff; } .art-duel .score .p2 { color: #ff5c84; }
.blob { position: absolute; bottom: 26%; width: 58px; height: 54px; margin-bottom: -2px; border-radius: 50% 50% 46% 46%; border: 3px solid #160c33; transform-origin: 50% 100%; }
.blob.p1 { left: 18%; background: radial-gradient(circle at 35% 30%, #9fe6ff 0 16%, #34c6ff 17%); }
.blob.p2 { right: 18%; background: radial-gradient(circle at 35% 30%, #ffb3c4 0 16%, #ff5c84 17%); }
.blob::before, .blob::after { content: ""; position: absolute; top: 15px; width: 13px; height: 15px; border-radius: 50%; background: radial-gradient(circle at var(--px, 60%) 55%, #160c33 0 32%, #fff 34%); border: 2px solid #160c33; }
.blob::before { left: 12px; } .blob::after { left: 28px; }
.blob.p2 { --px: 40%; }
.ballx { position: absolute; left: 25%; bottom: 52%; width: 22px; height: 22px; }
.bally { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 25%, #fff4e0 26%); border: 3px solid #160c33; }
.shadow { position: absolute; bottom: 24%; left: 25%; width: 26px; height: 6px; margin-left: -2px; border-radius: 50%; background: rgba(22, 12, 51, .35); }
.plate:hover .ballx, .plate:focus-visible .ballx { animation: ballX 1.6s linear infinite alternate; }
.plate:hover .bally, .plate:focus-visible .bally { animation: ballY .8s cubic-bezier(.33, .66, .66, 1) infinite alternate; }
.plate:hover .shadow, .plate:focus-visible .shadow { animation: ballX 1.6s linear infinite alternate; }
.plate:hover .blob.p1, .plate:focus-visible .blob.p1 { animation: hop 3.2s var(--out) -.45s infinite; }
.plate:hover .blob.p2, .plate:focus-visible .blob.p2 { animation: hop 3.2s var(--out) 1.15s infinite; }

/* zwykły projekt bez własnego obrazka */
.art-plain { display: grid; place-items: center; }
.art-plain .lw { width: 64px; height: 86px; color: #e3e4e8; }

.empty { padding: 28px; border-radius: 22px; border: 1.5px dashed var(--line); color: var(--mute); }

/* ---------- stopka ---------- */
.foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px 16px 36px; color: var(--mute); font-size: 13.5px; }
.foot .mark { width: 15px; height: 20px; background: currentColor; -webkit-mask: url(img/novaro-mark.png) center / contain no-repeat; mask: url(img/novaro-mark.png) center / contain no-repeat; }

/* ---------- wejście treści (raz, po haśle albo po logo) ---------- */
.hub.enter .plate { animation: plateIn .8s var(--out) both; animation-delay: calc(var(--n) * 110ms + .1s); }
.hub.enter .plate .mini i { animation: tickIn .6s var(--spring) both; animation-delay: calc(var(--n) * 110ms + .45s + var(--i) * 18ms); }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
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 .top, html.theming .hub { view-transition-name: none; }

@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 logoGo { to { transform: scale(1.08) translateY(-12px); opacity: .6; } }
@keyframes gateOut { to { clip-path: inset(0 0 100% 0); visibility: hidden; } }
@keyframes barFill { from { transform: scaleX(0); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes plateIn { from { opacity: 0; transform: translateY(26px) scale(.985); } }
@keyframes wordIn { from { opacity: 0; transform: translateY(.5em) rotate(3deg); filter: blur(8px); } }
@keyframes tickIn { from { transform: scaleY(0); } }
@keyframes tickWave { 40% { transform: scaleY(1.7); } }
@keyframes shake { 15%, 55% { transform: translateX(-8px); } 35%, 75% { transform: translateX(8px); } }
@keyframes nudge { 50% { transform: translateX(3px); } }
@keyframes packet { from { stroke-dashoffset: 5; } to { stroke-dashoffset: -100; } }
@keyframes screen { 0%, 100% { fill: #1f2125; stroke: #4a4d55; } 50% { fill: #3a1a0c; stroke: #ff4f00; } }
@keyframes led { 50% { fill: #3fcf80; } }
@keyframes type { to { clip-path: inset(0 0 0 0); } }
@keyframes blink { 50% { opacity: 1; } }
@keyframes popIn { to { transform: none; opacity: 1; } }
@keyframes stampIn { to { opacity: 1; transform: rotate(-4deg); } }
@keyframes ballX { from { left: 25%; } to { left: 71%; } }
@keyframes ballY { from { transform: translateY(46px); } to { transform: translateY(-34px); } }
@keyframes hop { 0%, 8% { transform: none; } 14% { transform: translateY(-16px) scaleY(1.06); } 22% { transform: scaleY(.9) scaleX(1.08); } 30%, 100% { transform: 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: 860px) {
  .plate { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 14px 14px 22px; min-height: 0; }
  .art { order: -1; min-height: 0; aspect-ratio: 16 / 8.5; }
  .txt { padding: 0 8px; }
}
@media (max-width: 520px) {
  .art-code { grid-template-columns: 1fr; }
  .art-code .pv { display: none; }
  .bs { display: none; }
  .row { flex-direction: column; align-items: stretch; }
  .open { justify-content: space-between; }
}
@media (hover: none) {
  .plate:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .gate.splash { display: none; }
  .typed { clip-path: none; }
  .pv .img, .pv .ok { opacity: 1; transform: none; }
}
