/* ============================================================
   Connectiva Labs — connective node-graph identity
   Paper #F7F8FC · Ink #131A2E · Ultramarine #4353FF
   Display: Bricolage Grotesque · Body: Instrument Sans
   Labels: Spline Sans Mono
   ============================================================ */

:root {
  --paper: #f7f8fc;
  --card: #ffffff;
  --ink: #131a2e;
  --body: #4a536b;
  --line: #e4e7f2;
  --accent: #4353ff;
  --accent-ink: #2f3bd4;
  --accent-soft: #edefff;
  --teal: #14b8a0;
  --teal-soft: #e2f8f4;
  --amber: #ffb23e;
  --amber-soft: #fff3df;

  --font-display: "Bricolage Grotesque", "Instrument Sans", sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;

  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(19, 26, 46, 0.04), 0 8px 24px rgba(19, 26, 46, 0.06);
  --shadow-lift: 0 2px 4px rgba(19, 26, 46, 0.05), 0 16px 40px rgba(19, 26, 46, 0.1);
  --container: 1120px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(67, 83, 255, 0.28);
}

.btn-primary:hover {
  background: var(--accent-ink);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

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

/* ---------- Header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 248, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.site-nav a {
  color: var(--body);
  font-weight: 500;
  font-size: 0.98rem;
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}

.site-nav .btn {
  padding: 9px 20px;
  font-size: 0.95rem;
}

.site-nav a.btn-primary,
.site-nav a.btn-primary:hover {
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(rgba(67, 83, 255, 0.1) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, var(--paper) 96%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
  padding-block: 84px 96px;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.2vw, 3.9rem);
  font-weight: 800;
  margin-bottom: 20px;
}

.hero h1 .tie {
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}

.hero-sub {
  font-size: 1.16rem;
  max-width: 34rem;
  margin: 0 0 32px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--body);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.hero-meta span::before {
  content: "● ";
  font-size: 0.55rem;
  vertical-align: 2px;
  color: var(--teal);
}

/* Node-graph figure */

.hero-figure {
  position: relative;
}

.hero-figure svg {
  width: 100%;
  height: auto;
}

.net-link {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-dasharray: 6 7;
  opacity: 0.55;
  animation: link-flow 26s linear infinite;
}

.net-link.alt {
  stroke: var(--teal);
  animation-duration: 34s;
  animation-direction: reverse;
}

.net-dot {
  fill: var(--accent);
}

.net-tile {
  animation: tile-float 7s ease-in-out infinite;
}

.net-tile:nth-of-type(odd) {
  animation-duration: 8.5s;
  animation-delay: -3s;
}

.net-tile rect.tile-bg {
  fill: var(--card);
  stroke: var(--line);
  stroke-width: 1.5;
}

.net-hub circle.hub-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  opacity: 0.35;
  animation: hub-pulse 4s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

@keyframes link-flow {
  to {
    stroke-dashoffset: -260;
  }
}

@keyframes tile-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes hub-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.35;
  }
  50% {
    transform: scale(1.18);
    opacity: 0.12;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: 88px;
}

.section-head {
  max-width: 40rem;
  margin-bottom: 52px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 700;
}

.section-head p {
  margin: 0;
  font-size: 1.08rem;
}

/* Apps grid */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.app-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.app-card h3 {
  font-size: 1.22rem;
  font-weight: 700;
  margin: 18px 0 8px;
}

.app-card p {
  margin: 0;
  font-size: 0.99rem;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.card-icon.t-teal {
  background: var(--teal-soft);
  color: var(--teal);
}

.card-icon.t-amber {
  background: var(--amber-soft);
  color: #c47d13;
}

/* Services */

.services {
  background: var(--ink);
  border-radius: 32px;
  padding: 72px 56px;
  color: #aab1c8;
}

.services .eyebrow {
  color: #9aa6ff;
}

.services .section-head h2 {
  color: #fff;
}

.services .section-head p {
  color: #aab1c8;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.service-cell {
  padding: 28px 26px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.service-cell h3 {
  color: #fff;
  font-size: 1.12rem;
  font-weight: 600;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-cell h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  flex: none;
}

.service-cell:nth-child(3n + 2) h3::before {
  background: var(--accent);
}

.service-cell:nth-child(3n) h3::before {
  background: var(--amber);
}

.service-cell p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Process */

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.step {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-ink);
  letter-spacing: 0.1em;
}

.step h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 10px 0 8px;
}

