/* Hallmark · macrostructure: Immersive Canvas · tone: retro technical · anchor hue: terminal green · pre-emit: P5 H5 E5 S5 R5 V5 · contrast: pass (46-50) · nav: N9 · footer: Ft2 · slop: pass (51-60) · mobile: pass (36, 59, 61-69) */
:root {
  --font-reference: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --color-reference-black: oklch(1.5% 0.006 190);
  --color-reference-white: oklch(98.5% 0.006 95);
  --color-reference-green: oklch(86% 0.29 142);
  --color-reference-yellow: oklch(94% 0.2 102);
  --color-reference-red: oklch(62% 0.25 29);
  --color-reference-screen: oklch(26% 0.025 197);
  --color-reference-border: oklch(56% 0.006 190);
  --color-reference-control-hover: oklch(82% 0.006 95);
  --color-reference-control-active: oklch(58% 0.006 190);
  --space-reference-2xs: 0.25rem;
  --space-reference-xs: 0.5rem;
  --space-reference-sm: 1rem;
  --space-reference-md: 1.5rem;
  --space-reference-lg: 3rem;
  --text-reference-mobile: 0.625rem;
  --text-reference-base: 1rem;
  --rule-reference: 1px solid var(--color-reference-white);
  --rule-reference-dialog: 0.4375rem solid var(--color-reference-white);
  --radius-reference-none: 0;
  --dur-reference-fast: 120ms;
  --dur-reference-enter: 200ms;
  --ease-reference-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-reference-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 20rem;
  height: 100%;
  margin: 0;
  overflow-x: clip;
  overflow-y: clip;
  background: var(--color-reference-black);
  color: var(--color-reference-white);
  font-family: var(--font-reference);
  letter-spacing: 0;
}

button,
a {
  font: inherit;
  letter-spacing: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-reference-yellow);
  outline-offset: 3px;
}

p {
  margin: 0;
  font-size: var(--text-reference-base);
  line-height: 1.25;
}

.reference-experience,
.reference-css,
.reference-webgl,
.reference-overlay,
.bios,
.reference-ui {
  position: fixed;
  inset: 0;
}

.reference-experience {
  isolation: isolate;
  overflow: clip;
  background: var(--color-reference-black);
  touch-action: none;
  transition: background-color 900ms var(--ease-reference-in-out);
}

.reference-experience.is-lamp-bright {
  background: #d3c8b9;
}

.reference-experience[data-builder-theme="warm"] {
  background: #120f0d;
}

.reference-experience[data-builder-theme="graphite"] {
  background: #080a0c;
}

.reference-experience.is-lamp-bright[data-builder-theme="warm"] {
  background: #c7baaa;
}

.reference-experience.is-lamp-bright[data-builder-theme="graphite"] {
  background: #afb5b7;
}

.reference-css {
  z-index: 1;
  pointer-events: auto;
}

.reference-webgl {
  z-index: 2;
  pointer-events: none;
}

.reference-webgl.is-interactive {
  pointer-events: auto;
  cursor: grab;
}

.reference-webgl.is-dragging {
  cursor: grabbing;
}

.reference-overlay {
  z-index: 3;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: soft-light;
}

.reference-css > div,
.reference-webgl canvas,
.reference-overlay canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.monitor-surface {
  position: relative;
  width: 1280px;
  height: 1024px;
  overflow: hidden;
  background: var(--color-reference-screen);
  pointer-events: auto;
}

.monitor-focus-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
}

.monitor-surface.is-focused .monitor-focus-hit {
  pointer-events: none;
}

.monitor-surface iframe {
  position: absolute;
  inset: 30px 34px;
  display: block;
  width: calc(100% - 68px);
  height: calc(100% - 60px);
  padding: 0;
  border: 0;
  box-sizing: border-box;
  background: var(--color-reference-screen);
}

.monitor-surface.is-focused iframe {
  /* Focus changes interaction state only; the desktop must not visually zoom. */
  inset: 30px 34px;
}

.monitor-app-anchor {
  background: transparent;
  pointer-events: none;
}

.monitor-app-portal {
  position: fixed;
  z-index: 1;
  overflow: hidden;
  background: #fff;
  pointer-events: auto;
  touch-action: auto;
}

.monitor-app-portal[hidden] {
  display: none;
}

iframe.monitor-app-frame {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #fff;
}

.monitor-app-fallback[hidden] {
  display: none;
}

.monitor-app-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  padding: 32px;
  background:
    linear-gradient(rgb(255 255 255 / 82%), rgb(244 248 250 / 92%)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgb(27 72 96 / 5%) 3px 4px);
  color: #26343c;
  font-family: "Microsoft YaHei", "Noto Sans SC", sans-serif;
  place-content: center;
  place-items: center;
  text-align: center;
}

.monitor-app-fallback strong {
  margin-top: 14px;
  font-size: 24px;
}

.monitor-app-fallback > span {
  display: grid;
  width: 54px;
  height: 46px;
  border: 3px solid #26343c;
  border-radius: 8px 8px 20px 20px;
  background: linear-gradient(#77858c, #364148);
  color: #fff0a3;
  font: 700 28px/1 Georgia, serif;
  place-items: center;
}

.monitor-app-fallback p {
  max-width: 420px;
  margin: 8px 0 18px;
  color: #5d6b73;
  font-size: 14px;
}

.monitor-app-fallback button {
  min-width: 112px;
  min-height: 34px;
  border: 1px solid #52636c;
  border-radius: 3px;
  background: #edf4f7;
  color: #26343c;
  cursor: pointer;
  font: 700 14px/1 "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

.bios {
  z-index: 20;
  display: flex;
  background: var(--color-reference-black);
  transition: opacity var(--dur-reference-enter) var(--ease-reference-in-out), transform var(--dur-reference-enter) var(--ease-reference-in-out);
}

.bios.is-dismissed {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.1);
}

.bios__readout {
  display: flex;
  width: 100%;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
}

.bios__header,
.bios__footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-reference-lg);
  padding: var(--space-reference-lg);
}

