/* one look only: black, like the brief says. Warm off-white type, rust as the single accent. */
:root {
  --bg: #000;
  --fg: #e9e6df;
  --dim: #7d7a74;
  --line: #2a2926;
  --rust: #c8683a;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fg); }

/* ---- home ---------------------------------------------------------------- */

.home main {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 16px;
}

#cube {
  width: min(82vmin, 780px);
  height: min(82vmin, 780px);
  display: block;
  object-fit: contain;
  user-select: none;
  /* the render's floor light fades into the page instead of stopping at the picture's edge */
  -webkit-mask-image: radial-gradient(closest-side, #000 74%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 74%, transparent 100%);
}

h1 {
  margin: 0;
  font-size: clamp(13px, 2.1vw, 19px);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-align: center;
  padding-left: 0.32em;
}

.now { margin: -14px 0 0; font-size: 12px; letter-spacing: 0.32em; color: var(--fg); text-align: center; }
.now span { color: #ccff00; margin-left: 0.6em; }

.joke { max-width: 560px; text-align: center; font-size: 14px; line-height: 1.7; color: var(--dim); }
.joke p { margin: 0 0 10px; }
.joke .punch { color: #ccff00; font-size: 15px; letter-spacing: 0.24em; margin-top: 16px; }

.stats { margin: 0; max-width: 760px; text-align: center; font-size: 11px; letter-spacing: 0.3em; line-height: 2;
         color: var(--dim); }
.stats b { color: #ccff00; font-weight: 500; }

.ones { display: grid; grid-template-columns: repeat(4, minmax(0, 150px)); gap: 10px; margin-top: 8px; }
@media (max-width: 640px) { .ones { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; } }
.ones button { background: #050505; border: 1px solid var(--line); padding: 0; cursor: pointer; color: var(--dim);
               font: inherit; text-align: left; }
.ones button img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.ones button span { display: block; padding: 7px 8px 8px; font-size: 10px; letter-spacing: 0.18em; }
.ones button.on { border-color: #ccff00; color: var(--fg); }
.ones button:hover { border-color: var(--fg); }
.more { margin: 0 0 40px; font-size: 11px; letter-spacing: 0.2em; color: var(--dim); }
.cta {
  font-size: 12px;
  letter-spacing: 0.42em;
  padding: 0 0 5px 0.42em;
  text-decoration: none;
  border-bottom: 1px solid #3a3935;
  transition: border-color 0.2s;
}
.cta:hover, .cta:focus-visible { border-color: var(--fg); outline: none; }

/* ---- pile ---------------------------------------------------------------- */

.pile header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px 16px 18px;
  font-size: 12px;
  letter-spacing: 0.32em;
}
.pile header a { text-decoration: none; color: var(--dim); }
.pile header a:hover { color: var(--fg); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2px;
  padding: 0 2px 2px;
}

.tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: #050505;
  overflow: hidden;
  border: 0;
  padding: 0;
  cursor: zoom-in;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.tile:hover img, .tile:focus-visible img { transform: scale(1.06); }
.tile span {
  position: absolute;
  left: 8px;
  bottom: 7px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--fg);
  opacity: 0;
  transition: opacity 0.2s;
  font-family: var(--mono);
}
.tile:hover span, .tile:focus-visible span { opacity: 0.85; }
.tile:focus-visible { outline: 1px solid var(--fg); outline-offset: -1px; }
.tile.one::after {
  content: "1/1";
  position: absolute;
  top: 7px;
  right: 8px;
  font: 10px var(--mono);
  letter-spacing: 0.14em;
  color: var(--rust);
}

/* ---- viewer ---------------------------------------------------------------- */

dialog {
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: var(--fg);
}
dialog::backdrop { background: #000; }

.viewer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  height: 100%;
}
.stage {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
}
.stage.zoomed { cursor: zoom-out; }
.stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 50%;
  transition: transform 0.25s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.stage.zoomed img { transform: scale(2.6); transition: none; }

.info {
  border-left: 1px solid var(--line);
  padding: 22px 20px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
}
.info h2 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.24em;
}
.info p { color: #b9b5ad; margin: 0 0 18px; }
.info dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.info dt { color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; padding-top: 2px; }
.info dd { margin: 0; }
.info .rare { color: var(--rust); }

.controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.controls button {
  background: rgba(0, 0, 0, 0.6);
  color: var(--fg);
  border: 1px solid var(--line);
  font: 12px var(--mono);
  letter-spacing: 0.2em;
  padding: 7px 10px;
  cursor: pointer;
}
.controls button:hover, .controls button:focus-visible { border-color: var(--fg); outline: none; }

@media (max-width: 760px) {
  .viewer { grid-template-columns: 1fr; grid-template-rows: minmax(0, 62svh) auto; }
  .info { border-left: 0; border-top: 1px solid var(--line); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .tile img, .stage img { transition: none; }
}

/* ---- the opening film */
#intro { position: fixed; inset: 0; z-index: 50; background: #000; display: grid; place-items: center;
         transition: opacity 0.8s ease; }
#intro.out { opacity: 0; pointer-events: none; }
#intro[hidden] { display: none; }
#intro video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
#intro button { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); background: rgba(0, 0, 0, 0.55);
                color: var(--fg); border: 1px solid var(--line); font: 500 11px/1 var(--mono); letter-spacing: 0.28em;
                padding: 11px 14px 11px 16px; cursor: pointer; }
#intro button:hover { border-color: var(--fg); }
#sound { left: 18px; }
#sound[aria-pressed="true"] { color: #ccff00; border-color: #ccff00; }
#skip { right: 18px; }
body.filming { overflow: hidden; }
