:root {
  --paper: #f7f6f0;
  --ink: #111111;
  --paper-dark: #ebe9e0;
  --muted: #68665f;
  --line: rgba(17,17,17,.18);
  --display: "Caveat", cursive;
  --body: "DM Sans", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  overflow-x: hidden;
  cursor: none;
}

body.modal-open { overflow: hidden; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .035;
  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='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }

button { font: inherit; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.012) 4px);
  z-index: 2;
}

.navbar {
  height: 78px;
  position: fixed;
  z-index: 90;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  background: rgba(247,246,240,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.logo span {
  width: 33px;
  height: 33px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  transform: rotate(-8deg);
}

.navbar nav {
  display: flex;
  gap: 32px;
  font-size: 12px;
  font-weight: 700;
}

.navbar nav a {
  position: relative;
}

.navbar nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transition: .3s;
}

.navbar nav a:hover::after { transform: scaleX(1); }

.nav-button {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 11px 17px;
  font-size: 11px;
  font-weight: 700;
  transition: .3s;
}

.nav-button:hover {
  background: var(--ink);
  color: var(--paper);
}

.menu-button { display: none; background: none; border: 0; font-size: 22px; }

.hero {
  min-height: 100vh;
  position: relative;
  padding: 150px 7vw 100px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.hero-content {
  width: 57%;
  position: relative;
  z-index: 5;
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  margin-bottom: 17px;
}

.hero h1 {
  font-size: clamp(62px, 8.5vw, 132px);
  line-height: .82;
  letter-spacing: -.075em;
}

.hero h1 em,
.about-text h2 em,
.contact-content h2 em {
  font-family: var(--display);
  font-weight: 500;
  font-style: normal;
  letter-spacing: -.02em;
}

.hero-description {
  color: var(--muted);
  max-width: 520px;
  margin: 34px 0 28px;
  line-height: 1.7;
  font-size: 14px;
}

.hero-buttons { display: flex; gap: 11px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 14px 19px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
  transition: .3s;
}

.btn-dark {
  background: var(--ink);
  color: var(--paper);
}

.btn-dark:hover {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 5px 6px 0 #c9c7be;
}

.btn-light:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-3px);
}

.hero-doodle {
  position: absolute;
  left: 4vw;
  top: 112px;
  font: 25px var(--display);
  line-height: .8;
  transform: rotate(-9deg);
}

.hero-doodle span { font-size: 34px; }

.hero-game-wrap {
  position: absolute;
  z-index: 8;
  right: 4.5vw;
  top: 50%;
  transform: translateY(-40%);
  width: min(39vw, 500px);
}

.game-card {
  position: relative;
  padding: 14px;
  background: #fffef8;
  border: 2px solid var(--ink);
  box-shadow: 10px 12px 0 rgba(17,17,17,.1);
  transform: rotate(1.2deg);
}

.game-card::before,
.game-card::after {
  content: "";
  position: absolute;
  inset: -5px 7px 4px -5px;
  border: 1px solid var(--ink);
  opacity: .45;
  pointer-events: none;
  transform: rotate(-1deg);
}

.game-card::after {
  inset: 4px -6px -5px 5px;
  transform: rotate(.5deg);
}

.game-top,
.game-heading,
.game-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-top {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  padding: 2px 3px 11px;
}

.game-heading { padding: 0 3px 9px; }

.game-heading strong {
  font: 26px var(--display);
}

.game-heading span {
  font-size: 12px;
  letter-spacing: 2px;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ink);
  touch-action: none;
}

.game-bottom {
  padding: 10px 3px 1px;
  font-size: 9px;
  font-weight: 700;
}

#restartGame {
  border: 1px solid var(--ink);
  background: transparent;
  padding: 6px 9px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

#restartGame:hover {
  background: var(--ink);
  color: var(--paper);
}

.hand-note {
  text-align: right;
  margin-top: 19px;
  font: 21px var(--display);
  transform: rotate(-4deg);
}

.scroll-note {
  position: absolute;
  bottom: 30px;
  left: 7vw;
  font-size: 9px;
  letter-spacing: .15em;
  font-weight: 700;
}

