/* Carta fiorentina — ivoor papier, habijtblauw, bladgoud, terracotta knipoog */
:root {
  --paper: #F6F1E7;
  --paper-deep: #EDE4D3;
  --blue: #7E9CC4;
  --blue-dark: #34507A;
  --gold: #B8893B;
  --terracotta: #B5523B;
  --ink: #2B2A33;
  --night: #24262C;
  --cream: #EFE6D2;

  --serif: 'Cormorant Garamond', 'Garamond', 'Georgia', serif;
  --sans: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;

  --fade: 1100ms;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Deck & slides ---------- */

#deck { position: fixed; inset: 0; }

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5vh 6vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--fade) ease, visibility 0s linear var(--fade);
  background: var(--paper);
  overflow: hidden;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--fade) ease, visibility 0s;
  z-index: 2;
}

/* Papier: zachte aquarelvlekken + korrel */
.slide.paper::before {
  content: '';
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 45% 35% at 12% 18%, rgba(126,156,196,.20), transparent 70%),
    radial-gradient(ellipse 40% 30% at 88% 82%, rgba(184,137,59,.16), transparent 70%),
    radial-gradient(ellipse 30% 25% at 80% 15%, rgba(126,156,196,.10), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}
.slide.paper::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 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='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .30  0 0 0 0 .22  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  pointer-events: none;
  mix-blend-mode: multiply;
}
.slide > * { position: relative; z-index: 1; }

/* ---------- Typografie ---------- */

.it {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--blue-dark);
  line-height: 1.1;
}
.nl {
  font-family: var(--sans);
  font-style: italic;
  color: rgba(43,42,51,.68);
  line-height: 1.35;
}
.rule {
  width: 9rem;
  height: 1px;
  margin: 3.2vh auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  position: relative;
}
.rule::after {
  content: '✦';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -52%);
  color: var(--gold);
  font-size: .9rem;
  background: var(--paper);
  padding: 0 .5rem;
}

/* ---------- Cover ---------- */

.cover { text-align: center; }
.cover .kicker {
  font-family: var(--sans);
  font-size: clamp(.8rem, 1.4vw, 1.05rem);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2.5vh;
}
.cover .it { font-size: clamp(3rem, 9vw, 8rem); font-weight: 600; }
.cover .it em { font-style: italic; font-weight: 500; }
.cover .sub-it { font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.6vw, 2.2rem); color: var(--ink); }
.cover .nl { font-size: clamp(1rem, 1.7vw, 1.35rem); margin-top: .8vh; }
.cover .portrait {
  width: clamp(8rem, 17vw, 15rem);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: 55% 30%;
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--gold), 0 18px 40px rgba(52,80,122,.25);
  margin-bottom: 4vh;
}

/* ---------- Hoofdstukkaart ---------- */

.card { text-align: center; }
.card .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  color: var(--gold);
  margin-bottom: 1.5vh;
}
.card .it { font-size: clamp(2.8rem, 7.5vw, 6.5rem); font-weight: 600; }
.card.wink .it { color: var(--terracotta); }
.card .nl.title { font-size: clamp(1.1rem, 2.2vw, 1.8rem); margin-top: .5vh; }
.card .line-it {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 2.1rem);
  max-width: 44ch;
  margin: 0 auto;
  color: var(--ink);
  line-height: 1.3;
}
.card .line-nl { font-size: clamp(.95rem, 1.5vw, 1.2rem); max-width: 60ch; margin: 1.2vh auto 0; }

/* ---------- Foto (albumafdruk) ---------- */

.photo .print {
  background: #fff;
  padding: clamp(8px, 1.1vw, 16px) clamp(8px, 1.1vw, 16px) clamp(10px, 1.4vw, 20px);
  box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 22px 50px rgba(43,42,51,.22);
  transform: rotate(var(--tilt, 0deg));
  max-width: 86vw;
}
.photo .frame { overflow: hidden; line-height: 0; }
.photo img {
  display: block;
  max-height: 72vh;
  max-width: calc(86vw - 32px);
  width: auto;
  height: auto;
}
.photo.active img { animation: kenburns var(--dur, 8s) ease-out forwards; }
.photo .cap { text-align: center; margin-top: 2.6vh; }
.photo .cap .it { font-style: italic; font-size: clamp(1.15rem, 2.1vw, 1.8rem); color: var(--ink); }
.photo .cap .nl { font-size: clamp(.85rem, 1.3vw, 1.05rem); }

