/* The home page: what the site is, for someone who has not signed in. It borrows the
   editor's colors, buttons and windows (app.css) and lays itself out as an ordinary page
   that scrolls, where the editor is a fixed frame. */

body.home { display: block; height: auto; min-height: 100%; overflow: auto; background: #fff; font-size: 15px; line-height: 1.55; }

.home-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 max(20px, calc((100vw - 1120px) / 2)); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-soft); }
.home-top .brand { font-size: 17px; }

.home-btn { padding: 8px 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; }
.home-btn:hover { border-color: var(--accent); color: var(--accent); }
.home-btn.quiet { border-color: transparent; }
.home-btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.home-btn.primary:hover { background: #2548C4; border-color: #2548C4; color: #fff; }
.home-btn.large { padding: 11px 20px; font-size: 15.5px; }

main { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main h1 { margin: 0 0 16px; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; letter-spacing: -.025em; }
main h2 { margin: 0 0 8px; font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -.015em; }
main h3 { margin: 0 0 6px; font-size: 16.5px; }
.lead { max-width: 62ch; margin: 0 0 22px; color: #3C4658; font-size: 17px; }
.note { margin: 14px 0 0; color: var(--muted); font-size: 13.5px; }

.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: 44px; padding: 56px 0 64px; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-shot { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 44px rgba(16, 24, 40, .16); }

.band { padding: 52px 0; border-top: 1px solid var(--line-soft); }

/* The same program at each of the four levels: the tabs are the control the editor has. */
.levels { display: grid; gap: 16px; justify-items: start; }
.level-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.level-tabs button { padding: 7px 15px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.level-tabs button:hover { color: var(--text); }
.level-tabs button.on { background: var(--accent); color: #fff; }
.level-view { width: 100%; margin: 0; }
.level-view img { display: block; width: 100%; max-width: 960px; height: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--ws-bg); }
.level-view figcaption { margin-top: 10px; color: #3C4658; font-size: 15.5px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 22px; }
.card { padding: 18px 18px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--ws-bg); }
.card p { margin: 0; color: #3C4658; }

/* Projects people have shared, each a picture of its stage, its name and who made it. */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.shared { display: grid; gap: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: inherit; text-align: left; text-decoration: none; }
.shared:hover { border-color: var(--accent); box-shadow: 0 8px 22px rgba(16, 24, 40, .12); }
.shared img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--ws-bg); border-bottom: 1px solid var(--line-soft); }
.shared-words { padding: 11px 14px 13px; }
.shared-name { font-weight: 650; font-size: 15.5px; }
.shared-by { color: var(--muted); font-size: 13px; }
.shared-about { margin: 6px 0 0; color: #3C4658; font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- the page that runs one project from the showcase ----------------------------------- */

.home-top a.brand { color: inherit; text-decoration: none; }
a.home-btn { text-decoration: none; }
main.play { max-width: 760px; padding-top: 30px; padding-bottom: 50px; }
main.play h1 { margin-bottom: 4px; font-size: clamp(24px, 3.4vw, 34px); }
.play-by { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.play-stage { position: relative; }
.play-stage canvas { display: block; width: 100%; aspect-ratio: 4 / 3; outline-offset: -2px; }
/* Before it has been run, the stage wears a button: the project as it starts, and the way to start it. */
.play-start { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; background: rgba(16, 24, 40, .28); color: #fff; font-size: 22px; font-weight: 650; }
.play-start span { display: grid; place-items: center; width: 62px; height: 62px; padding-left: 5px; border-radius: 50%; background: var(--go); font-size: 26px; box-shadow: 0 6px 18px rgba(16, 24, 40, .35); }
.play-start:hover { background: rgba(16, 24, 40, .2); }
.play-bar { display: flex; align-items: center; gap: 8px; margin: 12px 0 18px; }
.play-status { margin-left: 6px; color: var(--muted); font-size: 13.5px; }
.play-console { max-height: 180px; margin: 0; padding: 10px 12px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--ws-bg); font: 12.5px/1.5 var(--mono); white-space: pre-wrap; }
.play-console .error { color: var(--danger); }
/* A picture that has not come is a plain panel, not a broken-picture mark. */
.shared img { color: transparent; }

/* ---- looking inside a project shared with a link: view only ------------------------------
   Wider than the column the stage is in, since code runs wide, and centered on it all the
   same. The blocks and the code are the editor's own (app.css); what is here is the frame,
   and whatever says "nothing in here can be moved or typed into". */

.inside { position: relative; left: 50%; width: min(1120px, calc(100vw - 40px)); margin-top: 28px; transform: translateX(-50%); scroll-margin-top: 76px; font-size: 13px; line-height: 1.4; }
.inside-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.inside-head h2 { margin: 0 4px 0 0; font-size: 20px; }
.inside-about { flex: 1 1 200px; min-width: 0; color: var(--muted); }       /* (on a narrow screen it takes a line of its own) */
.inside-only { padding: 2px 10px; border-radius: 999px; background: var(--line-soft); color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.inside-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--ws-bg); }
.inside-tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.inside-tabs .tab { margin-bottom: -1px; }
.inside-panel[data-view="code"] .tab.on { background: #fff; }
.inside-blocks { max-height: min(72vh, 760px); overflow: auto; padding: 18px 22px 30px; }
.inside-blocks .blk, .inside-blocks .blk *, .inside-blocks .body { cursor: default !important; }
.inside-blocks .empty::before { content: none !important; }
.inside-code { background: #fff; }
.inside-code .code-scroll { height: auto; max-height: min(72vh, 760px); }
.inside-code .gutter, .inside-code .hl { padding-bottom: 18px; }
.inside-media { display: grid; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.inside-pictures, .inside-sounds { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.inside-label { min-width: 76px; color: var(--muted); font-size: 12px; font-weight: 650; }
.inside-picture { display: grid; justify-items: center; gap: 2px; width: 72px; margin: 0; }
.inside-picture img { width: 56px; height: 56px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--ws-bg); object-fit: contain; color: transparent; }
.inside-picture figcaption { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }

.home-foot { display: flex; align-items: center; justify-content: space-between; max-width: 1120px; margin: 0 auto; padding: 22px 20px 34px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13.5px; }
.home-foot .link { border: 0; background: none; color: var(--accent); font-size: 13.5px; }

@media (max-width: 860px) {
    .play-bar { flex-wrap: wrap; }
    .hero { grid-template-columns: 1fr; gap: 28px; padding: 34px 0 44px; }
    .band { padding: 38px 0; }
    .home-top .home-btn.quiet { display: none; }
}
