/* Making your Marco. Fonts are self-hosted so the site also runs from a double-clicked index.html. */
@font-face { font-family: Fraunces; src: url(fonts/fraunces-latin-400-normal.woff2); font-weight: 400; font-display: swap; }
@font-face { font-family: Fraunces; src: url(fonts/fraunces-latin-600-normal.woff2); font-weight: 600; font-display: swap; }
@font-face { font-family: Fraunces; src: url(fonts/fraunces-latin-400-italic.woff2); font-style: italic; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url(fonts/dm-mono-latin-400-normal.woff2); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url(fonts/dm-mono-latin-500-normal.woff2); font-weight: 500; font-display: swap; }
@font-face { font-family: Anton; src: url(fonts/anton-latin-400-normal.woff2); font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url(fonts/instrument-serif-latin-400-normal.woff2); font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url(fonts/instrument-serif-latin-400-italic.woff2); font-style: italic; font-display: swap; }
@font-face { font-family: Caveat; src: url(fonts/caveat-latin-600-normal.woff2); font-weight: 600; font-display: swap; }
@font-face { font-family: Unbounded; src: url(fonts/unbounded-latin-700-normal.woff2); font-weight: 700; font-display: swap; }
@font-face { font-family: VT323; src: url(fonts/vt323-latin-400-normal.woff2); font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(fonts/space-grotesk-latin-500-normal.woff2); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(fonts/space-grotesk-latin-700-normal.woff2); font-weight: 700; font-display: swap; }

:root {
  --bg: #0b0a0c;
  --ink: #f2efe9;
  --ink-2: rgba(242, 239, 233, .62);
  --ink-3: rgba(242, 239, 233, .36);
  --line: rgba(242, 239, 233, .14);
  --glass: rgba(24, 22, 26, .72);
  --glass-2: rgba(242, 239, 233, .08);
  --glow: #e8552d;
  --accent: #e8552d;
  --serif: Fraunces, Georgia, serif;
  --mono: 'DM Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme='light'] {
  --bg: #e9e6df;
  --ink: #17151a;
  --ink-2: rgba(23, 21, 26, .66);
  --ink-3: rgba(23, 21, 26, .42);
  --line: rgba(23, 21, 26, .16);
  --glass: rgba(245, 243, 238, .78);
  --glass-2: rgba(23, 21, 26, .07);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--mono); font-size: 13px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
}
#app { position: fixed; inset: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ───────── Shelf ───────── */
.shelf { position: absolute; inset: 0; overflow: hidden; background: var(--bg); transition: background .6s; }
.backdrop { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.shelf__grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-size: 220px 220px;
}
.shelf canvas.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.shelf.is-dragging canvas.gl { cursor: grabbing; }

.top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; z-index: 3; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { font-family: var(--serif); font-size: 19px; letter-spacing: -.01em; }
.brand em { color: var(--ink-2); font-size: 15px; margin-left: 6px; }
.top__right { display: flex; gap: 8px; }
.round {
  height: 36px; min-width: 36px; padding: 0 12px; border-radius: 18px; white-space: nowrap; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--glass-2); border: 1px solid var(--line); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  transition: background .2s, transform .2s var(--ease);
}
.round:hover { background: var(--line); }
.round:active { transform: scale(.95); }

.credit { position: absolute; left: 28px; bottom: 26px; z-index: 3; max-width: min(330px, 70vw); pointer-events: none; }
.credit__n { font-size: 11px; letter-spacing: .14em; color: var(--ink-2); }
.credit__n b { color: var(--ink); font-weight: 500; }
.credit__t { font-family: var(--serif); font-size: clamp(34px, 4.1vw, 58px); line-height: 1.02; letter-spacing: -.025em; margin: 8px 0 8px; font-weight: 400; }
.credit__s { color: var(--ink-2); font-size: 12px; line-height: 1.55; min-height: 3.1em; margin: 0 0 12px; }
.credit__play { pointer-events: auto; border-bottom: 1px solid var(--ink); padding-bottom: 2px; font-size: 12px; letter-spacing: .04em; }
.credit__play:hover { color: var(--accent); border-color: var(--accent); }

.hint { position: absolute; right: 28px; bottom: 28px; z-index: 3; font-size: 10.5px; letter-spacing: .16em; color: var(--ink-3); text-transform: uppercase; pointer-events: none; }
.ticks { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; z-index: 3; }
.ticks button { width: 34px; height: 11px; display: flex; align-items: center; justify-content: flex-end; }
.ticks i { display: block; height: 1.5px; width: 10px; background: var(--ink-3); transition: width .3s var(--ease), background .3s; }
.ticks button:hover i { width: 18px; background: var(--ink-2); }
.ticks button.on i { width: 26px; background: var(--ink); }

