* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  padding: 0 40px;
  background: white;
  color: black;
  font-family: Arial, sans-serif;
}

.doodle-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.walker {
  position: absolute;
  bottom: 13%;
  left: -60px;
  width: 44px;
  height: 78px;
  color: #6d28d9;
  opacity: 0.27;
  --step-speed: 600ms;
  will-change: left, margin-bottom;
  animation: walk-across 20s linear infinite, walk-bob 700ms ease-in-out infinite alternate;
}

.walker-two {
  bottom: 46%;
  color: #0891b2;
  opacity: 0.21;
  animation-delay: -9s;
  animation-duration: 30s, 700ms;
  transform: scale(0.72);
  --step-speed: 760ms;
}

.walker-three {
  bottom: 54%;
  color: #db2777;
  opacity: 0.18;
  animation-delay: -4s;
  animation-duration: 15s, 700ms;
  transform: scale(0.58);
  --step-speed: 520ms;
}

.walker-four {
  bottom: 62%;
  color: #2563eb;
  opacity: 0.15;
  animation-delay: -15s;
  animation-duration: 38s, 700ms;
  transform: scale(0.48);
  --step-speed: 900ms;
}

.walker-five {
  bottom: 42%;
  color: #ea580c;
  opacity: 0.2;
  animation-delay: -20s;
  animation-duration: 19s, 700ms;
  transform: scale(0.82);
  --step-speed: 650ms;
}

.walker-six {
  bottom: 70%;
  color: #7c3aed;
  opacity: 0.12;
  animation-delay: -11s;
  animation-duration: 45s, 700ms;
  transform: scale(0.38);
  --step-speed: 1s;
}

.walker-seven {
  bottom: 51%;
  color: #059669;
  opacity: 0.15;
  animation-delay: -25s;
  animation-duration: 17s, 700ms;
  transform: scale(0.66);
  --step-speed: 480ms;
}

.walker-eight {
  bottom: 59%;
  color: #c026d3;
  opacity: 0.14;
  animation-delay: -18s;
  animation-duration: 31s, 700ms;
  transform: scale(0.52);
  --step-speed: 820ms;
}

