/* ---- Shared theme for the Lab landing page and demo chrome ---- */
:root {
  --bg: #0f1220;
  --bg-2: #141a2e;
  --surface: #1a2036;
  --surface-2: #232b47;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef0f8;
  --muted: #9aa3bf;
  --accent: #7c9cff;
  --accent-2: #b07cff;
  --good: #3ddc84;
  --bad: #ff5d73;
  --warn: #ffcc4d;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.5;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 20% -10%, rgba(124, 156, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(176, 124, 255, 0.14), transparent 60%);
  background-repeat: no-repeat;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
.muted { color: var(--muted); }

.wrap { width: min(1100px, 100% - 2rem); margin-inline: auto; }

/* ---- Buttons ---- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0b0e1a; }
.btn-ghost { background: transparent; border-color: var(--border); }

/* ---- Landing page ---- */
.site-header { padding: clamp(2rem, 6vw, 4rem) 0 1rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.tagline { margin: 0.5rem 0 0; color: var(--muted); font-size: 1.05rem; max-width: 60ch; }
.section-title {
  margin: 1.5rem 0 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-grid {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.demo-card:hover { transform: translateY(-2px); border-color: rgba(124, 156, 255, 0.4); }
.demo-card-link,
.demo-card-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  padding: 1.25rem;
  color: inherit;
  text-decoration: none;
}
.demo-card-icon { font-size: 2.5rem; line-height: 1; }
.demo-card h3 { margin: 0 0 0.25rem; font-size: 1.25rem; }
.demo-card p { margin: 0; color: var(--muted); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0.5rem 0 0; }
.tags li {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
}
.demo-card-cta { margin-top: auto; font-weight: 700; color: var(--accent); }
.demo-card.soon { opacity: 0.6; border-style: dashed; box-shadow: none; }
.demo-card.soon:hover { transform: none; border-color: var(--border); }
.site-footer { padding: 2rem 0 3rem; color: var(--muted); font-size: 0.9rem; }
.site-footer .version { margin: 0.4rem 0 0; font-size: 0.8rem; }
.site-footer .version code { color: var(--text); background: var(--surface-2); padding: 0.05rem 0.4rem; border-radius: 6px; font-size: 0.95em; }
.site-footer .version a { text-decoration: none; }
.site-footer .version a:hover code { background: var(--surface); outline: 1px solid var(--border); }
.site-footer .version .warn { color: var(--warn); }

/* ---- Demo page chrome (shared by demo pages) ---- */
.demo-header { padding: clamp(1.5rem, 5vw, 3rem) 0 1rem; }
.demo-header h1 { margin: 0.25rem 0; font-size: clamp(1.6rem, 5vw, 2.25rem); letter-spacing: -0.02em; }
.demo-kicker { margin: 1rem 0 0; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.back-inline { color: var(--muted); font-weight: 600; text-decoration: none; }
.back-inline:hover { color: var(--text); }
