:root {
  color-scheme: light;

  --paper: #ffffff;
  --mist: #eef4f0;
  --ink: #13221a;
  --ink-soft: #4b5b52;
  --line: #d3dfd7;
  --green: #1e8e4b;
  --green-deep: #146a36;
  --green-bright: #2cc766;
  --forms: #17a58a;

  --font: "Schibsted Grotesk", system-ui, sans-serif;

  /* Typeschaal (ratio ~1.25) */
  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-md: 1.3125rem;
  --t-lg: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);
  --t-xl: clamp(2.5rem, 1.4rem + 4.4vw, 4.75rem);

  --gutter: clamp(16px, 4vw, 48px);
  --radius: 14px;
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }

:focus-visible {
  outline: 3px solid var(--green-bright);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.wrap { width: min(1200px, 100% - 2 * var(--gutter)); margin-inline: auto; }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: var(--t-lg); }

/* Header */

.top {
  position: sticky; top: 0; z-index: 50;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}
.top-inner {
  height: 76px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand img { width: 168px; height: auto; mix-blend-mode: multiply; }
.top nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); font-size: var(--t-sm); font-weight: 600; }
.top nav a:hover { color: var(--green-deep); }
.nav-contact {
  padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--ink);
}
.nav-contact:hover { background: var(--ink); color: var(--paper) !important; }

/* Hero */

