/* Design plan
   Strict black and white: only #000 and #fff, softer tones are white with
   transparency. The edits play greyscale and stretched behind everything,
   with a dithered 3D Roblox baseplate world on top of them. No rules, no
   borders, no boxes: structure comes from scale, spacing and alignment.
   Wide display type for names and headings, a fine serif for sentences.
   Left aligned, with the stats and notes pushed to the right edge. */
:root {
  --white: #fff;
  --black: #000;
  --w80: rgb(255 255 255 / 0.8);
  --w60: rgb(255 255 255 / 0.6);
  --w30: rgb(255 255 255 / 0.3);

  --f-wide: "Archivo", "Arial Black", Arial, sans-serif;
  --f-serif: "Instrument Serif", "Times New Roman", serif;

  --maxw: 1440px;
  --header-h: 64px;
  --gutter: max(2rem, env(safe-area-inset-left, 0px));
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --t: 220ms;
  color-scheme: dark;
}

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

html {
  scroll-padding-top: var(--header-h);
  scrollbar-width: thin;
  scrollbar-color: var(--white) var(--black);
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--f-wide);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--white);
  color: var(--black);
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

main {
  position: relative;
  z-index: 2;
}

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 4rem);
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: max(2rem, env(safe-area-inset-right, 0px));
}

/* ---------- Background ---------- */

.video-bg-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--black);
}

#bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: grayscale(1) contrast(1.2) brightness(0.9);
}

.video-bg-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgb(0 0 0 / 0.42);
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  image-rendering: pixelated;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 50;
  mix-blend-mode: difference;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  font-weight: 800;
  font-stretch: 125%;
  font-size: 1.05rem;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 2.25rem;
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity var(--t) var(--ease);
}

.site-nav a:hover,
.site-nav a.active {
  opacity: 1;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--white);
  transition: transform var(--t) var(--ease), top var(--t) var(--ease);
}

.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  padding-block: calc(var(--header-h) + 3.5rem) 1.5rem;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
}

.hero-intro {
  margin: 0;
  max-width: 22ch;
  font-family: var(--f-serif);
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  line-height: 1.12;
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  margin: 0;
  text-align: right;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stat dd {
  margin: 0;
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat dt {
  max-width: 24ch;
  margin-top: 0.35rem;
  font-family: var(--f-serif);
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--w80);
}

.mega {
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  line-height: 0.78;
  letter-spacing: -0.035em;
  white-space: nowrap;
  mix-blend-mode: difference;
}

.fit {
  display: inline-block;
  font-size: 17.5vw;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(8rem, 18vw, 14rem) 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.h2 {
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(3.5rem, 11vw, 10rem);
  line-height: 0.8;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.section-note {
  margin: 0;
  max-width: 24ch;
  font-family: var(--f-serif);
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--w80);
  text-align: right;
}

/* ---------- Skills poster: fill shows level ---------- */

.legend {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  font-family: var(--f-serif);
  font-size: 1.2rem;
  color: var(--w80);
}

.legend li {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.key {
  font-family: var(--f-wide);
  font-weight: 900;
  font-stretch: 125%;
  font-size: 1.6rem;
  line-height: 1;
}

.skill-poster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1em 0.42em;
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(2.2rem, 6.4vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.key--solid,
.lvl--solid {
  color: var(--white);
}

.key--outline,
.lvl--outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--white);
}

.key--dots,
.lvl--dots {
  color: transparent;
  background: radial-gradient(var(--white) 1.2px, transparent 1.5px) 0 0 / 4px 4px;
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---------- Games: staggered 3D cards ---------- */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 4vw, 4rem);
  row-gap: clamp(2.5rem, 5vw, 4.5rem);
  perspective: 1400px;
}

/* Second column sits lower, so the grid reads as a staggered wall. */
.cards li:nth-child(even) {
  transform: translateY(clamp(3rem, 9vw, 9rem));
}

.cards li:last-child:nth-child(even) {
  margin-bottom: clamp(3rem, 9vw, 9rem);
}

.card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  display: block;
  text-decoration: none;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card.tilting {
  transition: transform 80ms linear;
}

.card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: radial-gradient(var(--w30) 1px, transparent 1.3px) 0 0 / 4px 4px, rgb(0 0 0 / 0.55);
}

.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.15) brightness(0.92);
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 500ms ease, transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 300ms ease;
}