.walker-nine { bottom: 47%; color: #be123c; opacity: 0.15; animation-delay: -6s; animation-duration: 21s, 700ms; transform: scale(0.44); --step-speed: 570ms; }
.walker-ten { bottom: 34%; color: #0369a1; opacity: 0.12; animation-delay: -13s; animation-duration: 34s, 700ms; transform: scale(0.35); --step-speed: 1.1s; }
.walker-eleven { bottom: 7%; color: #a16207; opacity: 0.18; animation-delay: -17s; animation-duration: 25s, 700ms; transform: scale(0.94); --step-speed: 680ms; }
.walker-twelve { bottom: 26%; color: #4f46e5; opacity: 0.14; animation-delay: -22s; animation-duration: 28s, 700ms; transform: scale(0.6); --step-speed: 440ms; }
.walker-thirteen { bottom: 42%; color: #0f766e; opacity: 0.1; animation-delay: -8s; animation-duration: 36s, 700ms; transform: scale(0.3); --step-speed: 1.2s; }
.walker-fourteen { bottom: 18%; color: #9333ea; opacity: 0.15; animation-delay: -28s; animation-duration: 22s, 700ms; transform: scale(0.74); --step-speed: 730ms; }
.walker-fifteen { bottom: 11%; color: #c2410c; opacity: 0.15; animation-delay: -31s; animation-duration: 30s, 700ms; transform: scale(0.5); --step-speed: 500ms; }
.walker-sixteen { bottom: 30%; color: #0284c7; opacity: 0.12; animation-delay: -36s; animation-duration: 33s, 700ms; transform: scale(0.42); --step-speed: 950ms; }
.walker-seventeen { bottom: 48%; color: #9333ea; opacity: 0.07; animation-delay: -5s; animation-duration: 37s, 700ms; transform: scale(0.3); --step-speed: 1s; }
.walker-eighteen { bottom: 55%; color: #0891b2; opacity: 0.07; animation-delay: -16s; animation-duration: 42s, 700ms; transform: scale(0.25); --step-speed: 850ms; }
.walker-nineteen { bottom: 62%; color: #db2777; opacity: 0.06; animation-delay: -24s; animation-duration: 39s, 700ms; transform: scale(0.22); --step-speed: 1.1s; }
.walker-twenty { bottom: 70%; color: #2563eb; opacity: 0.06; animation-delay: -32s; animation-duration: 46s, 700ms; transform: scale(0.2); --step-speed: 720ms; }
.walker-twenty-one { bottom: 76%; color: #c2410c; opacity: 0.05; animation-delay: -12s; animation-duration: 44s, 700ms; transform: scale(0.18); --step-speed: 900ms; }
.walker-twenty-two { bottom: 52%; color: #059669; opacity: 0.06; animation-delay: -27s; animation-duration: 35s, 700ms; transform: scale(0.28); --step-speed: 640ms; }
.walker-twenty-three { bottom: 67%; color: #7c3aed; opacity: 0.05; animation-delay: -38s; animation-duration: 48s, 700ms; transform: scale(0.24); --step-speed: 1.2s; }
.walker-twenty-four { bottom: 82%; color: #be123c; opacity: 0.05; animation-delay: -21s; animation-duration: 50s, 700ms; transform: scale(0.16); --step-speed: 780ms; }

.head,
.body-line,
.arm,
.leg {
  position: absolute;
  display: block;
  background: currentColor;
}

.head {
  top: 0;
  left: 15px;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
}

.body-line {
  top: 19px;
  left: 22px;
  width: 2px;
  height: 29px;
}

.arm,
.leg {
  width: 25px;
  height: 2px;
  transform-origin: left center;
}

.arm {
  top: 27px;
  left: 22px;
}

.arm-left {
  transform: rotate(135deg);
  animation: arm-swing-left var(--step-speed) ease-in-out infinite alternate;
}

.arm-right {
  transform: rotate(45deg);
  animation: arm-swing-right var(--step-speed) ease-in-out infinite alternate;
}

.leg {
  top: 46px;
  left: 22px;
  width: 28px;
}

.leg-left {
  transform: rotate(45deg);
  animation: leg-swing-left var(--step-speed) ease-in-out infinite alternate;
}

.leg-right {
  transform: rotate(135deg);
  animation: leg-swing-right var(--step-speed) ease-in-out infinite alternate;
}

@keyframes walk-across {
  0% { left: -60px; }
  100% { left: calc(100% + 60px); }
}

@keyframes walk-bob {
  from { margin-bottom: 0; }
  to { margin-bottom: 3px; }
}

@keyframes arm-swing-left {
  to { transform: rotate(45deg); }
}

@keyframes arm-swing-right {
  to { transform: rotate(135deg); }
}

@keyframes leg-swing-left {
  to { transform: rotate(135deg); }
}

@keyframes leg-swing-right {
  to { transform: rotate(45deg); }
}

header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  margin: 0 -40px;
  padding: 0 40px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

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

#header-name.is-typing::after {
  content: '_';
  animation: header-cursor 800ms step-end infinite;
}

#header-name::after {
  content: '';
}

@keyframes header-cursor {
  50% {
    opacity: 0;
  }
}

nav {
  display: flex;
  gap: 28px;
}

nav a {
  position: relative;
  transition: color 180ms ease, transform 180ms ease;
}

nav a::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 2px;
  background: #000;
  content: '';
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

nav a:hover {
  color: #555;
  transform: translateY(-2px);
}

nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

#app {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: calc(100vh - 72px);
  place-items: center;
}

#projects {
  display: none;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 72px);
  padding: 24px 0 110px;
  background: white;
}

#app.page-hidden,
#projects.page-visible {
  display: none;
}

#projects.page-visible {
  display: block;
}

#about {
  display: none;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 72px);
  padding: 120px 0 110px;
  background: white;
}

#about.page-visible {
  display: block;
}

.about-inner {
  width: min(760px, 100%);
  margin: 0 auto;
}

.section-label {
  margin: 0 0 34px;
  color: #52657a;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about-inner h2 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.about-copy {
  max-width: 500px;
  margin: 52px 0 0;
  color: #454545;
  font-size: 18px;
  line-height: 1.5;
}

.projects-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.projects-heading {
  display: block;
  margin-bottom: 34px;
}

.project-status,
.project-number,
.project-tags {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.projects-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.05em;
}

.projects-intro {
  display: none;
}

.project-grid {
  display: grid;
  gap: 0;
}

.project-card {
  display: flex;
  min-height: 104px;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  padding: 24px 0;
  border: 0;
  border-bottom: 1px solid #e5e5e5;
  cursor: pointer;
  transition: padding 180ms ease, color 180ms ease;
}

.project-card:hover {
  padding-bottom: 30px;
}

.project-card-primary,
.project-card-secondary,
.project-card-tertiary { background: white; }

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

.project-card-top {
  flex: 0 0 80px;
}

.project-number {
  color: #52657a;
  font-weight: 400;
}

.project-status,
.project-card p,
.project-tags {
  display: none;
}

.project-card h3 {
  flex: 1;
  margin: 0;
  font-size: clamp(1.65rem, 2.8vw, 2.15rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1;
}

.project-details {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 1fr;
  gap: 32px;
  flex-basis: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: max-height 240ms ease, opacity 180ms ease, transform 240ms ease;
}

.project-card:hover .project-details,
.project-card:focus-visible .project-details,
.project-card:focus-within .project-details {
  max-height: 230px;
  opacity: 1;
  transform: translateY(0);
}

.project-details img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  filter: grayscale(100%);
}

.project-details-copy {
  display: flex;
  max-width: 420px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.project-details-copy p {
  display: block;
  max-width: 390px;
  margin: 0 0 20px;
  color: #242424;
  font-size: 16px;
  line-height: 1.45;
}

.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.project-tags span {
  padding: 6px 8px;
  border: 1px solid #111;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-details-copy a {
  display: inline-block;
  border-bottom: 1px solid #111;
  font-size: 14px;
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.project-details-copy a:hover,
.project-details-copy a:focus-visible {
  color: #52657a;
  border-color: #52657a;
  transform: translateX(5px);
}

.project-card:focus-visible {
  outline: 2px solid #52657a;
  outline-offset: 5px;
}

#text3d {
  position: relative;
  top: -40px;
  display: inline-block;
  width: min(100%, calc(100vw - 40px));
  text-align: center;
}

#name3d {
  position: relative;
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  transform-style: preserve-3d;
  transition: transform 100ms ease-out;
  cursor: default;
}

#name3d.is-typing h1::after {
  content: '_';
  animation: header-cursor 800ms step-end infinite;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 28px;
  font-size: 26px;
}

.social-links a {
  border-bottom: 1px solid black;
}

.social-links a:hover {
  opacity: 0.55;
}

#text3d h1 {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0;
  font-size: clamp(3rem, 10vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  overflow: visible;
  line-height: 1;
  transition: transform 100ms ease-out;
}

.description {
  position: relative;
  z-index: 2;
  display: block;
  width: min(600px, calc(100vw - 40px));
  margin: 70px auto 0;
  color: #000000;
  font-size: 19px;
  line-height: 1.6;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .walker,
  .arm,
  .leg {
    animation: none;
  }

  #name3d,
  #text3d h1 {
    transition: none;
  }
}

@media (max-width: 520px) {
  body {
    padding: 0 20px;
  }

  header {
    margin: 0 -20px;
    padding: 0 20px;
  }

  nav {
    gap: 14px;
  }

  #projects {
    padding-top: 58px;
  }

  #about {
    padding-top: 80px;
  }

  .project-card {
    min-height: 88px;
    gap: 16px;
    padding: 20px 0;
  }

  .projects-heading {
    margin-bottom: 24px;
  }

  .project-card-top {
    flex-basis: 54px;
  }

  .project-number {
    font-size: 11px;
  }

  .project-details {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-details img {
    height: 150px;
  }

  .project-card:hover .project-details,
  .project-card:focus-visible .project-details,
  .project-card:focus-within .project-details {
    max-height: 500px;
  }

}
