/* Steunplek: één gedurfd element (de maandbalans), de rest rustig en goed leesbaar. */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/assets/fonts/bricolage-grotesque-latin-opsz.a79fdb52d4a5.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/assets/fonts/atkinson-hyperlegible-next-latin-wght.18b2a1a39a2f.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #15231e;
  --muted: #4a5a52;
  --pine: #12483a;
  --pine-deep: #0c362b;
  --sun: #ffc845;
  --sun-soft: #ffd978;
  --tint: #f1f5f0;
  --paper: #ffffff;
  --line: #d6dfd8;
  --need: #e6ede7;
  --seg-domi: #1f6b4f;
  --seg-gift: #3aa36c;
  --seg-event: #f3b93c;
  --seg-subsidy: #8cc9a8;
  --font-display: 'Bricolage Grotesque', 'Arial Narrow', Arial, sans-serif;
  --font-text: 'Atkinson Hyperlegible Next', 'Segoe UI', Roboto, Arial, sans-serif;
  --gutter: clamp(20px, 4vw, 40px);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.125rem;
  line-height: 1.6;
}

[hidden] {
  display: none !important;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.75rem, 1.55rem + 5vw, 5.5rem);
  font-weight: 780;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(2rem, 1.35rem + 2.2vw, 3rem);
  font-weight: 760;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--pine);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--pine);
  outline-offset: 3px;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--pine);
  color: #fff;
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

/* Knoppen */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font-text);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.button-primary {
  background: var(--pine);
  color: #fff;
}

.button-primary:hover {
  background: var(--pine-deep);
}

.button-secondary {
  border-color: var(--pine);
  color: var(--pine);
}

.button-secondary:hover {
  background: rgba(18, 72, 58, 0.08);
}

.button-sun {
  background: var(--sun);
  color: var(--ink);
}

.button-sun:hover {
  background: var(--sun-soft);
}

.button-compact {
  min-height: 44px;
  padding: 0 18px;
  font-size: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
}

/* Header en footer */

.site-header {
  background: var(--tint);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 80px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a,
.header-login {
  padding-block: 8px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.header-login:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-login {
  color: var(--pine);
  font-weight: 700;
}

.site-footer {
  padding-block: 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 1rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 48px;
  align-items: start;
}

.footer-brand p {
  max-width: 34ch;
  margin-top: 12px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 24px;
  max-width: 560px;
}

.footer-nav a {
  color: var(--ink);
}

.footer-copy {
  grid-column: 1 / -1;
  font-size: 0.9375rem;
}

/* Hero en voorbeeldbalans */

.hero {
  padding-block: clamp(40px, 6vw, 88px) clamp(56px, 7vw, 96px);
  background: var(--tint);
}

.hero-intro {
  max-width: 980px;
}

.lead {
  max-width: 40em;
  margin-top: 24px;
  color: var(--muted);
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.375rem);
  line-height: 1.55;
}

.balance {
  margin: clamp(40px, 5vw, 64px) 0 0;
  padding: clamp(20px, 3.5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 24px 48px -32px rgba(18, 72, 58, 0.45);
}

.balance-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.balance-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.balance-carried {
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.125rem;
}

.balance-figure {
  margin-right: 0.15em;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 2rem + 3vw, 4.25rem);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.02em;
}

.bar {
  display: flex;
  gap: 3px;
  height: clamp(44px, 5vw, 64px);
  margin-top: 20px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--paper);
}

.bar-covered {
  display: flex;
  flex: 845 1 0%;
  gap: 3px;
  min-width: 0;
  transition: flex-grow 0.7s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.segment {
  flex: 0 1 0%;
  min-width: 0;
  transition: flex-grow 0.7s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.segment-domi {
  flex-grow: 400;
  background: var(--seg-domi);
}

.segment-gift {
  flex-grow: 230;
  background: var(--seg-gift);
}

.segment-event {
  flex-grow: 125;
  background: var(--seg-event);
}

.segment-subsidy {
  flex-grow: 90;
  background: var(--seg-subsidy);
}

.bar-need {
  flex: 395 1 0%;
  min-width: 0;
  background: repeating-linear-gradient(-45deg, rgba(18, 72, 58, 0.17) 0 2px, transparent 2px 9px) var(--need);
  transition: flex-grow 0.7s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.bar-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
}

.bar-caption strong,
.legend strong {
  color: var(--ink);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.swatch-domi {
  background: var(--seg-domi);
}

.swatch-gift {
  background: var(--seg-gift);
}

.swatch-event {
  background: var(--seg-event);
}

.swatch-subsidy {
  background: var(--seg-subsidy);
}

.examples {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.examples-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.examples-hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 1rem;
}

.example-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.example,
.example-button {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--tint);
}

/* Met JavaScript wordt elk voorbeeld een knop die de volle hoogte van de rij vult. */
.balance.is-interactive .example {
  display: flex;
  padding: 0;
  background: none;
}

.example-button {
  position: relative;
  flex: 1 1 auto;
  margin: 0;
  padding-left: 52px;
  border: 2px solid transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.example-button:hover {
  border-color: #a9c0b3;
}

.example-button::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 18px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--pine);
  border-radius: 6px;
  background: var(--paper);
}

.example-button[aria-pressed='true'] {
  border-color: var(--pine);
  background: var(--paper);
}

.example-button[aria-pressed='true']::before {
  background: var(--pine);
}

.example-button[aria-pressed='true']::after {
  content: '';
  position: absolute;
  top: 22px;
  left: 26px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.example-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.example-effect {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.is-changed {
  animation: number-flash 1.4s ease-out;
}

.segment.is-changed {
  animation: segment-glow 1.4s ease-out;
}

@keyframes number-flash {
  0%,
  35% {
    background-color: rgba(255, 200, 69, 0.6);
  }
  100% {
    background-color: rgba(255, 200, 69, 0);
  }
}

@keyframes segment-glow {
  0%,
  35% {
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.95);
    filter: brightness(1.12);
  }
  100% {
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0);
    filter: none;
  }
}

@keyframes bar-fill {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .bar-covered {
    animation: bar-fill 1.2s cubic-bezier(0.22, 0.8, 0.24, 1) 0.2s both;
  }
}

/* Secties */

.section {
  padding-block: clamp(64px, 9vw, 120px);
}

.section-tinted {
  background: var(--tint);
}

.section h2 {
  max-width: 22ch;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
  margin: clamp(28px, 4vw, 48px) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

/* De balk boven elke stap groeit mee met de volgorde, net als de maandbalans. */
.steps li {
  --fill: 33.4%;
  counter-increment: step;
}

.steps li:nth-child(2) {
  --fill: 66.7%;
}

.steps li:nth-child(3) {
  --fill: 100%;
}

.steps li::before {
  content: '';
  display: block;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--seg-gift) var(--fill), var(--line) var(--fill));
}

