:root {
  --paper: #efe2c0;
  --paper-2: #e2cf9f;
  --paper-light: #f6ecd2;
  --ink: #3b2b1c;
  --ink-soft: rgba(59, 43, 28, 0.72);
  --ink-faint: rgba(59, 43, 28, 0.22);
  --red: #9e4630;
  --teal: #4f7d75;
  --line: 32px;
  --sc: 'IM Fell English SC', Georgia, serif;
  --fell: 'IM Fell English', Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 40px; }
html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--fell);
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 248, 228, 0.7), transparent 70%),
    var(--paper);
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- papier & kader (zoals de Alumni Eilanden) ---------- */

.paper-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: multiply;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(120, 76, 28, 0.32) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='s'><feTurbulence type='fractalNoise' baseFrequency='0.006' numOctaves='3' seed='4'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.38  0 0 0 0 0.16  0 0 0 0.3 -0.08'/></filter><rect width='100%' height='100%' filter='url(%23s)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0 0.12  0 0 0 0.24 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.frame {
  position: fixed;
  inset: 10px;
  z-index: 6;
  border: 2px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: -8px;
  pointer-events: none;
}
.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  background: var(--paper);
  border: 2px solid var(--ink);
}
.corner::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1.5px solid var(--ink);
  transform: rotate(45deg);
}
.corner.tl { top: -13px; left: -13px; }
.corner.tr { top: -13px; right: -13px; }
.corner.bl { bottom: -13px; left: -13px; }
.corner.br { bottom: -13px; right: -13px; }

/* ---------- pagina ---------- */

.page {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 34px 44px 150px;
}

/* ---------- held: oester + titel ---------- */

.hero {
  position: relative;
  display: grid;
  justify-items: center;
  margin-bottom: 34px;
}
.oester {
  width: min(100%, 760px);
  height: clamp(250px, 40vw, 380px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.4s ease, transform 1.4s ease;
}
.oester.klaar { opacity: 1; transform: none; }
.oester.geen-3d { display: none; }
.oester canvas { display: block; width: 100%; height: 100%; }

.cartouche {
  position: relative;
  margin-top: -18px;
  padding: 14px 40px 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--ink), 4px 6px 0 5px rgba(59, 43, 28, 0.18);
  text-align: center;
}
.cartouche h1 {
  font-family: var(--sc);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.05;
  margin: 0;
  letter-spacing: 0.03em;
}
.cartouche p {
  margin: 4px 0 0;
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
}
.cartouche::before, .cartouche::after {
  content: '❦';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--ink);
  opacity: 0.8;
}
.cartouche::before { left: 12px; transform: translateY(-50%) scaleX(-1); }
.cartouche::after { right: 12px; }

/* ---------- kaarten ---------- */

.card {
  position: relative;
  background: rgba(246, 236, 210, 0.62);
  border: 1.5px solid var(--ink);
  box-shadow: 0 0 0 4px rgba(246, 236, 210, 0.62), 0 0 0 5px var(--ink), 5px 7px 0 5px rgba(59, 43, 28, 0.13);
  padding: 30px 40px 28px;
}

.intro {
  max-width: 720px;
  margin: 0 auto 70px;
  text-align: center;
}
.kicker {
  font-family: var(--sc);
  font-size: 15px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin: 0 0 12px;
  color: var(--red);
}
.kicker::before, .kicker::after { content: ' ✦ '; color: var(--ink-soft); letter-spacing: 0; }
.lead { font-size: 20px; line-height: 1.55; margin: 0 0 24px; }
.lead::first-letter {
  font-family: var(--sc);
  font-size: 2.6em;
  float: left;
  line-height: 0.85;
  margin: 6px 8px 0 0;
  color: var(--red);
}
.intro .lead { text-align: left; }
.small { font-size: 15px; font-style: italic; color: var(--ink-soft); line-height: 1.45; margin: 16px 0 0; }