.section {
  padding: 130px 7vw;
  position: relative;
}

.section-title {
  display: grid;
  grid-template-columns: 80px 1fr 50px;
  margin-bottom: 65px;
}

.section-no {
  font: 27px var(--display);
}

.section-title h2 {
  font-size: clamp(42px, 6vw, 78px);
  line-height: .9;
  letter-spacing: -.065em;
}

.title-arrow {
  font: 42px var(--display);
  transform: rotate(-15deg);
}

.work-section {
  background: linear-gradient(var(--paper), var(--paper-dark));
}

.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px 34px;
}

.project { cursor: pointer; }

.project:nth-child(even) { margin-top: 100px; }

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #dfddd4;
  border: 1.5px solid var(--ink);
  overflow: hidden;
  transform: rotate(-1deg);
  transition: .45s cubic-bezier(.2,.8,.2,1);
}

.project:nth-child(even) .project-media { transform: rotate(1.2deg); }

.project:hover .project-media {
  transform: rotate(0) scale(1.015);
}

.project-media img,
.project-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: .6s;
}

.project:hover img {
  transform: scale(1.04);
  filter: grayscale(.15);
}

.project-media video { position: absolute; inset: 0; }

.image-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: var(--display);
  font-size: 28px;
}

.image-placeholder small {
  font: 9px var(--body);
  color: #777;
  margin-top: 5px;
}

.project-number,
.project-view {
  position: absolute;
  top: 12px;
  padding: 7px 9px;
  background: var(--paper);
  border: 1px solid var(--ink);
  font-size: 9px;
  font-weight: 700;
}

.project-number { left: 12px; }
.project-view { right: 12px; }

