/* ===================================================================
   motion.css
   Micro-animaties en UX-verfijningen voor theoybema.nl
   Laad ná bootstrap.min.css en styles.min.css.
   =================================================================== */

:root {
  --yp-primary: #d42b61;
  --yp-secondary: #4989e6;
  --yp-ink: #1a1a1a;
  --yp-head-color: #4a2a38;
  --yp-body-color: #3a2028;
  --yp-font-head: "Space Grotesk", "Fraunces", "DM Serif Display", Georgia, serif;
  --yp-ease: cubic-bezier(.22, 1, .36, 1);
  --yp-ease-back: cubic-bezier(.34, 1.56, .64, 1);
}

/* Respecteer altijd gebruikers die minder beweging willen */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== 1. HERO — signature moment ================================ */

/* De banner zit in een container met overflow hidden zodat de parallax
   de banner zelf iets groter maakt en meebeweegt met scroll + cursor. */
.yp-hero {
  /* de hero-container is al relative/overflow via base styling */
}
.yp-hero-banner {
  /* iets groter dan z'n container + translateY-overhead, zodat parallax
     geen harde rand laat zien bij scroll */
  height: clamp(320px, 52vw, 620px) !important;
  will-change: transform;
  /* JS zet --sy (scroll) en --cx/--cy (cursor). Default: ademhaling. */
  transform:
    translate3d(calc(var(--cx, 0px) * 1), calc(var(--sy, 0px) + var(--cy, 0px) * 1), 0)
    scale(var(--sc, 1.06));
  transition: transform .25s linear;
  background-position: center center !important;
  background-size: cover !important;
}
/* Zachte ademhaling alleen op rust (geen scroll-transform) */
.yp-hero-banner.at-rest {
  animation: yp-breathe 9s ease-in-out infinite;
}
@keyframes yp-breathe {
  0%, 100% { transform: translate3d(var(--cx,0px), var(--cy,0px), 0) scale(1.06); }
  50%      { transform: translate3d(var(--cx,0px), var(--cy,0px), 0) scale(1.08); }
}

/* De naam klimt per letter naar boven. */
.yp-reveal-letters .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(.6em);
  animation: yp-char-in .6s var(--yp-ease) forwards;
}
.yp-reveal-letters .char.space { width: .25em; }
@keyframes yp-char-in {
  to { opacity: 1; transform: translateY(0); }
}

/* "Creative Learning Producer" tikt regel-voor-regel */
.yp-typewriter {
  display: inline-block;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  color: #737373;
  border-right: 2px solid currentColor;
  animation:
    yp-type 1.6s steps(28, end) .6s both,
    yp-blink .8s step-end 2.2s 4;
}
@keyframes yp-type {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes yp-blink {
  50% { border-color: transparent; }
}

/* Onderlijn die onder de hero-titel "getekend" wordt */
.yp-underline {
  position: relative;
  display: inline-block;
}
.yp-underline::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -.1em;
  height: 6px;
  background: var(--yp-primary);
  border-radius: 4px;
  animation: yp-draw 1.2s var(--yp-ease) 2.4s forwards;
}
@keyframes yp-draw { to { right: 0; } }

/* ===== 2. Scroll reveal — vervanger van AOS ====================== */

.yp-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--yp-ease) var(--yp-delay, 0ms),
              transform .8s var(--yp-ease) var(--yp-delay, 0ms);
  will-change: opacity, transform;
}
.yp-reveal.in  { opacity: 1; transform: none; }

.yp-reveal[data-anim="fade-left"]  { transform: translateX(-32px); }
.yp-reveal[data-anim="fade-right"] { transform: translateX( 32px); }
.yp-reveal[data-anim="zoom"]       { transform: scale(.9); }
.yp-reveal.in[data-anim]           { transform: none; }

/* ===== 3. Werkwijze — 4 stappen met verbindingslijn ============== */

.yp-werkwijze {
  position: relative;
}
.yp-werkwijze-track {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 85px;
  height: 2px;
  width: auto !important;
  flex: none !important;
  max-width: none !important;
  background: linear-gradient(to right,
    rgba(0,0,0,.55) 0%,
    rgba(0,0,0,.55) var(--yp-progress, 0%),
    rgba(0,0,0,.08) var(--yp-progress, 0%),
    rgba(0,0,0,.08) 100%);
  transition: background 1.2s var(--yp-ease);
  z-index: 0;
}
@media (max-width: 767px) { .yp-werkwijze-track { display: none; } }