.vooraf {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px 18px;
  align-items: baseline;
  max-width: 520px;
  margin: 10px auto 6px;
  text-align: left;
}
.regel { display: contents; }
.regel label { font-family: var(--sc); font-size: 19px; white-space: nowrap; }
.regel input {
  min-width: 0;
  font: inherit;
  font-size: 20px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px dotted var(--ink);
  padding: 2px 4px 3px;
  border-radius: 0;
}
.regel-label { font-family: var(--sc); font-size: 19px; white-space: nowrap; }
.keuze { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px 0; }
.optie { position: relative; cursor: pointer; }
.optie input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.optie span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 16px 6px 12px;
  font-size: 19px;
  border: 1.5px solid var(--ink);
  background: rgba(255, 251, 240, 0.5);
  box-shadow: 2px 3px 0 rgba(59, 43, 28, 0.18);
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.optie span::before {
  content: '';
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: var(--paper);
  transition: background 0.2s, box-shadow 0.2s;
}
.optie:hover span { background: var(--paper-light); transform: translateY(-1px); }
.optie input:checked + span { background: var(--ink); color: var(--paper); }
.optie input:checked + span::before {
  background: radial-gradient(circle at 36% 32%, #fff 0 18%, #f3eadb 35%, #d9c9c4 100%);
  box-shadow: 0 0 6px rgba(255, 246, 222, 0.9);
}
.optie input:focus-visible + span { outline: 2px dashed var(--red); outline-offset: 3px; }
.regel input::placeholder { color: rgba(59, 43, 28, 0.4); font-style: italic; }
.regel input:focus { outline: none; border-bottom: 2px solid var(--red); background: rgba(255, 250, 235, 0.6); }

/* ---------- knoppen ---------- */

.knop, button {
  display: inline-block;
  font-family: var(--sc);
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  padding: 9px 26px 8px;
  cursor: pointer;
  box-shadow: 2px 3px 0 rgba(59, 43, 28, 0.25);
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s, color 0.12s;
}
.knop:hover, button:hover { background: var(--paper-light); transform: translateY(-1px); box-shadow: 3px 4px 0 rgba(59, 43, 28, 0.25); }
.knop:active, button:active { transform: translateY(1px); box-shadow: 1px 1px 0 rgba(59, 43, 28, 0.25); }
.knop:focus-visible, button:focus-visible { outline: 2px dashed var(--red); outline-offset: 4px; }
.intro .knop { margin-top: 26px; }
.intro .hint { margin-top: 10px; }
.laadfout { font-style: italic; color: var(--red); }
#form { animation: opduiken 0.9s ease both; }
.knop.groot {
  font-size: 24px;
  padding: 13px 40px 12px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--ink), 4px 6px 0 4px rgba(59, 43, 28, 0.2);
}
.knop.groot:hover { background: #4d3a27; }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
#verstuur:disabled { cursor: progress; }
.klein { font-size: 14px; padding: 3px 12px; }

/* ---------- delen ---------- */

.deel { margin: 0 0 40px; }
.deel-kop { text-align: center; margin: 0 0 30px; }
.deel-nr {
  font-family: var(--sc);
  font-size: 16px;
  letter-spacing: 0.3em;
  margin: 0 0 8px;
  color: var(--ink-soft);
}

/* lint zoals de vaandels boven de eilanden */
.lint {
  display: inline-block;
  position: relative;
  margin: 0;
  font-family: var(--sc);
  font-weight: 400;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1;
}
.lint span {
  position: relative;
  display: inline-block;
  padding: 9px 34px 10px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  box-shadow: 2px 3px 0 rgba(59, 43, 28, 0.22);
}
.lint::before, .lint::after {
  content: '';
  position: absolute;
  top: 10px;
  width: 34px;
  height: 100%;
  background: var(--paper-2);
  border: 1.5px solid var(--ink);
  z-index: -1;
}
.lint::before { left: -24px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.lint::after { right: -24px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }
.deel-kop .lint, .kern .lint { isolation: isolate; }

/* ---------- parels (vraagparen) ---------- */

.parel {
  position: relative;
  margin: 0 0 34px;
  padding: 24px 30px 30px;
  background: rgba(246, 236, 210, 0.55);
  border: 1.5px solid var(--ink);
  box-shadow: 5px 7px 0 rgba(59, 43, 28, 0.1);
  transition: box-shadow 0.3s;
}
.parel:focus-within { box-shadow: 5px 7px 0 rgba(59, 43, 28, 0.1), 0 0 0 4px rgba(246, 236, 210, 0.9), 0 0 0 5px var(--ink); }
.parel > header { display: flex; align-items: baseline; gap: 16px; margin: 0 0 18px; flex-wrap: wrap; }
.parel h3 {
  margin: 0;
  font-family: var(--sc);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
}
.parel-nr {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sc);
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--red);
}
.mini-parel { width: 18px; height: 18px; transition: transform 0.4s, filter 0.4s; filter: grayscale(1) opacity(0.45); }
.parel[data-staat='half'] .mini-parel { filter: grayscale(0.4) opacity(0.8); }
.parel[data-staat='vol'] .mini-parel { filter: none; transform: scale(1.25); }

