/* Shapelings website. Colours are the game's form hexes; ink 14293A, cream FFF8EE, teal 2AA597 / 136A61. */
@font-face { font-family: "Baloo 2"; src: url("/assets/baloo2.woff2") format("woff2"), url("/assets/baloo2.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #FFF8EE; --surface: #FFFFFF; --surface2: #FCEEDB; --ink: #14293A; --muted: #43576A; --teal: #136A61; --teal2: #2AA597;
  --line: rgba(20, 41, 58, .12); --shadow: 0 10px 30px rgba(20, 41, 58, .10); --focus: #136A61;
  --ball: #FF7A6B; --cube: #FDC747; --spring: #7ED6A5; --magnet: #E5484D; --liquid: #5BC0EB; --balloon: #FF9EC7; --prism: #B79CFF;
  --timber: #D99A4E; --seed: #8BD450; --cog: #6F8FF0; --lantern: #D46BE0; --ice: #A8E6FF; --ghost: #D6C8FF;
  --head: "Baloo 2", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #10202B; --surface: #172C3A; --surface2: #1B3546; --ink: #FFF8EE; --muted: #BACAD5; --teal: #7FDCCF; --teal2: #2AA597;
    --line: rgba(255, 248, 238, .14); --shadow: 0 10px 30px rgba(0, 0, 0, .35); --focus: #7FDCCF; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--body); }
img, svg, canvas { max-width: 100%; }
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--head); font-weight: 400; font-synthesis: none; line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 5vw, 2.9rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 40px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 12px; }
kbd { font: 600 .85em var(--body); background: var(--surface); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px; padding: 0 .4em; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 1.5rem/1 var(--head); }
.brand img { border-radius: 10px; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 10px; font-weight: 600; font-size: .95rem; }
.top nav a:hover { background: var(--surface2); }
@media (max-width: 640px) { .top nav a:not(.keep) { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 14px;
  border: 2px solid var(--ink); background: var(--ink); color: var(--bg); font: 600 1rem var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--surface2); }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: .95rem; background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.small:hover { background: var(--surface2); }
.play-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 22px 8px 18px; border-radius: 16px;
  background: var(--ink); color: var(--bg); text-decoration: none; font: 1.35rem/1.05 var(--head); }
.play-btn svg { width: 26px; height: 26px; flex: none; }
.play-btn small { display: block; font: 600 .72rem/1.2 var(--body); letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.play-btn.soon { background: transparent; color: var(--ink); border: 2px dashed var(--muted); cursor: default; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 22px 0 10px; }
.cta-row.center { justify-content: center; }

/* hero */
.hero { position: relative; overflow: hidden; padding: clamp(28px, 6vw, 72px) 0 clamp(40px, 7vw, 90px);
  background: radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--teal2) 16%, transparent) 0, transparent 45%),
              radial-gradient(circle at 5% 90%, color-mix(in srgb, var(--ball) 14%, transparent) 0, transparent 40%); }
