/* Self-hosted fonts (SIL OFL 1.1, licences in assets/fonts). No third-party requests. */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url('../fonts/instrument-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url('../fonts/instrument-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Logo only: the wordmark uses basic Latin, so no extended subset */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 600;
  font-display: swap;
  src: url('../fonts/inter-tight-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

:root {
  /* Brand palette (docs/brand.md) */
  --core: #0f2a44;
  --core-700: #1a3858;
  --core-600: #2a4a6d;
  --core-300: #afc0d2;
  --signal: #f2541b;
  --signal-ink: #c9400f;
  --ink-900: #0b1826;
  --slate: #4a5563;
  --stone: #687282;
  --paper: #faf8f5;
  --white: #ffffff;
  --mist: #e6edf3;
  --line-warm: #e3ded6;
  --dim: #7b8594; /* unlit manifesto words: 3.1:1 on Mist, still clearly lighter than Ink */

  /* Semantic roles */
  --bg: var(--paper);
  --ink: var(--ink-900);
  --ink-2: var(--slate);
  --muted: var(--stone);
  --line: var(--line-warm);
  --accent: var(--signal);
  --primary: var(--core);
  --primary-hover: var(--core-700);
  --danger: #b3261e;

  --font: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-logo: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --stretch-display: 100%;
  --stretch-heading: 100%;
  --content: min(calc(var(--wrap) - 2 * var(--gutter)), calc(100% - 2 * var(--gutter)));
  --header-h: 4.25rem;

  /* Type scale: size / leading / tracking move together */
  --fs-display: clamp(2rem, min(8.6vw, 9svh), 7rem);
  --fs-h2: clamp(2rem, 4vw, 3.25rem);
  --fs-h3: clamp(1.25rem, 1.6vw, 1.5rem);
  --fs-lead: clamp(1.125rem, 1.4vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-micro: 0.8125rem;

  --lh-display: 0.96;
  --lh-heading: 1.05;
  --lh-snug: 1.25;
  --lh-body: 1.6;

  --tr-display: -0.035em;
  --tr-heading: -0.028em;
  --tr-snug: -0.02em;
  --tr-body: -0.006em;
  --tr-micro: 0.01em;

  /* 4px spacing grid */
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  --wrap: 1280px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(5rem, 11vw, 9rem);
  --radius: 6px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --step-gap: 160ms;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }

/* Cross-document page transitions where supported */
@view-transition { navigation: auto; }

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
  font-optical-sizing: auto;
  font-kerning: normal;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }

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

h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  padding: var(--sp-2) var(--sp-4);
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
  text-decoration: none;
  z-index: 20;
}
.skip:focus { top: var(--sp-4); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--signal); color: var(--ink); }

/* Buttons and links */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1;
  color: var(--white);
  background: var(--primary);
  border: 0;
  border-radius: var(--radius);
  padding: 0.95rem 1.35rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease;
}
.button:hover { background: var(--primary-hover); }
.button:disabled { opacity: 0.55; cursor: wait; }
.button .arrow { width: 1rem; height: 1rem; transition: transform 0.35s var(--ease-out); }
.button:hover .arrow { transform: translateX(3px); }
.button-sm { padding: 0.7rem 1rem; white-space: nowrap; }

.button.is-busy { position: relative; color: transparent; }
.button.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--white);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link {
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 3px;
  background:
    linear-gradient(var(--signal), var(--signal)) left bottom / 0 1px no-repeat,
    linear-gradient(var(--line), var(--line)) left bottom / 100% 1px no-repeat;
  transition: background-size 0.5s var(--ease-out);
}
.link:hover { background-size: 100% 1px, 100% 1px; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.top.is-scrolled { border-bottom-color: var(--line); }

/* Reading progress: native scroll-driven animation, hidden where unsupported */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 30;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  .progress {
    animation: progress linear both;
    animation-timeline: scroll(root);
  }
}
@keyframes progress { to { transform: scaleX(1); } }

.top-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  height: var(--header-h);
}

/* Wordmark from the original nxtcore.be logo: Inter Tight, NXT light, CORE 600.
   NXT is weight 100 at display size; small sizes need 300 to keep the same visual weight. */
.brand {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-logo);
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  margin-right: auto;
}
.brand-light { font-weight: 300; }
.brand-bold { font-weight: 600; }
.brand-dot {
  display: inline-block;
  width: max(0.076em, 5px);
  height: max(0.076em, 5px);
  margin-left: 0.1em;
  border-radius: 1px;
  background: var(--signal);
}

