/* ==================================================================
   3D PORTFOLIO — STIJL
   Eén kleur (--accent) wisselt mee met het geselecteerde project.
   ================================================================== */

:root {
  --bg: #07080c;
  --bg-soft: #0b0d13;
  --ink: #eef0f5;
  --muted: #8b91a3;
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.07);
  --accent: #c9f24d;
  --accent-ink: #07080c;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --topbar-h: 68px;
  --pad: clamp(16px, 3vw, 34px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  overflow: hidden;
}

body[data-view="list"] { overflow: auto; }

::selection { background: var(--accent); color: var(--accent-ink); }

button, a { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ------------------------------------------------------------ grain */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------ boot */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 90% at 50% 10%, #10131b 0%, var(--bg) 60%);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.boot.is-done { opacity: 0; visibility: hidden; }

.boot__inner { text-align: center; width: min(320px, 72vw); }

.boot__dot {
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 26px var(--accent);
  animation: pulse 1.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.7); opacity: 0.45; }
}

.boot__title {
  margin: 0 0 6px;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.boot__status {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.boot__bar {
  height: 2px;
  background: var(--line-soft);
  overflow: hidden;
}
.boot__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}

/* ---------------------------------------------------------- topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--pad);
  background: linear-gradient(to bottom, rgba(7, 8, 12, 0.92), rgba(7, 8, 12, 0));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 15px;
}
.brand__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.brand__name { white-space: nowrap; }

.topbar__now {
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 0;
}
.topbar__index { color: var(--accent); transition: color 0.5s var(--ease); }
.topbar__title {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__actions { display: flex; gap: 8px; }

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.chip:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.chip--ghost { background: transparent; }

/* ----------------------------------------------------------- stage */
.stage {
  position: relative;
  min-height: 100dvh;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
  touch-action: none;
}
body[data-view="3d"] #scene { opacity: 1; }
body[data-view="list"] #scene { pointer-events: none; }

/* ---------------------------------------------------------- labels */
.labels {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
body[data-view="list"] .labels,
body[data-focus="on"] .labels { opacity: 0; visibility: hidden; }

.label {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate3d(-9999px, -9999px, 0);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 14px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(8, 10, 15, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), opacity 0.35s var(--ease);
  will-change: transform, opacity;
}
.label.is-out { opacity: 0 !important; pointer-events: none; }
.label:hover,
.label.is-hot {
  border-color: var(--accent);
  background: rgba(10, 13, 19, 0.86);
}
.label__no {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--accent);
  transition: color 0.5s var(--ease);
}
.label__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.label__desc {
  font-size: 11.5px;
  color: var(--muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------ dots */
.dots {
  position: fixed;
  left: var(--pad);
  bottom: calc(var(--pad) + 4px);
  z-index: 30;
  display: flex;
  gap: 9px;
  align-items: center;
  transition: opacity 0.4s var(--ease);
}
body[data-focus="on"] .dots,
body[data-view="list"] .dots { opacity: 0; pointer-events: none; }

.dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  cursor: pointer;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.dot:hover { background: rgba(255, 255, 255, 0.6); }
.dot.is-active {
  background: var(--accent);
  transform: scale(1.55);
  box-shadow: 0 0 12px var(--accent);
}

/* ------------------------------------------------------------ hint */
.hint {
  position: fixed;
  right: var(--pad);
  bottom: calc(var(--pad) + 2px);
  z-index: 30;
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: opacity 0.5s var(--ease);
}
.hint__key { color: var(--ink); }
.hint__sep { opacity: 0.4; margin: 0 6px; }
body[data-focus="on"] .hint,
body[data-view="list"] .hint { opacity: 0; }

/* ----------------------------------------------------------- panel */
.panel {
  position: fixed;
  z-index: 35;
  top: calc(var(--topbar-h) + 8px);
  right: var(--pad);
  width: min(420px, 36vw);
  max-height: calc(100dvh - var(--topbar-h) - var(--pad) - 12px);
  overflow-y: auto;
  padding: 22px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(12, 15, 22, 0.9), rgba(8, 10, 15, 0.86));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  visibility: hidden;
  transition: opacity 0.5s var(--ease), transform 0.55s var(--ease), visibility 0.5s;
}
.panel.is-open {
  opacity: 1;
  transform: none;
  visibility: visible;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.panel__index {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  padding: 5px 11px;
  transition: color 0.5s var(--ease), border-color 0.5s var(--ease);
}
.panel__close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, transform 0.3s var(--ease);
}
.panel__close:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.4); transform: rotate(90deg); }