.paar {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  align-items: stretch;
}
.kolom { display: flex; flex-direction: column; min-width: 0; }
.kolom .vraag { flex: 1; }

.tijd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-family: var(--sc);
  font-size: 17px;
  letter-spacing: 0.06em;
}
.tijd em {
  font-family: var(--fell);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0;
  padding: 0 9px 1px;
  border: 1px solid currentColor;
  border-radius: 10px;
}
.icoon { width: 26px; height: 26px; flex: none; }
.toen .tijd { color: #7b5a3c; }
.nu .tijd { color: var(--teal); }

.vraag {
  display: block;
  font-style: italic;
  font-size: 17.5px;
  line-height: 1.45;
  margin: 0 0 12px;
  color: var(--ink);
}

.scheiding { position: relative; }
.scheiding::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  border-left: 1.5px dashed var(--ink-faint);
}
.scheiding span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}
.scheiding span::after {
  content: '→';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

/* gelinieerd logboekpapier */
textarea {
  display: block;
  width: 100%;
  min-height: calc(var(--line) * 5 + 8px);
  resize: vertical;
  font-family: var(--fell);
  font-size: 18.5px;
  line-height: var(--line);
  color: var(--ink);
  padding: 4px 14px 4px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background-color: rgba(255, 251, 240, 0.72);
  background-image:
    linear-gradient(90deg, transparent 10px, rgba(158, 70, 48, 0.28) 10px, rgba(158, 70, 48, 0.28) 11.5px, transparent 11.5px),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--ink-faint) calc(var(--line) - 1px), var(--ink-faint) var(--line));
  background-position: 0 0, 0 4px;
  background-attachment: local;
  box-shadow: inset 2px 2px 0 rgba(59, 43, 28, 0.06);
  transition: background-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.toen textarea { background-color: rgba(233, 216, 178, 0.55); }
textarea::placeholder { color: rgba(59, 43, 28, 0.38); font-style: italic; }
textarea:focus {
  outline: none;
  background-color: rgba(255, 252, 244, 0.95);
  box-shadow: inset 2px 2px 0 rgba(59, 43, 28, 0.06), 0 0 0 3px rgba(158, 70, 48, 0.25);
}

/* ---------- kernparel ---------- */

.kern {
  position: relative;
  max-width: 760px;
  margin: 70px auto 50px;
  padding: 70px 50px 40px;
  text-align: center;
  background: rgba(246, 236, 210, 0.7);
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 5px rgba(246, 236, 210, 0.7), 0 0 0 6px var(--ink), 6px 8px 0 6px rgba(59, 43, 28, 0.15);
}
.kern-parel {
  position: absolute;
  top: -38px;
  left: 50%;
  width: 76px;
  height: 76px;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 14px rgba(255, 246, 222, 0.9));
}
.kern .lint { margin-bottom: 22px; }
.vraag.groot { font-size: 21px; line-height: 1.45; margin: 0 auto 18px; max-width: 34em; }
.kern textarea {
  min-height: calc(var(--line) * 2 + 8px);
  text-align: center;
  font-size: 22px;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--ink-faint) calc(var(--line) - 1px), var(--ink-faint) var(--line));
  background-position: 0 4px;
  padding: 4px 18px;
}

/* ---------- versturen ---------- */

