/* Shared frame for the standalone demo pages (Werkout, Vibey) and the "How Plinko works" page.
   Each demo links ../../fonts/fonts.css and this file, then puts its own UI inside <main class="demo">.
   Same night palette as the rest of the site (css/base.css). */

:root {
  --bg: #121417;
  --bg-raised: #191c20;
  --line: #2b3037;
  --fg: #ecebe6;
  --muted: #a1a6ad;
  --ball: #d9ec6a;    /* muted tennis-ball accent, used sparingly */
  --koi: #f08a5d;     /* muted koi accent */
  --danger: #e8a08f;
  --action: #ecebe6;
  --action-ink: #121417;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 6px; }

.demo-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  padding: 16px clamp(16px, 4vw, 40px);
  background: rgb(18 20 23 / 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  font: 400 14px/1.4 var(--sans);
}
.demo-bar .back { text-decoration: none; color: var(--muted); transition: color 0.18s; }
.demo-bar .back:hover { color: var(--fg); }
.demo-bar .title { font-weight: 500; letter-spacing: -0.01em; }
.demo-bar .tag {
  padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 12px;
}
.demo-bar .spacer { flex: 1; }
.demo-bar .links { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; }
.demo-bar .links a { text-decoration: none; color: var(--muted); transition: color 0.18s; }
.demo-bar .links a:hover { color: var(--fg); text-decoration: underline; }

.demo { padding: clamp(16px, 4vw, 40px); max-width: 1100px; margin: 0 auto; }

.demo-note {
  margin: 0 0 16px; padding: 12px 16px;
  border-radius: 12px; background: var(--bg-raised);
  color: var(--muted); font-size: 13px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--fg);
  font: 400 14px/1 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color 0.18s, background-color 0.18s, transform 0.18s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--action); border-color: var(--action); color: var(--action-ink); font-weight: 500; }
.btn-primary:hover { background: #fffdf6; border-color: #fffdf6; }

.source-page .demo { max-width: 900px; }
.source-page pre {
  overflow: auto; padding: 16px; border-radius: 12px;
  background: #0d0f11; font: 400 12.5px/1.55 var(--mono); tab-size: 2;
}
.source-page h1 { font-weight: 500; letter-spacing: -0.02em; }
.source-page h2 { font: 500 16px/1.4 var(--sans); margin: 32px 0 8px; }

@media (prefers-reduced-motion: reduce) {
  .btn, .demo-bar .back, .demo-bar .links a { transition: none; }
  .btn:active { transform: none; }
}

/* Same soft crossfade as the rest of the site when moving between pages (both sides must opt in). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.42s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; } }
