/* ============================================================================
   my-world · shared design tokens
   Every prototype imports this file and uses ONLY these values for colour,
   type and spacing. Deviating is allowed, but note it in the prototype's notes
   so the comparison stays honest.
   ========================================================================== */

:root{
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);

  /* --- surfaces (the world is always night; this is deliberate) --------- */
  --bg:        #0a0c12;
  --bg-2:      #101520;
  --surface:   #131928;
  --surface-2: #182238;
  --line:      #212a40;
  --line-2:    #2d3955;

  /* --- ink -------------------------------------------------------------- */
  --ink:    #e4eaf7;
  --ink-2:  #95a4c4;
  --ink-3:  #74829f;
  --paper:  #f6efdf;

  /* --- accent (cobalt blue; use it sparingly) --------------------------- */
  --brand:      #5580f7;
  --brand-2:    #8baaff;
  --brand-deep: #284cb0;

  /* --- status. NEVER rely on colour alone: pair with shape or motion,
         because several prototypes are judged on a light background too.  */
  --ok:    #4fd08a;
  --warn:  #f0a84a;
  --bad:   #f0554f;
  --idle:  #424d66;

  /* --- data channels (keep consistent across prototypes) ---------------- */
  --kafka-in:  #f3e8d2;   /* a message arriving / consumed */
  --kafka-out: #5580f7;   /* a message leaving / produced  */
  --http:      #5ec8d8;   /* synchronous call              */
  --selfloop:  #f29ad8;   /* produced and consumed by self */

  /* --- type ------------------------------------------------------------- */
  --display: "Bricolage Grotesque", "Archivo", system-ui, sans-serif;
  --body:    "Archivo", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --t-xs: 10.5px;
  --t-sm: 12.5px;
  --t-md: 14px;
  --t-lg: 17px;
  --t-xl: 22px;

  /* --- space (4px base) -------------------------------------------------- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* --- chrome ------------------------------------------------------------ */
  --panel-bg:     color-mix(in srgb, var(--bg-2) 88%, transparent);
  --panel-border: 1px solid var(--line);
  --panel-shadow: 0 10px 30px rgba(0,0,0,.45);
}

:root:not([data-theme="light"]){ color-scheme: dark; }
@media (prefers-color-scheme: light){
  :root:not([data-theme="light"]){ color-scheme: dark; }
}

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

html, body{ height:100%; margin:0; }
body{
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;            /* prototypes are full-bleed canvases */
}

/* --- the panel: every prototype's HUD uses this -------------------------- */
.mw-panel{
  background: var(--panel-bg);
  border: var(--panel-border);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(6px);
}
/* set by instrumentation.js when WebGL runs in software */
.mw-no-gpu .mw-panel{ backdrop-filter: none; }

/* --- shared bars on a phone: camera presets scroll sideways, never wrap --- */
@media (max-width: 760px){
  .mw-cambar{ max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; }
  .mw-cambar button{ flex: 0 0 auto; white-space: nowrap; }
}

.mw-mono{ font-family: var(--mono); }
.mw-label{ font-size: var(--t-xs); color: var(--ink-3); letter-spacing:.06em; }

/* --- focus: keyboard users must always see where they are ---------------- */
:focus-visible{ outline: 2px solid var(--brand); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