@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.07) translate(var(--kx, 0%), var(--ky, -1%)); }
}

/* ---------- Onthulling (AI-beeld + naamkaartje) ---------- */

.reveal { padding: 0; background: #1d1f24; }
.reveal .blur {
  position: absolute; inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(.55) saturate(1.1);
}
.reveal .hero {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.reveal.active .hero { animation: revealzoom var(--dur, 9s) ease-out forwards; }
@keyframes revealzoom { from { transform: scale(1.06); } to { transform: scale(1); } }

.badge {
  position: absolute;
  left: 4vw;
  bottom: 6vh;
  background: var(--paper);
  border-top: 5px solid var(--terracotta);
  padding: 1.6vh 2vw 1.8vh;
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
  transform: rotate(-1.5deg) translateY(30px);
  opacity: 0;
  max-width: min(36rem, 80vw);
}
.reveal.active .badge { animation: badgein .9s 1.2s cubic-bezier(.2,.9,.3,1.2) forwards; }
@keyframes badgein { to { opacity: 1; transform: rotate(-1.5deg) translateY(0); } }
.badge .who {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(.7rem, 1vw, .85rem);
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.badge .role {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.8rem);
  color: var(--blue-dark);
  line-height: 1.05;
  margin: .4vh 0 .3vh;
}
.badge .where { font-family: var(--serif); font-style: italic; font-size: clamp(1rem, 1.6vw, 1.35rem); color: var(--ink); }
.badge .nl { font-size: clamp(.8rem, 1.1vw, .95rem); margin-top: .4vh; }

.pending {
  position: absolute;
  right: 3vw;
  top: 3vh;
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--paper);
  background: rgba(181,82,59,.85);
  padding: .4rem .8rem;
  border-radius: 2px;
}

/* ---------- Donker (papa) ---------- */

.dark { background: var(--night); }
.dark .it { color: var(--cream); }
.dark .nl { color: rgba(239,230,210,.62); }
.dark .rule::after { background: var(--night); }
.dark.photo .print { background: var(--cream); box-shadow: 0 22px 60px rgba(0,0,0,.5); }
.dark.photo img { filter: sepia(.15); }
.dark.photo .cap .it { color: var(--cream); }
.dark.card .it { color: var(--cream); }
.dark.card .line-it { color: var(--cream); }

.poem { text-align: center; }
.poem .title { font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 2.6vw, 2.2rem); color: var(--gold); margin-bottom: 3vh; }
.poem .verse {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.3vw, 2rem);
  line-height: 1.45;
  color: var(--cream);
  white-space: pre-line;
}
.poem .verse.placeholder { opacity: .5; font-style: italic; }
.poem .src { margin-top: 3vh; font-size: clamp(.85rem, 1.2vw, 1rem); }

/* ---------- Citaat ---------- */

.quote { text-align: center; }
.quote .it {
  font-style: italic;
  font-size: clamp(1.6rem, 3.4vw, 3rem);
  max-width: 30ch;
  color: var(--ink);
  line-height: 1.25;
}
.quote .nl { font-size: clamp(.95rem, 1.5vw, 1.2rem); max-width: 62ch; margin-top: 2.5vh; }
.quote .ref { margin-top: 2.5vh; font-family: var(--serif); font-size: clamp(1rem, 1.6vw, 1.4rem); color: var(--gold); letter-spacing: .08em; }
.quote.with-image { padding: 0; }
.quote.with-image .bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 35%;
  opacity: .22;
  filter: saturate(.7);
}

/* ---------- Liedtekst ---------- */