.nav { display: flex; gap: var(--sp-8); font-size: var(--fs-small); }
.nav a { color: var(--ink-2); text-decoration: none; transition: color 0.2s ease; }
.nav a:hover { color: var(--ink); }
.nav a { position: relative; }

.lang-switch {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.lang-switch:hover { color: var(--ink); border-color: var(--ink-2); }
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.nav a.is-current { color: var(--ink); }
.nav a.is-current::after { transform: scaleX(1); }

/* Hero: pinned full-viewport stage; scrolling through the track untangles the graphic */
.hero-track { height: 200svh; }

.hero {
  position: sticky;
  top: var(--header-h);
  height: calc(100svh - var(--header-h));
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: space-between;
  padding-block: clamp(1.25rem, 4svh, 3.5rem) clamp(1.25rem, 3svh, 2.5rem);
}

.statement {
  font-weight: 500;
  font-stretch: var(--stretch-display);
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
}
.statement .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.statement .line > span {
  display: block;
  animation: line-up 1.1s var(--ease-out) both;
}
.statement .line:nth-child(2) > span { animation-delay: 0.08s; }
.statement .line:nth-child(3) > span { animation-delay: 0.16s; }
.statement .accent { color: var(--signal); }
@keyframes line-up {
  from { transform: translateY(105%); }
  to   { transform: none; }
}

.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 34rem) auto;
  justify-content: space-between;
  align-items: end;
  gap: var(--sp-6) var(--sp-16);
}

.lede {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--ink-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4) var(--sp-8);
}

.intro { animation: rise 1s var(--ease-out) 0.35s both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* Convergence graphic: draws on load, morphs from chaos to order on scroll (site.js) */
.convergence { padding-block: clamp(0.75rem, 2.5svh, 2rem); }
/* Width-driven: the graphic always spans the content width, height follows */
.convergence-svg {
  display: block;
  width: var(--content);
  height: auto;
  margin-inline: auto;
  overflow: visible;
}

.convergence-lines path {
  fill: none;
  stroke: var(--core);
  stroke-width: 1.1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.convergence-dot {
  fill: var(--signal);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.8s var(--ease-out);
}

.convergence-labels {
  position: relative;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  width: var(--content);
  margin-inline: auto;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-micro);
  color: var(--muted);
}
.convergence-labels li { position: relative; transition: opacity 0.6s ease, color 0.6s ease; }
.convergence-labels li:last-child { justify-self: end; }
.convergence-labels span { margin-right: var(--sp-3); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.convergence-labels li:nth-child(2) { justify-self: center; }
.convergence-labels li:last-child { color: var(--ink); }
.js .convergence-labels li { transition: opacity 0.6s ease, color 0.4s ease; }
.js .convergence-labels li.is-on:not(.is-current) { color: var(--muted); }
.js .convergence-labels li.is-current { color: var(--ink); }
.js .convergence-labels li.is-current span { color: var(--signal-ink); }

.scroll-hint { display: none; }
.js .scroll-hint {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: var(--content);
  margin: 0 auto var(--sp-2);
  justify-content: flex-end;
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-micro);
  color: var(--ink-2);
  opacity: calc(1 - var(--order, 0) * 1.4);
  transition: opacity 0.3s ease;
}
/* Progress bar on the label rule: fills with the untangle progress (--order);
   each label has a square marker that turns Signal once the rail passes it */
.js .convergence-labels::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: var(--signal);
  transform: scaleX(var(--order, 0));
  transform-origin: left;
}
.js .convergence-labels li::before {
  content: "";
  position: absolute;
  top: calc(-1 * var(--sp-3) - 5px);
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: var(--paper);
  border: 1px solid var(--core-300);
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.4s var(--ease-spring);
}
.js .convergence-labels li:nth-child(2)::before { left: 50%; margin-left: -4px; }
.js .convergence-labels li:last-child::before { left: auto; right: 0; }
.js .convergence-labels li.is-passed::before {
  background: var(--signal);
  border-color: var(--signal);
  transform: scale(1.25);
}

.js .convergence-lines path { stroke-dashoffset: 1; }
.js .convergence-dot { transform: scale(0); }
.js .convergence.is-done .convergence-dot { transform: none; }
.js .convergence-labels li { opacity: 0.25; }
.js .convergence-labels li.is-on { opacity: 1; }

/* Manifesto: words light up with scroll progress (site.js) */
.manifesto { padding-block: var(--section); }

