/* ============================================================
   MOERLAB — centrale toegangspoort
   ============================================================ */

:root {
  --bg: #09111F;
  --bg-2: #121923;
  --ink: #F5F3EF;
  --ink-soft: #C3C8D2;
  --ink-mute: #98A1B0;
  --warm: #F29B54;
  --sand: #D8B98A;
  --line: rgba(245, 243, 239, .10);
  --panel: rgba(18, 25, 35, .62);
  --radius: 22px;
  --font-display: "Sora", "Space Grotesk", system-ui, sans-serif;
  --font-body: "Manrope", "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-navigating { overflow: hidden; }

a { color: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-weight: 700;
  text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 16px; }

:focus-visible {
  outline: 3px solid var(--warm);
  outline-offset: 4px;
  border-radius: 8px;
}

/* ---------- Achtergrond ---------- */
.bg-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vmax 45vmax at 85% -10%, rgba(242, 155, 84, .16), transparent 60%),
    radial-gradient(55vmax 45vmax at -10% 105%, rgba(116, 169, 255, .14), transparent 60%),
    radial-gradient(40vmax 30vmax at 50% 55%, rgba(188, 147, 255, .06), transparent 70%);
}

/* ---------- Podium (zoomt bij de overgang) ---------- */
.stage {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: 0 clamp(16px, 4vw, 56px);
  transform-origin: 50% 50%;
  will-change: auto;
}
.stage.is-zooming {
  transition: transform .62s cubic-bezier(.7, 0, .84, 0), opacity .5s ease-in .12s, filter .55s ease-in;
  will-change: transform, opacity;
}

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: clamp(18px, 3vw, 30px) 0;
  max-width: 1320px; width: 100%; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.brand-mark svg { display: block; color: var(--ink); }
.brand-word {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.3rem; letter-spacing: .14em;
}
.brand-word span { color: var(--warm); }

.header-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .86rem; color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(245, 243, 239, .03);
  transition: border-color .25s, color .25s, background .25s;
}
.header-link strong { color: var(--ink); font-weight: 700; }
.header-link:hover { border-color: rgba(242, 155, 84, .5); color: var(--ink); background: rgba(242, 155, 84, .08); }

/* ---------- Hero ---------- */
main { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; }

.hero {
  text-align: center;
  padding: clamp(20px, 4.5vh, 64px) 0 clamp(26px, 4.5vh, 48px);
  max-width: 860px; margin: 0 auto;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 22px;
  font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--sand);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 0 0 rgba(242, 155, 84, .6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(242, 155, 84, .55); }
  70% { box-shadow: 0 0 0 10px rgba(242, 155, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 155, 84, 0); }
}

h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6.4vw, 4.9rem);
  line-height: 1.02; letter-spacing: -.035em;
  margin: 0 0 18px;
}
.grad {
  background: linear-gradient(100deg, #F5F3EF 0%, #F29B54 38%, #FF7E8B 62%, #BC93FF 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.tagline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2.3vw, 1.5rem);
  letter-spacing: -.01em;
  margin: 0 0 14px; color: var(--ink);
}
.intro {
  margin: 0 auto; max-width: 520px;
  color: var(--ink-soft); font-size: clamp(1rem, 1.4vw, 1.08rem);
}

/* ---------- Portalen ---------- */
.portals { padding-bottom: clamp(36px, 7vh, 80px); outline: none; }

.portal-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(14px, 1.6vw, 22px);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  perspective: 1400px;
}

.portal-list > li {
  opacity: 0; transform: translateY(18px);
  animation: rise .8s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 80ms + 150ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

.portal {
  --accent: #F29B54;
  --accent-rgb: 242, 155, 84;
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start;
  height: 100%;
  padding: 22px 22px 22px;
  border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), .10), rgba(var(--accent-rgb), 0) 46%),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 20px 50px -24px rgba(0, 0, 0, .7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden; isolation: isolate;
  transition: transform .45s var(--ease-out), border-color .35s, box-shadow .45s var(--ease-out), opacity .4s;
  -webkit-tap-highlight-color: transparent;
}
/* licht dat de muis volgt */
.portal::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(var(--accent-rgb), .20), transparent 65%);
  opacity: 0; transition: opacity .35s;
}
/* gloeiende rand */
.portal::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: 1;
  background: linear-gradient(160deg, rgba(var(--accent-rgb), .9), rgba(var(--accent-rgb), 0) 45%, rgba(var(--accent-rgb), .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.portal:hover, .portal:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(var(--accent-rgb), .45);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 30px 60px -26px rgba(var(--accent-rgb), .55), 0 20px 50px -24px rgba(0, 0, 0, .7);
}
.portal:hover::before, .portal:focus-visible::before,
.portal:hover::after, .portal:focus-visible::after { opacity: 1; }
.portal:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }

.portal-num {
  position: absolute; top: 18px; right: 20px;
  font-family: var(--font-display); font-weight: 600; font-size: .78rem;
  letter-spacing: .12em; color: var(--ink-mute);
}

