:root {
  --cream: #fffcd9;
  --red: #cd1719;
  --teal: #6cb4af;
  --black: #050505;
  --white: #ffffff;
  --shadow: 0 3px 9px rgba(0, 0, 0, 0.24);
  --page-pad: clamp(15px, 1.8vw, 20px);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

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

button {
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

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

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

.button-pill,
.button-group a,
.toast,
.library-title {
  min-height: 22px;
  padding: 4px 6px 3px;
  background: var(--white);
  color: var(--black);
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.button-pill:hover,
.button-group a:hover,
.button-group a.active {
  background: var(--cream);
}

.brand-link {
  align-self: start;
}

.nav-cluster {
  display: flex;
  max-width: calc(100vw - 180px);
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.button-group {
  display: flex;
  min-width: 0;
  overflow: auto hidden;
  background: var(--white);
  box-shadow: var(--shadow);
  scrollbar-width: none;
}

.button-group::-webkit-scrollbar {
  display: none;
}

.button-group a {
  box-shadow: none;
}

.mess-link {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 4px 7px 3px;
  background: var(--red);
  color: var(--teal);
  box-shadow: var(--shadow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

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

.game-badge {
  position: fixed;
  bottom: 10px;
  left: var(--page-pad);
  z-index: 18;
  width: clamp(84px, 10vw, 140px);
  transform: rotate(20deg);
  transition: transform 160ms ease;
}

.game-badge:hover {
  transform: rotate(14deg);
}

.game-badge img {
  width: 100%;
  aspect-ratio: 10 / 7;
  object-fit: contain;
}

.timezone-badge {
  position: fixed;
  right: var(--page-pad);
  bottom: 28px;
  z-index: 18;
  display: flex;
  gap: 16px;
  padding: 4px 6px 3px;
  transform: rotate(-10deg);
  background: var(--cream);
  color: var(--black);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.timezone-badge span span {
  margin-left: 2px;
}

.cursor-follower {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  display: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
  color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(92px, 10vw, 190px);
  line-height: 0.7;
  mix-blend-mode: difference;
  opacity: 0.86;
}

.page {
  min-height: 100vh;
  padding: 64px var(--page-pad) 120px;
}

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

.project-card {
  position: relative;
  min-width: 0;
  color: var(--white);
  text-align: center;
}

.project-media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

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

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

.project-card:nth-child(4n + 3) .project-media img {
  opacity: 0.9;
}

.project-card:hover .project-media img {
  opacity: 1;
  transform: scale(1.018);
}

.project-copy {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.project-copy h2 {
  max-width: min(88%, 420px);
  margin: 0 0 16px;
  font-size: clamp(16px, 1.8vw, 24px);
  font-weight: 400;
  line-height: 1;
}

.project-copy p,
.project-copy small {
  max-width: 78%;
  margin: 0;
  font-size: clamp(12px, 1.1vw, 14px);
  line-height: 1.08;
  white-space: pre-line;
}

.project-copy small {
  margin-top: 16px;
}

.detail-page {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
  gap: 28px;
  align-items: start;
}

.detail-hero {
  width: 100%;
  min-height: min(75vh, 820px);
  object-fit: contain;
}

.detail-copy {
  position: sticky;
  top: 70px;
  padding-top: 4px;
}

.detail-copy h1,
.large-text {
  margin: 0;
  font-size: clamp(28px, 5vw, 76px);
  font-weight: 400;
  line-height: 0.96;
}

.detail-copy p {
  margin: 22px 0;
  font-size: clamp(18px, 2vw, 30px);
  line-height: 1;
  white-space: pre-line;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 4px 7px 3px;
  background: var(--cream);
  color: var(--black);
  box-shadow: var(--shadow);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(240px, 3fr);
  gap: clamp(28px, 7vw, 90px);
}

.about-grid .large-text {
  white-space: pre-line;
}

.service-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-content: start;
}

.service-list span {
  background: var(--cream);
  color: var(--black);
  padding: 4px 6px 3px;
  box-shadow: var(--shadow);
}

.contact-link {
  display: inline-block;
  margin-top: 24px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.library-list {
  margin: -64px calc(var(--page-pad) * -1) -120px;
}

.library-item {
  position: relative;
  display: flex;
  min-height: 50vh;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.library-item:nth-child(even) {
  justify-content: flex-end;
}

.library-image {
  width: min(72vw, 920px);
  height: 50vh;
  object-fit: contain;
}

.library-title {
  position: absolute;
  top: 50%;
  left: var(--x, 24%);
  z-index: 1;
  max-width: min(72vw, 560px);
  transform: translateY(-50%) rotate(var(--r, 0deg));
  font-size: clamp(14px, 1.4vw, 20px);
  line-height: 1;
  white-space: normal;
}

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

.shop-tabs a {
  min-height: 22px;
  padding: 4px 10px 3px;
  background: var(--white);
  color: var(--black);
  box-shadow: var(--shadow);
}

.shop-tabs a.active {
  background: var(--black);
  color: var(--white);
}

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

.product-card {
  position: relative;
  min-width: 0;
}

.product-button {
  display: block;
  width: 86%;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  color: inherit;
}

.product-image-wrap {
  position: relative;
  aspect-ratio: 4 / 5;
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-label {
  position: absolute;
  bottom: 18px;
  left: 50%;
  max-width: 88%;
  padding: 4px 6px 3px;
  transform: translateX(-50%);
  background: var(--cream);
  color: var(--black);
  box-shadow: var(--shadow);
  line-height: 1;
  text-align: center;
}

.price-burst {
  position: absolute;
  top: -3px;
  right: -10px;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  background: var(--cream);
  color: var(--black);
  clip-path: polygon(
    50% 0,
    56% 22%,
    72% 7%,
    67% 30%,
    93% 22%,
    75% 42%,
    100% 50%,
    75% 58%,
    93% 78%,
    67% 70%,
    72% 93%,
    56% 78%,
    50% 100%,
    44% 78%,
    28% 93%,
    33% 70%,
    7% 78%,
    25% 58%,
    0 50%,
    25% 42%,
    7% 22%,
    33% 30%,
    28% 7%,
    44% 22%
  );
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.24));
}

.mess-page {
  color: var(--teal);
}

.mess-lockup {
  display: inline-block;
  margin-right: 0.25em;
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
}

.mess-products {
  margin-top: 64px;
}

.mess-products .product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.toast {
  position: fixed;
  right: var(--page-pad);
  bottom: 76px;
  z-index: 25;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

.empty-state {
  display: grid;
  min-height: 65vh;
  place-items: center;
  text-align: center;
}

.empty-state a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .cursor-follower {
    display: block;
  }
}

@media (max-width: 980px) {
  .project-grid,
  .product-grid,
  .mess-products .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-page,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .detail-copy {
    position: static;
  }
}

@media (max-width: 620px) {
  .site-header {
    inset: 10px 10px auto;
    display: block;
  }

  .brand-link {
    display: inline-flex;
  }

  .nav-cluster {
    position: fixed;
    top: 40px;
    left: 10px;
    right: 10px;
    max-width: none;
  }

  .page {
    padding-top: 86px;
  }

  .project-grid,
  .product-grid,
  .mess-products .product-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .project-copy h2 {
    font-size: 20px;
  }

  .project-copy p,
  .project-copy small {
    font-size: 13px;
  }

  .library-list {
    margin-top: -86px;
  }

  .library-image {
    width: 100vw;
  }

  .library-title {
    left: 18px;
    max-width: calc(100vw - 36px);
  }

  .timezone-badge {
    right: 12px;
    bottom: 20px;
    gap: 10px;
  }
}
