:root {
  --red: #cd1719;
  --cream: #fffcd9;
  --teal: #6cb4af;
  --ink: #111;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--red);
  color: white;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 252, 217, 0.18), transparent 22rem),
    linear-gradient(180deg, #cd1719 0%, #b81217 58%, #111 180%);
}

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

button {
  color: inherit;
  font: inherit;
}

.badge,
.home-badge,
.nav-group a,
.clock-badge,
.project-title-card,
.page-kicker {
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow);
  display: inline-flex;
  padding: 3px 6px;
}

.site-header {
  position: fixed;
  inset: 12px 15px auto 15px;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.site-header a,
.site-header span {
  pointer-events: auto;
}

.home-badge:hover,
.nav-group a:hover,
.nav-group a.active,
.badge:hover {
  background: var(--cream);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mess-tab {
  height: 24px;
  min-width: 64px;
  padding: 4px 7px 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  background: var(--red);
  box-shadow: var(--shadow);
  font-weight: 900;
  letter-spacing: 0;
}

.mess-tab:hover,
.mess-tab.active {
  color: var(--red);
  background: var(--teal);
}

.nav-group {
  display: flex;
  height: 24px;
  background: white;
  box-shadow: var(--shadow);
}

.nav-group a {
  height: 24px;
  box-shadow: none;
}

.game-sticker {
  position: fixed;
  left: 18px;
  bottom: 12px;
  width: clamp(88px, 10vw, 150px);
  z-index: 45;
  transform: rotate(20deg);
  transition: transform 180ms ease;
}

.game-sticker:hover {
  transform: rotate(13deg) scale(1.04);
}

.game-sticker img {
  display: block;
  width: 100%;
}

.clock-badge {
  position: fixed;
  right: 20px;
  bottom: 28px;
  z-index: 45;
  gap: 18px;
  background: var(--cream);
  transform: rotate(-10deg);
  pointer-events: none;
}

.home-main,
.page-shell {
  min-height: 100vh;
  padding: 76px 15px 90px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
}

.project-card a {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  color: white;
  text-align: center;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 220ms ease, transform 220ms ease;
}

.project-card:nth-child(4n + 2) img {
  opacity: 0.22;
}

.project-card:nth-child(5n + 3) img {
  opacity: 0.5;
}

.project-card:hover img {
  opacity: 1;
  transform: rotate(var(--tilt)) scale(1.04);
}

.project-copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12%;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
}

.project-copy strong {
  font-size: clamp(18px, 2.1vw, 35px);
  line-height: 0.95;
}

.project-copy span,
.project-copy em {
  max-width: 28ch;
  font-size: 15px;
  font-style: normal;
  line-height: 1.05;
}

.cursor-follower {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  color: white;
  font-size: 175px;
  font-weight: 900;
  line-height: 0.8;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: difference;
  transition: opacity 180ms ease;
}

.page-kicker {
  margin: 0 0 24px;
  background: var(--cream);
}

.project-detail {
  min-height: 100vh;
  padding: 74px 18px 110px;
}

.project-hero {
  position: relative;
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
}

.project-hero img {
  max-width: min(86vw, 1000px);
  max-height: 72vh;
  object-fit: contain;
}

.project-title-card {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  max-width: min(420px, calc(100vw - 40px));
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  text-align: center;
  transform: translate(-50%, -50%) rotate(-2deg);
}

.project-title-card h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 62px);
  line-height: 0.9;
}

.project-title-card p {
  margin: 0;
  line-height: 1.05;
}

.project-pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-pager a,
.shop-switcher a {
  background: white;
  color: var(--ink);
  padding: 5px 9px;
  box-shadow: var(--shadow);
}

.project-pager a:hover,
.shop-switcher a:hover,
.shop-switcher a.active {
  background: var(--cream);
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
  gap: 80px;
  padding: 86px 20px 120px;
}

.about-copy p {
  max-width: 1000px;
  margin: 0;
  font-size: clamp(25px, 3.2vw, 46px);
  line-height: 1;
}

.service-copy {
  max-width: 360px;
}

.service-copy h1,
.service-copy p {
  margin: 0 0 20px;
  font-size: clamp(21px, 1.8vw, 25px);
  font-weight: 400;
  line-height: 1;
}

.service-copy a {
  text-decoration: underline;
}

.library-list {
  padding-top: 64px;
}

.library-row {
  position: relative;
  height: 50vh;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 252, 217, 0.32);
}