.lyrics { text-align: center; }
.lyrics .song {
  font-family: var(--sans);
  font-size: clamp(.8rem, 1.2vw, 1rem);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1vh;
}
.lyrics .label { font-family: var(--serif); font-style: italic; color: var(--blue); font-size: clamp(1.1rem, 1.8vw, 1.5rem); margin-bottom: 2.5vh; }
.lyrics .text {
  font-family: var(--serif);
  font-weight: 500;
  white-space: pre-line;
  line-height: 1.35;
  color: var(--ink);
  font-size: clamp(1.6rem, 3.3vw, 3rem);
}
.lyrics.long .text { font-size: clamp(1.3rem, 2.6vw, 2.3rem); }
.lyrics.refrain .text { color: var(--blue-dark); font-weight: 600; font-size: clamp(1.9rem, 4.2vw, 3.8rem); }
.lyrics .after {
  margin-top: 3vh;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 1.7vw, 1.45rem);
  color: var(--blue-dark);
  opacity: .75;
  white-space: pre-line;
}

/* ---------- Chrome: voortgang, hint, status ---------- */

#progress { position: fixed; left: 0; right: 0; bottom: 0; height: 3px; z-index: 10; background: rgba(184,137,59,.15); }
#progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .6s ease; }

#hint {
  position: fixed;
  left: 50%; bottom: 3vh;
  transform: translateX(-50%);
  z-index: 10;
  font-size: .85rem;
  color: rgba(43,42,51,.7);
  background: rgba(246,241,231,.92);
  padding: .55rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
  white-space: nowrap;
  transition: opacity 1.2s ease;
}
#hint.gone { opacity: 0; pointer-events: none; }
kbd {
  font-family: var(--sans);
  font-size: .75rem;
  border: 1px solid rgba(43,42,51,.25);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 .35rem;
  margin: 0 .1rem;
  background: #fff;
}

#status {
  position: fixed;
  right: 2vw; top: 2vh;
  z-index: 10;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--gold);
  opacity: 0;
  transition: opacity .6s ease;
  text-shadow: 0 1px 6px rgba(0,0,0,.25);
}
#status.show { opacity: 1; }

body.auto { cursor: none; }

@media (max-width: 700px) {
  #hint { font-size: .7rem; white-space: normal; text-align: center; width: 92vw; }
  .badge { left: 3vw; right: 3vw; bottom: 4vh; }
}

@media (prefers-reduced-motion: reduce) {
  .photo.active img, .reveal.active .hero { animation: none; }
}

/* ---------- Liedkeuze ---------- */

#chooser {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(36,38,44,.45);
  backdrop-filter: blur(6px);
}
#chooser[hidden] { display: none; }
#chooser .panel {
  background: var(--paper);
  border-top: 5px solid var(--gold);
  padding: 3.5vh 3vw 2.5vh;
  width: min(34rem, 92vw);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
#chooser .panel > .it { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 600; }
#chooser .panel > .nl { margin-bottom: 2.5vh; }
#chooser .choices { display: grid; gap: .8rem; }
#chooser .choices button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid rgba(126,156,196,.45);
  border-radius: 4px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
#chooser .choices button:hover, #chooser .choices button:focus-visible { border-color: var(--blue-dark); transform: translateY(-1px); outline: none; }
#chooser .t { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--blue-dark); line-height: 1.2; }
#chooser .d { font-size: .9rem; color: rgba(43,42,51,.6); }
#chooser .close {
  margin-top: 1.8vh;
  background: none; border: 0;
  font: inherit; font-size: .85rem;
  color: rgba(43,42,51,.55);
  cursor: pointer;
}

/* ♪-knop: alleen op aanraakschermen */
#playbtn {
  display: none;
  position: fixed;
  right: 4vw; bottom: 4vh;
  z-index: 15;
  width: 3.2rem; height: 3.2rem;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(246,241,231,.92);
  color: var(--blue-dark);
  font-size: 1.3rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: none) and (pointer: coarse) {
  #playbtn { display: block; }
}