.hero { padding-block: clamp(32px, 6vw, 80px) clamp(48px, 7vw, 96px); overflow: hidden; }
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
}
.hero h1 {
  font-size: var(--t-xl);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
  max-width: 11ch;
}
.lede {
  margin-top: 24px;
  max-width: 36ch;
  font-size: var(--t-md);
  line-height: 1.5;
  color: var(--ink-soft);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px;
  font-weight: 600; font-size: var(--t-base);
  transition: background-color 160ms, color 160ms, border-color 160ms;
}
.btn-primary { background: var(--green-deep); color: #fff; }
.btn-primary:hover { background: var(--ink); }
.btn-ghost { border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

/* Netwerkdiagram */

.net { position: relative; aspect-ratio: 600 / 520; width: 100%; }
.net-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.arm {
  stroke: url(#g-arm);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 900ms cubic-bezier(.6, 0, .2, 1) forwards;
}
.arm-forms { animation-delay: 150ms; }
.arm-substrx { animation-delay: 300ms; }
.arm-next {
  stroke: var(--line);
  stroke-width: 6;
  animation-delay: 450ms;
}
.arm-faint {
  stroke: var(--mist);
  stroke-width: 6;
  animation-delay: 600ms;
}

.node, .node-open, .hub {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: pop 420ms cubic-bezier(.3, 1.5, .5, 1) forwards;
  transition: transform 220ms cubic-bezier(.3, 1.5, .5, 1);
}
.hub { fill: var(--ink); animation-delay: 50ms; }
.node { fill: url(#g-node); }
.node-forms { animation-delay: 850ms; }
.node-substrx { animation-delay: 1000ms; }
.node-open {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 3;
  stroke-dasharray: 7 7;
}
.node-next { animation-delay: 1150ms; }
.node-faint { stroke: var(--mist); animation-delay: 1250ms; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

.tag {
  position: absolute;
  display: flex; flex-direction: column;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line);
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  animation: fade 400ms ease-out forwards;
}
.tag strong { font-size: var(--t-base); font-weight: 700; }
.tag span { font-size: var(--t-sm); color: var(--ink-soft); }
a.tag { transition: box-shadow 160ms; }
a.tag:hover { box-shadow: 0 0 0 2px var(--green); }

/* Plaatsing onder elk knooppunt (percentages van de 600×520 viewBox) */
.tag-forms   { left: 21.3%; top: 31%; transform: translateX(-35%); animation-delay: 1000ms; }
.tag-substrx { left: 79.7%; top: 28%; transform: translateX(-65%); animation-delay: 1150ms; }
.tag-next    { left: 78.3%; top: 89%; transform: translateX(-65%); box-shadow: none; background: transparent; padding-block: 4px; animation-delay: 1300ms; }
.tag-next strong { font-weight: 600; color: var(--ink-soft); }

@keyframes fade { to { opacity: 1; } }

/* 3D-versie (hero.js): canvas vervangt de SVG, labels volgen de bollen */
.net-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.net.is-3d .net-lines { display: none; }
.net.is-3d .tag { left: 0; top: 0; transform: none; will-change: transform; }
.net.is-3d .tag-forms { animation-delay: 1250ms; }
.net.is-3d .tag-substrx { animation-delay: 1400ms; }
.net.is-3d .tag-next { animation-delay: 1550ms; }

/* Een platform aanwijzen, waar dan ook op de pagina, licht het knooppunt op */
body:has([data-platform="forms"]:hover, .tag-forms:hover, .tag-forms:focus-visible) .node-forms,
body:has([data-platform="substrx"]:hover, .tag-substrx:hover, .tag-substrx:focus-visible) .node-substrx {
  transform: scale(1.14);
}

/* Platformen */

.platforms {
  background: var(--mist);
  padding-block: clamp(56px, 8vw, 104px);
}
.platform-list {
  margin-top: clamp(24px, 4vw, 40px);
  display: grid; gap: 16px;
}
.platform {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  padding: 16px clamp(16px, 2vw, 28px) 16px 16px;
  background: var(--paper);
  border-radius: var(--radius);
}
.platform-mark {
  height: 148px;
  border-radius: 10px;
  display: grid; place-items: center;
  padding: 24px;
}
.platform-mark-forms { background: #e3f5f0; }
.platform-mark-forms img { width: 100%; max-width: 210px; height: auto; mix-blend-mode: multiply; }
.platform-mark-substrx { background: var(--ink); }
.wordmark {
  font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em;
  color: #fff;
}
.wordmark b { color: var(--green-bright); font-weight: 800; }

.platform-body h3 {
  font-size: var(--t-md);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.platform-body p { margin-top: 8px; color: var(--ink-soft); max-width: 52ch; }
.badge {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0;
  padding: 3px 9px; border-radius: 999px;
  background: #dcf5e5; color: var(--green-deep);
}

.platform-link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-weight: 600; font-size: var(--t-sm);
  white-space: nowrap;
  transition: background-color 160ms, color 160ms, border-color 160ms;
}
.platform-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.platform-link:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }

/* Over */

.about { padding-block: clamp(56px, 8vw, 112px); }
.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(24px, 5vw, 72px);
}
.about h2 { max-width: 14ch; }
.about-lead { font-size: var(--t-md); line-height: 1.5; max-width: 40ch; }
.traits {
  margin-top: 40px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.traits div { border-top: 2px solid var(--ink); padding-top: 14px; }
.traits dt { font-weight: 700; }
.traits dd { margin-top: 6px; color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.55; }

/* Contact */

.contact { background: var(--green-deep); color: #fff; }
.contact-inner {
  padding-block: clamp(56px, 8vw, 104px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: end; gap: 32px;
}
.contact h2 { max-width: 16ch; }
.contact p { margin-top: 14px; max-width: 42ch; color: #cfe9d8; }
.mail {
  font-size: clamp(1.5rem, 1rem + 2.4vw, 2.75rem);
  font-weight: 700; letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
  text-decoration-color: var(--green-bright);
  transition: text-decoration-color 160ms;
  overflow-wrap: anywhere;
}
.mail:hover { text-decoration-color: #fff; }

/* Footer */

.foot { font-size: var(--t-sm); color: var(--ink-soft); }
.foot-inner { display: flex; justify-content: space-between; gap: 16px; padding-block: 24px; }
.foot a:hover { color: var(--ink); }

/* Responsief */

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero h1 { max-width: 13ch; }
  .net { max-width: 560px; margin-inline: auto; }
  .platform { grid-template-columns: 200px minmax(0, 1fr); }
  .platform-link { grid-column: 2; justify-self: start; }
  .about-inner { grid-template-columns: 1fr; }
  .about h2 { max-width: none; }
}

@media (max-width: 640px) {
  .top-inner { height: 64px; }
  .brand img { width: 128px; }
  .top nav a:not(.nav-contact) { display: none; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
  .tag { padding: 7px 10px; }
  .tag strong { font-size: var(--t-sm); }
  .tag span { font-size: 0.75rem; }
  .platform { grid-template-columns: 1fr; padding: 12px 12px 20px; gap: 16px; }
  .platform-mark { height: 120px; }
  .platform-body, .platform-link { margin-inline: 8px; }
  .platform-link { grid-column: auto; }
  .traits { grid-template-columns: 1fr; gap: 20px; }
  .contact-inner { grid-template-columns: 1fr; }
}

/* Beweging buiten de hero */

.top.scrolled { border-bottom-color: var(--line); }
.top nav a:not(.nav-contact) { position: relative; }
.top nav a:not(.nav-contact)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--green); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform 260ms cubic-bezier(.3, .7, .2, 1);
}
.top nav a.current::after, .top nav a:not(.nav-contact):hover::after { transform: scaleX(1); }

/* Hero-tekst komt binnen terwijl het 3D-model zich opbouwt */
.hero-text > * { animation: rise 700ms cubic-bezier(.2, .7, .2, 1) both; }
.hero-text > :nth-child(2) { animation-delay: 120ms; }
.hero-text > :nth-child(3) { animation-delay: 240ms; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* Platformrijen schuiven in, als nieuwe takken van het netwerk */
.js .platform {
  opacity: 0; transform: translateX(-28px);
  transition: opacity 600ms ease-out, transform 700ms cubic-bezier(.2, .7, .2, 1), box-shadow 200ms;
}
.js .platform + .platform { transition-delay: 120ms; }
.js .platform.in { opacity: 1; transform: none; }
.platform:hover { box-shadow: 0 0 0 1.5px var(--green); }

/* Forms: velden vullen zich, analyse-balken groeien */
.platform-mark-forms { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; }
.mock-form { width: 100%; max-width: 210px; display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; align-items: end; }
.field { grid-column: 1; height: 9px; border-radius: 5px; background: #fff; overflow: hidden; }
.field i { display: block; height: 100%; width: 0; background: var(--forms); border-radius: inherit; }
.bars { grid-column: 2; grid-row: 1 / 3; display: flex; align-items: end; gap: 3px; height: 26px; }
.bars i { width: 6px; height: 20%; background: var(--forms); border-radius: 2px; opacity: .85; }
.playing .field i { animation: fill 3.6s cubic-bezier(.5, 0, .3, 1) infinite; }
.playing .field + .field i { animation-delay: 500ms; }
.playing .bars i { animation: bar 3.6s cubic-bezier(.3, 1.4, .5, 1) infinite; }
.bars i:nth-child(1) { --h: 45%; animation-delay: 1100ms !important; }
.bars i:nth-child(2) { --h: 80%; animation-delay: 1200ms !important; }
.bars i:nth-child(3) { --h: 60%; animation-delay: 1300ms !important; }
.bars i:nth-child(4) { --h: 100%; animation-delay: 1400ms !important; }
.bars i:nth-child(5) { --h: 70%; animation-delay: 1500ms !important; }
@keyframes fill { 0%, 8% { width: 0; } 35%, 85% { width: 100%; } 100% { width: 0; } }
@keyframes bar { 0% { height: 20%; } 18%, 75% { height: var(--h); } 100% { height: 20%; } }

/* SubstrX: scanlijn over een meetlat */
.platform-mark-substrx { position: relative; overflow: hidden; }
.scan {
  position: absolute; top: 0; bottom: 0; left: -72px; width: 72px;
  background: linear-gradient(90deg, transparent, rgb(44 199 102 / .28) 96%, var(--green-bright) 96%);
}
.playing .scan { animation: scan 3.4s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes scan { 0% { left: -72px; } 70%, 100% { left: 100%; } }
.ruler {
  position: absolute; left: 16px; right: 16px; bottom: 12px; height: 10px;
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / .45) 0 1px, transparent 1px 10px) bottom / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, rgb(255 255 255 / .6) 0 1px, transparent 1px 50px) bottom / 100% 10px no-repeat;
}
.wordmark { position: relative; z-index: 1; }

/* Over: de lijnen boven de kenmerken trekken zich één voor één */
.traits div { position: relative; }
.js .traits div { border-top-color: transparent; }
.js .traits div::before {
  content: ''; position: absolute; left: 0; right: 0; top: -2px; height: 2px;
  background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform 800ms cubic-bezier(.6, 0, .2, 1);
}
.js .traits dt, .js .traits dd { opacity: 0; transition: opacity 500ms ease-out 400ms; }
.traits.in div::before { transform: scaleX(1); }
.traits.in dt, .traits.in dd { opacity: 1; }
.traits div:nth-child(2)::before, .traits div:nth-child(2) dt, .traits div:nth-child(2) dd { transition-delay: 180ms; }
.traits div:nth-child(3)::before, .traits div:nth-child(3) dt, .traits div:nth-child(3) dd { transition-delay: 360ms; }
.traits.in div:nth-child(2) dt, .traits.in div:nth-child(2) dd { transition-delay: 580ms; }
.traits.in div:nth-child(3) dt, .traits.in div:nth-child(3) dd { transition-delay: 760ms; }
.traits.in div:nth-child(1) dt, .traits.in div:nth-child(1) dd { transition-delay: 400ms; }

/* Contact: lichtvlek volgt de muis */
.contact { position: relative; overflow: hidden; isolation: isolate; }
.contact::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 80%) var(--my, 40%), rgb(44 199 102 / .45), transparent 70%);
  opacity: .7;
  transition: opacity 300ms;
}
.contact:hover::before { opacity: 1; }
.mail-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
.copy {
  font: inherit; font-size: var(--t-sm); font-weight: 600;
  color: #fff; background: rgb(255 255 255 / .12);
  border: 1.5px solid rgb(255 255 255 / .35); border-radius: 999px;
  min-height: 40px; padding: 0 16px; cursor: pointer;
  transition: background-color 160ms, border-color 160ms, color 160ms;
}
.copy:hover { background: rgb(255 255 255 / .22); }
.copy.done { background: #fff; color: var(--green-deep); border-color: #fff; }

@media (max-width: 640px) {
  .mail-wrap { align-items: flex-start; }
  .js .platform { transform: translateY(20px); }
  .js .platform.in { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js .platform, .js .traits dt, .js .traits dd { opacity: 1; transform: none; }
  .js .traits div::before { transform: scaleX(1); }
  .field i { width: 70%; }
  .bars i { height: var(--h); }
  .scan { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition: none !important; }
}