.bios__brand strong,
.bios__launch strong {
  color: var(--color-reference-green);
}

.bios__meta {
  margin-right: auto;
}

.bios__body {
  display: flex;
  width: 100%;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding-inline: var(--space-reference-lg);
}

.bios__spacer {
  height: var(--space-reference-sm);
  flex: 0 0 auto;
}

.bios__resources {
  min-height: 9.5rem;
  padding: var(--space-reference-sm) 0 var(--space-reference-sm) 2rem;
}

.bios__resources p {
  white-space: pre;
}

.bios__loading::after {
  content: "";
  animation: dotty 1s steps(1, end) infinite;
}

.bios__cursor {
  display: inline-block;
  width: 0.8em;
  height: 0.15em;
  flex: 0 0 auto;
  background: var(--color-reference-white);
  animation: blink 650ms step-end infinite;
}

.bios__error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-reference-sm);
}

.bios__dialog {
  display: flex;
  width: min(100%, 34rem);
  flex-direction: column;
  padding: var(--space-reference-md);
  border: var(--rule-reference-dialog);
  border-radius: var(--radius-reference-none);
  background: var(--color-reference-black);
}

.bios__start-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.bios__error strong {
  color: var(--color-reference-red);
}

.reference-ui {
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms var(--ease-reference-out);
}

.reference-ui.is-visible {
  opacity: 1;
}

.lamp-control {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: var(--lamp-hit-size, 88px);
  height: var(--lamp-hit-size, 88px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  touch-action: manipulation;
}

.lamp-control:focus-visible {
  outline: 1px solid rgba(247, 237, 218, 0.72);
  outline-offset: 0.3rem;
  opacity: 0.24;
}

.identity {
  position: absolute;
  top: var(--space-reference-lg);
  left: var(--space-reference-lg);
  display: flex;
  align-items: flex-start;
  flex-direction: column;
}

.identity > p,
.identity__row > p,
.icon-control {
  min-height: 1.75rem;
  padding: var(--space-reference-2xs) var(--space-reference-sm);
  background: var(--color-reference-black);
  color: var(--color-reference-white);
}

.identity > p {
  margin-bottom: var(--space-reference-2xs);
}

.identity__row {
  display: flex;
  gap: var(--space-reference-2xs);
}

.icon-control {
  display: grid;
  width: 2rem;
  min-width: 2rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: var(--radius-reference-none);
  cursor: pointer;
  pointer-events: auto;
}

.icon-control img {
  display: block;
  width: 0.75rem;
  height: 0.75rem;
}

.icon-control:hover img {
  opacity: 0.8;
}

.icon-control:active img {
  opacity: 0.5;
  transform: scale(0.8);
}

.icon-control:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon-control:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.icon-control[aria-pressed="true"] {
  background: var(--color-reference-control-active);
}

.help-prompt {
  position: absolute;
  bottom: var(--space-reference-lg);
  left: 50%;
  display: flex;
  align-items: flex-end;
  gap: var(--space-reference-xs);
  padding: var(--space-reference-2xs) var(--space-reference-sm);
  background: var(--color-reference-black);
  transform: translateX(-50%);
  transition: opacity 500ms var(--ease-reference-out), transform 500ms var(--ease-reference-out);
}

.help-prompt.is-hidden {
  opacity: 0;
  transform: translate(-50%, 0.75rem);
}

video,
audio {
  display: none;
}

[hidden] {
  display: none !important;
}

@keyframes blink {
  0%, 100% { background: transparent; }
  50% { background: var(--color-reference-white); }
}

@keyframes dotty {
  0%, 100% { content: "   "; }
  25% { content: ".  "; }
  50% { content: ".. "; }
  75% { content: "..."; }
}

@keyframes monitor-jitter {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0.35px, -0.25px); }
}

@media (max-width: 48rem) {
  p {
    font-size: var(--text-reference-mobile);
  }

  .bios__header,
  .bios__footer {
    gap: var(--space-reference-sm);
    padding: var(--space-reference-sm);
  }

  .bios__header {
    justify-content: flex-start;
  }

  .bios__meta {
    margin-right: 0;
  }

  .bios__body {
    padding-inline: var(--space-reference-sm);
  }

  .bios__resources {
    min-height: 7rem;
    padding-left: var(--space-reference-sm);
  }

  .bios__dialog {
    padding: var(--space-reference-sm);
  }

  .bios__cursor {
    width: 0.4em;
    height: 0.08em;
  }

  .identity {
    top: var(--space-reference-sm);
    left: var(--space-reference-sm);
  }

  .identity > p,
  .identity__row > p,
  .icon-control {
    min-height: 1.25rem;
    padding-inline: var(--space-reference-xs);
  }

  .icon-control {
    width: 1.5rem;
    min-width: 1.5rem;
  }

  .icon-control img {
    width: 0.5rem;
    height: 0.5rem;
  }

  .help-prompt {
    bottom: var(--space-reference-sm);
    white-space: nowrap;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 50ms !important;
  }
}