.steps h3::before {
  content: counter(step);
  display: block;
  margin: 20px 0 8px;
  color: var(--pine);
  font-size: 3rem;
  font-weight: 780;
  line-height: 1;
}

.steps p {
  margin-top: 8px;
  color: var(--muted);
}

.audiences {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(28px, 4vw, 48px);
}

.audience h3 {
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.features {
  margin: 0;
}

.features div {
  padding-block: 18px;
  border-top: 1px solid var(--line);
}

.features dt {
  font-weight: 700;
}

.features dd {
  max-width: 52ch;
  margin: 4px 0 0;
  color: var(--muted);
}

.campaign-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}

.campaign-text p {
  max-width: 52ch;
  margin-top: 20px;
  color: var(--muted);
}

.campaign {
  margin: 0;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
}

.campaign-name {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
}

.campaign-bar {
  height: 18px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 9px;
  background: #f1ead6;
}

.campaign-fill {
  display: block;
  width: 39.375%;
  height: 100%;
  background: var(--sun);
}

.campaign-figures {
  margin-top: 14px;
  color: var(--muted);
}

.campaign-figures strong {
  margin-right: 0.15em;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 760;
}

.campaign-count {
  color: var(--muted);
  font-size: 1rem;
}

.faq-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 32px clamp(32px, 6vw, 96px);
  align-items: start;
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  padding: 20px 48px 20px 0;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 6px;
  width: 18px;
  height: 18px;
  background:
    linear-gradient(var(--pine), var(--pine)) center / 18px 2.5px no-repeat,
    linear-gradient(var(--pine), var(--pine)) center / 2.5px 18px no-repeat;
  transform: translateY(-50%);
}

.faq details[open] summary::after {
  background: linear-gradient(var(--pine), var(--pine)) center / 18px 2.5px no-repeat;
}

.faq details p {
  max-width: 62ch;
  padding-bottom: 22px;
  color: var(--muted);
}

.closing {
  padding-block: clamp(64px, 8vw, 112px);
  background: var(--pine);
  color: #fff;
}

.closing h2 {
  max-width: 18ch;
}

.closing p {
  max-width: 52ch;
  margin-top: 16px;
  color: #d5e6dc;
  font-size: 1.1875rem;
}

.closing .button {
  margin-top: 32px;
}

.closing :focus-visible {
  outline-color: var(--sun);
}

/* Losse pagina's */

.page {
  padding-block: clamp(56px, 8vw, 104px);
}

/* Leesbare kolom, links uitgelijnd met de header en footer. */
.page-narrow > * {
  max-width: 760px;
}

.page h1 {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.75rem);
  line-height: 1.02;
}

.page .lead {
  margin-top: 20px;
}

.note {
  max-width: 56ch;
  margin-top: 24px;
  color: var(--muted);
  font-size: 1rem;
}

.legal h2 {
  margin: 40px 0 8px;
  font-size: 1.5rem;
  line-height: 1.2;
}

.legal p + p {
  margin-top: 12px;
}

.legal-version {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
}

/* Smallere schermen */

@media (max-width: 960px) {
  .site-nav {
    display: none;
  }

  .faq-layout,
  .campaign-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .audiences {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .header-inner {
    gap: 12px;
    min-height: 68px;
  }

  .header-login {
    display: none;
  }

  .brand-name {
    font-size: 1.3rem;
  }

  .button-compact {
    padding: 0 14px;
    font-size: 0.9375rem;
  }

  .actions .button {
    flex: 1 1 100%;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
