/* The Blueprint Deck · huisstijl Sanne Daenen */
:root {
  --olive: #56572B;
  --olive-deep: #3b3c1c;
  --terra: #7F3830;
  --terra-soft: #C8634C;
  --sage: #BCC795;
  --paper: #F7F3EC;
  --bg: #EEE8DE;
  --on-dark: #F3EEE4;
  --line: #D6CEBE;
  --fg: #202321;
  --muted: #5C5A4C;
  --head: "Geist", "Helvetica Neue", Arial, sans-serif;
  --body: "Open Sans", "Segoe UI", Arial, sans-serif;
  --hand: "Caveat", "Bradley Hand", cursive;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --card-w: clamp(140px, 18vw, 200px);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .1 0 0 0 0 .05 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .95 0 0 0 0 .93 0 0 0 0 .8 0 0 0 .22 -.04'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--body); color: var(--on-dark); background: var(--olive-deep); min-height: 100vh; -webkit-font-smoothing: antialiased; }

/* aquarel-gloed: olijf, licht midden, roestrode hoek */
.sky { position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    var(--grain),
    var(--cloud) center / 1200px 1200px,
    radial-gradient(ellipse 45% 40% at 8% 92%, rgba(200,99,76,.85), rgba(127,56,48,.45) 45%, rgba(127,56,48,0) 75%),
    radial-gradient(ellipse 55% 50% at 50% 45%, rgba(188,199,149,.42), rgba(188,199,149,0) 70%),
    radial-gradient(ellipse 120% 90% at 50% 40%, #6a6b35, var(--olive) 45%, var(--olive-deep) 100%);
}
.ornaments { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.orn { position: absolute; opacity: .55; }
.orn.tl { top: 0; left: 0; width: min(28vw, 300px); }
.orn.tr { top: 2vh; right: 4vw; width: min(7vw, 70px); }
.orn.br { bottom: 0; right: 0; width: min(32vw, 340px); }

/* colofon */
.colofon { display: flex; align-items: center; gap: 16px; max-width: 1120px; margin: 0 auto; padding: 26px 28px 0; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(243,238,228,.75); }
.colofon .line { flex: 1; height: 1px; background: rgba(243,238,228,.22); }

main { max-width: 1120px; margin: 0 auto; padding: 48px 28px 96px; }
.scene { display: none; }
.scene.is-active { display: grid; animation: rise .9s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: none } }

/* typografie */
.display { font-family: var(--head); font-weight: 300; letter-spacing: -.035em; line-height: .95; margin: 0 0 24px; font-size: clamp(3.2rem, 8vw, 6.6rem); }
.display.small { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -.03em; margin-bottom: 16px; }
.accent { color: var(--terra-soft); }
.lead { font-family: var(--head); font-weight: 400; font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.4; letter-spacing: -.01em; max-width: 520px; margin: 0 0 28px; }
.body-text { font-size: 1rem; line-height: 1.75; }
.body-text p { margin: 0 0 14px; }
.num { font-family: var(--head); font-weight: 300; font-size: .95rem; letter-spacing: .1em; color: var(--sage); margin: 0 0 18px; display: flex; align-items: center; gap: 12px; }
.num::after { content: ""; width: 44px; height: 1px; background: currentColor; opacity: .6; }
.hand { font-family: var(--hand); font-size: 1.9rem; line-height: 1; color: var(--sage); margin: 4px 0 14px !important; }

/* knoppen */
.btn { appearance: none; border: 1px solid var(--on-dark); background: var(--on-dark); color: var(--olive-deep); font: 600 .92rem/1 var(--body); padding: 17px 30px; border-radius: 4px; cursor: pointer; text-decoration: none; display: inline-block; transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -14px rgba(0,0,0,.6); }
.btn.ghost { background: transparent; color: var(--on-dark); border-color: rgba(243,238,228,.55); }
.btn.ghost:hover { background: rgba(243,238,228,.08); }
.btn:focus-visible, input:focus-visible, select:focus-visible, .tcard:focus-visible, .close:focus-visible, .seal:focus-visible { outline: 2px solid var(--terra-soft); outline-offset: 3px; }
.cta-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.meta { font-size: .82rem; color: rgba(243,238,228,.7); }

/* ===== kaarten ===== */
.pcard { width: var(--card-w); aspect-ratio: 5 / 8; border-radius: 10px; position: relative; overflow: hidden;
  box-shadow: 0 1px 1px rgba(0,0,0,.2), 0 2px 5px rgba(0,0,0,.15), 0 26px 40px -24px rgba(0,0,0,.75); }
.pcard.back { background:
  var(--grain), url("card-back.svg") center / 100% 100% no-repeat,
  radial-gradient(ellipse 60% 45% at 50% 50%, rgba(188,199,149,.35), rgba(188,199,149,0) 70%),
  radial-gradient(ellipse 70% 40% at 0% 100%, rgba(200,99,76,.55), rgba(200,99,76,0) 70%),
  linear-gradient(160deg, #5f6030, var(--olive-deep)); }
.pcard .bname { position: absolute; left: 0; right: 0; top: 47%; text-align: center; color: var(--on-dark); font: 600 calc(var(--card-w) * .066)/1.2 var(--body); letter-spacing: .16em; text-transform: uppercase; text-shadow: 0 1px 8px rgba(30,31,14,.6); }
.pcard .bname b { display: block; font-family: var(--head); font-weight: 300; font-size: calc(var(--card-w) * .22); line-height: 1; letter-spacing: -.02em; margin-bottom: 6px; }
.pcard .idx { position: absolute; font-size: calc(var(--card-w) * .05); letter-spacing: .16em; text-transform: uppercase; }
.pcard .idx.tl { top: 7%; left: 9%; }
.pcard .idx.br { bottom: 7%; right: 9%; transform: rotate(180deg); }
.pcard.back .idx { color: var(--on-dark); opacity: .85; }

/* voorkant: papier, olijf inkt */
.cface { background: var(--grain), var(--paper); color: var(--olive); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 10%; }
.cface::before { content: ""; position: absolute; inset: 5%; border: 1px solid rgba(86,87,43,.55); border-radius: 6px; pointer-events: none; }
.cface::after { content: ""; position: absolute; inset: calc(5% + 4px); border: 1px solid rgba(86,87,43,.2); border-radius: 4px; pointer-events: none; }
.cface .glyph { font-family: "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols", serif; font-size: calc(var(--card-w) * .3); line-height: 1; margin-bottom: 8%; }
.cface svg.glyph { width: calc(var(--card-w) * .3); height: calc(var(--card-w) * .3); }
.cface .name { font-family: var(--head); font-weight: 400; font-size: calc(var(--card-w) * .088); letter-spacing: -.01em; line-height: 1.2; color: var(--fg); }
.cface .rule { width: 18%; height: 1px; background: var(--terra-soft); margin: 7% 0; }
.cface .sub { font-size: calc(var(--card-w) * .05); letter-spacing: .14em; text-transform: uppercase; line-height: 1.5; color: var(--muted); }
.cface .idx { color: var(--olive); }

/* ===== welkom ===== */
.welcome { grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: center; }
.welcome-text { max-width: 600px; }
.note-card { background: rgba(247,243,236,.07); border: 1px solid rgba(243,238,228,.2); border-radius: 6px; padding: 22px 26px 6px; margin: 0 0 32px; line-height: 1.7; font-size: .98rem; max-width: 520px; backdrop-filter: blur(2px); }
.note-card .label { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--sage); margin: 0 0 10px; }
.note-card p { margin: 0 0 14px; }
.welcome-deck { position: relative; height: calc(var(--card-w) * 1.6 + 80px); --card-w: clamp(180px, 22vw, 250px); }
.welcome-deck .pcard { position: absolute; left: 50%; top: 40px; margin-left: calc(var(--card-w) / -2); transition: transform .8s var(--ease); animation: drop 1.1s var(--ease) both; }
.welcome-deck .s1 { transform: rotate(9deg) translate(26px, 8px); animation-delay: .1s }
.welcome-deck .s2 { transform: rotate(4deg) translate(12px, 4px); animation-delay: .2s }
.welcome-deck .s3 { transform: rotate(-1deg); animation-delay: .3s }
.welcome-deck .s4 { transform: rotate(-6deg) translate(-14px, -6px); animation-delay: .45s }
.welcome-deck:hover .s4 { transform: rotate(-9deg) translate(-40px, -18px); }
.welcome-deck:hover .s1 { transform: rotate(13deg) translate(44px, 10px); }
@keyframes drop { from { opacity: 0; translate: 0 -40px } to { opacity: 1; translate: 0 0 } }
.cover { background: var(--grain), var(--paper); color: var(--olive); }
.cover::before { content: ""; position: absolute; inset: 5%; border: 1px solid rgba(86,87,43,.5); border-radius: 6px; }
.cover .idx { color: var(--olive); }
.cover-title { position: absolute; left: 13%; top: 26%; font-family: var(--head); font-weight: 300; font-size: calc(var(--card-w) * .155); line-height: .98; letter-spacing: -.035em; color: var(--fg); }
.cover-rule { position: absolute; left: 13%; top: 64%; width: 16%; height: 1px; background: var(--terra-soft); }
.cover-sub { position: absolute; left: 13%; top: 69%; font-size: calc(var(--card-w) * .048); letter-spacing: .16em; text-transform: uppercase; line-height: 1.7; color: var(--muted); }

/* ===== formulier ===== */
.form-scene { grid-template-columns: .8fr 1.2fr; gap: 64px; align-items: start; }
.form { display: grid; gap: 18px; background: rgba(32,35,33,.18); border: 1px solid rgba(243,238,228,.14); border-radius: 8px; padding: 30px; backdrop-filter: blur(3px); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: grid; gap: 7px; font-size: .8rem; font-weight: 600; letter-spacing: .03em; }
.form input:not([type=checkbox]) { font: 1rem var(--body); color: var(--fg); background: var(--paper); border: 1px solid transparent; border-radius: 4px; padding: 14px 16px; width: 100%; transition: border-color .2s, box-shadow .2s; color-scheme: light; }
.form input:focus { border-color: var(--terra-soft); outline: none; box-shadow: 0 0 0 3px rgba(200,99,76,.25); }
.form input:disabled { opacity: .45; }
.form .check { grid-template-columns: auto 1fr; align-items: start; font-weight: 400; font-size: .92rem; letter-spacing: 0; line-height: 1.5; cursor: pointer; }
.form .check input { accent-color: var(--terra-soft); width: 18px; height: 18px; margin: 2px 0 0; }
.hint { margin: -6px 0 0; font-size: .9rem; line-height: 1.6; border-left: 2px solid var(--sage); padding: 6px 14px; }
.error { margin: 0; color: #f0b3a3; font-size: .92rem; line-height: 1.5; }
.form .btn { justify-self: start; margin-top: 6px; }

/* ===== envelop ===== */
.env-scene { justify-items: center; padding-top: 30px; }
.envelope { --w: min(460px, 86vw); width: var(--w); height: calc(var(--w) * .66); position: relative; margin-top: calc(var(--w) * .25); perspective: 1200px; animation: drop 1s var(--ease) both; }
.env-back, .env-front, .env-flap { position: absolute; inset: 0; background: var(--grain), var(--paper); }
.env-back { background: var(--grain), linear-gradient(180deg, #ddd3c2, #ebe3d6); border-radius: 6px; box-shadow: 0 34px 60px -30px rgba(0,0,0,.8); z-index: 1; }
.env-card { --card-w: calc(var(--w) * .34); position: absolute; left: 50%; top: 8%; margin-left: calc(var(--card-w) / -2); z-index: 2; transition: transform 1.2s var(--ease) .6s; }
.env-front { z-index: 3; clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%); border-radius: 6px; background: var(--grain), linear-gradient(170deg, #f3ede3, var(--paper)); }
.env-v { position: absolute; inset: 0; width: 100%; height: 100%; }
.env-to { position: absolute; left: 0; right: 0; bottom: 11%; text-align: center; font-family: var(--hand); font-size: calc(var(--w) * .085); color: var(--olive); line-height: 1; }
.env-to b { font-weight: 600; }
.env-from { position: absolute; left: 0; right: 0; bottom: 5%; text-align: center; font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.env-flap { z-index: 4; height: 62%; clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; background: var(--grain), linear-gradient(180deg, #ece5d9, #f5f0e7); filter: drop-shadow(0 4px 6px rgba(0,0,0,.2)); transition: transform .9s var(--ease), z-index 0s .45s; }
.seal { position: absolute; z-index: 5; left: 50%; top: 62%; width: 70px; height: 70px; margin: -35px 0 0 -35px; border: 0; padding: 0; cursor: pointer; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, var(--terra-soft), #9a4536 50%, var(--terra) 100%);
  box-shadow: 0 0 0 4px rgba(127,56,48,.9), 0 0 0 5px rgba(80,30,25,.5), 0 8px 14px -4px rgba(40,15,10,.6);
  transition: transform .5s var(--ease), opacity .5s; }
.seal::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 1px solid rgba(243,238,228,.45); }
.seal span { font-family: var(--head); font-weight: 400; font-size: 1.15rem; letter-spacing: .06em; color: var(--on-dark); text-shadow: 0 -1px 0 rgba(0,0,0,.3); position: relative; }
.seal:disabled { cursor: default; }
.envelope.ready .seal { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1) } 50% { transform: scale(1.06) } }
.envelope.open .seal { animation: none; transform: scale(.6) translateY(30px); opacity: 0; }
.envelope.open .env-flap { transform: scaleY(-1); z-index: 0; background: var(--grain), linear-gradient(0deg, #ddd3c2, #ebe3d6); filter: none; }
.envelope.open .env-card { transform: translateY(-78%); }
.env-text { margin-top: 36px; font-family: var(--head); font-weight: 300; font-size: 1.15rem; letter-spacing: -.01em; transition: opacity .4s; text-align: center; }

/* ===== tafel ===== */
.table-scene { justify-items: center; text-align: center; }
.table-head { max-width: 620px; display: flex; flex-direction: column; align-items: center; }
.table-head .num, .closing .num { justify-content: center; }
.table-head .num::before, .closing .num::before { content: ""; width: 44px; height: 1px; background: currentColor; opacity: .6; }
.table { display: grid; grid-template-columns: repeat(4, var(--card-w)); gap: clamp(16px, 2.8vw, 36px); justify-content: center; perspective: 1400px; margin: 22px 0 28px; }
.tcard { all: unset; cursor: pointer; width: var(--card-w); aspect-ratio: 5 / 8; position: relative; transform: rotate(var(--rot, 0deg)); animation: deal .9s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes deal { from { opacity: 0; translate: 0 -120px; rotate: -10deg } to { opacity: 1; translate: 0 0; rotate: 0deg } }
.tcard .inner { position: absolute; inset: 0; transition: transform .95s var(--ease); transform-style: preserve-3d; }
.tcard:hover .inner { transform: translateY(-10px); }
.tcard.flipped .inner { transform: rotateY(180deg); }
.tcard.flipped:hover .inner { transform: rotateY(180deg) translateY(-10px); }
.tcard .face { position: absolute; inset: 0; width: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.tcard .face.front { transform: rotateY(180deg); }
.progress { font-size: .85rem; color: rgba(243,238,228,.7); margin: 0; }

.closing { margin-top: 72px; max-width: 620px; display: flex; flex-direction: column; align-items: center; animation: rise 1s var(--ease) both; }
.closing[hidden] { display: none; }
.closing .cta-row { justify-content: center; margin-top: 10px; }

/* ===== detail (licht papier voor leesbaarheid) ===== */
dialog { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 40px); border: none; padding: 0; border-radius: 10px; background: var(--grain), var(--paper); color: var(--fg); box-shadow: 0 40px 90px -30px rgba(0,0,0,.8); }
dialog[open] { animation: rise .6s var(--ease) both; }
dialog::backdrop { background: rgba(30,31,14,.6); backdrop-filter: blur(3px); }
.close { position: absolute; top: 14px; right: 18px; z-index: 2; background: none; border: none; font-size: 2rem; line-height: 1; color: var(--olive); cursor: pointer; }
.reading { display: grid; grid-template-columns: 290px 1fr; gap: 52px; padding: 48px 52px; text-align: left; }
.reading-card { --card-w: 290px; position: sticky; top: 0; }
.reading-card .pcard { transform: rotate(-2deg); }
.reading .display.small { color: var(--olive); }
.kicker { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 20px; display: flex; align-items: center; gap: 12px; }
.kicker::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.placement { font-size: .74rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--terra); margin: 0 0 10px; }
.business { background: var(--bg); border-left: 2px solid var(--terra-soft); border-radius: 0 6px 6px 0; padding: 18px 22px; margin: 8px 0 20px; line-height: 1.7; }
.business h3 { font: 600 .68rem/1 var(--body); letter-spacing: .2em; text-transform: uppercase; margin: 0 0 10px; color: var(--olive); }
.business p { margin: 0; }
.note { font-style: italic; font-size: .88rem; line-height: 1.6; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin: 0 0 24px; }
.notice { border-left: 2px solid var(--terra-soft); padding: 6px 16px; font-size: .93rem; line-height: 1.6; margin: 0 0 16px; }
.notice a, .picker a { color: var(--terra); }
.picker { display: grid; gap: 12px; margin: 4px 0 18px; }
.picker select { font: 1rem var(--body); color: var(--fg); padding: 12px 14px; border-radius: 4px; border: 1px solid var(--line); background: #fff; }
.picker .error { color: var(--terra); }
dialog .btn { background: var(--olive); color: var(--on-dark); border-color: var(--olive); }
dialog .btn.ghost { background: transparent; color: var(--olive); border-color: var(--olive); }

#print-deck { display: none; }

/* mobiel */
@media (max-width: 820px) {
  .welcome, .form-scene { grid-template-columns: 1fr; gap: 32px; }
  .welcome-deck { order: -1; --card-w: 170px; height: 330px; }
  .colofon span:nth-child(5), .colofon .line:nth-of-type(2) { display: none; }
  .orn.tl { width: 44vw; } .orn.br { width: 56vw; } .orn.tr { display: none; }
  main { padding-top: 28px; }
  :root { --card-w: clamp(132px, 40vw, 180px); }
  .table { grid-template-columns: repeat(2, var(--card-w)); }
  .form .row { grid-template-columns: 1fr; }
  .form { padding: 22px; }
  .reading { grid-template-columns: 1fr; padding: 56px 22px 28px; gap: 28px; }
  .reading-card { --card-w: 170px; position: static; justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* PDF */
@media print {
  @page { size: A4; margin: 16mm; }
  body { background: #fff; color: var(--fg); }
  .sky, .ornaments, .colofon, main, dialog { display: none !important; }
  #print-deck { display: block; color: var(--fg); }
  #print-deck * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-deck .display { color: var(--olive); }
  .p-page { page-break-after: always; display: grid; grid-template-columns: 62mm 1fr; gap: 12mm; align-items: start; }
  .p-page:last-child { page-break-after: auto; }
  .p-cover { display: block; padding-top: 60mm; }
  .p-page .pcard { --card-w: 62mm; box-shadow: none; border: 1px solid var(--line); }
  .p-page .body-text { font-size: 10.5pt; }
}
