/* Quantic OS — charcoal and off-white, the two colours of the mark. Everything else is light. */
:root {
  --ink: #0a110f;
  --shell: #16211e;
  --line: rgba(206, 231, 218, 0.14);
  --line-strong: rgba(206, 231, 218, 0.28);
  --pale: #e7f0ea;
  --dim: #9bb0a6;
  --faint: #6b8279;
  --curve: #ffeec8;
  --hash: #a9f0cc;
  --panel: rgba(8, 14, 12, 0.74);
  --radius: 14px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--pale);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

/* ───────────────────────────── the stage ───────────────────────────── */
.stage { position: fixed; inset: 0; z-index: 0; }
.stage canvas { width: 100%; height: 100%; display: block; }
.stage-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(0, 0, 0, 0) 40%, rgba(5, 9, 8, 0.72) 100%),
    linear-gradient(180deg, rgba(5, 9, 8, 0.55) 0%, rgba(5, 9, 8, 0) 26%);
}

/* ───────────────────────────── chrome ──────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px;
  background: linear-gradient(180deg, rgba(6, 11, 10, 0.88), rgba(6, 11, 10, 0));
}
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark svg { width: 34px; height: 28px; color: var(--pale); flex: none; }
.wordmark b {
  font-weight: 700; letter-spacing: 0.16em; font-size: 13px; text-transform: uppercase;
}
.tabs { display: flex; gap: 2px; margin-left: 10px; flex-wrap: wrap; }
.tabs a {
  text-decoration: none; font-size: 12.5px; letter-spacing: 0.06em;
  padding: 7px 12px; border-radius: 9px; color: var(--dim);
  border: 1px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--pale); background: rgba(233, 243, 237, 0.05); }
.tabs a.on { color: var(--ink); background: var(--pale); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--dim); background: rgba(8, 14, 12, 0.6);
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--hash); flex: none; }
.chip.demo i { background: var(--curve); }

.btn {
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--pale); background: var(--pale); color: var(--ink);
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--pale); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--pale); }
.btn.small { padding: 6px 11px; font-size: 12px; }

/* ───────────────────────────── layout ──────────────────────────────── */
.outlet {
  position: relative; z-index: 20;
  padding: 92px 22px 190px;
  max-width: 1120px; margin: 0 auto;
}
/* the screens that are not tools leave the right of the frame to the object */
.outlet.narrow > section { max-width: 620px; }

.panel {
  background: var(--panel);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.panel + .panel { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

h1 { font-size: 40px; line-height: 1.08; margin: 0 0 14px; letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: 19px; margin: 0 0 12px; letter-spacing: -0.01em; font-weight: 600; }
h3 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 10px; font-weight: 500;
}
p { margin: 0 0 12px; color: var(--dim); }
p.lead { font-size: 17px; color: var(--pale); max-width: 60ch; }
.hero { max-width: 760px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-family: var(--mono); font-size: 12.5px; }
.kv dt { color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; font-size: 10.5px; align-self: center; }
.kv dd { margin: 0; color: var(--pale); overflow-wrap: anywhere; }

.stat { font-family: var(--mono); }
.stat b { display: block; font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.stat span { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

input[type="text"], input[type="number"], textarea {
  width: 100%; font-family: var(--mono); font-size: 13px;
  background: rgba(4, 8, 7, 0.68); color: var(--pale);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 13px;
}
input:focus, textarea:focus { outline: none; border-color: var(--hash); }
label { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin: 0 0 6px; }
.field + .field { margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

code, .mono { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.note { font-size: 12.5px; color: var(--faint); }

/* the phase ladder, bottom left */
.ladder {
  position: fixed; left: 22px; bottom: 22px; z-index: 25;
  display: flex; flex-direction: column; gap: 5px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.ladder b { color: var(--faint); font-weight: 500; display: flex; align-items: center; gap: 9px; }
.ladder b::before { content: ""; width: 14px; height: 1px; background: var(--line-strong); }
.ladder b.on { color: var(--pale); }
.ladder b.on::before { background: var(--hash); height: 2px; }
.ladder .ladder-note { max-width: 24ch; text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--faint); margin-top: 6px; line-height: 1.45; }

.steps { counter-reset: s; display: grid; gap: 14px; }
.steps > div { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start; }
.steps > div::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  font-family: var(--mono); font-size: 11px; color: var(--hash); padding-top: 3px;
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  z-index: 60; opacity: 0; pointer-events: none;
  background: var(--pale); color: var(--ink); font-size: 13px; font-weight: 600;
  padding: 11px 18px; border-radius: 10px; transition: opacity 0.2s, transform 0.2s;
  max-width: min(520px, 90vw);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--curve); }

.boot {
  position: fixed; inset: 0; z-index: 90; background: var(--ink);
  display: grid; place-items: center; gap: 18px; align-content: center;
  transition: opacity 0.5s ease;
}
.boot svg { width: 72px; color: var(--pale); }
.boot-txt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.24em; color: var(--faint); text-transform: uppercase; }

@media (max-width: 900px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  h1 { font-size: 29px; }
  .outlet { padding: 124px 16px 128px; }
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 11px 16px 9px; }
  .tabs {
    order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .wordmark b { font-size: 12px; }
  /* the readout keeps one line on a phone: the ladder is a ladder only where there is room */
  .ladder {
    left: 10px; right: 10px; bottom: 10px; flex-direction: row; align-items: center;
    gap: 10px; padding: 9px 12px;
  }
  .ladder b { display: none; }
  .ladder b.on { display: flex; }
  .ladder .ladder-note { margin-top: 0; max-width: none; flex: 1; }
}

/* On a wide screen the interface is a column on the left and the object keeps the right,
   the way a readout sits beside the thing it is reading. */
@media (min-width: 1240px) {
  .outlet { margin-left: 56px; margin-right: auto; max-width: 920px; }
  .ladder { left: auto; right: 28px; }
}
