/* ============================================================================
   NANOCLAUDE PIPES — [F] chrome.css
   Design language: digital-lace.  Genre lock: terminal-session.
   Every colour comes from a CSS custom property that main.js writes onto :root
   from the active palette.  No hex literals except the offline fallbacks in the
   var() second argument.
   Hard rules honoured: zero box-shadow, zero filter/blur, zero gradient,
   border-radius 0 everywhere, hairlines exactly 1px, linear/steps timing only.
   ========================================================================== */

#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  color: var(--ink, #C9CCBE);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  opacity: 1;
  transition: opacity 200ms linear;
}

/* low-specificity reset only: anything with a class must be able to win */
#hud * {
  pointer-events: none;
  box-sizing: border-box;
  border-radius: 0;
}

/* auto-dim after 4 s of no input; instant-ish return on any input.
   Decorative overlay only — any keypress or pointer move restores full ink. */
#hud.nc-dim { opacity: 0.18; }
#hud.nc-off { display: none; }

/* --- registration crosses -------------------------------------------------
   1px hairlines built from pseudo-elements. No images anywhere. */
.nc-reg {
  position: fixed;
  width: 13px;
  height: 13px;
}
.nc-reg::before,
.nc-reg::after {
  content: '';
  position: absolute;
  background: var(--ink, #C9CCBE);
}
.nc-reg::before { left: 0; top: 6px; width: 13px; height: 1px; }
.nc-reg::after  { top: 0; left: 6px; height: 13px; width: 1px; }
.nc-reg-tl { top: 12px;    left: 12px; }
.nc-reg-tr { top: 12px;    right: 12px; }
/* the bottom pair clears the status rail so the hairline never cuts a cross */
.nc-reg-bl { bottom: 31px; left: 12px; }
.nc-reg-br { bottom: 31px; right: 12px; }

/* --- corner clusters ------------------------------------------------------ */
.nc-c { position: fixed; }
.nc-tl { top: 30px;    left: 30px;  max-width: 42ch; }
.nc-tr { top: 30px;    right: 30px; width: 196px; }
.nc-bl { bottom: 54px; left: 30px; }
.nc-br { bottom: 54px; right: 30px; text-align: right; }

/* --- top-left: mono eyebrow + serif title + one emphasis span ------------- */
/* authored already-uppercase: text-transform would mangle the 0xFB token */
.nc-eyebrow {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: none;
  color: var(--ink, #C9CCBE);
}
.nc-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: none;
  font-weight: 400;
  margin: 6px 0 4px;
}
.nc-sub {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  max-width: 34ch;
  margin: 0;
}
/* the surface's ONE loud signal gesture. There is no pixel face offline, so the
   machine-emphasis move is played with the mono face, the signal ink and heavy
   tracking. It is mono-in-signal, not a pixel voice. */
.nc-em {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--signal, #D77757);
}

/* --- top-right: the dense kv cluster -------------------------------------- */
.nc-kvhead {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-align: right;
  padding-bottom: 4px;
}
.nc-kv {
  display: grid;
  grid-template-columns: 1fr auto;
  border-top: 1px solid var(--ink, #C9CCBE);
}
.nc-kv > span {
  font-size: 9px;
  letter-spacing: 0.14em;
  padding: 3px 0;
  border-bottom: 1px solid var(--ghost, #1C211A);
}
.nc-kv > span.nc-v {
  text-align: right;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  padding-left: 10px;
}

/* --- bottom-left: spinner + prompt ---------------------------------------- */
.nc-bl { font-size: 11px; letter-spacing: 0.14em; }
.nc-spin {
  display: inline-block;
  width: 1.4em;
  letter-spacing: 0;
}
.nc-prompt { display: inline-block; }
.nc-cur {
  display: inline-block;
  width: 0.62em;
  animation: nc-blink 1.1s steps(1, end) infinite;
}
@keyframes nc-blink {
  0%   { opacity: 1; }
  50%  { opacity: 0; }
  100% { opacity: 1; }
}

/* --- bottom-right: status chips ------------------------------------------- */
.nc-chip {
  display: inline-block;
  border: 1px solid var(--ink, #C9CCBE);
  padding: 2px 7px;
  margin-left: 8px;
  font-size: 9px;
  letter-spacing: 0.14em;
  white-space: pre;
}
.nc-chip.nc-warn {
  color: var(--signal-2, #6E7A63);
  border-color: var(--signal-2, #6E7A63);
}

/* --- bottom status rail --------------------------------------------------- */
.nc-rail {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 6px 30px 7px;
  border-top: 1px solid var(--ghost, #1C211A);
  font-size: 9px;
  letter-spacing: 0.16em;
  white-space: nowrap;
  overflow: hidden;
  /* the command echo is a real shell line and the checksum is 0xNN — both are
     authored at their true case, so no transform here */
  text-transform: none;
}
.nc-rail > span { font-variant-numeric: tabular-nums; }
.nc-rail-mid { letter-spacing: 0.2em; }

/* --- flash plate: stamp-slam, steps timing, no ease ----------------------- */
.nc-flash {
  position: fixed;
  left: 50%;
  top: 50%;
  display: none;
  padding: 11px 24px 10px;
  background: var(--paper, #0E100C);
  border: 1px solid var(--ink, #C9CCBE);
  color: var(--ink, #C9CCBE);
  font-size: 11px;
  letter-spacing: 0.34em;
  transform: translate(-50%, -50%);
}
.nc-flash.nc-on {
  display: block;
  animation: nc-slam 140ms steps(2, end) 1 both;
}
@keyframes nc-slam {
  0%   { transform: translate(-50%, -50%) scale(1.06); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* --- v3.6(a): the panel-open control --------------------------------------
   The one piece of chrome that is CLICKABLE and that `H` must not take away.
   It lives outside #hud (see index.html) precisely so `#hud.nc-off` cannot
   reach it: hiding the readouts must never strand the user with no way back to
   the controls. It still dims with the HUD's idle timer, via the sibling
   selector below — no JS coupling, one timer, one behaviour.

   Digital-lace, terminal-session: 1px hairline, radius 0, 10px mono caps,
   tracked. No shadow, no gradient, no emoji. Hover INVERTS, instantly —
   inversion is the hover language here, so `transition: none` is load-bearing
   and not an omission. */
#controls {
  position: fixed;
  right: 30px;
  bottom: 84px;              /* clears the [OK] chip row at bottom:54px */
  z-index: 20;
  pointer-events: none;      /* only the button itself takes the pointer */
  text-align: right;
  opacity: 1;
  transition: opacity 200ms linear;
}

/* dims with the chrome, but is never hidden by it */
#hud.nc-dim ~ #controls { opacity: 0.18; }

.nc-ctl {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  box-sizing: border-box;
  margin: 0;
  /* fixed box so CONTROLS -> STOW does not shuffle the corner */
  min-width: 128px;
  padding: 6px 10px 5px;
  border: 1px solid var(--ink, #C9CCBE);
  border-radius: 0;
  background: var(--paper, #0E100C);
  color: var(--ink, #C9CCBE);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  white-space: pre;
  cursor: pointer;
  pointer-events: auto;
  -webkit-font-smoothing: antialiased;
  transition: none;
}

.nc-ctl:hover,
.nc-ctl:focus-visible {
  background: var(--ink, #C9CCBE);
  color: var(--paper, #0E100C);
  outline: none;
}

/* the inversion above IS the focus indicator; a browser ring would be a second,
   softer language on a surface that has none */
.nc-ctl:focus { outline: none; }

/* With the appliance up, the button has to climb above it — it is the stow
   control, so being buried under the thing it stows would be absurd. These
   numbers track --ncp-h in panel.css (232px, 188px on short frames); that
   variable is scoped to #panel and cannot be read from here. */
#controls.nc-above { bottom: 244px; }
@media (max-height: 620px) {
  #controls.nc-above { bottom: 200px; }
}

/* --- tight viewports: keep the centre open, shed the prose ---------------- */
@media (max-width: 720px), (max-height: 520px) {
  .nc-title { font-size: 20px; }
  .nc-sub { display: none; }
  .nc-tr { width: 172px; }
}
