/* The editor's slate and copper (alembic/frontend/src/app.css), at reading sizes. */
:root{--page:#333d4b;--deep:#2b333f;--panel:#3d4857;--raised:#485466;--field:#374252;--text:#f5f1eb;--soft:#d8dbe1;--muted:#a6aeba;
  --faint:#7f8794;--line:rgba(255,255,255,.085);--line-strong:rgba(255,255,255,.14);--accent:#e28a67;--accent-soft:rgba(226,138,103,.18);
  --accent-text:#291914;--ok:#7fe0a0;--shadow:0 18px 48px rgba(8,12,20,.32),0 2px 8px rgba(8,12,20,.16);
  color-scheme:dark;font:16px/1.55 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;font-synthesis:none;color:var(--text);
  background:var(--deep) linear-gradient(180deg,var(--deep),var(--page) 70vh) no-repeat}
*{box-sizing:border-box}body{margin:0;min-height:100vh;overflow-x:hidden}[hidden]{display:none!important}
a{color:var(--accent);text-underline-offset:3px}:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
h1,h2,p{margin:0}

/* Navigation: the name and both pages together, top left. */
header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;min-height:60px;padding:10px 24px;border-bottom:1px solid var(--line)}
nav{display:flex;align-items:center;gap:2px}
nav a{position:relative;padding:6px 11px;border-radius:8px;color:var(--muted);font-size:15px;text-decoration:none;white-space:nowrap;transition:color .15s,background .15s}
nav a:hover{color:var(--text);background:var(--line)}
nav a[aria-current]:not(.home){color:var(--text)}
nav a[aria-current]:not(.home)::after{content:'';position:absolute;left:11px;right:11px;bottom:-11px;height:2px;border-radius:2px;background:var(--accent)}
nav .home{display:flex;align-items:center;gap:9px;margin-right:8px;padding-left:4px;color:var(--text);font-weight:600;letter-spacing:-.01em}
nav .home:hover{background:none}
.mark{width:24px;height:24px;flex:none}

button{font:inherit;font-size:14px;font-weight:600;color:var(--accent-text);background:var(--accent);border:1px solid var(--accent);border-radius:8px;
  padding:8px 16px;cursor:pointer;transition:filter .15s,background .15s}
button:hover:not(:disabled){filter:brightness(1.08)}button:disabled{cursor:default;opacity:.45}
.plain{color:var(--soft);background:transparent;border-color:var(--line-strong);font-weight:500;padding:6px 14px}
.plain:hover:not(:disabled){background:var(--line);filter:none}

main{width:min(100%,1180px);margin:0 auto;padding:44px 24px 72px}
.muted{color:var(--muted)}
#status{margin-top:14px;color:var(--soft);font-size:14px}#status code{user-select:all;padding:2px 6px;border-radius:6px;background:var(--field);word-break:break-all}
.key-form{display:flex;gap:8px;margin-top:12px;max-width:420px}.key-form[hidden]{display:none}.key-form input{flex:1;min-width:0}#status:empty,#downloads:empty{display:none}

/* Page headings on Demos and Marketplace. */
.page-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 16px;padding-bottom:20px;border-bottom:1px solid var(--line)}
.page-head h1{font-size:28px;font-weight:600;letter-spacing:-.02em}
.page-head p{color:var(--muted)}

/* Landing. */
.landing{display:grid;grid-template-columns:minmax(260px,330px) minmax(0,1fr);align-items:center;gap:48px;width:min(100%,1320px);
  min-height:calc(100vh - 61px);padding-block:40px}
.lede h1{font-size:clamp(36px,4.2vw,52px);line-height:1.05;font-weight:600;letter-spacing:-.03em}
.lede h1::before{content:'';display:block;width:36px;height:2px;margin-bottom:22px;border-radius:2px;background:var(--accent)}
.lede p{margin-top:16px;color:var(--soft);font-size:18px;max-width:19em;text-wrap:balance}
#downloads{display:flex;flex-wrap:wrap;gap:10px;margin-top:28px}
#downloads a{padding:9px 16px;border:1px solid var(--line-strong);border-radius:8px;background:var(--panel);color:var(--text);font-size:14px;
  font-weight:500;text-decoration:none}
#downloads a:first-child{color:var(--accent-text);background:var(--accent);border-color:var(--accent);font-weight:600}
#downloads a:hover{filter:brightness(1.08)}

.intro{margin:0;min-width:0;border:1px solid var(--line-strong);border-radius:14px;overflow:hidden;background:#2a323e;
  box-shadow:var(--shadow),0 0 120px -30px rgba(226,138,103,.28)}
