:root {
  --bg: #16191e;
  --bg-elev: #1d2127;
  --panel: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --text: #eef1f4;
  --muted: #a3aab4;
  --faint: #6f767f;
  --accent: #4aa8ff;
  --accent-dim: rgba(74, 168, 255, 0.14);
  --warn: #f2b34a;
  --grid: rgba(255, 255, 255, 0.05);
  --maxw: 1240px;
  --mono: "IBM Plex Mono", "SFMono-Regular", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* ---- Wiremesh background ---- */
.mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 40%, transparent 100%);
}

.mesh-fine {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 11px 11px;
}

.glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 700px;
  z-index: -2;
  background: radial-gradient(ellipse at center, rgba(87, 224, 196, 0.10), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}

/* ---- Cursor tracker ---- */
.cursor-dot {
  position: fixed;
  width: 6px; height: 6px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s;
}
.cursor-dot.active { opacity: .8; }

/* ---- Layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.section { padding: 110px 0; position: relative; }
.section--tight { padding: 80px 0; }

/* ---- Header / Nav ---- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background .35s, border-color .35s, backdrop-filter .35s;
}
.site-header.scrolled {
  background: rgba(10, 11, 13, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  position: relative;
}
.brand-mark::before {
  content: ""; position: absolute; inset: 5px;
  border: 1px solid var(--accent); opacity: .55;
}
.brand-mark span { width: 6px; height: 6px; background: var(--accent); position: relative; z-index: 1; }
.brand-name { font-weight: 700; letter-spacing: .03em; font-size: 16px; }
.brand-name small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .22em; color: #9ab4cf; font-weight: 400; }

.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 14px;
  letter-spacing: .04em; padding: 8px 14px; border-radius: 2px;
  transition: color .2s, background .2s; position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-cta {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  color: var(--bg) !important; background: var(--accent);
  padding: 9px 16px !important; text-transform: uppercase;
}
.nav-cta:hover { background: #7cc0ff; }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); width: 40px; height: 40px; cursor: pointer; }

/* ---- Technical labels ---- */
.tag {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
}
.tag::before { content: ""; width: 22px; height: 1px; background: var(--accent); display: inline-block; }
.tag--muted { color: var(--faint); }
.tag--muted::before { background: var(--faint); }

/* ---- Hero ---- */
.hero { padding: 170px 0 90px; position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 60px; align-items: center;
}
.hero h1 {
  font-size: clamp(34px, 5vw, 62px); line-height: 1.05; letter-spacing: -0.02em;
  font-weight: 600; margin: 22px 0 24px;
}
.hero h1 .accent { color: var(--accent); }
.hero p.lead { color: var(--muted); font-size: 18px; max-width: 54ch; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Buttons */
.btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; padding: 14px 22px; display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-strong); color: var(--text); background: transparent;
  transition: all .22s; position: relative; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn--primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn--primary:hover { background: #7cc0ff; color: var(--bg); }
.btn .arrow { transition: transform .22s; }
.btn:hover .arrow { transform: translateX(4px); }

/* Telemetry panel */
.telemetry {
  border: 1px solid var(--line); background: var(--panel);
  position: relative; padding: 0;
}
.telemetry::before, .telemetry::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border-color: var(--accent); border-style: solid;
}
.telemetry::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.telemetry::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.telemetry-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--faint);
  text-transform: uppercase;
}
.telemetry-head .live { display: flex; align-items: center; gap: 7px; color: var(--accent); }
.telemetry-head .live i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(74,168,255,.6); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,168,255,.5); }
  70% { box-shadow: 0 0 0 8px rgba(74,168,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,168,255,0); }
}
.telemetry-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.telemetry-row:last-child { border-bottom: 0; }
.telemetry-row .k { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.telemetry-row .v { font-family: var(--mono); font-size: 22px; color: var(--text); }
.telemetry-row .v small { font-size: 12px; color: var(--faint); }
.telemetry-row .v.up { color: var(--accent); }

/* ---- Section heads ---- */
.sec-head { max-width: 720px; margin-bottom: 54px; }
.sec-head h2 {
  font-size: clamp(26px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -0.02em;
  font-weight: 600; margin: 18px 0 16px;
}
.sec-head p { color: var(--muted); font-size: 17px; }

/* ---- Method grid ---- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); }
.card {
  padding: 34px 30px 38px; border-right: 1px solid var(--line); position: relative;
  transition: background .25s;
}
.card:last-child { border-right: 0; }
.card:hover { background: var(--panel); }
.card .idx {
  font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: .1em;
}
.card h3 { font-size: 20px; font-weight: 600; margin: 18px 0 12px; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 15px; }
.card .corner {
  position: absolute; top: 14px; right: 14px; width: 8px; height: 8px;
  border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong);
}

/* ---- Edge list ---- */
.edge { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.edge-copy p { color: var(--muted); font-size: 17px; margin-bottom: 18px; }
.edge-list { display: flex; flex-direction: column; }
.edge-item {
  display: flex; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line);
}
.edge-item:last-child { border-bottom: 1px solid var(--line); }
.edge-item .num { font-family: var(--mono); font-size: 12px; color: var(--faint); padding-top: 3px; min-width: 28px; }
.edge-item .body h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.edge-item .body p { color: var(--muted); font-size: 14px; }

/* ---- CTA band ---- */
.cta {
  border: 1px solid var(--line-strong); background: var(--panel);
  padding: 56px 48px; position: relative; overflow: hidden;
  display: flex; justify-content: space-between; align-items: center; gap: 40px; flex-wrap: wrap;
}
.cta::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px; opacity: .5; pointer-events: none;
}
.cta .content { position: relative; z-index: 1; }
.cta h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 600; letter-spacing: -0.02em; margin: 14px 0 10px; }
.cta p { color: var(--muted); max-width: 46ch; }
.cta .actions { position: relative; z-index: 1; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 54px 0 40px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.foot-grid h5 { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 18px; }
.foot-grid a { display: block; color: var(--muted); text-decoration: none; font-size: 14px; padding: 6px 0; transition: color .2s; }
.foot-grid a:hover { color: var(--accent); }
.foot-grid .about p { color: var(--muted); font-size: 14px; max-width: 34ch; margin: 14px 0; }
.foot-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--faint);
}