/* Het "venster" met ringen */
.portal-orb {
  position: relative;
  width: 92px; height: 92px; margin: 6px 0 22px;
  display: grid; place-items: center;
  flex: none;
}
.portal-orb .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(var(--accent-rgb), .55);
}
.portal-orb .ring:nth-child(2) {
  inset: 12px; border-color: rgba(var(--accent-rgb), .3);
  border-style: dashed;
  animation: spin 22s linear infinite;
}
.portal-orb .ring:nth-child(3) {
  inset: -9px; border-color: transparent;
  border-top-color: rgba(var(--accent-rgb), .9);
  border-right-color: rgba(var(--accent-rgb), .25);
  animation: spin 9s linear infinite reverse;
}
.portal-orb .core {
  position: relative;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(var(--accent-rgb), .55), rgba(var(--accent-rgb), .14) 70%);
  box-shadow: 0 0 28px rgba(var(--accent-rgb), .45), inset 0 0 12px rgba(255, 255, 255, .12);
  color: #fff;
  transition: transform .5s var(--ease-out), box-shadow .5s;
}
.portal-orb svg { width: 24px; height: 24px; }
.portal:hover .core, .portal:focus-visible .core {
  transform: scale(1.1);
  box-shadow: 0 0 44px rgba(var(--accent-rgb), .75), inset 0 0 12px rgba(255, 255, 255, .2);
}
.portal:hover .ring:nth-child(3), .portal:focus-visible .ring:nth-child(3) { animation-duration: 2.6s; }
@keyframes spin { to { transform: rotate(360deg); } }

.portal-text { display: flex; flex-direction: column; flex: 1; }
.portal-role {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.28rem; letter-spacing: -.01em;
  margin: 0 0 6px;
}
.portal-sub {
  font-weight: 600; color: var(--accent); font-size: .95rem;
  margin: 0 0 8px; line-height: 1.35;
}
.portal-desc { color: var(--ink-soft); font-size: .93rem; margin: 0 0 22px; line-height: 1.45; }

.portal-cta {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 16px 10px 18px;
  border-radius: 999px;
  font-weight: 700; font-size: .92rem;
  color: #0B1220;
  background: var(--accent);
  box-shadow: 0 8px 22px -10px rgba(var(--accent-rgb), .9);
  transition: gap .3s var(--ease-out), filter .3s;
}
.portal-cta svg { width: 16px; height: 16px; transition: transform .3s var(--ease-out); }
.portal:hover .portal-cta svg, .portal:focus-visible .portal-cta svg { transform: translateX(3px); }
.portal:active { transform: translateY(-2px) scale(.985); }

/* Tijdens de overgang */
.is-navigating .portal { pointer-events: none; }
.portal.is-dimmed { opacity: .15; transform: scale(.94); filter: blur(2px); }
.portal.is-chosen {
  transform: translateY(-4px) scale(1.04);
  border-color: rgba(var(--accent-rgb), .9);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .6), 0 0 80px -10px rgba(var(--accent-rgb), .8);
}
.portal.is-chosen::before, .portal.is-chosen::after { opacity: 1; }

.noscript {
  text-align: center; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px;
}
.noscript a { color: var(--warm); }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1320px; width: 100%; margin: 0 auto;
  padding: 22px 0 calc(22px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: .85rem; color: var(--ink-mute);
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink-soft); text-decoration-color: rgba(242, 155, 84, .6); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--warm); }

/* ---------- Wormhole ---------- */
.wormhole {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 20; pointer-events: none;
  opacity: 0; transition: opacity .35s ease-out;
}
.wormhole.is-active { opacity: 1; }

.flash {
  position: fixed; inset: 0; z-index: 25; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #fff 0%, var(--flash, #F29B54) 30%, transparent 75%);
  opacity: 0;
}
.flash.is-on { animation: flash .55s ease-out forwards; }
@keyframes flash {
  0% { opacity: 0; transform: scale(.4); }
  35% { opacity: .9; transform: scale(1.4); }
  100% { opacity: 0; transform: scale(2.2); }
}

