:root {
  --ink: #17211b;
  --muted: #607068;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --line: #d9ded6;
  --accent: #0f766e;
  --accent-dark: #16443d;
  --blue: #1d4ed8;
  --gold: #b45309;
  --hero-a: rgba(8, 20, 17, .96);
  --hero-b: rgba(8, 20, 17, .66);
  --shadow: 0 18px 48px rgba(23, 33, 27, .12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Arial, Helvetica, sans-serif; line-height: 1.6; }
a { color: inherit; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-160%); padding: 10px 14px; border-radius: 7px; color: #fff; background: #111827; text-decoration: none; }
.skip-link:focus { transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(23,33,27,.12); background: rgba(247,245,239,.95); backdrop-filter: blur(14px); }
.nav, .wrap { width: min(1180px, 100%); margin: 0 auto; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 22px; }
.brand { display: grid; flex: 0 0 auto; text-decoration: none; font-weight: 900; line-height: 1.05; }
.brand span:last-child { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.nav-links { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.nav-links a { border-radius: 7px; padding: 8px 10px; color: var(--muted); font-size: 14px; font-weight: 800; text-decoration: none; }
.nav-links a:hover, .nav-links a:focus-visible, .nav-links a.active { color: var(--ink); background: #e8f3ef; outline: none; }
.hero { position: relative; min-height: 520px; overflow: hidden; isolation: isolate; display: grid; align-items: end; color: #fff; background: #101d19; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: 0; background: linear-gradient(90deg, var(--hero-a), var(--hero-b), rgba(8,20,17,.24)), url('18-278337742_5034731356574421_3073030576425160217.jpg') center/cover; }
.hero::after { content: ''; position: absolute; inset: auto 0 0; z-index: 1; height: 30%; background: linear-gradient(0deg, var(--paper), rgba(247,245,239,0)); }
.hero-inner { position: relative; z-index: 2; width: min(1180px, 100%); margin: 0 auto; padding: 84px 22px 92px; animation: rise .75s ease-out both; }
.eyebrow { margin: 0 0 12px; color: #b7efe7; font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 860px; margin-bottom: 16px; font-size: clamp(42px, 8vw, 82px); line-height: .98; }
.hero p:not(.eyebrow) { max-width: 760px; color: rgba(255,255,255,.86); font-size: 19px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; padding: 11px 16px; font-weight: 900; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.btn:hover, .btn:focus-visible { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(16,35,29,.18); outline: none; }
.btn.primary { color: #10231d; background: #fff; }
.btn.secondary { border-color: rgba(255,255,255,.42); color: #fff; background: rgba(255,255,255,.12); }
section { padding: 76px 22px; }
.section-head { max-width: 800px; margin-bottom: 28px; }
.section-head h2 { margin-bottom: 10px; font-size: clamp(31px,5vw,54px); line-height: 1.03; }
.section-head p { color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-button { border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; color: var(--muted); background: var(--panel); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.filter-button:hover, .filter-button:focus-visible, .filter-button.active { border-color: var(--accent); color: #fff; background: var(--accent); outline: none; }
.library-summary { margin: -8px 0 28px; color: var(--muted); font-size: 14px; }
.catalog-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.catalog-card { min-height: 100%; display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 20px; color: inherit; background: var(--panel); box-shadow: 0 10px 28px rgba(23,33,27,.06); text-decoration: none; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.catalog-card:hover, .catalog-card:focus-visible { transform: translateY(-5px); border-color: rgba(15,118,110,.35); box-shadow: var(--shadow); outline: none; }
.catalog-card[hidden] { display: none !important; }
.catalog-thumb { position: relative; min-height: 126px; overflow: hidden; isolation: isolate; border-radius: 9px; background: #111827; }
.catalog-thumb::before, .catalog-thumb::after { content: ''; position: absolute; z-index: 0; }
.catalog-thumb b { position: absolute; z-index: 1; left: 13px; bottom: 11px; color: #fff; font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.tag { justify-self: start; border-radius: 999px; padding: 6px 10px; color: var(--accent-dark); background: #e8f3ef; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.catalog-card h3 { margin-bottom: 6px; font-size: 22px; line-height: 1.18; }
.catalog-card p { margin-bottom: 0; color: var(--muted); }
.open { color: var(--blue); font-weight: 900; }
.note { margin-top: 28px; padding: 18px; border-left: 5px solid var(--gold); border-radius: 8px; color: #5f4b32; background: #fff8ed; }
footer { padding: 26px 22px; color: rgba(255,255,255,.68); background: #0f1714; text-align: center; font-size: 14px; }
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .65s ease, transform .65s ease; }
.js .reveal.is-visible { opacity: 1; transform: translateY(0); }
.no-js .reveal { opacity: 1 !important; transform: none !important; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* Simulation thumbnails */
.thumb-inertia { background: linear-gradient(135deg,#1e3a8a,#0f172a); }
.thumb-inertia::before { width:70px; height:70px; right:28px; top:26px; border-radius:50%; background:#facc15; box-shadow:-74px 16px 0 -22px #38bdf8,-122px 16px 0 -34px #fff; }
.thumb-gravity { background: linear-gradient(135deg,#0f766e,#111827); }
.thumb-gravity::before { width:82px; height:82px; right:24px; top:22px; border-radius:50%; background:#60a5fa; box-shadow:-86px 30px 0 -24px #facc15; }
.thumb-orbit { background: linear-gradient(135deg,#312e81,#020617); }
.thumb-orbit::before { width:112px; height:72px; right:16px; top:28px; border:2px solid rgba(255,255,255,.72); border-radius:50%; transform:rotate(-18deg); }
.thumb-orbit::after { width:22px; height:22px; right:64px; top:54px; border-radius:50%; background:#facc15; box-shadow:42px -18px 0 -6px #93c5fd; }
.thumb-blackhole { background: radial-gradient(circle at 62% 48%,#020617 0 22px,#f97316 23px 30px,#7c2d12 31px 38px,#111827 39px),linear-gradient(135deg,#0f172a,#020617); }
.thumb-machine { background: linear-gradient(135deg,#78350f,#0f172a); }
.thumb-machine::before { width:128px; height:16px; right:20px; top:60px; border-radius:999px; background:#fbbf24; transform:rotate(-18deg); box-shadow:-68px 28px 0 -3px #94a3b8; }
.thumb-wave { background: linear-gradient(135deg,#0e7490,#111827); }
.thumb-wave::before { width:150px; height:54px; right:10px; top:36px; background:repeating-radial-gradient(ellipse at center,transparent 0 10px,rgba(255,255,255,.75) 11px 13px,transparent 14px 22px); }
.thumb-ph { background: linear-gradient(135deg,#155e75,#0f172a); }
.thumb-ph::before { width:54px; height:86px; right:50px; top:20px; border-radius:8px 8px 22px 22px; background:linear-gradient(#fff 0 24%,#22c55e 24% 100%); box-shadow:-62px 20px 0 -8px #f472b6; }
.thumb-titration { background: linear-gradient(135deg,#581c87,#0f172a); }
.thumb-titration::before { width:20px; height:94px; right:72px; top:12px; border-radius:999px; background:#e9d5ff; box-shadow:0 78px 0 22px rgba(216,180,254,.35),-58px 42px 0 -4px #38bdf8; }
.thumb-flame { background: linear-gradient(135deg,#7f1d1d,#111827); }
.thumb-flame::before { width:72px; height:92px; right:44px; top:22px; border-radius:60% 40% 60% 40%; background:linear-gradient(#fef08a,#f97316,#dc2626); transform:rotate(14deg); box-shadow:-70px 24px 0 -26px #22d3ee; }
.thumb-atom { background: linear-gradient(135deg,#1e1b4b,#0f172a); }
.thumb-atom::before { width:112px; height:54px; right:18px; top:38px; border:2px solid #a5b4fc; border-radius:50%; transform:rotate(26deg); }
.thumb-atom::after { width:22px; height:22px; right:64px; top:54px; border-radius:50%; background:#facc15; box-shadow:34px -12px 0 -8px #fff,-38px 14px 0 -8px #fff; }
.thumb-density { background: linear-gradient(135deg,#0f766e,#164e63); }
.thumb-density::before { width:62px; height:72px; right:58px; top:30px; border-radius:10px; background:linear-gradient(#fff 0 16%,#38bdf8 16% 100%); box-shadow:-66px 22px 0 -12px #facc15; }
.thumb-photo { background: linear-gradient(135deg,#166534,#0f172a); }
.thumb-photo::before { width:92px; height:92px; right:24px; top:18px; border-radius:50%; background:#facc15; box-shadow:-78px 42px 0 -28px #22c55e,-108px 18px 0 -34px #86efac; }

/* Game thumbnails */
.thumb-game { background: linear-gradient(145deg,#312e81,#111827); }
.thumb-game::before { width:84px; height:84px; right:30px; top:22px; border-radius:22px; background:#f59e0b; box-shadow:-72px 28px 0 -18px #38bdf8; transform:rotate(12deg); }
.thumb-chess::before { border-radius:50% 50% 18px 18px; background:#f8fafc; box-shadow:-68px 20px 0 -22px #c084fc; }
.thumb-archery::before { width:92px; height:92px; border:10px solid #f8fafc; border-radius:50%; background:#ef4444; box-shadow:inset 0 0 0 18px #fbbf24; transform:none; }
.thumb-code::before { border-radius:16px; background:#22c55e; box-shadow:-72px 28px 0 -18px #facc15; }
.thumb-knight::before { border-radius:50% 50% 20% 20%; background:#cbd5e1; box-shadow:-70px 18px 0 -20px #a78bfa; }
.thumb-memory { background: radial-gradient(circle at 72% 28%,rgba(167,139,250,.72),transparent 26%),linear-gradient(145deg,#312e81,#0f172a); }
.thumb-memory::before { width:92px; height:92px; right:28px; top:20px; border-radius:22px; background:linear-gradient(135deg,#8b5cf6 0 48%,#22d3ee 48% 100%); box-shadow:-76px 28px 0 -20px #facc15; transform:rotate(8deg); }
.thumb-memory-education { background: radial-gradient(circle at 72% 28%,rgba(250,204,21,.68),transparent 25%),linear-gradient(145deg,#0f766e,#0f172a); }
.thumb-memory-education::before { width:94px; height:72px; right:24px; top:30px; border-radius:14px; background:linear-gradient(135deg,#ecfdf5 0 50%,#34d399 50% 100%); box-shadow:-74px 22px 0 -22px #60a5fa; transform:rotate(-4deg); }

/* Tool thumbnails */
.thumb-tool { background: linear-gradient(145deg,#0f766e,#0f172a); }
.thumb-medcalc::before { width:82px; height:82px; right:34px; top:22px; border-radius:18px; background:#e2e8f0; box-shadow:inset 0 0 0 22px #ef4444; }
.thumb-piano { background:linear-gradient(145deg,#111827,#4c1d95); }
.thumb-piano::before { width:142px; height:74px; right:12px; top:30px; background:repeating-linear-gradient(90deg,#fff 0 18px,#111827 19px 25px,#fff 26px 42px); border-radius:6px; }
.thumb-asl { background:linear-gradient(145deg,#0e7490,#111827); }
.thumb-asl::before { width:100px; height:76px; right:28px; top:25px; border:3px solid #67e8f9; border-radius:12px; background:linear-gradient(135deg,transparent 45%,rgba(103,232,249,.35) 46% 54%,transparent 55%); box-shadow:-78px 26px 0 -22px #a78bfa; }

@media (max-width:900px) { .nav { align-items:flex-start; flex-direction:column; } .nav-links { justify-content:flex-start; } .catalog-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) { section { padding:58px 18px; } .hero { min-height:470px; } .hero-inner { padding:70px 18px 82px; } .catalog-grid { grid-template-columns:1fr; } .nav { padding-inline:18px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; scroll-behavior:auto !important; transition-duration:.01ms !important; } .js .reveal { opacity:1; transform:none; } }

.games-page { --accent:#5b21b6; --accent-dark:#4c1d95; --hero-a:rgba(25,12,55,.96); --hero-b:rgba(30,27,75,.68); }
.games-page .tag { background:#f1eafe; }