.yp-step {
  position: relative;
  text-align: center;
  padding: 12px 14px 24px;
  border-radius: 14px;
  transition: background .3s var(--yp-ease), transform .4s var(--yp-ease);
  background: transparent;
}
.yp-step:hover {
  background: rgba(0,0,0,.04);
  transform: translateY(-3px);
}
.yp-step-num { display: none; }
.yp-step-icon {
  width: 130px;
  height: 130px;
  margin: 8px auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
  position: relative;
  z-index: 1;
  transition: transform .5s var(--yp-ease-back), box-shadow .4s var(--yp-ease);
}
.yp-step-icon img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  transition: transform .5s var(--yp-ease-back);
}
.yp-step:hover .yp-step-icon {
  transform: scale(1.06);
  box-shadow: 0 10px 24px -8px rgba(0,0,0,.18);
}
.yp-step:hover .yp-step-icon img { transform: rotate(-6deg) scale(1.05); }

.yp-step h2 {
  font-size: 1.35rem;
  margin: 6px 0 6px;
  position: relative;
  display: inline-block;
}
.yp-step h2::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -4px;
  width: 0; height: 2px;
  background: var(--yp-primary);
  transform: translateX(-50%);
  transition: width .35s var(--yp-ease);
}
.yp-step:hover h2::after { width: 70%; }

/* Stagger wanneer de sectie in beeld komt */
.yp-werkwijze.revealed .yp-step {
  animation: yp-step-pop .7s var(--yp-ease-back) both;
}
.yp-werkwijze.revealed .yp-step:nth-child(1) { animation-delay: .05s; }
.yp-werkwijze.revealed .yp-step:nth-child(2) { animation-delay: .20s; }
.yp-werkwijze.revealed .yp-step:nth-child(3) { animation-delay: .35s; }
.yp-werkwijze.revealed .yp-step:nth-child(4) { animation-delay: .50s; }
@keyframes yp-step-pop {
  from { opacity: 0; transform: translateY(20px) scale(.94); }
  to   { opacity: 1; transform: none; }
}

/* ===== 4. Project kaarten ======================================== */

.yp-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: transform .45s var(--yp-ease), box-shadow .45s var(--yp-ease);
  will-change: transform;
}
.yp-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 40px -22px rgba(0,0,0,.35);
}
.yp-card h4 {
  margin: 10px 14px 6px;
  transition: color .25s var(--yp-ease);
}
.yp-card:hover h4 { color: var(--yp-primary); }

.yp-card p { padding: 0 14px 14px; font-size: .95rem; line-height: 1.5; }

.yp-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  background: #eee;
}
.yp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s var(--yp-ease), filter .4s var(--yp-ease);
}
.yp-card:hover .yp-thumb img { transform: scale(1.06); filter: saturate(1.1); }

/* Play-icoon dat in-zoomt bij hover */
.yp-thumb.is-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(0,0,0,.35) 0 28%, transparent 28.5%);
  opacity: 0;
  transition: opacity .35s var(--yp-ease);
}
.yp-thumb.is-video::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent #fff;
  transform: translate(-38%, -50%) scale(.7);
  opacity: 0;
  transition: transform .45s var(--yp-ease-back), opacity .3s var(--yp-ease);
  z-index: 2;
}
.yp-card:hover .yp-thumb.is-video::after { opacity: 1; }
.yp-card:hover .yp-thumb.is-video::before {
  opacity: 1;
  transform: translate(-38%, -50%) scale(1);
}

/* Focus states voor toetsenbord-gebruikers */
.yp-thumb:focus-visible {
  outline: 3px solid var(--yp-primary);
  outline-offset: 3px;
}

/* ===== 5. Navigatie — actieve sectie + hover ==================== */

.yp-nav {
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  background: rgba(255,255,255,.85);
  transition: box-shadow .3s var(--yp-ease), border-color .3s var(--yp-ease);
}
.yp-nav.scrolled {
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.yp-nav .nav-link {
  position: relative;
  transition: color .2s var(--yp-ease);
}
.yp-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 4px;
  width: 0; height: 2px;
  background: var(--yp-primary);
  transform: translateX(-50%);
  transition: width .3s var(--yp-ease);
}
.yp-nav .nav-link:hover::after,
.yp-nav .nav-link.active::after { width: 60%; }
.yp-nav .nav-link.active { color: var(--yp-primary); }

