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

:root {
  --cipher-bg: #0b0b0c;
  --cipher-fg: #e9eae4;
  --cipher-fg-dim: rgba(233, 234, 228, 0.55);
  --cipher-font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: var(--cipher-font);
  background: var(--cipher-bg);
  color: var(--cipher-fg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.cipher-hero {
  position: relative;
  width: 100%;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  background: var(--cipher-bg);
}

.cipher-hero canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}

.cipher-hero canvas:active {
  cursor: grabbing;
}

.works_infos {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 16px 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 19px;
  text-transform: uppercase;
  color: var(--cipher-fg);
  mix-blend-mode: difference;
  pointer-events: none;
  user-select: none;
}

.works_infos .l {
  display: flex;
  justify-content: flex-start;
}

.works_infos .m {
  display: flex;
  justify-content: center;
  text-align: center;
}

.works_infos .r {
  display: flex;
  justify-content: flex-end;
}

.work_index,
.work_label {
  white-space: nowrap;
  min-height: 19px;
}

.hint {
  color: var(--cipher-fg-dim);
  letter-spacing: 0.12em;
}

@media (max-width: 768px) {
  .works_infos {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 14px 20px;
  }

  .works_infos .m {
    display: none;
  }

  .works_infos .r {
    justify-content: flex-start;
  }

  .hint {
    font-size: 10px;
  }
}

.detail {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2vmin;
  visibility: hidden;
  overflow-y: auto;
}

.detail__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 6, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  cursor: zoom-out;
}

.detail__card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  width: min(1440px, 96vw);
  max-height: 96vh;
  max-height: 96svh;
  background: #101012;
  border: 1px solid rgba(233, 234, 228, 0.14);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
}

.detail__media {
  position: relative;
  min-height: 600px;
  background: #000;
  overflow: hidden;
}

.detail__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.detail__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: clamp(28px, 4.5vw, 64px);
}

.detail__index {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--cipher-fg-dim);
}

.detail__title {
  font-size: clamp(32px, 4.6vw, 58px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-transform: uppercase;
  text-wrap: balance;
}

.detail__tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 7px 12px;
  border: 1px solid rgba(233, 234, 228, 0.35);
  border-radius: 999px;
  color: var(--cipher-fg);
}

.detail__text {
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  color: rgba(233, 234, 228, 0.82);
  max-width: 36ch;
}

.detail__meta {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cipher-fg-dim);
}

.detail__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(233, 234, 228, 0.4);
  border-radius: 50%;
  background: rgba(11, 11, 12, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--cipher-fg);
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s, color 0.3s;
}

.detail__close:hover {
  background: var(--cipher-fg);
  color: #0b0b0c;
  transform: rotate(90deg) scale(1.06);
}

.detail__close:focus-visible {
  outline: 2px solid var(--cipher-fg);
  outline-offset: 3px;
}

.detail__close svg {
  width: 13px;
  height: 13px;
  display: block;
}

.detail__flyer {
  position: fixed;
  z-index: 2;
  object-fit: cover;
  display: block;
  pointer-events: none;
  visibility: hidden;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

@media (max-width: 768px) {
  .detail {
    padding: 12px;
    align-items: flex-start;
  }

  .detail__card {
    grid-template-columns: 1fr;
    width: min(720px, 96vw);
    max-height: none;
    margin: auto 0;
  }

  .detail__media {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .detail__body {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cipher-hero canvas {
    cursor: default;
  }
}
