@font-face {
  font-family: Bricolage;
  src: url(/fonts/bricolage.woff2) format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Caveat;
  src: url(/fonts/caveat-latin-400-normal.woff2) format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Caveat;
  src: url(/fonts/caveat-latin-700-normal.woff2) format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  /* zand als ondergrond, lava als tekst, vulkaanrood voor de actie */
  --bg: oklch(96.5% 0.013 75);
  --surface: oklch(99.2% 0.004 75);
  --ink: #2b2724;
  --ink-2: oklch(44% 0.025 50);
  --line: oklch(87% 0.018 70);
  --accent: oklch(50% 0.155 33);
  --accent-press: oklch(44% 0.15 33);
  --accent-tint: oklch(94% 0.03 40);
  --focus: oklch(50% 0.155 33);

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --font: Bricolage, ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  font-optical-sizing: auto;
  caret-color: var(--accent);
}
::selection { background: oklch(85% 0.07 40); color: var(--ink); }
img, canvas { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.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: 10;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
}
.skip:focus { top: 12px; }

.wrap { width: min(100% - 40px, 1160px); margin-inline: auto; }

/* kop */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: -0.01em; font-size: 1.05rem; }
.brand span { color: var(--ink-2); font-weight: 500; }
.lang select {
  font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  min-height: 44px; padding: 0 36px 0 12px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b2724' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}

.intro { padding-block: 8px 28px; }
h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem);
  line-height: 1.04; letter-spacing: -0.03em; font-weight: 700;
  margin: 0 0 12px; text-wrap: balance; max-width: 18ch;
}
.lede { margin: 0; font-size: 1.125rem; color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }
h2 { font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 6px; }
.h3, h3 { font-size: 1.05rem; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
.muted { color: var(--ink-2); margin: 0 0 16px; text-wrap: pretty; }

.layout { display: grid; gap: 40px; padding-bottom: 64px; }
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: start; }
}

/* kaart met omdraai-effect */
.stage { perspective: 1800px; }
.card3d {
  all: unset; display: block; position: relative; width: 100%; aspect-ratio: 148 / 105;
  transform-style: preserve-3d; cursor: pointer;
  transition: transform 700ms var(--ease-in-out);
  border-radius: 4px;
}
.card3d:focus-visible { outline: 3px solid var(--focus); outline-offset: 6px; }
.card3d.is-back { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 4px; overflow: hidden; background: #f4efe8;
  box-shadow: 0 1px 2px rgb(43 39 36 / 0.12), 0 12px 32px -8px rgb(43 39 36 / 0.35);
}
.face img, .face canvas { width: 100%; height: 100%; object-fit: cover; }
.face-back { transform: rotateY(180deg); }

@media (prefers-reduced-motion: reduce) {
  .card3d { transition: none; transform: none !important; }
  .face { transition: opacity 200ms ease; backface-visibility: visible; }
  .face-back { transform: none; opacity: 0; }
  .card3d.is-back .face-back { opacity: 1; }
  .card3d.is-back .face-front { opacity: 0; }
}

.flip { margin: 14px auto 28px; }
.flip svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* kaartkeuze */
.picker { display: flex; gap: 12px; overflow-x: auto; padding: 10px 2px 6px; margin-bottom: 20px; scrollbar-width: thin; }
.pick {
  all: unset; flex: 0 0 auto; width: 128px; cursor: pointer; border-radius: var(--r-sm);
  text-align: center; font-size: 0.9rem; color: var(--ink-2);
}
.pick img { width: 128px; aspect-ratio: 148 / 105; object-fit: cover; border-radius: 4px; outline: 2px solid transparent; outline-offset: 3px; margin-bottom: 6px; transition: outline-color 150ms ease; }
.pick[aria-checked="true"] { color: var(--ink); font-weight: 600; }
.pick[aria-checked="true"] img { outline-color: var(--accent); }
.pick:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

/* formulier */
.fields { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label, .label-row label { font-weight: 600; font-size: 0.95rem; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.count { font-size: 0.85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.count.low { color: var(--accent); font-weight: 600; }
input, textarea, .test select {
  font: inherit; color: var(--ink); width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 13px; min-height: 48px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea { resize: vertical; min-height: 140px; font-family: Caveat, cursive; font-size: 1.55rem; line-height: 1.2; color: #253a6e; }
input::placeholder, textarea::placeholder { color: oklch(50% 0.02 50); opacity: 1; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px oklch(50% 0.155 33 / 0.22); }

/* knoppen */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-sm);
  font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; text-align: center;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-press); }
  .btn-ghost:hover { border-color: var(--ink-2); }
  .card3d:hover .face { box-shadow: 0 1px 2px rgb(43 39 36 / 0.12), 0 16px 40px -8px rgb(43 39 36 / 0.42); }
}
.flip { display: flex; }

/* varianten */
.variants { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.variant {
  display: grid; grid-template-columns: 88px 1fr; gap: 6px 16px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.variant .btn { grid-column: 1 / -1; width: 100%; margin-top: 8px; }
@media (min-width: 560px) {
  .variant .btn { grid-column: 2; width: auto; justify-self: start; margin-top: 6px; }
}
.variant p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.95rem; text-wrap: pretty; }
.variant .ios-note { color: var(--ink); font-size: 0.9rem; }
.tag {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent-tint); color: var(--accent-press); font-size: 0.8rem; font-weight: 700;
  vertical-align: 1px; margin-right: 2px;
}
.thumb {
  width: 88px; height: 88px; border-radius: var(--r-sm); background: var(--ink);
  display: grid; place-items: center; overflow: hidden;
}
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb-pair { grid-template-rows: 1fr 1fr; padding: 6px; gap: 4px; }
.thumb-pair img { height: 100%; }
.linkbox { margin-top: 24px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.linkbox h3 { margin-bottom: 12px; }
.linkbox img { width: 100%; height: auto; border-radius: var(--r-sm); }
.linkbox .url { font-size: 0.95rem; word-break: break-all; margin: 12px 0; }
.linkbox .row { display: flex; flex-wrap: wrap; gap: 10px; }
.linkbox .row .btn { flex: 1 1 180px; }

.save { margin: 24px 0 0; color: var(--ink-2); font-size: 0.95rem; }
.save a { color: var(--ink); display: inline-block; padding-block: 6px; }

.test { margin-top: 28px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--r); font-size: 0.95rem; }
.test summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.test .field { margin: 12px 0; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }

.foot { border-top: 1px solid var(--line); padding-block: 24px 40px; color: var(--ink-2); font-size: 0.95rem; }
.foot p { margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 20;
  width: min(100% - 32px, 460px); padding: 14px 18px; border-radius: var(--r);
  background: var(--ink); color: #fbf6ef; font-size: 0.98rem; line-height: 1.4;
  box-shadow: 0 10px 30px -6px rgb(0 0 0 / 0.4);
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* bekijkpagina van een gedeeld kaartje */
.view { padding-block: 16px 64px; display: grid; gap: 20px; justify-items: center; text-align: center; }
.view .stage { width: min(100%, 860px); }
.view h1 { max-width: 22ch; margin-inline: auto; font-size: clamp(1.7rem, 1.3rem + 2vw, 2.6rem); }
.view .row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
