@font-face { font-family: 'Bricolage Grotesque'; src: url(_player/fonts/BricolageGrotesque-var.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: Figtree; src: url(_player/fonts/Figtree-var.woff2) format('woff2'); font-weight: 300 900; font-display: swap; }

:root {
  --paper: #FFF8EA; --paper-2: #FFFDF6; --ink: #1F2A44; --muted: #5B6478;
  --lss: #FF6C2F; --chem: #00838A; --bio: #3FA34D; --sun: #FFD23F; --pink: #FF48B0;
  --line: 3px solid var(--ink); --shadow: 6px 6px 0 var(--ink);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font: 17px/1.5 Figtree, system-ui, sans-serif; overflow-x: hidden; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button { font: inherit; color: inherit; }

/* drifting doodles in the background: beakers, atoms, cells as simple shapes */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.sky i { position: absolute; width: 70px; height: 70px; border: 3px solid rgba(31,42,68,.12); border-radius: 50%; animation: drift 22s ease-in-out infinite; }
.sky i:nth-child(1) { left: 6%; top: 18%; } .sky i:nth-child(2) { left: 82%; top: 12%; width: 110px; height: 110px; animation-delay: -4s; }
.sky i:nth-child(3) { left: 70%; top: 70%; border-radius: 30% 70% 60% 40%; animation-delay: -8s; } .sky i:nth-child(4) { left: 12%; top: 76%; width: 50px; height: 50px; animation-delay: -2s; }
.sky i:nth-child(5) { left: 45%; top: 40%; width: 36px; height: 36px; border-color: rgba(255,108,47,.18); animation-delay: -12s; }
.sky i:nth-child(6) { left: 90%; top: 46%; width: 40px; height: 40px; border-color: rgba(0,131,138,.18); animation-delay: -6s; }
.sky i:nth-child(7) { left: 28%; top: 6%; width: 28px; height: 28px; border-color: rgba(63,163,77,.2); } .sky i:nth-child(8) { left: 55%; top: 88%; width: 60px; height: 60px; border-radius: 20%; animation-delay: -16s; }
@keyframes drift { 50% { transform: translate(18px, -24px) rotate(25deg); } }

.hero, main, .foot { position: relative; z-index: 1; }
.hero { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; max-width: 1180px; margin: 0 auto; padding: 22px 16px 8px; }
.home { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.logo { position: relative; width: 52px; height: 52px; border: var(--line); border-radius: 50%; background: var(--sun); box-shadow: 3px 3px 0 var(--ink); }
.logo b { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--ink); animation: orbit 4s linear infinite; left: 16px; top: 16px; }
.logo b:nth-child(1) { background: var(--lss); } .logo b:nth-child(2) { background: var(--chem); animation-delay: -1.33s; } .logo b:nth-child(3) { background: var(--bio); animation-delay: -2.66s; }
@keyframes orbit { from { transform: rotate(0) translateX(17px) rotate(0); } to { transform: rotate(360deg) translateX(17px) rotate(-360deg); } }
.brand { font: 800 clamp(24px, 4vw, 34px)/1 'Bricolage Grotesque', sans-serif; letter-spacing: -.5px; }
.search { flex: 1 1 300px; max-width: 460px; }
.search input { width: 100%; padding: 12px 16px; border: var(--line); border-radius: 999px; background: #fff; font: inherit; box-shadow: 3px 3px 0 var(--ink); outline: none; }
.search input:focus { box-shadow: 3px 3px 0 var(--lss); }

main { max-width: 1180px; margin: 0 auto; padding: 8px 16px 40px; }
h1, h2, h3 { font-family: 'Bricolage Grotesque', sans-serif; line-height: 1.1; margin: 0; }
.intro { margin: 18px 0 22px; }
.intro h1 { font-size: clamp(30px, 5.5vw, 54px); letter-spacing: -1px; }
.intro p { margin: 8px 0 0; color: var(--muted); font-size: 18px; max-width: 640px; }

/* subject worlds */
.worlds { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.world { position: relative; display: flex; flex-direction: column; text-align: left; border: var(--line); border-radius: 22px; background: var(--paper-2); box-shadow: var(--shadow); padding: 0; cursor: pointer; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.world:hover, .world:focus-visible { transform: translate(-3px, -3px) rotate(-.6deg); box-shadow: 10px 10px 0 var(--ink); outline: none; }
.world .band { height: 150px; background: var(--c); position: relative; overflow: hidden; border-bottom: var(--line); }
.world .band img { position: absolute; width: 58%; aspect-ratio: 3 / 2; object-fit: cover; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); }
.world .band img:nth-child(1) { left: 6%; top: 18px; transform: rotate(-5deg); } .world .band img:nth-child(2) { right: 6%; top: 34px; transform: rotate(4deg); }
.world .band .glyph { position: absolute; right: 14px; bottom: -18px; font: 800 120px/1 'Bricolage Grotesque', sans-serif; color: rgba(255,255,255,.35); }
.world .body { padding: 16px 18px 18px; display: grid; gap: 6px; }
.world h2 { font-size: 26px; }
.world p { margin: 0; color: var(--muted); }
.count { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 800; }
.count .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); }

/* topic map: a winding path of stops */
.subject-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 14px 0 6px; }
.back { border: var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 800; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.subject-head h1 { font-size: clamp(28px, 5vw, 46px); }
.subject-head .pill { background: var(--c); color: #fff; border: var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 800; }
.legend { color: var(--muted); margin: 0 0 18px; }
.map { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 34px 18px; padding: 10px 0 20px; }
.map::before { content: ''; position: absolute; inset: 40px 6% 30px; border: 6px dashed rgba(31,42,68,.12); border-radius: 60px; z-index: 0; }
@media (max-width: 860px) { .map { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .map { grid-template-columns: 1fr; } }
.stop { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; border: 0; background: none; cursor: pointer; padding: 0; }
.map .stop:nth-child(8n+5), .map .stop:nth-child(8n+6), .map .stop:nth-child(8n+7), .map .stop:nth-child(8n+8) { order: 0; }
.stop .node { position: relative; width: 132px; height: 132px; border-radius: 50%; border: var(--line); background: #fff; box-shadow: 4px 4px 0 var(--ink); display: grid; place-items: center; overflow: hidden; transition: transform .18s; }
.stop .node img { width: 100%; height: 100%; object-fit: cover; }
.stop .nodewrap { position: relative; }
.stop .num { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); background: var(--ink); color: #fff; font: 800 15px/1 'Bricolage Grotesque', sans-serif; padding: 6px 10px; border-radius: 999px; z-index: 2; }
.stop .label { font: 800 16px/1.2 'Bricolage Grotesque', sans-serif; max-width: 210px; }
.stop .sub { font-size: 13px; color: var(--muted); }
.stop.ready .node { background: var(--c); }
.stop.ready .nodewrap { animation: bob 3.2s ease-in-out infinite; }
.stop.ready:hover .node, .stop.ready:focus-visible .node { transform: scale(1.07) rotate(-3deg); }
.stop.soon { cursor: default; }
.stop.soon .node { border-style: dashed; background: repeating-linear-gradient(45deg, #fff 0 10px, #F4EEE0 10px 20px); box-shadow: none; }
.stop.soon .node span { font: 800 14px/1.1 'Bricolage Grotesque', sans-serif; color: var(--muted); padding: 10px; }
.stop.soon .label { color: var(--muted); }
@keyframes bob { 50% { transform: translateY(-6px); } }
.stop .sticker { position: absolute; right: -8px; bottom: 6px; z-index: 3; background: var(--sun); border: 2.5px solid var(--ink); border-radius: 999px; font: 800 12px/1 'Bricolage Grotesque', sans-serif; padding: 5px 8px; transform: rotate(8deg); }

/* explainer drawer */
.drawer { position: fixed; inset: 0; z-index: 10; display: grid; place-items: end center; background: rgba(31,42,68,.45); animation: fade .2s; }
@media (min-width: 760px) { .drawer { place-items: center; } }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(760px, 100%); max-height: 92vh; overflow: auto; background: var(--paper-2); border: var(--line); border-radius: 24px 24px 0 0; box-shadow: var(--shadow); padding: 18px 18px 24px; animation: up .25s ease-out; }
@media (min-width: 760px) { .sheet { border-radius: 24px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.sheet h2 { font-size: 26px; }
.sheet .close { border: var(--line); background: #fff; border-radius: 50%; width: 40px; height: 40px; font-weight: 800; cursor: pointer; flex: none; }
.card { display: grid; gap: 12px; margin-top: 16px; border: var(--line); border-radius: 18px; background: #fff; overflow: hidden; box-shadow: 4px 4px 0 var(--ink); }
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-bottom: var(--line); display: block; }
.card .in { padding: 4px 16px 16px; display: grid; gap: 10px; }
.card h3 { font-size: 24px; }
.card .hook { margin: 0; font-size: 17px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 800; background: var(--paper); }
.play { display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; background: var(--c); color: #fff; border: var(--line); border-radius: 999px; padding: 12px 20px; font: 800 18px/1 'Bricolage Grotesque', sans-serif; box-shadow: 3px 3px 0 var(--ink); width: fit-content; }
.play:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.play svg { width: 18px; height: 18px; }
details.los { border-top: 2px dashed rgba(31,42,68,.25); padding-top: 8px; }
details.los summary { cursor: pointer; font-weight: 800; }
details.los li { margin: 6px 0; font-size: 15px; }
.tag { font-size: 12px; font-weight: 800; background: #FFE6DA; border-radius: 6px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }
.empty { text-align: center; padding: 24px; color: var(--muted); }

/* search results */
.results { display: grid; gap: 10px; margin-top: 14px; }
.hit { display: flex; gap: 12px; align-items: center; text-align: left; border: var(--line); border-radius: 14px; background: #fff; padding: 10px 14px; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.hit .sw { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); }
.hit b { font-family: 'Bricolage Grotesque', sans-serif; }
.hit small { color: var(--muted); display: block; }
.foot { text-align: center; color: var(--muted); padding: 10px 16px 30px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