.maker { position: absolute; right: 28px; bottom: 52px; z-index: 3; display: flex; align-items: center; gap: 9px; color: var(--ink-2); text-decoration: none; font-size: 10px; letter-spacing: .08em; line-height: 1.35; text-transform: uppercase; transition: transform .25s var(--ease), color .2s; }
.maker img { width: 50px; height: auto; display: block; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); transition: transform .25s var(--ease); }
.maker b { color: var(--ink); font-weight: 500; }
.maker:hover { color: var(--ink); }
.maker:hover img { transform: rotate(-5deg) scale(1.07); }
.cat__foot { display: flex; justify-content: center; padding: 34px 0 6px; }
.cat__foot .maker { position: static; }
.toy__maker { flex: none; display: block; transition: transform .25s var(--ease); }
.toy__maker img { display: block; width: 38px; height: auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }
.toy__maker:hover { transform: rotate(-5deg) scale(1.08); }

.pill {
  position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; padding: 6px 12px; border-radius: 99px;
  background: var(--ink); color: var(--bg); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; transition: opacity .2s; will-change: transform;
}
.pill.on { opacity: 1; }

/* Catalogue: the grid of every release, and the fallback when WebGL is missing. */
.cat { position: absolute; inset: 0; z-index: 6; background: var(--bg); overflow: auto; padding: 84px 28px 40px; opacity: 0; pointer-events: none; transition: opacity .3s; user-select: none; }
.cat.on { opacity: 1; pointer-events: auto; }
.cat__head { position: fixed; left: 0; right: 0; top: 0; padding: 22px 28px; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(var(--bg) 70%, transparent); z-index: 1; }
.cat__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 26px 20px; max-width: 1400px; margin: 0 auto; }
.cat__item { text-align: left; display: block; transition: transform .25s var(--ease); }
.cat__item:hover { transform: translateY(-4px); }
.cat__item canvas { width: 100%; aspect-ratio: 1; display: block; border-radius: 2px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.cat__item b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 400; margin-top: 9px; letter-spacing: -.01em; }
.cat__item span { color: var(--ink-3); font-size: 10.5px; letter-spacing: .1em; }