/* ---------- Tussenscherm ---------- */
.transit {
  --accent: #F29B54; --accent-rgb: 242, 155, 84;
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  padding: 24px 16px;
  background: radial-gradient(70vmax 60vmax at 50% 45%, rgba(var(--accent-rgb), .16), rgba(9, 17, 31, .82) 55%, rgba(9, 17, 31, .94));
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.transit[hidden] { display: none; }
.transit.is-visible .transit-card { animation: transitIn .5s var(--ease-out) both; }
@keyframes transitIn {
  from { opacity: 0; transform: scale(.92) translateY(10px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
.transit-card {
  width: min(460px, 100%);
  text-align: center;
  padding: 34px 26px 26px;
  border-radius: 28px;
  background: rgba(13, 20, 32, .72);
  border: 1px solid rgba(var(--accent-rgb), .35);
  box-shadow: 0 0 120px -30px rgba(var(--accent-rgb), .7), 0 40px 80px -30px rgba(0, 0, 0, .8);
}
.transit-orb {
  position: relative; width: 112px; height: 112px; margin: 0 auto 22px;
  display: grid; place-items: center;
}
.transit-orb .ring { position: absolute; border-radius: 50%; border: 2px solid transparent; }
.transit-orb .r1 { inset: 0; border-top-color: var(--accent); border-left-color: rgba(var(--accent-rgb), .35); animation: spin 1.1s linear infinite; }
.transit-orb .r2 { inset: 14px; border-bottom-color: var(--accent); border-right-color: rgba(var(--accent-rgb), .3); animation: spin 1.6s linear infinite reverse; }
.transit-orb .r3 { inset: 28px; border: 1.5px dashed rgba(var(--accent-rgb), .4); animation: spin 6s linear infinite; }
.transit-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, rgba(var(--accent-rgb), .7), rgba(var(--accent-rgb), .2));
  box-shadow: 0 0 30px rgba(var(--accent-rgb), .7);
}
.transit-icon svg { width: 20px; height: 20px; }
.transit-kicker {
  margin: 0 0 6px; font-size: .74rem; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: var(--accent);
}
.transit-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.6rem, 6vw, 2.1rem); letter-spacing: -.02em;
  margin: 0 0 14px; outline: none;
}
.transit-msg { margin: 0 0 4px; font-weight: 700; font-size: 1.05rem; }
.transit-sub { margin: 0 0 22px; color: var(--ink-soft); font-size: .95rem; }
.transit-bar {
  height: 4px; border-radius: 4px; overflow: hidden;
  background: rgba(245, 243, 239, .10);
  margin: 0 0 20px;
}
.transit-bar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .6), var(--accent));
  box-shadow: 0 0 12px var(--accent);
}
.transit-bar span.is-running { animation: fill var(--delay, 1000ms) linear forwards; }
@keyframes fill { to { width: 100%; } }
.transit-link {
  display: inline-block; padding: 8px 6px;
  color: var(--ink); font-size: .92rem; font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--accent);
  text-underline-offset: 4px; text-decoration-thickness: 2px;
}
.transit-link:hover { color: var(--accent); }
.transit-link:focus-visible { outline-color: var(--accent); }

/* ---------- Responsief ---------- */
@media (max-width: 1180px) {
  .portal-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .portal-list > li { grid-column: span 2; }
  .portal-list > li:nth-child(4) { grid-column: 2 / span 2; }
  .portal-list > li:nth-child(5) { grid-column: 4 / span 2; }
}

@media (max-width: 760px) {
  .portal-list { grid-template-columns: 1fr; gap: 12px; }
  .portal-list > li, .portal-list > li:nth-child(4), .portal-list > li:nth-child(5) { grid-column: auto; }
  .portal {
    flex-direction: row; align-items: center; gap: 16px;
    padding: 16px 16px 16px 14px;
    border-radius: 18px;
  }
  .portal:hover, .portal:focus-visible { transform: none; }
  .portal-orb { width: 64px; height: 64px; margin: 0; }
  .portal-orb .ring:nth-child(2) { inset: 8px; }
  .portal-orb .ring:nth-child(3) { inset: -5px; }
  .portal-orb .core { width: 40px; height: 40px; }
  .portal-orb svg { width: 20px; height: 20px; }
  .portal-num { display: none; }
  .portal-role { font-size: 1.12rem; margin-bottom: 2px; }
  .portal-sub { font-size: .9rem; margin-bottom: 2px; }
  .portal-desc { margin: 0; font-size: .86rem; }
  .portal-cta {
    margin: 0; padding: 0; min-height: 44px; width: 44px; flex: none;
    justify-content: center; border-radius: 50%;
  }
  .portal-cta .cta-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .header-link { font-size: .78rem; padding: 7px 11px; }
  .header-link .hide-sm { display: none; }
  .hero { text-align: left; padding-top: 16px; }
  .eyebrow { font-size: .72rem; margin-bottom: 14px; }
}

@media (max-width: 400px) {
  .brand-word { font-size: 1.1rem; }
  .brand-mark svg { width: 28px; height: 28px; }
  .header-link { display: none; }
}

/* ---------- Minder beweging ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .portal-list > li { opacity: 1; transform: none; }
  .transit-bar span.is-running { animation-duration: var(--delay, 1000ms) !important; }
  .transit.is-visible .transit-card { animation: fadeOnly .25s ease-out both !important; animation-duration: .25s !important; }
  .stage.is-calm { transition: opacity .25s ease !important; opacity: 0; }
}
@keyframes fadeOnly { from { opacity: 0; } to { opacity: 1; } }

@media (forced-colors: active) {
  .portal { border: 2px solid CanvasText; }
  .portal-cta { border: 1px solid ButtonText; }
}