/* ---- Page hero (inner pages) ---- */
.page-hero { padding: 150px 0 50px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(32px, 4.6vw, 54px); letter-spacing: -0.02em; font-weight: 600; margin: 18px 0 18px; line-height: 1.05; }
.page-hero p { color: var(--muted); font-size: 18px; max-width: 60ch; }

/* ---- Generic content ---- */
.prose { max-width: 760px; }
.prose p { color: var(--muted); font-size: 17px; margin-bottom: 20px; }
.prose h3 { font-size: 22px; font-weight: 600; margin: 40px 0 14px; letter-spacing: -0.01em; }
.prose ul { color: var(--muted); font-size: 16px; padding-left: 0; list-style: none; }
.prose ul li { padding: 10px 0 10px 26px; border-bottom: 1px solid var(--line); position: relative; }
.prose ul li::before { content: "›"; position: absolute; left: 4px; color: var(--accent); }

/* Stat row */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin: 10px 0 50px; }
.stat { padding: 28px 26px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .v { font-family: var(--mono); font-size: 30px; color: var(--text); }
.stat .v span { color: var(--accent); }
.stat .k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-top: 8px; }

/* Process steps */
.steps { display: grid; gap: 0; border: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 120px 1fr; gap: 30px; padding: 32px 30px; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .n { font-family: var(--mono); font-size: 28px; color: var(--accent); }
.step h4 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 15px; }

/* Insights list */
.post { display: grid; grid-template-columns: 140px 1fr auto; gap: 30px; align-items: center; padding: 28px 0; border-top: 1px solid var(--line); transition: padding .2s; }
.post:last-child { border-bottom: 1px solid var(--line); }
.post:hover { padding-left: 12px; }
.post .date { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--faint); }
.post h3 { font-size: 20px; font-weight: 600; }
.post p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.post .cat { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--line); padding: 6px 12px; white-space: nowrap; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.field { margin-bottom: 22px; }
.field label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; background: var(--bg-elev); border: 1px solid var(--line); color: var(--text);
  padding: 13px 15px; font-family: var(--sans); font-size: 15px; transition: border-color .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 130px; }
.contact-meta .row { padding: 18px 0; border-top: 1px solid var(--line); }
.contact-meta .row:last-child { border-bottom: 1px solid var(--line); }
.contact-meta .k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.contact-meta .v { color: var(--text); font-size: 16px; margin-top: 5px; }
.contact-meta a { color: var(--accent); text-decoration: none; }

/* Reveal animation (only hides when JS is active, so content is never blank) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .cards { grid-template-columns: 1fr; }
  .card { border-right: 0; border-bottom: 1px solid var(--line); }
  .edge { grid-template-columns: 1fr; gap: 40px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .contact-grid { grid-template-columns: 1fr; }
  .post { grid-template-columns: 1fr; gap: 6px; }
  .post .cat { justify-self: start; }
  .step { grid-template-columns: 60px 1fr; gap: 16px; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--line); padding: 12px; gap: 4px;
  }
  .section { padding: 80px 0; }
  .cta { padding: 38px 26px; }
  .foot-grid { grid-template-columns: 1fr; gap: 30px; }
  .stat-row { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
}

/* ---- Light theme ---- */
html.light {
  --bg: #f4f6f9;
  --bg-elev: #ffffff;
  --panel: rgba(15, 23, 32, 0.03);
  --line: rgba(15, 23, 32, 0.14);
  --line-strong: rgba(15, 23, 32, 0.30);
  --text: #0e1318;
  --muted: #40474f;
  --faint: #6c747e;
  --accent: #1f7fd6;
  --accent-dim: rgba(31, 125, 214, 0.10);
  --grid: rgba(15, 23, 32, 0.07);
}
html.light .mesh-fine {
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}
html.light .brand-name small { color: #4a6b85; }
html.light .nav-links a { color: #1c2228; font-weight: 500; }
html.light .btn--primary { color: #fff; }
html.light .nav-cta { color: #fff !important; }
html.light .glow { background: radial-gradient(ellipse at center, rgba(31, 125, 214, 0.12), transparent 60%); }
html.light .card,
html.light .telemetry,
html.light .cta,
html.light .stat {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(14, 19, 24, 0.04), 0 10px 30px rgba(14, 19, 24, 0.05);
}
html.light h1, html.light h2, html.light h3, html.light h4 { letter-spacing: -0.02em; }

.theme-toggle {
  background: none; border: 1px solid var(--line); color: var(--text);
  width: 40px; height: 40px; cursor: pointer; display: grid; place-items: center;
  font-size: 15px; margin-right: 8px; transition: border-color .2s, color .2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