/* Scroll progress indicator — zeer dun, boven aan pagina */
.yp-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: var(--yp-scroll, 0%);
  background: linear-gradient(90deg, var(--yp-primary), var(--yp-secondary));
  z-index: 10002;
  transition: width .1s linear;
}

/* ===== 6. Opdrachtgevers — magnetisch hover ===================== */

.yp-logo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.yp-logo {
  display: grid;
  place-items: center;
  aspect-ratio: 16/9;
  padding: 18px;
  border-radius: 12px;
  background: #fafafa;
  filter: saturate(.1) opacity(.65);
  transition: filter .4s var(--yp-ease),
              transform .4s var(--yp-ease-back),
              background .4s var(--yp-ease);
}
.yp-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.yp-logo:hover {
  filter: saturate(1) opacity(1);
  transform: translateY(-4px);
  background: #fff;
  box-shadow: 0 12px 24px -14px rgba(0,0,0,.25);
}

/* ===== 7. CTA / contact ========================================= */

.yp-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: none;
  border-radius: 999px;
  background: var(--yp-primary);
  color: #fff;
  font: 600 1rem/1 "Roboto", sans-serif;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .3s var(--yp-ease), box-shadow .3s var(--yp-ease);
}
.yp-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -10px rgba(212,43,97,.6); }
.yp-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(0,0,0,.08) 0, transparent 60%);
  opacity: 0;
  transition: opacity .3s var(--yp-ease);
  z-index: -1;
}
.yp-btn:hover::before { opacity: 1; }
.yp-btn .yp-arrow {
  display: inline-block;
  transition: transform .3s var(--yp-ease);
}
.yp-btn:hover .yp-arrow { transform: translateX(4px); }

/* Contact-icons: subtiele "hartslag" op hover */
.yp-contact-icon {
  display: inline-grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fafafa;
  color: var(--yp-primary);
  margin: 6px;
  transition: transform .3s var(--yp-ease-back), background .3s var(--yp-ease), color .3s var(--yp-ease);
}
.yp-contact-icon:hover {
  transform: translateY(-3px) scale(1.05);
  background: var(--yp-primary);
  color: #fff;
  animation: yp-pulse 1.2s var(--yp-ease) infinite;
}
@keyframes yp-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(212,43,97,.45); }
  50%     { box-shadow: 0 0 0 12px rgba(212,43,97,0); }
}

/* ===== 8. Modal polish ========================================== */

.yp-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,10,10,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--yp-ease);
  z-index: 10050;
}
.yp-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.yp-modal-panel {
  width: min(960px, 92vw);
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  transform: scale(.92) translateY(14px);
  opacity: 0;
  transition: transform .5s var(--yp-ease-back), opacity .35s var(--yp-ease);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
  position: relative;
}
.yp-modal-backdrop.open .yp-modal-panel {
  transform: none;
  opacity: 1;
}
.yp-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff;
  border: none;
  font-size: 18px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .3s var(--yp-ease), transform .3s var(--yp-ease);
  z-index: 2;
}
.yp-modal-close:hover { background: rgba(255,255,255,.3); transform: rotate(90deg); }

.yp-video-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: rgba(255,255,255,.6);
  font: 500 14px/1.4 "Source Sans Pro", sans-serif;
  text-align: center;
  padding: 20px;
}

/* ===== 8b. Bootstrap modal polish =============================== */
.modal.fade .modal-dialog {
  transform: scale(.94) translateY(12px);
  opacity: 0;
  transition: transform .4s var(--yp-ease-back), opacity .3s var(--yp-ease);
}
.modal.show .modal-dialog {
  transform: none;
  opacity: 1;
}
.modal-backdrop.show {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: .72;
}

/* ===== 9. Kleine details ======================================== */

/* Cursor-gestuurde gloed achter de naam (uit, niet visueel gewenst) */
.yp-glow { display: none !important; }

/* Sectie-titels: klein kleuraccent links */
.yp-section-title {
  position: relative;
  display: inline-block;
  padding-left: 0;
}
.yp-section-title::before {
  content: "";
  position: absolute;
  left: -26px; top: 50%;
  width: 18px; height: 4px;
  background: var(--yp-primary);
  border-radius: 2px;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left;
  transition: transform .6s var(--yp-ease) .1s;
}
.yp-reveal.in .yp-section-title::before { transform: translateY(-50%) scaleX(1); }

