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

:root {
  /* ── Monochrome Palette (cool-neutral ink) ── */
  --bg-0: #f8fbff;
  --bg-1: #eff4ff;
  --bg-2: #e6eefc;
  --bg-3: #dae5fb;
  --surface-0: rgba(255, 255, 255, 0.84);
  --surface-1: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(243, 247, 255, 0.94);
  --surface-3: rgba(228, 236, 251, 0.98);
  --ink: #1e2f67;
  --ink-secondary: rgba(30, 47, 103, 0.74);
  --ink-soft: rgba(30, 47, 103, 0.6);
  --muted: rgba(56, 79, 139, 0.6);
  --muted-strong: rgba(30, 47, 103, 0.8);

  /* ── Accent: signal blue (single hue, execution / channel / core) ── */
  --accent: #5c9fd8;
  --accent-soft: #2f6fff;
  --accent-deep: #164fd6;
  --accent-glow: rgba(30, 102, 255, 0.22);
  --accent-dim: rgba(30, 102, 255, 0.12);
  --accent-border: rgba(30, 102, 255, 0.24);
  --accent-particle: rgba(30, 102, 255, 0.24);

  /* ── Secondary tones (structure) ── */
  --metal: #9ba8c7;
  --metal-soft: #6e81b0;
  --metal-dim: rgba(120, 132, 148, 0.08);

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

  /* ── Particle / halftone system ── */
  --hg-dot-fine: 3px;
  --hg-dot-mid: 6px;
  --hg-dot-coarse: 11px;
  --hg-particle-dot: rgba(30, 102, 255, 0.18);
  --hg-particle-faint: rgba(30, 102, 255, 0.12);
  --hg-screen-line: rgba(33, 79, 184, 0.08);

  /* 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(33, 79, 184, 0.12);
  --line-soft: rgba(33, 79, 184, 0.08);
  --line-faint: rgba(33, 79, 184, 0.05);

  /* ── Glass Layers ── */
  --glass-1: rgba(255, 255, 255, 0.74);
  --glass-2: rgba(255, 255, 255, 0.82);
  --glass-3: rgba(245, 248, 255, 0.92);
  --glass-border: rgba(33, 79, 184, 0.08);
  --glass-blur-sm: 12px;
  --glass-blur-md: 22px;
  --glass-blur-lg: 36px;

  /* ── Shadows ── */
  --shadow-sm: 0 8px 18px rgba(95, 131, 218, 0.08);
  --shadow-md: 0 14px 36px rgba(95, 131, 218, 0.12), 0 0 0 1px rgba(255,255,255,0.48);
  --shadow-lg: 0 18px 50px rgba(95, 131, 218, 0.14), inset 0 1px 0 rgba(255,255,255,0.58);
  --shadow-float: 0 24px 70px rgba(95, 131, 218, 0.16), 0 0 0 1px rgba(255,255,255,0.55);

  /* ── 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: "Inter", "Space Grotesk", "Noto Sans JP", system-ui, sans-serif;
  
  /* ── Golden Ratio Typography Scale (φ = 1.618) ── */
  --golden-ratio: 1.618;
  --font-scale-xs: 0.618rem;
  --font-scale-sm: 0.75rem;
  --font-scale-base: 1rem;
  --font-scale-lg: 1.618rem;
  --font-scale-xl: 2.618rem;
  --font-scale-2xl: 4.236rem;

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

  /* ── Observation terrain — CLI / TUI readout ── */
  --ot-cli-bg: rgba(247, 250, 255, 0.92);
  --ot-cli-border: rgba(33, 79, 184, 0.12);
  --ot-cli-text: rgba(30, 47, 103, 0.92);
  --ot-cli-dim: rgba(56, 79, 139, 0.72);
  --ot-cli-accent: #1e66ff;
  --ot-cli-ok: rgba(109, 205, 168, 0.82);
  --ot-cli-grid: rgba(30, 102, 255, 0.05);
}

/* ── 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; }
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(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); }
}

@keyframes featherFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-3px) rotate(2deg); }
}

/* ── 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;
  }
}