.library-row h1 {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 27%;
  margin: 0;
  padding: 4px 7px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 16px;
  font-weight: 400;
  transform: rotate(var(--angle));
}

.library-images img {
  position: absolute;
  top: 0;
  left: var(--left);
  width: auto;
  height: 50vh;
  object-fit: contain;
  opacity: var(--opacity);
  transform: translateX(var(--shift));
  transition: opacity 180ms ease, transform 180ms ease;
}

.library-row:hover img {
  opacity: 1;
  transform: translateX(var(--hover-shift)) rotate(var(--hover-angle));
}

.shop-page {
  min-height: 100vh;
  padding: 84px 22px 120px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.product-card button {
  position: relative;
  display: block;
  width: 90%;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 200ms ease;
}

.product-card button:hover img,
.product-card button.added img {
  transform: rotate(-2deg) scale(1.03);
}

.product-title {
  position: absolute;
  left: 50%;
  bottom: 20px;
  max-width: 84%;
  padding: 4px 7px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.price-burst {
  position: absolute;
  top: -10px;
  right: -6px;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  background: var(--cream);
  color: var(--ink);
  clip-path: polygon(50% 0, 56% 22%, 73% 8%, 68% 31%, 91% 25%, 74% 43%, 98% 50%, 74% 57%, 91% 75%, 68% 69%, 73% 92%, 56% 78%, 50% 100%, 44% 78%, 27% 92%, 32% 69%, 9% 75%, 26% 57%, 2% 50%, 26% 43%, 9% 25%, 32% 31%, 27% 8%, 44% 22%);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.25));
}

.shop-switcher {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 55;
  display: flex;
  gap: 18px;
  transform: translateX(-50%);
}

.mess-layout {
  padding: 84px 20px 120px;
}

.mess-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.85fr);
  align-items: end;
  gap: 28px;
}

.mess-intro h1 {
  margin: 0;
  color: var(--teal);
  font-size: clamp(92px, 23vw, 360px);
  line-height: 0.72;
  letter-spacing: 0;
}

.mess-intro p {
  max-width: 650px;
  margin: 0;
  color: white;
  font-size: clamp(25px, 3.2vw, 48px);
  line-height: 0.95;
}

.mess-strip {
  position: relative;
  height: 48vh;
  margin-top: 38px;
  overflow: hidden;
}

.mess-strip img {
  position: absolute;
  top: 0;
  left: var(--left);
  height: 48vh;
  width: auto;
  object-fit: contain;
  box-shadow: var(--shadow);
  transform: rotate(var(--angle));
}

.mess-product {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 36px;
  color: white;
}

.mess-product h2,
.mess-product p {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 44px);
  line-height: 1;
}

.game-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.game-target {
  position: absolute;
  z-index: 4;
  width: clamp(130px, 18vw, 260px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: left 160ms ease, top 160ms ease, transform 160ms ease;
}

.game-target img {
  display: block;
  width: 100%;
}

.game-score {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 5;
  transform: translateX(-50%);
}

.not-found {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
}

@media (max-width: 900px) {
  html {
    font-size: 14px;
  }

  .site-header {
    inset: 10px 12px auto;
    gap: 10px;
    align-items: flex-start;
  }

  .top-nav {
    flex-direction: column;
    align-items: flex-end;
  }

  .nav-group {
    flex-wrap: wrap;
    justify-content: flex-end;
    width: min(244px, calc(100vw - 128px));
    height: auto;
  }

  .nav-group a {
    height: 25px;
  }

  .project-grid,
  .shop-grid,
  .about-layout,
  .mess-intro {
    grid-template-columns: 1fr;
  }

  .project-grid {
    gap: 16px;
  }

  .home-main,
  .page-shell,
  .shop-page,
  .mess-layout {
    padding-left: 12px;
    padding-right: 12px;
  }

  .clock-badge {
    right: 14px;
    bottom: 25px;
    gap: 10px;
  }

  .game-sticker {
    width: 88px;
  }

  .about-layout {
    gap: 34px;
  }

  .service-copy {
    max-width: none;
  }

  .library-row,
  .library-images img {
    height: 38vh;
  }

  .library-row h1 {
    left: 12%;
    max-width: 78vw;
  }

  .mess-strip {
    height: 34vh;
  }

  .mess-strip img {
    height: 34vh;
    left: var(--mobile-left);
  }

  .mess-product {
    align-items: flex-start;
    flex-direction: column;
  }
}
