/* ── HyperGrowth ── Monochrome + Signal Blue + Particle Screen ── */
/* Halftone / dither forward; accent = coherent signal (cool, archival) */

:root {
  /* ── Monochrome Palette (cool-neutral ink) ── */
  --bg-0: #050608;
  --bg-1: #0a0c10;
  --bg-2: #0f1218;
  --bg-3: #161a22;
  --surface-0: #0c0e14;
  --surface-1: #12151c;
  --surface-2: #1a1e28;
  --surface-3: #222831;
  --ink: #e8eaf0;
  --ink-secondary: #c8ccd6;
  --ink-soft: #9aa3b0;
  --muted: #6a7382;
  --muted-strong: #8a93a3;

  /* ── Accent: signal blue (single hue, execution / channel / core) ── */
  --accent: #5c9fd8;
  --accent-soft: #8eb8ea;
  --accent-deep: #3d7eb8;
  --accent-glow: rgba(92, 159, 216, 0.34);
  --accent-dim: rgba(92, 159, 216, 0.14);
  --accent-border: rgba(92, 159, 216, 0.42);
  --accent-particle: rgba(130, 188, 245, 0.62);

  /* ── Secondary tones (structure) ── */
  --metal: #a8b0bc;
  --metal-soft: #7a8494;
  --metal-dim: rgba(120, 132, 148, 0.09);

  /* ── Status ── */
  --ok: #6dcda8;
  --warn: #e8b060;
  --danger: #e07070;

  /* ── Particle / halftone system ── */
  --hg-dot-fine: 3px;
  --hg-dot-mid: 6px;
  --hg-dot-coarse: 11px;
  --hg-particle-dot: rgba(255, 255, 255, 0.72);
  --hg-particle-faint: rgba(255, 255, 255, 0.36);
  --hg-screen-line: rgba(200, 210, 230, 0.085);

  /* Pointer-driven screen registration (halftone interaction; set by hg-screen-pointer.js) */
  --hg-pointer-x: 0.5;
  --hg-pointer-y: 0.5;

  /* ── Lines & Borders ── */
  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --line-faint: rgba(255, 255, 255, 0.035);

  /* ── Glass Layers ── */
  --glass-1: rgba(12, 14, 20, 0.62);
  --glass-2: rgba(8, 10, 16, 0.74);
  --glass-3: rgba(4, 6, 12, 0.86);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-blur-sm: 12px;
  --glass-blur-md: 22px;
  --glass-blur-lg: 36px;

  /* ── Shadows ── */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.32);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.42), 0 0 0 1px rgba(255,255,255,0.03);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.52), inset 0 1px 0 rgba(255,255,255,0.03);

  /* ── Border Radius ── */
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --radius-pill: 999px;

  /* ── Typography ── */
  --font-display: "Space Grotesk", "Noto Sans JP", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --font-body: "Space Grotesk", "Noto Sans JP", system-ui, sans-serif;

  /* ── Animation ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 160ms ease;
  --transition-normal: 280ms var(--ease-out);

  /* ── Observation terrain — CLI / TUI readout ── */
  --ot-cli-bg: rgba(5, 7, 10, 0.94);
  --ot-cli-border: rgba(92, 159, 216, 0.11);
  --ot-cli-text: rgba(168, 182, 198, 0.92);
  --ot-cli-dim: rgba(90, 100, 118, 0.88);
  --ot-cli-accent: rgba(142, 184, 234, 0.95);
  --ot-cli-ok: rgba(109, 205, 168, 0.82);
  --ot-cli-grid: rgba(255, 255, 255, 0.028);
}

/* ── Shared Keyframes ── */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes corePulse {
  0%, 100% { opacity: 0.72; }
  50%      { opacity: 1; }
}

@keyframes scanline {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateY(-8px); }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Legacy motion hooks (dashboard / platform; cool-tinted) ── */

@keyframes glowDrift {
  0%   { opacity: 0.42; transform: scale(1) translate(0, 0); }
  33%  { opacity: 0.68; transform: scale(1.06) translate(8px, -6px); }
  66%  { opacity: 0.52; transform: scale(1.02) translate(-4px, 4px); }
  100% { opacity: 0.42; transform: scale(1) translate(0, 0); }
}

@keyframes quillGlow {
  0%, 100% {
    filter: drop-shadow(0 2px 12px rgba(92, 159, 216, 0.22)) drop-shadow(0 0 4px rgba(92, 159, 216, 0.08));
  }
  50% {
    filter: drop-shadow(0 4px 22px rgba(92, 159, 216, 0.38)) drop-shadow(0 0 8px rgba(92, 159, 216, 0.12));
  }
}

@keyframes signalBreathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(92, 159, 216, 0); }
  50%      { box-shadow: 0 0 28px 2px rgba(92, 159, 216, 0.06); }
}

/* ── Observation Terrain: CLI chrome (Console + Dashboard) ── */

.ot-cli {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

.ot-cli-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28em 0.55em;
  padding: 6px 12px 5px 14px;
  font-family: var(--font-mono);
  font-size: clamp(0.52rem, 0.65vw, 0.62rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.03em;
  color: var(--ot-cli-text);
  border-bottom: 1px solid var(--ot-cli-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, transparent 72%);
  flex-shrink: 0;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.ot-cli-glyph {
  color: var(--ot-cli-dim);
  letter-spacing: 0;
  user-select: none;
  opacity: 0.9;
}

.ot-cli-scope {
  color: var(--ot-cli-accent);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.ot-cli-sep {
  color: var(--ot-cli-dim);
  opacity: 0.75;
  user-select: none;
}

.ot-cli-cmd {
  color: var(--ink-secondary);
  letter-spacing: 0.05em;
}

.ot-cli-kv {
  display: inline-flex;
  align-items: baseline;
  gap: 0.06em;
}

.ot-cli-k {
  color: var(--ot-cli-dim);
}

.ot-cli-eq {
  color: var(--ot-cli-dim);
  opacity: 0.55;
}

.ot-cli-v {
  color: var(--ot-cli-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.ot-cli-led {
  margin-left: auto;
  color: var(--ot-cli-ok);
  font-size: 0.5rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(109, 205, 168, 0.28));
}

.ot-cli-dots {
  color: var(--ot-cli-dim);
  opacity: 0.45;
  letter-spacing: 0.25em;
  user-select: none;
}

.ot-cli-ruler {
  display: block;
  padding: 0 12px 3px;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  color: var(--ot-cli-dim);
  opacity: 0.55;
  line-height: 1;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.2);
}

.ot-canvas-host {
  position: relative;
  flex: 1;
  min-height: 18px;
  width: 100%;
}

/* Centered variable ASCII — halftone silhouette as monospace glyph field */
.ot-cli-ascii {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: clamp(0.52rem, 0.95vw, 0.68rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.06em;
  white-space: pre;
  text-align: center;
  color: rgba(198, 224, 210, 0.38);
  text-shadow:
    0 0 18px rgba(92, 159, 216, 0.12),
    0 1px 0 rgba(0, 0, 0, 0.85);
  pointer-events: none;
  user-select: none;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  animation: otAsciiPresence 7s ease-in-out infinite;
}

.ot-cli-ascii code.ot-cli-ascii-inner {
  display: block;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  white-space: pre;
}

@keyframes otAsciiPresence {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.92; filter: brightness(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .ot-cli-led {
    filter: none;
  }

  .ot-cli-ascii {
    animation: none;
    opacity: 0.94;
  }
}