.manifesto-text {
  max-width: 26ch;
  font-weight: 500;
  font-stretch: var(--stretch-heading);
  font-size: clamp(1.875rem, 4.2vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: var(--tr-heading);
}
.manifesto-text .accent { display: block; margin-top: 0.4em; color: var(--signal); }

.js .manifesto-text .word { color: var(--dim); transition: color 0.35s ease; }
.js .manifesto-text .word.is-lit { color: var(--ink); }
.js .manifesto-text .accent .word.is-lit { color: var(--signal); }

/* Closing promise (variant page) */
.closing { padding-block: var(--section); }

.closing-text {
  max-width: 24ch;
  font-weight: 500;
  font-stretch: var(--stretch-heading);
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
}
/* The promise runs across the section, under the statement. */
.closing-note {
  margin-top: var(--sp-8);
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--ink-2);
  text-wrap: pretty;
}
.closing-tagline {
  margin-top: clamp(var(--sp-12), 6vw, 5rem);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--core-300);
  font-size: var(--fs-small);
  letter-spacing: var(--tr-micro);
  text-transform: uppercase;
  color: var(--signal-ink);
}

/* Sections */
.section { padding-block: var(--section); }

.section-head { margin-bottom: clamp(var(--sp-12), 6vw, 5rem); }

.section-title {
  font-weight: 500;
  font-stretch: var(--stretch-heading);
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
  max-width: 18ch;
}

/* A title that sets its own line breaks needs the room to use them. */
.section-title:has(br) { max-width: 36ch; }

/* One-sentence section titles that should stay on a single line. */
#background-title { max-width: 32ch; }

/* Approach: four columns divided by fine rules */
.pillars {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--core);
}

.pillars-3 { grid-template-columns: repeat(3, 1fr); }

.pillar {
  position: relative;
  padding: var(--sp-8) var(--sp-8) var(--sp-4) 0;
}
.pillar + .pillar { padding-left: var(--sp-8); border-left: 1px solid var(--line); }
.pillar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}
.pillar:hover::before { transform: scaleX(1); }

.pillar-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--sp-6);
}

.pillar-num {
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-micro);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* Line icons (pillars and principles): motif language, draw in when revealed */
.line-icon { width: clamp(3.5rem, 5vw, 4.5rem); height: auto; aspect-ratio: 1; overflow: visible; }
.line-icon path {
  fill: none;
  stroke: var(--core);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.dark .line-icon path { stroke: var(--white); }
.line-icon-dot {
  fill: var(--signal);
  transform-box: fill-box;
  transform-origin: center;
}
.js [data-step] .line-icon path {
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.2s cubic-bezier(.65, 0, .35, 1) calc(var(--i, 0) * var(--step-gap) + 450ms);
}
.js [data-step] .line-icon-dot {
  transform: scale(0) rotate(-45deg);
  transition: transform 0.6s var(--ease-spring) calc(var(--i, 0) * var(--step-gap) + 1400ms);
}
.js [data-step].is-active .line-icon path { stroke-dashoffset: 0; }
.js [data-step].is-active .line-icon-dot { transform: none; }
.js [data-step].is-active:hover .line-icon-dot { transform: rotate(90deg); transition-delay: 0s; }

/* Step groups: when a group enters the viewport (site.js adds .is-playing), a
   Signal rail runs along the top rule and the columns jump in one after another */
.pillars,
.principles { position: relative; }
.js .pillars::after,
.js .principles::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
  transition: transform 1.4s cubic-bezier(.65, 0, .35, 1) 0.1s;
}
.js .pillars.is-playing::after,
.js .principles.is-playing::after { transform: scaleX(1); }

.js [data-scroll-steps] [data-step] {
  opacity: 0;
  transform: translateY(48px) scale(0.97);
  transition:
    opacity 0.5s ease calc(var(--i, 0) * var(--step-gap) + 150ms),
    transform 0.9s var(--ease-spring) calc(var(--i, 0) * var(--step-gap) + 150ms);
}
.js [data-scroll-steps] [data-step].is-active { opacity: 1; transform: none; }
.js .next [data-step] span { transition: color 0.4s ease calc(var(--i, 0) * var(--step-gap) + 500ms); }
.js .next [data-step].is-active span { color: var(--signal-ink); }

.pillar h3 {
  font-weight: 500;
  font-stretch: var(--stretch-heading);
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
  margin-bottom: var(--sp-4);
}

