/* ============================================================
   ContextPlus - shared design system
   Matte black · cool-blue signal · sans + mono · sharp lines
   ============================================================ */

:root {
  /* surfaces */
  --bg:        #0a0a0c;
  --bg-1:      #0e0e11;
  --bg-2:      #131318;
  --bg-3:      #191920;
  --panel:     #101015;

  /* lines */
  --line:      rgba(255,255,255,0.075);
  --line-2:    rgba(255,255,255,0.14);
  --line-3:    rgba(255,255,255,0.22);

  /* text */
  --text:      #ecedf1;
  --text-soft: #a6a7af;
  --text-mute: #6a6b74;
  --text-dim:  #4a4b53;

  /* signal - cool blue (oklch ~0.72 0.14 258) */
  --accent:      #5b9dff;
  --accent-bri:  #8cbaff;
  --accent-deep: #2f6fe0;
  --accent-ghost: rgba(91,157,255,0.12);
  --accent-line:  rgba(91,157,255,0.32);
  --accent-glow:  rgba(91,157,255,0.18);

  /* type */
  --display: "Space Grotesk", system-ui, sans-serif;
  --sans:    "IBM Plex Sans", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1240px;
  --pad: clamp(20px, 5vw, 64px);
  --nav-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle grid / vignette field on body */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(91,157,255,0.06), transparent 60%),
    linear-gradient(to bottom, #0c0c10, var(--bg) 30%);
  pointer-events: none; z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: rgba(91,157,255,0.28); color: #fff; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); position: relative; z-index: 1; }
.section { padding: clamp(72px, 10vw, 140px) 0; position: relative; z-index: 1; }
.section--tight { padding: clamp(48px, 6vw, 88px) 0; }
.divider { height: 1px; background: var(--line); width: 100%; }

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 22px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--accent-line);
}
.eyebrow.plain::before { display: none; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; margin: 0; color: var(--text); }
.h-display { font-size: clamp(44px, 7vw, 92px); line-height: 0.98; letter-spacing: -0.035em; font-weight: 500; }
.h1 { font-size: clamp(36px, 5vw, 62px); line-height: 1.02; letter-spacing: -0.03em; }
.h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.06; letter-spacing: -0.025em; }
.h3 { font-size: clamp(21px, 2vw, 27px); line-height: 1.18; letter-spacing: -0.015em; font-weight: 600; }

.lede { font-size: clamp(18px, 1.7vw, 22px); line-height: 1.55; color: var(--text-soft); max-width: 64ch; text-wrap: pretty; }
.body { font-size: 17px; line-height: 1.65; color: var(--text-soft); text-wrap: pretty; }
.small { font-size: 14px; line-height: 1.55; color: var(--text-mute); }
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.italic { font-style: italic; }
strong { color: var(--text); font-weight: 600; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(10,10,12,0.72);
  backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 30px; width: auto; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5)); }
.brand .wordmark { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; color: var(--text); }
.brand .wordmark b { color: var(--accent); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em;
  color: var(--text-mute); padding: 9px 14px; border-radius: 7px;
  transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { content: ""; }
.nav-cta { margin-left: 8px; }
.nav-burger { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.01em;
  padding: 13px 22px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; transition: all .18s ease; white-space: nowrap;
}
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary {
  background: var(--accent); color: #07111f; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(91,157,255,0.4), 0 8px 30px -8px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-bri); box-shadow: 0 0 0 1px rgba(140,186,255,0.6), 0 10px 40px -6px var(--accent-glow); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--line-3); background: rgba(255,255,255,0.03); }
.btn-sm { padding: 9px 16px; font-size: 13px; border-radius: 7px; }

/* ---------- pill / tag ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); padding: 7px 13px; border: 1px solid var(--accent-line); border-radius: 999px;
  background: var(--accent-ghost);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* ---------- panel / card ---------- */
.panel {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: 14px;
}
.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  transition: border-color .2s, transform .2s;
  position: relative;
}
.card:hover { border-color: var(--line-2); }
.card .knum { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--text-dim); }

/* ---------- terminal frame ---------- */
.term {
  background: #0b0b0f;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8);
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.term-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #2a2a31; }
.term-bar .title { font-family: var(--mono); font-size: 12px; color: var(--text-mute); margin-left: 10px; letter-spacing: 0.02em; }
.term-body { padding: 22px 24px; font-family: var(--mono); font-size: 14px; line-height: 1.85; color: var(--text-soft); }
.term-body .c-key { color: var(--accent); }
.term-body .c-str { color: #9fd8b0; }
.term-body .c-mut { color: var(--text-dim); }
.term-body .c-cmt { color: var(--text-dim); font-style: italic; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 64px 0 40px; position: relative; z-index: 1; }
.foot .row { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; align-items: flex-start; }
.foot .brand img { height: 34px; }
.foot .cols { display: flex; gap: 64px; flex-wrap: wrap; }
.foot .col h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 16px; font-weight: 500; }
.foot .col a { display: block; color: var(--text-mute); font-size: 14px; padding: 5px 0; transition: color .15s; }
.foot .col a:hover { color: var(--text); }
.foot .legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot .legal span { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

/* ---------- misc helpers ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 64px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stack-sm > * + * { margin-top: 12px; }
.stack > * + * { margin-top: 22px; }
.stack-lg > * + * { margin-top: 40px; }
.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.muted { color: var(--text-mute); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg-1); border-bottom: 1px solid var(--line); padding: 10px; gap: 2px; }
  .nav-burger { display: inline-flex; background: none; border: 1px solid var(--line-2); border-radius: 8px; width: 40px; height: 40px; align-items: center; justify-content: center; cursor: pointer; }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after { content:""; display:block; width:18px; height:1.5px; background: var(--text); position: relative; }
  .nav-burger span::before { position:absolute; top:-6px; } .nav-burger span::after { position:absolute; top:6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
