/* BlackRoad OS — Shared Design System v4 */
/* Matches brand.blackroad.io canonical component library */
/* 6-stop spectrum — NEVER use old F5A623/FF1D6C/9C27B0/2979FF palette */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --black:    #000000;
  --bg:       #000000;
  --deep:     #050505;
  --card:     #0a0a0a;
  --surface:  #0a0a0a;
  --elevated: #111111;
  --hover:    #181818;
  --border:   #1a1a1a;
  --muted:    #444444;
  --sub:      #737373;
  --subtle:   #737373;
  --text:     #f5f5f5;
  --white:    #f5f5f5;

  /* Border radius — per brand.blackroad.io */
  --radius-sm:   4px;
  --radius:      6px;
  --radius-md:   8px;
  --radius-lg:   10px;
  --radius-pill: 50px;
  --radius-full: 50%;

  /* Accent colors — decorative elements ONLY, never text */
  --ember:   #FF6B2B;
  --flare:   #FF2255;
  --magenta: #CC00AA;
  --orchid:  #8844FF;
  --arc:     #4488FF;
  --cyan:    #00D4FF;

  --grad: linear-gradient(90deg, #FF6B2B, #FF2255, #CC00AA, #8844FF, #4488FF, #00D4FF);

  --sg: 'Space Grotesk', sans-serif;
  --in: 'Inter', sans-serif;
  --jb: 'JetBrains Mono', monospace;

  --phi:    1.618;
  --sp-xs:  8px;
  --sp-sm:  13px;
  --sp-md:  21px;
  --sp-lg:  34px;
  --sp-xl:  55px;
  --sp-2xl: 89px;

  --ease:        cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Animations */
@keyframes gradShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes barPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50%       { opacity: 0.45; transform: scaleY(0.65); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--in);
  line-height: 1.618;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--border); }

.grad-border {
  border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              var(--grad) border-box;
}

.fade-up {
  animation: fadeUp 0.6s ease both;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Nav — gradient top bar + backdrop blur */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-md) var(--sp-xl);
  background: rgba(0,0,0,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
nav::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad);
  background-size: 200% 100%;
  animation: gradShift 4s linear infinite;
}
.nav-logo {
  font-family: var(--sg);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.03em;
  color: var(--white);
}
.nav-links { display: flex; gap: var(--sp-lg); font-size: 0.875rem; color: var(--subtle); font-family: var(--in); }
.nav-links a:hover { color: var(--white); transition: color 0.15s; }
.nav-cta {
  font-size: 0.8rem;
  font-family: var(--in);
  font-weight: 600;
  padding: 8px 18px;
  background: var(--grad);
  background-size: 200% 100%;
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-position 0.4s ease, transform 0.2s;
}

/* Buttons — per brand.blackroad.io */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: var(--sg);
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-sm { padding: 7px 16px; font-size: 12px; border-radius: 5px; }
.btn-lg { padding: 14px 32px; font-size: 15px; border-radius: var(--radius-md); }
.btn-white { background: var(--white); color: #000; }
.btn-white:hover { background: #e0e0e0; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: #444; }
.btn-ghost { background: transparent; border: none; color: var(--sub); }
.btn-ghost:hover { color: var(--white); }
.btn-dark { background: var(--elevated); color: var(--text); border: 1px solid var(--border); }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-md); background: var(--elevated); border: 1px solid var(--border); color: var(--sub); }

/* Badges — per brand.blackroad.io */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text);
}
.badge-dot { width: 6px; height: 6px; border-radius: var(--radius-full); flex-shrink: 0; }

/* Inputs — per brand.blackroad.io */
.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sg);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: #333; }
.input::placeholder { color: var(--muted); }

/* Avatar — per brand.blackroad.io */
.avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--elevated);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
}
.nav-cta:hover { background-position: 100% 0; transform: translateY(-1px); }

/* Card gradient top bar */
.card-grad { height: 3px; background: var(--grad); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card-body { padding: 20px; }
.card-title { font-weight: 600; font-size: 15px; color: var(--white); margin-bottom: 6px; }
.card-text { font-size: 13px; color: var(--sub); line-height: 1.7; }
.card-meta { font-family: var(--jb); font-size: 10px; color: var(--muted); margin-top: 10px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card:hover { border-color: #333; transition: border-color 0.2s; }

/* Search bar — embeddable in any nav */
.nav-search {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
  transition: border-color 0.2s;
}
.nav-search:focus-within { border-color: rgba(255,255,255,0.15); }
.nav-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--in);
  font-size: 0.8rem;
  padding: 6px 12px;
  width: 160px;
  transition: width 0.3s;
}
.nav-search input:focus { width: 240px; }
.nav-search input::placeholder { color: var(--muted); }
.nav-search button {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--subtle);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: color 0.2s;
}
.nav-search button:hover { color: var(--white); }

/* Search results overlay */
.search-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 999;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(20px);
  padding: 80px 20px 40px;
  overflow-y: auto;
}
.search-overlay.active { display: block; }
.search-overlay-close {
  position: fixed; top: 16px; right: 24px; z-index: 1000;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--subtle); font-size: 1.2rem; padding: 6px 12px;
  cursor: pointer; transition: color 0.2s;
}
.search-overlay-close:hover { color: var(--white); }
.search-overlay-input {
  display: block;
  width: 100%; max-width: 640px; margin: 0 auto 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-bottom: 2px solid;
  border-image: var(--grad) 1;
  outline: none;
  color: var(--white);
  font-family: var(--sg);
  font-size: 1.5rem;
  font-weight: 600;
  padding: 16px 20px;
}
.search-overlay-input::placeholder { color: var(--muted); font-weight: 400; }
.search-overlay-results {
  max-width: 640px; margin: 0 auto;
}
.search-result {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.search-result-title {
  font-family: var(--sg);
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
}
.search-result-title:hover { text-decoration: underline; }
.search-result-url {
  font-family: var(--jb);
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.search-result-snippet {
  font-family: var(--in);
  font-size: 0.85rem;
  color: var(--subtle);
  line-height: 1.6;
}
.search-result-tag {
  display: inline-block;
  font-family: var(--jb);
  font-size: 0.65rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  margin-top: 6px;
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
/* Cmd+K shortcut hint */
.search-hint {
  font-family: var(--jb);
  font-size: 0.65rem;
  color: var(--muted);
  padding: 2px 6px;
  border: 1px solid var(--border);
  margin-left: 8px;
}

/* Sections */
section { padding: var(--sp-2xl) var(--sp-xl); max-width: 1200px; margin: 0 auto; }

.section-label {
  font-family: var(--jb);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-sm);
}

h1, h2, h3 { font-family: var(--sg); color: var(--white); }
h1 { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.04em; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { font-family: var(--in); color: var(--subtle); line-height: 1.75; }

code, .mono { font-family: var(--jb); }

/* Cards — per brand.blackroad.io */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: var(--sp-lg);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.card:hover { border-color: var(--muted); }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-md); }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  nav { padding: var(--sp-md); }
  section { padding: var(--sp-xl) var(--sp-md); }
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-xl);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem; color: var(--muted);
  font-family: var(--jb);
}

/* Dot grid bg */
.dot-bg {
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
}