.project-info {
  padding: 17px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-info p {
  color: #777;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.project-info h3 {
  font-size: 30px;
  letter-spacing: -.04em;
}

.round-arrow {
  width: 39px;
  height: 39px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: .3s;
}

.project:hover .round-arrow {
  background: var(--ink);
  color: var(--paper);
  transform: rotate(45deg);
}

.about-section {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 8vw;
  align-items: center;
}

.about-text { max-width: 650px; }

.about-text h2 {
  font-size: clamp(57px, 7vw, 102px);
  line-height: .82;
  letter-spacing: -.065em;
  margin: 18px 0 30px;
}

.about-text > p:not(.eyebrow) {
  max-width: 590px;
  color: var(--muted);
  line-height: 1.75;
  margin-top: 14px;
  font-size: 14px;
}

.sketch-board {
  min-height: 390px;
  position: relative;
}

.orbit {
  width: 310px;
  height: 310px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(24deg);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.orbit::before,
.orbit::after {
  content: "";
  position: absolute;
  border: 1px dashed var(--ink);
  border-radius: 50%;
}

.orbit::before {
  inset: 22px -6px;
  transform: rotate(61deg);
}

.orbit::after {
  inset: 62px 20px;
  transform: rotate(-25deg);
}

.note {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  background: #fffef8;
  border: 1px solid var(--ink);
  padding: 35px 42px;
  font: 36px/1 var(--display);
  box-shadow: 7px 8px 0 rgba(17,17,17,.12);
}

.pencil {
  position: absolute;
  right: 5%;
  top: 3%;
  font-size: 70px;
  transform: rotate(35deg);
}

.sketch-label {
  position: absolute;
  left: 5%;
  bottom: 7%;
  font: 19px var(--display);
  transform: rotate(-4deg);
}

.skills-section { border-top: 1px solid var(--line); }

.skills-list { border-top: 1px solid var(--ink); }

.skill {
  display: grid;
  grid-template-columns: 80px 1fr 40px;
  align-items: center;
  border-bottom: 1px solid var(--ink);
  padding: 17px 0;
  transition: .35s;
}

.skill span { font: 20px var(--display); }

.skill h3 {
  font-size: clamp(26px, 3.5vw, 50px);
  letter-spacing: -.045em;
}

.skill b {
  font-size: 24px;
  font-weight: 400;
}

.skill:hover {
  padding-left: 18px;
  background: #fffef8;
}

.skill:hover b { transform: rotate(45deg); }

.process-section { background: var(--paper-dark); }

.process {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.process-card {
  min-height: 275px;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 25px;
  transform: rotate(-.7deg);
}

.process-card:nth-child(2) { transform: rotate(1deg); }
.process-card:nth-child(3) { transform: rotate(-.5deg); }

.process-card > span {
  font: 29px var(--display);
}

.process-card h3 {
  font-size: 40px;
  letter-spacing: -.05em;
  margin: 55px 0 14px;
}

.process-card p {
  max-width: 360px;
  color: #666;
  line-height: 1.6;
  font-size: 13px;
}

.contact-section {
  min-height: 78vh;
  display: grid;
  place-items: center;
  text-align: center;
  border-top: 1px solid var(--line);
}

.contact-content h2 {
  font-size: clamp(65px, 10vw, 150px);
  line-height: .76;
  letter-spacing: -.07em;
}

.email {
  display: inline-block;
  margin: 48px 0 27px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 5px;
  font-size: 19px;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 25px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.socials a:hover { text-decoration: underline; }

footer {
  display: flex;
  justify-content: space-between;
  padding: 25px 7vw;
  border-top: 1px solid var(--line);
  color: #666;
  font-size: 10px;
}

.cursor {
  position: fixed;
  z-index: 200;
  left: -8px;
  top: -8px;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  transition: width .2s, height .2s, background .2s;
}

.cursor.hover {
  width: 32px;
  height: 32px;
  background: rgba(17,17,17,.08);
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 25px;
}

.modal.open { display: flex; }

.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(17,17,17,.72);
  backdrop-filter: blur(5px);
}

.modal-box {
  width: min(920px, 95vw);
  max-height: 91vh;
  overflow: auto;
  position: relative;
  z-index: 2;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 45px;
  box-shadow: 12px 14px 0 rgba(0,0,0,.2);
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ink);
  background: transparent;
  border-radius: 50%;
  font-size: 25px;
  cursor: pointer;
}

.modal-box h2 {
  font-size: 70px;
  line-height: .83;
  letter-spacing: -.06em;
  margin-bottom: 25px;
}

.modal-media {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border: 1px solid var(--ink);
}

.modal-description {
  color: #5e5c56;
  line-height: 1.75;
  max-width: 750px;
  margin: 25px 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 25px;
}

.tags span {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 9px;
}

.no-link {
  color: #777;
  font-size: 11px;
}

.mobile-menu {
  display: none;
}

/* ================= MOBILE ================= */

@media (max-width: 1100px) {
  .hero {
    display: block;
    padding-top: 145px;
  }

  .hero-content { width: 100%; }

  .hero-game-wrap {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: min(100%, 570px);
    margin: 70px auto 0;
  }

  .scroll-note { display: none; }
}

@media (max-width: 800px) {
  body { cursor: auto; }

  .cursor { display: none; }

  .navbar { height: 66px; }

  .navbar nav,
  .nav-button { display: none; }

  .menu-button { display: block; }

  .mobile-menu {
    position: fixed;
    z-index: 85;
    inset: 66px 0 auto;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
    padding: 25px 6vw;
    flex-direction: column;
    gap: 20px;
    font-size: 22px;
    font-weight: 700;
  }

  .mobile-menu.open { display: flex; }

  .section { padding: 100px 6vw; }

  .hero {
    padding: 125px 6vw 90px;
  }

  .hero h1 { font-size: 18vw; }

  .hero-doodle { display: none; }

  .hero-game-wrap { margin-top: 55px; }

  .section-title {
    grid-template-columns: 48px 1fr;
  }

  .title-arrow { display: none; }

  .projects,
  .about-section,
  .process {
    grid-template-columns: 1fr;
  }

  .project:nth-child(even) { margin-top: 0; }

  .about-section { gap: 50px; }

  .process { gap: 18px; }

  .process-card { min-height: 230px; }

  footer {
    flex-direction: column;
    gap: 8px;
  }

  .modal-box {
    padding: 30px 20px;
  }

  .modal-box h2 {
    font-size: 55px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}