/* ===== 10. Heading herkleuring conform Claude Design ============= */

/* Sectie-titels (Werkwijze, Projecten, Theo Ybema, Contact, Opdrachtgevers) */
main h1.display-1,
main h1.display-3,
section h1.display-1,
section h1.display-3,
.display-1.yp-reveal,
.display-3.yp-reveal {
  color: var(--yp-head-color) !important;
  font-family: var(--yp-font-head);
  font-weight: 300;
  letter-spacing: -.02em;
}

/* Generieke pagina-titels (blog, artikelen) die niet in een witte hero staan */
h1:not(.text-white):not(.yp-reveal-letters):not(.yp-underline),
h2.text-center:not(.text-white):not(.text-dark) {
  color: var(--yp-head-color);
  font-family: var(--yp-font-head);
  font-weight: 300;
  letter-spacing: -.01em;
}

/* Hero "Theo Ybema" */
.yp-underline,
.yp-reveal-letters {
  color: var(--yp-head-color) !important;
  font-family: var(--yp-font-head);
  font-weight: 300;
}

/* Werkwijze step titels */
.yp-step h2,
.yp-step h3 {
  color: var(--yp-head-color) !important;
  font-family: var(--yp-font-head);
  font-weight: 700;
}

/* Project-kaart titels */
.yp-card h4,
.yp-card h3 {
  color: var(--yp-head-color) !important;
  font-family: var(--yp-font-head);
  font-weight: 600;
}

/* Werkwijze: zachte cirkel-achtergrond rond de iconen (zoals demo) */
.yp-step-icon {
  background: #fff6f9;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), inset 0 0 0 1px rgba(212,43,97,.08);
}

/* Intro body tekst iets zachter, conform demo */
body, p {
  color: var(--yp-body-color);
}

/* ===== 11. Project-secties: weg met roze blok & stippellijnen ==== */

/* De "ANIMATIE / APPS / VIDEO / E-LEARNING" balken: schone tekst ipv
   vol ingekleurd pink blok met witte uppercase letters. */
.projectSectie {
  background: transparent !important;
  color: var(--yp-head-color) !important;
  text-transform: none !important;
  min-height: 0 !important;
  padding: 0 !important;
}
.projectSectie h2 {
  color: var(--yp-head-color) !important;
  font-family: var(--yp-font-head);
  font-weight: 300;
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  margin: 12px 0 4px !important;
  letter-spacing: -.01em;
}

/* Het horizontale lijntje onder de sectiekop: kort en in primaire kleur,
   conform demo (een subtiel accentje, geen brede witte balk). */
.projectSectie hr {
  display: block !important;
  width: 56px !important;
  border: 0 !important;
  border-top: 2px solid var(--yp-primary) !important;
  opacity: 1 !important;
  margin: 4px 0 16px !important;
}

/* Gestippelde intro-rand weghalen (was boven- en onderrand dotted blue). */
.sectieInleiding,
@media (min-width: 768px) {
  .sectieInleiding {
    border: 0 !important;
  }
}
.sectieInleiding {
  border: 0 !important;
  color: var(--yp-body-color);
}

/* Oude werkwijze-blok met dotted border (ongebruikt maar voor de zekerheid). */
.werkwijzeBlok { border: 0 !important; padding: 0 !important; }

/* Dotted kaart-rand ook weg (wordt al vervangen door .yp-card styling). */
.projectKaart { border: 0 !important; }

/* De dikke roze horizontale scheidingslijnen tussen secties (inline style
   op #video, #e-learning, en de display-1 headings met border-top/bottom)
   vervangen we door een subtiele lijn. */
#video,
#e-learning {
  border-top: 1px solid rgba(74, 42, 56, .08) !important;
}
#projecten > .row > .col > h1.display-1,
#over-mij h1.display-1,
#contact h1.display-1,
#opdrachtgevers h1.display-3 {
  border-top: 1px solid rgba(74, 42, 56, .08) !important;
  border-bottom: 1px solid rgba(74, 42, 56, .08) !important;
}
/* Projecten-heading: alleen onderlijn, geen bovenlijn */
#projecten > .row > .col > h1.display-1 {
  border-top: 0 !important;
}
/* Opdrachtgevers: alleen bovenlijn */
#opdrachtgevers h1.display-3 {
  border-bottom: 0 !important;
}