/* ───────── Toy shell ───────── */
.toy { position: absolute; inset: 0; z-index: 5; background: #0d0c0e; color: #f2efe9; visibility: hidden; --ink: #f2efe9; --ink-2: rgba(242,239,233,.62); --ink-3: rgba(242,239,233,.36); --line: rgba(242,239,233,.14); --glass: rgba(20,18,22,.76); --glass-2: rgba(242,239,233,.09); }
.toy.on { visibility: visible; }
.toy__stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.toy__bar {
  position: absolute; left: 14px; right: 14px; top: 12px; display: flex; align-items: center; gap: 8px; z-index: 4; pointer-events: none;
}
.toy__bar > * { pointer-events: auto; }
.toy__title { display: flex; flex-direction: column; justify-content: center; height: 36px; padding: 0 14px; border-radius: 18px; pointer-events: none; min-width: 0; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.toy__title b { font-family: var(--serif); font-weight: 400; font-size: 18px; letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; }
.toy__title span { font-size: 10px; letter-spacing: .12em; color: var(--ink-2); white-space: nowrap; }
.toy__spacer { flex: 1; pointer-events: none; }
.toy .round { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.toy .round:hover { background: rgba(60, 56, 64, .86); }
.round.primary { background: var(--ink) !important; color: #141216; border-color: transparent; }
.round.primary:hover { background: #fff !important; }
.round svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.dock {
  position: absolute; left: 0; right: 0; bottom: 14px; margin: 0 auto; width: fit-content; z-index: 4;
  display: flex; align-items: center; gap: 14px; padding: 8px 14px; min-height: 52px; max-width: calc(100vw - 20px);
  background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 26px; overflow-x: auto; scrollbar-width: none;
}
.dock::-webkit-scrollbar { display: none; }
.dock:empty { display: none; }
.dock > * { flex: none; }
.dock__sep { width: 1px; height: 24px; background: var(--line); }
.sw { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 18px); gap: 3px 4px; align-items: center; }
.sw button { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .18); transition: transform .15s var(--ease); }
.sw__more { grid-row: span 2; width: 27px; height: 27px; margin-left: 4px; border-radius: 50%; overflow: hidden; cursor: pointer; background: conic-gradient(#ff3d3d, #ffd23d, #3dff7a, #3dd0ff, #6a3dff, #ff3dc8, #ff3d3d); border: 2px solid rgba(255, 255, 255, .25); transition: transform .15s var(--ease); }
.sw__more:hover { transform: scale(1.1); }
.sw__more input { opacity: 0; width: 100%; height: 100%; cursor: pointer; display: block; }
.strip { display: flex; gap: 5px; }
.strip button { border: 2px solid transparent; }
.strip button.on { border-color: #fff; }
.pick { height: 32px; padding: 0 26px 0 12px; border-radius: 16px; border: 0; outline: none; cursor: pointer; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink); background: var(--glass-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23f2efe9' stroke-width='1.3'/%3E%3C/svg%3E") no-repeat right 11px center / 9px; -webkit-appearance: none; appearance: none; }
.pick option { background: #17151a; color: #f2efe9; }
.round.on { background: var(--accent) !important; color: #fff; border-color: transparent; }
.ghost { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; pointer-events: none; opacity: 0; z-index: 2; background: rgba(255, 255, 255, .22); border: 1.5px solid rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 0 14px rgba(255, 255, 255, .45); transition: opacity .3s; }
.sw button:hover { transform: scale(1.14); }
.sw button.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .4); transform: scale(1.14); }
.dock.dense { gap: 9px; }
.dock.dense .seg button { padding: 0 8px; }
.ctl { display: flex; align-items: center; gap: 8px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.ctl input[type=range] { -webkit-appearance: none; appearance: none; width: 92px; height: 20px; background: none; margin: 0; cursor: pointer; }
.ctl input[type=range]::-webkit-slider-runnable-track { height: 3px; background: var(--line); border-radius: 2px; }
.ctl input[type=range]::-moz-range-track { height: 3px; background: var(--line); border-radius: 2px; }
.ctl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; margin-top: -6px; border-radius: 50%; background: #f2efe9; border: 0; }
.ctl input[type=range]::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: #f2efe9; border: 0; }
.seg { display: flex; background: var(--glass-2); border-radius: 15px; padding: 2px; }
.seg button { height: 28px; padding: 0 11px; border-radius: 13px; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: #f2efe9; color: #141216; }
.btn { height: 32px; padding: 0 13px; border-radius: 16px; background: var(--glass-2); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; transition: background .15s, transform .15s var(--ease); }
.btn:hover { background: var(--line); }
.btn:active { transform: scale(.95); }
.btn.on { background: #f2efe9; color: #141216; }
.btn.hot { background: var(--accent); color: #fff; }
.txt { width: 240px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass-2); font-size: 12px; outline: none; user-select: text; -webkit-user-select: text; }
.txt:focus { border-color: var(--ink-2); }
.readout { font-size: 10.5px; letter-spacing: .1em; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.tip {
  position: absolute; left: 50%; top: 68px; transform: translateX(-50%); z-index: 3; padding: 7px 14px; border-radius: 99px;
  background: var(--glass); backdrop-filter: blur(12px); font-size: 11px; letter-spacing: .04em; white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; transition: opacity .5s;
}
.tip.off { opacity: 0; }
.toast {
  position: absolute; left: 50%; bottom: 84px; transform: translate(-50%, 10px); z-index: 7; padding: 9px 16px; border-radius: 99px;
  background: #f2efe9; color: #141216; font-size: 11.5px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* The painted transition between the rack and a toy. */
.wipe { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 9; pointer-events: none; }

/* Bring it to life */
.alive { position: absolute; inset: 0; z-index: 8; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(8, 7, 10, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.alive.on { display: flex; }
.alive__card { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #17151a; border: 1px solid var(--line); border-radius: 18px; padding: 22px; user-select: text; -webkit-user-select: text; }
.alive__card h3 { font-family: var(--serif); font-weight: 400; font-size: 27px; letter-spacing: -.02em; margin: 0 0 6px; }
.alive__card p { color: var(--ink-2); font-size: 12px; line-height: 1.6; margin: 0 0 14px; }
.alive__card code { color: var(--ink); background: var(--glass-2); padding: 1px 5px; border-radius: 4px; }
.alive__card pre { background: #0d0c0e; border-radius: 8px; padding: 10px 12px; font-size: 11.5px; line-height: 1.6; overflow: auto; margin: 0 0 14px; }
.alive__card textarea { width: 100%; min-height: 76px; resize: vertical; background: var(--glass-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; outline: none; margin-bottom: 14px; user-select: text; -webkit-user-select: text; }
.alive__card textarea:focus { border-color: var(--ink-2); }
.alive__card img, .alive__card video { width: 100%; display: block; border-radius: 10px; margin-bottom: 14px; background: #000; }
.alive__row { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.alive__row .note { flex: 1; min-width: 150px; font-size: 10.5px; color: var(--ink-3); line-height: 1.5; }
.alive__dots::after { content: ''; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* A surface is a fitted, centred box of stacked canvases. */
.surface { position: absolute; touch-action: none; cursor: crosshair; }
.surface canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.surface canvas.nohit { pointer-events: none; }
.surface.paper { box-shadow: 0 18px 60px rgba(0, 0, 0, .5); }

@media (max-width: 1060px) {
  .toy__title span { display: none; }
  .toy [data-act=alive] .lbl, .toy [data-act=hang] .lbl { display: none; }
}
@media (max-width: 720px) {
  /* On a phone the stack runs behind the text, so the text gets its own quiet ground. */
  .shelf::after {
    content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(var(--bg) 0, transparent 110px), linear-gradient(transparent calc(100% - 210px), var(--bg) calc(100% - 70px));
  }
  .brand em { display: none; }
  .maker { right: 16px; bottom: 18px; }
  .maker img { width: 42px; }
  .toy__maker { display: none; }
  .top .round { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .toy__title { padding: 0 12px; overflow: hidden; }
  .toy__title b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
  .top { padding: 16px; }
  .credit { left: 16px; bottom: 18px; }
  .credit__s { display: none; }
  .hint { display: none; }
  .ticks { right: 6px; }
  .round .lbl { display: none; }
  .round { padding: 0 10px; }
  .toy__title span { display: none; }
  .dock { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}