.pillar-when { font-weight: 500; margin-bottom: var(--sp-3); }
.pillar p:last-child { color: var(--ink-2); font-size: var(--fs-small); }

/* Section bands: light sections alternate Paper and Mist; principles is the Navy band */
.band-paper { background: var(--paper); }
.band-mist { background: var(--mist); }

/* Principles: the dark band */
.dark {
  padding-block: var(--section);
  color: var(--white);
  background: var(--core);
}

.principles {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--core-600);
}

.principle { padding: var(--sp-8) var(--sp-8) 0 0; }
.principle + .principle { padding-left: var(--sp-8); border-left: 1px solid var(--core-600); }

.principle .line-icon { display: block; margin-bottom: var(--sp-6); }

.principle h3 {
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-snug);
  margin-bottom: var(--sp-3);
}
.principle p { color: var(--core-300); max-width: 34ch; }

/* Contact */
.contact {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(var(--sp-12), 7vw, 7rem);
}

.contact-intro .section-title { margin-bottom: var(--sp-6); }
.contact-intro > p { color: var(--ink-2); max-width: 30rem; }

.next {
  list-style: none;
  margin-top: var(--sp-8);
  border-top: 1px solid var(--core-300);
  font-size: var(--fs-small);
}
.next li {
  display: flex;
  gap: var(--sp-4);
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--core-300);
}
.next span { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.contact-mail { margin-top: var(--sp-8); color: var(--ink-2); }

.form {
  display: grid;
  gap: var(--sp-12);
  align-content: start;
}
.field-full { grid-column: 1 / -1; }

/* Form steps: 01 topic, 02 topic-specific and shared questions, 03 contact */
.form-step {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6) var(--sp-4);
}
.form-step-title {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: 0;
  margin-bottom: var(--sp-4);
  font-weight: 500;
  font-size: 1.125rem;
  letter-spacing: var(--tr-snug);
}
.form-step-title span {
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  color: var(--signal-ink);
}

.topic-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}
.topic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.85rem 2.25rem 0.85rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.topic-card:last-child { grid-column: 1 / -1; }
.topic-card:hover { border-color: var(--core-300); }
.topic-card input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.topic-card::after {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 10px;
  height: 10px;
  border: 1px solid var(--core-300);
  border-radius: 2px;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.3s var(--ease-spring);
}
.topic-card:has(input:checked) { border-color: var(--core); box-shadow: inset 0 0 0 1px var(--core); }
.topic-card:has(input:checked)::after { background: var(--signal); border-color: var(--signal); transform: scale(1.2); }
.topic-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.topic-name { font-weight: 500; }
.topic-hint { font-size: var(--fs-small); color: var(--ink-2); }

.topic-fields,
.common-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6) var(--sp-4);
}
.topic-fields .field:only-child,
.common-fields .field:first-child { grid-column: 1 / -1; }

.optional { font-weight: 400; color: var(--muted); }

.field-choice { border: 0; margin: 0; padding: 0; min-width: 0; }
.field-choice legend {
  padding: 0;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-small);
  font-weight: 500;
}
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  position: relative;
  padding: 0.5rem 0.9rem;
  font-size: var(--fs-small);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.chip:hover { border-color: var(--core-300); }
.chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.chip:has(input:checked) { color: var(--white); background: var(--core); border-color: var(--core); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Reveal the next steps once a topic is chosen. Without :has() support all steps stay visible. */
@supports selector(:has(*)) {
  .form .form-details,
  .form .form-contact,
  .form .form-foot,
  .form .topic-fields { display: none; }
  .form:has(input[name="topic"]:checked) .form-details,
  .form:has(input[name="topic"]:checked) .form-contact { display: grid; animation: rise 0.6s var(--ease-out) both; }
  .form:has(input[name="topic"]:checked) .form-foot { display: flex; }
  .form:has(input[name="topic"][value="strategy"]:checked) .topic-fields[data-topic="strategy"],
  .form:has(input[name="topic"][value="architecture"]:checked) .topic-fields[data-topic="architecture"],
  .form:has(input[name="topic"][value="delivery"]:checked) .topic-fields[data-topic="delivery"],
  .form:has(input[name="topic"][value="execution"]:checked) .topic-fields[data-topic="execution"] { display: grid; }
}

.field label {
  display: block;
  font-size: var(--fs-small);
  font-weight: 500;
  margin-bottom: var(--sp-2);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { resize: vertical; min-height: 10rem; line-height: 1.5; }
.field select {
  padding-right: 2.25rem;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%230f2a44' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 0.75rem center / 1rem no-repeat;
  cursor: pointer;
}
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--core-300); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--core);
  box-shadow: 0 0 0 3px rgba(15, 42, 68, 0.12);
}
.field [aria-invalid="true"] { border-color: var(--danger); }

