:root {
  color-scheme: dark;
  --black: #020202;
  --green: #b5ff36;
  --purple: #a539ff;
  --white: #f7f7f4;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--black); }
body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
  color: var(--white);
  font-family: "Arial Narrow", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 5px;
}

/* Color matrix is evaluated on the native looping video, avoiding canvas
   tainting and GPU context failures when previewing local files. */
.video-source {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  filter: url("#hdnvsns-duotone");
  -webkit-filter: url("#hdnvsns-duotone");
}
.filter-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.page-home {
  min-height: 100vh;
  min-height: 100dvh;
}

.site-header {
  position: fixed;
  z-index: 80;
  inset: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(18px, 3vw, 38px);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.wordmark {
  display: inline-block;
  padding: 8px 0;
  color: #fff;
  font-size: clamp(19px, 1.8vw, 25px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.075em;
  text-decoration: none;
  text-shadow: 2px 2px 0 rgba(165, 57, 255, .72);
  user-select: none;
}

.menu-toggle {
  position: relative;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 51px;
  height: 51px;
  padding: 0;
  border: 1px solid rgba(181, 255, 54, .9);
  border-radius: 0;
  background: #000;
  color: var(--green);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle:hover { background: #0c0a12; }
.menu-toggle-lines { position: relative; display: block; width: 22px; height: 17px; }
.menu-toggle-lines span {
  position: absolute;
  right: 0;
  left: 0;
  display: block;
  height: 2px;
  background: currentColor;
  box-shadow: 2px 2px 0 var(--purple);
  transition: top 260ms ease, transform 260ms ease, opacity 150ms ease;
}
.menu-toggle-lines span:nth-child(1) { top: 1px; }
.menu-toggle-lines span:nth-child(2) { top: 8px; }
.menu-toggle-lines span:nth-child(3) { top: 15px; }
.menu-open .menu-toggle-lines span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.menu-open .menu-toggle-lines span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle-lines span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

.menu-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(0, 0, 0, .66);
  opacity: 0;
  visibility: hidden;
  transition: opacity 280ms ease, visibility 280ms ease;
}
.menu-panel {
  position: fixed;
  z-index: 60;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  height: 100vh;
  height: 100dvh;
  padding: 80px clamp(28px, 5.5vw, 64px) max(30px, env(safe-area-inset-bottom));
  overflow-y: auto;
  border-left: 1px solid rgba(181, 255, 54, .62);
  background: #000;
  box-shadow: -8px 0 0 rgba(165, 57, 255, .2);
  opacity: 0;
  visibility: hidden;
  transform: translateX(102%);
  transition: transform 330ms cubic-bezier(.19, 1, .22, 1), opacity 240ms ease, visibility 330ms ease;
}
.menu-open .menu-backdrop { visibility: visible; opacity: 1; }
.menu-open .menu-panel { visibility: visible; opacity: 1; transform: translateX(0); }
.menu-logo-link {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: clamp(140px, 24vh, 200px);
  overflow: hidden;
}
.menu-logo-link img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100%, 300px, 39vh);
  height: auto;
  max-width: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}
.menu-nav {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(9px, 1.7vh, 17px);
  margin-top: clamp(9px, 3vh, 22px);
  padding-bottom: 32px;
}
.menu-link {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: 1px 8px 4px 0;
  font-size: clamp(34px, 4.1vw, 55px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.065em;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.menu-link .text-front { position: relative; z-index: 2; color: var(--green); }
.menu-link .text-shadow {
  position: absolute;
  z-index: 1;
  top: 4px;
  left: 4px;
  color: var(--purple);
  white-space: nowrap;
  pointer-events: none;
}
.menu-link:hover .text-front,
.menu-link[aria-current="page"] .text-front { color: #fff; }
.menu-link:hover .text-shadow { top: 6px; left: 6px; }
.menu-link .text-shadow { transition: top 120ms ease, left 120ms ease; }

.project-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 96px 30px 50px;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(77, 35, 119, .15), transparent 60%),
    #000;
}
.project-stage::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    rgba(160, 255, 96, .017) 4px
  );
  content: "";
  pointer-events: none;
}
.project-title {
  position: relative;
  margin: 0;
  max-width: 100%;
  color: var(--green);
  font-size: clamp(53px, 11vw, 166px);
  font-weight: 900;
  line-height: .93;
  letter-spacing: -.09em;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: clamp(3px, .6vw, 9px) clamp(3px, .6vw, 9px) 0 var(--purple);
}
.project-stage.has-game { display: block; padding: 0; }
.project-stage.has-game::before, .project-stage.has-game .project-title { display: none; }
.game-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

@media (max-width: 550px) {
  .site-header { padding: 18px; }
  .menu-toggle { width: 48px; height: 48px; }
  .menu-panel { padding-top: 76px; border-left: none; }
  .menu-logo-link { height: clamp(135px, 23vh, 185px); }
  .menu-nav { gap: clamp(11px, 2vh, 18px); }
  .menu-link { font-size: clamp(33px, 9.3vw, 49px); }
}
@media (max-height: 580px) {
  .menu-panel { padding-top: 68px; }
  .menu-logo-link { height: 130px; }
  .menu-nav { gap: 10px; margin-top: 5px; }
  .menu-link { font-size: 31px; }
}