.intro svg{display:block;width:100%;height:auto;font-family:inherit}
.intro .grid{fill:none;stroke:#fff;stroke-opacity:.045;stroke-width:1}
.intro .moon{fill:#d8dbe1;fill-opacity:.12;stroke:#d8dbe1;stroke-opacity:.35;stroke-width:1}
.intro .stars{fill:#d8dbe1;opacity:.45}
.intro .f{stroke:#c9cfd8;stroke-opacity:.6;stroke-width:1;stroke-linejoin:round;stroke-dasharray:1 1}
.intro .t{fill:#4f5c6f}.intro .l{fill:#414c5c}.intro .r{fill:#37414f}.intro .back{fill:#4a5669}.intro .roof{fill:#465263}
.intro .glow{fill:#e28a67;opacity:.5}
.intro .gold{fill:url(#i-gold);stroke:#f6c49a;stroke-width:1;stroke-linejoin:round}
.intro .relief{fill:none;stroke:#fbe2c8;stroke-opacity:.7;stroke-width:1;stroke-linejoin:round}
.intro .sparks{fill:#f6c49a}.intro .sparks path{opacity:0}
.intro .select rect{fill:rgba(226,138,103,.06);stroke:#e28a67;stroke-width:1.2;stroke-dasharray:5 4}
.intro .select circle{fill:#3d4857;stroke:#e28a67;stroke-width:1.2}
.intro .wire{fill:none;stroke:#e28a67;stroke-width:1.8;stroke-linecap:round;stroke-dasharray:1 1}
.intro .card .body{fill:#485466;stroke:rgba(255,255,255,.14)}
.intro .card .head{fill:#5e5c66}
.intro .card .port{fill:#485466;stroke:#e28a67;stroke-width:2}
.intro .card .title{font-size:13px;font-weight:600;fill:#f5f1eb;dominant-baseline:middle}
.intro .card .x{stroke:#a6aeba;stroke-width:1.4;stroke-linecap:round}
.intro .card .field{fill:#374252;stroke:#e28a67;stroke-opacity:.55}
.intro .card .typed{font-size:14px;fill:#f5f1eb}
.intro .card .caret{fill:#e28a67;opacity:0}
.intro .card .note{font-size:12.5px;fill:#a6aeba}
.intro .card .send{fill:#e28a67}.intro .card .send-label{font-size:12px;font-weight:600;fill:#291914}
.intro .brew{opacity:0}.intro .brew .glass{fill:none;stroke:#d8dbe1;stroke-width:1.2;stroke-linejoin:round}
.intro .brew .liquid{fill:#e28a67;fill-opacity:.7}.intro .brew .bubble{fill:#fbe2c8;opacity:0}
.intro .done circle{fill:#7fe0a0}
.intro .strip>rect{fill:#3d4857}.intro .strip .rule{stroke:rgba(255,255,255,.085)}
.intro .strip .tab{fill:#333d4b;stroke:rgba(255,255,255,.085)}
.intro .strip text{font-size:12.5px;fill:#d8dbe1}
.intro .tools *{fill:none;stroke:#a6aeba;stroke-width:1.3;stroke-linejoin:round}
.intro .prompt-tool{fill:rgba(226,138,103,.18);stroke:rgba(226,138,103,.5)}.intro .strip .prompt-label{fill:#e28a67;font-weight:600}

/* The intro plays once (about seven seconds) and then rests on its last frame; reduced motion shows that frame at once. */
@media (prefers-reduced-motion:no-preference){
  .intro .grid,.intro .moon,.intro .stars{animation:i-fade 1.6s ease-out both}
  .intro .f{animation:i-draw 1.3s cubic-bezier(.4,0,.2,1) var(--d) both}
  .intro .prompt-tool,.intro .prompt-label{animation:i-fade .4s 1.9s both}
  .intro .select{animation:i-pop .45s cubic-bezier(.2,.8,.2,1) 2.2s both;transform-box:fill-box;transform-origin:center}
  .intro .wire{animation:i-line .6s ease-out 2.7s both}
  .intro .card{animation:i-rise .5s ease-out 2.75s both}
  .intro .typed{animation:i-type 1s steps(17,end) 3.4s both}
  .intro .caret{animation:i-caret 1.4s step-end 3.3s both}
  .intro .send,.intro .send-label{animation:i-press .35s ease-in-out 4.6s both}
  .intro .brew{animation:i-brew 1.6s 4.8s both}
  .intro .brew .bubble{animation:i-bubble .8s ease-in 4.9s 2 both}.intro .brew .b2{animation-delay:5.2s}
  .intro .done{animation:i-fade .4s 6.35s both}
  .intro .glow,.intro .gold,.intro .relief{animation:i-fade 1.1s ease-out 6.3s both}
  .intro .sparks path{animation:i-spark 1.3s ease-out var(--d) both}
}
@keyframes i-fade{from{opacity:0}}
@keyframes i-draw{from{stroke-dashoffset:1;fill-opacity:0}55%{fill-opacity:0}}
@keyframes i-line{from{stroke-dashoffset:1}}
@keyframes i-pop{from{opacity:0;transform:scale(.92)}}
@keyframes i-rise{from{opacity:0;transform:translateY(8px)}}
@keyframes i-type{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes i-caret{0%,20%,40%,60%,80%{opacity:1}10%,30%,50%,70%,90%,100%{opacity:0}}
@keyframes i-press{50%{opacity:.6}}
@keyframes i-brew{0%{opacity:0}12%,88%{opacity:1}100%{opacity:0}}
@keyframes i-bubble{0%{opacity:0;transform:translateY(0)}30%{opacity:1}100%{opacity:0;transform:translateY(-9px)}}
@keyframes i-spark{0%{opacity:0;translate:0 6px}40%{opacity:1}100%{opacity:0;translate:0 -14px}}

/* Demos. */
.live-demos{margin-top:28px}.live-demos h2{font-size:19px;font-weight:600;letter-spacing:-.01em}.live-demos p{margin-top:4px}
#live-demos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:14px}
.live-demo{display:flex;flex-direction:column;padding:0;overflow:hidden;border:1px solid var(--line-strong);border-radius:12px;background:var(--panel);box-shadow:var(--shadow);text-align:left;cursor:pointer}
.live-demo img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;background:var(--field)}
.live-demo span{padding:12px 16px;color:var(--soft);font-size:15px}

#examples{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:14px}
.live-demo.example{position:relative}.live-demo.example span{position:absolute;left:0;right:0;bottom:0;padding:8px 12px;background:#000a;color:#fff;font-size:13px;opacity:0;transition:opacity .08s}
.live-demo.example:hover span,.live-demo.example:focus-visible span{opacity:1}
#demos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;margin-top:28px}
#demos figure{margin:0;overflow:hidden;border:1px solid var(--line-strong);border-radius:12px;background:var(--panel);box-shadow:var(--shadow)}
#demos figure:first-child{grid-column:1/-1}
video{display:block;width:100%;aspect-ratio:16/9;object-fit:contain;background:#11151b}
figcaption{display:flex;align-items:center;gap:10px;padding:12px 16px;border-top:1px solid var(--line);color:var(--soft);font-size:15px}
figcaption::before{content:'';width:7px;height:7px;flex:none;border-radius:50%;background:var(--accent)}

/* Marketplace. */
#bundles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;margin-top:28px}
#bundles>.muted{grid-column:1/-1}
.bundle{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid var(--line-strong);
  border-radius:12px;background:var(--panel);box-shadow:var(--shadow)}
.bundle h2{font-size:17px;font-weight:600;letter-spacing:-.01em}
.thumb{display:block;padding:0;overflow:hidden;border-color:var(--line);border-radius:8px;background:var(--field);cursor:pointer}
.thumb img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover}
.bundle-actions{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:auto}
.price{color:var(--soft);font-size:14px}
figcaption .plain{margin-left:auto;padding:3px 10px;font-size:14px}

/* Shared image/video viewer. */
#viewer[open]{display:flex;flex-direction:column;gap:10px;align-items:stretch;max-width:94vw;max-height:94vh;padding:12px;border:1px solid var(--line-strong);border-radius:12px;background:var(--panel);color:inherit}
#viewer::backdrop{background:rgba(0,0,0,.7)}
#viewer>button{align-self:flex-end}
#viewer>img{display:block;max-width:100%;max-height:calc(94vh - 80px);margin:auto;object-fit:contain}
#viewer>video{width:min(calc(94vw - 26px),1200px);max-width:100%;max-height:calc(94vh - 80px)}

/* Live preview: the real editor fills the dialog; the poster sits under it until it is ready, and stays if it fails. */
#viewer>.preview{display:flex;flex-direction:column;width:min(calc(94vw - 26px),1700px);margin:auto}
#viewer>.preview>a{align-self:flex-end;margin-top:6px}
.stage{position:relative;height:calc(94vh - 92px);overflow:hidden;border-radius:8px;background:var(--field)}
@supports(height:1dvh){.stage{height:calc(94dvh - 92px)}}
.stage>img,.stage>iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.stage>img{object-fit:contain}
.stage>iframe{opacity:0;pointer-events:none}.stage>iframe.on{opacity:1;pointer-events:auto}
/* Loading: the poster and a quiet progress line (a compositor animation: it moves while the engine boots). */
.stage.loading::after{content:"";position:absolute;left:0;bottom:0;width:30%;height:2px;background:var(--accent);opacity:.7;animation:stage-loading 1.4s ease-in-out infinite}
@keyframes stage-loading{from{transform:translateX(-100%)}to{transform:translateX(340%)}}
@media (prefers-reduced-motion:reduce){.stage.loading::after{animation:none;width:100%;opacity:.35}}
/* The marketplace warm-up: the previewed project's editor boots in the dialog, open non-modally and out of sight. */
#viewer.warming{position:fixed;left:-10000px;top:0;margin:0}#viewer.warming>.preview{width:480px}#viewer.warming .stage{height:270px}

@media(max-width:860px){
  .landing{grid-template-columns:minmax(0,1fr);align-content:center;gap:32px;min-height:calc(100svh - 61px);padding-block:32px 48px}
  #demos,#bundles,#live-demos{grid-template-columns:minmax(0,1fr)}#examples{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  header{gap:8px;padding:10px 12px}
  nav a{padding:6px 7px;font-size:14.5px}nav .home{gap:6px;margin-right:0;padding-left:0}.mark{width:20px;height:20px}
  nav a[aria-current]:not(.home)::after{left:7px;right:7px}
  .plain{padding:5px 10px}
  .intro{margin-inline:-8px}
  main{padding:28px 16px 56px}
}
