@font-face { font-family: 'Noto Sans Hebrew'; src: url('fonts/noto-sans-hebrew-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Sans Hebrew'; src: url('fonts/noto-sans-hebrew-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Noto Sans Hebrew'; src: url('fonts/noto-sans-hebrew-900.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/poppins-700.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0030-0039, U+0025, U+003A; }

:root {
  color-scheme: dark;
  --bg: #0e1117; --card: #171c26; --line: #2a3242; --text: #f2f4f8; --soft: #aab3c5; --track: #252d3c;
  --ok: #4ade80; --warn: #fbbf24; --eye: #ffffff; --pupil: #10131a;
  --c0: #ff8a3d; --c0b: #ffd2a8; --c1: #35c9e0; --c1b: #c3f1f8; --c2: #a98bff; --c2b: #e0d6ff; --c3: #5fd68a; --c3b: #cdf5da;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Poppins', 'Noto Sans Hebrew', system-ui, sans-serif; font-size: 16px; line-height: 1.5; }
[hidden] { display: none !important; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 16px 40px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
h1 { margin: 0; font-size: 30px; font-weight: 900; line-height: 1.2; }
.summary { margin: 4px 0 0; color: var(--soft); font-size: 17px; }
.live { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--soft); font-size: 14px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: pulse 2s ease-in-out infinite; }
.live.is-off .live-dot { background: var(--warn); animation: none; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 18px; padding: 18px 16px 20px; display: flex; flex-direction: column; min-width: 0; }
.s0 { --c: var(--c0); --cb: var(--c0b); } .s1 { --c: var(--c1); --cb: var(--c1b); } .s2 { --c: var(--c2); --cb: var(--c2b); } .s3 { --c: var(--c3); --cb: var(--c3b); }
.stage { height: 150px; display: flex; align-items: flex-end; justify-content: center; }
.dragon { width: 150px; height: 150px; overflow: visible; }
.name-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.name { margin: 0; font-size: 24px; font-weight: 900; color: var(--c); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--soft); }
.is-working .pill::before { background: var(--ok); animation: pulse 1.2s ease-in-out infinite; }
.is-thinking .pill::before { background: var(--warn); animation: pulse 1.8s ease-in-out infinite; }
.task { margin: 12px 0 0; font-size: 17px; font-weight: 700; min-height: 51px; overflow-wrap: anywhere; }
.is-sleeping .task { font-weight: 400; color: var(--soft); }
.now { margin: 6px 0 0; color: var(--soft); font-size: 15px; min-height: 23px; }
.bar { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; margin-top: 14px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--c); transition: width 1s linear; }
.is-sleeping .bar { visibility: hidden; }
.bar.is-open i { width: 40%; animation: slide 1.6s ease-in-out infinite alternate; }
.eta { margin: 10px 0 0; font-size: 18px; font-weight: 700; min-height: 27px; }
.sub { margin: 2px 0 0; color: var(--soft); font-size: 14px; min-height: 21px; }

/* the dragon */
.dragon * { transform-box: fill-box; transform-origin: center; }
.skin { fill: var(--c); } .belly { fill: var(--cb); } .wing, .tail, .horn, .foot { fill: var(--c); filter: brightness(.8); }
.eye { fill: var(--eye); } .pupil { fill: var(--pupil); } .glint { fill: #fff; } .cheek { fill: #ff6b81; opacity: .45; }
.nostril { fill: var(--pupil); opacity: .55; } .mouth, .lids path { fill: none; stroke: var(--pupil); stroke-width: 2.4; stroke-linecap: round; }
.lids, .sparks, .dots, .zzz { opacity: 0; }
.sparks circle { fill: var(--c); } .dots circle { fill: var(--soft); } .zzz { fill: var(--soft); font: 700 15px 'Poppins', sans-serif; }
.eyes { animation: blink 4.2s infinite; }
.s1 .eyes { animation-delay: .9s; } .s2 .eyes { animation-delay: 1.9s; } .s3 .eyes { animation-delay: 2.8s; }

.is-working .dr-body { animation: hop .62s ease-in-out infinite alternate; }
.is-working .wing { animation: flap .31s ease-in-out infinite alternate; }
.is-working .wing-l { transform-origin: 100% 100%; } .is-working .wing-r { transform-origin: 0 100%; }
.is-working .sparks { opacity: 1; } .is-working .sparks circle { animation: spark 1s ease-in-out infinite; }
.is-working .sparks circle:nth-child(2) { animation-delay: .33s; } .is-working .sparks circle:nth-child(3) { animation-delay: .66s; }

.is-thinking .dr-body { animation: sway 3s ease-in-out infinite alternate; }
.is-thinking .pupils { transform: translate(2px, -4px); }
.is-thinking .dots { opacity: 1; } .is-thinking .dots circle { animation: spark 1.5s ease-in-out infinite; }
.is-thinking .dots circle:nth-child(2) { animation-delay: .3s; } .is-thinking .dots circle:nth-child(3) { animation-delay: .6s; }

.is-sleeping .dragon { opacity: .6; }
.is-sleeping .dr-body { animation: breathe 3.4s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.is-sleeping .eyes { display: none; } .is-sleeping .lids { opacity: 1; }
.is-sleeping .zzz { opacity: 1; animation: zzz 3.4s ease-in-out infinite; }

@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
@keyframes hop { from { transform: translateY(0); } to { transform: translateY(-9px); } }
@keyframes flap { from { transform: rotate(0); } to { transform: rotate(14deg); } }
.is-working .wing-r { animation-name: flap-r; }
@keyframes flap-r { from { transform: rotate(0); } to { transform: rotate(-14deg); } }
@keyframes sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes breathe { from { transform: scale(1, 1); } to { transform: scale(1.03, .96); } }
@keyframes spark { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 6px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -10px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes slide { from { margin-inline-start: 0; } to { margin-inline-start: 60%; } }

.list, .gate { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; }
.list h2, .gate h2 { margin: 0 0 8px; font-size: 20px; font-weight: 900; }
.gate p { margin: 0; color: var(--soft); font-size: 17px; }
.list ul { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; }
.list li:first-child { border-top: 0; }
.list li span:first-child { overflow-wrap: anywhere; } .list li span:last-child { color: var(--soft); white-space: nowrap; }
.note { margin: 24px 0 0; color: var(--soft); font-size: 14px; text-align: center; }

@media (max-width: 1023px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 559px) {
  .grid { grid-template-columns: 1fr; gap: 12px; }
  h1 { font-size: 26px; }
  .card { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 14px; padding: 14px; }
  .stage { grid-row: 1 / span 6; height: auto; align-items: center; }
  .dragon { width: 96px; height: 96px; }
  .name-row { margin-top: 0; } .task { min-height: 0; margin-top: 8px; } .now, .eta, .sub { min-height: 0; }
  .list li { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { .dragon *, .live-dot, .pill::before, .bar i { animation: none !important; transition: none; } }