.step p {
  margin: 0;
  font-size: 0.95rem;
}

.step::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -22px;
  width: 22px;
  border-top: 2px dashed var(--line);
}

.step:last-child::after {
  display: none;
}

/* Contact */

.contact-card {
  background: linear-gradient(135deg, var(--accent) 0%, #2f3bd4 60%, #23289e 100%);
  border-radius: 32px;
  padding: 68px 56px;
  text-align: center;
  color: #ccd2ff;
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 70%);
}

.contact-card > * {
  position: relative;
}

.contact-card h2 {
  color: #fff;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
}

.contact-card p {
  max-width: 32rem;
  margin: 0 auto 30px;
}

.contact-card .btn-primary {
  background: #fff;
  color: var(--accent-ink);
  box-shadow: 0 10px 26px rgba(10, 14, 60, 0.35);
}

.contact-card .btn-primary:hover {
  background: var(--accent-soft);
}

.contact-mail {
  display: block;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #ccd2ff;
}

.contact-mail:hover {
  color: #fff;
}

/* ---------- Footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 56px 0 32px;
  margin-top: 40px;
  background: #fff;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 44px;
}

.foot-brand p {
  max-width: 22rem;
  font-size: 0.96rem;
  margin: 14px 0 0;
}

.foot-col h4 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 16px;
}

.foot-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.foot-col a {
  color: var(--body);
  font-size: 0.96rem;
}

.foot-col a:hover {
  color: var(--accent-ink);
}

.foot-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.88rem;
  color: #7b8299;
}

/* ---------- Legal pages ---------- */

.legal-hero {
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding-block: 56px 44px;
}

.legal-hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 750;
  max-width: 24ch;
}

.legal-updated {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #7b8299;
  margin: 0;
}

.legal-wrap {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  padding-block: 56px 88px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 100px;
  border-left: 2px solid var(--line);
  padding-left: 20px;
}

.toc h2 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #7b8299;
  margin-bottom: 14px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.toc a {
  color: var(--body);
  font-size: 0.92rem;
  line-height: 1.4;
  display: block;
}

.toc a:hover {
  color: var(--accent-ink);
  text-decoration: none;
}

.toc a.active {
  color: var(--accent-ink);
  font-weight: 600;
}

/* Prose */

.prose {
  max-width: 46rem;
}

.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.2em 0 0.6em;
  padding-top: 0.4em;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h2 > span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 500;
  margin-right: 10px;
}

.prose h3 {
  font-size: 1.12rem;
  font-weight: 650;
  margin: 1.6em 0 0.5em;
}

.prose p,
.prose li {
  font-size: 1rem;
}

.prose ul {
  padding-left: 22px;
}

.prose li {
  margin-bottom: 7px;
}

.prose strong {
  color: var(--ink);
}

.callout {
  background: var(--accent-soft);
  border: 1px solid #d8dcff;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
}

.callout.warn {
  background: var(--amber-soft);
  border-color: #f4dcb2;
}

.callout p {
  margin: 0;
}

.prose .contact-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 12px;
}

.prose .contact-block p {
  margin: 4px 0;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding-block: 56px 64px;
  }

  .hero-figure {
    max-width: 460px;
    margin-inline: auto;
  }

  .card-grid,
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .step::after {
    display: none;
  }

  .services {
    padding: 52px 32px;
  }

  .legal-wrap {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .toc {
    position: static;
    border-left: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    background: #fff;
  }
}

@media (max-width: 640px) {
  .site-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 20px;
    display: none;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 10px 0;
  }

  .site-nav .btn {
    justify-content: center;
    margin-top: 8px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .card-grid,
  .service-grid,
  .process-grid {
    grid-template-columns: 1fr;
  }

  .foot-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .section {
    padding-block: 60px;
  }

  .contact-card {
    padding: 48px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .net-link,
  .net-tile,
  .net-hub circle.hub-ring {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .app-card {
    transition: none;
  }
}
