/* kriskraanen.nl — motion. Progressive: without JS or with reduced motion
   everything is simply visible. */

/* ---------- progress line ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--sp, 0)); transition: background-color .8s var(--ease); }

/* ---------- header ---------- */
.site-header { transition: transform .6s var(--ease); }
.site-header.hidden { transform: translateY(-100%); }

/* ---------- split words (headings) ---------- */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .03em .12em; margin: 0 -.03em -.12em; }
.wi { display: inline-block; }
html.js [data-split] .wi { transform: translateY(105%); }
html.js [data-split].in .wi { transform: none; transition: transform 1.1s var(--ease); transition-delay: calc(var(--d, 0) * 60ms); }

/* ---------- generic reveal ---------- */
html.js [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--k, 0) * 100ms); }
html.js [data-reveal].in { opacity: 1; transform: none; }
html.js [data-stagger] > * { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--k, 0) * 100ms + 80ms); }
html.js [data-stagger].in > * { opacity: 1; transform: none; }

/* ---------- hero ---------- */
.blobs { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .6; }
.blob.b1 { width: 42vw; height: 42vw; max-width: 600px; max-height: 600px; right: -10vw; top: -8vw; background: rgba(255, 46, 59, .28); animation: drift1 24s ease-in-out infinite alternate; }
.blob.b2 { width: 30vw; height: 30vw; max-width: 440px; max-height: 440px; right: 24vw; bottom: -14vw; background: rgba(255, 255, 255, .07); animation: drift2 28s ease-in-out infinite alternate; }
.blob.b3 { display: none; }
@keyframes drift1 { to { transform: translate(-6vw, 5vw) scale(1.1); } }
@keyframes drift2 { to { transform: translate(8vw, -4vw) scale(.92); } }
.hero .wrap { transform: translate3d(0, calc(var(--sy, 0) * -.1px), 0); opacity: calc(1 - var(--sy, 0) / 950); }
html.js .hero .fade { animation: rise-in 1.2s var(--ease) both; animation-delay: calc(var(--d, 0) * 80ms + 200ms); }
@keyframes rise-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; padding: 26px 0; border-block: 1px solid var(--line); transition: border-color .8s var(--ease); }
.marquee .track { display: flex; width: max-content; animation: marquee 55s linear infinite; }
.marquee span { font-family: var(--head); font-weight: 600; letter-spacing: -0.03em; font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1; white-space: nowrap; padding: 0 24px; display: inline-flex; align-items: center; gap: 48px; }
.marquee span:nth-child(even) { color: var(--muted); }
.marquee span::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- stacked panels ---------- */
@media (min-width: 861px) and (min-height: 700px) {
  .panels .panel { position: sticky; top: calc(100px + var(--i) * 24px); transform-origin: 50% 0; transform: scale(var(--s, 1)); will-change: transform; }
  .panels .panel::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: #000000; opacity: var(--o, 0); pointer-events: none; }
  .panel { position: relative; }
}

/* ---------- project: browser mock floats, content shimmers ---------- */
.browser { animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }
.browser .page b { position: relative; overflow: hidden; }
.browser .page b::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); transform: translateX(-100%); animation: shimmer 3.2s ease-in-out infinite; }
.browser .grid i { animation: pop 6s var(--ease) infinite; }
.browser .grid i:nth-child(2) { animation-delay: .3s; }
.browser .grid i:nth-child(3) { animation-delay: .6s; }
@keyframes shimmer { 60%, 100% { transform: translateX(100%); } }
@keyframes pop { 0%, 100% { background: #efefef; } 15% { background: rgba(228, 20, 35, .18); } 35% { background: #efefef; } }
.project { transform: scale(var(--ps, 1)); transition: background-color .8s var(--ease); }

/* ---------- timeline + process lines draw with scroll ---------- */
.timeline::after { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 1px; background: var(--accent); transform-origin: 50% 0; transform: scaleY(var(--pl, 1)); }
html.js .timeline::after { transform: scaleY(var(--pl, 0)); }
html.js .timeline li::before { transform: scale(0); transition: transform .8s var(--ease) .2s, background-color .8s var(--ease); }
html.js .timeline.in li::before { transform: scale(1); }
.process { position: relative; }
.process::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--pl, 1)); }
html.js .process::before { transform: scaleX(var(--pl, 0)); }

/* ---------- portrait: clip reveal ---------- */
html.js .portrait[data-reveal] { opacity: 1; transform: none; clip-path: inset(100% 0 0 0 round var(--radius)); transition: clip-path 1.4s var(--ease); }
html.js .portrait[data-reveal].in { clip-path: inset(0 0 0 0 round var(--radius)); }

/* ---------- hover polish ---------- */
.step, .panel { transition: transform .5s var(--ease), background-color .8s var(--ease); }
.step:hover { transform: translateY(-4px); }
.btn.magnetic { transform: translate(var(--tx, 0), var(--ty, 0)); transition: transform .5s var(--ease), background-color .8s var(--ease), color .8s var(--ease), box-shadow .3s ease; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js [data-split] .wi, html.js [data-reveal], html.js [data-stagger] > * { opacity: 1 !important; transform: none !important; }
  html.js .portrait[data-reveal] { clip-path: none !important; }
  html.js .timeline::after, html.js .process::before { transform: none !important; }
  html.js .timeline li::before { transform: none !important; }
  .hero .wrap { transform: none !important; opacity: 1 !important; }
  .panels .panel { transform: none !important; }
  .panels .panel::after { opacity: 0 !important; }
}