.verzend { text-align: center; margin: 50px 0 0; }
.status { min-height: 1.5em; margin: 0 auto 18px; max-width: 34em; font-style: italic; }
.status.fout { color: var(--red); }
.status.let-op { color: #7b5a3c; }
.honing { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- bedankt ---------- */

.bedankt {
  max-width: 640px;
  margin: 10px auto 60px;
  text-align: center;
  animation: opduiken 1s ease both;
}
.bedankt:focus { outline: none; }
.bedankt h2 { font-family: var(--sc); font-weight: 400; font-size: 38px; margin: 6px 0 12px; }
.bedankt p { font-size: 20px; line-height: 1.5; margin: 0; }
.grote-parel { width: 92px; height: 92px; filter: drop-shadow(0 0 18px rgba(255, 246, 222, 1)); animation: glinster 3s ease-in-out infinite; }
@keyframes opduiken { from { opacity: 0; transform: translateY(24px); } }
@keyframes glinster { 50% { transform: scale(1.06) rotate(6deg); } }

.voet {
  text-align: center;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 30px 0 0;
}
.voet::before { content: '~ ✦ ~'; display: block; margin-bottom: 6px; letter-spacing: 0.3em; }

/* ---------- parelsnoer ---------- */

.snoer {
  position: fixed;
  z-index: 7;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 18px 7px 14px;
  background: rgba(239, 226, 192, 0.96);
  border: 1.5px solid var(--ink);
  box-shadow: 0 0 0 3px rgba(239, 226, 192, 0.96), 0 0 0 4px var(--ink), 3px 5px 0 4px rgba(59, 43, 28, 0.15);
  max-width: calc(100vw - 56px);
}
.snoer ol {
  position: relative;
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* het touwtje */
.snoer ol::before {
  content: '';
  position: absolute;
  left: -6px;
  right: -6px;
  top: 50%;
  height: 10px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='10'><path d='M0 5 Q10 1 20 5 T40 5' fill='none' stroke='%233b2b1c' stroke-width='1.2'/></svg>") repeat-x center;
  opacity: 0.55;
}
.snoer li { position: relative; }
.snoer-parel {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.snoer-parel:hover { background: none; box-shadow: none; transform: translateY(-2px); }
.bol {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  transition: all 0.4s cubic-bezier(.3, 1.6, .5, 1);
}
.snoer-parel[data-staat='half'] .bol {
  background: linear-gradient(90deg, #f1e7d8 50%, var(--paper) 50%);
  border-style: solid;
}
.snoer-parel[data-staat='vol'] .bol {
  width: 22px;
  height: 22px;
  background: radial-gradient(circle at 36% 32%, #fff 0 14%, #f3eadb 30%, #e3d3c6 70%, #cdbbb2 100%);
  box-shadow: 0 0 10px rgba(255, 246, 222, 0.95);
}
.snoer-tekst { font-style: italic; font-size: 15px; white-space: nowrap; }
.snoer-tekst b { font-family: Georgia, serif; font-style: normal; font-weight: 400; font-size: 14px; }

/* ---------- beheer ---------- */

.beheer .page { padding-top: 54px; }
.beheer .cartouche { margin: 0 auto 40px; display: table; }
.samenvatting { max-width: 640px; margin: 0 auto 50px; text-align: center; }
.teller { font-size: 22px; margin: 0 0 18px; }
.teller span { font-family: Georgia, serif; font-size: 50px; display: block; line-height: 1; }
.inzending {
  margin: 0 0 26px;
  padding: 18px 26px 10px;
  background: rgba(246, 236, 210, 0.55);
  border: 1.5px solid var(--ink);
  box-shadow: 4px 6px 0 rgba(59, 43, 28, 0.1);
}
.inzending header { display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--ink-faint); padding-bottom: 10px; margin-bottom: 10px; }
.inzending .nr { font-family: var(--sc); font-size: 26px; color: var(--red); min-width: 2.2em; }
.inzending .tijd { flex: 1; font-style: italic; margin: 0; font-family: var(--fell); letter-spacing: 0; }
.inzending .verwijder { margin: 0; }
.inzending dl { margin: 0; }
.qa { padding: 8px 0; border-bottom: 1px dotted var(--ink-faint); }
.qa:last-child { border-bottom: 0; }
.qa dt { font-family: var(--sc); font-size: 16px; color: var(--ink-soft); }
.qa dd { margin: 2px 0 0; white-space: pre-wrap; line-height: 1.45; }
.leeg { text-align: center; font-style: italic; font-size: 20px; }

/* ---------- smal scherm ---------- */

@media (max-width: 760px) {
  html, body { font-size: 17px; }
  .page { padding: 24px 22px 130px; }
  .cartouche { padding: 10px 34px 9px; }
  .cartouche h1 { font-size: 29px; white-space: nowrap; }
  .cartouche::before, .cartouche::after { font-size: 16px; }
  .cartouche::before { left: 9px; }
  .cartouche::after { right: 9px; }
  .cartouche p { font-size: 15px; }
  .card { padding: 22px 20px 22px; }
  .lead { font-size: 18px; }
  .vooraf { grid-template-columns: 1fr; gap: 4px; }
  .regel input, .keuze { margin-bottom: 12px; }
  .parel { padding: 18px 16px 20px; }
  .parel h3 { font-size: 23px; }
  .paar { grid-template-columns: 1fr; }
  .scheiding { height: 34px; }
  .scheiding::before { top: 0; bottom: 0; }
  .scheiding span::after { content: '↓'; }
  .kern { padding: 56px 20px 26px; }
  .lint span { padding: 8px 20px 9px; }
  .snoer { bottom: 20px; gap: 8px; padding: 6px 12px 6px 10px; }
  .snoer ol { gap: 4px; }
  .snoer-tekst { font-size: 13px; }
}
@media (max-width: 420px) {
  .snoer-tekst { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
#bedankt-tekst { white-space: pre-line; }
