/* ============================================================
   BitMidpoint — Cypher Base CSS
   Global design tokens, layout primitives, animations
   ============================================================ */

/* ── Fonts ──────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Surfaces */
  --c-bg:             #0A0A0A;
  --c-surface:        #0F0F0F;
  --c-surface-low:    #111111;
  --c-surface-mid:    #141414;
  --c-surface-high:   #1A1A1A;
  --c-surface-bright: #222222;

  /* Borders */
  --c-outline:        #333333;
  --c-outline-var:    #222222;

  /* Text */
  --c-on-surface:     #F2F2F2;
  --c-on-dim:         #A0A0A0;
  --c-on-muted:       #555555;

  /* Accent — mint/acid-lime */
  --c-primary:        #daff7c;
  --c-primary-dim:    #b0d356;
  --c-on-primary:     #0A0A0A;

  /* Semantic */
  --c-green:          #4ade80;
  --c-red:            #FF5F5F;
  --c-yellow:         #fbbf24;
  --c-teal:           #5EEAD4;

  /* Typography */
  --f-mono:    'JetBrains Mono', monospace;
  --f-body:    'Inter', sans-serif;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms;
  --t-mid:  200ms;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 15px; /* base for em calculations */
}

html.dark body,
body {
  background-color: var(--c-bg);
  background-image: radial-gradient(rgba(218, 255, 124, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--c-on-surface);
  font-family: var(--f-body);
  font-size: 1rem; /* 15px */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* No rounded corners — ever */
* { border-radius: 0 !important; }

/* Selection */
::selection {
  background-color: var(--c-primary);
  color: var(--c-on-primary);
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-primary); }
::-webkit-scrollbar-thumb:hover { background: #fff; }

/* ── Material Icons ─────────────────────────────────────────── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
}
.material-symbols-outlined.fill-1 {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Scanline ───────────────────────────────────────────────── */
.scanline {
  width: 100%;
  height: 100px;
  z-index: 9999;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(218, 255, 124, 0.025) 50%,
    rgba(0, 0, 0, 0) 100%
  );
  position: fixed;
  bottom: 100%;
  left: 0;
  pointer-events: none;
  animation: scanline 10s linear infinite;
}
@keyframes scanline {
  0%   { bottom: 100%; }
  100% { bottom: -100px; }
}

/* ── Typography helpers ─────────────────────────────────────── */
.font-mono { font-family: var(--f-mono); }
.font-body { font-family: var(--f-body); }

.text-primary   { color: var(--c-primary); }
.text-dim       { color: var(--c-on-dim); }
.text-surface   { color: var(--c-on-surface); }
.text-red       { color: var(--c-red); }
.text-green     { color: var(--c-green); }
.text-yellow    { color: var(--c-yellow); }

/* ── Spread color classes ───────────────────────────────────── */
.spread-low  { color: var(--c-green); }
.spread-mid  { color: var(--c-yellow); }
.spread-high { color: var(--c-red); }

/* ── Layout ─────────────────────────────────────────────────── */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-content {
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--sp-8);
}

/* ── Cypher border with corner accent ───────────────────────── */
.cypher-border {
  border: 1px solid var(--c-outline);
  position: relative;
}
.cypher-border-accent {
  border: 1px solid var(--c-primary);
}
.cypher-corner::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 8px; height: 8px;
  border-top: 1px solid var(--c-teal);
  border-left: 1px solid var(--c-teal);
  pointer-events: none;
}

/* ── Status dot ─────────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--c-primary);
  border-radius: 0 !important;
  flex-shrink: 0;
}
.status-dot.pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}
.status-dot.offline { background: var(--c-red); }
.status-dot.warning { background: var(--c-yellow); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Utility: v-cloak ───────────────────────────────────────── */
[v-cloak] { display: none !important; }

/* ── Responsive helpers ─────────────────────────────────────── */
@media (max-width: 640px)  { .hide-sm  { display: none !important; } }
@media (max-width: 768px)  { .hide-md  { display: none !important; } }
@media (max-width: 1024px) { .hide-lg  { display: none !important; } }
