/* ═════════ آزمایشگاه علوم — themeable neon lab ═════════ */
:root, [data-theme="dark"] {
  --bg: #05070f; --bg-soft: #0a1020;
  --surface: rgba(15, 23, 44, .72); --surface-solid: #0c1428; --surface-2: #131d38; --surface-3: #1a2647;
  --input: rgba(5, 9, 20, .55); --top: rgba(7, 10, 22, .62);
  --line: rgba(125, 211, 252, .12); --line2: rgba(125, 211, 252, .24);
  --text: #e8f1ff; --text2: #b6c4e0; --muted: #7d8db0;
  --cyan: #22d3ee; --lime: #a3e635; --pink: #f472b6; --amber: #fbbf24; --violet: #a78bfa;
  --accent-grad: linear-gradient(90deg, #22d3ee, #a3e635); --on-accent: #001018;
  --ok: #4ade80; --bad: #fb7185;
  --glow: 0 0 24px rgba(34, 211, 238, .35);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
  --neon-shadow: 0 0 30px rgba(34, 211, 238, .28);
  --grid: rgba(34, 211, 238, .14); --glow-op: .32;
  /* lab scene */
  --wall1: #0d1426; --wall2: #121c33; --bench1: #2b3550; --bench2: #1c2438; --bench3: #121829;
  --edge: #3b4a6e; --shelf: #1b2742; --tile: rgba(125, 211, 252, .05); --lamp: #7dd3fc;
  --glass: #8fb6d9; --stage: #0d1426; --tag-bg: #0f172a; --msg: rgba(8, 13, 28, .9);
  --nb-bg: #f8f3e3; --nb-ink: #2b2410;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #eef3fb; --bg-soft: #e3ebf7;
  --surface: rgba(255, 255, 255, .8); --surface-solid: #ffffff; --surface-2: #f3f6fc; --surface-3: #e9eef8;
  --input: #f3f6fc; --top: rgba(255, 255, 255, .72);
  --line: rgba(30, 64, 120, .1); --line2: rgba(30, 64, 120, .18);
  --text: #0f1b33; --text2: #3b4b6b; --muted: #6b7a99;
  --cyan: #0891b2; --lime: #4d7c0f; --pink: #db2777; --amber: #b45309; --violet: #7c3aed;
  --accent-grad: linear-gradient(90deg, #06b6d4, #65a30d); --on-accent: #ffffff;
  --ok: #16a34a; --bad: #e11d48;
  --glow: 0 10px 30px -10px rgba(8, 145, 178, .35);
  --shadow: 0 24px 50px -28px rgba(30, 64, 120, .35);
  --neon-shadow: none;
  --grid: rgba(8, 145, 178, .12); --glow-op: .16;
  --wall1: #e9eff9; --wall2: #dce5f3; --bench1: #c5d0e3; --bench2: #b3c0d8; --bench3: #9fadc8;
  --edge: #8ea0c2; --shelf: #b9c6de; --tile: rgba(30, 64, 120, .06); --lamp: #ffffff;
  --glass: #5b7aa6; --stage: #e5ecf7; --tag-bg: #ffffff; --msg: rgba(255, 255, 255, .94);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: 'Vazirmatn', Tahoma, sans-serif; line-height: 1.9; overflow-x: hidden; -webkit-font-smoothing: antialiased; transition: background .5s, color .5s; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--cyan); color: var(--on-accent); }
::-webkit-scrollbar { width: 10px; } ::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 9px; border: 2px solid var(--bg); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.theming * { transition: background-color .45s, border-color .45s, color .45s, fill .45s, stroke .45s !important; }

/* ── ambient background ── */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-grid { position: absolute; left: -50%; right: -50%; bottom: -10%; height: 70%; transform: perspective(500px) rotateX(62deg); transform-origin: bottom;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 60px 60px;
  mask-image: linear-gradient(to top, #000 10%, transparent 80%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 80%); animation: gridMove 6s linear infinite; }
@keyframes gridMove { to { background-position: 0 60px; } }
.bg-glow { position: absolute; width: 50vw; height: 50vw; border-radius: 50%; filter: blur(120px); opacity: var(--glow-op); }
.g1 { background: #0891b2; left: -18vw; top: -10vw; animation: drift 18s ease-in-out infinite; }
.g2 { background: #65a30d; right: -20vw; top: 30vh; animation: drift 22s ease-in-out infinite reverse; }
.g3 { background: #7c3aed; left: 30vw; bottom: -30vw; opacity: calc(var(--glow-op) * .7); animation: drift 26s ease-in-out infinite; }
@keyframes drift { 50% { transform: translate(6vw, 4vh) scale(1.1); } }
.bg-dust { position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 20% 30%, #9fe8ff88 50%, transparent), radial-gradient(1px 1px at 70% 20%, #d9ff9e88 50%, transparent), radial-gradient(1.5px 1.5px at 40% 70%, #9fe8ff66 50%, transparent), radial-gradient(1px 1px at 85% 60%, #ffffff55 50%, transparent), radial-gradient(1px 1px at 10% 85%, #d9ff9e66 50%, transparent); background-size: 600px 600px; animation: dust 40s linear infinite; }
[data-theme="light"] .bg-dust { opacity: .35; filter: invert(.6); }
@keyframes dust { to { background-position: 0 -600px; } }
body.flicker-on main, body.flicker-on .top { animation: flick 1.2s steps(1) 1; }
@keyframes flick { 0%, 12%, 28% { opacity: .15; } 6%, 20%, 34%, 100% { opacity: 1; } }

/* ── intro ── */
#intro { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; }
.door { position: absolute; top: 0; bottom: 0; width: 50%; background: linear-gradient(90deg, #0b1224, #111a33); transition: transform 1.2s cubic-bezier(.7, 0, .2, 1); box-shadow: inset 0 0 80px rgba(0, 0, 0, .6); }
.door.left { left: 0; border-right: 2px solid rgba(34, 211, 238, .5); } .door.right { right: 0; border-left: 2px solid rgba(34, 211, 238, .5); }
.door-stripe { position: absolute; top: 84%; height: 5%; left: 10%; right: 10%; background: repeating-linear-gradient(45deg, #fbbf24 0 18px, #111 18px 36px); opacity: .5; border-radius: 6px; }
#intro.open .door.left { transform: translateX(-100%); } #intro.open .door.right { transform: translateX(100%); }
.intro-c { position: relative; text-align: center; color: #e8f1ff; transition: opacity .5s, transform .6s; }
#intro.open .intro-c { opacity: 0; transform: scale(1.15); }
.intro-logo { width: 110px; height: 110px; filter: drop-shadow(0 0 30px rgba(34, 211, 238, .6)); animation: floaty 3s ease-in-out infinite; }
.intro-scan { position: absolute; left: 50%; top: 0; width: 140px; height: 3px; margin-left: -70px; background: #22d3ee; box-shadow: 0 0 16px #22d3ee; animation: scan 2s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: translateY(0); opacity: 0; } 15%, 85% { opacity: 1; } 50% { transform: translateY(110px); } }
.intro-c h1 { margin: 14px 0 0; font-size: clamp(36px, 7vw, 64px); font-weight: 900; text-shadow: 0 0 24px rgba(34, 211, 238, .55); }
.intro-c p { margin: 0 0 6px; color: #b6c4e0; }
.intro-credit { margin: 0 0 24px !important; font-size: 13.5px; color: #7dd3fc !important; }
#enterBtn { all: unset; cursor: pointer; padding: 15px 34px; border-radius: 16px; font-weight: 900; font-size: 18px; color: #001018; background: linear-gradient(90deg, #22d3ee, #a3e635); box-shadow: 0 0 40px rgba(34, 211, 238, .45); animation: glowPulse 2s ease-in-out infinite; }
.intro-c small { display: block; margin-top: 14px; color: #7d8db0; }
@keyframes glowPulse { 50% { box-shadow: 0 0 70px rgba(163, 230, 53, .55); } }
@keyframes floaty { 50% { transform: translateY(-8px); } }

/* ── header: floating glass bar ── */
.top { position: sticky; top: 12px; z-index: 60; margin: 12px auto 0; max-width: 1280px; width: calc(100% - 24px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px;
  padding: 10px 12px 10px 14px; border-radius: 22px; background: var(--top); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line2); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06); }
.top::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), var(--lime), transparent); opacity: .7; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; justify-self: start; }
.brand img { width: 42px; height: 42px; border-radius: 13px; filter: drop-shadow(0 0 10px rgba(34, 211, 238, .4)); transition: transform .4s; }
.brand:hover img { transform: rotate(-10deg) scale(1.06); }
.brand span { display: flex; flex-direction: column; line-height: 1.25; } .brand b { font-weight: 900; font-size: 16px; } .brand small { color: var(--muted); font-size: 11.5px; }
.nav { position: relative; display: flex; gap: 2px; padding: 5px; border-radius: 16px; background: var(--input); border: 1px solid var(--line); }
.nav-ind { position: absolute; top: 5px; bottom: 5px; right: 0; width: 0; border-radius: 12px; background: color-mix(in srgb, var(--nc, var(--cyan)) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nc, var(--cyan)) 45%, transparent), 0 0 18px -4px var(--nc, var(--cyan)); transition: transform .45s cubic-bezier(.3, 1.3, .5, 1), width .45s cubic-bezier(.3, 1.3, .5, 1), background .3s; opacity: 0; }
.nav-ind.on { opacity: 1; }
.nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; text-decoration: none; padding: 7px 14px; border-radius: 12px; font-weight: 700; font-size: 14.5px; color: var(--text2); transition: color .25s; white-space: nowrap; }
.nav a .ic { width: 18px; height: 18px; transition: transform .35s; }
.nav a:hover { color: var(--text); } .nav a:hover .ic { transform: translateY(-2px) rotate(-8deg); }
.nav a.on { color: var(--nc, var(--cyan)); }
.nav a em { font-style: normal; font-size: 10.5px; font-weight: 800; padding: 0 6px; border-radius: 6px; background: var(--surface-3); color: var(--muted); line-height: 1.7; }
.top-act { display: flex; gap: 8px; justify-self: end; align-items: center; }
.ibtn { all: unset; cursor: pointer; height: 42px; min-width: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line2); background: var(--input); color: var(--text2); font-size: 13px; font-weight: 700; transition: border-color .2s, box-shadow .2s, color .2s, transform .2s; }
.ibtn:hover { border-color: var(--cyan); color: var(--text); box-shadow: var(--glow); transform: translateY(-1px); }
.ibtn kbd { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--muted); border: 1px solid var(--line); }
.ibtn .lbl { white-space: nowrap; }
#themeBtn .ic { transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); } #themeBtn:hover .ic { transform: rotate(40deg); }
.theme-sun, .theme-moon { display: none; } [data-theme="dark"] .theme-sun, [data-theme="light"] .theme-moon { display: block; }

main { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 60px; }

/* ── footer with credit ── */
.foot { position: relative; z-index: 1; max-width: 1280px; margin: 40px auto 0; padding: 0 clamp(16px, 4vw, 48px) 34px; }
.foot-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 22px 24px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.foot-av { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-grad); color: var(--on-accent); font-size: 26px; font-weight: 900; box-shadow: var(--glow); }
.foot-credit small { display: block; color: var(--muted); font-size: 12.5px; }
.foot-credit b { font-size: 20px; font-weight: 900; display: block; line-height: 1.6; }
.foot-credit span { color: var(--cyan); font-weight: 700; font-size: 14px; }
.foot-src { color: var(--muted); font-size: 12.5px; max-width: 340px; line-height: 1.9; }
.foot-bottom { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ── shared ── */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--cyan); font-weight: 800; font-size: 13.5px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.lead { color: var(--text2); font-size: 16.5px; max-width: 640px; }
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 13px 22px; border-radius: 14px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; border: 1px solid var(--line2); background: var(--surface); color: var(--text); transition: transform .2s, box-shadow .2s, border-color .2s; }
.btn .ic { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: var(--glow); }
.btn.primary { color: var(--on-accent); border-color: transparent; background: var(--accent-grad); box-shadow: 0 12px 34px -10px rgba(34, 211, 238, .7); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.sec-h { display: flex; align-items: baseline; gap: 16px; margin: 70px 0 24px; }
.sec-h span { font-family: 'JetBrains Mono', monospace; color: var(--cyan); font-size: 14px; }
.sec-h h2 { margin: 0; font-size: clamp(20px, 2.6vw, 28px); font-weight: 900; }
.sec-h p { margin: 0; color: var(--muted); font-size: 14px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s, transform .7s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ── home ── */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 30px; align-items: center; min-height: calc(100vh - 160px); padding: 30px 0; }
.neon { margin: 14px 0 10px; font-size: clamp(56px, 9vw, 116px); line-height: 1.12; font-weight: 900; letter-spacing: -.01em; text-shadow: var(--neon-shadow); }
.neon span { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px rgba(163, 230, 53, .3)); }
.stats { display: flex; gap: 34px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column; line-height: 1.3; } .stats b { font-size: 32px; font-weight: 900; color: var(--cyan); text-shadow: var(--neon-shadow); } .stats small { color: var(--muted); }
.hero-art svg { width: 100%; height: auto; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .35)); }
.hf-liq { animation: liq 3s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes liq { 50% { transform: scaleY(.92); filter: brightness(1.25); } }
.hb { animation: hb 2.2s ease-in infinite; }
@keyframes hb { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-70px); opacity: 0; } }
.hflame { transform-box: fill-box; transform-origin: 50% 100%; animation: flk .15s ease-in-out infinite alternate; }
@keyframes flk { to { transform: scale(.93, 1.08); } }
.pulse { animation: pulse 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 50% { transform: scale(1.15); opacity: .7; } }
.atom { animation: spinA 14s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spinA { to { transform: translate(300px, 110px) rotate(360deg); } }
.hero-bench { fill: var(--bench2); } .hero-bench-top { fill: var(--edge); }

/* teaser player */
.teaser { position: relative; border-radius: 28px; overflow: hidden; border: 1px solid var(--line2); box-shadow: var(--shadow), 0 0 0 1px rgba(34, 211, 238, .08); background: #000; aspect-ratio: 16 / 9; }
.teaser::before { content: ''; position: absolute; inset: -2px; z-index: 0; border-radius: 30px; background: conic-gradient(from 0deg, transparent, var(--cyan), transparent 30%, var(--lime), transparent 60%); animation: spinB 6s linear infinite; opacity: .55; }
.teaser-in { position: absolute; inset: 2px; z-index: 1; border-radius: 26px; overflow: hidden; background: #000; }
.teaser video { width: 100%; height: 100%; display: block; object-fit: cover; }
.teaser-play { all: unset; cursor: pointer; position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: radial-gradient(circle, rgba(0, 0, 0, .1), rgba(0, 0, 0, .55)); transition: opacity .4s; }
.teaser-play span { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: rgba(5, 10, 22, .55); border: 2px solid rgba(255, 255, 255, .7); backdrop-filter: blur(8px); box-shadow: 0 0 0 0 rgba(34, 211, 238, .7); animation: ping 2s infinite; transition: transform .3s; }
.teaser-play:hover span { transform: scale(1.08); }
.teaser-play svg { width: 40px; height: 40px; margin-right: -6px; fill: #fff; }
.teaser-play em { position: absolute; bottom: 22px; font-style: normal; color: #fff; font-weight: 800; font-size: 15px; text-shadow: 0 2px 10px #000; }
.teaser.playing .teaser-play { opacity: 0; pointer-events: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .6); } 100% { box-shadow: 0 0 0 28px rgba(34, 211, 238, 0); } }
@keyframes spinB { to { transform: rotate(360deg); } }

.wing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.wing { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 26px; text-decoration: none; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s; }
.wing:hover { transform: translateY(-6px); box-shadow: 0 24px 60px -20px var(--c), 0 0 0 1px var(--c); }
.wing-door { height: 150px; border-radius: 18px; display: grid; place-items: center; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .04) 0 2px, transparent 2px 40px), linear-gradient(180deg, var(--wall1), var(--wall2)); border: 1px solid var(--line2); position: relative; overflow: hidden; }
.wing-door::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .12) 50%, transparent 70%); transform: translateX(-100%); transition: transform .8s; }
.wing:hover .wing-door::after { transform: translateX(100%); }
.wing-n { font-size: 96px; font-weight: 900; line-height: 1; color: var(--c); text-shadow: 0 0 30px color-mix(in srgb, var(--c) 70%, transparent); }
.wing-t { display: flex; flex-direction: column; line-height: 1.5; } .wing-t small { color: var(--muted); } .wing-t b { font-size: 22px; font-weight: 900; } .wing-t em { font-style: normal; color: var(--text2); font-size: 14px; }
.wing-p { position: absolute; top: 34px; left: 34px; display: grid; place-items: center; } .wing-p i { position: absolute; font-style: normal; font-size: 12px; font-weight: 800; }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 6; } .ring-fg { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .8s; }
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.how-c { padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); transition: transform .3s, border-color .3s; }
.how-c:hover { transform: translateY(-4px); border-color: var(--line2); }
.how-i { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: color-mix(in srgb, var(--hc) 14%, transparent); color: var(--hc); border: 1px solid color-mix(in srgb, var(--hc) 35%, transparent); }
.how-i .ic { width: 24px; height: 24px; }
.how-c b { display: block; margin: 10px 0 4px; font-size: 17px; } .how-c p { margin: 0; color: var(--text2); font-size: 14px; line-height: 1.9; }

/* ── grade page ── */
.grade { padding-top: 40px; }
.g-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 22px; }
.g-head h1 { margin: 0; font-size: clamp(30px, 4.6vw, 50px); font-weight: 900; }
.g-head .lead { margin: 4px 0 0; } .g-head .eyebrow { color: var(--c); }
.g-badge { width: 96px; height: 96px; border-radius: 28px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 1px solid var(--c); box-shadow: 0 0 40px -12px var(--c); }
.g-badge span { font-size: 58px; font-weight: 900; color: var(--c); line-height: 1; }
.g-prog { margin-inline-start: auto; position: relative; display: grid; place-items: center; } .g-prog b { position: absolute; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.chip { all: unset; cursor: pointer; padding: 7px 16px; border-radius: 99px; border: 1px solid var(--line2); background: var(--surface); font-weight: 700; font-size: 14px; color: var(--text2); transition: all .2s; }
.chip.on, .chip:hover { color: var(--text); border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.chap { margin-bottom: 34px; }
.chap-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--line2); }
.chap-h span { font-family: 'JetBrains Mono', 'Vazirmatn', monospace; color: var(--c); font-size: 13px; font-weight: 700; } .chap-h b { font-size: 19px; }
.xgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.xcard { position: relative; display: flex; gap: 14px; padding: 18px; border-radius: 22px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); transition: transform .25s, border-color .25s, box-shadow .25s; overflow: hidden; }
.xcard::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--f); opacity: .8; }
.xcard:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 18px 40px -20px var(--c); }
.xcard.is-done { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.xcard-ic { flex: none; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--f) 14%, var(--surface-2)); border: 1px solid var(--line); }
.xcard-ic svg { width: 46px; height: 46px; }
.xcard-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.xcard-t small { color: var(--muted); font-size: 12px; } .fchip { color: var(--f); font-weight: 800; margin-inline-end: 4px; }
[data-theme="light"] .fchip { filter: brightness(.7); }
.xcard-t b { font-size: 17px; line-height: 1.6; }
.xcard-g { color: var(--text2); font-size: 13.5px; line-height: 1.85; }
.xcard-m { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.xcard-m i { font-style: normal; } .xcard-m .done { font-style: normal; color: var(--ok); font-weight: 800; }

/* ── experiment page ── */
.xp { padding-top: 26px; }
.crumb { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); } .crumb a { color: var(--c); text-decoration: none; }
.xp-head h1 { margin: 6px 0 2px; font-size: clamp(28px, 4.2vw, 46px); font-weight: 900; }
.xp-head .lead { margin: 0 0 12px; }
.safety { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sign { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 10px; font-size: 13px; font-weight: 700; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .45); color: var(--amber); }
.sign i { font-style: normal; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #fbbf24; clip-path: polygon(50% 0, 100% 100%, 0 100%); font-size: 11px; padding-top: 6px; }
.xp-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.now-row { display: flex; gap: 10px; align-items: stretch; margin-bottom: 10px; flex-wrap: wrap; }
.now { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.now-n { flex: none; padding: 3px 12px; border-radius: 99px; background: var(--c); color: #001018; font-weight: 900; font-size: 12.5px; }
.now-n.done { background: var(--ok); }
.now-t { font-weight: 700; line-height: 1.8; } .now-t em { font-style: normal; color: var(--muted); font-weight: 400; font-size: 13px; }
.xp-tools { display: flex; gap: 6px; }
.tool { all: unset; cursor: pointer; padding: 0 14px; min-height: 46px; display: inline-flex; align-items: center; gap: 7px; border-radius: 14px; font-weight: 800; font-size: 14px; border: 1px solid var(--line2); background: var(--surface); white-space: nowrap; transition: all .2s; }
.tool .ic { width: 18px; height: 18px; }
.tool:hover { border-color: var(--cyan); box-shadow: var(--glow); }
.tool.on { border-color: var(--lime); color: var(--lime); }
.stage { position: relative; border-radius: 24px; overflow: hidden; border: 1px solid var(--line2); box-shadow: var(--shadow), 0 0 0 1px rgba(34, 211, 238, .06); background: var(--stage); }
.stage::before { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(transparent 50%, rgba(255, 255, 255, .012) 50%); background-size: 100% 4px; }
.stage.flash::after { content: ''; position: absolute; inset: 0; z-index: 3; background: var(--flash, #fff); pointer-events: none; animation: flashA 1.4s ease-out forwards; }
@keyframes flashA { 0% { opacity: 0; } 12% { opacity: .85; } 100% { opacity: 0; } }
.lab-svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; font-family: 'Vazirmatn', Tahoma, sans-serif; }
.msg { position: absolute; z-index: 4; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: center; pointer-events: none; }
.lm { max-width: 660px; padding: 10px 18px; border-radius: 14px; font-size: 14.5px; line-height: 1.9; font-weight: 600; text-align: center; background: var(--msg); border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); backdrop-filter: blur(6px); animation: lmIn .35s cubic-bezier(.3, 1.4, .6, 1); }
.lm.ok { border-color: var(--ok); } .lm.warn { border-color: var(--bad); }
.lm b { color: var(--lime); }
@keyframes lmIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.lapse { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; background: rgba(2, 4, 12, .62); backdrop-filter: blur(3px); }
.lapse-in { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 24px; color: #22d3ee; text-shadow: 0 0 20px #22d3ee; }
.lapse-in svg { width: 76px; height: 76px; } .lapse-in circle { fill: none; stroke: #22d3ee; stroke-width: 3; }
.lapse-in path { stroke: #22d3ee; stroke-width: 3; stroke-linecap: round; transform-origin: 24px 24px; }
.lapse-in .h1 { animation: spin .8s linear infinite; } .lapse-in .h2 { animation: spin 3.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.confetti { position: absolute; z-index: 6; top: 0; width: 9px; height: 14px; border-radius: 2px; pointer-events: none; }

.quiz { margin-top: 12px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1.5px solid var(--c); box-shadow: 0 0 30px -12px var(--c); animation: lmIn .35s ease; }
.lq-k { margin: 0; color: var(--c); font-weight: 800; font-size: 13px; }
.lq-q { margin: 2px 0 12px; font-weight: 800; font-size: 17px; line-height: 1.9; }
.lq-o { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.lq-o button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--input); font-size: 14.5px; line-height: 1.7; transition: all .2s; }
.lq-o button:hover { border-color: var(--cyan); }
.lq-o button span { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--surface-3); color: var(--muted); }
.lq-o button.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); } .lq-o button.right span { background: var(--ok); color: #001; }
.lq-o button.wrong { border-color: var(--bad); opacity: .55; }
.lq-o button.picked { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 14%, transparent); }

.tray { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 20px; min-height: 96px; background: linear-gradient(180deg, var(--surface-2), var(--surface-solid)); border: 1px solid var(--line); box-shadow: inset 0 2px 20px rgba(0, 0, 0, .15); }
.tok { all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100px; padding: 10px 6px 8px; border-radius: 16px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2)); border: 1.5px solid var(--line2); transition: transform .2s, border-color .2s, box-shadow .2s, opacity .2s; }
[data-theme="light"] .tok { background: linear-gradient(180deg, #fff, #f1f5fc); }
.tok:hover { transform: translateY(-3px); border-color: var(--cyan); box-shadow: var(--glow); }
.tok-ic { width: 48px; height: 48px; display: grid; place-items: center; } .tok-ic svg { width: 48px; height: 48px; }
.tok-l { font-size: 12px; font-weight: 700; text-align: center; line-height: 1.5; }
.tok.lifted { opacity: .3; } .tok.sel { border-color: var(--lime); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 30%, transparent); }
.tok.fresh { animation: tokIn .6s cubic-bezier(.3, 1.6, .6, 1); } .tok.hinted { border-color: var(--lime); animation: tokP 1s ease-in-out infinite; }
@keyframes tokIn { from { transform: scale(.4); opacity: 0; } } @keyframes tokP { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--lime) 25%, transparent); } }
.tok-ghost { position: fixed; left: 0; top: 0; z-index: 900; pointer-events: none; border-color: var(--cyan); box-shadow: 0 0 30px rgba(34, 211, 238, .5), 0 20px 40px rgba(0, 0, 0, .4); }
.tray-empty { margin: auto; color: var(--muted); font-size: 13.5px; }
.hint-hand { position: fixed; left: 0; top: 0; z-index: 950; font-size: 34px; pointer-events: none; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
.tip { display: flex; align-items: center; gap: 6px; margin: 10px 4px 0; font-size: 12.5px; color: var(--muted); } .tip .ic { width: 16px; height: 16px; color: var(--amber); }

.notebook { margin-top: 14px; padding: 16px; border-radius: 18px; background: var(--nb-bg); color: var(--nb-ink); border: 1px solid #d9c99a; box-shadow: var(--shadow); background-image: repeating-linear-gradient(transparent 0 27px, rgba(59, 130, 246, .18) 27px 28px); }
.notebook.nb-new { animation: nbIn .5s ease; } @keyframes nbIn { 30% { box-shadow: 0 0 0 4px rgba(163, 230, 53, .6); } }
.nb-h { font-weight: 900; margin-bottom: 8px; }
.nb-t { width: 100%; border-collapse: collapse; font-size: 14px; } .nb-t th { text-align: right; font-size: 12.5px; color: #6b5a2a; border-bottom: 2px solid #c9b47a; padding: 4px 8px; } .nb-t td { padding: 5px 8px; border-bottom: 1px dashed #d9c99a; }
.nb-empty { color: #9a8a5a; text-align: center; }
.nb-chart { display: flex; align-items: flex-end; gap: 12px; height: 150px; margin-top: 14px; padding: 8px 4px 0; border-bottom: 2px solid #c9b47a; }
.nb-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.nb-bar i { width: 70%; max-width: 46px; background: linear-gradient(180deg, #0ea5e9, #0369a1); border-radius: 6px 6px 0 0; transition: height .6s; }
.nb-bar em { font-style: normal; font-size: 11px; font-weight: 800; } .nb-bar small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.xp-side { position: sticky; top: 100px; display: grid; gap: 12px; }
.panel { padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.panel-h { display: flex; align-items: center; gap: 8px; font-weight: 900; margin-bottom: 10px; } .panel-h .ic { color: var(--c); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; color: var(--muted); font-size: 13.5px; line-height: 1.8; transition: all .3s; }
.steps li p { margin: 0; } .steps li span { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; background: var(--surface-3); }
.steps li.cur { background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--text); font-weight: 700; } .steps li.cur span { background: var(--c); color: #001018; box-shadow: 0 0 12px var(--c); }
.steps li.done { color: var(--text2); } .steps li.done span { background: var(--ok); color: #001; }
.mats { display: flex; flex-wrap: wrap; gap: 6px; } .mats span { padding: 3px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; }
#labResult { margin-top: 24px; scroll-margin-top: 100px; }
.result { padding: 24px; border-radius: 26px; background: linear-gradient(160deg, color-mix(in srgb, var(--ok) 10%, var(--surface)), var(--surface)); border: 1.5px solid color-mix(in srgb, var(--ok) 50%, transparent); box-shadow: var(--shadow); animation: lmIn .5s ease; }
.result-h { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.result-h .ok { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--ok); color: #001; font-size: 26px; font-weight: 900; }
.result-h small { display: block; color: var(--muted); } .result-h b { font-size: 21px; }
.pred { margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--violet) 12%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 40%, transparent); }
.result-b h3 { margin: 6px 0; font-size: 16px; } .result-b p { margin: 0 0 14px; color: var(--text2); font-size: 16px; line-height: 2.05; } .result-b b { color: var(--lime); }
.eqs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.eqs code { font-family: 'JetBrains Mono', 'Vazirmatn', monospace; font-weight: 700; font-size: 15.5px; color: var(--cyan); padding: 8px 14px; border-radius: 12px; background: var(--input); border: 1px solid var(--line2); unicode-bidi: plaintext; }
.xp-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; } .xp-nav a { color: var(--text2); text-decoration: none; font-size: 14px; } .xp-nav a:hover { color: var(--cyan); }

/* ── search ── */
#search { position: fixed; inset: 0; z-index: 800; background: rgba(2, 4, 12, .55); backdrop-filter: blur(8px); display: grid; place-items: start center; padding: 10vh 16px; }
.search-box { width: 100%; max-width: 620px; border-radius: 22px; background: var(--surface-solid); border: 1px solid var(--line2); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); overflow: hidden; }
.search-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-in input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 17px; }
.search-in button { all: unset; cursor: pointer; color: var(--muted); padding: 4px 8px; }
#searchRes { max-height: 60vh; overflow: auto; padding: 8px; }
.sr { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; text-decoration: none; } .sr:hover { background: color-mix(in srgb, var(--cyan) 8%, transparent); }
.sr-ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); } .sr-ic svg { width: 34px; height: 34px; }
.sr span:last-child { display: flex; flex-direction: column; line-height: 1.6; } .sr small { color: var(--muted); font-size: 12px; }

/* ═════════ SVG scene styles ═════════ */
.lab-svg .l-tiles line { stroke: var(--tile); }
.lab-svg .shelf { fill: var(--shelf); }
.lab-svg .l-edge { fill: var(--edge); }
.lab-svg .glass { fill: none; stroke: var(--glass); stroke-width: 2.6; stroke-linejoin: round; }
.lab-svg .glass.thick { stroke-width: 3; fill: rgba(200, 230, 255, .06); }
.lab-svg .gradm { stroke: var(--glass); stroke-width: 1.5; opacity: .8; }
.lab-svg .liq { transform-box: fill-box; transform-origin: 50% 100%; }
.lab-svg .m-dk { fill: #3b4458; } .lab-svg .rack { fill: #6b4f2a; }
.lab-svg .btag rect { fill: var(--tag-bg); stroke: var(--line2); } .lab-svg .btag text { fill: var(--text); font-size: 13px; font-weight: 800; text-anchor: middle; }
.lab-svg .l-label { fill: var(--text2); font-size: 14px; font-weight: 700; text-anchor: middle; }
.lab-svg .l-label.b { font-weight: 900; fill: var(--text); } .lab-svg .l-label.sm { font-size: 12px; } .lab-svg .l-label.xs { font-size: 10.5px; } .lab-svg .l-label.dk { fill: #1e293b; }
.lab-svg .lcd-box { fill: #04110c; stroke: #14532d; stroke-width: 2; }
.lab-svg .lcd { fill: #4ade80; font-family: 'JetBrains Mono', 'Vazirmatn', monospace; font-weight: 700; font-size: 18px; text-anchor: middle; }
[data-theme="light"] .lab-svg text.lcd:not(.sm) { fill: #15803d; }
.lab-svg .lcd.sm { font-size: 13px; } .lab-svg .lcd.big { font-size: 24px; }
.lab-svg .thermo-v rect { fill: var(--tag-bg); stroke: var(--line2); } .lab-svg .thermo-v text { fill: #ef4444; font-weight: 800; font-size: 14px; text-anchor: middle; }
.lab-svg .wire { fill: none; stroke: #f97316; stroke-width: 4; stroke-linecap: round; }
.lab-svg .battery { fill: #1f2937; stroke: #475569; stroke-width: 2; }
.lab-svg .bulbg { stroke: var(--glass); stroke-width: 2.5; } .lab-svg .fil { fill: none; stroke: #a16207; stroke-width: 2; }
.lab-svg .elec { fill: #27272a; stroke: #52525b; }
.lab-svg .slot-hint { fill: none; stroke: var(--glass); stroke-width: 2; stroke-dasharray: 8 7; opacity: .7; }
.lab-svg .cblk { fill: #a8a29e; stroke: #57534e; stroke-width: 2; }
.lab-svg .chg { font-size: 22px; font-weight: 900; text-anchor: middle; } .lab-svg .chg.pos { fill: #f43f5e; } .lab-svg .chg.neg { fill: #3b82f6; }
.lab-svg .wgt rect { stroke: #1e293b; stroke-width: 2; } .lab-svg .wgt text { fill: #fff; font-size: 12px; font-weight: 800; text-anchor: middle; }
.lab-svg .stream { fill: none; stroke: #5aa9e6; stroke-width: 7; stroke-linecap: round; } .lab-svg .stream.flow { stroke-dasharray: 16 9; animation: flow .6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -25; } }
.lab-svg .steam path { fill: none; stroke: var(--glass); stroke-width: 2.5; stroke-linecap: round; opacity: .6; animation: steam 2.4s ease-in-out infinite; }
@keyframes steam { 50% { transform: translateY(-6px); opacity: .2; } }
.lab-svg .flicker { transform-box: fill-box; transform-origin: 50% 100%; animation: flk .16s ease-in-out infinite alternate; }
.lab-svg .lbl-tag { fill: #fde68a; stroke: #a16207; } .lab-svg .lbl-dot { fill: rgba(253, 230, 138, .25); stroke: #eab308; stroke-width: 2; stroke-dasharray: 4 3; }
.lab-svg [id^="lbl-"] { transform-box: fill-box; transform-origin: center; }
.lab-svg .dz { fill: transparent; stroke: transparent; stroke-width: 2.5; stroke-dasharray: 9 7; pointer-events: all; transition: stroke .2s, fill .2s; }
.lab-svg.dragging .dz, .lab-svg.picking .dz { stroke: color-mix(in srgb, var(--cyan) 45%, transparent); }
.lab-svg .dz.over { stroke: var(--lime); fill: color-mix(in srgb, var(--lime) 12%, transparent); stroke-dasharray: none; }
.lab-svg .dz.hinted { stroke: var(--lime); fill: color-mix(in srgb, var(--lime) 12%, transparent); animation: dzP 1s ease-in-out infinite; }
@keyframes dzP { 50% { stroke-width: 5; } }

/* ── mobile bottom tab bar ── */
.tabbar { display: none; }
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; min-height: 0; } .hero-art { max-width: 520px; margin: 0 auto; }
  .wing-grid { grid-template-columns: 1fr; } .how-grid { grid-template-columns: repeat(2, 1fr); }
  .xp-wrap { grid-template-columns: 1fr; } .xp-side { position: static; }
  .ibtn .lbl, .ibtn kbd { display: none; }
  .foot-card { grid-template-columns: auto 1fr; } .foot-src { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; top: 8px; width: calc(100% - 16px); }
  .top .nav { display: none; }
  .tabbar { display: flex; position: fixed; z-index: 70; left: 10px; right: 10px; bottom: 10px; padding: 6px; border-radius: 22px; background: var(--top); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--line2); box-shadow: var(--shadow); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; border-radius: 16px; text-decoration: none; font-size: 11.5px; font-weight: 700; color: var(--muted); transition: all .25s; }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--nc, var(--cyan)); background: color-mix(in srgb, var(--nc, var(--cyan)) 14%, transparent); }
  body { padding-bottom: 84px; }
  .brand small { display: none; }
  .how-grid { grid-template-columns: 1fr; } .xgrid { grid-template-columns: 1fr; }
  .stage { border-radius: 16px; } .msg { position: static; padding: 8px; background: var(--stage); } .lm { font-size: 13px; }
  .tok { width: calc(33.33% - 7px); } .tool { padding: 0 10px; font-size: 13px; } .tool .lbl { display: none; }
  .stats { gap: 22px; } .g-prog { margin-inline-start: 0; }
  .teaser { border-radius: 18px; } .teaser-in { border-radius: 16px; } .teaser-play span { width: 76px; height: 76px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }
