/* ship&test lab: header, home showcase, experiment badge, feedback. Builds on the engine's base.css tokens
   (--bg, --fg, --muted, --line, --card, --accent, --accent-fg, --good) with light and dark variants. */
:root { --lab-radius: 14px; --lab-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
body { -webkit-font-smoothing: antialiased; }

/* --- wordmark */
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-weight: 700; letter-spacing: -.01em; font-size: 1.05rem; }
.logo svg { color: var(--fg); }
.logo b { color: var(--accent); font-weight: 700; }

/* --- lab header (home, about) */
.labhead { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px);
           border-bottom: 1px solid var(--line); }
.labhead .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.labhead nav { display: flex; align-items: center; gap: 18px; }
.labhead nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.labhead nav a:hover { color: var(--fg); }
.fbbtn { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--fg); font: inherit; font-size: .9rem;
         font-weight: 600; cursor: pointer; }
.fbbtn.go { background: var(--accent); color: var(--accent-fg); }
.fbwrap { position: relative; display: inline-flex; }

/* --- home */
main.wrap, .labhead .wrap, .site-footer .wrap { max-width: 1040px; }
.hero { padding: 64px 0 28px; }
.hero .kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--accent); font-weight: 700; margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 16px; }
.hero .lede { font-size: 1.15rem; line-height: 1.6; color: var(--muted); max-width: 640px; margin: 0; }
main h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 44px 0 14px; font-weight: 700; }
.showcase { display: grid; gap: 18px; grid-template-columns: 2fr 1fr; align-items: stretch; }
.xcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--lab-radius); overflow: hidden; display: flex; flex-direction: column; }
.xcard .cover { display: block; aspect-ratio: 16 / 9; background: #05070b; overflow: hidden; }
.xcard .cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.xcard:hover .cover img { transform: scale(1.02); }
.xbody { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.xbody h3 { margin: 2px 0 0; font-size: 1.35rem; letter-spacing: -.01em; }
.xbody h3 a { color: var(--fg); text-decoration: none; }
.xbody p { margin: 0; color: var(--muted); line-height: 1.55; }
.xbody > .tag { align-self: flex-start; }
.xmeta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.xreact { color: var(--muted); font-size: .9rem; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.tag.live { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.tag.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.try { margin-top: auto; align-self: flex-start; padding: 9px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); text-decoration: none; font-weight: 600; }
.ghostbtn { background: transparent; color: var(--fg); border: 1px solid var(--line); font: inherit; font-weight: 600; cursor: pointer; }
.xcard.next { border-style: dashed; background: transparent; align-self: start; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { counter-increment: s; border-top: 2px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.steps li::before { content: "0" counter(s); color: var(--accent); font-weight: 700; font-size: .85rem; }
.steps b { font-size: 1.05rem; }
.steps span { color: var(--muted); line-height: 1.5; }
.ended { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
@media (max-width: 760px) {
  .showcase, .steps { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
  .labhead nav { gap: 12px; } .labhead nav a[href="/#experiments"] { display: none; }
}

/* --- experiment header (no lab header on experiment pages) */
:root { --expbar-h: 44px; }
.expbar { position: fixed; top: 0; left: 0; right: 0; height: var(--expbar-h); z-index: 40; display: flex; align-items: center; justify-content: space-between;
          gap: 10px; padding: 0 14px; background: rgba(6, 9, 14, .82); border-bottom: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(10px);
          color: #e6e8eb; font: 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif; }
.expbar .left, .expbar .right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.expbar .logo, .expbar .logo svg { color: #e6e8eb; font-size: 14.5px; } .expbar .logo b { color: #7aa7ff; }
.expbar .exp { color: #8b95a3; font-size: 12.5px; white-space: nowrap; }
.infowrap { position: relative; display: inline-flex; }
.expbar .aboutbtn { padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: #c8d3e0; font: 600 12px system-ui, sans-serif; cursor: pointer; }
.expbar .aboutbtn:hover { border-color: #7aa7ff; color: #fff; }
@media (max-width: 760px) { .expbar .aboutbtn span { display: none; } }
.expbar .info { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #aab4c3; font: 600 11px system-ui; cursor: pointer; padding: 0; }
.infopop { position: absolute; top: calc(100% + 10px); left: -10px; width: 290px; padding: 12px 14px; border-radius: 12px; background: rgba(12, 14, 20, .97);
           border: 1px solid rgba(255, 255, 255, .12); box-shadow: var(--lab-shadow); color: #c8ced8; font: 13px/1.5 system-ui, sans-serif; z-index: 45; }
.infopop[hidden] { display: none; }
.infopop a { color: #8fb3ff; }
.reacts { display: flex; gap: 2px; padding: 2px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03); }
.reacts .react { width: 30px; height: 28px; border: 0; border-radius: 999px; background: transparent; font-size: 15px; line-height: 1; cursor: pointer; filter: grayscale(.55); opacity: .82;
                 transition: transform .12s ease, filter .12s ease, opacity .12s ease; padding: 0; }
.reacts .react:hover { filter: none; opacity: 1; transform: scale(1.15); }
.reacts .react.on { filter: none; opacity: 1; background: rgba(76, 141, 255, .25); transform: scale(1.08); }
.expbar .fbbtn { background: rgba(76, 141, 255, .14); color: #fff; border-color: #4c8dff; font-size: 12.5px; padding: 6px 12px; white-space: nowrap; }
.expbar .short { display: none; }
.expbar .nudge { right: 0; bottom: auto; top: calc(100% + 12px); }
.expbar .nudge::after { bottom: auto; top: -6px; border-top: 0; border-bottom: 6px solid #4c8dff; border-top-color: transparent; }
@media (max-width: 760px) {
  .expbar { padding: 0 8px; gap: 6px; } .expbar .exp { display: none; } .expbar .logo span { display: none; }
  .reacts .react { width: 26px; } .expbar .long { display: none; } .expbar .short { display: inline; }
}

/* attention: gentle pulse on the feedback pill until opened, one-time nudge bubble */
.fbbtn.attn { animation: fbpulse 2.4s ease-out infinite; }
@keyframes fbpulse { 0% { box-shadow: 0 0 0 0 rgba(76, 141, 255, .7); } 70% { box-shadow: 0 0 0 10px rgba(76, 141, 255, 0); } 100% { box-shadow: 0 0 0 0 transparent; } }
.nudge { position: absolute; right: 0; bottom: calc(100% + 12px); width: 250px; padding: 10px 13px; border-radius: 12px; background: #4c8dff; color: #fff; font: 13px/1.4 system-ui, sans-serif;
         box-shadow: var(--lab-shadow); z-index: 41; cursor: pointer; animation: nudgein .35s ease-out; }
.nudge::after { content: ""; position: absolute; right: 26px; bottom: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #4c8dff; }
.labhead .nudge { bottom: auto; top: calc(100% + 12px); }
.labhead .nudge::after { bottom: auto; top: -6px; border-top: 0; border-bottom: 6px solid #4c8dff; border-top-color: transparent; }
.nudge[hidden] { display: none; }
@keyframes nudgein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fbbtn.attn, .nudge { animation: none; } }

/* --- feedback dialog */
.labfb { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); padding: 16px; }
.labfb[hidden] { display: none; }
.labfb .box { width: min(500px, 100%); background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--lab-shadow); }
.labfb h2 { margin: 0 0 6px; font-size: 1.3rem; text-transform: none; letter-spacing: -.01em; color: var(--fg); }
.labfb textarea { width: 100%; box-sizing: border-box; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font: inherit; }
.labfb .row { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.labfb button[type=submit] { padding: 8px 16px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-fg); font-weight: 600; cursor: pointer; }
.labfb button.ghost { padding: 8px 14px; border-radius: 999px; background: transparent; border: 1px solid var(--line); color: var(--fg); cursor: pointer; }
.labfb .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.labfb .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.labfb .chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font-size: 13px; cursor: pointer; }
.labfb .chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