.card-media img.loaded {
  opacity: 1;
}

.card:hover .card-media img {
  transform: scale(1.1);
  filter: grayscale(1) contrast(1.3) brightness(1.05);
}

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgb(255 255 255 / 0.25), transparent 55%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.card:hover .card-media::after {
  opacity: 1;
}

.card-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(1.6rem, 3.6vw, 3.2rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1px var(--w60);
}

.card-media img.loaded + .card-ph {
  display: none;
}

.card-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  transform: translateZ(50px);
}

.card-name {
  min-width: 0;
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(1.2rem, 2.1vw, 1.9rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.card-go {
  flex-shrink: 0;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 1.15rem;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}

.card:hover .card-go,
.card:focus-visible .card-go {
  opacity: 1;
  transform: none;
}

/* ---------- Contact ---------- */

.contact {
  padding-block: clamp(12rem, 24vw, 20rem) clamp(3rem, 6vw, 5rem);
}

.contact-label {
  margin: 0 0 1rem;
  font-family: var(--f-serif);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.contact-user {
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.8;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  mix-blend-mode: difference;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2.5rem;
  margin-top: 2.5rem;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  height: 60px;
  padding: 0 2.25rem;
  font: inherit;
  font-weight: 700;
  font-stretch: 112%;
  font-size: 1rem;
  color: var(--black);
  background: var(--white);
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease);
}

.copy-btn:hover {
  transform: scale(1.04);
}

.copy-btn.copied {
  background: var(--black);
  color: var(--white);
}

.text-link {
  font-family: var(--f-serif);
  font-size: 1.2rem;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 2;
  padding-block: 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.85rem;
  color: var(--w60);
}

.footer-inner p {
  margin: 0;
}

/* ---------- Audio control ---------- */

.audio-control {
  position: fixed;
  right: calc(1.25rem + env(safe-area-inset-right, 0px));
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 42px;
  padding: 0 1.1rem 0 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  background: var(--white);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  mix-blend-mode: difference;
}

.audio-control .icon {
  width: 18px;
  height: 18px;
}

.audio-control .icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  padding: 0.75rem 1.3rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--black);
  background: var(--white);
  border-radius: 999px;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 300;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  color: var(--black);
  background: var(--white);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Smooth scroll (Lenis) ---------- */

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* ---------- Load sequence ---------- */

.js .load {
  animation: wipe 1100ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 140ms + 150ms);
}

@keyframes wipe {
  from {
    clip-path: inset(100% 0 0 0);
    transform: translateY(0.4em);
  }
  to {
    clip-path: inset(-10% 0 -10% 0);
    transform: none;
  }
}

/* ---------- 404 ---------- */

.not-found {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.not-found .hero-intro {
  margin: 2rem 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-top {
    flex-direction: column;
  }

  .stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
    text-align: left;
  }

  .stat {
    align-items: flex-start;
    flex: 1 1 9rem;
  }

  .section-note {
    text-align: left;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: max(16px, env(safe-area-inset-left, 0px));
  }

  .wrap {
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .site-header {
    mix-blend-mode: normal;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem max(16px, env(safe-area-inset-right, 0px)) 1.5rem max(16px, env(safe-area-inset-left, 0px));
    background: var(--black);
    clip-path: inset(0 0 100% 0);
    pointer-events: none;
    transition: clip-path 350ms var(--ease);
  }

  .site-nav.open {
    clip-path: inset(0 0 0 0);
    pointer-events: auto;
  }

  .site-nav a {
    padding: 0.6rem 0;
    font-size: 2rem;
    font-weight: 900;
    font-stretch: 125%;
    letter-spacing: -0.03em;
    opacity: 1;
  }

  .hero-inner {
    padding-top: calc(var(--header-h) + 1.5rem);
  }

  .stat dd {
    font-size: 1.8rem;
  }

  .stat dt {
    font-size: 0.95rem;
  }

  .legend {
    gap: 1rem;
    font-size: 1.05rem;
  }

  .skill-poster {
    font-size: 8.4vw;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .cards li:nth-child(even) {
    transform: none;
  }

  .cards li:last-child:nth-child(even) {
    margin-bottom: 0;
  }

  .card-go {
    opacity: 1;
    transform: none;
  }

  .copy-btn {
    width: 100%;
    justify-content: center;
  }

  .audio-label {
    display: none;
  }

  .audio-control {
    width: 42px;
    padding: 0;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
