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

body {
  background-color: #fff;
  font-family: 'Inter', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #000;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  -webkit-text-stroke: 0.3px;
}

img {
  image-rendering: pixelated;
}

/* Layout */

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 20px;
  width: 100%;
}

.container:not(.center-v) {
  padding-top: 166px;
  padding-bottom: 140px;
}

.container.center-v {
  padding-top: 166px;
}

.work-section,
.item-block {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.item-block + .item-block {
  margin-top: 7.5rem;
}

/* Artwork (image + iframe shared) */

.artwork-wrap,
.artwork-wrap-iframe {
  position: relative;
}

.artwork-wrap {
  display: inline-block;
}

.artwork,
.artwork-iframe {
  display: block;
  border: 1px solid #000;
}

.artwork {
  width: 100%;
  aspect-ratio: 1;
}

.artwork-wrap.panel-open,
.artwork-wrap-iframe.panel-open {
  border: 1px solid #000;
}

.artwork-wrap.panel-open .artwork,
.artwork-wrap-iframe.panel-open .artwork-iframe {
  border: none;
}

.iframe-click-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 100px 100%, 100px calc(100% - 80px), 0 calc(100% - 80px));
}

.iframe-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100dvh !important;
  margin: 0 !important;
  border: none !important;
  transform: none !important;
  z-index: 1000;
}

.fs-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 1000;
}

/* Price button */

.price-btn {
  position: relative;
  cursor: pointer;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  padding: 1em 2em;
  text-align: center;
  line-height: 1.7;
  margin-top: 1rem;
}

/* Panels (about / work info) */

.about-panel,
.work-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.about-panel.open,
.work-panel.open {
  display: flex;
}

.panel-content {
  text-align: center;
  line-height: 1.7;
  max-width: 650px;
}

.container.about-open {
  padding-left: 0;
  padding-right: 0;
}

.about-panel {
  position: static;
  width: 100%;
}

.about-panel .panel-content {
  text-align: left;
  line-height: 1.8;
  padding: 0 20px;
}

.panel-content p + p {
  margin-top: 1em;
}

.panel-content .title {
  font-weight: bold;
}

.panel-content .description {
  white-space: pre-line;
}

/* Works list */

#worksList {
  max-width: 650px;
  width: 100%;
  padding: 0 20px;
}

.works-list {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  font-size: 0.9em;
  line-height: 1.6;
}

.works-list-title td {
  font-weight: 700;
  padding-bottom: 0.5em;
}

.works-list-item td {
  border-top: 1px solid #000;
  padding: 0.4em 0.6em 0.4em 0;
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
}

.works-list col:nth-child(1) { width: 40%; }
.works-list col:nth-child(2) { width: 22%; }
.works-list col:nth-child(3) { width: 25%; }
.works-list col:nth-child(4) { width: 13%; }

.works-list-item td:nth-child(2),
.works-list-item td:nth-child(3),
.works-list-item td:nth-child(4) {
  white-space: nowrap;
}

.works-list-divider {
  width: 100%;
  max-width: 700px;
  margin: 2em auto 3rem;
}

/* Links */

.collect-link,
.collect-link:visited {
  color: blue;
  text-decoration: underline;
}

.gate-msg {
  font-size: 0.85em;
  opacity: 0.5;
}

/* Close buttons (× shared) */

.close-panel,
.close-viewer {
  cursor: pointer;
  font-weight: 200;
  -webkit-tap-highlight-color: transparent;
}

.close-panel {
  font-size: 59px;
}

.close-viewer {
  font-size: 98px;
}

.close-panel {
  margin-top: 24px;
  text-align: center;
}

.close-viewer {
  position: fixed;
  top: -13px;
  right: 20px;
  z-index: 1001;
  animation: bw 1s ease-in-out infinite;
  transition: opacity 0.5s;
}

.close-viewer.hidden {
  opacity: 0;
}

@keyframes bw {
  0%   { color: #000; }
  50%  { color: #fff; }
  100% { color: #000; }
}

/* Fixed UI (TT button) */

.tt-btn {
  position: fixed;
  background: none;
  border: none;
  color: #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Inter', Helvetica, Arial, sans-serif;
  z-index: 100;
  top: -7px;
  left: -5px;
  font-size: 1.21em;
  font-weight: 700;
  letter-spacing: 0.04rem;
  padding: 20px 23px;
}

/* Focus / Active */

.tt-btn:focus,
.fullscreen-btn:focus,
.close-viewer:focus {
  outline: none;
}

.tt-btn:active,
.price-btn:active,
.close-panel:active,
.close-viewer:active,
.collect-link:active {
  color: #F03;
}

/* Fullscreen button (corner brackets) */

.fullscreen-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #000;
  background-clip: content-box;
  border: none;
  cursor: pointer;
  padding: 20px 0 0 20px;
  -webkit-tap-highlight-color: transparent;
  z-index: 10;
  width: 56px;
  height: 52px;
}

.fullscreen-btn::before,
.fullscreen-btn::after,
.fullscreen-icon::before,
.fullscreen-icon::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  border-color: #fff;
  border-style: solid;
}

.fullscreen-btn::before  { top: 29px;   left: 30px;  border-width: 2px 0 0 2px; }
.fullscreen-btn::after   { top: 29px;   right: 10px; border-width: 2px 2px 0 0; }
.fullscreen-icon::before { bottom: 9px; left: 30px;  border-width: 0 0 2px 2px; }
.fullscreen-icon::after  { bottom: 9px; right: 10px; border-width: 0 2px 2px 0; }

.fullscreen-btn:active::before,
.fullscreen-btn:active::after,
.fullscreen-btn:active .fullscreen-icon::before,
.fullscreen-btn:active .fullscreen-icon::after {
  border-color: #F03;
}

/* Viewer (fullscreen image) */

#viewer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: #fff;
}

#viewer.active { display: block; }
#viewer.dragging { cursor: grabbing; }

#viewerCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Thumbnail bar */

#thumbBar {
  display: flex;
  flex-wrap: wrap;
  column-gap: 16px;
  row-gap: 55px;
  padding: 24px 20px;
  margin-top: 180px;
  max-width: 960px;
  width: 100%;
}

.thumb-item {
  width: calc((100% - 32px) / 3);
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.thumb-item:active .thumb-name {
  color: #F03;
}

.thumb-img {
  width: 177px;
  height: 177px;
  border: 1px solid #000;
}

.thumb-name,
.thumb-status {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* Mobile */

@media (max-width: 768px) {
  body { font-size: 12px; }
  .container { padding: 29px 36px 80px; }
  .container:not(.center-v),
  .container.center-v { padding-top: 146px; }
  .container.about-open { padding: 4rem 0 80px; }
  .tt-btn { font-size: 1.21em; }
  .close-viewer { top: -8px; right: 12px; font-size: 72px; }
  .close-panel { font-size: 40px; margin-top: 14px; }
  .work-panel { bottom: 60px; }
  .about-panel .panel-content { margin-bottom: 16px; }
  .fullscreen-btn { bottom: 0; right: 0; transform: scale(0.7); transform-origin: bottom right; }
  .price-btn { margin-top: 0.8rem; }
  .item-block + .item-block { margin-top: 3.6rem; }
  #thumbBar { column-gap: 12px; row-gap: 32px; padding: 16px 0; margin-top: 90px; }
  .thumb-item { width: calc((100% - 24px) / 3); }
  .thumb-img { width: 90%; height: auto; aspect-ratio: 1; }
  .thumb-name, .thumb-status { font-size: 9px; }
}
