/* ==========================================================
   CODE 8 NETWORK — core design system
   ========================================================== */
:root {
  --bg: #05060a;
  --bg-2: #0a0c14;
  --surface: #0e111c;
  --surface-2: #141828;
  --line: rgba(120, 200, 255, 0.12);
  --line-strong: rgba(0, 240, 255, 0.35);
  --text: #e6ecf5;
  --text-dim: #8a94ab;
  --text-faint: #566079;
  --cyan: #00f0ff;
  --cyan-dim: rgba(0, 240, 255, 0.14);
  --magenta: #ff2bd6;
  --magenta-dim: rgba(255, 43, 214, 0.14);
  --lime: #b8ff3c;
  --amber: #ffb547;
  --red: #ff4d6d;

  --font-display: 'Chakra Petch', 'Segoe UI', sans-serif;
  --font-body: 'Satoshi', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.15vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.5vw, 3.5rem);
  --text-hero: clamp(2.75rem, 1rem + 7vw, 7.5rem);

  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem; --space-16: 4rem; --space-24: 6rem;

  --radius: 4px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --wrap: 1240px;
  --clip: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.05; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
::selection { background: var(--magenta); color: #000; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* scanline + noise overlay */
.fx-scan {
  pointer-events: none; position: fixed; inset: 0; z-index: 90;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.fx-vignette {
  pointer-events: none; position: fixed; inset: 0; z-index: 89;
  background: radial-gradient(120% 80% at 50% 40%, transparent 55%, rgba(0,0,0,.6) 100%);
}

/* ---------- buttons ---------- */
.btn {
  --c: var(--cyan);
  position: relative; display: inline-flex; align-items: center; gap: .6rem;
  padding: .9rem 1.4rem; font-family: var(--font-mono); font-size: var(--text-sm);
  letter-spacing: .08em; text-transform: uppercase;
  color: #000; background: var(--c);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}
.btn:hover { transform: translateY(-2px); background: #fff; }
.btn--ghost { color: var(--c); background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); clip-path: none; }
.btn--ghost:hover { background: var(--cyan-dim); color: #fff; }
.btn svg { width: 16px; height: 16px; }

.tag {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase;
  color: var(--cyan);
}
.tag::before { content: ''; width: 6px; height: 6px; background: currentColor; box-shadow: 0 0 10px currentColor; }

/* glitch text */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
}
.glitch::before { color: var(--magenta); transform: translate(2px, 0); clip-path: inset(0 0 60% 0); animation: gl1 3.2s infinite steps(1); opacity: .8; }
.glitch::after  { color: var(--cyan);    transform: translate(-2px, 0); clip-path: inset(55% 0 0 0); animation: gl2 2.7s infinite steps(1); opacity: .8; }
@keyframes gl1 { 0%,92%,100% { transform: translate(0); clip-path: inset(0 0 100% 0); } 93% { transform: translate(4px,-2px); clip-path: inset(10% 0 60% 0);} 96% { transform: translate(-3px,1px); clip-path: inset(40% 0 30% 0);} }
@keyframes gl2 { 0%,88%,100% { transform: translate(0); clip-path: inset(100% 0 0 0); } 89% { transform: translate(-4px,2px); clip-path: inset(60% 0 10% 0);} 94% { transform: translate(3px,-1px); clip-path: inset(20% 0 55% 0);} }

/* reveal */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* C8N cybernetic scrollbars — native scrolling, themed tracks and cyan grip. */
* { scrollbar-color: #278b9d #0a0c14; scrollbar-width: thin; }
@supports selector(::-webkit-scrollbar) {
  * { scrollbar-color: auto; scrollbar-width: auto; }
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-track { background: #0a0c14; border-left: 1px solid #172332; }
  ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #00d9e8, #28748c); border: 2px solid #0a0c14; border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: #00f0ff; }
  ::-webkit-scrollbar-thumb:active { background: #ff2bd6; }
  ::-webkit-scrollbar-corner { background: #0a0c14; }
  .subtabs::-webkit-scrollbar, .ptabs::-webkit-scrollbar, .dtabs::-webkit-scrollbar { display: none; }
}
@media (forced-colors: active) { * { scrollbar-color: auto; } }
