* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.works-page {
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #fffef6;
  color: #490303;
  font-family: Poppins, Inter, Arial, sans-serif;
}

body.works-page .work-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: clamp(70px, 3.912vw, 86px);
  padding: 0;
  background: transparent;
  overflow: visible;
  pointer-events: none;
}

body.works-page .work-header::before,
body.works-page .work-header::after {
  content: none !important;
  display: none !important;
}

body.works-page .brand {
  position: absolute;
  z-index: auto;
  left: 50px;
  top: 5px;
  width: auto;
  height: auto;
  overflow: visible;
  color: #490303;
  font-family: "Hachi Maru Pop", "Chalkboard SE", "Comic Sans MS", cursive;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-shadow: 1px 2px 3px rgba(73, 3, 3, 0.24);
  white-space: nowrap;
  pointer-events: auto;
}

.works-reference {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 720px;
  overflow: hidden;
  background: #fffef6;
}

.works-reference h1 {
  position: absolute;
  left: 50%;
  top: 75%;
  z-index: 20;
  transform: translate(-50%, -50%);
  margin: 0;
  text-align: center;
  color: rgba(84, 84, 90, 0.25);
  font-family: Poppins, Inter, Arial, sans-serif;
  font-size: clamp(18px, 1.52vw, 29px);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

.works-reference h1 span {
  display: inline-block;
  margin-top: 2px;
}

.works-top-nav-wrap {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 100%;
  height: clamp(70px, 3.912vw, 86px);
  transform: none;
}

.works-top-nav-visual {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
}

.works-top-link {
  position: absolute;
  top: 0;
  height: 100%;
  display: block;
  z-index: 26;
  background: transparent;
  overflow: visible;
}

.works-top-about {
  left: 38.2%;
  width: 14.8%;
}

.works-top-works {
  left: 57.0%;
  width: 12.8%;
}

.works-top-contact {
  left: 72.0%;
  width: 16.8%;
}

.works-viewport {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
}

.works-disc {
  position: absolute;
  left: 50%;
  top: 120%;
  width: 170vmax;
  height: 170vmax;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: 50% 50%;
  animation: worksDiscRotate 180s linear infinite;
  will-change: transform;
}

@keyframes worksDiscRotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.work-card {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: clamp(132px, 12.9vw, 248px);
  aspect-ratio: 777 / 1096;
  border-radius: 14px;
  overflow: hidden;
  transform:
    translate(-50%, -50%)
    rotate(var(--r))
    translateY(calc(-1 * var(--radius)));
  transform-origin: 50% 50%;
  text-decoration: none;
}

.work-card img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  box-shadow: 0 12px 24px rgba(73, 3, 3, 0.10);
  user-select: none;
  -webkit-user-drag: none;
}

.work-card {
  --radius: 43vmax;
  --r: 0deg;
}

.work-card-1 {
  --r: 0deg;
}

.work-card-13 {
  --r: 24deg;
}

.work-card-12 {
  --r: 48deg;
}

.work-card-11 {
  --r: 72deg;
}

.work-card-4 {
  --r: 96deg;
}

.work-card-10 {
  --r: 120deg;
}

.work-card-15 {
  --r: 144deg;
}

.work-card-2 {
  --r: 168deg;
}

.work-card-8 {
  --r: -168deg;
}

.work-card-3 {
  --r: -144deg;
}

.work-card-14 {
  --r: -120deg;
}

.work-card-9 {
  --r: -96deg;
}

.work-card-5 {
  --r: -72deg;
}

.work-card-6 {
  --r: -48deg;
}

.work-card-7 {
  --r: -24deg;
}

@media (prefers-reduced-motion: reduce) {
  .works-disc {
    animation: none;
  }
}

@media (max-width: 900px) {
  .works-reference {
    min-height: 100vh;
  }

  body.works-page .brand {
    left: 50px;
    top: 5px;
    font-size: 24px;
  }

  .works-disc {
    top: 120%;
    width: 170vmax;
    height: 170vmax;
  }

  .work-card {
    width: clamp(112px, 22vw, 160px);
    --radius: 45vmax;
  }

  .works-reference h1 {
    top: 74%;
    font-size: 16px;
  }
}

/* === MIAO FINAL COMPUTED STYLE LOCK === */
html body.works-page .work-header .brand,
html body.works-page .brand {
  position: absolute !important;
  left: 50px !important;
  top: 5px !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  color: #490303 !important;
  font-family: "Hachi Maru Pop", "Chalkboard SE", "Comic Sans MS", cursive !important;
  font-size: 24px !important;
  font-weight: 400 !important;
  line-height: 24px !important;
  letter-spacing: 0.72px !important;
  text-decoration: none !important;
  text-shadow: 1px 2px 3px rgba(73, 3, 3, 0.24) !important;
  white-space: nowrap !important;
  transform: none !important;
  z-index: auto !important;
  pointer-events: auto !important;
}

/* === SITE MIAO FINAL LOCK V2 === */
html body.works-page .work-header .site-miao,
html body.works-page .work-header .brand,
html body.works-page .site-miao {
  position: absolute !important;
  left: 50px !important;
  top: 5px !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  color: #490303 !important;
  font-family: "Hachi Maru Pop", "Chalkboard SE", "Comic Sans MS", cursive !important;
  font-size: 24px !important;
  font-weight: 400 !important;
  line-height: 24px !important;
  letter-spacing: 0.72px !important;
  text-decoration: none !important;
  text-shadow: 1px 2px 3px rgba(73, 3, 3, 0.24) !important;
  white-space: nowrap !important;
  transform: none !important;
  z-index: auto !important;
  pointer-events: auto !important;
}

/* === WORKS MIAO TRUE FINAL LOCK ===
   Matches the About/Home Miao while leaving the rotating disc untouched. */
html body.works-page .work-header .site-miao,
html body.works-page .work-header .brand.site-miao,
html body.works-page .site-miao {
  position: absolute !important;
  left: 50px !important;
  top: 5px !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  overflow: visible !important;
  color: #490303 !important;
  font-family: "Hachi Maru Pop", "Chalkboard SE", "Comic Sans MS", cursive !important;
  font-size: 24px !important;
  font-weight: 400 !important;
  line-height: 24px !important;
  letter-spacing: 0.72px !important;
  text-decoration: none !important;
  text-transform: none !important;
  text-shadow: 1px 2px 3px rgba(73, 3, 3, 0.24) !important;
  white-space: nowrap !important;
  transform: none !important;
  z-index: 120 !important;
  pointer-events: auto !important;
}
