@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #071220;
  --ink: #f4f8ff;
  --muted: #9fb3ca;
  --line: rgba(143, 181, 224, 0.28);
  --panel: rgba(9, 22, 38, 0.86);
  --ok: #66efd0;
  --bad: #ff8da0;
  --sans: 'Space Grotesk', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 15% 20%, rgba(23, 208, 192, 0.18), transparent 30%),
    radial-gradient(circle at 85% 70%, rgba(255, 169, 77, 0.14), transparent 35%),
    linear-gradient(145deg, #040a14 0%, #0a1a2d 60%, #0e1828 100%);
  min-height: 100vh;
}

.preview-layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px;
  display: grid;
  gap: 14px;
}

.topbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

h1 {
  margin: 0;
  font-size: 1.45rem;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.state-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.84rem;
}

.pill.ok {
  color: var(--ok);
  border-color: rgba(102, 239, 208, 0.6);
}

.pill.bad {
  color: var(--bad);
  border-color: rgba(255, 141, 160, 0.6);
}

.stage-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.stage-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 80px
    ),
    linear-gradient(160deg, #0f2740 0%, #14253a 46%, #1a2233 100%);
}

.stage::before {
  content: 'Browser Program Preview';
  position: absolute;
  left: 10px;
  top: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  font-family: var(--mono);
  z-index: 1;
}

.layer-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.footnote {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footnote a {
  color: #8cf2ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(140, 242, 255, 0.45);
}

@media (max-width: 800px) {
  .topbar,
  .footnote {
    flex-direction: column;
    align-items: flex-start;
  }
}

body.output-mode {
  background: #000;
  overflow: hidden;
}

body.alpha-mode {
  background: transparent;
  overflow: hidden;
}

:is(body.output-mode, body.alpha-mode) .preview-layout {
  width: 1920px;
  height: 1080px;
  margin: 0;
  padding: 0;
  max-width: none;
  min-height: 0;
  display: block;
  gap: 0;
}

:is(html.output-mode, html.alpha-mode),
:is(html.output-mode, html.alpha-mode) body {
  width: 1920px;
  height: 1080px;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

html.output-mode,
html.output-mode body {
  background: #000;
}

html.alpha-mode,
html.alpha-mode body {
  background: transparent;
}

:is(body.output-mode, body.alpha-mode) .preview-layout > :not(.stage-wrap) {
  display: none !important;
}

:is(body.output-mode, body.alpha-mode) .stage-wrap > :not(.stage) {
  display: none !important;
}

:is(body.output-mode, body.alpha-mode) .topbar,
:is(body.output-mode, body.alpha-mode) .footnote,
:is(body.output-mode, body.alpha-mode) .stage-label {
  display: none;
}

:is(body.output-mode, body.alpha-mode) .stage-wrap {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  width: 1920px;
  height: 1080px;
}

:is(body.output-mode, body.alpha-mode) .stage {
  width: 1920px;
  height: 1080px;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  margin: 0;
  background: transparent !important;
}

:is(body.output-mode, body.alpha-mode) .stage::before {
  display: none;
}