.hero-grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 48px; } }
.eyebrow { font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; margin-bottom: .2em; }
.wordmark { font-size: clamp(3.6rem, 13vw, 7rem); line-height: .95; margin: .12em 0 0; letter-spacing: -.02em; }
.wm-i { position: relative; display: inline-block; }
.wm-i .cube { position: absolute; left: 50%; top: .06em; width: .2em; height: .2em; margin-left: -.08em; border-radius: .05em;
  background: linear-gradient(135deg, #FFE08A, #F2B42E); box-shadow: 0 .03em .05em rgba(20, 41, 58, .25); transform: rotate(14deg); animation: cube-hop 3.2s ease-in-out infinite; }
@keyframes cube-hop { 0%, 70%, 100% { transform: translateY(0) rotate(14deg); } 80% { transform: translateY(-.12em) rotate(-8deg); } 90% { transform: translateY(0) rotate(14deg) scale(1.12, .88); } }
.subtitle { font: clamp(1.6rem, 4.5vw, 2.3rem)/1 var(--head); color: var(--teal); margin: .1em 0 .6em; }
.hook { font: clamp(1.35rem, 3.4vw, 1.75rem)/1.25 var(--head); margin-bottom: .6em; }
.lead { color: var(--muted); max-width: 36em; }
.dots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dots i { width: 18px; height: 18px; border-radius: 6px; display: block; }
.dots i:nth-child(1) { background: var(--ball); border-radius: 50%; } .dots i:nth-child(2) { background: var(--cube); }
.dots i:nth-child(3) { background: var(--spring); } .dots i:nth-child(4) { background: var(--magnet); } .dots i:nth-child(5) { background: var(--liquid); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.dots i:nth-child(6) { background: var(--balloon); border-radius: 50%; } .dots i:nth-child(7) { background: var(--prism); clip-path: polygon(50% 5%, 100% 95%, 0 95%); border-radius: 0; }
.dots i:nth-child(8) { background: var(--timber); } .dots i:nth-child(9) { background: var(--seed); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.dots i:nth-child(10) { background: var(--cog); } .dots i:nth-child(11) { background: var(--lantern); } .dots i:nth-child(12) { background: var(--ice); }
.dots i:nth-child(13) { background: var(--ghost); border-radius: 50% 50% 3px 3px; }

.hero-art { display: flex; flex-direction: column; align-items: center; }
.mark-btn { background: none; border: 0; padding: 0; cursor: pointer; width: min(440px, 70vw); border-radius: 24%; -webkit-tap-highlight-color: transparent; }
.mark-btn svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 22px 34px rgba(20, 41, 58, .22)); }
.mark-tip { margin: 14px 0 0; font: 1.15rem var(--head); color: var(--muted); min-height: 1.6em; }
.mark .orb { transform-box: fill-box; transform-origin: center; animation: orbit 6s ease-in-out infinite; }
.mark .o2 { animation-delay: -1.5s; animation-duration: 7s; }
.mark .o3 { animation-delay: -3s; animation-duration: 6.5s; }
.mark .o4 { animation-name: boing; animation-duration: 2.6s; }
@keyframes orbit { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(6px, -10px) rotate(4deg); } 50% { transform: translate(0, -16px) rotate(0); } 75% { transform: translate(-6px, -8px) rotate(-4deg); } }
@keyframes boing { 0%, 100% { transform: scaleY(1); } 40% { transform: scaleY(.78); } 60% { transform: scaleY(1.12) translateY(-6px); } }
.mark .trail circle { animation: twinkle 2.4s ease-in-out infinite; }
.mark .trail circle:nth-child(2) { animation-delay: -.8s; } .mark .trail circle:nth-child(3) { animation-delay: -1.6s; }
@keyframes twinkle { 50% { opacity: .2; } }
.mark .pip { transform-box: view-box; transform-origin: 256px 424px; animation: breathe 3.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, .975); } }
.mark .eyes { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
@keyframes blink { 0%, 44%, 50%, 100% { transform: scaleY(1); } 47% { transform: scaleY(.08); } }
.mark .body { transform-box: view-box; transform-origin: 256px 300px; opacity: 0; transform: scale(.55) rotate(-12deg);
  transition: opacity .3s ease, transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.mark-btn[data-form="ball"] .b-ball, .mark-btn[data-form="cube"] .b-cube, .mark-btn[data-form="drop"] .b-drop, .mark-btn[data-form="prism"] .b-prism { opacity: 1; transform: none; }
.mark .face { transform-box: view-box; transform-origin: 256px 300px; transition: transform .4s ease; }
.mark-btn[data-form="prism"] .face { transform: translateY(34px) scale(.78); }
.mark-btn[data-form="drop"] .face { transform: translateY(16px) scale(.92); }

/* bands */
.band { padding: clamp(48px, 8vw, 96px) 0; }
.band:nth-of-type(even) { background: var(--surface2); }
.sub { color: var(--muted); max-width: 46em; font-size: 1.05rem; margin-bottom: 28px; }

/* demo */
.demo { --pz-bg: #FFF3E0; --pz-wall: #E7CDA4; --pz-top: #8BD450; --pz-line: rgba(20, 41, 58, .08); --pz-door: #2AA597; --pz-crate: #D99A4E;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: clamp(16px, 3vw, 28px); box-shadow: var(--shadow); max-width: 760px; margin-inline: auto; }
@media (prefers-color-scheme: dark) { .demo { --pz-bg: #1D3747; --pz-wall: #3B5B6D; --pz-top: #2AA597; --pz-line: rgba(255, 255, 255, .06); --pz-door: #2AA597; } }
.pz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pz-head h3 { margin: 0; font-size: 1.5rem; }
.pz-levels { display: flex; gap: 8px; }
.pz-moves { margin: 0 0 0 auto; font-weight: 600; color: var(--muted); }
.pz-moves b { color: var(--ink); font: 1.3rem var(--head); }
.pz-levels button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: 1.2rem var(--head); cursor: pointer; }
.pz-levels button[aria-current="step"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.pz-levels button.done:not([aria-current="step"]) { background: var(--spring); color: #14293A; border-color: var(--spring); }
.pz-goal { color: var(--muted); margin: 8px 0 12px; }
.pz-stage { position: relative; display: flex; justify-content: center; }
.pz-stage canvas { display: block; border-radius: 16px; touch-action: none; cursor: pointer; }
.pz-win { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  background: color-mix(in srgb, var(--surface) 86%, transparent); border-radius: 16px; padding: 16px; animation: pop .35s ease; }
.pz-win[hidden] { display: none; }
.pz-win p { font: 1.3rem/1.25 var(--head); max-width: 26em; margin: 0 0 8px; }
@media (max-width: 560px) { .pz-win { padding: 8px; } .pz-win p { font-size: 1.02rem; margin-bottom: 4px; } .pz-win .btn { min-height: 44px; padding: 6px 16px; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
.pz-status { min-height: 1.6em; margin: 10px 0 6px; font-weight: 600; text-align: center; }
.pz-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.pz-move { display: flex; gap: 10px; }
.pz-arrow { width: 64px; height: 56px; border-radius: 16px; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; display: grid; place-items: center; }
.pz-arrow svg { width: 28px; height: 28px; }
.pz-arrow:active { transform: translateY(2px); }
.pz-forms { display: flex; gap: 10px; }
.form-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 76px; height: 64px; border-radius: 16px; cursor: pointer;
  border: 3px solid transparent; color: #14293A; font: 600 .85rem var(--body); }
.form-btn svg { width: 26px; height: 26px; fill: #14293A; stroke: #14293A; }
.form-btn.f-ball { background: var(--ball); } .form-btn.f-cube { background: var(--cube); } .form-btn.f-spring { background: var(--spring); }
.form-btn[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--surface) inset; }
.form-btn:active { transform: translateY(2px); }
.pz-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pz-hint { margin: 14px auto 0; max-width: 34em; background: var(--surface2); border-radius: 14px; padding: 10px 14px; text-align: center; }
.pz-keys { color: var(--muted); font-size: .9rem; text-align: center; margin: 14px 0 0; }

/* forms */
.forms { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.fcard { --c: var(--ball); display: grid; width: 100%; height: 100%; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; perspective: 900px; text-align: center; font: inherit; }
.fface { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 236px; padding: 16px 12px;
  border-radius: 22px; background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); backface-visibility: hidden; transition: transform .5s cubic-bezier(.3, 1.3, .5, 1); }
.fface.back { transform: rotateY(-180deg); background: color-mix(in srgb, var(--c) 22%, var(--surface)); border-color: var(--c); justify-content: flex-start; text-align: left; align-items: stretch; gap: 8px; }
.fcard[aria-pressed="true"] .front { transform: rotateY(180deg); }
.fcard[aria-pressed="true"] .back { transform: rotateY(0); }
@media (hover: hover) { .fcard:hover .front { transform: rotateY(180deg); } .fcard:hover .back { transform: rotateY(0); } }
.fswatch { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 28px; background: color-mix(in srgb, var(--c) 24%, var(--surface)); margin-bottom: 6px; }
.form-ic { width: 70px; height: 70px; }
.fname { font: 1.55rem/1 var(--head); }
.fworld { color: var(--muted); font-size: .9rem; font-weight: 600; }
.fflip { margin-top: 6px; font-size: .78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 10px; }
.frow { font-size: .92rem; line-height: 1.4; }
.frow b { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fcard:focus-visible { outline: none; }
.fcard:focus-visible .fface { outline: 3px solid var(--focus); outline-offset: 3px; }
.c-ball { --c: var(--ball); } .c-cube { --c: var(--cube); } .c-spring { --c: var(--spring); } .c-magnet { --c: var(--magnet); } .c-liquid { --c: var(--liquid); }
.c-balloon { --c: var(--balloon); } .c-prism { --c: var(--prism); } .c-timber { --c: var(--timber); } .c-seed { --c: var(--seed); } .c-cog { --c: var(--cog); }
.c-lantern { --c: var(--lantern); } .c-ice { --c: var(--ice); } .c-ghost { --c: var(--ghost); }

/* worlds */
.worlds { list-style: none; margin: 0; padding: 8px max(20px, (100% - 1160px) / 2) 24px; display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding-inline: max(20px, (100% - 1160px) / 2); overscroll-behavior-x: contain; }
.worlds:focus-visible { outline-offset: -3px; }
.world { flex: 0 0 min(240px, 68vw); scroll-snap-align: start; }
.shot { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 22px; width: 100%; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow); background: var(--surface); transition: transform .25s ease; }
.shot:hover img { transform: translateY(-4px); }
.wtext { padding: 12px 4px 0; }
.wnum { font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); }
.wtext h3 { margin: 2px 0 4px; }
.wtext p { color: var(--muted); font-size: .95rem; margin: 0; }

/* features */
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
.feat h3 { margin-top: 12px; }
.feat p { color: var(--muted); margin: 0; }
.fi { display: block; width: 44px; height: 44px; border-radius: 14px; }
.fi.f1 { background: var(--ball); border-radius: 50%; } .fi.f2 { background: var(--cube); } .fi.f3 { background: var(--spring); border-radius: 14px 14px 50% 50%; }
.fi.f4 { background: var(--lantern); border-radius: 50%; box-shadow: 0 0 0 7px color-mix(in srgb, var(--lantern) 25%, transparent); }
.fi.f5 { background: var(--liquid); border-radius: 50% 50% 50% 0; transform: rotate(-45deg) scale(.9); } .fi.f6 { background: var(--cog); width: 56px; height: 36px; }
.fi.f7 { background: var(--ghost); border-radius: 50% 50% 10px 10px; } .fi.f8 { background: var(--seed); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; }
.land { margin: 36px auto 0; max-width: 860px; }
.land img { display: block; width: 100%; height: auto; border-radius: 22px; box-shadow: var(--shadow); }
.land figcaption { text-align: center; color: var(--muted); margin-top: 10px; font-size: .95rem; }

/* parents */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.checks li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 18px 18px 62px; }
.checks li::before { content: ""; position: absolute; left: 18px; top: 20px; width: 30px; height: 30px; border-radius: 10px; background: var(--spring); }
.checks li::after { content: ""; position: absolute; left: 28px; top: 26px; width: 8px; height: 14px; border: solid #14293A; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.checks b { display: block; font: 1.2rem/1.2 var(--head); margin-bottom: 4px; }

/* faq */
.faq details, .doc details { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 4px 18px; margin-bottom: 10px; }
.faq summary, .doc summary { cursor: pointer; font: 1.2rem/1.3 var(--head); padding: 12px 0; list-style-position: outside; }
.faq details p, .doc details p { color: var(--muted); }

.final { text-align: center; }
.final .sub { margin-inline: auto; }

/* doc pages */
.doc { max-width: 780px; padding: 40px 0 70px; }
.doc h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); }
.doc h2 { font-size: 1.7rem; margin-top: 1.6em; }
.doc li { margin-bottom: .5em; }
.updated { color: var(--muted); font-size: .95rem; }
.nf { text-align: center; padding: 40px 0; }
.nf img { border-radius: 24%; margin-bottom: 10px; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 30px 0 40px; font-size: .95rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.foot-brand { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.foot-brand strong { color: var(--ink); }
.foot-brand img { border-radius: 10px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot nav a { font-weight: 600; padding: 8px 0; }

/* lightbox */
.lightbox { border: 0; padding: 14px; border-radius: 24px; background: var(--surface); color: var(--ink); max-width: min(94vw, 560px); max-height: 96vh; }
.lightbox::backdrop { background: rgba(8, 18, 26, .78); }
.lightbox figure { margin: 0; }
.lightbox img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(96vh - 130px); margin-inline: auto; border-radius: 16px; aspect-ratio: 9 / 16; }
.lightbox figcaption { text-align: center; font: 1.15rem var(--head); margin: 10px 0 6px; }
.lb-bar { display: flex; justify-content: center; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
