/* ---------- Design tokens ---------- */
:root {
  --bg: #f6f7f5;
  --bg-alt: #eef1ee;
  --surface: #ffffff;
  --text: #12181a;
  --text-dim: #57635f;
  --accent: #0e7c66;
  --accent-2: #b5772f;
  --border: rgba(18, 24, 26, 0.12);
  --grid-line: rgba(18, 24, 26, 0.06);
  --node: #0e7c66;
  --shadow: 0 8px 24px rgba(18, 24, 26, 0.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --canvas-opacity: 0.35;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f11;
    --bg-alt: #0d1417;
    --surface: #11191c;
    --text: #e9f1ee;
    --text-dim: #8ea39c;
    --accent: #2be7b8;
    --accent-2: #ffb85c;
    --border: rgba(233, 241, 238, 0.1);
    --grid-line: rgba(43, 231, 184, 0.06);
    --node: #2be7b8;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --canvas-opacity: 0.6;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.dim { color: var(--text-dim); }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 650; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.15rem; margin-bottom: 0.4em; }
p { margin: 0 0 1em; color: var(--text-dim); }
a { color: inherit; }

/* ---------- Background network canvas ---------- */
#net-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: var(--canvas-opacity);
  pointer-events: none;
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.brand-chip {
  background: var(--accent);
  color: #06110d;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Dot nav (desktop right side / mobile bottom) ---------- */
.dotnav {
  position: fixed;
  z-index: 20;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.dotnav ul {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(8px);
}

.dotnav a.dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  text-decoration: none;
}

.dot-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  background: transparent;
  transition: all 0.25s ease;
}

.dotnav a.dot.active .dot-mark,
.dotnav a.dot:hover .dot-mark {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.dotnav a.dot::after {
  content: attr(data-label);
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dotnav a.dot:hover::after {
  opacity: 1;
}

/* ---------- Layout ---------- */
main { position: relative; z-index: 1; }

.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 1.5rem 5rem;
  position: relative;
}

.section-alt {
  background: color-mix(in srgb, var(--bg-alt) 92%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-inner {
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.lead {
  max-width: 620px;
  font-size: 1.08rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at 30% 30%, black 0%, transparent 70%);
  pointer-events: none;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #06110d;
  box-shadow: var(--shadow);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}

.btn-lg { padding: 1rem 1.8rem; font-size: 1rem; }

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.scroll-cue span { animation: bob 1.6s infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ---------- Chain row (Focus) ---------- */
.chain-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-top: 2.5rem;
}

.chain-node {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem 1.4rem;
  box-shadow: var(--shadow);
  position: relative;
}

.chain-link {
  width: 44px;
  flex-shrink: 0;
  position: relative;
  align-self: center;
}

.chain-link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 12px);
}

.chain-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.node-glyph { width: 20px; height: 20px; display: block; position: relative; }

.node-glyph--brain {
  border-radius: 50% 50% 50% 20%;
  border: 2px solid var(--accent);
}

.node-glyph--flow {
  border: 2px solid var(--accent);
  border-radius: 4px;
}
.node-glyph--flow::before,
.node-glyph--flow::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  top: -3px;
}
.node-glyph--flow::before { left: -3px; }
.node-glyph--flow::after { right: -3px; bottom: -3px; top: auto; }

.node-glyph--block {
  border: 2px solid var(--accent);
  transform: rotate(45deg);
  border-radius: 3px;
}

/* ---------- Pipeline (Process) ---------- */
.pipeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.pipeline-track {
  position: absolute;
  top: 22px;
  left: 5%;
  right: 5%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 16px);
  opacity: 0.5;
}

.pipeline-step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.2rem 1.2rem;
  box-shadow: var(--shadow);
}

.step-node {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  margin-bottom: 0.9rem;
  background: var(--bg);
}

/* ---------- Cell grid (Capabilities) ---------- */
.cell-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 2.5rem;
  border: 1px solid var(--border);
  background: var(--border);
}

.cell {
  background: var(--surface);
  padding: 1.6rem 1.4rem;
  position: relative;
  min-height: 150px;
}

.cell-ref {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  font-size: 0.65rem;
  color: var(--text-dim);
  opacity: 0.6;
}

/* ---------- Contact ---------- */
.contact-inner { text-align: left; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 1.6rem 1.5rem 2.2rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  max-width: 980px;
  margin: 0 auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .chain-row { flex-direction: column; }
  .chain-link { width: 100%; height: 30px; }
  .chain-link::before { top: 0; bottom: 0; left: 50%; right: auto; width: 2px; height: 100%; background: repeating-linear-gradient(180deg, var(--accent) 0 6px, transparent 6px 12px); }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipeline-track { display: none; }
  .cell-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .dotnav {
    right: auto;
    left: 50%;
    top: auto;
    bottom: 1.1rem;
    transform: translateX(-50%);
  }
  .dotnav ul {
    flex-direction: row;
    padding: 0.55rem 0.9rem;
  }
  .dotnav a.dot::after {
    right: auto;
    left: 50%;
    top: -34px;
    transform: translateX(-50%);
  }
  .cell-grid { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .section { padding: 6rem 1.2rem 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse, .scroll-cue span { animation: none; }
}