.panel__kicker {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel__title {
  margin: 0;
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.panel__client {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.06em;
  transition: color 0.5s var(--ease);
}
.panel__body {
  margin: 18px 0 0;
  font-size: 14.5px;
  line-height: 1.62;
  color: #c3c8d4;
}

.panel__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}
.panel__tags li {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #d6dae4;
}

.panel__facts {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 11px;
}
.panel__facts div { display: flex; gap: 14px; align-items: baseline; }
.panel__facts dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  width: 64px;
  flex: none;
}
.panel__facts dd {
  margin: 0;
  font-size: 13.5px;
  color: #d9dde7;
}

.panel__foot {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.panel__cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  transition: transform 0.3s var(--ease), filter 0.3s, background 0.5s var(--ease);
}
.panel__cta:hover { transform: translateY(-2px); filter: brightness(1.08); }
.panel__cta[hidden] { display: none; }

.panel__nav { display: flex; gap: 8px; }
.panel__nav .chip { padding: 9px 13px; font-size: 12.5px; }

/* ----------------------------------------------------------- about */
.about {
  position: fixed;
  z-index: 36;
  top: calc(var(--topbar-h) + 8px);
  left: var(--pad);
  width: min(380px, calc(100vw - 2 * var(--pad)));
  padding: 24px 26px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(9, 11, 17, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.4s var(--ease), transform 0.45s var(--ease), visibility 0.4s;
}
.about.is-open { opacity: 1; visibility: visible; transform: none; }
.about h2 {
  margin: 0 0 12px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.about p { margin: 0 0 14px; font-size: 14px; line-height: 1.6; color: #c1c6d2; }
.about__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.about__keys { margin: 0 0 14px; display: grid; gap: 8px; }
.about__keys div { display: flex; gap: 12px; align-items: baseline; }
.about__keys dt {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  min-width: 74px;
  transition: color 0.5s var(--ease);
}
.about__keys dd { margin: 0; font-size: 13px; color: var(--muted); }
.about__note {
  font-family: var(--mono);
  font-size: 11.5px !important;
  color: var(--muted) !important;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  margin-bottom: 0 !important;
}
.about code { color: var(--accent); }

/* ------------------------------------------------------------ grid */
.grid {
  display: none;
  position: relative;
  z-index: 25;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(18px, 2.4vw, 32px);
  padding: calc(var(--topbar-h) + 24px) var(--pad) 80px;
  max-width: 1500px;
  margin: 0 auto;
}
body[data-view="list"] .grid { display: grid; }

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  cursor: pointer;
  text-align: left;
  transition: transform 0.45s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 60%, transparent);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}
.card__shot {
  position: relative;
  aspect-ratio: 16 / 9.4;
  border-radius: 12px;
  overflow: hidden;
  background: #10131a;
  border: 1px solid var(--line-soft);
}
.card__shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__no {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(6, 8, 12, 0.7);
  color: var(--card-accent, var(--accent));
  border: 1px solid var(--line-soft);
}
.card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.card h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
  font-weight: 750;
}
.card p { margin: 0; font-size: 14px; line-height: 1.55; color: #b7bcc9; }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.card__tags li {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #cdd2dd;
}
.card__open {
  font-size: 13px;
  font-weight: 700;
  color: var(--card-accent, var(--accent));
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

/* --------------------------------------------------------- noweb */
.noweb {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 45;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 11, 17, 0.9);
  font-size: 13px;
  color: var(--muted);
}

/* ----------------------------------------------------- responsive */
@media (max-width: 900px) {
  .topbar__now { display: none; }
  .hint { display: none; }

  .panel {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: min(58dvh, 520px);
    padding: 18px 20px 20px;
    transform: translateY(24px);
    border-radius: 20px;
  }
  .panel__foot { justify-content: space-between; }
  .dots { bottom: auto; top: calc(var(--topbar-h) - 4px); left: 12px; }
  .label__desc { display: none; }
  .about { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; }
}

@media (max-width: 560px) {
  .brand__name { font-size: 13.5px; }
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.12s !important;
  }
}
