/* Go2 demo page: the same tokens and type as devmello.xyz (see ../../styles.css). */
:root {
  color-scheme: light dark;
  --bg: oklch(0.985 0.004 250);
  --bg-2: oklch(0.955 0.006 250);
  --ink: oklch(0.21 0.012 250);
  --ink-2: oklch(0.44 0.016 250);
  --ink-3: oklch(0.545 0.014 250);
  --rule: oklch(0.88 0.006 250);
  --accent: oklch(0.54 0.19 24);
  --font: "Atkinson Hyperlegible Next", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.18 0.008 250);
    --bg-2: oklch(0.22 0.009 250);
    --ink: oklch(0.93 0.006 250);
    --ink-2: oklch(0.74 0.01 250);
    --ink-3: oklch(0.64 0.01 250);
    --rule: oklch(0.31 0.01 250);
    --accent: oklch(0.72 0.17 26);
  }
}
/* ?scheme=dark|light forces a scheme (used to render the poster frames). */
.scheme-dark {
  --bg: oklch(0.18 0.008 250); --bg-2: oklch(0.22 0.009 250); --ink: oklch(0.93 0.006 250);
  --ink-2: oklch(0.74 0.01 250); --ink-3: oklch(0.64 0.01 250); --rule: oklch(0.31 0.01 250); --accent: oklch(0.72 0.17 26);
}
.scheme-light {
  --bg: oklch(0.985 0.004 250); --bg-2: oklch(0.955 0.006 250); --ink: oklch(0.21 0.012 250);
  --ink-2: oklch(0.44 0.016 250); --ink-3: oklch(0.545 0.014 250); --rule: oklch(0.88 0.006 250); --accent: oklch(0.54 0.19 24);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; text-decoration-color: var(--rule); }
a:hover, a:focus-visible { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page { max-width: 62rem; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 3rem; display: flex; flex-direction: column; gap: 1rem; min-height: 100%; }
.page__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; }
.page__head h1 { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.page__head p { margin: 0; color: var(--ink-2); font-size: 0.9375rem; max-width: 62ch; }
.page__back { font-size: 0.875rem; color: var(--ink-2); }

.demo { display: flex; flex-direction: column; gap: 0.75rem; }
.stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 0.375rem;
  background: var(--bg-2);
  outline-offset: -2px;
}
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.status {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem;
  text-align: center; font-size: 0.9375rem; color: var(--ink-2); pointer-events: none;
}
.status[hidden] { display: none; }
.hint {
  position: absolute; top: 0.625rem; left: 0.75rem; margin: 0;
  font-size: 0.8125rem; color: var(--ink-2); pointer-events: none;
}
.hint kbd { font: 500 0.75rem var(--mono); color: var(--ink); padding: 0.05rem 0.3rem; border: 1px solid var(--rule); border-radius: 0.25rem; background: var(--bg); }
.hint[hidden] { display: none; }
@media (hover: none) and (pointer: coarse) { .hint { display: none; } }

.readouts {
  position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.625rem; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.25rem 1rem;
  font: 500 0.75rem/1.4 var(--mono); font-variant-numeric: tabular-nums; pointer-events: none;
}
.readouts > div { display: flex; gap: 0.5rem; }
.readouts dt { color: var(--ink-3); }
.readouts dd { margin: 0; color: var(--ink); min-width: 6ch; }

.pad {
  position: absolute; right: 0.625rem; bottom: 2.25rem;
  display: grid; grid-template-columns: repeat(3, 2.25rem); grid-auto-rows: 2.25rem; gap: 0.25rem;
}
.pad button {
  border: 1px solid var(--rule); border-radius: 0.375rem; background: color-mix(in oklab, var(--bg) 80%, transparent);
  color: var(--ink); font: 500 0.9rem var(--mono); cursor: pointer; touch-action: none; user-select: none;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease);
}
.pad button:hover, .pad button.is-down { border-color: var(--ink); }
.pad button.is-down { background: var(--ink); color: var(--bg); }
.pad .pad__spacer { visibility: hidden; }

.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; font-size: 0.875rem; color: var(--ink-2); }
.bar p { margin: 0; }
.bar__buttons { display: flex; gap: 0.5rem; }
.btn {
  height: 2.25rem; padding: 0 1rem; border: 1px solid var(--ink); border-radius: 999px; background: transparent;
  color: var(--ink); font: 500 0.875rem var(--font); cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--bg); }
.btn[hidden] { display: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Embedded in the portfolio: only the stage and a slim bar, filling the iframe. */
.embed body { background: var(--bg-2); }
.embed .page { padding: 0; gap: 0; max-width: none; height: 100%; }
.embed .page__head, .embed .page__foot { display: none; }
.embed .demo { height: 100%; gap: 0; }
.embed .stage { flex: 1; aspect-ratio: auto; border-radius: 0; min-height: 0; }
.embed .bar { height: 2.75rem; padding: 0 0.75rem; background: var(--bg); border-top: 1px solid var(--rule); font-size: 0.8125rem; }
.embed .btn { height: 1.875rem; padding: 0 0.75rem; font-size: 0.8125rem; }
@media (max-width: 30rem) { .bar p:not(.bar__keys) { display: none; } }
/* In a small embed the bar keeps only its buttons, so Push and Reset never wrap out of sight. */
@media (max-width: 40rem) { .embed .bar p { display: none; } }