.field-error { margin-top: var(--sp-2); font-size: var(--fs-small); color: var(--danger); }

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4) var(--sp-6);
}
.privacy { font-size: var(--fs-micro); color: var(--ink-2); }

.form-status:empty { display: none; }
.form-status.is-error { color: var(--danger); }
.form-status.is-success {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-snug);
  animation: rise 0.8s var(--ease-out) both;
}
.form-status.is-success::before {
  content: "";
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 1.3rem no-repeat,
    var(--core);
}
/* After sending only the confirmation stays; !important beats the :has() reveal rules */
.form.is-sent .form-step,
.form.is-sent .form-foot { display: none !important; }

/* Footer */
.foot { padding-block: var(--sp-8); }

.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-6);
  font-size: var(--fs-small);
  color: var(--muted);
}

/* Long-form pages (privacy) */
.prose { padding-block: var(--section); }
.prose > * { max-width: 46rem; }
.prose .section-title { margin-bottom: var(--sp-3); }
.prose-updated { color: var(--ink-2); font-size: var(--fs-small); margin-bottom: var(--sp-12); }
.prose h2 {
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-snug);
  margin: var(--sp-12) 0 var(--sp-3);
}
.prose p { color: var(--ink-2); max-width: 65ch; }
.prose p + p { margin-top: var(--sp-4); }

.foot-links { display: flex; gap: var(--sp-6); }
.privacy a { color: inherit; }

/* Fallback pages (404, contact.php without JS) */
.fallback { padding-block: var(--section); min-height: 70vh; }
.fallback .actions { margin-top: var(--sp-12); }
.fallback p { color: var(--ink-2); }

/* Scroll reveal: hidden state only when JS is running */
.js .reveal {
  opacity: 0;
  transform: translateY(56px);
  transition: opacity 0.6s ease, transform 1s var(--ease-spring);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* Reduced motion: keep fades, line drawing and colour changes; drop movement,
   springs and the pinned scroll morph */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-track { height: auto; }
  .hero { position: relative; top: 0; height: auto; min-height: calc(100svh - var(--header-h)); }
  .js .scroll-hint { display: none; }
  .statement .line > span,
  .intro { animation-name: fade-in; }
  .js .reveal { transform: none; transition: opacity 0.8s ease; }
  .js [data-scroll-steps] [data-step] {
    transform: none;
    transition: opacity 0.6s ease calc(var(--i, 0) * var(--step-gap) + 150ms);
  }
  .js [data-step] .line-icon-dot { transform: scale(0); transition-timing-function: ease; }
  .js [data-step].is-active .line-icon-dot,
  .js [data-step].is-active:hover .line-icon-dot { transform: none; }
  .button:hover .arrow { transform: none; }
}

/* Short screens: no pinning, let the hero flow */
@media (max-height: 560px) {
  .hero-track { height: auto; }
  .hero { position: relative; top: 0; height: auto; }
}

@media (max-width: 1000px) {
  .pillars { grid-template-columns: 1fr 1fr; }
  .pillars-3 { grid-template-columns: 1fr; }
  .pillars-3 .pillar,
  .pillars-3 .pillar + .pillar { padding-left: 0; border-left: 0; }
  .pillars-3 .pillar + .pillar { border-top: 1px solid var(--line); }
  .pillar:nth-child(3) { padding-left: 0; border-left: 0; }
  .pillar:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .hero-foot { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
  .principle,
  .principle + .principle { padding: var(--sp-8) 0; border-left: 0; }
  .principle + .principle { border-top: 1px solid var(--core-600); }
  .principle .line-icon { margin-bottom: var(--sp-6); }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .pillars { grid-template-columns: 1fr; }
  .pillar,
  .pillar + .pillar { padding: var(--sp-8) 0; border-left: 0; }
  .pillar + .pillar { border-top: 1px solid var(--line); }
  .convergence-lines path { stroke-width: 2.4; }
  .convergence-labels { grid-template-columns: 1fr auto; }
  .convergence-labels li:nth-child(2) { display: none; }
  .form-step,
  .topic-grid,
  .topic-fields,
  .common-fields { grid-template-columns: 1fr; }
  .foot-row { flex-direction: column; }
}
