/* Keeble Weil Builder: light, airy AI-builder look; the plugins themselves render dark or light in their own colours */
:root {
  --bg: #fbf8f5; --ink: #17151f; --muted: #6c6879; --line: #ebe5df; --card: #ffffff; --soft: #f4efea;
  --violet: #7b5cff; --cyan: #2ec5ff; --coral: #ff8a5c; --grad: linear-gradient(100deg, var(--violet), var(--cyan));
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "Geist Mono", ui-monospace, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; } [hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); overflow-x: hidden; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }

/* soft colour glow behind the hero */
.glow { position: absolute; inset: 0 0 auto 0; height: 900px; overflow: hidden; pointer-events: none; z-index: -1; }
.glow i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.glow i:nth-child(1) { width: 620px; height: 520px; left: 50%; top: -160px; margin-left: -520px; background: #ffc6a8; }
.glow i:nth-child(2) { width: 560px; height: 480px; left: 50%; top: -120px; margin-left: -60px; background: #c9b8ff; animation-delay: -6s; }
.glow i:nth-child(3) { width: 480px; height: 420px; left: 50%; top: 120px; margin-left: -260px; background: #a9e6ff; animation-delay: -12s; opacity: .45; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.08); } }

.nav { display: flex; align-items: center; gap: 24px; padding: 18px max(20px, env(safe-area-inset-right)) 18px max(20px, env(safe-area-inset-left)); max-width: 1200px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.brand small { font-weight: 400; color: var(--muted); font-size: 14px; }
.mark { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); box-shadow: inset 0 0 0 6px rgba(255,255,255,.35); }
.nav nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.nav nav a { text-decoration: none; color: var(--muted); } .nav nav a:hover { color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 11px 20px; font-weight: 500; font-size: 15px; text-decoration: none; border: 0; white-space: nowrap; }
.btn.dark { background: var(--ink); color: #fff; } .btn.dark:hover { background: #2a2733; }
.btn.ghost { background: var(--card); border: 1px solid var(--line); }
.btn.grad { background: var(--grad); color: #fff; } .btn.wide { width: 100%; }

main { max-width: 1200px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.hero { text-align: center; padding: 72px 0 24px; display: grid; justify-items: center; gap: 22px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid var(--line); font-size: 14px; color: var(--muted); text-decoration: none; backdrop-filter: blur(6px); }
.eyebrow b { background: var(--ink); color: #fff; font-weight: 500; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; }
h1 { margin: 0; font-weight: 650; font-size: clamp(44px, 8vw, 88px); line-height: .98; letter-spacing: -.045em; }
h1 span { background: linear-gradient(100deg, #ff8a5c, #7b5cff 55%, #2ec5ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { margin: 0; max-width: 620px; color: var(--muted); font-size: 19px; }
.prompt { width: min(760px, 100%); background: var(--card); border-radius: 26px; padding: 14px 14px 12px 20px; box-shadow: 0 1px 0 var(--line), 0 30px 80px -30px rgba(80, 60, 160, .35), 0 0 0 1px var(--line); text-align: left; }
.prompt textarea { width: 100%; border: 0; resize: none; background: none; font-size: 18px; line-height: 1.5; padding: 6px 0; min-height: 60px; }
.prompt textarea:focus { outline: none; }
.prompt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kind { display: flex; gap: 6px; flex-wrap: wrap; }
.kind input { position: absolute; opacity: 0; pointer-events: none; }
.kind span { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 13.5px; cursor: pointer; }
.kind input:checked + span { background: var(--ink); color: #fff; }
.kind input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }
.go { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 8px 24px -8px rgba(123,92,255,.7); }
.go svg { width: 22px; height: 22px; } .go:disabled { opacity: .5; cursor: progress; }
.ideas { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 820px; }
.ideas button { background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 14px; color: var(--muted); }
.ideas button:hover { color: var(--ink); border-color: #d9d0c7; }

/* building + result */
.stage { padding: 30px 0 40px; min-height: 40px; }
.building { max-width: 520px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 28px; display: flex; gap: 22px; align-items: flex-start; box-shadow: 0 20px 60px -30px rgba(80,60,160,.3); }
.spinner { width: 38px; height: 38px; border-radius: 50%; flex: none; background: conic-gradient(from 0deg, var(--violet), var(--cyan), var(--coral), var(--violet)); -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); mask: radial-gradient(circle, transparent 54%, #000 56%); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.building ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.building li { color: #b3adbb; transition: color .3s; } .building li.on { color: var(--ink); font-weight: 500; } .building li.done { color: var(--muted); } .building li.done::after { content: "  ✓"; color: #3cbf8a; }
.result { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.side { display: grid; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.side h2 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.side p { margin: 0; color: var(--muted); }
.tag { justify-self: start; font: 500 11.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--violet); background: #f0ecff; padding: 6px 9px; border-radius: 7px; }
.chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chain span { font-size: 13px; background: var(--soft); border-radius: 8px; padding: 4px 9px; }
.chain i { color: #c4bcb4; font-style: normal; font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row .src { background: var(--soft); border: 1px solid transparent; border-radius: 999px; padding: 6px 12px; font-size: 13.5px; }
.row .src.on { border-color: var(--ink); background: var(--card); }
.play i { width: 0; height: 0; border-left: 10px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.play.on i { width: 10px; height: 10px; border: 0; background: #fff; border-radius: 2px; }
.note { font-size: 13.5px; }

/* the generated plugin */
.plugin { --a: #7b5cff; --b: #2ec5ff; border-radius: 24px; padding: 22px; color: #eef0f7; background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--a) 28%, #12131c), #0d0e15 60%); box-shadow: 0 40px 90px -40px color-mix(in srgb, var(--a) 70%, transparent), 0 0 0 1px rgba(255,255,255,.06) inset; display: grid; gap: 18px; }
.plugin.light { color: #1b1a22; background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--a) 22%, #ffffff), #f3f1ee 65%); box-shadow: 0 40px 90px -40px color-mix(in srgb, var(--a) 60%, transparent), 0 0 0 1px rgba(0,0,0,.06) inset; }
.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pl-name { font-weight: 700; font-size: 26px; letter-spacing: -.02em; line-height: 1; }
.pl-tag { font-size: 13px; opacity: .65; margin-top: 4px; }
.pl-led { width: 10px; height: 10px; border-radius: 50%; background: var(--b); box-shadow: 0 0 12px var(--b); }
.pl-scope { width: 100%; height: 86px; border-radius: 14px; background: rgba(0,0,0,.28); display: block; }
.plugin.light .pl-scope { background: rgba(0,0,0,.06); }
.knobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 16px 10px; }
.knob { display: grid; justify-items: center; gap: 4px; user-select: none; touch-action: none; }
.knob svg { width: 78px; height: 78px; cursor: ns-resize; }
.knob .lbl { font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.knob .val { font: 500 11.5px/1 var(--mono); opacity: .6; }
.pl-keys { display: flex; height: 92px; border-radius: 12px; overflow: hidden; position: relative; }
.pl-keys button { flex: 1; border: 0; border-right: 1px solid rgba(0,0,0,.15); background: #f5f4f1; padding: 0; }
.pl-keys button.on, .pl-keys button:active { background: color-mix(in srgb, var(--b) 45%, #ffffff); }
.pl-keys .blk { position: absolute; top: 0; height: 58%; width: 5.2%; background: #16161d; border-radius: 0 0 5px 5px; border: 0; z-index: 1; }
.pl-keys .blk.on { background: var(--a); }
.pl-foot { display: flex; justify-content: space-between; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; opacity: .55; }

/* sections */
section h2 { font-size: clamp(32px, 5vw, 54px); letter-spacing: -.035em; line-height: 1.02; margin: 0 0 26px; font-weight: 650; }
section h2 span { color: var(--muted); }
.how, .handled { padding: 70px 0 20px; }
.cards { display: grid; gap: 14px; } .cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } .cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards article { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: grid; gap: 8px; align-content: start; }
.cards article b { width: 34px; height: 34px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; font-weight: 600; }
.cards h3 { margin: 0; font-size: 19px; letter-spacing: -.01em; } .cards p { margin: 0; color: var(--muted); font-size: 15px; } .cards em { color: var(--violet); font-style: normal; }
.ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; }
.sell { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; align-items: center; padding: 80px 0 20px; }
.sell p { color: var(--muted); font-size: 18px; margin: 0; }
.proof { background: #121119; color: #eef0f7; border-radius: 24px; padding: 28px; display: grid; gap: 10px; box-shadow: 0 40px 80px -40px rgba(80,60,160,.6); }
.proof .tag { background: rgba(255,255,255,.08); color: #9fd8ff; } .proof h3 { margin: 0; font-size: 28px; letter-spacing: -.02em; } .proof p { color: #a5a8bd; font-size: 15.5px; } .proof a { color: #fff; font-weight: 500; }
.waitlist { text-align: center; padding: 90px 0 70px; display: grid; justify-items: center; gap: 14px; }
.waitlist p { color: var(--muted); margin: 0; font-size: 18px; }
#wl { display: flex; gap: 8px; width: min(520px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px; box-shadow: 0 20px 60px -30px rgba(80,60,160,.35); }
#wl input[type=email] { flex: 1; min-width: 0; border: 0; background: none; padding: 0 14px; font-size: 16px; } #wl input:focus { outline: none; }
.hp { position: absolute; left: -9999px; }
.wl-msg { min-height: 24px; } .wl-msg.good { color: #2f9c6f; } .wl-msg.err { color: #d1495b; }
.foot { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px max(20px, env(safe-area-inset-right)) 34px max(20px, env(safe-area-inset-left)); color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 18px; max-width: min(92vw, 520px); box-shadow: 0 20px 50px rgba(0,0,0,.25); z-index: 20; }

@media (max-width: 960px) { .result, .sell { grid-template-columns: 1fr; } .cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cards.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .nav nav { display: none; } .nav .btn { margin-left: auto; padding: 9px 14px; font-size: 14px; }
  .hero { padding-top: 40px; } .sub { font-size: 17px; }
  .cards.four, .cards.three { grid-template-columns: 1fr; }
  .knob svg { width: 66px; height: 66px; } .plugin { padding: 16px; }
  .prompt textarea { font-size: 16px; }
  .brand small, .pl-foot span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { .glow i, .spinner { animation: none; } html { scroll-behavior: auto; } }

/* workspace: chat + live plugin */
body.ws-mode .hero, body.ws-mode .stage, body.ws-mode .how, body.ws-mode .handled, body.ws-mode .sell { display: none; }
.ws { display: grid; grid-template-columns: minmax(320px, 430px) minmax(0, 1fr); gap: 20px; padding: 6px 0 30px; height: calc(100vh - 92px); min-height: 580px; }
.ws-chat { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px -40px rgba(80,60,160,.35); min-height: 0; }
.ws-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.btn.sm { padding: 7px 13px; font-size: 13.5px; }
.msgs { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.m { max-width: 92%; animation: fadeUp .25s ease both; }
.m.user { align-self: flex-end; background: var(--ink); color: #fff; border-radius: 18px 18px 5px 18px; padding: 10px 14px; font-size: 15px; }
.m.ai { align-self: flex-start; display: grid; gap: 9px; width: 92%; }
.ai-head { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }
.ai-head .mark { width: 20px; height: 20px; border-radius: 6px; }
.live { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.live li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--muted); animation: fadeUp .25s ease both; line-height: 1.35; }
.live li i { width: 15px; height: 15px; border-radius: 50%; flex: none; margin-top: 2px; position: relative; }
.live li.run { color: var(--ink); }
.live li.run i { border: 2px solid #e2dcef; border-top-color: var(--violet); animation: spin .8s linear infinite; }
.live li.ok i { background: #e2f6ec; } .live li.ok i::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #2f9c6f; }
.live li.err { color: #c0392b; } .live li.err i { background: #fde4e4; } .live li.err i::after { content: "!"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.live li b { color: var(--ink); font-weight: 600; }
.live li.meta { font: 500 12px/1.3 var(--mono); letter-spacing: .04em; color: #a39eae; }
.live li.meta i { display: none; }
.reply { margin: 0; background: var(--soft); border-radius: 5px 18px 18px 18px; padding: 11px 14px; font-size: 15px; }
.retry { justify-self: start; }
.composer { border-top: 1px solid var(--line); padding: 10px 10px 10px 14px; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; border: 0; resize: none; background: none; padding: 8px 0; font-size: 15.5px; max-height: 140px; }
.composer textarea:focus { outline: none; }
.composer .go { width: 40px; height: 40px; }
.ws-view { overflow-y: auto; min-height: 0; padding-right: 2px; }
.ws .result { grid-template-columns: 1fr; gap: 16px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } }
@media (max-width: 960px) {
  .ws { grid-template-columns: 1fr; height: auto; }
  .ws-view { order: 1; overflow: visible; } .ws-chat { order: 2; max-height: 75vh; }
}

/* model picker */
.model { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236c6879' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; border-radius: 999px; padding: 7px 28px 7px 12px; font-size: 13.5px; color: var(--ink); margin-left: auto; cursor: pointer; }
.model.sm { margin-left: 0; font-size: 12.5px; padding: 6px 26px 6px 11px; }
.prompt-bar { flex-wrap: wrap; }
/* chat: thinking + live writing */
.think { font-size: 13.5px; color: var(--muted); background: #faf8fc; border: 1px solid #eee9f5; border-radius: 12px; padding: 8px 11px; }
.think summary { cursor: pointer; font-weight: 500; color: #7a6f99; list-style: none; display: flex; align-items: center; gap: 8px; }
.think summary::-webkit-details-marker { display: none; }
.think summary::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); animation: st-pulse 1.2s ease-in-out infinite; flex: none; }
.think.done summary::before { animation: none; background: #c9c0dc; }
.think .tail { margin: 6px 0 0; font-style: italic; white-space: pre-wrap; max-height: 3.9em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.think[open] .tail { max-height: 320px; overflow-y: auto; display: block; }
@keyframes st-pulse { 50% { opacity: .3; transform: scale(.7); } }
.m.ai .ai-head small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.fix { justify-self: start; }
/* the plugin frame */
.ws-view { display: grid; gap: 12px; align-content: start; }
.frame-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.frame-title { display: flex; align-items: center; gap: 10px; font-size: 18px; } .frame-title b { font-weight: 650; letter-spacing: -.01em; }
.frame-tools { display: flex; gap: 6px; }
.frame-tools .btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.frame-wrap { position: relative; border-radius: 22px; overflow: hidden; background: #0c0c12; min-height: 420px; box-shadow: 0 40px 90px -40px rgba(80,60,160,.55), 0 0 0 1px rgba(0,0,0,.06); }
.frame-wrap iframe { display: block; width: 100%; height: 560px; border: 0; background: #0c0c12; }
.frame-empty { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; color: #a7a3b8; text-align: center; padding: 30px; }
.frame-empty p { margin: 0; max-width: 360px; }
.code { background: #0f0f16; color: #d6d8e6; border-radius: 16px; overflow: hidden; }
.code-tabs { display: flex; gap: 2px; padding: 6px; background: #171722; }
.code-tabs button { background: none; border: 0; color: #8f93a8; font: 500 12.5px var(--mono); padding: 6px 10px; border-radius: 8px; }
.code-tabs button.on { background: #262636; color: #fff; }
.code pre { margin: 0; padding: 14px 16px; max-height: 420px; overflow: auto; font: 12px/1.55 var(--mono); white-space: pre; }
